diff --git a/.hgtags b/.hgtags index 0244212bbe4..a470c9afa31 100644 --- a/.hgtags +++ b/.hgtags @@ -216,3 +216,6 @@ f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90 2fd6acba737b01e705e1f7c33588c922a3787f13 jdk8-b92 b72ae39e1329fefae50d4690db4fde43f3841a95 jdk8-b93 0d804e3b955dce406af6a79ac1cc35c696aff7fb jdk8-b94 +49fe9c8049132647ad38837a877dd473e6c9b0e5 jdk8-b95 +ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96 +0a85476a0b9cb876d5666d45097dac68bef3fce1 jdk8-b97 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 22bffa459a6..64129189d67 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -216,3 +216,6 @@ cb51fb4789ac0b8be4056482077ddfb8f3bd3805 jdk8-b91 3a36c926a7aafa9d4a892a45ef3678e87ad8359b jdk8-b92 27c51c6e31c1ef36afa0e6efb031f9b13f26c12b jdk8-b93 50d2bde060f2a9bbbe4da0c8986e20aca61f2e2e jdk8-b94 +785d07fe38901ecc1b7e0145e53e1c3da9361fee jdk8-b95 +c156084add486f941c12d886a0b1b2854795d557 jdk8-b96 +a1c1e8bf71f354f3aec0214cf13d6668811e021d jdk8-b97 diff --git a/NewMakefile.gmk b/NewMakefile.gmk index 033183289ff..101ebe06278 100644 --- a/NewMakefile.gmk +++ b/NewMakefile.gmk @@ -68,12 +68,15 @@ else # First, find out the valid targets # Run the makefile with an arbitraty SPEC using -p -q (quiet dry-run and dump rules) to find # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. - all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \ - $(MAKE) -p -q -f common/makefiles SPEC=$(firstword $(SPEC)) | \ + all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \ + $(MAKE) -p -q -f common/makefiles/Main.gmk SPEC=$(firstword $(SPEC)) | \ grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) -$(all_phony_targets): - @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true + $(all_phony_targets): + $(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \ + $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true + + .PHONY: $(all_phony_targets) endif endif diff --git a/README-builds.html b/README-builds.html index 9a52859f8c2..5573c8cd2f1 100644 --- a/README-builds.html +++ b/README-builds.html @@ -355,12 +355,24 @@
  • Install a - Bootstrap JDK -
    + Bootstrap JDK. All OpenJDK builds require access to a previously released - JDK, this is often called a bootstrap JDK. - Currently, for this JDK release we require - JDK 7 Update 7 or newer. + JDK called the bootstrap JDK or boot JDK. + The general rule is that the bootstrap JDK + must be an instance of the previous major + release of the JDK. In addition, there may be + a requirement to use a release at or beyond a + particular update level. +
     
    + + Building JDK 8 requires use of a version + of JDK 7 that is at Update 7 or newer. JDK 8 + developers should not use JDK 8 as the boot + JDK, to ensure that JDK 8 dependencies are + not introduced into the parts of the system + that are built with JDK 7. + +
     
    The JDK 7 binaries can be downloaded from Oracle's JDK 7 download site. diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 03b088e883f..126993b5cd7 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -43,6 +43,16 @@ AC_DEFUN([ADD_JVM_ARG_IF_OK], fi ]) +# Appends a string to a path variable, only adding the : when needed. +AC_DEFUN([BASIC_APPEND_TO_PATH], +[ + if test "x[$]$1" = x; then + $1="$2" + else + $1="[$]$1:$2" + fi +]) + # This will make sure the given variable points to a full and proper # path. This means: # 1) There will be no spaces in the path. On posix platforms, @@ -351,7 +361,9 @@ fi AC_SUBST(SYS_ROOT) AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], - [search this directory for compilers and tools (for cross-compiling)])], [TOOLS_DIR=$with_tools_dir]) + [search this directory for compilers and tools (for cross-compiling)])], + [TOOLS_DIR=$with_tools_dir] +) AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], [use this directory as base for tools-dir and sys-root (for cross-compiling)])], @@ -359,17 +371,14 @@ AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], if test "x$with_sys_root" != x; then AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) fi - if test "x$with_tools_dir" != x; then - AC_MSG_ERROR([Cannot specify both --with-devkit and --with-tools-dir at the same time]) - fi - TOOLS_DIR=$with_devkit/bin + BASIC_FIXUP_PATH([with_devkit]) + BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) if test -d "$with_devkit/$host_alias/libc"; then SYS_ROOT=$with_devkit/$host_alias/libc elif test -d "$with_devkit/$host/sys-root"; then SYS_ROOT=$with_devkit/$host/sys-root fi ]) - ]) AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], @@ -612,6 +621,14 @@ AC_PATH_PROGS(READELF, [readelf greadelf]) AC_PATH_PROG(HG, hg) AC_PATH_PROG(STAT, stat) AC_PATH_PROG(TIME, time) +# Check if it's GNU time +IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` +if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes +else + IS_GNU_TIME=no +fi +AC_SUBST(IS_GNU_TIME) if test "x$OPENJDK_TARGET_OS" = "xwindows"; then BASIC_REQUIRE_PROG(COMM, comm) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index e41a488f336..1f084da68c9 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for OpenJDK jdk8. +# Generated by GNU Autoconf 2.68 for OpenJDK jdk8. # # Report bugs to . # @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -216,11 +217,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -799,6 +807,7 @@ OS_VERSION_MAJOR PKG_CONFIG CODESIGN XATTR +IS_GNU_TIME TIME STAT HG @@ -1460,7 +1469,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1896,7 +1905,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF OpenJDK configure jdk8 -generated by GNU Autoconf 2.67 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1942,7 +1951,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1980,7 +1989,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -2018,7 +2027,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_objc_try_compile @@ -2055,7 +2064,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -2092,7 +2101,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -2105,10 +2114,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2175,7 +2184,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2184,7 +2193,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel @@ -2225,7 +2234,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run @@ -2239,7 +2248,7 @@ ac_fn_cxx_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2257,7 +2266,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile @@ -2434,7 +2443,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_compute_int @@ -2480,7 +2489,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link @@ -2493,7 +2502,7 @@ ac_fn_cxx_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2548,7 +2557,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func @@ -2561,7 +2570,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2579,7 +2588,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF @@ -2587,7 +2596,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by OpenJDK $as_me jdk8, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2845,7 +2854,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -3083,6 +3092,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Also set JVM_ARG_OK to true/false depending on outcome. +# Appends a string to a path variable, only adding the : when needed. + + # This will make sure the given variable points to a full and proper # path. This means: # 1) There will be no spaces in the path. On posix platforms, @@ -3782,7 +3794,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1371547824 +DATE_WHEN_GENERATED=1373384053 ############################################################################### # @@ -3820,7 +3832,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BASENAME+set}" = set; then : +if ${ac_cv_path_BASENAME+:} false; then : $as_echo_n "(cached) " >&6 else case $BASENAME in @@ -3879,7 +3891,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BASH+set}" = set; then : +if ${ac_cv_path_BASH+:} false; then : $as_echo_n "(cached) " >&6 else case $BASH in @@ -3938,7 +3950,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CAT+set}" = set; then : +if ${ac_cv_path_CAT+:} false; then : $as_echo_n "(cached) " >&6 else case $CAT in @@ -3997,7 +4009,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHMOD+set}" = set; then : +if ${ac_cv_path_CHMOD+:} false; then : $as_echo_n "(cached) " >&6 else case $CHMOD in @@ -4056,7 +4068,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CMP+set}" = set; then : +if ${ac_cv_path_CMP+:} false; then : $as_echo_n "(cached) " >&6 else case $CMP in @@ -4115,7 +4127,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_COMM+set}" = set; then : +if ${ac_cv_path_COMM+:} false; then : $as_echo_n "(cached) " >&6 else case $COMM in @@ -4174,7 +4186,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CP+set}" = set; then : +if ${ac_cv_path_CP+:} false; then : $as_echo_n "(cached) " >&6 else case $CP in @@ -4233,7 +4245,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CPIO+set}" = set; then : +if ${ac_cv_path_CPIO+:} false; then : $as_echo_n "(cached) " >&6 else case $CPIO in @@ -4292,7 +4304,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CUT+set}" = set; then : +if ${ac_cv_path_CUT+:} false; then : $as_echo_n "(cached) " >&6 else case $CUT in @@ -4351,7 +4363,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DATE+set}" = set; then : +if ${ac_cv_path_DATE+:} false; then : $as_echo_n "(cached) " >&6 else case $DATE in @@ -4410,7 +4422,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DIFF+set}" = set; then : +if ${ac_cv_path_DIFF+:} false; then : $as_echo_n "(cached) " >&6 else case $DIFF in @@ -4469,7 +4481,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DIRNAME+set}" = set; then : +if ${ac_cv_path_DIRNAME+:} false; then : $as_echo_n "(cached) " >&6 else case $DIRNAME in @@ -4528,7 +4540,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ECHO+set}" = set; then : +if ${ac_cv_path_ECHO+:} false; then : $as_echo_n "(cached) " >&6 else case $ECHO in @@ -4587,7 +4599,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_EXPR+set}" = set; then : +if ${ac_cv_path_EXPR+:} false; then : $as_echo_n "(cached) " >&6 else case $EXPR in @@ -4646,7 +4658,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_FILE+set}" = set; then : +if ${ac_cv_path_FILE+:} false; then : $as_echo_n "(cached) " >&6 else case $FILE in @@ -4705,7 +4717,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_FIND+set}" = set; then : +if ${ac_cv_path_FIND+:} false; then : $as_echo_n "(cached) " >&6 else case $FIND in @@ -4764,7 +4776,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_HEAD+set}" = set; then : +if ${ac_cv_path_HEAD+:} false; then : $as_echo_n "(cached) " >&6 else case $HEAD in @@ -4823,7 +4835,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LN+set}" = set; then : +if ${ac_cv_path_LN+:} false; then : $as_echo_n "(cached) " >&6 else case $LN in @@ -4882,7 +4894,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LS+set}" = set; then : +if ${ac_cv_path_LS+:} false; then : $as_echo_n "(cached) " >&6 else case $LS in @@ -4941,7 +4953,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MKDIR+set}" = set; then : +if ${ac_cv_path_MKDIR+:} false; then : $as_echo_n "(cached) " >&6 else case $MKDIR in @@ -5000,7 +5012,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MKTEMP+set}" = set; then : +if ${ac_cv_path_MKTEMP+:} false; then : $as_echo_n "(cached) " >&6 else case $MKTEMP in @@ -5059,7 +5071,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MV+set}" = set; then : +if ${ac_cv_path_MV+:} false; then : $as_echo_n "(cached) " >&6 else case $MV in @@ -5118,7 +5130,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PRINTF+set}" = set; then : +if ${ac_cv_path_PRINTF+:} false; then : $as_echo_n "(cached) " >&6 else case $PRINTF in @@ -5177,7 +5189,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_RM+set}" = set; then : +if ${ac_cv_path_RM+:} false; then : $as_echo_n "(cached) " >&6 else case $RM in @@ -5236,7 +5248,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SH+set}" = set; then : +if ${ac_cv_path_SH+:} false; then : $as_echo_n "(cached) " >&6 else case $SH in @@ -5295,7 +5307,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SORT+set}" = set; then : +if ${ac_cv_path_SORT+:} false; then : $as_echo_n "(cached) " >&6 else case $SORT in @@ -5354,7 +5366,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TAIL+set}" = set; then : +if ${ac_cv_path_TAIL+:} false; then : $as_echo_n "(cached) " >&6 else case $TAIL in @@ -5413,7 +5425,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TAR+set}" = set; then : +if ${ac_cv_path_TAR+:} false; then : $as_echo_n "(cached) " >&6 else case $TAR in @@ -5472,7 +5484,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TEE+set}" = set; then : +if ${ac_cv_path_TEE+:} false; then : $as_echo_n "(cached) " >&6 else case $TEE in @@ -5531,7 +5543,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TOUCH+set}" = set; then : +if ${ac_cv_path_TOUCH+:} false; then : $as_echo_n "(cached) " >&6 else case $TOUCH in @@ -5590,7 +5602,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TR+set}" = set; then : +if ${ac_cv_path_TR+:} false; then : $as_echo_n "(cached) " >&6 else case $TR in @@ -5649,7 +5661,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_UNAME+set}" = set; then : +if ${ac_cv_path_UNAME+:} false; then : $as_echo_n "(cached) " >&6 else case $UNAME in @@ -5708,7 +5720,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_UNIQ+set}" = set; then : +if ${ac_cv_path_UNIQ+:} false; then : $as_echo_n "(cached) " >&6 else case $UNIQ in @@ -5767,7 +5779,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_WC+set}" = set; then : +if ${ac_cv_path_WC+:} false; then : $as_echo_n "(cached) " >&6 else case $WC in @@ -5826,7 +5838,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_WHICH+set}" = set; then : +if ${ac_cv_path_WHICH+:} false; then : $as_echo_n "(cached) " >&6 else case $WHICH in @@ -5885,7 +5897,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XARGS+set}" = set; then : +if ${ac_cv_path_XARGS+:} false; then : $as_echo_n "(cached) " >&6 else case $XARGS in @@ -5945,7 +5957,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -5995,7 +6007,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -6070,7 +6082,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -6149,7 +6161,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -6228,7 +6240,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -6314,7 +6326,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_NAWK+set}" = set; then : +if ${ac_cv_path_NAWK+:} false; then : $as_echo_n "(cached) " >&6 else case $NAWK in @@ -6378,7 +6390,7 @@ THEPWDCMD=pwd set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CYGPATH+set}" = set; then : +if ${ac_cv_path_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else case $CYGPATH in @@ -6418,7 +6430,7 @@ fi set dummy readlink; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_READLINK+set}" = set; then : +if ${ac_cv_path_READLINK+:} false; then : $as_echo_n "(cached) " >&6 else case $READLINK in @@ -6458,7 +6470,7 @@ fi set dummy df; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DF+set}" = set; then : +if ${ac_cv_path_DF+:} false; then : $as_echo_n "(cached) " >&6 else case $DF in @@ -6498,7 +6510,7 @@ fi set dummy SetFile; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SETFILE+set}" = set; then : +if ${ac_cv_path_SETFILE+:} false; then : $as_echo_n "(cached) " >&6 else case $SETFILE in @@ -6544,7 +6556,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -6560,7 +6572,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -6578,7 +6590,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -6593,7 +6605,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -6611,7 +6623,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : +if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then @@ -6626,7 +6638,7 @@ fi $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -7457,6 +7469,7 @@ fi # Check whether --with-tools-dir was given. if test "${with_tools_dir+set}" = set; then : withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir + fi @@ -7467,10 +7480,135 @@ if test "${with_devkit+set}" = set; then : if test "x$with_sys_root" != x; then as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 fi - if test "x$with_tools_dir" != x; then - as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5 + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$with_devkit" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" fi - TOOLS_DIR=$with_devkit/bin + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + with_devkit="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$with_devkit" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + with_devkit="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$with_devkit" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + with_devkit="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$TOOLS_DIR" = x; then + TOOLS_DIR="$with_devkit/bin" + else + TOOLS_DIR="$TOOLS_DIR:$with_devkit/bin" + fi + if test -d "$with_devkit/$host_alias/libc"; then SYS_ROOT=$with_devkit/$host_alias/libc elif test -d "$with_devkit/$host/sys-root"; then @@ -7481,7 +7619,6 @@ fi - # Setup default logging of stdout and stderr to build.log in the output root. BUILD_LOG='$(OUTPUT_ROOT)/build.log' BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' @@ -8027,7 +8164,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PKGHANDLER+set}" = set; then : +if ${ac_cv_prog_PKGHANDLER+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PKGHANDLER"; then @@ -8392,7 +8529,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then : +if ${ac_cv_path_CHECK_GMAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $CHECK_GMAKE in @@ -8746,7 +8883,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_MAKE+set}" = set; then : +if ${ac_cv_path_CHECK_MAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $CHECK_MAKE in @@ -9105,7 +9242,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then : +if ${ac_cv_path_CHECK_TOOLSDIR_GMAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $CHECK_TOOLSDIR_GMAKE in @@ -9458,7 +9595,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then : +if ${ac_cv_path_CHECK_TOOLSDIR_MAKE+:} false; then : $as_echo_n "(cached) " >&6 else case $CHECK_TOOLSDIR_MAKE in @@ -9854,7 +9991,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_UNZIP+set}" = set; then : +if ${ac_cv_path_UNZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $UNZIP in @@ -9913,7 +10050,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ZIP+set}" = set; then : +if ${ac_cv_path_ZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $ZIP in @@ -9972,7 +10109,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} set dummy ldd; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LDD+set}" = set; then : +if ${ac_cv_path_LDD+:} false; then : $as_echo_n "(cached) " >&6 else case $LDD in @@ -10018,7 +10155,7 @@ fi set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_OTOOL+set}" = set; then : +if ${ac_cv_path_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $OTOOL in @@ -10063,7 +10200,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_READELF+set}" = set; then : +if ${ac_cv_path_READELF+:} false; then : $as_echo_n "(cached) " >&6 else case $READELF in @@ -10106,7 +10243,7 @@ done set dummy hg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_HG+set}" = set; then : +if ${ac_cv_path_HG+:} false; then : $as_echo_n "(cached) " >&6 else case $HG in @@ -10146,7 +10283,7 @@ fi set dummy stat; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_STAT+set}" = set; then : +if ${ac_cv_path_STAT+:} false; then : $as_echo_n "(cached) " >&6 else case $STAT in @@ -10186,7 +10323,7 @@ fi set dummy time; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TIME+set}" = set; then : +if ${ac_cv_path_TIME+:} false; then : $as_echo_n "(cached) " >&6 else case $TIME in @@ -10222,6 +10359,14 @@ $as_echo "no" >&6; } fi +# Check if it's GNU time +IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` +if test "x$IS_GNU_TIME" != x; then + IS_GNU_TIME=yes +else + IS_GNU_TIME=no +fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then @@ -10231,7 +10376,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_COMM+set}" = set; then : +if ${ac_cv_path_COMM+:} false; then : $as_echo_n "(cached) " >&6 else case $COMM in @@ -10293,7 +10438,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XATTR+set}" = set; then : +if ${ac_cv_path_XATTR+:} false; then : $as_echo_n "(cached) " >&6 else case $XATTR in @@ -10349,7 +10494,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} set dummy codesign; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CODESIGN+set}" = set; then : +if ${ac_cv_path_CODESIGN+:} false; then : $as_echo_n "(cached) " >&6 else case $CODESIGN in @@ -10413,7 +10558,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -10456,7 +10601,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -10629,7 +10774,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then : +if ${ac_cv_prog_BDEPS_UNZIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BDEPS_UNZIP"; then @@ -10675,7 +10820,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then : +if ${ac_cv_prog_BDEPS_FTP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BDEPS_FTP"; then @@ -11971,7 +12116,7 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } set dummy javac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVAC_CHECK+set}" = set; then : +if ${ac_cv_path_JAVAC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC_CHECK in @@ -12011,7 +12156,7 @@ fi set dummy java; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVA_CHECK+set}" = set; then : +if ${ac_cv_path_JAVA_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVA_CHECK in @@ -16340,7 +16485,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JTREGEXE+set}" = set; then : +if ${ac_cv_path_JTREGEXE+:} false; then : $as_echo_n "(cached) " >&6 else case $JTREGEXE in @@ -16408,7 +16553,7 @@ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then set dummy link; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CYGWIN_LINK+set}" = set; then : +if ${ac_cv_path_CYGWIN_LINK+:} false; then : $as_echo_n "(cached) " >&6 else case $CYGWIN_LINK in @@ -17182,6 +17327,8 @@ $as_echo "ok" >&6; } # Remove any trailing \ from INCLUDE and LIB to avoid trouble in spec.gmk. VS_INCLUDE=`$ECHO "$INCLUDE" | $SED 's/\\\\$//'` VS_LIB=`$ECHO "$LIB" | $SED 's/\\\\$//'` + # Remove any paths containing # (typically F#) as that messes up make + PATH=`$ECHO "$PATH" | $SED 's/[^:#]*#[^:]*://g'` VS_PATH="$PATH" @@ -17849,7 +17996,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BUILD_CC+set}" = set; then : +if ${ac_cv_path_BUILD_CC+:} false; then : $as_echo_n "(cached) " >&6 else case $BUILD_CC in @@ -18160,7 +18307,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BUILD_CXX+set}" = set; then : +if ${ac_cv_path_BUILD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else case $BUILD_CXX in @@ -18469,7 +18616,7 @@ $as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} set dummy ld; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BUILD_LD+set}" = set; then : +if ${ac_cv_path_BUILD_LD+:} false; then : $as_echo_n "(cached) " >&6 else case $BUILD_LD in @@ -18933,15 +19080,6 @@ $as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_serve fi -if test "x$SYS_ROOT" != "x/" ; then - CFLAGS="--sysroot=$SYS_ROOT $CFLAGS" - CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS" - OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" - OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" - CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS" - LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS" -fi - # Store the CFLAGS etal passed to the configure script. ORG_CFLAGS="$CFLAGS" ORG_CXXFLAGS="$CXXFLAGS" @@ -18985,7 +19123,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TOOLS_DIR_CC+set}" = set; then : +if ${ac_cv_path_TOOLS_DIR_CC+:} false; then : $as_echo_n "(cached) " >&6 else case $TOOLS_DIR_CC in @@ -19037,7 +19175,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_POTENTIAL_CC+set}" = set; then : +if ${ac_cv_path_POTENTIAL_CC+:} false; then : $as_echo_n "(cached) " >&6 else case $POTENTIAL_CC in @@ -19450,7 +19588,7 @@ $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then : +if ${ac_cv_prog_PROPER_COMPILER_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PROPER_COMPILER_CC"; then @@ -19494,7 +19632,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_PROPER_COMPILER_CC"; then @@ -19892,7 +20030,7 @@ $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\ elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` @@ -19944,7 +20082,7 @@ if test -n "$ac_tool_prefix"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -19988,7 +20126,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -20041,7 +20179,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -20156,7 +20294,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20199,7 +20337,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -20258,7 +20396,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -20269,7 +20407,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20310,7 +20448,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -20320,7 +20458,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20357,7 +20495,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -20435,7 +20573,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -20558,7 +20696,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_TOOLS_DIR_CXX+set}" = set; then : +if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then : $as_echo_n "(cached) " >&6 else case $TOOLS_DIR_CXX in @@ -20610,7 +20748,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then : +if ${ac_cv_path_POTENTIAL_CXX+:} false; then : $as_echo_n "(cached) " >&6 else case $POTENTIAL_CXX in @@ -21023,7 +21161,7 @@ $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then : +if ${ac_cv_prog_PROPER_COMPILER_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PROPER_COMPILER_CXX"; then @@ -21067,7 +21205,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_PROPER_COMPILER_CXX"; then @@ -21465,7 +21603,7 @@ $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\ elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` @@ -21521,7 +21659,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -21565,7 +21703,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -21643,7 +21781,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21680,7 +21818,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -21778,7 +21916,7 @@ if test -n "$ac_tool_prefix"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJC+set}" = set; then : +if ${ac_cv_prog_OBJC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJC"; then @@ -21822,7 +21960,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJC"; then @@ -21898,7 +22036,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Objective C compiler" >&5 $as_echo_n "checking whether we are using the GNU Objective C compiler... " >&6; } -if test "${ac_cv_objc_compiler_gnu+set}" = set; then : +if ${ac_cv_objc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21935,7 +22073,7 @@ ac_test_OBJCFLAGS=${OBJCFLAGS+set} ac_save_OBJCFLAGS=$OBJCFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5 $as_echo_n "checking whether $OBJC accepts -g... " >&6; } -if test "${ac_cv_prog_objc_g+set}" = set; then : +if ${ac_cv_prog_objc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_objc_werror_flag=$ac_objc_werror_flag @@ -22311,7 +22449,7 @@ if test "x$OPENJDK_TARGET_OS" != xwindows; then set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -22351,7 +22489,7 @@ if test -z "$ac_cv_prog_AR"; then set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -22693,7 +22831,7 @@ if test "x$OPENJDK_TARGET_OS" = xwindows; then : set dummy link; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_WINLD+set}" = set; then : +if ${ac_cv_prog_WINLD+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WINLD"; then @@ -23032,7 +23170,7 @@ $as_echo "yes" >&6; } set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MT+set}" = set; then : +if ${ac_cv_prog_MT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MT"; then @@ -23353,7 +23491,7 @@ $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;} set dummy rc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RC+set}" = set; then : +if ${ac_cv_prog_RC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RC"; then @@ -23725,26 +23863,27 @@ $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} RC_FLAGS="$RC_FLAGS -d NDEBUG" fi - JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION - if test "x$JDK_UPDATE_VERSION" = x; then : - JDK_UPDATE_VERSION_NOTNULL=0 - -fi - RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\"" + # The version variables used to create RC_FLAGS may be overridden + # in a custom configure script, or possibly the command line. + # Let those variables be expanded at make time in spec.gmk. + # The \$ are escaped to the shell, and the $(...) variables + # are evaluated by make. + RC_FLAGS="$RC_FLAGS \ + -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ + -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ + -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ + -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ + -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ + -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ + -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" # lib.exe is used to create static libraries. # Extract the first word of "lib", so it can be a program name with args. set dummy lib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_WINAR+set}" = set; then : +if ${ac_cv_prog_WINAR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WINAR"; then @@ -24050,7 +24189,7 @@ $as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;} set dummy dumpbin; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -24369,7 +24508,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -24485,7 +24624,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp @@ -24769,7 +24908,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -24885,7 +25024,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp @@ -25187,7 +25326,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_AS+set}" = set; then : +if ${ac_cv_path_AS+:} false; then : $as_echo_n "(cached) " >&6 else case $AS in @@ -25499,7 +25638,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then set dummy nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_NM+set}" = set; then : +if ${ac_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else case $NM in @@ -25805,7 +25944,7 @@ $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} set dummy gnm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GNM+set}" = set; then : +if ${ac_cv_path_GNM+:} false; then : $as_echo_n "(cached) " >&6 else case $GNM in @@ -26111,7 +26250,7 @@ $as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_STRIP+set}" = set; then : +if ${ac_cv_path_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else case $STRIP in @@ -26417,7 +26556,7 @@ $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} set dummy mcs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MCS+set}" = set; then : +if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else case $MCS in @@ -26725,7 +26864,7 @@ elif test "x$OPENJDK_TARGET_OS" != xwindows; then set dummy ${ac_tool_prefix}nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NM+set}" = set; then : +if ${ac_cv_prog_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -26765,7 +26904,7 @@ if test -z "$ac_cv_prog_NM"; then set dummy nm; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then : +if ${ac_cv_prog_ac_ct_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then @@ -27085,7 +27224,7 @@ $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -27125,7 +27264,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -27450,7 +27589,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJCOPY+set}" = set; then : +if ${ac_cv_prog_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJCOPY"; then @@ -27494,7 +27633,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJCOPY"; then @@ -27821,7 +27960,7 @@ if test -n "$ac_tool_prefix"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -27865,7 +28004,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -28189,7 +28328,7 @@ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LIPO+set}" = set; then : +if ${ac_cv_path_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else case $LIPO in @@ -28506,7 +28645,7 @@ PATH="$OLD_PATH" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28683,7 +28822,7 @@ fi for ac_header in stdio.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" -if test "x$ac_cv_header_stdio_h" = x""yes; then : +if test "x$ac_cv_header_stdio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDIO_H 1 _ACEOF @@ -28712,7 +28851,7 @@ done # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 $as_echo_n "checking size of int *... " >&6; } -if test "${ac_cv_sizeof_int_p+set}" = set; then : +if ${ac_cv_sizeof_int_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : @@ -28722,7 +28861,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int *) -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int_p=0 fi @@ -28769,7 +28908,7 @@ $as_echo "$OPENJDK_TARGET_CPU_BITS bits" >&6; } # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown @@ -29945,8 +30084,8 @@ if test "x$with_x" = xno; then have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. @@ -30223,7 +30362,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30257,14 +30396,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30298,7 +30437,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi @@ -30317,14 +30456,14 @@ rm -f core conftest.err conftest.$ac_objext \ # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = x""yes; then : +if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30358,14 +30497,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30399,7 +30538,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -30414,14 +30553,14 @@ fi # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_cxx_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = x""yes; then : +if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_connect+set}" = set; then : +if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30455,7 +30594,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = x""yes; then : +if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi @@ -30463,14 +30602,14 @@ fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_cxx_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = x""yes; then : +if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } -if test "${ac_cv_lib_posix_remove+set}" = set; then : +if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30504,7 +30643,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = x""yes; then : +if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi @@ -30512,14 +30651,14 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_cxx_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = x""yes; then : +if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } -if test "${ac_cv_lib_ipc_shmat+set}" = set; then : +if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30553,7 +30692,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -30571,7 +30710,7 @@ fi # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -30605,7 +30744,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -31623,7 +31762,7 @@ $as_echo "$FREETYPE2_FOUND" >&6; } LDFLAGS="$FREETYPE2_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 $as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } -if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then : +if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -31657,7 +31796,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 $as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then : +if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : FREETYPE2_FOUND=true else as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 @@ -31945,7 +32084,7 @@ fi for ac_header in alsa/asoundlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" -if test "x$ac_cv_header_alsa_asoundlib_h" = x""yes; then : +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ALSA_ASOUNDLIB_H 1 _ACEOF @@ -32004,7 +32143,7 @@ fi USE_EXTERNAL_LIBJPEG=true { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 $as_echo_n "checking for main in -ljpeg... " >&6; } -if test "${ac_cv_lib_jpeg_main+set}" = set; then : +if ${ac_cv_lib_jpeg_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -32032,7 +32171,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5 $as_echo "$ac_cv_lib_jpeg_main" >&6; } -if test "x$ac_cv_lib_jpeg_main" = x""yes; then : +if test "x$ac_cv_lib_jpeg_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF @@ -32081,7 +32220,7 @@ if test "x${with_giflib}" = "xbundled"; then USE_EXTERNAL_LIBGIF=false elif test "x${with_giflib}" = "xsystem"; then ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_gif_lib_h" = x""yes; then : +if test "x$ac_cv_header_gif_lib_h" = xyes; then : else as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5 @@ -32090,7 +32229,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5 $as_echo_n "checking for DGifGetCode in -lgif... " >&6; } -if test "${ac_cv_lib_gif_DGifGetCode+set}" = set; then : +if ${ac_cv_lib_gif_DGifGetCode+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -32124,7 +32263,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5 $as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; } -if test "x$ac_cv_lib_gif_DGifGetCode" = x""yes; then : +if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGIF 1 _ACEOF @@ -32156,7 +32295,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 $as_echo_n "checking for compress in -lz... " >&6; } -if test "${ac_cv_lib_z_compress+set}" = set; then : +if ${ac_cv_lib_z_compress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -32190,7 +32329,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 $as_echo "$ac_cv_lib_z_compress" >&6; } -if test "x$ac_cv_lib_z_compress" = x""yes; then : +if test "x$ac_cv_lib_z_compress" = xyes; then : ZLIB_FOUND=yes else ZLIB_FOUND=no @@ -32283,7 +32422,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } -if test "${ac_cv_lib_m_cos+set}" = set; then : +if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -32317,7 +32456,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = x""yes; then : +if test "x$ac_cv_lib_m_cos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -32341,7 +32480,7 @@ save_LIBS="$LIBS" LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -32375,7 +32514,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -32605,7 +32744,7 @@ and LIBFFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else LIBFFI_CFLAGS=$pkg_cv_LIBFFI_CFLAGS LIBFFI_LIBS=$pkg_cv_LIBFFI_LIBS @@ -32621,7 +32760,7 @@ if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then set dummy llvm-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LLVM_CONFIG+set}" = set; then : +if ${ac_cv_prog_LLVM_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LLVM_CONFIG"; then @@ -33237,7 +33376,7 @@ fi set dummy ccache; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CCACHE+set}" = set; then : +if ${ac_cv_path_CCACHE+:} false; then : $as_echo_n "(cached) " >&6 else case $CCACHE in @@ -33499,10 +33638,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -33534,7 +33684,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -33635,6 +33785,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -33942,7 +34093,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by OpenJDK $as_me jdk8, which was -generated by GNU Autoconf 2.67. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -34005,7 +34156,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ OpenJDK config.status jdk8 -configured by $0, generated by GNU Autoconf 2.67, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -34134,7 +34285,7 @@ do "$OUTPUT_ROOT/spec.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" ;; "$OUTPUT_ROOT/Makefile") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -34156,9 +34307,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -34166,12 +34318,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -34193,7 +34346,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -34221,7 +34374,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -34269,7 +34422,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -34301,7 +34454,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -34335,7 +34488,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -34347,8 +34500,8 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -34449,7 +34602,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -34468,7 +34621,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -34477,7 +34630,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -34503,8 +34656,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -34629,21 +34782,22 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -34654,20 +34808,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ + mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 272a003673f..c30fd35dc18 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -510,6 +510,7 @@ TAR:=@TAR@ TAIL:=@TAIL@ TEE:=@TEE@ TIME:=@TIME@ +IS_GNU_TIME:=@IS_GNU_TIME@ TR:=@TR@ TOUCH:=@TOUCH@ UNIQ:=@UNIQ@ diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 10d7728cc33..b2b367f63c2 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -47,7 +47,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"` COMPILER_VENDOR="Microsoft CL.EXE" COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` @@ -226,15 +226,6 @@ BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, ], []) -if test "x$SYS_ROOT" != "x/" ; then - CFLAGS="--sysroot=$SYS_ROOT $CFLAGS" - CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS" - OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" - OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" - CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS" - LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS" -fi - # Store the CFLAGS etal passed to the configure script. ORG_CFLAGS="$CFLAGS" ORG_CXXFLAGS="$CXXFLAGS" @@ -378,17 +369,20 @@ AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ AS_IF([test "x$VARIANT" = xOPT], [ RC_FLAGS="$RC_FLAGS -d NDEBUG" ]) - JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION - AS_IF([test "x$JDK_UPDATE_VERSION" = x], [ - JDK_UPDATE_VERSION_NOTNULL=0 - ]) - RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\"" - RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\"" + + # The version variables used to create RC_FLAGS may be overridden + # in a custom configure script, or possibly the command line. + # Let those variables be expanded at make time in spec.gmk. + # The \$ are escaped to the shell, and the $(...) variables + # are evaluated by make. + RC_FLAGS="$RC_FLAGS \ + -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ + -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ + -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ + -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ + -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ + -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ + -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" # lib.exe is used to create static libraries. AC_CHECK_PROG([WINAR], [lib],[lib],,,) diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4 index 966c0133995..e5d4fff38f9 100644 --- a/common/autoconf/toolchain_windows.m4 +++ b/common/autoconf/toolchain_windows.m4 @@ -208,6 +208,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], # Remove any trailing \ from INCLUDE and LIB to avoid trouble in spec.gmk. VS_INCLUDE=`$ECHO "$INCLUDE" | $SED 's/\\\\$//'` VS_LIB=`$ECHO "$LIB" | $SED 's/\\\\$//'` + # Remove any paths containing # (typically F#) as that messes up make + PATH=`$ECHO "$PATH" | $SED 's/[[^:#]]*#[^:]*://g'` VS_PATH="$PATH" AC_SUBST(VS_INCLUDE) AC_SUBST(VS_LIB) diff --git a/common/makefiles/JavaCompilation.gmk b/common/makefiles/JavaCompilation.gmk index 4301cee1f0b..50b05865f00 100644 --- a/common/makefiles/JavaCompilation.gmk +++ b/common/makefiles/JavaCompilation.gmk @@ -155,7 +155,7 @@ define SetupArchive # lines, but not here for use in make dependencies. $1_DEPS+=$$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) ifeq (,$$($1_SKIP_METAINF)) - $1_DEPS+=$$(call CacheFind $$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) + $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) endif endif @@ -255,12 +255,21 @@ define SetupZipArchive $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) + # To avoid running find over too large sets of files, which causes make to crash + # on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set + # of directories to run find in, if available. + ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),) + $1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC),\ + $$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES)))) + else + $1_FIND_LIST := $$($1_SRC) + endif + # Find all files in the source tree. $1_ALL_SRCS := $$(call not-containing,_the.,\ - $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind $$($1_SRC)))) + $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST)))) ifneq ($$($1_INCLUDES),) - $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES)))) ifneq ($$($1_SUFFIXES),) $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\ $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES)))) @@ -269,12 +278,8 @@ define SetupZipArchive endif endif ifneq ($$($1_INCLUDE_FILES),) - $1_SRC_INCLUDES += $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) $1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES)) endif - ifneq ($$($1_SRC_INCLUDES),) - $1_ALL_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_SRCS)) - endif ifneq ($$($1_EXCLUDES),) $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) diff --git a/common/makefiles/Main.gmk b/common/makefiles/Main.gmk index 0120c1f33f3..1214ce56427 100644 --- a/common/makefiles/Main.gmk +++ b/common/makefiles/Main.gmk @@ -183,7 +183,7 @@ bootcycle-images-only: start-make test: images test-only test-only: start-make @$(call TargetEnter) - @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k JT_HOME=$(JT_HOME) MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true + @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true @$(call TargetExit) # Stores the tips for each repository. This file is be used when constructing the jdk image and can be @@ -192,7 +192,7 @@ source-tips: $(OUTPUT_ROOT)/source_tips $(OUTPUT_ROOT)/source_tips: FRC @$(MKDIR) -p $(@D) @$(RM) $@ - @$(if $(HG),$(call GetSourceTips),$(ECHO) "hg not installed" > $@) + @$(call GetSourceTips) # Remove everything, except the output from configure. diff --git a/common/makefiles/MakeBase.gmk b/common/makefiles/MakeBase.gmk index 98a56f86cd1..d2bf4aaabee 100644 --- a/common/makefiles/MakeBase.gmk +++ b/common/makefiles/MakeBase.gmk @@ -332,9 +332,11 @@ define SetupLogging # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make # For each target executed, will print # Building (from ) ( newer) - # but with a limit of 20 on , to avoid cluttering logs too much (and causing a crash on Cygwin). - OLD_SHELL:=$$(SHELL) - WRAPPER_SHELL:=$$(OLD_SHELL) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(TIME),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(OLD_SHELL) + # but with a limit of 20 on , to avoid cluttering logs too much + # (and causing a crash on Cygwin). + # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris. + # Only use time if it's GNU time which supports format and output file. + WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) endif # Never remove warning messages; this is just for completeness diff --git a/corba/.hgtags b/corba/.hgtags index 3a3e0a8a776..28f0b92d88b 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -216,3 +216,6 @@ c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90 717aa26f8e0a1c0e768aebb3a763aca56db0c83e jdk8-b92 8dc9d7ccbb2d77fd89bc321bb02e67c152aca257 jdk8-b93 22f5d7f261d9d61a953d2d9a53f2e9ce0ca361d1 jdk8-b94 +2cf36f43df36137980d9828cec27003ec10daeee jdk8-b95 +3357c2776431d51a8de326a85e0f41420e40774f jdk8-b96 +469995a8e97424f450c880606d689bf345277b19 jdk8-b97 diff --git a/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk b/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk index 465c546ec59..d007b4e374c 100644 --- a/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk +++ b/corba/make/com/sun/corba/minclude/com_sun_corba_se_impl_orbutil.jmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ com_sun_corba_se_impl_orbutil_java = \ com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java \ com/sun/corba/se/impl/orbutil/ORBConstants.java \ com/sun/corba/se/impl/orbutil/ORBUtility.java \ - com/sun/corba/se/impl/orbutil/ORBClassLoader.java \ com/sun/corba/se/impl/orbutil/RepIdDelegator.java \ com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \ com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \ diff --git a/corba/src/share/classes/com/sun/corba/se/impl/activation/ServerManagerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/activation/ServerManagerImpl.java index 4fde9aad06a..745f0aafadb 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/activation/ServerManagerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/activation/ServerManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,6 @@ import com.sun.corba.se.impl.logging.ActivationSystemException ; import com.sun.corba.se.impl.oa.poa.BadServerIdHandler; import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.orbutil.ORBUtility; import com.sun.corba.se.impl.util.Utility; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java index 0177bdd6407..3018cdef99e 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ package com.sun.corba.se.impl.corba; import java.io.Serializable; import java.math.BigDecimal; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.List ; import java.util.ArrayList ; @@ -504,7 +506,13 @@ public class AnyImpl extends Any public org.omg.CORBA.portable.OutputStream create_output_stream() { //debug.log ("create_output_stream"); - return new AnyOutputStream(orb); + final ORB finalorb = this.orb; + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public AnyOutputStream run() { + return new AnyOutputStream(finalorb); + } + }); } /** diff --git a/corba/src/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java index 7e926ddba63..4e90f7f2a32 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/TypeCodeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -600,7 +600,8 @@ public final class TypeCodeImpl extends TypeCode } public static CDROutputStream newOutputStream(ORB orb) { - TypeCodeOutputStream tcos = new TypeCodeOutputStream((ORB)orb); + TypeCodeOutputStream tcos = + sun.corba.OutputStreamFactory.newTypeCodeOutputStream(orb); //if (debug) System.out.println("Created TypeCodeOutputStream " + tcos + // " with no parent"); return tcos; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java index b26d2db2214..6914e0ec87a 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/IDLJavaSerializationOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ import org.omg.CORBA.CompletionStatus; * * @author Ram Jeyaraman */ -public class IDLJavaSerializationOutputStream extends CDROutputStreamBase { +final class IDLJavaSerializationOutputStream extends CDROutputStreamBase { private ORB orb; private byte encodingVersion; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java index 79139f15de6..94f6466013a 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/TypeCodeOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -196,7 +196,8 @@ public final class TypeCodeOutputStream extends EncapsOutputStream } public TypeCodeOutputStream createEncapsulation(org.omg.CORBA.ORB _orb) { - TypeCodeOutputStream encap = new TypeCodeOutputStream((ORB)_orb, isLittleEndian()); + TypeCodeOutputStream encap = + sun.corba.OutputStreamFactory.newTypeCodeOutputStream((ORB)_orb, isLittleEndian()); encap.setEnclosingOutputStream(this); encap.makeEncapsulation(); //if (TypeCodeImpl.debug) System.out.println("Created TypeCodeOutputStream " + encap + " with parent " + this); @@ -211,7 +212,8 @@ public final class TypeCodeOutputStream extends EncapsOutputStream public static TypeCodeOutputStream wrapOutputStream(OutputStream os) { boolean littleEndian = ((os instanceof CDROutputStream) ? ((CDROutputStream)os).isLittleEndian() : false); - TypeCodeOutputStream tos = new TypeCodeOutputStream((ORB)os.orb(), littleEndian); + TypeCodeOutputStream tos = + sun.corba.OutputStreamFactory.newTypeCodeOutputStream((ORB)os.orb(), littleEndian); tos.setEnclosingOutputStream(os); //if (TypeCodeImpl.debug) System.out.println("Created TypeCodeOutputStream " + tos + " with parent " + os); return tos; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java index 2b3e0fae116..6f469e2dc7d 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/CDREncapsCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -155,7 +155,8 @@ public final class CDREncapsCodec // be versioned. This can be handled once this work is complete. // Create output stream with default endianness. - EncapsOutputStream cdrOut = new EncapsOutputStream( + EncapsOutputStream cdrOut = + sun.corba.OutputStreamFactory.newEncapsOutputStream( (com.sun.corba.se.spi.orb.ORB)orb, giopVersion ); // This is an encapsulation, so put out the endian: diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java index e7d7ae27e76..9ad417e464e 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/PIHandlerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,6 @@ import com.sun.corba.se.impl.logging.InterceptorsSystemException; import com.sun.corba.se.impl.logging.ORBUtilSystemException; import com.sun.corba.se.impl.logging.OMGSystemException; import com.sun.corba.se.impl.corba.RequestImpl; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.orbutil.ORBConstants; import com.sun.corba.se.impl.orbutil.ORBUtility; import com.sun.corba.se.impl.orbutil.StackImpl; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java index a20de7a3af0..52e457f2220 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/RequestInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,13 +86,14 @@ import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; import com.sun.corba.se.impl.encoding.EncapsOutputStream; import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.util.RepositoryId; import com.sun.corba.se.impl.logging.InterceptorsSystemException; import com.sun.corba.se.impl.logging.OMGSystemException; +import sun.corba.SharedSecrets; + /** * Implementation of the RequestInfo interface as specified in * orbos/99-12-02 section 5.4.1. @@ -452,7 +453,8 @@ public abstract class RequestInfoImpl // Find the read method on the helper class: String helperClassName = className + "Helper"; - Class helperClass = ORBClassLoader.loadClass( helperClassName ); + Class helperClass = + SharedSecrets.getJavaCorbaAccess().loadClass( helperClassName ); Class[] readParams = new Class[1]; readParams[0] = org.omg.CORBA.portable.InputStream.class; Method readMethod = helperClass.getMethod( "read", readParams ); @@ -512,7 +514,8 @@ public abstract class RequestInfoImpl Class exceptionClass = userException.getClass(); String className = exceptionClass.getName(); String helperClassName = className + "Helper"; - Class helperClass = ORBClassLoader.loadClass( helperClassName ); + Class helperClass = + SharedSecrets.getJavaCorbaAccess().loadClass( helperClassName ); // Find insert( Any, class ) method Class[] insertMethodParams = new Class[2]; @@ -656,7 +659,8 @@ public abstract class RequestInfoImpl // Convert the "core" service context to an // "IOP" ServiceContext by writing it to a // CDROutputStream and reading it back. - EncapsOutputStream out = new EncapsOutputStream(myORB); + EncapsOutputStream out = + sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB); context.write( out, GIOPVersion.V1_2 ); InputStream inputStream = out.create_input_stream(); @@ -692,8 +696,8 @@ public abstract class RequestInfoImpl { int id = 0 ; // Convert IOP.service_context to core.ServiceContext: - EncapsOutputStream outputStream = new EncapsOutputStream( - myORB ); + EncapsOutputStream outputStream = + sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB); InputStream inputStream = null; UnknownServiceContext coreServiceContext = null; ServiceContextHelper.write( outputStream, service_context ); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java index 9f7008a16f8..b8afc9ce839 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java @@ -300,11 +300,11 @@ public class IIOPInputStream resetStream(); } - public final void setOrbStream(org.omg.CORBA_2_3.portable.InputStream os) { + final void setOrbStream(org.omg.CORBA_2_3.portable.InputStream os) { orbStream = os; } - public final org.omg.CORBA_2_3.portable.InputStream getOrbStream() { + final org.omg.CORBA_2_3.portable.InputStream getOrbStream() { return orbStream; } @@ -327,11 +327,11 @@ public class IIOPInputStream return (javax.rmi.CORBA.ValueHandler) vhandler; } - public final void increaseRecursionDepth(){ + final void increaseRecursionDepth(){ recursionDepth++; } - public final int decreaseRecursionDepth(){ + final int decreaseRecursionDepth(){ return --recursionDepth; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java index 9cf6afd6dbb..1ca9e118cfd 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/IIOPOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,19 +124,19 @@ public class IIOPOutputStream } } - public final void setOrbStream(org.omg.CORBA_2_3.portable.OutputStream os) { + final void setOrbStream(org.omg.CORBA_2_3.portable.OutputStream os) { orbStream = os; } - public final org.omg.CORBA_2_3.portable.OutputStream getOrbStream() { + final org.omg.CORBA_2_3.portable.OutputStream getOrbStream() { return orbStream; } - public final void increaseRecursionDepth(){ + final void increaseRecursionDepth(){ recursionDepth++; } - public final int decreaseRecursionDepth(){ + final int decreaseRecursionDepth(){ return --recursionDepth; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java b/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java index a55f0020adb..f8dcbe5b6d8 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/InputStreamHook.java @@ -251,7 +251,7 @@ public abstract class InputStreamHook extends ObjectInputStream } protected abstract byte getStreamFormatVersion(); - protected abstract org.omg.CORBA_2_3.portable.InputStream getOrbStream(); + abstract org.omg.CORBA_2_3.portable.InputStream getOrbStream(); // Description of possible actions protected static class ReadObjectState { diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java b/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java index d596accfb49..a40b007bac5 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java @@ -179,7 +179,7 @@ public abstract class OutputStreamHook extends ObjectOutputStream putFields.write(this); } - public abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream(); + abstract org.omg.CORBA_2_3.portable.OutputStream getOrbStream(); protected abstract void beginOptionalCustomData(); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java index 41d85a265fc..20cec8d7b30 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ValueUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,6 +98,14 @@ public class ValueUtility { public ValueHandlerImpl newValueHandlerImpl() { return ValueHandlerImpl.getInstance(); } + public Class loadClass(String className) throws ClassNotFoundException { + if (Thread.currentThread().getContextClassLoader() != null) { + return Thread.currentThread().getContextClassLoader(). + loadClass(className); + } else { + return ClassLoader.getSystemClassLoader().loadClass(className); + } + } }); } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java index 9071fc0c5aa..1d0f3c457f4 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/EncapsulationUtility.java @@ -128,7 +128,8 @@ public class EncapsulationUtility static public void writeEncapsulation( WriteContents obj, OutputStream os ) { - EncapsOutputStream out = new EncapsOutputStream( (ORB)os.orb() ) ; + EncapsOutputStream out = + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)os.orb()); out.putEndian() ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java index 1d43402e668..b715dce5a39 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,7 +95,8 @@ public class GenericTaggedProfile extends GenericIdentifiable implements TaggedP public org.omg.IOP.TaggedProfile getIOPProfile() { - EncapsOutputStream os = new EncapsOutputStream( orb ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream(orb); write( os ) ; InputStream is = (InputStream)(os.create_input_stream()) ; return org.omg.IOP.TaggedProfileHelper.read( is ) ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/IORImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/IORImpl.java index 8cd6fa271f0..8c531d0933a 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/IORImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/IORImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,7 +213,8 @@ public class IORImpl extends IdentifiableContainerBase implements IOR { StringWriter bs; - MarshalOutputStream s = new EncapsOutputStream(factory); + MarshalOutputStream s = + sun.corba.OutputStreamFactory.newEncapsOutputStream(factory); s.putEndian(); write( (OutputStream)s ); bs = new StringWriter(); @@ -237,7 +238,8 @@ public class IORImpl extends IdentifiableContainerBase implements IOR } public org.omg.IOP.IOR getIOPIOR() { - EncapsOutputStream os = new EncapsOutputStream(factory); + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream(factory); write(os); InputStream is = (InputStream) (os.create_input_stream()); return org.omg.IOP.IORHelper.read(is); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java index df2a1f5644e..614e035828d 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java @@ -87,7 +87,8 @@ public class ObjectKeyImpl implements ObjectKey public byte[] getBytes( org.omg.CORBA.ORB orb ) { - EncapsOutputStream os = new EncapsOutputStream( (ORB)orb ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb); write( os ) ; return os.toByteArray() ; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/TaggedComponentFactoryFinderImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/TaggedComponentFactoryFinderImpl.java index bc1dbda9f4e..db334e75c79 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/TaggedComponentFactoryFinderImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/TaggedComponentFactoryFinderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,8 @@ public class TaggedComponentFactoryFinderImpl extends public TaggedComponent create( org.omg.CORBA.ORB orb, org.omg.IOP.TaggedComponent comp ) { - EncapsOutputStream os = new EncapsOutputStream( (ORB)orb ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb); org.omg.IOP.TaggedComponentHelper.write( os, comp ) ; InputStream is = (InputStream)(os.create_input_stream() ) ; // Skip the component ID: we just wrote it out above diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java index be59b3f7959..4a7b0b921de 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -247,7 +247,8 @@ public class IIOPProfileImpl extends IdentifiableBase implements IIOPProfile public org.omg.IOP.TaggedProfile getIOPProfile() { - EncapsOutputStream os = new EncapsOutputStream( orb ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream(orb); os.write_long( getId() ) ; write( os ) ; InputStream is = (InputStream)(os.create_input_stream()) ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java index 26ac601daac..32a7d66d665 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,8 +132,9 @@ public class IIOPProfileTemplateImpl extends TaggedProfileTemplateBase // Note that this cannot be accomplished with a codec! // Use the byte order of the given stream - OutputStream encapsulatedOS = new EncapsOutputStream( (ORB)os.orb(), - ((CDROutputStream)os).isLittleEndian() ) ; + OutputStream encapsulatedOS = + sun.corba.OutputStreamFactory.newEncapsOutputStream( + (ORB)os.orb(), ((CDROutputStream)os).isLittleEndian() ) ; okeyTemplate.write( id, encapsulatedOS ) ; EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java index 9b87ee1b8f2..6af71ee77cb 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/StubDelegateImpl.java @@ -147,6 +147,14 @@ public class StubDelegateImpl implements javax.rmi.CORBA.StubDelegate return ior.equals( other.ior ) ; } + public int hashCode() { + if (ior == null) { + return 0; + } else { + return ior.hashCode(); + } + } + /** * Returns a string representation of this stub. Returns the same string * for all stubs that represent the same remote object. diff --git a/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java b/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java index aa2c6483804..7829d52a495 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,12 +109,9 @@ import com.sun.corba.se.impl.logging.OMGSystemException; import com.sun.corba.se.impl.util.Utility; import com.sun.corba.se.impl.util.IdentityHashtable; import com.sun.corba.se.impl.util.JDKBridge; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.logging.UtilSystemException; import com.sun.corba.se.spi.logging.CORBALogDomains; import sun.corba.SharedSecrets; -import sun.corba.JavaCorbaAccess; - /** * Provides utility methods that can be used by stubs and ties to @@ -263,7 +260,7 @@ public class Util implements javax.rmi.CORBA.UtilDelegate return new MarshalException(message,inner); } else if (ex instanceof ACTIVITY_REQUIRED) { try { - Class cl = ORBClassLoader.loadClass( + Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( "javax.activity.ActivityRequiredException"); Class[] params = new Class[2]; params[0] = java.lang.String.class; @@ -279,7 +276,7 @@ public class Util implements javax.rmi.CORBA.UtilDelegate } } else if (ex instanceof ACTIVITY_COMPLETED) { try { - Class cl = ORBClassLoader.loadClass( + Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( "javax.activity.ActivityCompletedException"); Class[] params = new Class[2]; params[0] = java.lang.String.class; @@ -295,7 +292,7 @@ public class Util implements javax.rmi.CORBA.UtilDelegate } } else if (ex instanceof INVALID_ACTIVITY) { try { - Class cl = ORBClassLoader.loadClass( + Class cl = SharedSecrets.getJavaCorbaAccess().loadClass( "javax.activity.InvalidActivityException"); Class[] params = new Class[2]; params[0] = java.lang.String.class; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBDataParserImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBDataParserImpl.java index 46b0627ae35..94bb5d9ee8f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBDataParserImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBDataParserImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,6 @@ import com.sun.corba.se.spi.transport.ReadTimeouts; import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; import com.sun.corba.se.impl.legacy.connection.USLPort; -import com.sun.corba.se.impl.orbutil.ORBClassLoader ; import com.sun.corba.se.impl.orbutil.ORBConstants ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java index 5db85734a95..8bda9dcbf0b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -152,7 +152,6 @@ import com.sun.corba.se.impl.oa.toa.TOAFactory; import com.sun.corba.se.impl.oa.poa.BadServerIdHandler; import com.sun.corba.se.impl.oa.poa.DelegateImpl; import com.sun.corba.se.impl.oa.poa.POAFactory; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.orbutil.ORBConstants; import com.sun.corba.se.impl.orbutil.ORBUtility; import com.sun.corba.se.impl.orbutil.StackImpl; @@ -551,7 +550,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB public synchronized org.omg.CORBA.portable.OutputStream create_output_stream() { checkShutdownState(); - return new EncapsOutputStream(this); + return sun.corba.OutputStreamFactory.newEncapsOutputStream(this); } /** diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java index 9bf7a83df42..63bec8b1161 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,7 +149,7 @@ public class ORBSingleton extends ORB } public OutputStream create_output_stream() { - return new EncapsOutputStream(this); + return sun.corba.OutputStreamFactory.newEncapsOutputStream(this); } public TypeCode create_struct_tc(String id, diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java index 550c4a7f304..f1ddd172ce9 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,6 @@ import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry ; import com.sun.corba.se.impl.legacy.connection.USLPort ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ; -import com.sun.corba.se.impl.orbutil.ORBClassLoader ; import com.sun.corba.se.impl.orbutil.ORBConstants ; import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr ; import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr ; @@ -86,6 +85,8 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr ; import com.sun.corba.se.impl.transport.DefaultIORToSocketInfoImpl; import com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl; +import sun.corba.SharedSecrets; + /** Initialize the parser data for the standard ORB parser. This is used both * to implement ORBDataParserImpl and to provide the basic testing framework * for ORBDataParserImpl. @@ -455,6 +456,10 @@ public class ParserTable { return other instanceof TestBadServerIdHandler ; } + public int hashCode() { + return 1; + } + public void handle( ObjectKey objectKey ) { } @@ -518,6 +523,10 @@ public class ParserTable { return other instanceof TestLegacyORBSocketFactory ; } + public int hashCode() { + return 1; + } + public ServerSocket createServerSocket( String type, int port ) { return null ; @@ -543,6 +552,10 @@ public class ParserTable { return other instanceof TestORBSocketFactory ; } + public int hashCode() { + return 1; + } + public void setORB(ORB orb) { } @@ -572,6 +585,10 @@ public class ParserTable { return other instanceof TestIORToSocketInfo; } + public int hashCode() { + return 1; + } + public List getSocketInfo(IOR ior) { return null; @@ -608,6 +625,10 @@ public class ParserTable { return other instanceof TestContactInfoListFactory; } + public int hashCode() { + return 1; + } + public void setORB(ORB orb) { } public CorbaContactInfoList create( IOR ior ) { return null; } @@ -640,8 +661,8 @@ public class ParserTable { String param = (String)value ; try { - Class legacySocketFactoryClass = - ORBClassLoader.loadClass(param); + Class legacySocketFactoryClass = + SharedSecrets.getJavaCorbaAccess().loadClass(param); // For security reasons avoid creating an instance if // this socket factory class is not one that would fail // the class cast anyway. @@ -670,7 +691,8 @@ public class ParserTable { String param = (String)value ; try { - Class socketFactoryClass = ORBClassLoader.loadClass(param); + Class socketFactoryClass = + SharedSecrets.getJavaCorbaAccess().loadClass(param); // For security reasons avoid creating an instance if // this socket factory class is not one that would fail // the class cast anyway. @@ -699,7 +721,8 @@ public class ParserTable { String param = (String)value ; try { - Class iorToSocketInfoClass = ORBClassLoader.loadClass(param); + Class iorToSocketInfoClass = + SharedSecrets.getJavaCorbaAccess().loadClass(param); // For security reasons avoid creating an instance if // this socket factory class is not one that would fail // the class cast anyway. @@ -728,7 +751,8 @@ public class ParserTable { String param = (String)value ; try { - Class iiopPrimaryToContactInfoClass = ORBClassLoader.loadClass(param); + Class iiopPrimaryToContactInfoClass = + SharedSecrets.getJavaCorbaAccess().loadClass(param); // For security reasons avoid creating an instance if // this socket factory class is not one that would fail // the class cast anyway. @@ -757,8 +781,8 @@ public class ParserTable { String param = (String)value ; try { - Class contactInfoListFactoryClass = - ORBClassLoader.loadClass(param); + Class contactInfoListFactoryClass = + SharedSecrets.getJavaCorbaAccess().loadClass(param); // For security reasons avoid creating an instance if // this socket factory class is not one that would fail // the class cast anyway. @@ -865,6 +889,10 @@ public class ParserTable { return other instanceof TestORBInitializer1 ; } + public int hashCode() { + return 1; + } + public void pre_init( ORBInitInfo info ) { } @@ -882,6 +910,10 @@ public class ParserTable { return other instanceof TestORBInitializer2 ; } + public int hashCode() { + return 1; + } + public void pre_init( ORBInitInfo info ) { } @@ -950,6 +982,8 @@ public class ParserTable { { return other instanceof TestAcceptor1 ; } + + public int hashCode() { return 1; } public boolean initialize() { return true; } public boolean initialized() { return true; } public String getConnectionCacheType() { return "FOO"; } @@ -981,6 +1015,7 @@ public class ParserTable { { return other instanceof TestAcceptor2 ; } + public int hashCode() { return 1; } public boolean initialize() { return true; } public boolean initialized() { return true; } public String getConnectionCacheType() { return "FOO"; } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java index 23d51f9008a..41dba4d9489 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,6 +90,8 @@ import com.sun.corba.se.impl.logging.ORBUtilSystemException ; import com.sun.corba.se.impl.logging.OMGSystemException ; import com.sun.corba.se.impl.ior.iiop.JavaSerializationComponent; +import sun.corba.SharedSecrets; + /** * Handy class full of static functions that don't belong in util.Utility for pure ORB reasons. */ @@ -262,8 +264,8 @@ public final class ORBUtility { { try { String name = classNameOf(strm.read_string()); - SystemException ex - = (SystemException)ORBClassLoader.loadClass(name).newInstance(); + SystemException ex = (SystemException)SharedSecrets. + getJavaCorbaAccess().loadClass(name).newInstance(); ex.minor = strm.read_long(); ex.completed = CompletionStatus.from_int(strm.read_long()); return ex; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java index 7fb16589162..c2bc23cacac 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/RepIdDelegator.java @@ -151,7 +151,9 @@ public final class RepIdDelegator } // Constructor used for factory/utility cases - public RepIdDelegator() {} + public RepIdDelegator() { + this(null); + } // Constructor used by getIdFromString. All non-static // RepositoryId methods will use the provided delegate. @@ -159,7 +161,7 @@ public final class RepIdDelegator this.delegate = _delegate; } - private RepositoryId delegate; + private final RepositoryId delegate; public String toString() { if (delegate != null) @@ -174,4 +176,12 @@ public final class RepIdDelegator else return super.equals(obj); } + + public int hashCode() { + if (delegate != null) { + return delegate.hashCode(); + } else { + return super.hashCode(); + } + } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties index 7be6158a9f5..794723ffa12 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties @@ -26,7 +26,7 @@ orbd.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -port ORBD\uAC00 \uC2DC\uC791\uB418\uC5B4\uC57C \uD558\uB294 \uD65C\uC131 \uD3EC\uD2B8\uB85C, \uAE30\uBCF8\uAC12\uC740 1049\uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -defaultdb ORBD \uD30C\uC77C\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uAE30\uBCF8\uAC12\uC740 "./orb.db"\uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -serverid ORBD\uC758 \uC11C\uBC84 ID\uB85C, \uAE30\uBCF8\uAC12\uC740 1 \uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n servertool.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n -servertool.banner=\n\nJava IDL \uC11C\uBC84 \uD234 \uC2DC\uC791 \n\uD504\uB86C\uD504\uD2B8\uC5D0 \uBA85\uB839\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624.\n +servertool.banner=\n\nJava IDL \uC11C\uBC84 \uD234 \uC2DC\uC791 \n\uD504\uB86C\uD504\uD2B8\uC5D0 \uBA85\uB839\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624. \n servertool.shorthelp=\n\n\t\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBA85\uB839: \n\t------------------- \n servertool.baddef=\uC798\uBABB\uB41C \uC11C\uBC84 \uC815\uC758: {0} servertool.nosuchserver=\t\uD574\uB2F9 \uC11C\uBC84\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java index a5ee15ba763..9badc182efd 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaMessageMediatorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1794,8 +1794,7 @@ public class CorbaMessageMediatorImpl if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) { // locate msgs 1.0 & 1.1 :=> grow, - // REVISIT - build from factory - outputObject = new CDROutputObject( + outputObject = sun.corba.OutputStreamFactory.newCDROutputObject( (ORB) messageMediator.getBroker(), this, GIOPVersion.V1_0, @@ -1804,8 +1803,7 @@ public class CorbaMessageMediatorImpl ORBConstants.STREAM_FORMAT_VERSION_1); } else { // 1.2 :=> stream - // REVISIT - build from factory - outputObject = new CDROutputObject( + outputObject = sun.corba.OutputStreamFactory.newCDROutputObject( (ORB) messageMediator.getBroker(), messageMediator, reply, @@ -1959,7 +1957,8 @@ public class CorbaMessageMediatorImpl ReplyMessage.NEEDS_ADDRESSING_MODE, null, null); // REVISIT: via acceptor factory. - CDROutputObject outputObject = new CDROutputObject( + CDROutputObject outputObject = + sun.corba.OutputStreamFactory.newCDROutputObject( (ORB)messageMediator.getBroker(), this, messageMediator.getGIOPVersion(), @@ -2126,7 +2125,7 @@ public class CorbaMessageMediatorImpl ex.printStackTrace(pw); pw.flush(); // NOTE: you must flush or baos will be empty. EncapsOutputStream encapsOutputStream = - new EncapsOutputStream((ORB)mediator.getBroker()); + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)mediator.getBroker()); encapsOutputStream.putEndian(); encapsOutputStream.write_wstring(baos.toString()); UnknownServiceContext serviceContext = @@ -2203,12 +2202,11 @@ public class CorbaMessageMediatorImpl // REVISIT = do not use null. // if (messageMediator.getConnection() == null) { - // REVISIT - needs factory replyOutputObject = - new CDROutputObject(orb, messageMediator, - messageMediator.getReplyHeader(), - messageMediator.getStreamFormatVersion(), - BufferManagerFactory.GROW); + sun.corba.OutputStreamFactory.newCDROutputObject(orb, + messageMediator, messageMediator.getReplyHeader(), + messageMediator.getStreamFormatVersion(), + BufferManagerFactory.GROW); } else { replyOutputObject = messageMediator.getConnection().getAcceptor() .createOutputObject(messageMediator.getBroker(), messageMediator); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java index a3af1ec2a41..8274de69f84 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/LocateReplyMessage_1_2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,6 @@ import com.sun.corba.se.impl.encoding.CDROutputStream; import com.sun.corba.se.impl.orbutil.ORBUtility; import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.spi.logging.CORBALogDomains ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java index b1eb366882a..6559be7fca4 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/MessageBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,9 +60,10 @@ import com.sun.corba.se.impl.encoding.CDRInputStream_1_0; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; import com.sun.corba.se.impl.orbutil.ORBUtility; import com.sun.corba.se.impl.orbutil.ORBConstants; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.impl.protocol.AddressingDispositionException; +import sun.corba.SharedSecrets; + /** * This class acts as the base class for the various GIOP message types. This * also serves as a factory to create various message types. We currently @@ -909,7 +910,8 @@ public abstract class MessageBase implements Message{ SystemException sysEx = null; try { - Class clazz = ORBClassLoader.loadClass(exClassName); + Class clazz = + SharedSecrets.getJavaCorbaAccess().loadClass(exClassName); if (message == null) { sysEx = (SystemException) clazz.newInstance(); } else { diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java index 8bcc4e8aec6..4d77e3aff0b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_0.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.spi.servicecontext.ServiceContexts; import com.sun.corba.se.spi.ior.iiop.GIOPVersion; import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.spi.ior.IOR; import com.sun.corba.se.impl.encoding.CDRInputStream; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java index e22e0fb64f8..65d8578f634 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/giopmsgheaders/ReplyMessage_1_1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ import com.sun.corba.se.spi.orb.ORB; import com.sun.corba.se.spi.servicecontext.ServiceContexts; import com.sun.corba.se.spi.ior.iiop.GIOPVersion; import com.sun.corba.se.impl.orbutil.ORBUtility; -import com.sun.corba.se.impl.orbutil.ORBClassLoader; import com.sun.corba.se.spi.ior.IOR; import com.sun.corba.se.impl.encoding.CDRInputStream; diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java index 1a439e1b5a5..419efe7e68d 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/CorbaContactInfoBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,7 +214,7 @@ public abstract class CorbaContactInfoBase messageMediator; OutputObject outputObject = - new CDROutputObject(orb, messageMediator, + sun.corba.OutputStreamFactory.newCDROutputObject(orb, messageMediator, corbaMessageMediator.getRequestHeader(), corbaMessageMediator.getStreamFormatVersion()); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java index 08cc96f5da6..49f2b8a2062 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SharedCDRContactInfoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -134,7 +134,7 @@ public class SharedCDRContactInfoImpl messageMediator; // NOTE: GROW. OutputObject outputObject = - new CDROutputObject(orb, messageMediator, + sun.corba.OutputStreamFactory.newCDROutputObject(orb, messageMediator, corbaMessageMediator.getRequestHeader(), corbaMessageMediator.getStreamFormatVersion(), BufferManagerFactory.GROW); diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java index 01d344b8c7f..e5fb14c754f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelAcceptorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -534,9 +534,9 @@ public class SocketOrChannelAcceptorImpl { CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator) messageMediator; - return new CDROutputObject((ORB) broker, corbaMessageMediator, - corbaMessageMediator.getReplyHeader(), - corbaMessageMediator.getStreamFormatVersion()); + return sun.corba.OutputStreamFactory.newCDROutputObject((ORB) broker, + corbaMessageMediator, corbaMessageMediator.getReplyHeader(), + corbaMessageMediator.getStreamFormatVersion()); } //////////////////////////////////////////////////// diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java index 39fb4fecc14..fa87b568df4 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1587,8 +1587,8 @@ public class SocketOrChannelConnectionImpl { // REVISIT: See comments in CDROutputObject constructor. CDROutputObject outputObject = - new CDROutputObject((ORB)orb, null, giopVersion, this, msg, - ORBConstants.STREAM_FORMAT_VERSION_1); + sun.corba.OutputStreamFactory.newCDROutputObject((ORB)orb, null, giopVersion, + this, msg, ORBConstants.STREAM_FORMAT_VERSION_1); msg.write(outputObject); outputObject.writeTo(this); diff --git a/corba/src/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java b/corba/src/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java index 9e9a2a2f12a..74617235d70 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/ior/TaggedComponentBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,8 @@ public abstract class TaggedComponentBase extends IdentifiableBase public org.omg.IOP.TaggedComponent getIOPComponent( org.omg.CORBA.ORB orb ) { - EncapsOutputStream os = new EncapsOutputStream( (ORB)orb ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb); write( os ) ; InputStream is = (InputStream)(os.create_input_stream() ) ; return org.omg.IOP.TaggedComponentHelper.read( is ) ; diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java b/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java index 306a9f7d2bf..91a691e2b25 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,8 +97,8 @@ import com.sun.corba.se.impl.logging.OMGSystemException ; import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ; -import com.sun.corba.se.impl.orbutil.ORBClassLoader ; import sun.awt.AppContext; +import sun.corba.SharedSecrets; public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB implements Broker, TypeCodeFactory @@ -201,7 +201,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB try { // First try the configured class name, if any - Class cls = ORBClassLoader.loadClass( className ) ; + Class cls = SharedSecrets.getJavaCorbaAccess().loadClass( className ) ; sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ; } catch (Exception exc) { // Use the default. Log the error as a warning. diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java b/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java index eb81eb56be0..d84523b0fd9 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orb/OperationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,9 +35,10 @@ import java.net.MalformedURLException ; import com.sun.corba.se.spi.logging.CORBALogDomains ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; -import com.sun.corba.se.impl.orbutil.ORBClassLoader ; import com.sun.corba.se.impl.orbutil.ObjectUtility ; +import sun.corba.SharedSecrets; + /** This is a static factory class for commonly used operations * for property parsing. The following operations are supported: *
      @@ -247,7 +248,8 @@ public abstract class OperationFactory { String className = getString( value ) ; try { - Class result = ORBClassLoader.loadClass( className ) ; + Class result = + SharedSecrets.getJavaCorbaAccess().loadClass( className ) ; return result ; } catch (Exception exc) { ORBUtilSystemException wrapper = ORBUtilSystemException.get( diff --git a/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java b/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java index db7a5db51b4..30994d385c3 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,8 @@ public abstract class ServiceContext { */ public void write(OutputStream s, GIOPVersion gv) throws SystemException { - EncapsOutputStream os = new EncapsOutputStream( (ORB)(s.orb()), gv ) ; + EncapsOutputStream os = + sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)(s.orb()), gv); os.putEndian() ; writeData( os ) ; byte[] data = os.toByteArray() ; diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp index 630b55d0d7f..d1f86754a8d 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp @@ -64,7 +64,7 @@ # # Translator: Start Translating -Compile.parsing=\u6B63\u5728\u5BF9 %0 \u8FDB\u884C\u8BED\u6CD5\u5206\u6790 +Compile.parsing=\u6B63\u5728\u89E3\u6790 %0 Compile.parseDone=\u5B8C\u6210 - %0 Compile.generating=\u6B63\u5728\u751F\u6210 %0 Compile.genDone=\u5B8C\u6210 - %0 @@ -165,7 +165,7 @@ Token.identifier=<\u6807\u8BC6\u7B26> Token.endOfFile=EOF Token.unknown=? Util.cantCreatePkg=\u65E0\u6CD5\u521B\u5EFA\u7A0B\u5E8F\u5305%0\u3002 -Version.product=IDL \u8BED\u6CD5\u5206\u6790\u5668\u6846\u67B6, \u7248\u672C "%0" +Version.product=IDL \u89E3\u6790\u5668\u6846\u67B6, \u7248\u672C "%0" Version.number=3.2 default=\u9519\u8BEF! \u8BF7\u6C42\u4E86\u4E0D\u5B58\u5728\u7684\u6D88\u606F\u3002\u6D88\u606F\u6587\u4EF6\u672A\u5305\u542B\u5173\u952E\u5B57: %0\u3002 diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp index 35cee81cd2d..35ae4fdb054 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp @@ -65,4 +65,5 @@ NameModifier.InvalidChar=\u30D1\u30BF\u30FC\u30F3\u306B\u7121\u52B9\u306A\u6587\ # -d, -emitAll, -f, -i, -keep, -m, -sep, -pkgPrefix, -td, -v, -verbose, -version, -implbase # Do not translate the string "java com.sun.tools.corba.se.idl.toJavaPortable.Compile" # -usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\n java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] \n\n\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n \u540C\u3058\u3067\u3059: #define \n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\u767A\u884C\u3057\u307E\u3059\u3002\n-f \u767A\u884C\u3059\u308B\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002\u306Fclient\u3001\n server\u3001all\u3001serverTIE\u3001allTIE\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002serverTIE\u3068allTIE\u306F\n \u59D4\u4EFB\u30E2\u30C7\u30EB\u30FB\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u767A\u884C\u3057\u307E\u3059\u3002\u3053\u306E\u30D5\u30E9\u30B0\u3092\n \u4F7F\u7528\u3057\u306A\u3044\u5834\u5408\u306F\u3001-fclient\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n-i \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-oldImplBase \u53E4\u3044(1.4\u4EE5\u524D) JDK ORB\u3068\u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n-pkgPrefix \u30D5\u30A1\u30A4\u30EB\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u306B\u5BFE\u3057\u3066\u751F\u6210\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306EJava\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u3092\n \u3067\u59CB\u3081\u307E\u3059\u3002\n-pkgTranslate \u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u751F\u6210\u3055\u308C\u305FJava\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u3067\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002pkgPrefix\u306E\n \u5909\u66F4\u304C\u5148\u306B\u884C\u308F\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u6B63\u5F0F\u540D\u3068\u5B8C\u5168\u306B\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305F\u3001\u3092\n org\u3001org.omg\u307E\u305F\u306Forg.omg\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\n-skeletonName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066\u30B9\u30B1\u30EB\u30C8\u30F3\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\n \u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F%POA (-fserver\u307E\u305F\u306F-fall) \n oldImplBase\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F_%ImplBase\n (-oldImplBase\u304A\u3088\u3073(-fserver\u307E\u305F\u306F-fall))\u3002\n-td \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u304B\u308F\u308A\u306B\u3092\n \u4F7F\u7528\u3057\u307E\u3059\u3002\n-tieName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066tie\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA tie\u306E\u5834\u5408\u306F%POATie (-fserverTie\u307E\u305F\u306F-fallTie) \n oldImplBase tie\u306E\u5834\u5408\u306F%_Tie\n (-oldImplBase\u304A\u3088\u3073(-fserverTie\u307E\u305F\u306F-fallTie))\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\u3002\n +usage=\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u4F7F\u7528\u65B9\u6CD5:\n\n java com.sun.tools.corba.se.idl.toJavaPortable.Compile [options] \n\n\u306FIDL\u5B9A\u7FA9\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3067\u3001\n[options]\u306F\u6B21\u306B\u30EA\u30B9\u30C8\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u3067\u3059\u3002\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\n\u7701\u7565\u53EF\u80FD\u3067\u3001\u4EFB\u610F\u306E\u9806\u5E8F\u3067\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u306F\u5FC5\u9808\u3067\u3001\n\u6700\u5F8C\u306B\u8868\u793A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \n\u30AA\u30D7\u30B7\u30E7\u30F3:\n-d IDL\u30D5\u30A1\u30A4\u30EB\u306E\u6B21\u306E\u884C\u3068\n \u540C\u3058\u3067\u3059: #define \n-emitAll #included\u30D5\u30A1\u30A4\u30EB\u3067\u898B\u3064\u304B\u3063\u305F\u30BF\u30A4\u30D7\u3092\u542B\u3080\u3001\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7\u3092\u767A\u884C\u3057\u307E\u3059\u3002\n-f \u767A\u884C\u3059\u308B\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u3092\u5B9A\u7FA9\u3057\u307E\u3059\u3002\u306Fclient\u3001\n server\u3001all\u3001serverTIE\u3001allTIE\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002serverTIE\u3068allTIE\u306F\n \u59D4\u4EFB\u30E2\u30C7\u30EB\u30FB\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u767A\u884C\u3057\u307E\u3059\u3002\u3053\u306E\u30D5\u30E9\u30B0\u3092\n \u4F7F\u7528\u3057\u306A\u3044\u5834\u5408\u306F\u3001-fclient\u3068\u307F\u306A\u3055\u308C\u307E\u3059\u3002\n-i \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u304C\n \u30B9\u30AD\u30E3\u30F3\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u5225\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3057\u307E\u3059\u3002\n-keep \u751F\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u5834\u5408\u306F\u3001\u4E0A\u66F8\u304D\n \u3057\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u4E0A\u66F8\u304D\u3055\u308C\u307E\u3059\u3002\n-noWarn \u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059\u3002\n-oldImplBase \u53E4\u3044(1.4\u4EE5\u524D) JDK ORB\u3068\u4E92\u63DB\u6027\u306E\u3042\u308B\u30B9\u30B1\u30EB\u30C8\u30F3\u3092\u751F\u6210\u3057\u307E\u3059\u3002\n-pkgPrefix \u30D5\u30A1\u30A4\u30EB\u30FB\u30B9\u30B3\u30FC\u30D7\u3067\u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u306B\u5BFE\u3057\u3066\u751F\u6210\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB\u306EJava\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u3092\n \u3067\u59CB\u3081\u307E\u3059\u3002\n-pkgTranslate \u30BF\u30A4\u30D7\u307E\u305F\u306F\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u304C\u691C\u51FA\u3055\u308C\u305F\u5834\u5408\u3001\n \u751F\u6210\u3055\u308C\u305FJava\u30D1\u30C3\u30B1\u30FC\u30B8\u5185\u3067\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002pkgPrefix\u306E\n \u5909\u66F4\u304C\u5148\u306B\u884C\u308F\u308C\u308B\u3053\u3068\u306B\u6CE8\u610F\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u6B63\u5F0F\u540D\u3068\u5B8C\u5168\u306B\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u307E\u305F\u3001\u3092\n \ +org\u3001org.omg\u307E\u305F\u306Forg.omg\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\n-skeletonName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066\u30B9\u30B1\u30EB\u30C8\u30F3\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\n \u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F%POA (-fserver\u307E\u305F\u306F-fall) \n oldImplBase\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u306E\u5834\u5408\u306F_%ImplBase\n (-oldImplBase\u304A\u3088\u3073(-fserver\u307E\u305F\u306F-fall))\u3002\n-td \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u306F\u3001\u73FE\u5728\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u304B\u308F\u308A\u306B\u3092\n \u4F7F\u7528\u3057\u307E\u3059\u3002\n-tieName \u30D1\u30BF\u30FC\u30F3\u306B\u5F93\u3063\u3066tie\u306B\u540D\u524D\u3092\u4ED8\u3051\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n POA tie\u306E\u5834\u5408\u306F%POATie (-fserverTie\u307E\u305F\u306F-fallTie) \n oldImplBase tie\u306E\u5834\u5408\u306F%_Tie\n (-oldImplBase\u304A\u3088\u3073(-fserverTie\u307E\u305F\u306F-fallTie))\u3002\n-v, -verbose \u8A73\u7D30\u30E2\u30FC\u30C9\u3002\n-version \u30D0\u30FC\u30B8\u30E7\u30F3\u756A\u53F7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059\u3002\n diff --git a/corba/src/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java b/corba/src/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java index d29c8a04e52..b1222dfe99b 100644 --- a/corba/src/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java +++ b/corba/src/share/classes/org/omg/CORBA_2_3/portable/OutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ package org.omg.CORBA_2_3.portable; +import java.io.SerializablePermission; +import java.security.AccessController; +import java.security.PrivilegedAction; + /** * OutputStream provides interface for writing of all of the mapped IDL type * to the stream. It extends org.omg.CORBA.portable.OutputStream, and defines @@ -43,6 +47,40 @@ package org.omg.CORBA_2_3.portable; public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream { + private static final String ALLOW_SUBCLASS_PROP = "jdk.corba.allowOutputStreamSubclass"; + private static final boolean allowSubclass = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Boolean run() { + String prop = System.getProperty(ALLOW_SUBCLASS_PROP); + return prop == null ? false : + (prop.equalsIgnoreCase("false") ? false : true); + } + }); + + private static Void checkPermission() { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + if (!allowSubclass) + sm.checkPermission(new + SerializablePermission("enableSubclassImplementation")); + } + return null; + } + private OutputStream(Void ignore) { } + + /** + * Create a new instance of this class. + * + * throw SecurityException if SecurityManager is installed and + * enableSubclassImplementation SerializablePermission + * is not granted or jdk.corba.allowOutputStreamSubclass system + * property is either not set or is set to 'false' + */ + public OutputStream() { + this(checkPermission()); + } + /** * Marshals a value type to the output stream. * @param value is the acutal value to write diff --git a/corba/src/share/classes/sun/corba/JavaCorbaAccess.java b/corba/src/share/classes/sun/corba/JavaCorbaAccess.java index 046453f2767..0d21551ef3e 100644 --- a/corba/src/share/classes/sun/corba/JavaCorbaAccess.java +++ b/corba/src/share/classes/sun/corba/JavaCorbaAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,4 +29,5 @@ import com.sun.corba.se.impl.io.ValueHandlerImpl; public interface JavaCorbaAccess { public ValueHandlerImpl newValueHandlerImpl(); + public Class loadClass(String className) throws ClassNotFoundException; } diff --git a/corba/src/share/classes/sun/corba/OutputStreamFactory.java b/corba/src/share/classes/sun/corba/OutputStreamFactory.java new file mode 100644 index 00000000000..d723e22c004 --- /dev/null +++ b/corba/src/share/classes/sun/corba/OutputStreamFactory.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.corba; + +import com.sun.corba.se.impl.corba.AnyImpl; +import com.sun.corba.se.impl.encoding.BufferManagerWrite; +import com.sun.corba.se.impl.encoding.CDROutputObject; +import com.sun.corba.se.impl.encoding.EncapsOutputStream; +import com.sun.corba.se.impl.encoding.TypeCodeOutputStream; +import com.sun.corba.se.impl.protocol.giopmsgheaders.Message; + +import com.sun.corba.se.pept.protocol.MessageMediator; + +import com.sun.corba.se.spi.orb.ORB; +import com.sun.corba.se.spi.transport.CorbaConnection; +import com.sun.corba.se.spi.ior.iiop.GIOPVersion; +import com.sun.corba.se.spi.protocol.CorbaMessageMediator; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +public final class OutputStreamFactory { + + private OutputStreamFactory() { + } + + public static TypeCodeOutputStream newTypeCodeOutputStream( + final ORB orb) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public TypeCodeOutputStream run() { + return new TypeCodeOutputStream(orb); + } + }); + } + + public static TypeCodeOutputStream newTypeCodeOutputStream( + final ORB orb, final boolean littleEndian) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public TypeCodeOutputStream run() { + return new TypeCodeOutputStream(orb, littleEndian); + } + }); + } + + public static EncapsOutputStream newEncapsOutputStream( + final ORB orb) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public EncapsOutputStream run() { + return new EncapsOutputStream( + (com.sun.corba.se.spi.orb.ORB)orb); + } + }); + } + + public static EncapsOutputStream newEncapsOutputStream( + final ORB orb, final GIOPVersion giopVersion) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public EncapsOutputStream run() { + return new EncapsOutputStream( + (com.sun.corba.se.spi.orb.ORB)orb, giopVersion); + } + }); + } + + public static EncapsOutputStream newEncapsOutputStream( + final ORB orb, final boolean isLittleEndian) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public EncapsOutputStream run() { + return new EncapsOutputStream( + (com.sun.corba.se.spi.orb.ORB)orb, isLittleEndian); + } + }); + } + + public static CDROutputObject newCDROutputObject( + final ORB orb, final MessageMediator messageMediator, + final Message header, final byte streamFormatVersion) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public CDROutputObject run() { + return new CDROutputObject(orb, messageMediator, + header, streamFormatVersion); + } + }); + } + + public static CDROutputObject newCDROutputObject( + final ORB orb, final MessageMediator messageMediator, + final Message header, final byte streamFormatVersion, + final int strategy) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public CDROutputObject run() { + return new CDROutputObject(orb, messageMediator, + header, streamFormatVersion, strategy); + } + }); + } + + public static CDROutputObject newCDROutputObject( + final ORB orb, final CorbaMessageMediator mediator, + final GIOPVersion giopVersion, final CorbaConnection connection, + final Message header, final byte streamFormatVersion) { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public CDROutputObject run() { + return new CDROutputObject(orb, mediator, + giopVersion, connection, header, streamFormatVersion); + } + }); + } + +} diff --git a/corba/src/share/classes/sun/rmi/rmic/iiop/CompoundType.java b/corba/src/share/classes/sun/rmi/rmic/iiop/CompoundType.java index 2c55bf72148..eba506daf73 100644 --- a/corba/src/share/classes/sun/rmi/rmic/iiop/CompoundType.java +++ b/corba/src/share/classes/sun/rmi/rmic/iiop/CompoundType.java @@ -32,6 +32,7 @@ package sun.rmi.rmic.iiop; +import java.util.Arrays; import java.util.Vector; import sun.tools.java.Identifier; import sun.tools.java.ClassNotFound; @@ -1851,6 +1852,10 @@ public abstract class CompoundType extends Type { return false; } + public int hashCode() { + return getName().hashCode() ^ Arrays.hashCode(arguments); + } + /** * Return a new Method object that is a legal combination of * this method object and another one. diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 974522a6a2b..f8540b7e06c 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -351,3 +351,10 @@ b786c04b7be15194febe88dc1f0c9443e737a84b hs25-b35 3c78a14da19d26d6937af5f98b97e2a21c653b04 hs25-b36 1beed1f6f9edefe47ba8ed1355fbd3e7606b8288 jdk8-b94 69689078dff8b21e6df30870464f5d736eebdf72 hs25-b37 +5d65c078cd0ac455aa5e58a09844c7acce54b487 jdk8-b95 +2cc5a9d1ba66dfdff578918b393c727bd9450210 hs25-b38 +e6a4b8c71fa6f225bd989a34de2d0d0a656a8be8 jdk8-b96 +2b9380b0bf0b649f40704735773e8956c2d88ba0 hs25-b39 +d197d377ab2e016d024e8c86cb06a57bd7eae590 jdk8-b97 +c9dd82da51ed34a28f7c6b3245163ee962e94572 hs25-b40 +30b5b75c42ac5174b640fbef8aa87527668e8400 jdk8-b98 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java index 5071235fa3e..9e8d016dcc2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java @@ -31,13 +31,19 @@ import java.io.*; import java.util.*; public class CLHSDB { + + public CLHSDB(JVMDebugger d) { + jvmDebugger = d; + } + public static void main(String[] args) { new CLHSDB(args).run(); } - private void run() { - // At this point, if pidText != null we are supposed to attach to it. - // Else, if execPath != null, it is the path of a jdk/bin/java + public void run() { + // If jvmDebugger is already set, we have been given a JVMDebugger. + // Otherwise, if pidText != null we are supposed to attach to it. + // Finally, if execPath != null, it is the path of a jdk/bin/java // and coreFilename is the pathname of a core file we are // supposed to attach to. @@ -49,7 +55,9 @@ public class CLHSDB { } }); - if (pidText != null) { + if (jvmDebugger != null) { + attachDebugger(jvmDebugger); + } else if (pidText != null) { attachDebugger(pidText); } else if (execPath != null) { attachDebugger(execPath, coreFilename); @@ -96,6 +104,7 @@ public class CLHSDB { // Internals only below this point // private HotSpotAgent agent; + private JVMDebugger jvmDebugger; private boolean attached; // These had to be made data members because they are referenced in inner classes. private String pidText; @@ -120,7 +129,7 @@ public class CLHSDB { case (1): if (args[0].equals("help") || args[0].equals("-help")) { doUsage(); - System.exit(0); + return; } // If all numbers, it is a PID to attach to // Else, it is a pathname to a .../bin/java for a core file. @@ -142,10 +151,15 @@ public class CLHSDB { default: System.out.println("HSDB Error: Too many options specified"); doUsage(); - System.exit(1); + return; } } + private void attachDebugger(JVMDebugger d) { + agent.attach(d); + attached = true; + } + /** NOTE we are in a different thread here than either the main thread or the Swing/AWT event handler thread, so we must be very careful when creating or removing widgets */ diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java index 2233844267c..1840caf9313 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java @@ -101,6 +101,9 @@ import sun.jvm.hotspot.utilities.soql.JSJavaFactoryImpl; import sun.jvm.hotspot.utilities.soql.JSJavaScriptEngine; public class CommandProcessor { + + volatile boolean quit; + public abstract static class DebuggerInterface { public abstract HotSpotAgent getAgent(); public abstract boolean isAttached(); @@ -1135,7 +1138,7 @@ public class CommandProcessor { usage(); } else { debugger.detach(); - System.exit(0); + quit = true; } } }, @@ -1714,7 +1717,7 @@ public class CommandProcessor { } protected void quit() { debugger.detach(); - System.exit(0); + quit = true; } protected BufferedReader getInputReader() { return in; @@ -1781,7 +1784,7 @@ public class CommandProcessor { public void run(boolean prompt) { // Process interactive commands. - while (true) { + while (!quit) { if (prompt) printPrompt(); String ln = null; try { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java index 5143408c687..d50cbaa5140 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java @@ -59,8 +59,11 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { // Internals only below this point // private HotSpotAgent agent; + private JVMDebugger jvmDebugger; private JDesktopPane desktop; private boolean attached; + private boolean argError; + private JFrame frame; /** List */ private java.util.List attachMenuItems; /** List */ @@ -85,6 +88,11 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { System.out.println(" path-to-corefile: Debug this corefile. The default is 'core'"); System.out.println(" If no arguments are specified, you can select what to do from the GUI.\n"); HotSpotAgent.showUsage(); + argError = true; + } + + public HSDB(JVMDebugger d) { + jvmDebugger = d; } private HSDB(String[] args) { @@ -95,7 +103,6 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { case (1): if (args[0].equals("help") || args[0].equals("-help")) { doUsage(); - System.exit(0); } // If all numbers, it is a PID to attach to // Else, it is a pathname to a .../bin/java for a core file. @@ -117,24 +124,29 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { default: System.out.println("HSDB Error: Too many options specified"); doUsage(); - System.exit(1); } } - private void run() { - // At this point, if pidText != null we are supposed to attach to it. - // Else, if execPath != null, it is the path of a jdk/bin/java - // and coreFilename is the pathname of a core file we are - // supposed to attach to. + // close this tool without calling System.exit + protected void closeUI() { + workerThread.shutdown(); + frame.dispose(); + } + + public void run() { + // Don't start the UI if there were bad arguments. + if (argError) { + return; + } agent = new HotSpotAgent(); workerThread = new WorkerThread(); attachMenuItems = new java.util.ArrayList(); detachMenuItems = new java.util.ArrayList(); - JFrame frame = new JFrame("HSDB - HotSpot Debugger"); + frame = new JFrame("HSDB - HotSpot Debugger"); frame.setSize(800, 600); - frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); JMenuBar menuBar = new JMenuBar(); @@ -197,7 +209,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { item = createMenuItem("Exit", new ActionListener() { public void actionPerformed(ActionEvent e) { - System.exit(0); + closeUI(); } }); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK)); @@ -406,7 +418,15 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { } }); - if (pidText != null) { + // If jvmDebugger is already set, we have been given a JVMDebugger. + // Otherwise, if pidText != null we are supposed to attach to it. + // Finally, if execPath != null, it is the path of a jdk/bin/java + // and coreFilename is the pathname of a core file we are + // supposed to attach to. + + if (jvmDebugger != null) { + attach(jvmDebugger); + } else if (pidText != null) { attach(pidText); } else if (execPath != null) { attach(execPath, coreFilename); @@ -1113,6 +1133,12 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { }); } + // Attach to existing JVMDebugger, which should be already attached to a core/process. + private void attach(JVMDebugger d) { + attached = true; + showThreadsDialog(); + } + /** NOTE we are in a different thread here than either the main thread or the Swing/AWT event handler thread, so we must be very careful when creating or removing widgets */ diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java index bdf9bd369e6..c963350591d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java @@ -25,6 +25,8 @@ package sun.jvm.hotspot; import java.rmi.RemoteException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import sun.jvm.hotspot.debugger.Debugger; import sun.jvm.hotspot.debugger.DebuggerException; @@ -63,7 +65,6 @@ public class HotSpotAgent { private String os; private String cpu; - private String fileSep; // The system can work in several ways: // - Attaching to local process @@ -155,6 +156,14 @@ public class HotSpotAgent { go(); } + /** This uses a JVMDebugger that is already attached to the core or process */ + public synchronized void attach(JVMDebugger d) + throws DebuggerException { + debugger = d; + isServer = false; + go(); + } + /** This attaches to a "debug server" on a remote machine; this remote server has already attached to a process or opened a core file and is waiting for RMI calls on the Debugger object to @@ -303,28 +312,37 @@ public class HotSpotAgent { // server, but not client attaching to server) // - try { - os = PlatformInfo.getOS(); - cpu = PlatformInfo.getCPU(); - } - catch (UnsupportedPlatformException e) { - throw new DebuggerException(e); - } - fileSep = System.getProperty("file.separator"); + // Handle existing or alternate JVMDebugger: + // these will set os, cpu independently of our PlatformInfo implementation. + String alternateDebugger = System.getProperty("sa.altDebugger"); + if (debugger != null) { + setupDebuggerExisting(); + + } else if (alternateDebugger != null) { + setupDebuggerAlternate(alternateDebugger); - if (os.equals("solaris")) { - setupDebuggerSolaris(); - } else if (os.equals("win32")) { - setupDebuggerWin32(); - } else if (os.equals("linux")) { - setupDebuggerLinux(); - } else if (os.equals("bsd")) { - setupDebuggerBsd(); - } else if (os.equals("darwin")) { - setupDebuggerDarwin(); } else { - // Add support for more operating systems here - throw new DebuggerException("Operating system " + os + " not yet supported"); + // Otherwise, os, cpu are those of our current platform: + try { + os = PlatformInfo.getOS(); + cpu = PlatformInfo.getCPU(); + } catch (UnsupportedPlatformException e) { + throw new DebuggerException(e); + } + if (os.equals("solaris")) { + setupDebuggerSolaris(); + } else if (os.equals("win32")) { + setupDebuggerWin32(); + } else if (os.equals("linux")) { + setupDebuggerLinux(); + } else if (os.equals("bsd")) { + setupDebuggerBsd(); + } else if (os.equals("darwin")) { + setupDebuggerDarwin(); + } else { + // Add support for more operating systems here + throw new DebuggerException("Operating system " + os + " not yet supported"); + } } if (isServer) { @@ -423,6 +441,41 @@ public class HotSpotAgent { // OS-specific debugger setup/connect routines // + // Use the existing JVMDebugger, as passed to our constructor. + // Retrieve os and cpu from that debugger, not the current platform. + private void setupDebuggerExisting() { + + os = debugger.getOS(); + cpu = debugger.getCPU(); + setupJVMLibNames(os); + machDesc = debugger.getMachineDescription(); + } + + // Given a classname, load an alternate implementation of JVMDebugger. + private void setupDebuggerAlternate(String alternateName) { + + try { + Class c = Class.forName(alternateName); + Constructor cons = c.getConstructor(); + debugger = (JVMDebugger) cons.newInstance(); + attachDebugger(); + setupDebuggerExisting(); + + } catch (ClassNotFoundException cnfe) { + throw new DebuggerException("Cannot find alternate SA Debugger: '" + alternateName + "'"); + } catch (NoSuchMethodException nsme) { + throw new DebuggerException("Alternate SA Debugger: '" + alternateName + "' has missing constructor."); + } catch (InstantiationException ie) { + throw new DebuggerException("Alternate SA Debugger: '" + alternateName + "' fails to initialise: ", ie); + } catch (IllegalAccessException iae) { + throw new DebuggerException("Alternate SA Debugger: '" + alternateName + "' fails to initialise: ", iae); + } catch (InvocationTargetException iae) { + throw new DebuggerException("Alternate SA Debugger: '" + alternateName + "' fails to initialise: ", iae); + } + + System.err.println("Loaded alternate HotSpot SA Debugger: " + alternateName); + } + // // Solaris // @@ -466,6 +519,11 @@ public class HotSpotAgent { debugger = new RemoteDebuggerClient(remote); machDesc = ((RemoteDebuggerClient) debugger).getMachineDescription(); os = debugger.getOS(); + setupJVMLibNames(os); + cpu = debugger.getCPU(); + } + + private void setupJVMLibNames(String os) { if (os.equals("solaris")) { setupJVMLibNamesSolaris(); } else if (os.equals("win32")) { @@ -479,8 +537,6 @@ public class HotSpotAgent { } else { throw new RuntimeException("Unknown OS type"); } - - cpu = debugger.getCPU(); } private void setupJVMLibNamesSolaris() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java index 9e85e133b3a..cff29ce8edc 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java @@ -26,11 +26,11 @@ package sun.jvm.hotspot.debugger.linux; import sun.jvm.hotspot.debugger.*; -class LinuxAddress implements Address { +public class LinuxAddress implements Address { protected LinuxDebugger debugger; protected long addr; - LinuxAddress(LinuxDebugger debugger, long addr) { + public LinuxAddress(LinuxDebugger debugger, long addr) { this.debugger = debugger; this.addr = addr; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java index 310acb88ac7..99291aada29 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java @@ -26,8 +26,8 @@ package sun.jvm.hotspot.debugger.linux; import sun.jvm.hotspot.debugger.*; -class LinuxOopHandle extends LinuxAddress implements OopHandle { - LinuxOopHandle(LinuxDebugger debugger, long addr) { +public class LinuxOopHandle extends LinuxAddress implements OopHandle { + public LinuxOopHandle(LinuxDebugger debugger, long addr) { super(debugger, addr); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 0a9d9436878..f84da894ac2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -246,7 +246,7 @@ public class VM { } } - private static final boolean disableDerivedPrinterTableCheck; + private static final boolean disableDerivedPointerTableCheck; private static final Properties saProps; static { @@ -256,12 +256,12 @@ public class VM { url = VM.class.getClassLoader().getResource("sa.properties"); saProps.load(new BufferedInputStream(url.openStream())); } catch (Exception e) { - throw new RuntimeException("Unable to load properties " + + System.err.println("Unable to load properties " + (url == null ? "null" : url.toString()) + ": " + e.getMessage()); } - disableDerivedPrinterTableCheck = System.getProperty("sun.jvm.hotspot.runtime.VM.disableDerivedPointerTableCheck") != null; + disableDerivedPointerTableCheck = System.getProperty("sun.jvm.hotspot.runtime.VM.disableDerivedPointerTableCheck") != null; } private VM(TypeDataBase db, JVMDebugger debugger, boolean isBigEndian) { @@ -371,7 +371,8 @@ public class VM { /** This is used by the debugging system */ public static void initialize(TypeDataBase db, JVMDebugger debugger) { if (soleInstance != null) { - throw new RuntimeException("Attempt to initialize VM twice"); + // Using multiple SA Tool classes in the same process creates a call here. + return; } soleInstance = new VM(db, debugger, debugger.getMachineDescription().isBigEndian()); @@ -683,7 +684,7 @@ public class VM { /** Returns true if C2 derived pointer table should be used, false otherwise */ public boolean useDerivedPointerTable() { - return !disableDerivedPrinterTableCheck; + return !disableDerivedPointerTableCheck; } /** Returns the code cache; should not be used if is core build */ diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java index 77f0f800445..eeda376b1d6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java @@ -41,6 +41,14 @@ import sun.jvm.hotspot.utilities.*; public class ClassLoaderStats extends Tool { boolean verbose = true; + public ClassLoaderStats() { + super(); + } + + public ClassLoaderStats(JVMDebugger d) { + super(d); + } + public static void main(String[] args) { ClassLoaderStats cls = new ClassLoaderStats(); cls.start(args); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java index 79e6784a63e..ed707b9ee8a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java @@ -24,6 +24,7 @@ package sun.jvm.hotspot.tools; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.tools.*; import sun.jvm.hotspot.oops.*; @@ -42,6 +43,15 @@ import java.util.Comparator; * summary of these objects in the form of a histogram. */ public class FinalizerInfo extends Tool { + + public FinalizerInfo() { + super(); + } + + public FinalizerInfo(JVMDebugger d) { + super(d); + } + public static void main(String[] args) { FinalizerInfo finfo = new FinalizerInfo(); finfo.start(args); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java index effeabb582a..c8db6d6b044 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java @@ -25,10 +25,19 @@ package sun.jvm.hotspot.tools; import java.io.PrintStream; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.runtime.*; public class FlagDumper extends Tool { + public FlagDumper() { + super(); + } + + public FlagDumper(JVMDebugger d) { + super(d); + } + public void run() { VM.Flag[] flags = VM.getVM().getCommandLineFlags(); PrintStream out = System.out; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java index 5a7c06618b9..c5af0ed005d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java @@ -25,6 +25,7 @@ package sun.jvm.hotspot.tools; import sun.jvm.hotspot.utilities.HeapHprofBinWriter; +import sun.jvm.hotspot.debugger.JVMDebugger; import java.io.IOException; /* @@ -42,6 +43,11 @@ public class HeapDumper extends Tool { this.dumpFile = dumpFile; } + public HeapDumper(String dumpFile, JVMDebugger d) { + super(d); + this.dumpFile = dumpFile; + } + protected void printFlagsUsage() { System.out.println(" \tto dump heap to " + DEFAULT_DUMP_FILE); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 87621655269..a0123dd4c99 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -29,12 +29,21 @@ import sun.jvm.hotspot.gc_interface.*; import sun.jvm.hotspot.gc_implementation.g1.*; import sun.jvm.hotspot.gc_implementation.parallelScavenge.*; import sun.jvm.hotspot.gc_implementation.shared.*; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.memory.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.runtime.*; public class HeapSummary extends Tool { + public HeapSummary() { + super(); + } + + public HeapSummary(JVMDebugger d) { + super(d); + } + public static void main(String[] args) { HeapSummary hs = new HeapSummary(); hs.start(args); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java index a9f6c0e9c90..f2452420744 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java @@ -25,12 +25,21 @@ package sun.jvm.hotspot.tools; import sun.jvm.hotspot.runtime.*; +import sun.jvm.hotspot.debugger.JVMDebugger; public class JInfo extends Tool { + public JInfo() { + super(); + } + public JInfo(int m) { mode = m; } + public JInfo(JVMDebugger d) { + super(d); + } + protected boolean needsJavaPrefix() { return false; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java index d9ea364edaa..f6f3c0741c0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java @@ -25,6 +25,7 @@ package sun.jvm.hotspot.tools; import java.io.*; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.utilities.*; public class JMap extends Tool { @@ -36,6 +37,10 @@ public class JMap extends Tool { this(MODE_PMAP); } + public JMap(JVMDebugger d) { + super(d); + } + protected boolean needsJavaPrefix() { return false; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java index 95f46445f8a..9301f1059fd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java @@ -25,9 +25,19 @@ package sun.jvm.hotspot.tools; import java.io.*; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.runtime.*; public class JSnap extends Tool { + + public JSnap() { + super(); + } + + public JSnap(JVMDebugger d) { + super(d); + } + public void run() { final PrintStream out = System.out; if (PerfMemory.initialized()) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java index 9e0688cf393..7cbe8f4d945 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java @@ -24,6 +24,8 @@ package sun.jvm.hotspot.tools; +import sun.jvm.hotspot.debugger.JVMDebugger; + public class JStack extends Tool { public JStack(boolean mixedMode, boolean concurrentLocks) { this.mixedMode = mixedMode; @@ -34,6 +36,10 @@ public class JStack extends Tool { this(true, true); } + public JStack(JVMDebugger d) { + super(d); + } + protected boolean needsJavaPrefix() { return false; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java index f03469e13f1..168202eec2c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java @@ -33,6 +33,14 @@ import java.io.PrintStream; an object histogram from a remote or crashed VM. */ public class ObjectHistogram extends Tool { + public ObjectHistogram() { + super(); + } + + public ObjectHistogram(JVMDebugger d) { + super(d); + } + public void run() { run(System.out, System.err); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java index 70bd55513b9..2a234130991 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java @@ -31,6 +31,15 @@ import sun.jvm.hotspot.debugger.cdbg.*; import sun.jvm.hotspot.runtime.*; public class PMap extends Tool { + + public PMap() { + super(); + } + + public PMap(JVMDebugger d) { + super(d); + } + public void run() { run(System.out); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java index 0b3720ff594..7f10612b317 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java @@ -45,6 +45,10 @@ public class PStack extends Tool { this(true, true); } + public PStack(JVMDebugger d) { + super(d); + } + public void run() { run(System.out); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java index 83270bfdeff..eb0cc88d116 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java @@ -45,6 +45,16 @@ public class StackTrace extends Tool { run(System.out); } + public StackTrace(JVMDebugger d) { + super(d); + } + + public StackTrace(JVMDebugger d, boolean v, boolean concurrentLocks) { + super(d); + this.verbose = v; + this.concurrentLocks = concurrentLocks; + } + public void run(java.io.PrintStream tty) { // Ready to go with the database... try { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java index bb4f703c64b..d601fef4401 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java @@ -27,10 +27,19 @@ package sun.jvm.hotspot.tools; import java.io.PrintStream; import java.util.*; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.runtime.*; public class SysPropsDumper extends Tool { + public SysPropsDumper() { + super(); + } + + public SysPropsDumper(JVMDebugger d) { + super(d); + } + public void run() { Properties sysProps = VM.getVM().getSystemProperties(); PrintStream out = System.out; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java index 4279c425bd8..3021801c9dd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java @@ -35,6 +35,7 @@ import sun.jvm.hotspot.debugger.*; public abstract class Tool implements Runnable { private HotSpotAgent agent; + private JVMDebugger jvmDebugger; private int debugeeType; // debugeeType is one of constants below @@ -42,6 +43,13 @@ public abstract class Tool implements Runnable { protected static final int DEBUGEE_CORE = 1; protected static final int DEBUGEE_REMOTE = 2; + public Tool() { + } + + public Tool(JVMDebugger d) { + jvmDebugger = d; + } + public String getName() { return getClass().getName(); } @@ -90,7 +98,6 @@ public abstract class Tool implements Runnable { protected void usage() { printUsage(); - System.exit(1); } /* @@ -106,13 +113,13 @@ public abstract class Tool implements Runnable { protected void stop() { if (agent != null) { agent.detach(); - System.exit(0); } } protected void start(String[] args) { if ((args.length < 1) || (args.length > 2)) { usage(); + return; } // Attempt to handle -h or -help or some invalid flag @@ -185,13 +192,31 @@ public abstract class Tool implements Runnable { } if (e.getMessage() != null) { err.print(e.getMessage()); + e.printStackTrace(); } err.println(); - System.exit(1); + return; } err.println("Debugger attached successfully."); + startInternal(); + } + // When using an existing JVMDebugger. + public void start() { + + if (jvmDebugger == null) { + throw new RuntimeException("Tool.start() called with no JVMDebugger set."); + } + agent = new HotSpotAgent(); + agent.attach(jvmDebugger); + startInternal(); + } + + // Remains of the start mechanism, common to both start methods. + private void startInternal() { + + PrintStream err = System.err; VM vm = VM.getVM(); if (vm.isCore()) { err.println("Core build detected."); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java index 34ccc102acb..96817b26226 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java @@ -25,6 +25,7 @@ package sun.jvm.hotspot.tools.jcore; import java.io.*; +import java.lang.reflect.Constructor; import java.util.jar.JarOutputStream; import java.util.jar.JarEntry; import java.util.jar.Manifest; @@ -38,6 +39,16 @@ public class ClassDump extends Tool { private ClassFilter classFilter; private String outputDirectory; private JarOutputStream jarStream; + private String pkgList; + + public ClassDump() { + super(); + } + + public ClassDump(JVMDebugger d, String pkgList) { + super(d); + this.pkgList = pkgList; + } public void setClassFilter(ClassFilter cf) { classFilter = cf; @@ -63,6 +74,25 @@ public class ClassDump extends Tool { public void run() { // Ready to go with the database... try { + // The name of the filter always comes from a System property. + // If we have a pkgList, pass it, otherwise let the filter read + // its own System property for the list of classes. + String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter", + "sun.jvm.hotspot.tools.jcore.PackageNameFilter"); + try { + Class filterClass = Class.forName(filterClassName); + if (pkgList == null) { + classFilter = (ClassFilter) filterClass.newInstance(); + } else { + Constructor con = filterClass.getConstructor(String.class); + classFilter = (ClassFilter) con.newInstance(pkgList); + } + } catch(Exception exp) { + System.err.println("Warning: Can not create class filter!"); + } + + String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", "."); + setOutputDirectory(outputDirectory); // walk through the system dictionary SystemDictionary dict = VM.getVM().getSystemDictionary(); @@ -139,26 +169,8 @@ public class ClassDump extends Tool { } public static void main(String[] args) { - // load class filters - ClassFilter classFilter = null; - String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter"); - if (filterClassName != null) { - try { - Class filterClass = Class.forName(filterClassName); - classFilter = (ClassFilter) filterClass.newInstance(); - } catch(Exception exp) { - System.err.println("Warning: Can not create class filter!"); - } - } - - String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir"); - if (outputDirectory == null) - outputDirectory = "."; - ClassDump cd = new ClassDump(); - cd.setClassFilter(classFilter); - cd.setOutputDirectory(outputDirectory); cd.start(args); cd.stop(); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java index e46de0194d7..09874af178e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java @@ -24,12 +24,22 @@ package sun.jvm.hotspot.tools.soql; +import sun.jvm.hotspot.debugger.JVMDebugger; import sun.jvm.hotspot.tools.*; import sun.jvm.hotspot.utilities.*; import sun.jvm.hotspot.utilities.soql.*; /** This is command line JavaScript debugger console */ public class JSDB extends Tool { + + public JSDB() { + super(); + } + + public JSDB(JVMDebugger d) { + super(d); + } + public static void main(String[] args) { JSDB jsdb = new JSDB(); jsdb.start(args); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java index 3a4c2470b1b..b3054b90bd0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java @@ -44,6 +44,14 @@ public class SOQL extends Tool { soql.stop(); } + public SOQL() { + super(); + } + + public SOQL(JVMDebugger d) { + super(d); + } + protected SOQLEngine soqlEngine; protected BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); protected PrintStream out = System.out; diff --git a/hotspot/make/bsd/makefiles/build_vm_def.sh b/hotspot/make/bsd/makefiles/build_vm_def.sh index fb9a0d57a78..91918635b26 100644 --- a/hotspot/make/bsd/makefiles/build_vm_def.sh +++ b/hotspot/make/bsd/makefiles/build_vm_def.sh @@ -7,6 +7,6 @@ else NM=nm fi -$NM --defined-only $* | awk ' - { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" } +$NM -Uj $* | awk ' + { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 } ' diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make index 64fa53441b8..36ba062651c 100644 --- a/hotspot/make/bsd/makefiles/gcc.make +++ b/hotspot/make/bsd/makefiles/gcc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -368,8 +368,8 @@ ifeq ($(OS_VENDOR), Darwin) # Standard linker flags LFLAGS += - # Darwin doesn't use ELF and doesn't support version scripts - LDNOMAP = true + # The apple linker has its own variant of mapfiles/version-scripts + MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj SONAMEFLAG = diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-debug b/hotspot/make/bsd/makefiles/mapfile-vers-debug index eb33112062c..d371239ab06 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug @@ -1,7 +1,3 @@ -# -# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35 -# - # # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -23,273 +19,244 @@ # 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. -# # +# +# Only used for OSX/Darwin builds # Define public interface. + # _JNI + _JNI_CreateJavaVM + _JNI_GetCreatedJavaVMs + _JNI_GetDefaultJavaVMInitArgs -SUNWprivate_1.1 { - global: - # JNI - JNI_CreateJavaVM; - JNI_GetCreatedJavaVMs; - JNI_GetDefaultJavaVMInitArgs; + # _JVM + _JVM_Accept + _JVM_ActiveProcessorCount + _JVM_AllocateNewArray + _JVM_AllocateNewObject + _JVM_ArrayCopy + _JVM_AssertionStatusDirectives + _JVM_Available + _JVM_Bind + _JVM_ClassDepth + _JVM_ClassLoaderDepth + _JVM_Clone + _JVM_Close + _JVM_CX8Field + _JVM_CompileClass + _JVM_CompileClasses + _JVM_CompilerCommand + _JVM_Connect + _JVM_ConstantPoolGetClassAt + _JVM_ConstantPoolGetClassAtIfLoaded + _JVM_ConstantPoolGetDoubleAt + _JVM_ConstantPoolGetFieldAt + _JVM_ConstantPoolGetFieldAtIfLoaded + _JVM_ConstantPoolGetFloatAt + _JVM_ConstantPoolGetIntAt + _JVM_ConstantPoolGetLongAt + _JVM_ConstantPoolGetMethodAt + _JVM_ConstantPoolGetMethodAtIfLoaded + _JVM_ConstantPoolGetMemberRefInfoAt + _JVM_ConstantPoolGetSize + _JVM_ConstantPoolGetStringAt + _JVM_ConstantPoolGetUTF8At + _JVM_CountStackFrames + _JVM_CurrentClassLoader + _JVM_CurrentLoadedClass + _JVM_CurrentThread + _JVM_CurrentTimeMillis + _JVM_DefineClass + _JVM_DefineClassWithSource + _JVM_DefineClassWithSourceCond + _JVM_DesiredAssertionStatus + _JVM_DisableCompiler + _JVM_DoPrivileged + _JVM_DTraceGetVersion + _JVM_DTraceActivate + _JVM_DTraceIsProbeEnabled + _JVM_DTraceIsSupported + _JVM_DTraceDispose + _JVM_DumpAllStacks + _JVM_DumpThreads + _JVM_EnableCompiler + _JVM_Exit + _JVM_FillInStackTrace + _JVM_FindClassFromClass + _JVM_FindClassFromClassLoader + _JVM_FindClassFromBootLoader + _JVM_FindLibraryEntry + _JVM_FindLoadedClass + _JVM_FindPrimitiveClass + _JVM_FindSignal + _JVM_FreeMemory + _JVM_GC + _JVM_GetAllThreads + _JVM_GetArrayElement + _JVM_GetArrayLength + _JVM_GetCPClassNameUTF + _JVM_GetCPFieldClassNameUTF + _JVM_GetCPFieldModifiers + _JVM_GetCPFieldNameUTF + _JVM_GetCPFieldSignatureUTF + _JVM_GetCPMethodClassNameUTF + _JVM_GetCPMethodModifiers + _JVM_GetCPMethodNameUTF + _JVM_GetCPMethodSignatureUTF + _JVM_GetCallerClass + _JVM_GetClassAccessFlags + _JVM_GetClassAnnotations + _JVM_GetClassCPEntriesCount + _JVM_GetClassCPTypes + _JVM_GetClassConstantPool + _JVM_GetClassContext + _JVM_GetClassDeclaredConstructors + _JVM_GetClassDeclaredFields + _JVM_GetClassDeclaredMethods + _JVM_GetClassFieldsCount + _JVM_GetClassInterfaces + _JVM_GetClassLoader + _JVM_GetClassMethodsCount + _JVM_GetClassModifiers + _JVM_GetClassName + _JVM_GetClassNameUTF + _JVM_GetClassSignature + _JVM_GetClassSigners + _JVM_GetClassTypeAnnotations + _JVM_GetComponentType + _JVM_GetDeclaredClasses + _JVM_GetDeclaringClass + _JVM_GetEnclosingMethodInfo + _JVM_GetFieldAnnotations + _JVM_GetFieldIxModifiers + _JVM_GetFieldTypeAnnotations + _JVM_GetHostName + _JVM_GetInheritedAccessControlContext + _JVM_GetInterfaceVersion + _JVM_GetLastErrorString + _JVM_GetManagement + _JVM_GetMethodAnnotations + _JVM_GetMethodDefaultAnnotationValue + _JVM_GetMethodIxArgsSize + _JVM_GetMethodIxByteCode + _JVM_GetMethodIxByteCodeLength + _JVM_GetMethodIxExceptionIndexes + _JVM_GetMethodIxExceptionTableEntry + _JVM_GetMethodIxExceptionTableLength + _JVM_GetMethodIxExceptionsCount + _JVM_GetMethodIxLocalsCount + _JVM_GetMethodIxMaxStack + _JVM_GetMethodIxModifiers + _JVM_GetMethodIxNameUTF + _JVM_GetMethodIxSignatureUTF + _JVM_GetMethodParameterAnnotations + _JVM_GetMethodParameters + _JVM_GetMethodTypeAnnotations + _JVM_GetPrimitiveArrayElement + _JVM_GetProtectionDomain + _JVM_GetSockName + _JVM_GetSockOpt + _JVM_GetStackAccessControlContext + _JVM_GetStackTraceDepth + _JVM_GetStackTraceElement + _JVM_GetSystemPackage + _JVM_GetSystemPackages + _JVM_GetThreadStateNames + _JVM_GetThreadStateValues + _JVM_GetVersionInfo + _JVM_Halt + _JVM_HoldsLock + _JVM_IHashCode + _JVM_InitAgentProperties + _JVM_InitProperties + _JVM_InitializeCompiler + _JVM_InitializeSocketLibrary + _JVM_InternString + _JVM_Interrupt + _JVM_InvokeMethod + _JVM_IsArrayClass + _JVM_IsConstructorIx + _JVM_IsInterface + _JVM_IsInterrupted + _JVM_IsNaN + _JVM_IsPrimitiveClass + _JVM_IsSameClassPackage + _JVM_IsSilentCompiler + _JVM_IsSupportedJNIVersion + _JVM_IsThreadAlive + _JVM_IsVMGeneratedMethodIx + _JVM_LatestUserDefinedLoader + _JVM_Listen + _JVM_LoadClass0 + _JVM_LoadLibrary + _JVM_Lseek + _JVM_MaxObjectInspectionAge + _JVM_MaxMemory + _JVM_MonitorNotify + _JVM_MonitorNotifyAll + _JVM_MonitorWait + _JVM_NanoTime + _JVM_NativePath + _JVM_NewArray + _JVM_NewInstanceFromConstructor + _JVM_NewMultiArray + _JVM_OnExit + _JVM_Open + _JVM_RaiseSignal + _JVM_RawMonitorCreate + _JVM_RawMonitorDestroy + _JVM_RawMonitorEnter + _JVM_RawMonitorExit + _JVM_Read + _JVM_Recv + _JVM_RecvFrom + _JVM_RegisterSignal + _JVM_ReleaseUTF + _JVM_ResolveClass + _JVM_ResumeThread + _JVM_Send + _JVM_SendTo + _JVM_SetArrayElement + _JVM_SetClassSigners + _JVM_SetLength + _JVM_SetNativeThreadName + _JVM_SetPrimitiveArrayElement + _JVM_SetProtectionDomain + _JVM_SetSockOpt + _JVM_SetThreadPriority + _JVM_Sleep + _JVM_Socket + _JVM_SocketAvailable + _JVM_SocketClose + _JVM_SocketShutdown + _JVM_StartThread + _JVM_StopThread + _JVM_SuspendThread + _JVM_SupportsCX8 + _JVM_Sync + _JVM_Timeout + _JVM_TotalMemory + _JVM_TraceInstructions + _JVM_TraceMethodCalls + _JVM_UnloadLibrary + _JVM_Write + _JVM_Yield + _JVM_handle_bsd_signal - # JVM - JVM_Accept; - JVM_ActiveProcessorCount; - JVM_AllocateNewArray; - JVM_AllocateNewObject; - JVM_ArrayCopy; - JVM_AssertionStatusDirectives; - JVM_Available; - JVM_Bind; - JVM_ClassDepth; - JVM_ClassLoaderDepth; - JVM_Clone; - JVM_Close; - JVM_CX8Field; - JVM_CompileClass; - JVM_CompileClasses; - JVM_CompilerCommand; - JVM_Connect; - JVM_ConstantPoolGetClassAt; - JVM_ConstantPoolGetClassAtIfLoaded; - JVM_ConstantPoolGetDoubleAt; - JVM_ConstantPoolGetFieldAt; - JVM_ConstantPoolGetFieldAtIfLoaded; - JVM_ConstantPoolGetFloatAt; - JVM_ConstantPoolGetIntAt; - JVM_ConstantPoolGetLongAt; - JVM_ConstantPoolGetMethodAt; - JVM_ConstantPoolGetMethodAtIfLoaded; - JVM_ConstantPoolGetMemberRefInfoAt; - JVM_ConstantPoolGetSize; - JVM_ConstantPoolGetStringAt; - JVM_ConstantPoolGetUTF8At; - JVM_CountStackFrames; - JVM_CurrentClassLoader; - JVM_CurrentLoadedClass; - JVM_CurrentThread; - JVM_CurrentTimeMillis; - JVM_DefineClass; - JVM_DefineClassWithSource; - JVM_DefineClassWithSourceCond; - JVM_DesiredAssertionStatus; - JVM_DisableCompiler; - JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; - JVM_DumpAllStacks; - JVM_DumpThreads; - JVM_EnableCompiler; - JVM_Exit; - JVM_FillInStackTrace; - JVM_FindClassFromClass; - JVM_FindClassFromClassLoader; - JVM_FindClassFromBootLoader; - JVM_FindLibraryEntry; - JVM_FindLoadedClass; - JVM_FindPrimitiveClass; - JVM_FindSignal; - JVM_FreeMemory; - JVM_GC; - JVM_GetAllThreads; - JVM_GetArrayElement; - JVM_GetArrayLength; - JVM_GetCPClassNameUTF; - JVM_GetCPFieldClassNameUTF; - JVM_GetCPFieldModifiers; - JVM_GetCPFieldNameUTF; - JVM_GetCPFieldSignatureUTF; - JVM_GetCPMethodClassNameUTF; - JVM_GetCPMethodModifiers; - JVM_GetCPMethodNameUTF; - JVM_GetCPMethodSignatureUTF; - JVM_GetCallerClass; - JVM_GetClassAccessFlags; - JVM_GetClassAnnotations; - JVM_GetClassCPEntriesCount; - JVM_GetClassCPTypes; - JVM_GetClassConstantPool; - JVM_GetClassContext; - JVM_GetClassDeclaredConstructors; - JVM_GetClassDeclaredFields; - JVM_GetClassDeclaredMethods; - JVM_GetClassFieldsCount; - JVM_GetClassInterfaces; - JVM_GetClassLoader; - JVM_GetClassMethodsCount; - JVM_GetClassModifiers; - JVM_GetClassName; - JVM_GetClassNameUTF; - JVM_GetClassSignature; - JVM_GetClassSigners; - JVM_GetClassTypeAnnotations; - JVM_GetComponentType; - JVM_GetDeclaredClasses; - JVM_GetDeclaringClass; - JVM_GetEnclosingMethodInfo; - JVM_GetFieldAnnotations; - JVM_GetFieldIxModifiers; - JVM_GetFieldTypeAnnotations; - JVM_GetHostName; - JVM_GetInheritedAccessControlContext; - JVM_GetInterfaceVersion; - JVM_GetLastErrorString; - JVM_GetManagement; - JVM_GetMethodAnnotations; - JVM_GetMethodDefaultAnnotationValue; - JVM_GetMethodIxArgsSize; - JVM_GetMethodIxByteCode; - JVM_GetMethodIxByteCodeLength; - JVM_GetMethodIxExceptionIndexes; - JVM_GetMethodIxExceptionTableEntry; - JVM_GetMethodIxExceptionTableLength; - JVM_GetMethodIxExceptionsCount; - JVM_GetMethodIxLocalsCount; - JVM_GetMethodIxMaxStack; - JVM_GetMethodIxModifiers; - JVM_GetMethodIxNameUTF; - JVM_GetMethodIxSignatureUTF; - JVM_GetMethodParameterAnnotations; - JVM_GetMethodParameters; - JVM_GetMethodTypeAnnotations; - JVM_GetPrimitiveArrayElement; - JVM_GetProtectionDomain; - JVM_GetSockName; - JVM_GetSockOpt; - JVM_GetStackAccessControlContext; - JVM_GetStackTraceDepth; - JVM_GetStackTraceElement; - JVM_GetSystemPackage; - JVM_GetSystemPackages; - JVM_GetThreadStateNames; - JVM_GetThreadStateValues; - JVM_GetVersionInfo; - JVM_Halt; - JVM_HoldsLock; - JVM_IHashCode; - JVM_InitAgentProperties; - JVM_InitProperties; - JVM_InitializeCompiler; - JVM_InitializeSocketLibrary; - JVM_InternString; - JVM_Interrupt; - JVM_InvokeMethod; - JVM_IsArrayClass; - JVM_IsConstructorIx; - JVM_IsInterface; - JVM_IsInterrupted; - JVM_IsNaN; - JVM_IsPrimitiveClass; - JVM_IsSameClassPackage; - JVM_IsSilentCompiler; - JVM_IsSupportedJNIVersion; - JVM_IsThreadAlive; - JVM_IsVMGeneratedMethodIx; - JVM_LatestUserDefinedLoader; - JVM_Listen; - JVM_LoadClass0; - JVM_LoadLibrary; - JVM_Lseek; - JVM_MaxObjectInspectionAge; - JVM_MaxMemory; - JVM_MonitorNotify; - JVM_MonitorNotifyAll; - JVM_MonitorWait; - JVM_NanoTime; - JVM_NativePath; - JVM_NewArray; - JVM_NewInstanceFromConstructor; - JVM_NewMultiArray; - JVM_OnExit; - JVM_Open; - JVM_RaiseSignal; - JVM_RawMonitorCreate; - JVM_RawMonitorDestroy; - JVM_RawMonitorEnter; - JVM_RawMonitorExit; - JVM_Read; - JVM_Recv; - JVM_RecvFrom; - JVM_RegisterSignal; - JVM_ReleaseUTF; - JVM_ResolveClass; - JVM_ResumeThread; - JVM_Send; - JVM_SendTo; - JVM_SetArrayElement; - JVM_SetClassSigners; - JVM_SetLength; - JVM_SetPrimitiveArrayElement; - JVM_SetProtectionDomain; - JVM_SetSockOpt; - JVM_SetThreadPriority; - JVM_Sleep; - JVM_Socket; - JVM_SocketAvailable; - JVM_SocketClose; - JVM_SocketShutdown; - JVM_StartThread; - JVM_StopThread; - JVM_SuspendThread; - JVM_SupportsCX8; - JVM_Sync; - JVM_Timeout; - JVM_TotalMemory; - JVM_TraceInstructions; - JVM_TraceMethodCalls; - JVM_UnloadLibrary; - JVM_Write; - JVM_Yield; - JVM_handle_bsd_signal; - - # Old reflection routines - # These do not need to be present in the product build in JDK 1.4 - # but their code has not been removed yet because there will not - # be a substantial code savings until JVM_InvokeMethod and - # JVM_NewInstanceFromConstructor can also be removed; see - # reflectionCompat.hpp. - JVM_GetClassConstructor; - JVM_GetClassConstructors; - JVM_GetClassField; - JVM_GetClassFields; - JVM_GetClassMethod; - JVM_GetClassMethods; - JVM_GetField; - JVM_GetPrimitiveField; - JVM_NewInstance; - JVM_SetField; - JVM_SetPrimitiveField; - - # debug JVM - JVM_AccessVMBooleanFlag; - JVM_AccessVMIntFlag; - JVM_VMBreakPoint; + # debug _JVM + _JVM_AccessVMBooleanFlag + _JVM_AccessVMIntFlag + _JVM_VMBreakPoint # miscellaneous functions - jio_fprintf; - jio_printf; - jio_snprintf; - jio_vfprintf; - jio_vsnprintf; - fork1; - numa_warn; - numa_error; - - # Needed because there is no JVM interface for this. - sysThreadAvailableStackWithSlack; + _jio_fprintf + _jio_printf + _jio_snprintf + _jio_vfprintf + _jio_vsnprintf # This is for Forte Analyzer profiling support. - AsyncGetCallTrace; + _AsyncGetCallTrace # INSERT VTABLE SYMBOLS HERE - local: - *; -}; - diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-product b/hotspot/make/bsd/makefiles/mapfile-vers-product index ace133748b7..ba9cb516620 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-product +++ b/hotspot/make/bsd/makefiles/mapfile-vers-product @@ -1,7 +1,3 @@ -# -# @(#)mapfile-vers-product 1.19 08/02/12 10:56:37 -# - # # Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -23,268 +19,239 @@ # 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. -# # +# +# Only used for OSX/Darwin builds # Define public interface. + # _JNI + _JNI_CreateJavaVM + _JNI_GetCreatedJavaVMs + _JNI_GetDefaultJavaVMInitArgs -SUNWprivate_1.1 { - global: - # JNI - JNI_CreateJavaVM; - JNI_GetCreatedJavaVMs; - JNI_GetDefaultJavaVMInitArgs; - - # JVM - JVM_Accept; - JVM_ActiveProcessorCount; - JVM_AllocateNewArray; - JVM_AllocateNewObject; - JVM_ArrayCopy; - JVM_AssertionStatusDirectives; - JVM_Available; - JVM_Bind; - JVM_ClassDepth; - JVM_ClassLoaderDepth; - JVM_Clone; - JVM_Close; - JVM_CX8Field; - JVM_CompileClass; - JVM_CompileClasses; - JVM_CompilerCommand; - JVM_Connect; - JVM_ConstantPoolGetClassAt; - JVM_ConstantPoolGetClassAtIfLoaded; - JVM_ConstantPoolGetDoubleAt; - JVM_ConstantPoolGetFieldAt; - JVM_ConstantPoolGetFieldAtIfLoaded; - JVM_ConstantPoolGetFloatAt; - JVM_ConstantPoolGetIntAt; - JVM_ConstantPoolGetLongAt; - JVM_ConstantPoolGetMethodAt; - JVM_ConstantPoolGetMethodAtIfLoaded; - JVM_ConstantPoolGetMemberRefInfoAt; - JVM_ConstantPoolGetSize; - JVM_ConstantPoolGetStringAt; - JVM_ConstantPoolGetUTF8At; - JVM_CountStackFrames; - JVM_CurrentClassLoader; - JVM_CurrentLoadedClass; - JVM_CurrentThread; - JVM_CurrentTimeMillis; - JVM_DefineClass; - JVM_DefineClassWithSource; - JVM_DefineClassWithSourceCond; - JVM_DesiredAssertionStatus; - JVM_DisableCompiler; - JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; - JVM_DumpAllStacks; - JVM_DumpThreads; - JVM_EnableCompiler; - JVM_Exit; - JVM_FillInStackTrace; - JVM_FindClassFromClass; - JVM_FindClassFromClassLoader; - JVM_FindClassFromBootLoader; - JVM_FindLibraryEntry; - JVM_FindLoadedClass; - JVM_FindPrimitiveClass; - JVM_FindSignal; - JVM_FreeMemory; - JVM_GC; - JVM_GetAllThreads; - JVM_GetArrayElement; - JVM_GetArrayLength; - JVM_GetCPClassNameUTF; - JVM_GetCPFieldClassNameUTF; - JVM_GetCPFieldModifiers; - JVM_GetCPFieldNameUTF; - JVM_GetCPFieldSignatureUTF; - JVM_GetCPMethodClassNameUTF; - JVM_GetCPMethodModifiers; - JVM_GetCPMethodNameUTF; - JVM_GetCPMethodSignatureUTF; - JVM_GetCallerClass; - JVM_GetClassAccessFlags; - JVM_GetClassAnnotations; - JVM_GetClassCPEntriesCount; - JVM_GetClassCPTypes; - JVM_GetClassConstantPool; - JVM_GetClassContext; - JVM_GetClassDeclaredConstructors; - JVM_GetClassDeclaredFields; - JVM_GetClassDeclaredMethods; - JVM_GetClassFieldsCount; - JVM_GetClassInterfaces; - JVM_GetClassLoader; - JVM_GetClassMethodsCount; - JVM_GetClassModifiers; - JVM_GetClassName; - JVM_GetClassNameUTF; - JVM_GetClassSignature; - JVM_GetClassSigners; - JVM_GetClassTypeAnnotations; - JVM_GetComponentType; - JVM_GetDeclaredClasses; - JVM_GetDeclaringClass; - JVM_GetEnclosingMethodInfo; - JVM_GetFieldAnnotations; - JVM_GetFieldIxModifiers; - JVM_GetFieldTypeAnnotations; - JVM_GetHostName; - JVM_GetInheritedAccessControlContext; - JVM_GetInterfaceVersion; - JVM_GetLastErrorString; - JVM_GetManagement; - JVM_GetMethodAnnotations; - JVM_GetMethodDefaultAnnotationValue; - JVM_GetMethodIxArgsSize; - JVM_GetMethodIxByteCode; - JVM_GetMethodIxByteCodeLength; - JVM_GetMethodIxExceptionIndexes; - JVM_GetMethodIxExceptionTableEntry; - JVM_GetMethodIxExceptionTableLength; - JVM_GetMethodIxExceptionsCount; - JVM_GetMethodIxLocalsCount; - JVM_GetMethodIxMaxStack; - JVM_GetMethodIxModifiers; - JVM_GetMethodIxNameUTF; - JVM_GetMethodIxSignatureUTF; - JVM_GetMethodParameterAnnotations; - JVM_GetMethodParameters; - JVM_GetMethodTypeAnnotations; - JVM_GetPrimitiveArrayElement; - JVM_GetProtectionDomain; - JVM_GetSockName; - JVM_GetSockOpt; - JVM_GetStackAccessControlContext; - JVM_GetStackTraceDepth; - JVM_GetStackTraceElement; - JVM_GetSystemPackage; - JVM_GetSystemPackages; - JVM_GetThreadStateNames; - JVM_GetThreadStateValues; - JVM_GetVersionInfo; - JVM_Halt; - JVM_HoldsLock; - JVM_IHashCode; - JVM_InitAgentProperties; - JVM_InitProperties; - JVM_InitializeCompiler; - JVM_InitializeSocketLibrary; - JVM_InternString; - JVM_Interrupt; - JVM_InvokeMethod; - JVM_IsArrayClass; - JVM_IsConstructorIx; - JVM_IsInterface; - JVM_IsInterrupted; - JVM_IsNaN; - JVM_IsPrimitiveClass; - JVM_IsSameClassPackage; - JVM_IsSilentCompiler; - JVM_IsSupportedJNIVersion; - JVM_IsThreadAlive; - JVM_IsVMGeneratedMethodIx; - JVM_LatestUserDefinedLoader; - JVM_Listen; - JVM_LoadClass0; - JVM_LoadLibrary; - JVM_Lseek; - JVM_MaxObjectInspectionAge; - JVM_MaxMemory; - JVM_MonitorNotify; - JVM_MonitorNotifyAll; - JVM_MonitorWait; - JVM_NanoTime; - JVM_NativePath; - JVM_NewArray; - JVM_NewInstanceFromConstructor; - JVM_NewMultiArray; - JVM_OnExit; - JVM_Open; - JVM_RaiseSignal; - JVM_RawMonitorCreate; - JVM_RawMonitorDestroy; - JVM_RawMonitorEnter; - JVM_RawMonitorExit; - JVM_Read; - JVM_Recv; - JVM_RecvFrom; - JVM_RegisterSignal; - JVM_ReleaseUTF; - JVM_ResolveClass; - JVM_ResumeThread; - JVM_Send; - JVM_SendTo; - JVM_SetArrayElement; - JVM_SetClassSigners; - JVM_SetLength; - JVM_SetPrimitiveArrayElement; - JVM_SetProtectionDomain; - JVM_SetSockOpt; - JVM_SetThreadPriority; - JVM_Sleep; - JVM_Socket; - JVM_SocketAvailable; - JVM_SocketClose; - JVM_SocketShutdown; - JVM_StartThread; - JVM_StopThread; - JVM_SuspendThread; - JVM_SupportsCX8; - JVM_Sync; - JVM_Timeout; - JVM_TotalMemory; - JVM_TraceInstructions; - JVM_TraceMethodCalls; - JVM_UnloadLibrary; - JVM_Write; - JVM_Yield; - JVM_handle_bsd_signal; - - # Old reflection routines - # These do not need to be present in the product build in JDK 1.4 - # but their code has not been removed yet because there will not - # be a substantial code savings until JVM_InvokeMethod and - # JVM_NewInstanceFromConstructor can also be removed; see - # reflectionCompat.hpp. - JVM_GetClassConstructor; - JVM_GetClassConstructors; - JVM_GetClassField; - JVM_GetClassFields; - JVM_GetClassMethod; - JVM_GetClassMethods; - JVM_GetField; - JVM_GetPrimitiveField; - JVM_NewInstance; - JVM_SetField; - JVM_SetPrimitiveField; + # _JVM + _JVM_Accept + _JVM_ActiveProcessorCount + _JVM_AllocateNewArray + _JVM_AllocateNewObject + _JVM_ArrayCopy + _JVM_AssertionStatusDirectives + _JVM_Available + _JVM_Bind + _JVM_ClassDepth + _JVM_ClassLoaderDepth + _JVM_Clone + _JVM_Close + _JVM_CX8Field + _JVM_CompileClass + _JVM_CompileClasses + _JVM_CompilerCommand + _JVM_Connect + _JVM_ConstantPoolGetClassAt + _JVM_ConstantPoolGetClassAtIfLoaded + _JVM_ConstantPoolGetDoubleAt + _JVM_ConstantPoolGetFieldAt + _JVM_ConstantPoolGetFieldAtIfLoaded + _JVM_ConstantPoolGetFloatAt + _JVM_ConstantPoolGetIntAt + _JVM_ConstantPoolGetLongAt + _JVM_ConstantPoolGetMethodAt + _JVM_ConstantPoolGetMethodAtIfLoaded + _JVM_ConstantPoolGetMemberRefInfoAt + _JVM_ConstantPoolGetSize + _JVM_ConstantPoolGetStringAt + _JVM_ConstantPoolGetUTF8At + _JVM_CountStackFrames + _JVM_CurrentClassLoader + _JVM_CurrentLoadedClass + _JVM_CurrentThread + _JVM_CurrentTimeMillis + _JVM_DefineClass + _JVM_DefineClassWithSource + _JVM_DefineClassWithSourceCond + _JVM_DesiredAssertionStatus + _JVM_DisableCompiler + _JVM_DoPrivileged + _JVM_DTraceGetVersion + _JVM_DTraceActivate + _JVM_DTraceIsProbeEnabled + _JVM_DTraceIsSupported + _JVM_DTraceDispose + _JVM_DumpAllStacks + _JVM_DumpThreads + _JVM_EnableCompiler + _JVM_Exit + _JVM_FillInStackTrace + _JVM_FindClassFromClass + _JVM_FindClassFromClassLoader + _JVM_FindClassFromBootLoader + _JVM_FindLibraryEntry + _JVM_FindLoadedClass + _JVM_FindPrimitiveClass + _JVM_FindSignal + _JVM_FreeMemory + _JVM_GC + _JVM_GetAllThreads + _JVM_GetArrayElement + _JVM_GetArrayLength + _JVM_GetCPClassNameUTF + _JVM_GetCPFieldClassNameUTF + _JVM_GetCPFieldModifiers + _JVM_GetCPFieldNameUTF + _JVM_GetCPFieldSignatureUTF + _JVM_GetCPMethodClassNameUTF + _JVM_GetCPMethodModifiers + _JVM_GetCPMethodNameUTF + _JVM_GetCPMethodSignatureUTF + _JVM_GetCallerClass + _JVM_GetClassAccessFlags + _JVM_GetClassAnnotations + _JVM_GetClassCPEntriesCount + _JVM_GetClassCPTypes + _JVM_GetClassConstantPool + _JVM_GetClassContext + _JVM_GetClassDeclaredConstructors + _JVM_GetClassDeclaredFields + _JVM_GetClassDeclaredMethods + _JVM_GetClassFieldsCount + _JVM_GetClassInterfaces + _JVM_GetClassLoader + _JVM_GetClassMethodsCount + _JVM_GetClassModifiers + _JVM_GetClassName + _JVM_GetClassNameUTF + _JVM_GetClassSignature + _JVM_GetClassSigners + _JVM_GetClassTypeAnnotations + _JVM_GetComponentType + _JVM_GetDeclaredClasses + _JVM_GetDeclaringClass + _JVM_GetEnclosingMethodInfo + _JVM_GetFieldAnnotations + _JVM_GetFieldIxModifiers + _JVM_GetFieldTypeAnnotations + _JVM_GetHostName + _JVM_GetInheritedAccessControlContext + _JVM_GetInterfaceVersion + _JVM_GetLastErrorString + _JVM_GetManagement + _JVM_GetMethodAnnotations + _JVM_GetMethodDefaultAnnotationValue + _JVM_GetMethodIxArgsSize + _JVM_GetMethodIxByteCode + _JVM_GetMethodIxByteCodeLength + _JVM_GetMethodIxExceptionIndexes + _JVM_GetMethodIxExceptionTableEntry + _JVM_GetMethodIxExceptionTableLength + _JVM_GetMethodIxExceptionsCount + _JVM_GetMethodIxLocalsCount + _JVM_GetMethodIxMaxStack + _JVM_GetMethodIxModifiers + _JVM_GetMethodIxNameUTF + _JVM_GetMethodIxSignatureUTF + _JVM_GetMethodParameterAnnotations + _JVM_GetMethodParameters + _JVM_GetMethodTypeAnnotations + _JVM_GetPrimitiveArrayElement + _JVM_GetProtectionDomain + _JVM_GetSockName + _JVM_GetSockOpt + _JVM_GetStackAccessControlContext + _JVM_GetStackTraceDepth + _JVM_GetStackTraceElement + _JVM_GetSystemPackage + _JVM_GetSystemPackages + _JVM_GetThreadStateNames + _JVM_GetThreadStateValues + _JVM_GetVersionInfo + _JVM_Halt + _JVM_HoldsLock + _JVM_IHashCode + _JVM_InitAgentProperties + _JVM_InitProperties + _JVM_InitializeCompiler + _JVM_InitializeSocketLibrary + _JVM_InternString + _JVM_Interrupt + _JVM_InvokeMethod + _JVM_IsArrayClass + _JVM_IsConstructorIx + _JVM_IsInterface + _JVM_IsInterrupted + _JVM_IsNaN + _JVM_IsPrimitiveClass + _JVM_IsSameClassPackage + _JVM_IsSilentCompiler + _JVM_IsSupportedJNIVersion + _JVM_IsThreadAlive + _JVM_IsVMGeneratedMethodIx + _JVM_LatestUserDefinedLoader + _JVM_Listen + _JVM_LoadClass0 + _JVM_LoadLibrary + _JVM_Lseek + _JVM_MaxObjectInspectionAge + _JVM_MaxMemory + _JVM_MonitorNotify + _JVM_MonitorNotifyAll + _JVM_MonitorWait + _JVM_NanoTime + _JVM_NativePath + _JVM_NewArray + _JVM_NewInstanceFromConstructor + _JVM_NewMultiArray + _JVM_OnExit + _JVM_Open + _JVM_RaiseSignal + _JVM_RawMonitorCreate + _JVM_RawMonitorDestroy + _JVM_RawMonitorEnter + _JVM_RawMonitorExit + _JVM_Read + _JVM_Recv + _JVM_RecvFrom + _JVM_RegisterSignal + _JVM_ReleaseUTF + _JVM_ResolveClass + _JVM_ResumeThread + _JVM_Send + _JVM_SendTo + _JVM_SetArrayElement + _JVM_SetClassSigners + _JVM_SetLength + _JVM_SetNativeThreadName + _JVM_SetPrimitiveArrayElement + _JVM_SetProtectionDomain + _JVM_SetSockOpt + _JVM_SetThreadPriority + _JVM_Sleep + _JVM_Socket + _JVM_SocketAvailable + _JVM_SocketClose + _JVM_SocketShutdown + _JVM_StartThread + _JVM_StopThread + _JVM_SuspendThread + _JVM_SupportsCX8 + _JVM_Sync + _JVM_Timeout + _JVM_TotalMemory + _JVM_TraceInstructions + _JVM_TraceMethodCalls + _JVM_UnloadLibrary + _JVM_Write + _JVM_Yield + _JVM_handle_bsd_signal # miscellaneous functions - jio_fprintf; - jio_printf; - jio_snprintf; - jio_vfprintf; - jio_vsnprintf; - fork1; - numa_warn; - numa_error; - - # Needed because there is no JVM interface for this. - sysThreadAvailableStackWithSlack; + _jio_fprintf + _jio_printf + _jio_snprintf + _jio_vfprintf + _jio_vsnprintf # This is for Forte Analyzer profiling support. - AsyncGetCallTrace; + _AsyncGetCallTrace - # INSERT VTABLE SYMBOLS HERE - - local: - *; -}; + # INSERT VTABLE SYMBOLS HERE diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make index 88bab5c39ad..7cc879a3d7b 100644 --- a/hotspot/make/excludeSrc.make +++ b/hotspot/make/excludeSrc.make @@ -112,3 +112,5 @@ ifeq ($(INCLUDE_NMT), false) endif -include $(HS_ALT_MAKE)/excludeSrc.make + +.PHONY: $(HS_ALT_MAKE)/excludeSrc.make diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index e16392a9273..b597ff990be 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=37 +HS_BUILD_NUMBER=40 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index 6ef416dfbec..38cf2c03492 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -214,7 +214,7 @@ ifeq ($(USE_CLANG), true) WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body endif -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value ifeq ($(USE_CLANG),) # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit @@ -350,9 +350,9 @@ else ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) ifeq ($(USE_CLANG), true) # Clang doesn't understand -gstabs - OPT_CFLAGS += -g + DEBUG_CFLAGS += -g else - OPT_CFLAGS += -gstabs + DEBUG_CFLAGS += -gstabs endif endif @@ -365,9 +365,9 @@ else ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) ifeq ($(USE_CLANG), true) # Clang doesn't understand -gstabs - OPT_CFLAGS += -g + FASTDEBUG_CFLAGS += -g else - OPT_CFLAGS += -gstabs + FASTDEBUG_CFLAGS += -gstabs endif endif diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index d9db77744a4..3c3bd2e2d16 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -107,6 +107,10 @@ CXXFLAGS/BYFILE = $(CXXFLAGS/$@) # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN/BYFILE) diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index d57716c7aab..b3939fbe144 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -95,6 +95,10 @@ CXXFLAGS/BYFILE = $(CXXFLAGS/$@) # File specific flags CXXFLAGS += $(CXXFLAGS/BYFILE) +# Large File Support +ifneq ($(LP64), 1) +CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 +endif # ifneq ($(LP64), 1) # CFLAGS_WARN holds compiler options to suppress/enable warnings. CFLAGS += $(CFLAGS_WARN) diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index 5541eb865b2..3192a855569 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -57,7 +57,6 @@ class Assembler : public AbstractAssembler { fbp_op2 = 5, br_op2 = 2, bp_op2 = 1, - cb_op2 = 7, // V8 sethi_op2 = 4 }; @@ -145,7 +144,6 @@ class Assembler : public AbstractAssembler { ldsh_op3 = 0x0a, ldx_op3 = 0x0b, - ldstub_op3 = 0x0d, stx_op3 = 0x0e, swap_op3 = 0x0f, @@ -163,15 +161,6 @@ class Assembler : public AbstractAssembler { prefetch_op3 = 0x2d, - - ldc_op3 = 0x30, - ldcsr_op3 = 0x31, - lddc_op3 = 0x33, - stc_op3 = 0x34, - stcsr_op3 = 0x35, - stdcq_op3 = 0x36, - stdc_op3 = 0x37, - casa_op3 = 0x3c, casxa_op3 = 0x3e, @@ -574,17 +563,11 @@ class Assembler : public AbstractAssembler { static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); } // instruction only in v9 - static void v9_only() { assert( VM_Version::v9_instructions_work(), "This instruction only works on SPARC V9"); } - - // instruction only in v8 - static void v8_only() { assert( VM_Version::v8_instructions_work(), "This instruction only works on SPARC V8"); } + static void v9_only() { } // do nothing // instruction deprecated in v9 static void v9_dep() { } // do nothing for now - // some float instructions only exist for single prec. on v8 - static void v8_s_only(FloatRegisterImpl::Width w) { if (w != FloatRegisterImpl::S) v9_only(); } - // v8 has no CC field static void v8_no_cc(CC cc) { if (cc) v9_only(); } @@ -730,11 +713,6 @@ public: inline void bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); inline void bp( Condition c, bool a, CC cc, Predict p, Label& L ); - // pp 121 (V8) - - inline void cb( Condition c, bool a, address d, relocInfo::relocType rt = relocInfo::none ); - inline void cb( Condition c, bool a, Label& L ); - // pp 149 inline void call( address d, relocInfo::relocType rt = relocInfo::runtime_call_type ); @@ -775,8 +753,8 @@ public: // pp 157 - void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); } - void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { v8_no_cc(cc); emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); } + void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); } + void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); } // pp 159 @@ -794,21 +772,11 @@ public: // pp 162 - void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); } + void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); } - void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); } + void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); } - // page 144 sparc v8 architecture (double prec works on v8 if the source and destination registers are the same). fnegs is the only instruction available - // on v8 to do negation of single, double and quad precision floats. - - void fneg( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(sd, w)); else emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x05) | fs2(sd, w)); } - - void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v8_s_only(w); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); } - - // page 144 sparc v8 architecture (double prec works on v8 if the source and destination registers are the same). fabss is the only instruction available - // on v8 to do abs operation on single/double/quad precision floats. - - void fabs( FloatRegisterImpl::Width w, FloatRegister sd ) { if (VM_Version::v9_instructions_work()) emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(sd, w)); else emit_int32( op(arith_op) | fd(sd, w) | op3(fpop1_op3) | opf(0x09) | fs2(sd, w)); } + void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); } // pp 163 @@ -839,11 +807,6 @@ public: void impdep1( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); } void impdep2( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); } - // pp 149 (v8) - - void cpop1( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_int32( op(arith_op) | fcn(crd) | op3(impdep1_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); } - void cpop2( int opc, int cr1, int cr2, int crd ) { v8_only(); emit_int32( op(arith_op) | fcn(crd) | op3(impdep2_op3) | u_field(cr1, 18, 14) | opf(opc) | u_field(cr2, 4, 0)); } - // pp 170 void jmpl( Register s1, Register s2, Register d ); @@ -860,16 +823,6 @@ public: inline void ldxfsr( Register s1, Register s2 ); inline void ldxfsr( Register s1, int simm13a); - // pp 94 (v8) - - inline void ldc( Register s1, Register s2, int crd ); - inline void ldc( Register s1, int simm13a, int crd); - inline void lddc( Register s1, Register s2, int crd ); - inline void lddc( Register s1, int simm13a, int crd); - inline void ldcsr( Register s1, Register s2, int crd ); - inline void ldcsr( Register s1, int simm13a, int crd); - - // 173 void ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } @@ -910,18 +863,6 @@ public: void lduwa( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } void ldxa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } void ldxa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void ldda( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldda( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - - // pp 179 - - inline void ldstub( Register s1, Register s2, Register d ); - inline void ldstub( Register s1, int simm13a, Register d); - - // pp 180 - - void ldstuba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldstuba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } // pp 181 @@ -992,11 +933,6 @@ public: void smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } void smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - // pp 199 - - void mulscc( Register s1, Register s2, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | rs2(s2) ); } - void mulscc( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(mulscc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - // pp 201 void nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); } @@ -1116,17 +1052,6 @@ public: void stda( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } void stda( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - // pp 97 (v8) - - inline void stc( int crd, Register s1, Register s2 ); - inline void stc( int crd, Register s1, int simm13a); - inline void stdc( int crd, Register s1, Register s2 ); - inline void stdc( int crd, Register s1, int simm13a); - inline void stcsr( int crd, Register s1, Register s2 ); - inline void stcsr( int crd, Register s1, int simm13a); - inline void stdcq( int crd, Register s1, Register s2 ); - inline void stdcq( int crd, Register s1, int simm13a); - // pp 230 void sub( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); } @@ -1153,20 +1078,16 @@ public: void taddcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | rs2(s2) ); } void taddcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void taddcctv( Register s1, Register s2, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | rs2(s2) ); } - void taddcctv( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(taddcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } // pp 235 void tsubcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | rs2(s2) ); } void tsubcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void tsubcctv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | rs2(s2) ); } - void tsubcctv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcctv_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } // pp 237 - void trap( Condition c, CC cc, Register s1, Register s2 ) { v8_no_cc(cc); emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); } - void trap( Condition c, CC cc, Register s1, int trapa ) { v8_no_cc(cc); emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); } + void trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); } + void trap( Condition c, CC cc, Register s1, int trapa ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); } // simple uncond. trap void trap( int trapa ) { trap( always, icc, G0, trapa ); } diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp index 23904f9e1f2..ade531a3f82 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp @@ -63,9 +63,6 @@ inline void Assembler::fb( Condition c, bool a, Label& L ) { fb(c, a, target(L)) inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); } inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { fbp(c, a, cc, p, target(L)); } -inline void Assembler::cb( Condition c, bool a, address d, relocInfo::relocType rt ) { v8_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(cb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); } -inline void Assembler::cb( Condition c, bool a, Label& L ) { cb(c, a, target(L)); } - inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); } inline void Assembler::br( Condition c, bool a, Label& L ) { br(c, a, target(L)); } @@ -88,18 +85,9 @@ inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHol inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); } -inline void Assembler::ldfsr( Register s1, Register s2) { v9_dep(); emit_int32( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::ldfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::ldc( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | rs2(s2) ); } -inline void Assembler::ldc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::lddc( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | rs2(s2) ); } -inline void Assembler::lddc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::ldcsr( Register s1, Register s2, int crd) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::ldcsr( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } - inline void Assembler::ldsb( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldsb( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } @@ -119,9 +107,6 @@ inline void Assembler::ldx( Register s1, int simm13a, Register d) { v9_only(); inline void Assembler::ldd( Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldd( Register s1, int simm13a, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::ldstub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } - inline void Assembler::rett( Register s1, Register s2 ) { cti(); emit_int32( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } inline void Assembler::rett( Register s1, int simm13a, relocInfo::relocType rt) { cti(); emit_data( op(arith_op) | op3(rett_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rt); has_delay_slot(); } @@ -132,8 +117,6 @@ inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rs inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); } inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::stfsr( Register s1, Register s2) { v9_dep(); emit_int32( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::stfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } inline void Assembler::stxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::stxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } @@ -152,17 +135,6 @@ inline void Assembler::stx( Register d, Register s1, int simm13a) { v9_only(); inline void Assembler::std( Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::std( Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -// v8 p 99 - -inline void Assembler::stc( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | rs2(s2) ); } -inline void Assembler::stc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::stdc( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::stdc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::stcsr( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::stcsr( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } -inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_int32( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); } -inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } - // pp 231 inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 7c4c54ea37f..64745015923 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -597,13 +597,6 @@ void LIR_Assembler::emit_op3(LIR_Op3* op) { __ sra(Rdividend, 31, Rscratch); __ wry(Rscratch); - if (!VM_Version::v9_instructions_work()) { - // v9 doesn't require these nops - __ nop(); - __ nop(); - __ nop(); - __ nop(); - } add_debug_info_for_div0_here(op->info()); @@ -652,10 +645,6 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { case lir_cond_lessEqual: acond = (is_unordered ? Assembler::f_unorderedOrLessOrEqual : Assembler::f_lessOrEqual); break; case lir_cond_greaterEqual: acond = (is_unordered ? Assembler::f_unorderedOrGreaterOrEqual: Assembler::f_greaterOrEqual); break; default : ShouldNotReachHere(); - }; - - if (!VM_Version::v9_instructions_work()) { - __ nop(); } __ fb( acond, false, Assembler::pn, *(op->label())); } else { @@ -725,9 +714,6 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { Label L; // result must be 0 if value is NaN; test by comparing value to itself __ fcmp(FloatRegisterImpl::S, Assembler::fcc0, rsrc, rsrc); - if (!VM_Version::v9_instructions_work()) { - __ nop(); - } __ fb(Assembler::f_unordered, true, Assembler::pn, L); __ delayed()->st(G0, addr); // annuled if contents of rsrc is not NaN __ ftoi(FloatRegisterImpl::S, rsrc, rsrc); @@ -1909,7 +1895,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr switch (code) { case lir_add: __ add (lreg, rreg, res); break; case lir_sub: __ sub (lreg, rreg, res); break; - case lir_mul: __ mult (lreg, rreg, res); break; + case lir_mul: __ mulx (lreg, rreg, res); break; default: ShouldNotReachHere(); } } @@ -1924,7 +1910,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr switch (code) { case lir_add: __ add (lreg, simm13, res); break; case lir_sub: __ sub (lreg, simm13, res); break; - case lir_mul: __ mult (lreg, simm13, res); break; + case lir_mul: __ mulx (lreg, simm13, res); break; default: ShouldNotReachHere(); } } else { @@ -1936,7 +1922,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr switch (code) { case lir_add: __ add (lreg, (int)con, res); break; case lir_sub: __ sub (lreg, (int)con, res); break; - case lir_mul: __ mult (lreg, (int)con, res); break; + case lir_mul: __ mulx (lreg, (int)con, res); break; default: ShouldNotReachHere(); } } @@ -2960,6 +2946,9 @@ void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst_opr) { } } +void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) { + fatal("CRC32 intrinsic is not implemented on this platform"); +} void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register obj = op->obj_opr()->as_register(); @@ -3234,48 +3223,26 @@ void LIR_Assembler::volatile_move_op(LIR_Opr src, LIR_Opr dest, BasicType type, Register base = mem_addr->base()->as_register(); if (src->is_register() && dest->is_address()) { // G4 is high half, G5 is low half - if (VM_Version::v9_instructions_work()) { - // clear the top bits of G5, and scale up G4 - __ srl (src->as_register_lo(), 0, G5); - __ sllx(src->as_register_hi(), 32, G4); - // combine the two halves into the 64 bits of G4 - __ or3(G4, G5, G4); - null_check_offset = __ offset(); - if (idx == noreg) { - __ stx(G4, base, disp); - } else { - __ stx(G4, base, idx); - } + // clear the top bits of G5, and scale up G4 + __ srl (src->as_register_lo(), 0, G5); + __ sllx(src->as_register_hi(), 32, G4); + // combine the two halves into the 64 bits of G4 + __ or3(G4, G5, G4); + null_check_offset = __ offset(); + if (idx == noreg) { + __ stx(G4, base, disp); } else { - __ mov (src->as_register_hi(), G4); - __ mov (src->as_register_lo(), G5); - null_check_offset = __ offset(); - if (idx == noreg) { - __ std(G4, base, disp); - } else { - __ std(G4, base, idx); - } + __ stx(G4, base, idx); } } else if (src->is_address() && dest->is_register()) { null_check_offset = __ offset(); - if (VM_Version::v9_instructions_work()) { - if (idx == noreg) { - __ ldx(base, disp, G5); - } else { - __ ldx(base, idx, G5); - } - __ srax(G5, 32, dest->as_register_hi()); // fetch the high half into hi - __ mov (G5, dest->as_register_lo()); // copy low half into lo + if (idx == noreg) { + __ ldx(base, disp, G5); } else { - if (idx == noreg) { - __ ldd(base, disp, G4); - } else { - __ ldd(base, idx, G4); - } - // G4 is high half, G5 is low half - __ mov (G4, dest->as_register_hi()); - __ mov (G5, dest->as_register_lo()); + __ ldx(base, idx, G5); } + __ srax(G5, 32, dest->as_register_hi()); // fetch the high half into hi + __ mov (G5, dest->as_register_lo()); // copy low half into lo } else { Unimplemented(); } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index 82cc696e8b7..dc3bc8691ac 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -784,6 +784,10 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) { set_no_result(x); } +void LIRGenerator::do_update_CRC32(Intrinsic* x) { + fatal("CRC32 intrinsic is not implemented on this platform"); +} + // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f // _i2b, _i2c, _i2s void LIRGenerator::do_Convert(Convert* x) { diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 05db22c93f9..bf4074b30fd 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -108,7 +108,7 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox // compare object markOop with Rmark and if equal exchange Rscratch with object markOop assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casx_under_lock(mark_addr.base(), Rmark, Rscratch, (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), Rmark, Rscratch); // if compare/exchange succeeded we found an unlocked object and we now have locked it // hence we are done cmp(Rmark, Rscratch); @@ -149,7 +149,7 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb // Check if it is still a light weight lock, this is is true if we see // the stack address of the basicLock in the markOop of the object - casx_under_lock(mark_addr.base(), Rbox, Rmark, (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), Rbox, Rmark); cmp(Rbox, Rmark); brx(Assembler::notEqual, false, Assembler::pn, slow_case); @@ -276,7 +276,7 @@ void C1_MacroAssembler::initialize_object( sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body initialize_body(t1, t2); #ifndef _LP64 - } else if (VM_Version::v9_instructions_work() && con_size_in_bytes < threshold * 2) { + } else if (con_size_in_bytes < threshold * 2) { // on v9 we can do double word stores to fill twice as much space. assert(hdr_size_in_bytes % 8 == 0, "double word aligned"); assert(con_size_in_bytes % 8 == 0, "double word aligned"); diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp index a43a9cee538..c6cf521272d 100644 --- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp @@ -49,8 +49,9 @@ define_pd_global(intx, FreqInlineSize, 325 ); define_pd_global(bool, ResizeTLAB, true ); define_pd_global(intx, ReservedCodeCacheSize, 32*M ); define_pd_global(intx, CodeCacheExpansionSize, 32*K ); -define_pd_global(uintx,CodeCacheMinBlockLength, 1); -define_pd_global(uintx,MetaspaceSize, 12*M ); +define_pd_global(uintx, CodeCacheMinBlockLength, 1); +define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); +define_pd_global(uintx, MetaspaceSize, 12*M ); define_pd_global(bool, NeverActAsServerClassMachine, true ); define_pd_global(intx, NewSizeThreadIncrease, 16*K ); define_pd_global(uint64_t,MaxRAM, 1ULL*G); diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index c642e915fe1..e32094deb06 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -86,7 +86,8 @@ define_pd_global(intx, CodeCacheExpansionSize, 32*K); // Ergonomics related flags define_pd_global(uint64_t,MaxRAM, 4ULL*G); #endif -define_pd_global(uintx,CodeCacheMinBlockLength, 4); +define_pd_global(uintx, CodeCacheMinBlockLength, 4); +define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); // Heap related flags define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(16*M)); diff --git a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp index 685a39dbf0f..6ad04df863d 100644 --- a/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp @@ -30,5 +30,4 @@ void Compile::pd_compiler2_init() { guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" ); - guarantee( VM_Version::v9_instructions_work(), "Server compiler does not run on V8 systems" ); } diff --git a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp index 761d0e3810e..a1f576b26a7 100644 --- a/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp @@ -30,8 +30,7 @@ } static const char* pd_cpu_opts() { - return (VM_Version::v9_instructions_work()? - (VM_Version::v8_instructions_work()? "" : "v9only") : "v8only"); + return "v9only"; } #endif // CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index b550d77a8bf..ac9746679b3 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -257,11 +257,6 @@ bool frame::safe_for_sender(JavaThread *thread) { return false; } - // Could be a zombie method - if (sender_blob->is_zombie() || sender_blob->is_unloaded()) { - return false; - } - // It should be safe to construct the sender though it might not be valid frame sender(_SENDER_SP, younger_sp, adjusted_stack); @@ -680,7 +675,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // validate ConstantPoolCache* ConstantPoolCache* cp = *interpreter_frame_cache_addr(); - if (cp == NULL || !cp->is_metadata()) return false; + if (cp == NULL || !cp->is_metaspace_object()) return false; // validate locals diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 35886ce8ea9..acffc90f2cf 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -110,8 +110,5 @@ define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS \ product(uintx, ArraycopyDstPrefetchDistance, 0, \ "Distance to prefetch destination array in arracopy") \ - \ - develop(intx, V8AtomicOperationUnderLockSpinCount, 50, \ - "Number of times to spin wait on a v8 atomic operation lock") \ #endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 9775d2f871a..454b23c920b 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -1210,8 +1210,7 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg, Register Object) st_ptr(mark_reg, lock_addr, BasicLock::displaced_header_offset_in_bytes()); // compare and exchange object_addr, markOop | 1, stack address of basicLock assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casx_under_lock(mark_addr.base(), mark_reg, temp_reg, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), mark_reg, temp_reg); // if the compare and exchange succeeded we are done (we saw an unlocked object) cmp_and_brx_short(mark_reg, temp_reg, Assembler::equal, Assembler::pt, done); @@ -1291,8 +1290,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { // we expect to see the stack address of the basicLock in case the // lock is still a light weight lock (lock_reg) assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casx_under_lock(mark_addr.base(), lock_reg, displaced_header_reg, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), lock_reg, displaced_header_reg); cmp(lock_reg, displaced_header_reg); brx(Assembler::equal, true, Assembler::pn, done); delayed()->st_ptr(G0, lockobj_addr); // free entry diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 578650a3419..022e67ba203 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -118,7 +118,6 @@ int MacroAssembler::patched_branch(int dest_pos, int inst, int inst_pos) { case bp_op2: m = wdisp( word_aligned_ones, 0, 19); v = wdisp( dest_pos, inst_pos, 19); break; case fb_op2: m = wdisp( word_aligned_ones, 0, 22); v = wdisp( dest_pos, inst_pos, 22); break; case br_op2: m = wdisp( word_aligned_ones, 0, 22); v = wdisp( dest_pos, inst_pos, 22); break; - case cb_op2: m = wdisp( word_aligned_ones, 0, 22); v = wdisp( dest_pos, inst_pos, 22); break; case bpr_op2: { if (is_cbcond(inst)) { m = wdisp10(word_aligned_ones, 0); @@ -149,7 +148,6 @@ int MacroAssembler::branch_destination(int inst, int pos) { case bp_op2: r = inv_wdisp( inst, pos, 19); break; case fb_op2: r = inv_wdisp( inst, pos, 22); break; case br_op2: r = inv_wdisp( inst, pos, 22); break; - case cb_op2: r = inv_wdisp( inst, pos, 22); break; case bpr_op2: { if (is_cbcond(inst)) { r = inv_wdisp10(inst, pos); @@ -325,12 +323,6 @@ void MacroAssembler::breakpoint_trap() { trap(ST_RESERVED_FOR_USER_0); } -// flush windows (except current) using flushw instruction if avail. -void MacroAssembler::flush_windows() { - if (VM_Version::v9_instructions_work()) flushw(); - else flush_windows_trap(); -} - // Write serialization page so VM thread can do a pseudo remote membar // We use the current thread pointer to calculate a thread specific // offset to write to within the page. This minimizes bus traffic @@ -358,88 +350,6 @@ void MacroAssembler::leave() { Unimplemented(); } -void MacroAssembler::mult(Register s1, Register s2, Register d) { - if(VM_Version::v9_instructions_work()) { - mulx (s1, s2, d); - } else { - smul (s1, s2, d); - } -} - -void MacroAssembler::mult(Register s1, int simm13a, Register d) { - if(VM_Version::v9_instructions_work()) { - mulx (s1, simm13a, d); - } else { - smul (s1, simm13a, d); - } -} - - -#ifdef ASSERT -void MacroAssembler::read_ccr_v8_assert(Register ccr_save) { - const Register s1 = G3_scratch; - const Register s2 = G4_scratch; - Label get_psr_test; - // Get the condition codes the V8 way. - read_ccr_trap(s1); - mov(ccr_save, s2); - // This is a test of V8 which has icc but not xcc - // so mask off the xcc bits - and3(s2, 0xf, s2); - // Compare condition codes from the V8 and V9 ways. - subcc(s2, s1, G0); - br(Assembler::notEqual, true, Assembler::pt, get_psr_test); - delayed()->breakpoint_trap(); - bind(get_psr_test); -} - -void MacroAssembler::write_ccr_v8_assert(Register ccr_save) { - const Register s1 = G3_scratch; - const Register s2 = G4_scratch; - Label set_psr_test; - // Write out the saved condition codes the V8 way - write_ccr_trap(ccr_save, s1, s2); - // Read back the condition codes using the V9 instruction - rdccr(s1); - mov(ccr_save, s2); - // This is a test of V8 which has icc but not xcc - // so mask off the xcc bits - and3(s2, 0xf, s2); - and3(s1, 0xf, s1); - // Compare the V8 way with the V9 way. - subcc(s2, s1, G0); - br(Assembler::notEqual, true, Assembler::pt, set_psr_test); - delayed()->breakpoint_trap(); - bind(set_psr_test); -} -#else -#define read_ccr_v8_assert(x) -#define write_ccr_v8_assert(x) -#endif // ASSERT - -void MacroAssembler::read_ccr(Register ccr_save) { - if (VM_Version::v9_instructions_work()) { - rdccr(ccr_save); - // Test code sequence used on V8. Do not move above rdccr. - read_ccr_v8_assert(ccr_save); - } else { - read_ccr_trap(ccr_save); - } -} - -void MacroAssembler::write_ccr(Register ccr_save) { - if (VM_Version::v9_instructions_work()) { - // Test code sequence used on V8. Do not move below wrccr. - write_ccr_v8_assert(ccr_save); - wrccr(ccr_save); - } else { - const Register temp_reg1 = G3_scratch; - const Register temp_reg2 = G4_scratch; - write_ccr_trap(ccr_save, temp_reg1, temp_reg2); - } -} - - // Calls to C land #ifdef ASSERT @@ -465,8 +375,8 @@ void MacroAssembler::get_thread() { #ifdef ASSERT AddressLiteral last_get_thread_addrlit(&last_get_thread); set(last_get_thread_addrlit, L3); - inc(L4, get_pc(L4) + 2 * BytesPerInstWord); // skip getpc() code + inc + st_ptr to point L4 at call - st_ptr(L4, L3, 0); + rdpc(L4); + inc(L4, 3 * BytesPerInstWord); // skip rdpc + inc + st_ptr to point L4 at call st_ptr(L4, L3, 0); #endif call(CAST_FROM_FN_PTR(address, reinitialize_thread), relocInfo::runtime_call_type); delayed()->nop(); @@ -1251,12 +1161,6 @@ void MacroAssembler::align(int modulus) { while (offset() % modulus != 0) nop(); } - -void MacroAssembler::safepoint() { - relocate(breakpoint_Relocation::spec(breakpoint_Relocation::safepoint)); -} - - void RegistersForDebugging::print(outputStream* s) { FlagSetting fs(Debugging, true); int j; @@ -1327,7 +1231,7 @@ void RegistersForDebugging::print(outputStream* s) { void RegistersForDebugging::save_registers(MacroAssembler* a) { a->sub(FP, round_to(sizeof(RegistersForDebugging), sizeof(jdouble)) - STACK_BIAS, O0); - a->flush_windows(); + a->flushw(); int i; for (i = 0; i < 8; ++i) { a->ld_ptr(as_iRegister(i)->address_in_saved_window().after_save(), L1); a->st_ptr( L1, O0, i_offset(i)); @@ -1338,7 +1242,7 @@ void RegistersForDebugging::save_registers(MacroAssembler* a) { for (i = 0; i < 32; ++i) { a->stf(FloatRegisterImpl::S, as_FloatRegister(i), O0, f_offset(i)); } - for (i = 0; i < (VM_Version::v9_instructions_work() ? 64 : 32); i += 2) { + for (i = 0; i < 64; i += 2) { a->stf(FloatRegisterImpl::D, as_FloatRegister(i), O0, d_offset(i)); } } @@ -1350,7 +1254,7 @@ void RegistersForDebugging::restore_registers(MacroAssembler* a, Register r) { for (int j = 0; j < 32; ++j) { a->ldf(FloatRegisterImpl::S, O0, f_offset(j), as_FloatRegister(j)); } - for (int k = 0; k < (VM_Version::v9_instructions_work() ? 64 : 32); k += 2) { + for (int k = 0; k < 64; k += 2) { a->ldf(FloatRegisterImpl::D, O0, d_offset(k), as_FloatRegister(k)); } } @@ -1465,8 +1369,6 @@ address MacroAssembler::_verify_oop_implicit_branch[3] = { NULL }; // the high bits of the O-regs if they contain Long values. Acts as a 'leaf' // call. void MacroAssembler::verify_oop_subroutine() { - assert( VM_Version::v9_instructions_work(), "VerifyOops not supported for V8" ); - // Leaf call; no frame. Label succeed, fail, null_or_fail; @@ -1870,26 +1772,17 @@ void MacroAssembler::lcmp( Register Ra_hi, Register Ra_low, // And the equals case for the high part does not need testing, // since that triplet is reached only after finding the high halves differ. - if (VM_Version::v9_instructions_work()) { - mov(-1, Rresult); - ba(done); delayed()-> movcc(greater, false, icc, 1, Rresult); - } else { - br(less, true, pt, done); delayed()-> set(-1, Rresult); - br(greater, true, pt, done); delayed()-> set( 1, Rresult); - } + mov(-1, Rresult); + ba(done); + delayed()->movcc(greater, false, icc, 1, Rresult); - bind( check_low_parts ); + bind(check_low_parts); - if (VM_Version::v9_instructions_work()) { - mov( -1, Rresult); - movcc(equal, false, icc, 0, Rresult); - movcc(greaterUnsigned, false, icc, 1, Rresult); - } else { - set(-1, Rresult); - br(equal, true, pt, done); delayed()->set( 0, Rresult); - br(greaterUnsigned, true, pt, done); delayed()->set( 1, Rresult); - } - bind( done ); + mov( -1, Rresult); + movcc(equal, false, icc, 0, Rresult); + movcc(greaterUnsigned, false, icc, 1, Rresult); + + bind(done); } void MacroAssembler::lneg( Register Rhi, Register Rlow ) { @@ -2117,119 +2010,24 @@ void MacroAssembler::store_sized_value(Register src, Address dst, size_t size_in void MacroAssembler::float_cmp( bool is_float, int unordered_result, FloatRegister Fa, FloatRegister Fb, Register Rresult) { - - fcmp(is_float ? FloatRegisterImpl::S : FloatRegisterImpl::D, fcc0, Fa, Fb); - - Condition lt = unordered_result == -1 ? f_unorderedOrLess : f_less; - Condition eq = f_equal; - Condition gt = unordered_result == 1 ? f_unorderedOrGreater : f_greater; - - if (VM_Version::v9_instructions_work()) { - - mov(-1, Rresult); - movcc(eq, true, fcc0, 0, Rresult); - movcc(gt, true, fcc0, 1, Rresult); - + if (is_float) { + fcmp(FloatRegisterImpl::S, fcc0, Fa, Fb); } else { - Label done; + fcmp(FloatRegisterImpl::D, fcc0, Fa, Fb); + } - set( -1, Rresult ); - //fb(lt, true, pn, done); delayed()->set( -1, Rresult ); - fb( eq, true, pn, done); delayed()->set( 0, Rresult ); - fb( gt, true, pn, done); delayed()->set( 1, Rresult ); - - bind (done); + if (unordered_result == 1) { + mov( -1, Rresult); + movcc(f_equal, true, fcc0, 0, Rresult); + movcc(f_unorderedOrGreater, true, fcc0, 1, Rresult); + } else { + mov( -1, Rresult); + movcc(f_equal, true, fcc0, 0, Rresult); + movcc(f_greater, true, fcc0, 1, Rresult); } } -void MacroAssembler::fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d) -{ - if (VM_Version::v9_instructions_work()) { - Assembler::fneg(w, s, d); - } else { - if (w == FloatRegisterImpl::S) { - Assembler::fneg(w, s, d); - } else if (w == FloatRegisterImpl::D) { - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 1) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 1) == 0), "float register alignment check"); - - Assembler::fneg(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - } else { - assert(w == FloatRegisterImpl::Q, "Invalid float register width"); - - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 3) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 3) == 0), "float register alignment check"); - - Assembler::fneg(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor(), d->successor()->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor()->successor(), d->successor()->successor()->successor()); - } - } -} - -void MacroAssembler::fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d) -{ - if (VM_Version::v9_instructions_work()) { - Assembler::fmov(w, s, d); - } else { - if (w == FloatRegisterImpl::S) { - Assembler::fmov(w, s, d); - } else if (w == FloatRegisterImpl::D) { - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 1) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 1) == 0), "float register alignment check"); - - Assembler::fmov(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - } else { - assert(w == FloatRegisterImpl::Q, "Invalid float register width"); - - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 3) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 3) == 0), "float register alignment check"); - - Assembler::fmov(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor(), d->successor()->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor()->successor(), d->successor()->successor()->successor()); - } - } -} - -void MacroAssembler::fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d) -{ - if (VM_Version::v9_instructions_work()) { - Assembler::fabs(w, s, d); - } else { - if (w == FloatRegisterImpl::S) { - Assembler::fabs(w, s, d); - } else if (w == FloatRegisterImpl::D) { - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 1) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 1) == 0), "float register alignment check"); - - Assembler::fabs(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - } else { - assert(w == FloatRegisterImpl::Q, "Invalid float register width"); - - // number() does a sanity check on the alignment. - assert(((s->encoding(FloatRegisterImpl::D) & 3) == 0) && - ((d->encoding(FloatRegisterImpl::D) & 3) == 0), "float register alignment check"); - - Assembler::fabs(FloatRegisterImpl::S, s, d); - Assembler::fmov(FloatRegisterImpl::S, s->successor(), d->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor(), d->successor()->successor()); - Assembler::fmov(FloatRegisterImpl::S, s->successor()->successor()->successor(), d->successor()->successor()->successor()); - } - } -} - void MacroAssembler::save_all_globals_into_locals() { mov(G1,L1); mov(G2,L2); @@ -2250,135 +2048,6 @@ void MacroAssembler::restore_globals_from_locals() { mov(L7,G7); } -// Use for 64 bit operation. -void MacroAssembler::casx_under_lock(Register top_ptr_reg, Register top_reg, Register ptr_reg, address lock_addr, bool use_call_vm) -{ - // store ptr_reg as the new top value -#ifdef _LP64 - casx(top_ptr_reg, top_reg, ptr_reg); -#else - cas_under_lock(top_ptr_reg, top_reg, ptr_reg, lock_addr, use_call_vm); -#endif // _LP64 -} - -// [RGV] This routine does not handle 64 bit operations. -// use casx_under_lock() or casx directly!!! -void MacroAssembler::cas_under_lock(Register top_ptr_reg, Register top_reg, Register ptr_reg, address lock_addr, bool use_call_vm) -{ - // store ptr_reg as the new top value - if (VM_Version::v9_instructions_work()) { - cas(top_ptr_reg, top_reg, ptr_reg); - } else { - - // If the register is not an out nor global, it is not visible - // after the save. Allocate a register for it, save its - // value in the register save area (the save may not flush - // registers to the save area). - - Register top_ptr_reg_after_save; - Register top_reg_after_save; - Register ptr_reg_after_save; - - if (top_ptr_reg->is_out() || top_ptr_reg->is_global()) { - top_ptr_reg_after_save = top_ptr_reg->after_save(); - } else { - Address reg_save_addr = top_ptr_reg->address_in_saved_window(); - top_ptr_reg_after_save = L0; - st(top_ptr_reg, reg_save_addr); - } - - if (top_reg->is_out() || top_reg->is_global()) { - top_reg_after_save = top_reg->after_save(); - } else { - Address reg_save_addr = top_reg->address_in_saved_window(); - top_reg_after_save = L1; - st(top_reg, reg_save_addr); - } - - if (ptr_reg->is_out() || ptr_reg->is_global()) { - ptr_reg_after_save = ptr_reg->after_save(); - } else { - Address reg_save_addr = ptr_reg->address_in_saved_window(); - ptr_reg_after_save = L2; - st(ptr_reg, reg_save_addr); - } - - const Register& lock_reg = L3; - const Register& lock_ptr_reg = L4; - const Register& value_reg = L5; - const Register& yield_reg = L6; - const Register& yieldall_reg = L7; - - save_frame(); - - if (top_ptr_reg_after_save == L0) { - ld(top_ptr_reg->address_in_saved_window().after_save(), top_ptr_reg_after_save); - } - - if (top_reg_after_save == L1) { - ld(top_reg->address_in_saved_window().after_save(), top_reg_after_save); - } - - if (ptr_reg_after_save == L2) { - ld(ptr_reg->address_in_saved_window().after_save(), ptr_reg_after_save); - } - - Label(retry_get_lock); - Label(not_same); - Label(dont_yield); - - assert(lock_addr, "lock_address should be non null for v8"); - set((intptr_t)lock_addr, lock_ptr_reg); - // Initialize yield counter - mov(G0,yield_reg); - mov(G0, yieldall_reg); - set(StubRoutines::Sparc::locked, lock_reg); - - bind(retry_get_lock); - cmp_and_br_short(yield_reg, V8AtomicOperationUnderLockSpinCount, Assembler::less, Assembler::pt, dont_yield); - - if(use_call_vm) { - Untested("Need to verify global reg consistancy"); - call_VM(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::yield_all), yieldall_reg); - } else { - // Save the regs and make space for a C call - save(SP, -96, SP); - save_all_globals_into_locals(); - call(CAST_FROM_FN_PTR(address,os::yield_all)); - delayed()->mov(yieldall_reg, O0); - restore_globals_from_locals(); - restore(); - } - - // reset the counter - mov(G0,yield_reg); - add(yieldall_reg, 1, yieldall_reg); - - bind(dont_yield); - // try to get lock - Assembler::swap(lock_ptr_reg, 0, lock_reg); - - // did we get the lock? - cmp(lock_reg, StubRoutines::Sparc::unlocked); - br(Assembler::notEqual, true, Assembler::pn, retry_get_lock); - delayed()->add(yield_reg,1,yield_reg); - - // yes, got lock. do we have the same top? - ld(top_ptr_reg_after_save, 0, value_reg); - cmp_and_br_short(value_reg, top_reg_after_save, Assembler::notEqual, Assembler::pn, not_same); - - // yes, same top. - st(ptr_reg_after_save, top_ptr_reg_after_save, 0); - membar(Assembler::StoreStore); - - bind(not_same); - mov(value_reg, ptr_reg_after_save); - st(lock_reg, lock_ptr_reg, 0); // unlock - - restore(); - } -} - RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset) { @@ -2970,7 +2639,7 @@ void MacroAssembler::biased_locking_enter(Register obj_reg, Register mark_reg, markOopDesc::biased_lock_mask_in_place | markOopDesc::age_mask_in_place | markOopDesc::epoch_mask_in_place, mark_reg); or3(G2_thread, mark_reg, temp_reg); - casn(mark_addr.base(), mark_reg, temp_reg); + cas_ptr(mark_addr.base(), mark_reg, temp_reg); // If the biasing toward our thread failed, this means that // another thread succeeded in biasing it toward itself and we // need to revoke that bias. The revocation will occur in the @@ -2998,7 +2667,7 @@ void MacroAssembler::biased_locking_enter(Register obj_reg, Register mark_reg, load_klass(obj_reg, temp_reg); ld_ptr(Address(temp_reg, Klass::prototype_header_offset()), temp_reg); or3(G2_thread, temp_reg, temp_reg); - casn(mark_addr.base(), mark_reg, temp_reg); + cas_ptr(mark_addr.base(), mark_reg, temp_reg); // If the biasing toward our thread failed, this means that // another thread succeeded in biasing it toward itself and we // need to revoke that bias. The revocation will occur in the @@ -3027,7 +2696,7 @@ void MacroAssembler::biased_locking_enter(Register obj_reg, Register mark_reg, // bits in this situation. Should attempt to preserve them. load_klass(obj_reg, temp_reg); ld_ptr(Address(temp_reg, Klass::prototype_header_offset()), temp_reg); - casn(mark_addr.base(), mark_reg, temp_reg); + cas_ptr(mark_addr.base(), mark_reg, temp_reg); // Fall through to the normal CAS-based lock, because no matter what // the result of the above CAS, some thread must have succeeded in // removing the bias bit from the object's header. @@ -3058,15 +2727,6 @@ void MacroAssembler::biased_locking_exit (Address mark_addr, Register temp_reg, } -// CASN -- 32-64 bit switch hitter similar to the synthetic CASN provided by -// Solaris/SPARC's "as". Another apt name would be cas_ptr() - -void MacroAssembler::casn (Register addr_reg, Register cmp_reg, Register set_reg ) { - casx_under_lock (addr_reg, cmp_reg, set_reg, (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); -} - - - // compiler_lock_object() and compiler_unlock_object() are direct transliterations // of i486.ad fast_lock() and fast_unlock(). See those methods for detailed comments. // The code could be tightened up considerably. @@ -3129,8 +2789,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, // compare object markOop with Rmark and if equal exchange Rscratch with object markOop assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casx_under_lock(mark_addr.base(), Rmark, Rscratch, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), Rmark, Rscratch); // if compare/exchange succeeded we found an unlocked object and we now have locked it // hence we are done @@ -3176,7 +2835,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, mov(Rbox, Rscratch); or3(Rmark, markOopDesc::unlocked_value, Rmark); assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casn(mark_addr.base(), Rmark, Rscratch); + cas_ptr(mark_addr.base(), Rmark, Rscratch); cmp(Rmark, Rscratch); brx(Assembler::equal, false, Assembler::pt, done); delayed()->sub(Rscratch, SP, Rscratch); @@ -3207,7 +2866,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, // Invariant: if we acquire the lock then _recursions should be 0. add(Rmark, ObjectMonitor::owner_offset_in_bytes()-2, Rmark); mov(G2_thread, Rscratch); - casn(Rmark, G0, Rscratch); + cas_ptr(Rmark, G0, Rscratch); cmp(Rscratch, G0); // Intentional fall-through into done } else { @@ -3240,7 +2899,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, mov(0, Rscratch); or3(Rmark, markOopDesc::unlocked_value, Rmark); assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casn(mark_addr.base(), Rmark, Rscratch); + cas_ptr(mark_addr.base(), Rmark, Rscratch); // prefetch (mark_addr, Assembler::severalWritesAndPossiblyReads); cmp(Rscratch, Rmark); brx(Assembler::notZero, false, Assembler::pn, Recursive); @@ -3266,7 +2925,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, // the fast-path stack-lock code from the interpreter and always passed // control to the "slow" operators in synchronizer.cpp. - // RScratch contains the fetched obj->mark value from the failed CASN. + // RScratch contains the fetched obj->mark value from the failed CAS. #ifdef _LP64 sub(Rscratch, STACK_BIAS, Rscratch); #endif @@ -3300,7 +2959,7 @@ void MacroAssembler::compiler_lock_object(Register Roop, Register Rmark, // Invariant: if we acquire the lock then _recursions should be 0. add(Rmark, ObjectMonitor::owner_offset_in_bytes()-2, Rmark); mov(G2_thread, Rscratch); - casn(Rmark, G0, Rscratch); + cas_ptr(Rmark, G0, Rscratch); cmp(Rscratch, G0); // ST box->displaced_header = NonZero. // Any non-zero value suffices: @@ -3336,8 +2995,7 @@ void MacroAssembler::compiler_unlock_object(Register Roop, Register Rmark, // Check if it is still a light weight lock, this is is true if we see // the stack address of the basicLock in the markOop of the object assert(mark_addr.disp() == 0, "cas must take a zero displacement"); - casx_under_lock(mark_addr.base(), Rbox, Rmark, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(mark_addr.base(), Rbox, Rmark); ba(done); delayed()->cmp(Rbox, Rmark); bind(done); @@ -3398,7 +3056,7 @@ void MacroAssembler::compiler_unlock_object(Register Roop, Register Rmark, delayed()->andcc(G0, G0, G0); add(Rmark, ObjectMonitor::owner_offset_in_bytes()-2, Rmark); mov(G2_thread, Rscratch); - casn(Rmark, G0, Rscratch); + cas_ptr(Rmark, G0, Rscratch); // invert icc.zf and goto done br_notnull(Rscratch, false, Assembler::pt, done); delayed()->cmp(G0, G0); @@ -3440,7 +3098,7 @@ void MacroAssembler::compiler_unlock_object(Register Roop, Register Rmark, // A prototype implementation showed excellent results, although // the scavenger and timeout code was rather involved. - casn(mark_addr.base(), Rbox, Rscratch); + cas_ptr(mark_addr.base(), Rbox, Rscratch); cmp(Rbox, Rscratch); // Intentional fall through into done ... @@ -3540,7 +3198,8 @@ void MacroAssembler::eden_allocate( if (CMSIncrementalMode || !Universe::heap()->supports_inline_contig_alloc()) { // No allocation in the shared eden. - ba_short(slow_case); + ba(slow_case); + delayed()->nop(); } else { // get eden boundaries // note: we need both top & top_addr! @@ -3583,7 +3242,7 @@ void MacroAssembler::eden_allocate( // Compare obj with the value at top_addr; if still equal, swap the value of // end with the value at top_addr. If not equal, read the value at top_addr // into end. - casx_under_lock(top_addr, obj, end, (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + cas_ptr(top_addr, obj, end); // if someone beat us on the allocation, try again, otherwise continue cmp(obj, end); brx(Assembler::notEqual, false, Assembler::pn, retry); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index 26605cbfa4c..72fd61f52c2 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -963,7 +963,7 @@ public: inline void sub(Register s1, RegisterOrConstant s2, Register d, int offset = 0); using Assembler::swap; - inline void swap(Address& a, Register d, int offset = 0); + inline void swap(const Address& a, Register d, int offset = 0); // address pseudos: make these names unlike instruction names to avoid confusion inline intptr_t load_pc_address( Register reg, int bytes_to_skip ); @@ -1056,13 +1056,6 @@ public: void breakpoint_trap(); void breakpoint_trap(Condition c, CC cc); - void flush_windows_trap(); - void clean_windows_trap(); - void get_psr_trap(); - void set_psr_trap(); - - // V8/V9 flush_windows - void flush_windows(); // Support for serializing memory accesses between threads void serialize_memory(Register thread, Register tmp1, Register tmp2); @@ -1071,14 +1064,6 @@ public: void enter(); void leave(); - // V8/V9 integer multiply - void mult(Register s1, Register s2, Register d); - void mult(Register s1, int simm13a, Register d); - - // V8/V9 read and write of condition codes. - void read_ccr(Register d); - void write_ccr(Register s); - // Manipulation of C++ bools // These are idioms to flag the need for care with accessing bools but on // this platform we assume byte size @@ -1162,21 +1147,6 @@ public: // check_and_forward_exception to handle exceptions when it is safe void check_and_forward_exception(Register scratch_reg); - private: - // For V8 - void read_ccr_trap(Register ccr_save); - void write_ccr_trap(Register ccr_save1, Register scratch1, Register scratch2); - -#ifdef ASSERT - // For V8 debugging. Uses V8 instruction sequence and checks - // result with V9 insturctions rdccr and wrccr. - // Uses Gscatch and Gscatch2 - void read_ccr_v8_assert(Register ccr_save); - void write_ccr_v8_assert(Register ccr_save); -#endif // ASSERT - - public: - // Write to card table for - register is destroyed afterwards. void card_table_write(jbyte* byte_map_base, Register tmp, Register obj); @@ -1314,20 +1284,9 @@ public: FloatRegister Fa, FloatRegister Fb, Register Rresult); - void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d); - void fneg( FloatRegisterImpl::Width w, FloatRegister sd ) { Assembler::fneg(w, sd); } - void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d); - void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d); - void save_all_globals_into_locals(); void restore_globals_from_locals(); - void casx_under_lock(Register top_ptr_reg, Register top_reg, Register ptr_reg, - address lock_addr=0, bool use_call_vm=false); - void cas_under_lock(Register top_ptr_reg, Register top_reg, Register ptr_reg, - address lock_addr=0, bool use_call_vm=false); - void casn (Register addr_reg, Register cmp_reg, Register set_reg) ; - // These set the icc condition code to equal if the lock succeeded // and notEqual if it failed and requires a slow case void compiler_lock_object(Register Roop, Register Rmark, Register Rbox, diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp index 871853c684d..125f9a724d7 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -229,10 +229,7 @@ inline void MacroAssembler::sll_ptr( Register s1, RegisterOrConstant s2, Registe // Use the right branch for the platform inline void MacroAssembler::br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { - if (VM_Version::v9_instructions_work()) - Assembler::bp(c, a, icc, p, d, rt); - else - Assembler::br(c, a, d, rt); + Assembler::bp(c, a, icc, p, d, rt); } inline void MacroAssembler::br( Condition c, bool a, Predict p, Label& L ) { @@ -268,10 +265,7 @@ inline void MacroAssembler::bp( Condition c, bool a, CC cc, Predict p, Label& L } inline void MacroAssembler::fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { - if (VM_Version::v9_instructions_work()) - fbp(c, a, fcc0, p, d, rt); - else - Assembler::fb(c, a, d, rt); + fbp(c, a, fcc0, p, d, rt); } inline void MacroAssembler::fb( Condition c, bool a, Predict p, Label& L ) { @@ -334,7 +328,7 @@ inline void MacroAssembler::callr( Register s1, int simm13a, RelocationHolder co // prefetch instruction inline void MacroAssembler::iprefetch( address d, relocInfo::relocType rt ) { - if (VM_Version::v9_instructions_work()) + Assembler::bp( never, true, xcc, pt, d, rt ); Assembler::bp( never, true, xcc, pt, d, rt ); } inline void MacroAssembler::iprefetch( Label& L) { iprefetch( target(L) ); } @@ -344,15 +338,7 @@ inline void MacroAssembler::iprefetch( Label& L) { iprefetch( target(L) ); } // returns delta from gotten pc to addr after inline int MacroAssembler::get_pc( Register d ) { int x = offset(); - if (VM_Version::v9_instructions_work()) - rdpc(d); - else { - Label lbl; - Assembler::call(lbl, relocInfo::none); // No relocation as this is call to pc+0x8 - if (d == O7) delayed()->nop(); - else delayed()->mov(O7, d); - bind(lbl); - } + rdpc(d); return offset() - x; } @@ -646,41 +632,26 @@ inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, const Address& a, Fl // returns if membar generates anything, obviously this code should mirror // membar below. inline bool MacroAssembler::membar_has_effect( Membar_mask_bits const7a ) { - if( !os::is_MP() ) return false; // Not needed on single CPU - if( VM_Version::v9_instructions_work() ) { - const Membar_mask_bits effective_mask = - Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); - return (effective_mask != 0); - } else { - return true; - } + if (!os::is_MP()) + return false; // Not needed on single CPU + const Membar_mask_bits effective_mask = + Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); + return (effective_mask != 0); } inline void MacroAssembler::membar( Membar_mask_bits const7a ) { // Uniprocessors do not need memory barriers - if (!os::is_MP()) return; + if (!os::is_MP()) + return; // Weakened for current Sparcs and TSO. See the v9 manual, sections 8.4.3, // 8.4.4.3, a.31 and a.50. - if( VM_Version::v9_instructions_work() ) { - // Under TSO, setting bit 3, 2, or 0 is redundant, so the only value - // of the mmask subfield of const7a that does anything that isn't done - // implicitly is StoreLoad. - const Membar_mask_bits effective_mask = - Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); - if ( effective_mask != 0 ) { - Assembler::membar( effective_mask ); - } - } else { - // stbar is the closest there is on v8. Equivalent to membar(StoreStore). We - // do not issue the stbar because to my knowledge all v8 machines implement TSO, - // which guarantees that all stores behave as if an stbar were issued just after - // each one of them. On these machines, stbar ought to be a nop. There doesn't - // appear to be an equivalent of membar(StoreLoad) on v8: TSO doesn't require it, - // it can't be specified by stbar, nor have I come up with a way to simulate it. - // - // Addendum. Dave says that ldstub guarantees a write buffer flush to coherent - // space. Put one here to be on the safe side. - Assembler::ldstub(SP, 0, G0); + // Under TSO, setting bit 3, 2, or 0 is redundant, so the only value + // of the mmask subfield of const7a that does anything that isn't done + // implicitly is StoreLoad. + const Membar_mask_bits effective_mask = + Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); + if (effective_mask != 0) { + Assembler::membar(effective_mask); } } @@ -748,7 +719,7 @@ inline void MacroAssembler::sub(Register s1, RegisterOrConstant s2, Register d, if (offset != 0) sub(d, offset, d); } -inline void MacroAssembler::swap(Address& a, Register d, int offset) { +inline void MacroAssembler::swap(const Address& a, Register d, int offset) { relocate(a.rspec(offset)); if (a.has_index()) { assert(offset == 0, ""); swap(a.base(), a.index(), d ); } else { swap(a.base(), a.disp() + offset, d); } diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 71a938e59fc..81f29d2671b 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -162,7 +162,7 @@ void NativeCall::replace_mt_safe(address instr_addr, address code_buffer) { int i1 = ((int*)code_buffer)[1]; int* contention_addr = (int*) n_call->addr_at(1*BytesPerInstWord); assert(inv_op(*contention_addr) == Assembler::arith_op || - *contention_addr == nop_instruction() || !VM_Version::v9_instructions_work(), + *contention_addr == nop_instruction(), "must not interfere with original call"); // The set_long_at calls do the ICacheInvalidate so we just need to do them in reverse order n_call->set_long_at(1*BytesPerInstWord, i1); @@ -181,7 +181,7 @@ void NativeCall::replace_mt_safe(address instr_addr, address code_buffer) { // Make sure the first-patched instruction, which may co-exist // briefly with the call, will do something harmless. assert(inv_op(*contention_addr) == Assembler::arith_op || - *contention_addr == nop_instruction() || !VM_Version::v9_instructions_work(), + *contention_addr == nop_instruction(), "must not interfere with original call"); } @@ -933,11 +933,7 @@ void NativeJump::patch_verified_entry(address entry, address verified_entry, add int code_size = 1 * BytesPerInstWord; CodeBuffer cb(verified_entry, code_size + 1); MacroAssembler* a = new MacroAssembler(&cb); - if (VM_Version::v9_instructions_work()) { - a->ldsw(G0, 0, O7); // "ld" must agree with code in the signal handler - } else { - a->lduw(G0, 0, O7); // "ld" must agree with code in the signal handler - } + a->ldsw(G0, 0, O7); // "ld" must agree with code in the signal handler ICache::invalidate_range(verified_entry, code_size); } @@ -1024,7 +1020,7 @@ void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) int i1 = ((int*)code_buffer)[1]; int* contention_addr = (int*) h_jump->addr_at(1*BytesPerInstWord); assert(inv_op(*contention_addr) == Assembler::arith_op || - *contention_addr == nop_instruction() || !VM_Version::v9_instructions_work(), + *contention_addr == nop_instruction(), "must not interfere with original call"); // The set_long_at calls do the ICacheInvalidate so we just need to do them in reverse order h_jump->set_long_at(1*BytesPerInstWord, i1); @@ -1043,6 +1039,6 @@ void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) // Make sure the first-patched instruction, which may co-exist // briefly with the call, will do something harmless. assert(inv_op(*contention_addr) == Assembler::arith_op || - *contention_addr == nop_instruction() || !VM_Version::v9_instructions_work(), + *contention_addr == nop_instruction(), "must not interfere with original call"); } diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp index 3c9a5e9b7a7..aa362012dcf 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp @@ -70,8 +70,7 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { bool is_zombie() { int x = long_at(0); return is_op3(x, - VM_Version::v9_instructions_work() ? - Assembler::ldsw_op3 : Assembler::lduw_op3, + Assembler::ldsw_op3, Assembler::ldst_op) && Assembler::inv_rs1(x) == G0 && Assembler::inv_rd(x) == O7; diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 945866e539f..423a424c936 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -249,12 +249,10 @@ class FloatRegisterImpl: public AbstractRegisterImpl { case D: assert(c < 64 && (c & 1) == 0, "bad double float register"); - assert(c < 32 || VM_Version::v9_instructions_work(), "V9 float work only on V9 platform"); return (c & 0x1e) | ((c & 0x20) >> 5); case Q: assert(c < 64 && (c & 3) == 0, "bad quad float register"); - assert(c < 32 || VM_Version::v9_instructions_work(), "V9 float work only on V9 platform"); return (c & 0x1c) | ((c & 0x20) >> 5); } ShouldNotReachHere(); diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp index 2a3516dcf6b..97bd2fcc692 100644 --- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp @@ -193,36 +193,6 @@ address Relocation::pd_get_address_from_code() { return *(address*)addr(); } - -int Relocation::pd_breakpoint_size() { - // minimum breakpoint size, in short words - return NativeIllegalInstruction::instruction_size / sizeof(short); -} - -void Relocation::pd_swap_in_breakpoint(address x, short* instrs, int instrlen) { - Untested("pd_swap_in_breakpoint"); - // %%% probably do not need a general instrlen; just use the trap size - if (instrs != NULL) { - assert(instrlen * sizeof(short) == NativeIllegalInstruction::instruction_size, "enough instrlen in reloc. data"); - for (int i = 0; i < instrlen; i++) { - instrs[i] = ((short*)x)[i]; - } - } - NativeIllegalInstruction::insert(x); -} - - -void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen) { - Untested("pd_swap_out_breakpoint"); - assert(instrlen * sizeof(short) == sizeof(int), "enough buf"); - union { int l; short s[1]; } u; - for (int i = 0; i < instrlen; i++) { - u.s[i] = instrs[i]; - } - NativeInstruction* ni = nativeInstruction_at(x); - ni->set_long_at(0, u.l); -} - void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { } diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index b6a338c34ee..3149dbd76d2 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -2459,7 +2459,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Finally just about ready to make the JNI call - __ flush_windows(); + __ flushw(); if (inner_frame_created) { __ restore(); } else { diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index ebbce2e7741..932da4a5930 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -2778,10 +2778,7 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{ Register Rold = reg_to_register_object($old$$reg); Register Rnew = reg_to_register_object($new$$reg); - // casx_under_lock picks 1 of 3 encodings: - // For 32-bit pointers you get a 32-bit CAS - // For 64-bit pointers you get a 64-bit CASX - __ casn(Rmem, Rold, Rnew); // Swap(*Rmem,Rnew) if *Rmem == Rold + __ cas_ptr(Rmem, Rold, Rnew); // Swap(*Rmem,Rnew) if *Rmem == Rold __ cmp( Rold, Rnew ); %} @@ -3067,7 +3064,7 @@ enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, notemp_iRegI r AddressLiteral last_rethrow_addrlit(&last_rethrow); __ sethi(last_rethrow_addrlit, L1); Address addr(L1, last_rethrow_addrlit.low10()); - __ get_pc(L2); + __ rdpc(L2); __ inc(L2, 3 * BytesPerInstWord); // skip this & 2 more insns to point at jump_to __ st_ptr(L2, addr); __ restore(); diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index 3cd4ff2d3f5..494c1bc405a 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -566,7 +566,7 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", "flush_callers_register_windows"); address start = __ pc(); - __ flush_windows(); + __ flushw(); __ retl(false); __ delayed()->add( FP, STACK_BIAS, O0 ); // The returned value must be a stack pointer whose register save area @@ -575,67 +575,9 @@ class StubGenerator: public StubCodeGenerator { return start; } - // Helper functions for v8 atomic operations. - // - void get_v8_oop_lock_ptr(Register lock_ptr_reg, Register mark_oop_reg, Register scratch_reg) { - if (mark_oop_reg == noreg) { - address lock_ptr = (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr(); - __ set((intptr_t)lock_ptr, lock_ptr_reg); - } else { - assert(scratch_reg != noreg, "just checking"); - address lock_ptr = (address)StubRoutines::Sparc::_v8_oop_lock_cache; - __ set((intptr_t)lock_ptr, lock_ptr_reg); - __ and3(mark_oop_reg, StubRoutines::Sparc::v8_oop_lock_mask_in_place, scratch_reg); - __ add(lock_ptr_reg, scratch_reg, lock_ptr_reg); - } - } - - void generate_v8_lock_prologue(Register lock_reg, Register lock_ptr_reg, Register yield_reg, Label& retry, Label& dontyield, Register mark_oop_reg = noreg, Register scratch_reg = noreg) { - - get_v8_oop_lock_ptr(lock_ptr_reg, mark_oop_reg, scratch_reg); - __ set(StubRoutines::Sparc::locked, lock_reg); - // Initialize yield counter - __ mov(G0,yield_reg); - - __ BIND(retry); - __ cmp_and_br_short(yield_reg, V8AtomicOperationUnderLockSpinCount, Assembler::less, Assembler::pt, dontyield); - - // This code can only be called from inside the VM, this - // stub is only invoked from Atomic::add(). We do not - // want to use call_VM, because _last_java_sp and such - // must already be set. - // - // Save the regs and make space for a C call - __ save(SP, -96, SP); - __ save_all_globals_into_locals(); - BLOCK_COMMENT("call os::naked_sleep"); - __ call(CAST_FROM_FN_PTR(address, os::naked_sleep)); - __ delayed()->nop(); - __ restore_globals_from_locals(); - __ restore(); - // reset the counter - __ mov(G0,yield_reg); - - __ BIND(dontyield); - - // try to get lock - __ swap(lock_ptr_reg, 0, lock_reg); - - // did we get the lock? - __ cmp(lock_reg, StubRoutines::Sparc::unlocked); - __ br(Assembler::notEqual, true, Assembler::pn, retry); - __ delayed()->add(yield_reg,1,yield_reg); - - // yes, got lock. do the operation here. - } - - void generate_v8_lock_epilogue(Register lock_reg, Register lock_ptr_reg, Register yield_reg, Label& retry, Label& dontyield, Register mark_oop_reg = noreg, Register scratch_reg = noreg) { - __ st(lock_reg, lock_ptr_reg, 0); // unlock - } - // Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest). // - // Arguments : + // Arguments: // // exchange_value: O0 // dest: O1 @@ -656,33 +598,14 @@ class StubGenerator: public StubCodeGenerator { __ mov(O0, O3); // scratch copy of exchange value __ ld(O1, 0, O2); // observe the previous value // try to replace O2 with O3 - __ cas_under_lock(O1, O2, O3, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr(),false); + __ cas(O1, O2, O3); __ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pn, retry); __ retl(false); __ delayed()->mov(O2, O0); // report previous value to caller - } else { - if (VM_Version::v9_instructions_work()) { - __ retl(false); - __ delayed()->swap(O1, 0, O0); - } else { - const Register& lock_reg = O2; - const Register& lock_ptr_reg = O3; - const Register& yield_reg = O4; - - Label retry; - Label dontyield; - - generate_v8_lock_prologue(lock_reg, lock_ptr_reg, yield_reg, retry, dontyield); - // got the lock, do the swap - __ swap(O1, 0, O0); - - generate_v8_lock_epilogue(lock_reg, lock_ptr_reg, yield_reg, retry, dontyield); - __ retl(false); - __ delayed()->nop(); - } + __ retl(false); + __ delayed()->swap(O1, 0, O0); } return start; @@ -691,7 +614,7 @@ class StubGenerator: public StubCodeGenerator { // Support for jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value) // - // Arguments : + // Arguments: // // exchange_value: O0 // dest: O1 @@ -701,15 +624,12 @@ class StubGenerator: public StubCodeGenerator { // // O0: the value previously stored in dest // - // Overwrites (v8): O3,O4,O5 - // address generate_atomic_cmpxchg() { StubCodeMark mark(this, "StubRoutines", "atomic_cmpxchg"); address start = __ pc(); // cmpxchg(dest, compare_value, exchange_value) - __ cas_under_lock(O1, O2, O0, - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr(),false); + __ cas(O1, O2, O0); __ retl(false); __ delayed()->nop(); @@ -718,7 +638,7 @@ class StubGenerator: public StubCodeGenerator { // Support for jlong Atomic::cmpxchg(jlong exchange_value, volatile jlong *dest, jlong compare_value) // - // Arguments : + // Arguments: // // exchange_value: O1:O0 // dest: O2 @@ -728,17 +648,12 @@ class StubGenerator: public StubCodeGenerator { // // O1:O0: the value previously stored in dest // - // This only works on V9, on V8 we don't generate any - // code and just return NULL. - // // Overwrites: G1,G2,G3 // address generate_atomic_cmpxchg_long() { StubCodeMark mark(this, "StubRoutines", "atomic_cmpxchg_long"); address start = __ pc(); - if (!VM_Version::supports_cx8()) - return NULL;; __ sllx(O0, 32, O0); __ srl(O1, 0, O1); __ or3(O0,O1,O0); // O0 holds 64-bit value from compare_value @@ -756,7 +671,7 @@ class StubGenerator: public StubCodeGenerator { // Support for jint Atomic::add(jint add_value, volatile jint* dest). // - // Arguments : + // Arguments: // // add_value: O0 (e.g., +1 or -1) // dest: O1 @@ -765,47 +680,22 @@ class StubGenerator: public StubCodeGenerator { // // O0: the new value stored in dest // - // Overwrites (v9): O3 - // Overwrites (v8): O3,O4,O5 + // Overwrites: O3 // address generate_atomic_add() { StubCodeMark mark(this, "StubRoutines", "atomic_add"); address start = __ pc(); __ BIND(_atomic_add_stub); - if (VM_Version::v9_instructions_work()) { - Label(retry); - __ BIND(retry); + Label(retry); + __ BIND(retry); - __ lduw(O1, 0, O2); - __ add(O0, O2, O3); - __ cas(O1, O2, O3); - __ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pn, retry); - __ retl(false); - __ delayed()->add(O0, O2, O0); // note that cas made O2==O3 - } else { - const Register& lock_reg = O2; - const Register& lock_ptr_reg = O3; - const Register& value_reg = O4; - const Register& yield_reg = O5; - - Label(retry); - Label(dontyield); - - generate_v8_lock_prologue(lock_reg, lock_ptr_reg, yield_reg, retry, dontyield); - // got lock, do the increment - __ ld(O1, 0, value_reg); - __ add(O0, value_reg, value_reg); - __ st(value_reg, O1, 0); - - // %%% only for RMO and PSO - __ membar(Assembler::StoreStore); - - generate_v8_lock_epilogue(lock_reg, lock_ptr_reg, yield_reg, retry, dontyield); - - __ retl(false); - __ delayed()->mov(value_reg, O0); - } + __ lduw(O1, 0, O2); + __ add(O0, O2, O3); + __ cas(O1, O2, O3); + __ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pn, retry); + __ retl(false); + __ delayed()->add(O0, O2, O0); // note that cas made O2==O3 return start; } @@ -841,7 +731,7 @@ class StubGenerator: public StubCodeGenerator { __ mov(G3, L3); __ mov(G4, L4); __ mov(G5, L5); - for (i = 0; i < (VM_Version::v9_instructions_work() ? 64 : 32); i += 2) { + for (i = 0; i < 64; i += 2) { __ stf(FloatRegisterImpl::D, as_FloatRegister(i), preserve_addr, i * wordSize); } @@ -855,7 +745,7 @@ class StubGenerator: public StubCodeGenerator { __ mov(L3, G3); __ mov(L4, G4); __ mov(L5, G5); - for (i = 0; i < (VM_Version::v9_instructions_work() ? 64 : 32); i += 2) { + for (i = 0; i < 64; i += 2) { __ ldf(FloatRegisterImpl::D, preserve_addr, as_FloatRegister(i), i * wordSize); } diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp index 3a544be2e16..da9e9040683 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp @@ -52,7 +52,3 @@ address StubRoutines::Sparc::_stop_subroutine_entry = NULL; address StubRoutines::Sparc::_flush_callers_register_windows_entry = CAST_FROM_FN_PTR(address, bootstrap_flush_windows); address StubRoutines::Sparc::_partial_subtype_check = NULL; - -int StubRoutines::Sparc::_atomic_memory_operation_lock = StubRoutines::Sparc::unlocked; - -int StubRoutines::Sparc::_v8_oop_lock_cache[StubRoutines::Sparc::nof_v8_oop_lock_cache_entries]; diff --git a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp index b0a24306295..1b23479a1f9 100644 --- a/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp @@ -47,46 +47,14 @@ enum /* platform_dependent_constants */ { class Sparc { friend class StubGenerator; - public: - enum { nof_instance_allocators = 10 }; - - // allocator lock values - enum { - unlocked = 0, - locked = 1 - }; - - enum { - v8_oop_lock_ignore_bits = 2, - v8_oop_lock_bits = 4, - nof_v8_oop_lock_cache_entries = 1 << (v8_oop_lock_bits+v8_oop_lock_ignore_bits), - v8_oop_lock_mask = right_n_bits(v8_oop_lock_bits), - v8_oop_lock_mask_in_place = v8_oop_lock_mask << v8_oop_lock_ignore_bits - }; - - static int _v8_oop_lock_cache[nof_v8_oop_lock_cache_entries]; - private: static address _test_stop_entry; static address _stop_subroutine_entry; static address _flush_callers_register_windows_entry; - static int _atomic_memory_operation_lock; - static address _partial_subtype_check; public: - // %%% global lock for everyone who needs to use atomic_compare_and_exchange - // %%% or atomic_increment -- should probably use more locks for more - // %%% scalability-- for instance one for each eden space or group of - - // address of the lock for atomic_compare_and_exchange - static int* atomic_memory_operation_lock_addr() { return &_atomic_memory_operation_lock; } - - // accessor and mutator for _atomic_memory_operation_lock - static int atomic_memory_operation_lock() { return _atomic_memory_operation_lock; } - static void set_atomic_memory_operation_lock(int value) { _atomic_memory_operation_lock = value; } - // test assembler stop routine by setting registers static void (*test_stop_entry()) () { return CAST_TO_FN_PTR(void (*)(void), _test_stop_entry); } diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index 135760ec0b4..7b9a494dff0 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -1054,7 +1054,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // flush the windows now. We don't care about the current (protection) frame // only the outer frames - __ flush_windows(); + __ flushw(); // mark windows as flushed Address flags(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset()); diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 00d1079742b..c3e8b298d6e 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1338,14 +1338,13 @@ void TemplateTable::lneg() { void TemplateTable::fneg() { transition(ftos, ftos); - __ fneg(FloatRegisterImpl::S, Ftos_f); + __ fneg(FloatRegisterImpl::S, Ftos_f, Ftos_f); } void TemplateTable::dneg() { transition(dtos, dtos); - // v8 has fnegd if source and dest are the same - __ fneg(FloatRegisterImpl::D, Ftos_f); + __ fneg(FloatRegisterImpl::D, Ftos_f, Ftos_f); } @@ -1470,19 +1469,10 @@ void TemplateTable::convert() { __ st_long(Otos_l, __ d_tmp); __ ldf(FloatRegisterImpl::D, __ d_tmp, Ftos_d); - if (VM_Version::v9_instructions_work()) { - if (bytecode() == Bytecodes::_l2f) { - __ fxtof(FloatRegisterImpl::S, Ftos_d, Ftos_f); - } else { - __ fxtof(FloatRegisterImpl::D, Ftos_d, Ftos_d); - } + if (bytecode() == Bytecodes::_l2f) { + __ fxtof(FloatRegisterImpl::S, Ftos_d, Ftos_f); } else { - __ call_VM_leaf( - Lscratch, - bytecode() == Bytecodes::_l2f - ? CAST_FROM_FN_PTR(address, SharedRuntime::l2f) - : CAST_FROM_FN_PTR(address, SharedRuntime::l2d) - ); + __ fxtof(FloatRegisterImpl::D, Ftos_d, Ftos_d); } break; @@ -1490,11 +1480,6 @@ void TemplateTable::convert() { Label isNaN; // result must be 0 if value is NaN; test by comparing value to itself __ fcmp(FloatRegisterImpl::S, Assembler::fcc0, Ftos_f, Ftos_f); - // According to the v8 manual, you have to have a non-fp instruction - // between fcmp and fb. - if (!VM_Version::v9_instructions_work()) { - __ nop(); - } __ fb(Assembler::f_unordered, true, Assembler::pn, isNaN); __ delayed()->clr(Otos_i); // NaN __ ftoi(FloatRegisterImpl::S, Ftos_f, F30); @@ -1537,16 +1522,7 @@ void TemplateTable::convert() { break; case Bytecodes::_d2f: - if (VM_Version::v9_instructions_work()) { __ ftof( FloatRegisterImpl::D, FloatRegisterImpl::S, Ftos_d, Ftos_f); - } - else { - // must uncache tos - __ push_d(); - __ pop_i(O0); - __ pop_i(O1); - __ call_VM_leaf(Lscratch, CAST_FROM_FN_PTR(address, SharedRuntime::d2f)); - } break; default: ShouldNotReachHere(); @@ -1956,17 +1932,8 @@ void TemplateTable::fast_binaryswitch() { __ ld( Rarray, Rscratch, Rscratch ); // (Rscratch is already in the native byte-ordering.) __ cmp( Rkey, Rscratch ); - if ( VM_Version::v9_instructions_work() ) { - __ movcc( Assembler::less, false, Assembler::icc, Rh, Rj ); // j = h if (key < array[h].fast_match()) - __ movcc( Assembler::greaterEqual, false, Assembler::icc, Rh, Ri ); // i = h if (key >= array[h].fast_match()) - } - else { - Label end_of_if; - __ br( Assembler::less, true, Assembler::pt, end_of_if ); - __ delayed()->mov( Rh, Rj ); // if (<) Rj = Rh - __ mov( Rh, Ri ); // else i = h - __ bind(end_of_if); // } - } + __ movcc( Assembler::less, false, Assembler::icc, Rh, Rj ); // j = h if (key < array[h].fast_match()) + __ movcc( Assembler::greaterEqual, false, Assembler::icc, Rh, Ri ); // i = h if (key >= array[h].fast_match()) // while (i+1 < j) __ bind( entry ); @@ -3418,9 +3385,7 @@ void TemplateTable::_new() { // has been allocated. __ cmp_and_brx_short(RnewTopValue, RendValue, Assembler::greaterUnsigned, Assembler::pn, slow_case); - __ casx_under_lock(RtopAddr, RoldTopValue, RnewTopValue, - VM_Version::v9_instructions_work() ? NULL : - (address)StubRoutines::Sparc::atomic_memory_operation_lock_addr()); + __ cas_ptr(RtopAddr, RoldTopValue, RnewTopValue); // if someone beat us on the allocation, try again, otherwise continue __ cmp_and_brx_short(RoldTopValue, RnewTopValue, Assembler::notEqual, Assembler::pn, retry); @@ -3701,14 +3666,7 @@ void TemplateTable::monitorenter() { __ verify_oop(O4); // verify each monitor's oop __ tst(O4); // is this entry unused? - if (VM_Version::v9_instructions_work()) - __ movcc( Assembler::zero, false, Assembler::ptr_cc, O3, O1); - else { - Label L; - __ br( Assembler::zero, true, Assembler::pn, L ); - __ delayed()->mov(O3, O1); // rememeber this one if match - __ bind(L); - } + __ movcc( Assembler::zero, false, Assembler::ptr_cc, O3, O1); __ cmp(O4, O0); // check if current entry is for same object __ brx( Assembler::equal, false, Assembler::pn, exit ); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 03670106924..392b7f5d927 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -75,23 +75,14 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1); } - if (has_v9()) { - assert(ArraycopySrcPrefetchDistance < 4096, "invalid value"); - if (ArraycopySrcPrefetchDistance >= 4096) - ArraycopySrcPrefetchDistance = 4064; - assert(ArraycopyDstPrefetchDistance < 4096, "invalid value"); - if (ArraycopyDstPrefetchDistance >= 4096) - ArraycopyDstPrefetchDistance = 4064; - } else { - if (ArraycopySrcPrefetchDistance > 0) { - warning("prefetch instructions are not available on this CPU"); - FLAG_SET_DEFAULT(ArraycopySrcPrefetchDistance, 0); - } - if (ArraycopyDstPrefetchDistance > 0) { - warning("prefetch instructions are not available on this CPU"); - FLAG_SET_DEFAULT(ArraycopyDstPrefetchDistance, 0); - } - } + guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); + + assert(ArraycopySrcPrefetchDistance < 4096, "invalid value"); + if (ArraycopySrcPrefetchDistance >= 4096) + ArraycopySrcPrefetchDistance = 4064; + assert(ArraycopyDstPrefetchDistance < 4096, "invalid value"); + if (ArraycopyDstPrefetchDistance >= 4096) + ArraycopyDstPrefetchDistance = 4064; UseSSE = 0; // Only on x86 and x64 diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index d602fd08cfb..f4cc8bf56b3 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -177,10 +177,6 @@ public: return AllocatePrefetchDistance > 0 ? AllocatePrefetchStyle : 0; } - // Legacy - static bool v8_instructions_work() { return has_v8() && !has_v9(); } - static bool v9_instructions_work() { return has_v9(); } - // Assembler testing static void allow_all(); static void revert(); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 02a438f2f40..761b5c3259f 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1673,6 +1673,11 @@ void Assembler::movdqa(XMMRegister dst, XMMRegister src) { emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_66); } +void Assembler::movdqa(XMMRegister dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_66); +} + void Assembler::movdqu(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_F3); @@ -2286,6 +2291,38 @@ void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { emit_int8(imm8); } +void Assembler::pextrd(Register dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, false); + emit_int8(0x16); + emit_int8((unsigned char)(0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, true); + emit_int8(0x16); + emit_int8((unsigned char)(0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, false); + emit_int8(0x22); + emit_int8((unsigned char)(0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, true); + emit_int8(0x22); + 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); @@ -3691,6 +3728,16 @@ void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) { emit_int8((unsigned char)(0xC0 | encode)); } +// Carry-Less Multiplication Quadword +void Assembler::vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask) { + assert(VM_Version::supports_avx() && VM_Version::supports_clmul(), ""); + bool vector256 = false; + int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); + emit_int8(0x44); + emit_int8((unsigned char)(0xC0 | encode)); + emit_int8((unsigned char)mask); +} + void Assembler::vzeroupper() { assert(VM_Version::supports_avx(), ""); (void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 97a5bfc0368..31481b5808f 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1266,6 +1266,7 @@ private: // Move Aligned Double Quadword void movdqa(XMMRegister dst, XMMRegister src); + void movdqa(XMMRegister dst, Address src); // Move Unaligned Double Quadword void movdqu(Address dst, XMMRegister src); @@ -1404,6 +1405,14 @@ private: void pcmpestri(XMMRegister xmm1, XMMRegister xmm2, int imm8); void pcmpestri(XMMRegister xmm1, Address src, int imm8); + // SSE 4.1 extract + void pextrd(Register dst, XMMRegister src, int imm8); + void pextrq(Register dst, XMMRegister src, int imm8); + + // SSE 4.1 insert + void pinsrd(XMMRegister dst, Register src, int imm8); + void pinsrq(XMMRegister dst, Register src, int imm8); + // SSE4.1 packed move void pmovzxbw(XMMRegister dst, XMMRegister src); void pmovzxbw(XMMRegister dst, Address src); @@ -1764,6 +1773,9 @@ private: // duplicate 4-bytes integer data from src into 8 locations in dest void vpbroadcastd(XMMRegister dst, XMMRegister src); + // Carry-Less Multiplication Quadword + void vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask); + // AVX instruction which is used to clear upper 128 bits of YMM registers and // to avoid transaction penalty between AVX and SSE states. There is no // penalty if legacy SSE instructions are encoded using VEX prefix because diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index a99d7939373..b5bceeb60c6 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3512,6 +3512,22 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { __ bind(*stub->continuation()); } +void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) { + assert(op->crc()->is_single_cpu(), "crc must be register"); + assert(op->val()->is_single_cpu(), "byte value must be register"); + assert(op->result_opr()->is_single_cpu(), "result must be register"); + Register crc = op->crc()->as_register(); + Register val = op->val()->as_register(); + Register res = op->result_opr()->as_register(); + + assert_different_registers(val, crc, res); + + __ lea(res, ExternalAddress(StubRoutines::crc_table_addr())); + __ notl(crc); // ~crc + __ update_byte_crc32(crc, val, res); + __ notl(crc); // ~crc + __ mov(res, crc); +} void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register obj = op->obj_opr()->as_register(); // may not be an oop diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 6810ae54216..e6638581bcf 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -932,6 +932,81 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) { __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint } +void LIRGenerator::do_update_CRC32(Intrinsic* x) { + assert(UseCRC32Intrinsics, "need AVX and LCMUL instructions support"); + // Make all state_for calls early since they can emit code + LIR_Opr result = rlock_result(x); + int flags = 0; + switch (x->id()) { + case vmIntrinsics::_updateCRC32: { + LIRItem crc(x->argument_at(0), this); + LIRItem val(x->argument_at(1), this); + crc.load_item(); + val.load_item(); + __ update_crc32(crc.result(), val.result(), result); + break; + } + case vmIntrinsics::_updateBytesCRC32: + case vmIntrinsics::_updateByteBufferCRC32: { + bool is_updateBytes = (x->id() == vmIntrinsics::_updateBytesCRC32); + + LIRItem crc(x->argument_at(0), this); + LIRItem buf(x->argument_at(1), this); + LIRItem off(x->argument_at(2), this); + LIRItem len(x->argument_at(3), this); + buf.load_item(); + off.load_nonconstant(); + + LIR_Opr index = off.result(); + int offset = is_updateBytes ? arrayOopDesc::base_offset_in_bytes(T_BYTE) : 0; + if(off.result()->is_constant()) { + index = LIR_OprFact::illegalOpr; + offset += off.result()->as_jint(); + } + LIR_Opr base_op = buf.result(); + +#ifndef _LP64 + if (!is_updateBytes) { // long b raw address + base_op = new_register(T_INT); + __ convert(Bytecodes::_l2i, buf.result(), base_op); + } +#else + if (index->is_valid()) { + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index, tmp); + index = tmp; + } +#endif + + LIR_Address* a = new LIR_Address(base_op, + index, + LIR_Address::times_1, + offset, + T_BYTE); + BasicTypeList signature(3); + signature.append(T_INT); + signature.append(T_ADDRESS); + signature.append(T_INT); + CallingConvention* cc = frame_map()->c_calling_convention(&signature); + const LIR_Opr result_reg = result_register_for(x->type()); + + LIR_Opr addr = new_pointer_register(); + __ leal(LIR_OprFact::address(a), addr); + + crc.load_item_force(cc->at(0)); + __ move(addr, cc->at(1)); + len.load_item_force(cc->at(2)); + + __ call_runtime_leaf(StubRoutines::updateBytesCRC32(), getThreadTemp(), result_reg, cc->args()); + __ move(result_reg, result); + + break; + } + default: { + ShouldNotReachHere(); + } + } +} // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f // _i2b, _i2c, _i2s diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp index 98e02b16cd0..13f3df82c29 100644 --- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp @@ -50,8 +50,9 @@ define_pd_global(intx, InitialCodeCacheSize, 160*K); define_pd_global(intx, ReservedCodeCacheSize, 32*M ); define_pd_global(bool, ProfileInterpreter, false); define_pd_global(intx, CodeCacheExpansionSize, 32*K ); -define_pd_global(uintx,CodeCacheMinBlockLength, 1); -define_pd_global(uintx,MetaspaceSize, 12*M ); +define_pd_global(uintx, CodeCacheMinBlockLength, 1); +define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); +define_pd_global(uintx, MetaspaceSize, 12*M ); define_pd_global(bool, NeverActAsServerClassMachine, true ); define_pd_global(uint64_t,MaxRAM, 1ULL*G); define_pd_global(bool, CICompileOSR, true ); diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index f63b8c46d58..ce92123e818 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -85,7 +85,8 @@ define_pd_global(bool, OptoScheduling, false); define_pd_global(bool, OptoBundling, false); define_pd_global(intx, ReservedCodeCacheSize, 48*M); -define_pd_global(uintx,CodeCacheMinBlockLength, 4); +define_pd_global(uintx, CodeCacheMinBlockLength, 4); +define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); // Heap related flags define_pd_global(uintx,MetaspaceSize, ScaleForWordSize(16*M)); diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 92587985dab..c2a7c8b49e3 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -587,7 +587,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // validate ConstantPoolCache* ConstantPoolCache* cp = *interpreter_frame_cache_addr(); - if (cp == NULL || !cp->is_metadata()) return false; + if (cp == NULL || !cp->is_metaspace_object()) return false; // validate locals diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 978a1d6eece..c47f7d1c193 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ define_pd_global(intx, OptoLoopAlignment, 16); define_pd_global(intx, InlineFrequencyCount, 100); define_pd_global(intx, InlineSmallCode, 1000); -define_pd_global(intx, StackYellowPages, 2); +define_pd_global(intx, StackYellowPages, NOT_WINDOWS(2) WINDOWS_ONLY(3)); define_pd_global(intx, StackRedPages, 1); #ifdef AMD64 // Very large C++ stack frames using solaris-amd64 optimized builds @@ -96,6 +96,9 @@ define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS product(intx, UseAVX, 99, \ "Highest supported AVX instructions set on x86/x64") \ \ + product(bool, UseCLMUL, false, \ + "Control whether CLMUL instructions can be used on x86/x64") \ + \ diagnostic(bool, UseIncDec, true, \ "Use INC, DEC instructions on x86") \ \ diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp index 13786e4149a..08f47708cdc 100644 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,8 @@ address generate_empty_entry(void); address generate_accessor_entry(void); address generate_Reference_get_entry(); + address generate_CRC32_update_entry(); + address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); void lock_method(void); void generate_stack_overflow_check(void); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 98c93f99a0f..8aad6965156 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2794,6 +2794,15 @@ void MacroAssembler::movdqu(XMMRegister dst, AddressLiteral src) { } } +void MacroAssembler::movdqa(XMMRegister dst, AddressLiteral src) { + if (reachable(src)) { + Assembler::movdqa(dst, as_Address(src)); + } else { + lea(rscratch1, src); + Assembler::movdqa(dst, Address(rscratch1, 0)); + } +} + void MacroAssembler::movsd(XMMRegister dst, AddressLiteral src) { if (reachable(src)) { Assembler::movsd(dst, as_Address(src)); @@ -6388,6 +6397,193 @@ void MacroAssembler::encode_iso_array(Register src, Register dst, Register len, bind(L_done); } +/** + * Emits code to update CRC-32 with a byte value according to constants in table + * + * @param [in,out]crc Register containing the crc. + * @param [in]val Register containing the byte to fold into the CRC. + * @param [in]table Register containing the table of crc constants. + * + * uint32_t crc; + * val = crc_table[(val ^ crc) & 0xFF]; + * crc = val ^ (crc >> 8); + * + */ +void MacroAssembler::update_byte_crc32(Register crc, Register val, Register table) { + xorl(val, crc); + andl(val, 0xFF); + shrl(crc, 8); // unsigned shift + xorl(crc, Address(table, val, Address::times_4, 0)); +} + +/** + * Fold 128-bit data chunk + */ +void MacroAssembler::fold_128bit_crc32(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, Register buf, int offset) { + vpclmulhdq(xtmp, xK, xcrc); // [123:64] + vpclmulldq(xcrc, xK, xcrc); // [63:0] + vpxor(xcrc, xcrc, Address(buf, offset), false /* vector256 */); + pxor(xcrc, xtmp); +} + +void MacroAssembler::fold_128bit_crc32(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, XMMRegister xbuf) { + vpclmulhdq(xtmp, xK, xcrc); + vpclmulldq(xcrc, xK, xcrc); + pxor(xcrc, xbuf); + pxor(xcrc, xtmp); +} + +/** + * 8-bit folds to compute 32-bit CRC + * + * uint64_t xcrc; + * timesXtoThe32[xcrc & 0xFF] ^ (xcrc >> 8); + */ +void MacroAssembler::fold_8bit_crc32(XMMRegister xcrc, Register table, XMMRegister xtmp, Register tmp) { + movdl(tmp, xcrc); + andl(tmp, 0xFF); + movdl(xtmp, Address(table, tmp, Address::times_4, 0)); + psrldq(xcrc, 1); // unsigned shift one byte + pxor(xcrc, xtmp); +} + +/** + * uint32_t crc; + * timesXtoThe32[crc & 0xFF] ^ (crc >> 8); + */ +void MacroAssembler::fold_8bit_crc32(Register crc, Register table, Register tmp) { + movl(tmp, crc); + andl(tmp, 0xFF); + shrl(crc, 8); + xorl(crc, Address(table, tmp, Address::times_4, 0)); +} + +/** + * @param crc register containing existing CRC (32-bit) + * @param buf register pointing to input byte buffer (byte*) + * @param len register containing number of bytes + * @param table register that will contain address of CRC table + * @param tmp scratch register + */ +void MacroAssembler::kernel_crc32(Register crc, Register buf, Register len, Register table, Register tmp) { + assert_different_registers(crc, buf, len, table, tmp, rax); + + Label L_tail, L_tail_restore, L_tail_loop, L_exit, L_align_loop, L_aligned; + Label L_fold_tail, L_fold_128b, L_fold_512b, L_fold_512b_loop, L_fold_tail_loop; + + lea(table, ExternalAddress(StubRoutines::crc_table_addr())); + notl(crc); // ~crc + cmpl(len, 16); + jcc(Assembler::less, L_tail); + + // Align buffer to 16 bytes + movl(tmp, buf); + andl(tmp, 0xF); + jccb(Assembler::zero, L_aligned); + subl(tmp, 16); + addl(len, tmp); + + align(4); + BIND(L_align_loop); + movsbl(rax, Address(buf, 0)); // load byte with sign extension + update_byte_crc32(crc, rax, table); + increment(buf); + incrementl(tmp); + jccb(Assembler::less, L_align_loop); + + BIND(L_aligned); + movl(tmp, len); // save + shrl(len, 4); + jcc(Assembler::zero, L_tail_restore); + + // Fold crc into first bytes of vector + movdqa(xmm1, Address(buf, 0)); + movdl(rax, xmm1); + xorl(crc, rax); + pinsrd(xmm1, crc, 0); + addptr(buf, 16); + subl(len, 4); // len > 0 + jcc(Assembler::less, L_fold_tail); + + movdqa(xmm2, Address(buf, 0)); + movdqa(xmm3, Address(buf, 16)); + movdqa(xmm4, Address(buf, 32)); + addptr(buf, 48); + subl(len, 3); + jcc(Assembler::lessEqual, L_fold_512b); + + // Fold total 512 bits of polynomial on each iteration, + // 128 bits per each of 4 parallel streams. + movdqu(xmm0, ExternalAddress(StubRoutines::x86::crc_by128_masks_addr() + 32)); + + align(32); + BIND(L_fold_512b_loop); + fold_128bit_crc32(xmm1, xmm0, xmm5, buf, 0); + fold_128bit_crc32(xmm2, xmm0, xmm5, buf, 16); + fold_128bit_crc32(xmm3, xmm0, xmm5, buf, 32); + fold_128bit_crc32(xmm4, xmm0, xmm5, buf, 48); + addptr(buf, 64); + subl(len, 4); + jcc(Assembler::greater, L_fold_512b_loop); + + // Fold 512 bits to 128 bits. + BIND(L_fold_512b); + movdqu(xmm0, ExternalAddress(StubRoutines::x86::crc_by128_masks_addr() + 16)); + fold_128bit_crc32(xmm1, xmm0, xmm5, xmm2); + fold_128bit_crc32(xmm1, xmm0, xmm5, xmm3); + fold_128bit_crc32(xmm1, xmm0, xmm5, xmm4); + + // Fold the rest of 128 bits data chunks + BIND(L_fold_tail); + addl(len, 3); + jccb(Assembler::lessEqual, L_fold_128b); + movdqu(xmm0, ExternalAddress(StubRoutines::x86::crc_by128_masks_addr() + 16)); + + BIND(L_fold_tail_loop); + fold_128bit_crc32(xmm1, xmm0, xmm5, buf, 0); + addptr(buf, 16); + decrementl(len); + jccb(Assembler::greater, L_fold_tail_loop); + + // Fold 128 bits in xmm1 down into 32 bits in crc register. + BIND(L_fold_128b); + movdqu(xmm0, ExternalAddress(StubRoutines::x86::crc_by128_masks_addr())); + vpclmulqdq(xmm2, xmm0, xmm1, 0x1); + vpand(xmm3, xmm0, xmm2, false /* vector256 */); + vpclmulqdq(xmm0, xmm0, xmm3, 0x1); + psrldq(xmm1, 8); + psrldq(xmm2, 4); + pxor(xmm0, xmm1); + pxor(xmm0, xmm2); + + // 8 8-bit folds to compute 32-bit CRC. + for (int j = 0; j < 4; j++) { + fold_8bit_crc32(xmm0, table, xmm1, rax); + } + movdl(crc, xmm0); // mov 32 bits to general register + for (int j = 0; j < 4; j++) { + fold_8bit_crc32(crc, table, rax); + } + + BIND(L_tail_restore); + movl(len, tmp); // restore + BIND(L_tail); + andl(len, 0xf); + jccb(Assembler::zero, L_exit); + + // Fold the rest of bytes + align(4); + BIND(L_tail_loop); + movsbl(rax, Address(buf, 0)); // load byte with sign extension + update_byte_crc32(crc, rax, table); + increment(buf); + decrementl(len); + jccb(Assembler::greater, L_tail_loop); + + BIND(L_exit); + notl(crc); // ~c +} + #undef BIND #undef BLOCK_COMMENT diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index e9f409dc500..3acef073c0e 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -899,6 +899,11 @@ public: void movdqu(XMMRegister dst, XMMRegister src) { Assembler::movdqu(dst, src); } void movdqu(XMMRegister dst, AddressLiteral src); + // Move Aligned Double Quadword + void movdqa(XMMRegister dst, Address src) { Assembler::movdqa(dst, src); } + void movdqa(XMMRegister dst, XMMRegister src) { Assembler::movdqa(dst, src); } + void movdqa(XMMRegister dst, AddressLiteral src); + void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } @@ -1027,6 +1032,16 @@ public: Assembler::vinsertf128h(dst, nds, src); } + // Carry-Less Multiplication Quadword + void vpclmulldq(XMMRegister dst, XMMRegister nds, XMMRegister src) { + // 0x00 - multiply lower 64 bits [0:63] + Assembler::vpclmulqdq(dst, nds, src, 0x00); + } + void vpclmulhdq(XMMRegister dst, XMMRegister nds, XMMRegister src) { + // 0x11 - multiply upper 64 bits [64:127] + Assembler::vpclmulqdq(dst, nds, src, 0x11); + } + // Data void cmov32( Condition cc, Register dst, Address src); @@ -1143,6 +1158,16 @@ public: XMMRegister tmp1, XMMRegister tmp2, XMMRegister tmp3, XMMRegister tmp4, Register tmp5, Register result); + // CRC32 code for java.util.zip.CRC32::updateBytes() instrinsic. + void update_byte_crc32(Register crc, Register val, Register table); + void kernel_crc32(Register crc, Register buf, Register len, Register table, Register tmp); + // Fold 128-bit data chunk + void fold_128bit_crc32(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, Register buf, int offset); + void fold_128bit_crc32(XMMRegister xcrc, XMMRegister xK, XMMRegister xtmp, XMMRegister xbuf); + // Fold 8-bit data + void fold_8bit_crc32(Register crc, Register table, Register tmp); + void fold_8bit_crc32(XMMRegister crc, Register table, XMMRegister xtmp, Register tmp); + #undef VIRTUAL }; diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp index e16c6653960..4cb5c3f61ca 100644 --- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp +++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp @@ -177,30 +177,6 @@ address Relocation::pd_get_address_from_code() { return *pd_address_in_code(); } -int Relocation::pd_breakpoint_size() { - // minimum breakpoint size, in short words - return NativeIllegalInstruction::instruction_size / sizeof(short); -} - -void Relocation::pd_swap_in_breakpoint(address x, short* instrs, int instrlen) { - Untested("pd_swap_in_breakpoint"); - if (instrs != NULL) { - assert(instrlen * sizeof(short) == NativeIllegalInstruction::instruction_size, "enough instrlen in reloc. data"); - for (int i = 0; i < instrlen; i++) { - instrs[i] = ((short*)x)[i]; - } - } - NativeIllegalInstruction::insert(x); -} - - -void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen) { - Untested("pd_swap_out_breakpoint"); - assert(NativeIllegalInstruction::instruction_size == sizeof(short), "right address unit for update"); - NativeInstruction* ni = nativeInstruction_at(x); - *(short*)ni->addr_at(0) = instrs[0]; -} - void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { #ifdef _LP64 if (!Assembler::is_polling_page_far()) { diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index db20c1f2388..cbe960556dc 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1429,6 +1429,8 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType assert(!length_arg.first()->is_Register() || length_arg.first()->as_Register() != tmp_reg, "possible collision"); + __ block_comment("unpack_array_argument {"); + // Pass the length, ptr pair Label is_null, done; VMRegPair tmp; @@ -1453,6 +1455,8 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType move_ptr(masm, tmp, body_arg); move32_64(masm, tmp, length_arg); __ bind(done); + + __ block_comment("} unpack_array_argument"); } @@ -2170,27 +2174,34 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, } } - // point c_arg at the first arg that is already loaded in case we - // need to spill before we call out - int c_arg = total_c_args - total_in_args; + int c_arg; // Pre-load a static method's oop into r14. Used both by locking code and // the normal JNI call code. - if (method->is_static() && !is_critical_native) { + if (!is_critical_native) { + // point c_arg at the first arg that is already loaded in case we + // need to spill before we call out + c_arg = total_c_args - total_in_args; - // load oop into a register - __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror())); + if (method->is_static()) { - // Now handlize the static class mirror it's known not-null. - __ movptr(Address(rsp, klass_offset), oop_handle_reg); - map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); + // load oop into a register + __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror())); - // Now get the handle - __ lea(oop_handle_reg, Address(rsp, klass_offset)); - // store the klass handle as second argument - __ movptr(c_rarg1, oop_handle_reg); - // and protect the arg if we must spill - c_arg--; + // Now handlize the static class mirror it's known not-null. + __ movptr(Address(rsp, klass_offset), oop_handle_reg); + map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); + + // Now get the handle + __ lea(oop_handle_reg, Address(rsp, klass_offset)); + // store the klass handle as second argument + __ movptr(c_rarg1, oop_handle_reg); + // and protect the arg if we must spill + c_arg--; + } + } else { + // For JNI critical methods we need to save all registers in save_args. + c_arg = 0; } // Change state to native (we save the return address in the thread, since it might not diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 7422ed39d24..82e4183ef47 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,7 +83,7 @@ class StubGenerator: public StubCodeGenerator { private: #ifdef PRODUCT -#define inc_counter_np(counter) (0) +#define inc_counter_np(counter) ((void)0) #else void inc_counter_np_(int& counter) { __ incrementl(ExternalAddress((address)&counter)); @@ -2713,6 +2713,59 @@ class StubGenerator: public StubCodeGenerator { return start; } + /** + * Arguments: + * + * Inputs: + * rsp(4) - int crc + * rsp(8) - byte* buf + * rsp(12) - int length + * + * Ouput: + * rax - int crc result + */ + address generate_updateBytesCRC32() { + assert(UseCRC32Intrinsics, "need AVX and CLMUL instructions"); + + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "updateBytesCRC32"); + + address start = __ pc(); + + const Register crc = rdx; // crc + const Register buf = rsi; // source java byte array address + const Register len = rcx; // length + const Register table = rdi; // crc_table address (reuse register) + const Register tmp = rbx; + assert_different_registers(crc, buf, len, table, tmp, rax); + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ push(rsi); + __ push(rdi); + __ push(rbx); + + Address crc_arg(rbp, 8 + 0); + Address buf_arg(rbp, 8 + 4); + Address len_arg(rbp, 8 + 8); + + // Load up: + __ movl(crc, crc_arg); + __ movptr(buf, buf_arg); + __ movl(len, len_arg); + + __ kernel_crc32(crc, buf, len, table, tmp); + + __ movl(rax, crc); + __ pop(rbx); + __ pop(rdi); + __ pop(rsi); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + } + public: // Information about frame layout at time of blocking runtime call. @@ -2887,6 +2940,12 @@ class StubGenerator: public StubCodeGenerator { // Build this early so it's available for the interpreter StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + + if (UseCRC32Intrinsics) { + // set table address before stub generation which use it + StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; + StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32(); + } } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index fb9c1ddd4b9..2d94642f828 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ class StubGenerator: public StubCodeGenerator { private: #ifdef PRODUCT -#define inc_counter_np(counter) (0) +#define inc_counter_np(counter) ((void)0) #else void inc_counter_np_(int& counter) { // This can destroy rscratch1 if counter is far from the code cache @@ -3584,7 +3584,45 @@ class StubGenerator: public StubCodeGenerator { return start; } + /** + * Arguments: + * + * Inputs: + * c_rarg0 - int crc + * c_rarg1 - byte* buf + * c_rarg2 - int length + * + * Ouput: + * rax - int crc result + */ + address generate_updateBytesCRC32() { + assert(UseCRC32Intrinsics, "need AVX and CLMUL instructions"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "updateBytesCRC32"); + + address start = __ pc(); + // Win64: rcx, rdx, r8, r9 (c_rarg0, c_rarg1, ...) + // Unix: rdi, rsi, rdx, rcx, r8, r9 (c_rarg0, c_rarg1, ...) + // rscratch1: r10 + const Register crc = c_rarg0; // crc + const Register buf = c_rarg1; // source java byte array address + const Register len = c_rarg2; // length + const Register table = c_rarg3; // crc_table address (reuse register) + const Register tmp = r11; + assert_different_registers(crc, buf, len, table, tmp, rax); + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + + __ kernel_crc32(crc, buf, len, table, tmp); + + __ movl(rax, crc); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + } #undef __ #define __ masm-> @@ -3736,6 +3774,11 @@ class StubGenerator: public StubCodeGenerator { CAST_FROM_FN_PTR(address, SharedRuntime:: throw_StackOverflowError)); + if (UseCRC32Intrinsics) { + // set table address before stub generation which use it + StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; + StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32(); + } } void generate_all() { diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp new file mode 100644 index 00000000000..200f2aff80d --- /dev/null +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "runtime/deoptimization.hpp" +#include "runtime/frame.inline.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/thread.inline.hpp" + +// Implementation of the platform-specific part of StubRoutines - for +// a description of how to extend it, see the stubRoutines.hpp file. + +address StubRoutines::x86::_verify_mxcsr_entry = NULL; +address StubRoutines::x86::_key_shuffle_mask_addr = NULL; + +uint64_t StubRoutines::x86::_crc_by128_masks[] = +{ + /* The fields in this structure are arranged so that they can be + * picked up two at a time with 128-bit loads. + * + * Because of flipped bit order for this CRC polynomials + * the constant for X**N is left-shifted by 1. This is because + * a 64 x 64 polynomial multiply produces a 127-bit result + * but the highest term is always aligned to bit 0 in the container. + * Pre-shifting by one fixes this, at the cost of potentially making + * the 32-bit constant no longer fit in a 32-bit container (thus the + * use of uint64_t, though this is also the size used by the carry- + * less multiply instruction. + * + * In addition, the flipped bit order and highest-term-at-least-bit + * multiply changes the constants used. The 96-bit result will be + * aligned to the high-term end of the target 128-bit container, + * not the low-term end; that is, instead of a 512-bit or 576-bit fold, + * instead it is a 480 (=512-32) or 544 (=512+64-32) bit fold. + * + * This cause additional problems in the 128-to-64-bit reduction; see the + * code for details. By storing a mask in the otherwise unused half of + * a 128-bit constant, bits can be cleared before multiplication without + * storing and reloading. Note that staying on a 128-bit datapath means + * that some data is uselessly stored and some unused data is intersected + * with an irrelevant constant. + */ + + ((uint64_t) 0xffffffffUL), /* low of K_M_64 */ + ((uint64_t) 0xb1e6b092U << 1), /* high of K_M_64 */ + ((uint64_t) 0xba8ccbe8U << 1), /* low of K_160_96 */ + ((uint64_t) 0x6655004fU << 1), /* high of K_160_96 */ + ((uint64_t) 0xaa2215eaU << 1), /* low of K_544_480 */ + ((uint64_t) 0xe3720acbU << 1) /* high of K_544_480 */ +}; + +/** + * crc_table[] from jdk/src/share/native/java/util/zip/zlib-1.2.5/crc32.h + */ +juint StubRoutines::x86::_crc_table[] = +{ + 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, + 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, + 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, + 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, + 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, + 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, + 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, + 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, + 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, + 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, + 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, + 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, + 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, + 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, + 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, + 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, + 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, + 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, + 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, + 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, + 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, + 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, + 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, + 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, + 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, + 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, + 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, + 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, + 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, + 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, + 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, + 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, + 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, + 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, + 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, + 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, + 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, + 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, + 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, + 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, + 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, + 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, + 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, + 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, + 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, + 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, + 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, + 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, + 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, + 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, + 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, + 0x2d02ef8dUL +}; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp new file mode 100644 index 00000000000..d8e52ab3b11 --- /dev/null +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#ifndef CPU_X86_VM_STUBROUTINES_X86_HPP +#define CPU_X86_VM_STUBROUTINES_X86_HPP + +// This file holds the platform specific parts of the StubRoutines +// definition. See stubRoutines.hpp for a description on how to +// extend it. + + private: + static address _verify_mxcsr_entry; + // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers + static address _key_shuffle_mask_addr; + // masks and table for CRC32 + static uint64_t _crc_by128_masks[]; + static juint _crc_table[]; + + public: + static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } + static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } + static address crc_by128_masks_addr() { return (address)_crc_by128_masks; } + +#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp index 65e773ed53c..53464dcccdf 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,4 @@ // Implementation of the platform-specific part of StubRoutines - for // a description of how to extend it, see the stubRoutines.hpp file. -address StubRoutines::x86::_verify_mxcsr_entry = NULL; address StubRoutines::x86::_verify_fpu_cntrl_wrd_entry = NULL; -address StubRoutines::x86::_key_shuffle_mask_addr = NULL; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index d53124fc6c8..bca5d493ce4 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,15 +39,12 @@ class x86 { friend class VMStructs; private: - static address _verify_mxcsr_entry; static address _verify_fpu_cntrl_wrd_entry; - // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers - static address _key_shuffle_mask_addr; public: - static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; } - static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } + +# include "stubRoutines_x86.hpp" }; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp index 9f0a94200a5..5c11734cc97 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,6 @@ address StubRoutines::x86::_get_previous_fp_entry = NULL; address StubRoutines::x86::_get_previous_sp_entry = NULL; -address StubRoutines::x86::_verify_mxcsr_entry = NULL; - address StubRoutines::x86::_f2i_fixup = NULL; address StubRoutines::x86::_f2l_fixup = NULL; address StubRoutines::x86::_d2i_fixup = NULL; @@ -45,4 +43,3 @@ address StubRoutines::x86::_float_sign_flip = NULL; address StubRoutines::x86::_double_sign_mask = NULL; address StubRoutines::x86::_double_sign_flip = NULL; address StubRoutines::x86::_mxcsr_std = NULL; -address StubRoutines::x86::_key_shuffle_mask_addr = NULL; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index c3efeecb759..d63e9fdf57f 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ class x86 { private: static address _get_previous_fp_entry; static address _get_previous_sp_entry; - static address _verify_mxcsr_entry; static address _f2i_fixup; static address _f2l_fixup; @@ -54,8 +53,6 @@ class x86 { static address _double_sign_mask; static address _double_sign_flip; static address _mxcsr_std; - // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers - static address _key_shuffle_mask_addr; public: @@ -69,11 +66,6 @@ class x86 { return _get_previous_sp_entry; } - static address verify_mxcsr_entry() - { - return _verify_mxcsr_entry; - } - static address f2i_fixup() { return _f2i_fixup; @@ -119,7 +111,7 @@ class x86 { return _mxcsr_std; } - static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } +# include "stubRoutines_x86.hpp" }; diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 3908a8c09da..2efa59f8b33 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -868,6 +868,120 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { return generate_accessor_entry(); } +/** + * Method entry for static native methods: + * int java.util.zip.CRC32.update(int crc, int b) + */ +address InterpreterGenerator::generate_CRC32_update_entry() { + if (UseCRC32Intrinsics) { + address entry = __ pc(); + + // rbx,: Method* + // rsi: senderSP must preserved for slow path, set SP to it on fast path + // rdx: scratch + // rdi: scratch + + Label slow_path; + // If we need a safepoint check, generate full interpreter entry. + ExternalAddress state(SafepointSynchronize::address_of_state()); + __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), + SafepointSynchronize::_not_synchronized); + __ jcc(Assembler::notEqual, slow_path); + + // We don't generate local frame and don't align stack because + // we call stub code and there is no safepoint on this path. + + // Load parameters + const Register crc = rax; // crc + const Register val = rdx; // source java byte value + const Register tbl = rdi; // scratch + + // Arguments are reversed on java expression stack + __ movl(val, Address(rsp, wordSize)); // byte value + __ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC + + __ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr())); + __ notl(crc); // ~crc + __ update_byte_crc32(crc, val, tbl); + __ notl(crc); // ~crc + // result in rax + + // _areturn + __ pop(rdi); // get return address + __ mov(rsp, rsi); // set sp to sender sp + __ jmp(rdi); + + // generate a vanilla native entry as the slow path + __ bind(slow_path); + + (void) generate_native_entry(false); + + return entry; + } + return generate_native_entry(false); +} + +/** + * Method entry for static native methods: + * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) + * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) + */ +address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + if (UseCRC32Intrinsics) { + address entry = __ pc(); + + // rbx,: Method* + // rsi: senderSP must preserved for slow path, set SP to it on fast path + // rdx: scratch + // rdi: scratch + + Label slow_path; + // If we need a safepoint check, generate full interpreter entry. + ExternalAddress state(SafepointSynchronize::address_of_state()); + __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), + SafepointSynchronize::_not_synchronized); + __ jcc(Assembler::notEqual, slow_path); + + // We don't generate local frame and don't align stack because + // we call stub code and there is no safepoint on this path. + + // Load parameters + const Register crc = rax; // crc + const Register buf = rdx; // source java byte array address + const Register len = rdi; // length + + // Arguments are reversed on java expression stack + __ movl(len, Address(rsp, wordSize)); // Length + // Calculate address of start element + if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) { + __ movptr(buf, Address(rsp, 3*wordSize)); // long buf + __ addptr(buf, Address(rsp, 2*wordSize)); // + offset + __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC + } else { + __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array + __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size + __ addptr(buf, Address(rsp, 2*wordSize)); // + offset + __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC + } + + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len); + // result in rax + + // _areturn + __ pop(rdi); // get return address + __ mov(rsp, rsi); // set sp to sender sp + __ jmp(rdi); + + // generate a vanilla native entry as the slow path + __ bind(slow_path); + + (void) generate_native_entry(false); + + return entry; + } + return generate_native_entry(false); +} + // // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the native method @@ -1501,15 +1615,16 @@ address AbstractInterpreterGenerator::generate_method_entry(AbstractInterpreter: // determine code generation flags bool synchronized = false; address entry_point = NULL; + InterpreterGenerator* ig_this = (InterpreterGenerator*)this; switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break; - case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true); break; - case Interpreter::empty : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); break; - case Interpreter::accessor : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); break; + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : entry_point = ig_this->generate_native_entry(false); break; + case Interpreter::native_synchronized : entry_point = ig_this->generate_native_entry(true); break; + case Interpreter::empty : entry_point = ig_this->generate_empty_entry(); break; + case Interpreter::accessor : entry_point = ig_this->generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = ig_this->generate_abstract_entry(); break; case Interpreter::java_lang_math_sin : // fall thru case Interpreter::java_lang_math_cos : // fall thru @@ -1519,9 +1634,15 @@ address AbstractInterpreterGenerator::generate_method_entry(AbstractInterpreter: case Interpreter::java_lang_math_log10 : // fall thru case Interpreter::java_lang_math_sqrt : // fall thru case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); break; + case Interpreter::java_lang_math_exp : entry_point = ig_this->generate_math_entry(kind); break; case Interpreter::java_lang_ref_reference_get - : entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); break; + : entry_point = ig_this->generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : entry_point = ig_this->generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : entry_point = ig_this->generate_CRC32_updateBytes_entry(kind); break; default: fatal(err_msg("unexpected method kind: %d", kind)); break; @@ -1529,7 +1650,7 @@ address AbstractInterpreterGenerator::generate_method_entry(AbstractInterpreter: if (entry_point) return entry_point; - return ((InterpreterGenerator*)this)->generate_normal_entry(synchronized); + return ig_this->generate_normal_entry(synchronized); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 50bb8a968f6..f0a2258a70e 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -840,6 +840,117 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { return generate_accessor_entry(); } +/** + * Method entry for static native methods: + * int java.util.zip.CRC32.update(int crc, int b) + */ +address InterpreterGenerator::generate_CRC32_update_entry() { + if (UseCRC32Intrinsics) { + address entry = __ pc(); + + // rbx,: Method* + // rsi: senderSP must preserved for slow path, set SP to it on fast path + // rdx: scratch + // rdi: scratch + + Label slow_path; + // If we need a safepoint check, generate full interpreter entry. + ExternalAddress state(SafepointSynchronize::address_of_state()); + __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), + SafepointSynchronize::_not_synchronized); + __ jcc(Assembler::notEqual, slow_path); + + // We don't generate local frame and don't align stack because + // we call stub code and there is no safepoint on this path. + + // Load parameters + const Register crc = rax; // crc + const Register val = rdx; // source java byte value + const Register tbl = rdi; // scratch + + // Arguments are reversed on java expression stack + __ movl(val, Address(rsp, wordSize)); // byte value + __ movl(crc, Address(rsp, 2*wordSize)); // Initial CRC + + __ lea(tbl, ExternalAddress(StubRoutines::crc_table_addr())); + __ notl(crc); // ~crc + __ update_byte_crc32(crc, val, tbl); + __ notl(crc); // ~crc + // result in rax + + // _areturn + __ pop(rdi); // get return address + __ mov(rsp, rsi); // set sp to sender sp + __ jmp(rdi); + + // generate a vanilla native entry as the slow path + __ bind(slow_path); + + (void) generate_native_entry(false); + + return entry; + } + return generate_native_entry(false); +} + +/** + * Method entry for static native methods: + * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) + * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) + */ +address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + if (UseCRC32Intrinsics) { + address entry = __ pc(); + + // rbx,: Method* + // r13: senderSP must preserved for slow path, set SP to it on fast path + + Label slow_path; + // If we need a safepoint check, generate full interpreter entry. + ExternalAddress state(SafepointSynchronize::address_of_state()); + __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), + SafepointSynchronize::_not_synchronized); + __ jcc(Assembler::notEqual, slow_path); + + // We don't generate local frame and don't align stack because + // we call stub code and there is no safepoint on this path. + + // Load parameters + const Register crc = c_rarg0; // crc + const Register buf = c_rarg1; // source java byte array address + const Register len = c_rarg2; // length + + // Arguments are reversed on java expression stack + __ movl(len, Address(rsp, wordSize)); // Length + // Calculate address of start element + if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) { + __ movptr(buf, Address(rsp, 3*wordSize)); // long buf + __ addptr(buf, Address(rsp, 2*wordSize)); // + offset + __ movl(crc, Address(rsp, 5*wordSize)); // Initial CRC + } else { + __ movptr(buf, Address(rsp, 3*wordSize)); // byte[] array + __ addptr(buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size + __ addptr(buf, Address(rsp, 2*wordSize)); // + offset + __ movl(crc, Address(rsp, 4*wordSize)); // Initial CRC + } + + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()), crc, buf, len); + // result in rax + + // _areturn + __ pop(rdi); // get return address + __ mov(rsp, r13); // set sp to sender sp + __ jmp(rdi); + + // generate a vanilla native entry as the slow path + __ bind(slow_path); + + (void) generate_native_entry(false); + + return entry; + } + return generate_native_entry(false); +} // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the @@ -1510,15 +1621,16 @@ address AbstractInterpreterGenerator::generate_method_entry( // determine code generation flags bool synchronized = false; address entry_point = NULL; + InterpreterGenerator* ig_this = (InterpreterGenerator*)this; switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break; - case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true); break; - case Interpreter::empty : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); break; - case Interpreter::accessor : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); break; + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : entry_point = ig_this->generate_native_entry(false); break; + case Interpreter::native_synchronized : entry_point = ig_this->generate_native_entry(true); break; + case Interpreter::empty : entry_point = ig_this->generate_empty_entry(); break; + case Interpreter::accessor : entry_point = ig_this->generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = ig_this->generate_abstract_entry(); break; case Interpreter::java_lang_math_sin : // fall thru case Interpreter::java_lang_math_cos : // fall thru @@ -1528,9 +1640,15 @@ address AbstractInterpreterGenerator::generate_method_entry( case Interpreter::java_lang_math_log10 : // fall thru case Interpreter::java_lang_math_sqrt : // fall thru case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); break; + case Interpreter::java_lang_math_exp : entry_point = ig_this->generate_math_entry(kind); break; case Interpreter::java_lang_ref_reference_get - : entry_point = ((InterpreterGenerator*)this)->generate_Reference_get_entry(); break; + : entry_point = ig_this->generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : entry_point = ig_this->generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : entry_point = ig_this->generate_CRC32_updateBytes_entry(kind); break; default: fatal(err_msg("unexpected method kind: %d", kind)); break; @@ -1540,8 +1658,7 @@ address AbstractInterpreterGenerator::generate_method_entry( return entry_point; } - return ((InterpreterGenerator*) this)-> - generate_normal_entry(synchronized); + return ig_this->generate_normal_entry(synchronized); } // These should never be compiled since the interpreter will prefer diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 90066c1041a..de38b4a3a53 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -446,6 +446,7 @@ void VM_Version::get_processor_features() { (supports_avx() ? ", avx" : ""), (supports_avx2() ? ", avx2" : ""), (supports_aes() ? ", aes" : ""), + (supports_clmul() ? ", clmul" : ""), (supports_erms() ? ", erms" : ""), (supports_mmx_ext() ? ", mmxext" : ""), (supports_3dnow_prefetch() ? ", 3dnowpref" : ""), @@ -489,6 +490,27 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseAES, false); } + // Use CLMUL instructions if available. + if (supports_clmul()) { + if (FLAG_IS_DEFAULT(UseCLMUL)) { + UseCLMUL = true; + } + } else if (UseCLMUL) { + if (!FLAG_IS_DEFAULT(UseCLMUL)) + warning("CLMUL instructions not available on this CPU (AVX may also be required)"); + FLAG_SET_DEFAULT(UseCLMUL, false); + } + + if (UseCLMUL && (UseAVX > 0) && (UseSSE > 2)) { + if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { + UseCRC32Intrinsics = true; + } + } else if (UseCRC32Intrinsics) { + if (!FLAG_IS_DEFAULT(UseCRC32Intrinsics)) + warning("CRC32 Intrinsics requires AVX and CLMUL instructions (not available on this CPU)"); + FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); + } + // The AES intrinsic stubs require AES instruction support (of course) // but also require sse3 mode for instructions it use. if (UseAES && (UseSSE > 2)) { diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index ec8caba23f0..86e9b662d52 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,8 @@ public: uint32_t value; struct { uint32_t sse3 : 1, - : 2, + clmul : 1, + : 1, monitor : 1, : 1, vmx : 1, @@ -249,7 +250,8 @@ protected: CPU_AVX = (1 << 17), CPU_AVX2 = (1 << 18), CPU_AES = (1 << 19), - CPU_ERMS = (1 << 20) // enhanced 'rep movsb/stosb' instructions + CPU_ERMS = (1 << 20), // enhanced 'rep movsb/stosb' instructions + CPU_CLMUL = (1 << 21) // carryless multiply for CRC } cpuFeatureFlags; enum { @@ -429,6 +431,8 @@ protected: result |= CPU_AES; if (_cpuid_info.sef_cpuid7_ebx.bits.erms != 0) result |= CPU_ERMS; + if (_cpuid_info.std_cpuid1_ecx.bits.clmul != 0) + result |= CPU_CLMUL; // AMD features. if (is_amd()) { @@ -555,6 +559,7 @@ public: static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; } static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; } static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; } + static bool supports_clmul() { return (_cpuFeatures & CPU_CLMUL) != 0; } // Intel features static bool is_intel_family_core() { return is_intel() && diff --git a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp index ed7ee7bca6a..5cd6c62a8de 100644 --- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp +++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp @@ -52,22 +52,6 @@ address* Relocation::pd_address_in_code() { return (address *) addr(); } -int Relocation::pd_breakpoint_size() { - ShouldNotCallThis(); -} - -void Relocation::pd_swap_in_breakpoint(address x, - short* instrs, - int instrlen) { - ShouldNotCallThis(); -} - -void Relocation::pd_swap_out_breakpoint(address x, - short* instrs, - int instrlen) { - ShouldNotCallThis(); -} - void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dst) { ShouldNotCallThis(); diff --git a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp index 1d17143761a..c04b225b830 100644 --- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp @@ -58,7 +58,9 @@ define_pd_global(intx, ReservedCodeCacheSize, 32*M ); define_pd_global(bool, ProfileInterpreter, false); define_pd_global(intx, CodeCacheExpansionSize, 32*K ); define_pd_global(uintx, CodeCacheMinBlockLength, 1 ); -define_pd_global(uintx, MetaspaceSize, 12*M ); +define_pd_global(uintx, CodeCacheMinimumUseSpace, 200*K); + +define_pd_global(uintx, MetaspaceSize, 12*M ); define_pd_global(bool, NeverActAsServerClassMachine, true ); define_pd_global(uint64_t, MaxRAM, 1ULL*G); define_pd_global(bool, CICompileOSR, true ); diff --git a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c index fd0c4333cba..6cdad788572 100644 --- a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c +++ b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c @@ -122,9 +122,7 @@ static int file_open(const char* path, int flag) { } static int file_close(int fd) { - int ret; - RESTARTABLE(close(fd), ret); - return ret; + return close(fd); } static int file_read(int fd, char* buf, int len) { diff --git a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp index 81fba25efd8..ee4feb8d046 100644 --- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp +++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp @@ -199,7 +199,7 @@ int BsdAttachListener::init() { ::unlink(initial_path); int res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr)); if (res == -1) { - RESTARTABLE(::close(listener), res); + ::close(listener); return -1; } @@ -217,7 +217,7 @@ int BsdAttachListener::init() { } } if (res == -1) { - RESTARTABLE(::close(listener), res); + ::close(listener); ::unlink(initial_path); return -1; } @@ -345,24 +345,21 @@ BsdAttachOperation* BsdAttachListener::dequeue() { uid_t puid; gid_t pgid; if (::getpeereid(s, &puid, &pgid) != 0) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } uid_t euid = geteuid(); gid_t egid = getegid(); if (puid != euid || pgid != egid) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } // peer credential look okay so we read the request BsdAttachOperation* op = read_request(s); if (op == NULL) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } else { return op; @@ -413,7 +410,7 @@ void BsdAttachOperation::complete(jint result, bufferedStream* st) { } // done - RESTARTABLE(::close(this->socket()), rc); + ::close(this->socket()); // were we externally suspended while we were waiting? thread->check_and_wait_while_suspended(); diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index e1864effbcf..2db740583e8 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -2074,6 +2074,13 @@ void bsd_wrap_code(char* base, size_t size) { } } +static void warn_fail_commit_memory(char* addr, size_t size, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", %d) failed; error='%s' (errno=%d)", addr, size, exec, + strerror(err), err); +} + // NOTE: Bsd kernel does not really reserve the pages for us. // All it does is to check if there are enough free pages // left at the time of mmap(). This could be a potential @@ -2082,18 +2089,45 @@ bool os::pd_commit_memory(char* addr, size_t size, bool exec) { int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; #ifdef __OpenBSD__ // XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD - return ::mprotect(addr, size, prot) == 0; + if (::mprotect(addr, size, prot) == 0) { + return true; + } #else uintptr_t res = (uintptr_t) ::mmap(addr, size, prot, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0); - return res != (uintptr_t) MAP_FAILED; + if (res != (uintptr_t) MAP_FAILED) { + return true; + } #endif -} + // Warn about any commit errors we see in non-product builds just + // in case mmap() doesn't work as described on the man page. + NOT_PRODUCT(warn_fail_commit_memory(addr, size, exec, errno);) + + return false; +} bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, bool exec) { - return commit_memory(addr, size, exec); + // alignment_hint is ignored on this OS + return pd_commit_memory(addr, size, exec); +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + if (!pd_commit_memory(addr, size, exec)) { + // add extra info in product mode for vm_exit_out_of_memory(): + PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);) + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg); + } +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, + size_t alignment_hint, bool exec, + const char* mesg) { + // alignment_hint is ignored on this OS + pd_commit_memory_or_exit(addr, size, exec, mesg); } void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { @@ -2148,7 +2182,7 @@ bool os::pd_uncommit_memory(char* addr, size_t size) { } bool os::pd_create_stack_guard_pages(char* addr, size_t size) { - return os::commit_memory(addr, size); + return os::commit_memory(addr, size, !ExecMem); } // If this is a growable mapping, remove the guard pages entirely by @@ -2320,21 +2354,20 @@ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) { } // The memory is committed - address pc = CALLER_PC; - MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc); - MemTracker::record_virtual_memory_commit((address)addr, bytes, pc); + MemTracker::record_virtual_memory_reserve_and_commit((address)addr, bytes, mtNone, CALLER_PC); return addr; } bool os::release_memory_special(char* base, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); // detaching the SHM segment will also delete it, see reserve_memory_special() int rslt = shmdt(base); if (rslt == 0) { - MemTracker::record_virtual_memory_uncommit((address)base, bytes); - MemTracker::record_virtual_memory_release((address)base, bytes); + tkr.record((address)base, bytes); return true; } else { + tkr.discard(); return false; } @@ -3512,7 +3545,7 @@ jint os::init_2(void) if (!UseMembar) { address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page"); + guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); os::set_memory_serialize_page( mem_serialize_page ); #ifndef PRODUCT diff --git a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp index 33ebec9fffc..cf8453332eb 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp @@ -178,11 +178,11 @@ inline size_t os::write(int fd, const void *buf, unsigned int nBytes) { } inline int os::close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); + return ::close(fd); } inline int os::socket_close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); + return ::close(fd); } inline int os::socket(int domain, int type, int protocol) { diff --git a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp index 3b794b70230..f59b763b325 100644 --- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp +++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ static char* create_standard_memory(size_t size) { } // commit memory - if (!os::commit_memory(mapAddress, size)) { + if (!os::commit_memory(mapAddress, size, !ExecMem)) { if (PrintMiscellaneous && Verbose) { warning("Could not commit PerfData memory\n"); } @@ -120,7 +120,7 @@ static void save_memory_to_file(char* addr, size_t size) { addr += result; } - RESTARTABLE(::close(fd), result); + result = ::close(fd); if (PrintMiscellaneous && Verbose) { if (result == OS_ERR) { warning("Could not close %s: %s\n", destfile, strerror(errno)); @@ -632,7 +632,7 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, if (PrintMiscellaneous && Verbose) { warning("could not set shared memory file size: %s\n", strerror(errno)); } - RESTARTABLE(::close(fd), result); + ::close(fd); return -1; } @@ -656,7 +656,7 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, if (result != -1) { return fd; } else { - RESTARTABLE(::close(fd), result); + ::close(fd); return -1; } } @@ -734,9 +734,7 @@ static char* mmap_create_shared(size_t size) { mapAddress = (char*)::mmap((char*)0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - // attempt to close the file - restart it if it was interrupted, - // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -755,8 +753,7 @@ static char* mmap_create_shared(size_t size) { (void)::memset((void*) mapAddress, 0, size); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); return mapAddress; } @@ -909,7 +906,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // attempt to close the file - restart if it gets interrupted, // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -921,8 +918,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor } // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); *addr = mapAddress; *sizep = size; diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp index 5b9c7294995..035d298a36c 100644 --- a/hotspot/src/os/linux/vm/attachListener_linux.cpp +++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp @@ -199,7 +199,7 @@ int LinuxAttachListener::init() { ::unlink(initial_path); int res = ::bind(listener, (struct sockaddr*)&addr, sizeof(addr)); if (res == -1) { - RESTARTABLE(::close(listener), res); + ::close(listener); return -1; } @@ -212,7 +212,7 @@ int LinuxAttachListener::init() { } } if (res == -1) { - RESTARTABLE(::close(listener), res); + ::close(listener); ::unlink(initial_path); return -1; } @@ -340,24 +340,21 @@ LinuxAttachOperation* LinuxAttachListener::dequeue() { struct ucred cred_info; socklen_t optlen = sizeof(cred_info); if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } uid_t euid = geteuid(); gid_t egid = getegid(); if (cred_info.uid != euid || cred_info.gid != egid) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } // peer credential look okay so we read the request LinuxAttachOperation* op = read_request(s); if (op == NULL) { - int res; - RESTARTABLE(::close(s), res); + ::close(s); continue; } else { return op; @@ -408,7 +405,7 @@ void LinuxAttachOperation::complete(jint result, bufferedStream* st) { } // done - RESTARTABLE(::close(this->socket()), rc); + ::close(this->socket()); // were we externally suspended while we were waiting? thread->check_and_wait_while_suspended(); diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 4b975461ee9..53bfe4e7369 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -2612,11 +2612,49 @@ void linux_wrap_code(char* base, size_t size) { } } +static bool recoverable_mmap_error(int err) { + // See if the error is one we can let the caller handle. This + // list of errno values comes from JBS-6843484. I can't find a + // Linux man page that documents this specific set of errno + // values so while this list currently matches Solaris, it may + // change as we gain experience with this failure mode. + switch (err) { + case EBADF: + case EINVAL: + case ENOTSUP: + // let the caller deal with these errors + return true; + + default: + // Any remaining errors on this OS can cause our reserved mapping + // to be lost. That can cause confusion where different data + // structures think they have the same memory mapped. The worst + // scenario is if both the VM and a library think they have the + // same memory mapped. + return false; + } +} + +static void warn_fail_commit_memory(char* addr, size_t size, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", %d) failed; error='%s' (errno=%d)", addr, size, exec, + strerror(err), err); +} + +static void warn_fail_commit_memory(char* addr, size_t size, + size_t alignment_hint, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", addr, size, + alignment_hint, exec, strerror(err), err); +} + // NOTE: Linux kernel does not really reserve the pages for us. // All it does is to check if there are enough free pages // left at the time of mmap(). This could be a potential // problem. -bool os::pd_commit_memory(char* addr, size_t size, bool exec) { +int os::Linux::commit_memory_impl(char* addr, size_t size, bool exec) { int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; uintptr_t res = (uintptr_t) ::mmap(addr, size, prot, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0); @@ -2624,9 +2662,32 @@ bool os::pd_commit_memory(char* addr, size_t size, bool exec) { if (UseNUMAInterleaving) { numa_make_global(addr, size); } - return true; + return 0; + } + + int err = errno; // save errno from mmap() call above + + if (!recoverable_mmap_error(err)) { + warn_fail_commit_memory(addr, size, exec, err); + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, "committing reserved memory."); + } + + return err; +} + +bool os::pd_commit_memory(char* addr, size_t size, bool exec) { + return os::Linux::commit_memory_impl(addr, size, exec) == 0; +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + int err = os::Linux::commit_memory_impl(addr, size, exec); + if (err != 0) { + // the caller wants all commit errors to exit with the specified mesg: + warn_fail_commit_memory(addr, size, exec, err); + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg); } - return false; } // Define MAP_HUGETLB here so we can build HotSpot on old systems. @@ -2639,8 +2700,9 @@ bool os::pd_commit_memory(char* addr, size_t size, bool exec) { #define MADV_HUGEPAGE 14 #endif -bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, - bool exec) { +int os::Linux::commit_memory_impl(char* addr, size_t size, + size_t alignment_hint, bool exec) { + int err; if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) { int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; uintptr_t res = @@ -2651,16 +2713,46 @@ bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, if (UseNUMAInterleaving) { numa_make_global(addr, size); } - return true; + return 0; + } + + err = errno; // save errno from mmap() call above + + if (!recoverable_mmap_error(err)) { + // However, it is not clear that this loss of our reserved mapping + // happens with large pages on Linux or that we cannot recover + // from the loss. For now, we just issue a warning and we don't + // call vm_exit_out_of_memory(). This issue is being tracked by + // JBS-8007074. + warn_fail_commit_memory(addr, size, alignment_hint, exec, err); +// vm_exit_out_of_memory(size, OOM_MMAP_ERROR, +// "committing reserved memory."); } // Fall through and try to use small pages } - if (commit_memory(addr, size, exec)) { + err = os::Linux::commit_memory_impl(addr, size, exec); + if (err == 0) { realign_memory(addr, size, alignment_hint); - return true; } - return false; + return err; +} + +bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, + bool exec) { + return os::Linux::commit_memory_impl(addr, size, alignment_hint, exec) == 0; +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, + size_t alignment_hint, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + int err = os::Linux::commit_memory_impl(addr, size, alignment_hint, exec); + if (err != 0) { + // the caller wants all commit errors to exit with the specified mesg: + warn_fail_commit_memory(addr, size, alignment_hint, exec, err); + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg); + } } void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { @@ -2678,7 +2770,7 @@ void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) { // small pages on top of the SHM segment. This method always works for small pages, so we // allow that in any case. if (alignment_hint <= (size_t)os::vm_page_size() || !UseSHM) { - commit_memory(addr, bytes, alignment_hint, false); + commit_memory(addr, bytes, alignment_hint, !ExecMem); } } @@ -2931,7 +3023,7 @@ bool os::pd_create_stack_guard_pages(char* addr, size_t size) { ::munmap((void*)stack_extent, (uintptr_t)addr - stack_extent); } - return os::commit_memory(addr, size); + return os::commit_memory(addr, size, !ExecMem); } // If this is a growable mapping, remove the guard pages entirely by @@ -3053,7 +3145,7 @@ bool os::Linux::hugetlbfs_sanity_check(bool warn, size_t page_size) { MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB, -1, 0); - if (p != (void *) -1) { + if (p != MAP_FAILED) { // We don't know if this really is a huge page or not. FILE *fp = fopen("/proc/self/maps", "r"); if (fp) { @@ -3271,22 +3363,21 @@ char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) { } // The memory is committed - address pc = CALLER_PC; - MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc); - MemTracker::record_virtual_memory_commit((address)addr, bytes, pc); + MemTracker::record_virtual_memory_reserve_and_commit((address)addr, bytes, mtNone, CALLER_PC); return addr; } bool os::release_memory_special(char* base, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); // detaching the SHM segment will also delete it, see reserve_memory_special() int rslt = shmdt(base); if (rslt == 0) { - MemTracker::record_virtual_memory_uncommit((address)base, bytes); - MemTracker::record_virtual_memory_release((address)base, bytes); + tkr.record((address)base, bytes); return true; } else { - return false; + tkr.discard(); + return false; } } @@ -4393,7 +4484,7 @@ jint os::init_2(void) if (!UseMembar) { address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page"); + guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); os::set_memory_serialize_page( mem_serialize_page ); #ifndef PRODUCT diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index 41c29f680a7..8c5032fc23b 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -76,6 +76,10 @@ class Linux { static julong physical_memory() { return _physical_memory; } static void initialize_system_info(); + static int commit_memory_impl(char* addr, size_t bytes, bool exec); + static int commit_memory_impl(char* addr, size_t bytes, + size_t alignment_hint, bool exec); + static void set_glibc_version(const char *s) { _glibc_version = s; } static void set_libpthread_version(const char *s) { _libpthread_version = s; } diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp index d1859b9a6c5..87fc56b2b58 100644 --- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp +++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ static char* create_standard_memory(size_t size) { } // commit memory - if (!os::commit_memory(mapAddress, size)) { + if (!os::commit_memory(mapAddress, size, !ExecMem)) { if (PrintMiscellaneous && Verbose) { warning("Could not commit PerfData memory\n"); } @@ -120,7 +120,7 @@ static void save_memory_to_file(char* addr, size_t size) { addr += result; } - RESTARTABLE(::close(fd), result); + result = ::close(fd); if (PrintMiscellaneous && Verbose) { if (result == OS_ERR) { warning("Could not close %s: %s\n", destfile, strerror(errno)); @@ -632,7 +632,7 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, if (PrintMiscellaneous && Verbose) { warning("could not set shared memory file size: %s\n", strerror(errno)); } - RESTARTABLE(::close(fd), result); + ::close(fd); return -1; } @@ -656,7 +656,7 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, if (result != -1) { return fd; } else { - RESTARTABLE(::close(fd), result); + ::close(fd); return -1; } } @@ -734,9 +734,7 @@ static char* mmap_create_shared(size_t size) { mapAddress = (char*)::mmap((char*)0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - // attempt to close the file - restart it if it was interrupted, - // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -755,8 +753,7 @@ static char* mmap_create_shared(size_t size) { (void)::memset((void*) mapAddress, 0, size); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); return mapAddress; } @@ -907,9 +904,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor mapAddress = (char*)::mmap((char*)0, size, mmap_prot, MAP_SHARED, fd, 0); - // attempt to close the file - restart if it gets interrupted, - // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -921,8 +916,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor } // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); *addr = mapAddress; *sizep = size; diff --git a/hotspot/src/os/solaris/dtrace/jhelper.d b/hotspot/src/os/solaris/dtrace/jhelper.d index 976a832107f..752f5ae535e 100644 --- a/hotspot/src/os/solaris/dtrace/jhelper.d +++ b/hotspot/src/os/solaris/dtrace/jhelper.d @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -332,12 +332,15 @@ dtrace:helper:ustack: this->nameSymbol = copyin_ptr(this->constantPool + this->nameIndex * sizeof (pointer) + SIZE_ConstantPool); + /* The symbol is a CPSlot and has lower bit set to indicate metadata */ + this->nameSymbol &= (~1); /* remove metadata lsb */ this->nameSymbolLength = copyin_uint16(this->nameSymbol + OFFSET_Symbol_length); this->signatureSymbol = copyin_ptr(this->constantPool + this->signatureIndex * sizeof (pointer) + SIZE_ConstantPool); + this->signatureSymbol &= (~1); /* remove metadata lsb */ this->signatureSymbolLength = copyin_uint16(this->signatureSymbol + OFFSET_Symbol_length); diff --git a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c index fd0c4333cba..6cdad788572 100644 --- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c +++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c @@ -122,9 +122,7 @@ static int file_open(const char* path, int flag) { } static int file_close(int fd) { - int ret; - RESTARTABLE(close(fd), ret); - return ret; + return close(fd); } static int file_read(int fd, char* buf, int len) { diff --git a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp index f90538efe77..9cc66876268 100644 --- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp +++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp @@ -392,7 +392,7 @@ int SolarisAttachListener::create_door() { return -1; } assert(fd >= 0, "bad file descriptor"); - RESTARTABLE(::close(fd), res); + ::close(fd); // attach the door descriptor to the file if ((res = ::fattach(dd, initial_path)) == -1) { @@ -410,7 +410,7 @@ int SolarisAttachListener::create_door() { // rename file so that clients can attach if (dd >= 0) { if (::rename(initial_path, door_path) == -1) { - RESTARTABLE(::close(dd), res); + ::close(dd); ::fdetach(initial_path); dd = -1; } @@ -549,7 +549,7 @@ void SolarisAttachOperation::complete(jint res, bufferedStream* st) { } // close socket and we're done - RESTARTABLE(::close(this->socket()), rc); + ::close(this->socket()); // were we externally suspended while we were waiting? thread->check_and_wait_while_suspended(); diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 5df7a8b403b..ad8c52914be 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -2784,7 +2784,42 @@ int os::vm_allocation_granularity() { return page_size; } -bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { +static bool recoverable_mmap_error(int err) { + // See if the error is one we can let the caller handle. This + // list of errno values comes from the Solaris mmap(2) man page. + switch (err) { + case EBADF: + case EINVAL: + case ENOTSUP: + // let the caller deal with these errors + return true; + + default: + // Any remaining errors on this OS can cause our reserved mapping + // to be lost. That can cause confusion where different data + // structures think they have the same memory mapped. The worst + // scenario is if both the VM and a library think they have the + // same memory mapped. + return false; + } +} + +static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", %d) failed; error='%s' (errno=%d)", addr, bytes, exec, + strerror(err), err); +} + +static void warn_fail_commit_memory(char* addr, size_t bytes, + size_t alignment_hint, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", " SIZE_FORMAT ", %d) failed; error='%s' (errno=%d)", addr, bytes, + alignment_hint, exec, strerror(err), err); +} + +int os::Solaris::commit_memory_impl(char* addr, size_t bytes, bool exec) { int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; size_t size = bytes; char *res = Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot); @@ -2792,14 +2827,38 @@ bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { if (UseNUMAInterleaving) { numa_make_global(addr, bytes); } - return true; + return 0; } - return false; + + int err = errno; // save errno from mmap() call in mmap_chunk() + + if (!recoverable_mmap_error(err)) { + warn_fail_commit_memory(addr, bytes, exec, err); + vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "committing reserved memory."); + } + + return err; } -bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint, - bool exec) { - if (commit_memory(addr, bytes, exec)) { +bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { + return Solaris::commit_memory_impl(addr, bytes, exec) == 0; +} + +void os::pd_commit_memory_or_exit(char* addr, size_t bytes, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + int err = os::Solaris::commit_memory_impl(addr, bytes, exec); + if (err != 0) { + // the caller wants all commit errors to exit with the specified mesg: + warn_fail_commit_memory(addr, bytes, exec, err); + vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg); + } +} + +int os::Solaris::commit_memory_impl(char* addr, size_t bytes, + size_t alignment_hint, bool exec) { + int err = Solaris::commit_memory_impl(addr, bytes, exec); + if (err == 0) { if (UseMPSS && alignment_hint > (size_t)vm_page_size()) { // If the large page size has been set and the VM // is using large pages, use the large page size @@ -2821,9 +2880,25 @@ bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint, // Since this is a hint, ignore any failures. (void)Solaris::set_mpss_range(addr, bytes, page_size); } - return true; } - return false; + return err; +} + +bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint, + bool exec) { + return Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec) == 0; +} + +void os::pd_commit_memory_or_exit(char* addr, size_t bytes, + size_t alignment_hint, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec); + if (err != 0) { + // the caller wants all commit errors to exit with the specified mesg: + warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err); + vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg); + } } // Uncommit the pages in a specified region. @@ -2835,7 +2910,7 @@ void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) { } bool os::pd_create_stack_guard_pages(char* addr, size_t size) { - return os::commit_memory(addr, size); + return os::commit_memory(addr, size, !ExecMem); } bool os::remove_stack_guard_pages(char* addr, size_t size) { @@ -3457,22 +3532,21 @@ char* os::reserve_memory_special(size_t size, char* addr, bool exec) { } // The memory is committed - address pc = CALLER_PC; - MemTracker::record_virtual_memory_reserve((address)retAddr, size, pc); - MemTracker::record_virtual_memory_commit((address)retAddr, size, pc); + MemTracker::record_virtual_memory_reserve_and_commit((address)retAddr, size, mtNone, CURRENT_PC); return retAddr; } bool os::release_memory_special(char* base, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); // detaching the SHM segment will also delete it, see reserve_memory_special() int rslt = shmdt(base); if (rslt == 0) { - MemTracker::record_virtual_memory_uncommit((address)base, bytes); - MemTracker::record_virtual_memory_release((address)base, bytes); + tkr.record((address)base, bytes); return true; } else { - return false; + tkr.discard(); + return false; } } @@ -6604,11 +6678,11 @@ size_t os::write(int fd, const void *buf, unsigned int nBytes) { } int os::close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); + return ::close(fd); } int os::socket_close(int fd) { - RESTARTABLE_RETURN_INT(::close(fd)); + return ::close(fd); } int os::recv(int fd, char* buf, size_t nBytes, uint flags) { diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp index 99b757cd6ad..f7f0a3d7283 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.hpp @@ -168,6 +168,9 @@ class Solaris { static int _dev_zero_fd; static int get_dev_zero_fd() { return _dev_zero_fd; } static void set_dev_zero_fd(int fd) { _dev_zero_fd = fd; } + static int commit_memory_impl(char* addr, size_t bytes, bool exec); + static int commit_memory_impl(char* addr, size_t bytes, + size_t alignment_hint, bool exec); static char* mmap_chunk(char *addr, size_t size, int flags, int prot); static char* anon_mmap(char* requested_addr, size_t bytes, size_t alignment_hint, bool fixed); static bool mpss_sanity_check(bool warn, size_t * page_size); diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp index 64515d93b91..4155c0f5b1c 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp @@ -89,7 +89,7 @@ inline int os::readdir_buf_size(const char *path) { inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { assert(dirp != NULL, "just checking"); -#if defined(_LP64) || defined(_GNU_SOURCE) +#if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 dirent* p; int status; @@ -98,9 +98,9 @@ inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { return NULL; } else return p; -#else // defined(_LP64) || defined(_GNU_SOURCE) +#else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 return ::readdir_r(dirp, dbuf); -#endif // defined(_LP64) || defined(_GNU_SOURCE) +#endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 } inline int os::closedir(DIR *dirp) { diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp index 3b7744a482e..e7b31ac6483 100644 --- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp +++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ static char* create_standard_memory(size_t size) { } // commit memory - if (!os::commit_memory(mapAddress, size)) { + if (!os::commit_memory(mapAddress, size, !ExecMem)) { if (PrintMiscellaneous && Verbose) { warning("Could not commit PerfData memory\n"); } @@ -122,7 +122,7 @@ static void save_memory_to_file(char* addr, size_t size) { addr += result; } - RESTARTABLE(::close(fd), result); + result = ::close(fd); if (PrintMiscellaneous && Verbose) { if (result == OS_ERR) { warning("Could not close %s: %s\n", destfile, strerror(errno)); @@ -437,7 +437,7 @@ static char* get_user_name(int vmid, TRAPS) { addr+=result; } - RESTARTABLE(::close(fd), result); + ::close(fd); // get the user name for the effective user id of the process char* user_name = get_user_name(psinfo.pr_euid); @@ -669,7 +669,7 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, if (PrintMiscellaneous && Verbose) { warning("could not set shared memory file size: %s\n", strerror(errno)); } - RESTARTABLE(::close(fd), result); + ::close(fd); return -1; } @@ -749,9 +749,7 @@ static char* mmap_create_shared(size_t size) { mapAddress = (char*)::mmap((char*)0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - // attempt to close the file - restart it if it was interrupted, - // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -770,8 +768,7 @@ static char* mmap_create_shared(size_t size) { (void)::memset((void*) mapAddress, 0, size); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); return mapAddress; } @@ -922,9 +919,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor mapAddress = (char*)::mmap((char*)0, size, mmap_prot, MAP_SHARED, fd, 0); - // attempt to close the file - restart if it gets interrupted, - // but ignore other failures - RESTARTABLE(::close(fd), result); + result = ::close(fd); assert(result != OS_ERR, "could not close file"); if (mapAddress == MAP_FAILED) { @@ -936,8 +931,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor } // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); *addr = mapAddress; *sizep = size; diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index baa17768215..cc43934d423 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -2524,7 +2524,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { addr = (address)((uintptr_t)addr & (~((uintptr_t)os::vm_page_size() - (uintptr_t)1))); os::commit_memory((char *)addr, thread->stack_base() - addr, - false ); + !ExecMem); return EXCEPTION_CONTINUE_EXECUTION; } else @@ -2875,7 +2875,7 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags, PAGE_READWRITE); // If reservation failed, return NULL if (p_buf == NULL) return NULL; - MemTracker::record_virtual_memory_reserve((address)p_buf, size_of_reserve, CALLER_PC); + MemTracker::record_virtual_memory_reserve((address)p_buf, size_of_reserve, mtNone, CALLER_PC); os::release_memory(p_buf, bytes + chunk_size); // we still need to round up to a page boundary (in case we are using large pages) @@ -2941,7 +2941,7 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags, // need to create a dummy 'reserve' record to match // the release. MemTracker::record_virtual_memory_reserve((address)p_buf, - bytes_to_release, CALLER_PC); + bytes_to_release, mtNone, CALLER_PC); os::release_memory(p_buf, bytes_to_release); } #ifdef ASSERT @@ -2961,9 +2961,10 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags, // Although the memory is allocated individually, it is returned as one. // NMT records it as one block. address pc = CALLER_PC; - MemTracker::record_virtual_memory_reserve((address)p_buf, bytes, pc); if ((flags & MEM_COMMIT) != 0) { - MemTracker::record_virtual_memory_commit((address)p_buf, bytes, pc); + MemTracker::record_virtual_memory_reserve_and_commit((address)p_buf, bytes, mtNone, pc); + } else { + MemTracker::record_virtual_memory_reserve((address)p_buf, bytes, mtNone, pc); } // made it this far, success @@ -3154,8 +3155,7 @@ char* os::reserve_memory_special(size_t bytes, char* addr, bool exec) { char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot); if (res != NULL) { address pc = CALLER_PC; - MemTracker::record_virtual_memory_reserve((address)res, bytes, pc); - MemTracker::record_virtual_memory_commit((address)res, bytes, pc); + MemTracker::record_virtual_memory_reserve_and_commit((address)res, bytes, mtNone, pc); } return res; @@ -3164,14 +3164,21 @@ char* os::reserve_memory_special(size_t bytes, char* addr, bool exec) { bool os::release_memory_special(char* base, size_t bytes) { assert(base != NULL, "Sanity check"); - // Memory allocated via reserve_memory_special() is committed - MemTracker::record_virtual_memory_uncommit((address)base, bytes); return release_memory(base, bytes); } void os::print_statistics() { } +static void warn_fail_commit_memory(char* addr, size_t bytes, bool exec) { + int err = os::get_last_error(); + char buf[256]; + size_t buf_len = os::lasterror(buf, sizeof(buf)); + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", %d) failed; error='%s' (DOS error/errno=%d)", addr, bytes, + exec, buf_len != 0 ? buf : "", err); +} + bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { if (bytes == 0) { // Don't bother the OS with noops. @@ -3186,11 +3193,17 @@ bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { // is always within a reserve covered by a single VirtualAlloc // in that case we can just do a single commit for the requested size if (!UseNUMAInterleaving) { - if (VirtualAlloc(addr, bytes, MEM_COMMIT, PAGE_READWRITE) == NULL) return false; + if (VirtualAlloc(addr, bytes, MEM_COMMIT, PAGE_READWRITE) == NULL) { + NOT_PRODUCT(warn_fail_commit_memory(addr, bytes, exec);) + return false; + } if (exec) { DWORD oldprot; // Windows doc says to use VirtualProtect to get execute permissions - if (!VirtualProtect(addr, bytes, PAGE_EXECUTE_READWRITE, &oldprot)) return false; + if (!VirtualProtect(addr, bytes, PAGE_EXECUTE_READWRITE, &oldprot)) { + NOT_PRODUCT(warn_fail_commit_memory(addr, bytes, exec);) + return false; + } } return true; } else { @@ -3205,12 +3218,20 @@ bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { MEMORY_BASIC_INFORMATION alloc_info; VirtualQuery(next_alloc_addr, &alloc_info, sizeof(alloc_info)); size_t bytes_to_rq = MIN2(bytes_remaining, (size_t)alloc_info.RegionSize); - if (VirtualAlloc(next_alloc_addr, bytes_to_rq, MEM_COMMIT, PAGE_READWRITE) == NULL) + if (VirtualAlloc(next_alloc_addr, bytes_to_rq, MEM_COMMIT, + PAGE_READWRITE) == NULL) { + NOT_PRODUCT(warn_fail_commit_memory(next_alloc_addr, bytes_to_rq, + exec);) return false; + } if (exec) { DWORD oldprot; - if (!VirtualProtect(next_alloc_addr, bytes_to_rq, PAGE_EXECUTE_READWRITE, &oldprot)) + if (!VirtualProtect(next_alloc_addr, bytes_to_rq, + PAGE_EXECUTE_READWRITE, &oldprot)) { + NOT_PRODUCT(warn_fail_commit_memory(next_alloc_addr, bytes_to_rq, + exec);) return false; + } } bytes_remaining -= bytes_to_rq; next_alloc_addr += bytes_to_rq; @@ -3222,7 +3243,24 @@ bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) { bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, bool exec) { - return commit_memory(addr, size, exec); + // alignment_hint is ignored on this OS + return pd_commit_memory(addr, size, exec); +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec, + const char* mesg) { + assert(mesg != NULL, "mesg must be specified"); + if (!pd_commit_memory(addr, size, exec)) { + warn_fail_commit_memory(addr, size, exec); + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg); + } +} + +void os::pd_commit_memory_or_exit(char* addr, size_t size, + size_t alignment_hint, bool exec, + const char* mesg) { + // alignment_hint is ignored on this OS + pd_commit_memory_or_exit(addr, size, exec, mesg); } bool os::pd_uncommit_memory(char* addr, size_t bytes) { @@ -3240,7 +3278,7 @@ bool os::pd_release_memory(char* addr, size_t bytes) { } bool os::pd_create_stack_guard_pages(char* addr, size_t size) { - return os::commit_memory(addr, size); + return os::commit_memory(addr, size, !ExecMem); } bool os::remove_stack_guard_pages(char* addr, size_t size) { @@ -3264,8 +3302,9 @@ bool os::protect_memory(char* addr, size_t bytes, ProtType prot, // Strange enough, but on Win32 one can change protection only for committed // memory, not a big deal anyway, as bytes less or equal than 64K - if (!is_committed && !commit_memory(addr, bytes, prot == MEM_PROT_RWX)) { - fatal("cannot commit protection page"); + if (!is_committed) { + commit_memory_or_exit(addr, bytes, prot == MEM_PROT_RWX, + "cannot commit protection page"); } // One cannot use os::guard_memory() here, as on Win32 guard page // have different (one-shot) semantics, from MSDN on PAGE_GUARD: diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp index 2f25414d1b7..1bf27296520 100644 --- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp +++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ static char* create_standard_memory(size_t size) { } // commit memory - if (!os::commit_memory(mapAddress, size)) { + if (!os::commit_memory(mapAddress, size, !ExecMem)) { if (PrintMiscellaneous && Verbose) { warning("Could not commit PerfData memory\n"); } @@ -1498,8 +1498,7 @@ static char* mapping_create_shared(size_t size) { (void)memset(mapAddress, '\0', size); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); return (char*) mapAddress; } @@ -1681,8 +1680,7 @@ static void open_file_mapping(const char* user, int vmid, } // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); *addrp = (char*)mapAddress; @@ -1836,9 +1834,10 @@ void PerfMemory::detach(char* addr, size_t bytes, TRAPS) { return; } + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); remove_file_mapping(addr); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_release((address)addr, bytes); + tkr.record((address)addr, bytes); } char* PerfMemory::backing_store_filename() { diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index fa31a50c327..9de203c1191 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -169,7 +169,6 @@ inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* : "memory"); return rv; #else - assert(VM_Version::v9_instructions_work(), "cas only supported on v9"); volatile jlong_accessor evl, cvl, rv; evl.long_value = exchange_value; cvl.long_value = compare_value; diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index fa0f1b2aa1c..4fc3b76d228 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -289,6 +289,16 @@ JVM_handle_linux_signal(int sig, } #endif // AMD64 +#ifndef AMD64 + // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs + // This can happen in any running code (currently more frequently in + // interpreter code but has been seen in compiled code) + if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) { + fatal("An irrecoverable SI_KERNEL SIGSEGV has occurred due " + "to unstable signal handling in this distribution."); + } +#endif // AMD64 + // Handle ALL stack overflow variations here if (sig == SIGSEGV) { address addr = (address) info->si_addr; diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp deleted file mode 100644 index c9e4c2cc0d0..00000000000 --- a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 1999, 2010, 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. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.inline.hpp" -#include "runtime/os.hpp" -#include "runtime/threadLocalStorage.hpp" - -#include // For trap numbers -#include // For V8 compatibility - -void MacroAssembler::read_ccr_trap(Register ccr_save) { - // Execute a trap to get the PSR, mask and shift - // to get the condition codes. - get_psr_trap(); - nop(); - set(PSR_ICC, ccr_save); - and3(O0, ccr_save, ccr_save); - srl(ccr_save, PSR_ICC_SHIFT, ccr_save); -} - -void MacroAssembler::write_ccr_trap(Register ccr_save, Register scratch1, Register scratch2) { - // Execute a trap to get the PSR, shift back - // the condition codes, mask the condition codes - // back into and PSR and trap to write back the - // PSR. - sll(ccr_save, PSR_ICC_SHIFT, scratch2); - get_psr_trap(); - nop(); - set(~PSR_ICC, scratch1); - and3(O0, scratch1, O0); - or3(O0, scratch2, O0); - set_psr_trap(); - nop(); -} - -void MacroAssembler::flush_windows_trap() { trap(ST_FLUSH_WINDOWS); } -void MacroAssembler::clean_windows_trap() { trap(ST_CLEAN_WINDOWS); } -void MacroAssembler::get_psr_trap() { trap(ST_GETPSR); } -void MacroAssembler::set_psr_trap() { trap(ST_SETPSR); } diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp index b91214748c2..7d17fdf39cd 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp @@ -60,21 +60,10 @@ inline jlong Atomic::load(volatile jlong* src) { return *src; } #else -extern "C" void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst); extern "C" void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst); inline void Atomic_move_long(volatile jlong* src, volatile jlong* dst) { -#ifdef COMPILER2 - // Compiler2 does not support v8, it is used only for v9. _Atomic_move_long_v9(src, dst); -#else - // The branch is cheaper then emulated LDD. - if (VM_Version::v9_instructions_work()) { - _Atomic_move_long_v9(src, dst); - } else { - _Atomic_move_long_v8(src, dst); - } -#endif } inline jlong Atomic::load(volatile jlong* src) { @@ -209,7 +198,6 @@ inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* : "memory"); return rv; #else //_LP64 - assert(VM_Version::v9_instructions_work(), "cas only supported on v9"); volatile jlong_accessor evl, cvl, rv; evl.long_value = exchange_value; cvl.long_value = compare_value; @@ -318,7 +306,6 @@ inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* // Return 64 bit value in %o0 return _Atomic_cas64((intptr_t)exchange_value, (intptr_t *)dest, (intptr_t)compare_value); #else // _LP64 - assert (VM_Version::v9_instructions_work(), "only supported on v9"); // Return 64 bit value in %o0,%o1 by hand return _Atomic_casl(exchange_value, dest, compare_value); #endif // _LP64 diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il index 2821c7077f0..47398351b39 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.il @@ -152,23 +152,6 @@ .nonvolatile .end - // Support for jlong Atomic::load and Atomic::store on v8. - // - // void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst) - // - // Arguments: - // src: O0 - // dest: O1 - // - // Overwrites O2 and O3 - - .inline _Atomic_move_long_v8,2 - .volatile - ldd [%o0], %o2 - std %o2, [%o1] - .nonvolatile - .end - // Support for jlong Atomic::load and Atomic::store on v9. // // void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst) diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 27651dc68d7..3d4a562e432 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -235,6 +235,9 @@ bool InstructForm::is_parm(FormDict &globals) { return false; } +bool InstructForm::is_ideal_negD() const { + return (_matrule && _matrule->_rChild && strcmp(_matrule->_rChild->_opType, "NegD") == 0); +} // Return 'true' if this instruction matches an ideal 'Copy*' node int InstructForm::is_ideal_copy() const { @@ -533,6 +536,12 @@ bool InstructForm::rematerialize(FormDict &globals, RegisterForm *registers ) { if( data_type != Form::none ) rematerialize = true; + // Ugly: until a better fix is implemented, disable rematerialization for + // negD nodes because they are proved to be problematic. + if (is_ideal_negD()) { + return false; + } + // Constants if( _components.count() == 1 && _components[0]->is(Component::USE_DEF) ) rematerialize = true; diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index 622d8902f45..fa3e9ff8f48 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -147,6 +147,7 @@ public: virtual int is_empty_encoding() const; // _size=0 and/or _insencode empty virtual int is_tls_instruction() const; // tlsLoadP rule or ideal ThreadLocal virtual int is_ideal_copy() const; // node matches ideal 'Copy*' + virtual bool is_ideal_negD() const; // node matches ideal 'NegD' virtual bool is_ideal_if() const; // node matches ideal 'If' virtual bool is_ideal_fastlock() const; // node matches 'FastLock' virtual bool is_ideal_membar() const; // node matches ideal 'MemBarXXX' diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 8d7619eedd6..b84c8911e4c 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3461,6 +3461,14 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { preserves_state = true; break; + case vmIntrinsics::_updateCRC32: + case vmIntrinsics::_updateBytesCRC32: + case vmIntrinsics::_updateByteBufferCRC32: + if (!UseCRC32Intrinsics) return false; + cantrap = false; + preserves_state = true; + break; + case vmIntrinsics::_loadFence : case vmIntrinsics::_storeFence: case vmIntrinsics::_fullFence : diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp index e9e73db0c06..13a7f790f6f 100644 --- a/hotspot/src/share/vm/c1/c1_IR.cpp +++ b/hotspot/src/share/vm/c1/c1_IR.cpp @@ -506,7 +506,7 @@ ComputeLinearScanOrder::ComputeLinearScanOrder(Compilation* c, BlockBegin* start _loop_map(0, 0), // initialized later with correct size _compilation(c) { - TRACE_LINEAR_SCAN(2, "***** computing linear-scan block order"); + TRACE_LINEAR_SCAN(2, tty->print_cr("***** computing linear-scan block order")); init_visited(); count_edges(start_block, NULL); @@ -683,7 +683,7 @@ void ComputeLinearScanOrder::clear_non_natural_loops(BlockBegin* start_block) { } void ComputeLinearScanOrder::assign_loop_depth(BlockBegin* start_block) { - TRACE_LINEAR_SCAN(3, "----- computing loop-depth and weight"); + TRACE_LINEAR_SCAN(3, tty->print_cr("----- computing loop-depth and weight")); init_visited(); assert(_work_list.is_empty(), "work list must be empty before processing"); @@ -868,7 +868,7 @@ void ComputeLinearScanOrder::append_block(BlockBegin* cur) { } void ComputeLinearScanOrder::compute_order(BlockBegin* start_block) { - TRACE_LINEAR_SCAN(3, "----- computing final block order"); + TRACE_LINEAR_SCAN(3, tty->print_cr("----- computing final block order")); // the start block is always the first block in the linear scan order _linear_scan_order = new BlockList(_num_blocks); diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index f26d1812c44..cb0ceab90c0 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -201,23 +201,24 @@ void LIR_OprDesc::validate_type() const { #ifdef ASSERT if (!is_pointer() && !is_illegal()) { + OprKind kindfield = kind_field(); // Factored out because of compiler bug, see 8002160 switch (as_BasicType(type_field())) { case T_LONG: - assert((kind_field() == cpu_register || kind_field() == stack_value) && + assert((kindfield == cpu_register || kindfield == stack_value) && size_field() == double_size, "must match"); break; case T_FLOAT: // FP return values can be also in CPU registers on ARM and PPC (softfp ABI) - assert((kind_field() == fpu_register || kind_field() == stack_value - ARM_ONLY(|| kind_field() == cpu_register) - PPC_ONLY(|| kind_field() == cpu_register) ) && + assert((kindfield == fpu_register || kindfield == stack_value + ARM_ONLY(|| kindfield == cpu_register) + PPC_ONLY(|| kindfield == cpu_register) ) && size_field() == single_size, "must match"); break; case T_DOUBLE: // FP return values can be also in CPU registers on ARM and PPC (softfp ABI) - assert((kind_field() == fpu_register || kind_field() == stack_value - ARM_ONLY(|| kind_field() == cpu_register) - PPC_ONLY(|| kind_field() == cpu_register) ) && + assert((kindfield == fpu_register || kindfield == stack_value + ARM_ONLY(|| kindfield == cpu_register) + PPC_ONLY(|| kindfield == cpu_register) ) && size_field() == double_size, "must match"); break; case T_BOOLEAN: @@ -229,7 +230,7 @@ void LIR_OprDesc::validate_type() const { case T_OBJECT: case T_METADATA: case T_ARRAY: - assert((kind_field() == cpu_register || kind_field() == stack_value) && + assert((kindfield == cpu_register || kindfield == stack_value) && size_field() == single_size, "must match"); break; @@ -429,6 +430,11 @@ LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_ _stub = new ArrayCopyStub(this); } +LIR_OpUpdateCRC32::LIR_OpUpdateCRC32(LIR_Opr crc, LIR_Opr val, LIR_Opr res) + : LIR_Op(lir_updatecrc32, res, NULL) + , _crc(crc) + , _val(val) { +} //-------------------verify-------------------------- @@ -875,6 +881,20 @@ void LIR_OpVisitState::visit(LIR_Op* op) { } +// LIR_OpUpdateCRC32 + case lir_updatecrc32: { + assert(op->as_OpUpdateCRC32() != NULL, "must be"); + LIR_OpUpdateCRC32* opUp = (LIR_OpUpdateCRC32*)op; + + assert(opUp->_crc->is_valid(), "used"); do_input(opUp->_crc); do_temp(opUp->_crc); + assert(opUp->_val->is_valid(), "used"); do_input(opUp->_val); do_temp(opUp->_val); + assert(opUp->_result->is_valid(), "used"); do_output(opUp->_result); + assert(opUp->_info == NULL, "no info for LIR_OpUpdateCRC32"); + + break; + } + + // LIR_OpLock case lir_lock: case lir_unlock: { @@ -1055,6 +1075,10 @@ void LIR_OpArrayCopy::emit_code(LIR_Assembler* masm) { masm->emit_code_stub(stub()); } +void LIR_OpUpdateCRC32::emit_code(LIR_Assembler* masm) { + masm->emit_updatecrc32(this); +} + void LIR_Op0::emit_code(LIR_Assembler* masm) { masm->emit_op0(this); } @@ -1762,6 +1786,8 @@ const char * LIR_Op::name() const { case lir_dynamic_call: s = "dynamic"; break; // LIR_OpArrayCopy case lir_arraycopy: s = "arraycopy"; break; + // LIR_OpUpdateCRC32 + case lir_updatecrc32: s = "updatecrc32"; break; // LIR_OpLock case lir_lock: s = "lock"; break; case lir_unlock: s = "unlock"; break; @@ -1814,6 +1840,13 @@ void LIR_OpArrayCopy::print_instr(outputStream* out) const { tmp()->print(out); out->print(" "); } +// LIR_OpUpdateCRC32 +void LIR_OpUpdateCRC32::print_instr(outputStream* out) const { + crc()->print(out); out->print(" "); + val()->print(out); out->print(" "); + result_opr()->print(out); out->print(" "); +} + // LIR_OpCompareAndSwap void LIR_OpCompareAndSwap::print_instr(outputStream* out) const { addr()->print(out); out->print(" "); diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index 61dd59e3fe9..fab85e5750f 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -877,6 +877,7 @@ class LIR_OpCall; class LIR_OpJavaCall; class LIR_OpRTCall; class LIR_OpArrayCopy; +class LIR_OpUpdateCRC32; class LIR_OpLock; class LIR_OpTypeCheck; class LIR_OpCompareAndSwap; @@ -982,6 +983,9 @@ enum LIR_Code { , begin_opArrayCopy , lir_arraycopy , end_opArrayCopy + , begin_opUpdateCRC32 + , lir_updatecrc32 + , end_opUpdateCRC32 , begin_opLock , lir_lock , lir_unlock @@ -1137,6 +1141,7 @@ class LIR_Op: public CompilationResourceObj { virtual LIR_Op2* as_Op2() { return NULL; } virtual LIR_Op3* as_Op3() { return NULL; } virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } + virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } @@ -1293,6 +1298,25 @@ public: void print_instr(outputStream* out) const PRODUCT_RETURN; }; +// LIR_OpUpdateCRC32 +class LIR_OpUpdateCRC32: public LIR_Op { + friend class LIR_OpVisitState; + +private: + LIR_Opr _crc; + LIR_Opr _val; + +public: + + LIR_OpUpdateCRC32(LIR_Opr crc, LIR_Opr val, LIR_Opr res); + + LIR_Opr crc() const { return _crc; } + LIR_Opr val() const { return _val; } + + virtual void emit_code(LIR_Assembler* masm); + virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return this; } + void print_instr(outputStream* out) const PRODUCT_RETURN; +}; // -------------------------------------------------- // LIR_Op0 @@ -2212,6 +2236,8 @@ class LIR_List: public CompilationResourceObj { void arraycopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length, LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info) { append(new LIR_OpArrayCopy(src, src_pos, dst, dst_pos, length, tmp, expected_type, flags, info)); } + void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res) { append(new LIR_OpUpdateCRC32(crc, val, res)); } + void fpop_raw() { append(new LIR_Op0(lir_fpop_raw)); } void instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci); diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index 87dd8dbae15..4ced297c07b 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,6 +195,7 @@ class LIR_Assembler: public CompilationResourceObj { void emit_opBranch(LIR_OpBranch* op); void emit_opLabel(LIR_OpLabel* op); void emit_arraycopy(LIR_OpArrayCopy* op); + void emit_updatecrc32(LIR_OpUpdateCRC32* op); void emit_opConvert(LIR_OpConvert* op); void emit_alloc_obj(LIR_OpAllocObj* op); void emit_alloc_array(LIR_OpAllocArray* op); diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index fcd6910ed95..3af2d23b7d6 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -2994,6 +2994,12 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { do_Reference_get(x); break; + case vmIntrinsics::_updateCRC32: + case vmIntrinsics::_updateBytesCRC32: + case vmIntrinsics::_updateByteBufferCRC32: + do_update_CRC32(x); + break; + default: ShouldNotReachHere(); break; } } diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index d3c76865dbd..0a029207308 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -247,6 +247,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void do_NIOCheckIndex(Intrinsic* x); void do_FPIntrinsics(Intrinsic* x); void do_Reference_get(Intrinsic* x); + void do_update_CRC32(Intrinsic* x); void do_UnsafePrefetch(UnsafePrefetch* x, bool is_store); diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 53d1f5326a8..908571f6cc4 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -299,6 +299,7 @@ const char* Runtime1::name_for_address(address entry) { #ifdef TRACE_HAVE_INTRINSICS FUNCTION_CASE(entry, TRACE_TIME_METHOD); #endif + FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32()); #undef FUNCTION_CASE diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index 8fb6e12b767..cc1be034dd9 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -265,8 +265,6 @@ ciObject* ciObjectFactory::get(oop key) { ciMetadata* ciObjectFactory::get_metadata(Metadata* key) { ASSERT_IN_VM; - assert(key == NULL || key->is_metadata(), "must be"); - #ifdef ASSERT if (CIObjectFactoryVerify) { Metadata* last = NULL; diff --git a/hotspot/src/share/vm/ci/ciUtilities.hpp b/hotspot/src/share/vm/ci/ciUtilities.hpp index 1a075bf6e98..2032a8f35e1 100644 --- a/hotspot/src/share/vm/ci/ciUtilities.hpp +++ b/hotspot/src/share/vm/ci/ciUtilities.hpp @@ -96,7 +96,7 @@ CLEAR_PENDING_EXCEPTION; \ return (result); \ } \ - (0 + (void)(0 #define KILL_COMPILE_ON_ANY \ THREAD); \ @@ -104,7 +104,7 @@ fatal("unhandled ci exception"); \ CLEAR_PENDING_EXCEPTION; \ } \ -(0 +(void)(0 inline const char* bool_to_str(bool b) { diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index b79cda74f0c..26e06c8a079 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -555,7 +555,7 @@ void Dictionary::verify() { loader_data->class_loader() == NULL || loader_data->class_loader()->is_instance(), "checking type of class_loader"); - e->verify(); + e->verify(/*check_dictionary*/false); probe->verify_protection_domain_set(); element_count++; } diff --git a/hotspot/src/share/vm/classfile/genericSignatures.cpp b/hotspot/src/share/vm/classfile/genericSignatures.cpp index 33fbca051b7..3bbce2f8ce7 100644 --- a/hotspot/src/share/vm/classfile/genericSignatures.cpp +++ b/hotspot/src/share/vm/classfile/genericSignatures.cpp @@ -124,7 +124,7 @@ class DescriptorStream : public ResourceObj { fatal(STREAM->parse_error()); \ } \ return NULL; \ - } 0 + } (void)0 #define READ() STREAM->read(); CHECK_FOR_PARSE_ERROR() #define PEEK() STREAM->peek(); CHECK_FOR_PARSE_ERROR() @@ -133,7 +133,7 @@ class DescriptorStream : public ResourceObj { #define EXPECTED(c, ch) STREAM->assert_char(c, ch); CHECK_FOR_PARSE_ERROR() #define EXPECT_END() STREAM->expect_end(); CHECK_FOR_PARSE_ERROR() -#define CHECK_STREAM STREAM); CHECK_FOR_PARSE_ERROR(); (0 +#define CHECK_STREAM STREAM); CHECK_FOR_PARSE_ERROR(); ((void)0 #ifndef PRODUCT void Identifier::print_on(outputStream* str) const { diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index c78ea2d3576..c00e9581759 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -598,6 +598,8 @@ StringTable* StringTable::_the_table = NULL; bool StringTable::_needs_rehashing = false; +volatile int StringTable::_parallel_claimed_idx = 0; + // Pick hashing algorithm unsigned int StringTable::hash_string(const jchar* s, int len) { return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) : @@ -761,8 +763,18 @@ void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f) } } -void StringTable::oops_do(OopClosure* f) { - for (int i = 0; i < the_table()->table_size(); ++i) { +void StringTable::buckets_do(OopClosure* f, int start_idx, int end_idx) { + const int limit = the_table()->table_size(); + + assert(0 <= start_idx && start_idx <= limit, + err_msg("start_idx (" INT32_FORMAT ") oob?", start_idx)); + assert(0 <= end_idx && end_idx <= limit, + err_msg("end_idx (" INT32_FORMAT ") oob?", end_idx)); + assert(start_idx <= end_idx, + err_msg("Ordering: start_idx=" INT32_FORMAT", end_idx=" INT32_FORMAT, + start_idx, end_idx)); + + for (int i = start_idx; i < end_idx; i += 1) { HashtableEntry* entry = the_table()->bucket(i); while (entry != NULL) { assert(!entry->is_shared(), "CDS not used for the StringTable"); @@ -774,6 +786,27 @@ void StringTable::oops_do(OopClosure* f) { } } +void StringTable::oops_do(OopClosure* f) { + buckets_do(f, 0, the_table()->table_size()); +} + +void StringTable::possibly_parallel_oops_do(OopClosure* f) { + const int ClaimChunkSize = 32; + const int limit = the_table()->table_size(); + + for (;;) { + // Grab next set of buckets to scan + int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize; + if (start_idx >= limit) { + // End of table + break; + } + + int end_idx = MIN2(limit, start_idx + ClaimChunkSize); + buckets_do(f, start_idx, end_idx); + } +} + void StringTable::verify() { for (int i = 0; i < the_table()->table_size(); ++i) { HashtableEntry* p = the_table()->bucket(i); diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp index 4701e74b553..7a0031c9ab4 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.hpp +++ b/hotspot/src/share/vm/classfile/symbolTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -246,12 +246,19 @@ private: // Set if one bucket is out of balance due to hash algorithm deficiency static bool _needs_rehashing; + // Claimed high water mark for parallel chunked scanning + static volatile int _parallel_claimed_idx; + static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS); oop basic_add(int index, Handle string_or_null, jchar* name, int len, unsigned int hashValue, TRAPS); oop lookup(int index, jchar* chars, int length, unsigned int hashValue); + // Apply the give oop closure to the entries to the buckets + // in the range [start_idx, end_idx). + static void buckets_do(OopClosure* f, int start_idx, int end_idx); + StringTable() : Hashtable((int)StringTableSize, sizeof (HashtableEntry)) {} @@ -277,9 +284,12 @@ public: unlink_or_oops_do(cl, NULL); } - // Invoke "f->do_oop" on the locations of all oops in the table. + // Serially invoke "f->do_oop" on the locations of all oops in the table. static void oops_do(OopClosure* f); + // Possibly parallel version of the above + static void possibly_parallel_oops_do(OopClosure* f); + // Hashing algorithm, used as the hash value used by the // StringTable for bucket selection and comparison (stored in the // HashtableEntry structures). This is used in the String.intern() method. @@ -315,5 +325,8 @@ public: // Rehash the symbol table if it gets out of balance static void rehash_table(); static bool needs_rehashing() { return _needs_rehashing; } + + // Parallel chunked scanning + static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; } }; #endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index 34a1e0b3aff..9da0ac34a84 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -86,9 +86,9 @@ class StackMapTable; // These macros are used similarly to CHECK macros but also check // the status of the verifier and return if that has an error. #define CHECK_VERIFY(verifier) \ - CHECK); if ((verifier)->has_error()) return; (0 + CHECK); if ((verifier)->has_error()) return; ((void)0 #define CHECK_VERIFY_(verifier, result) \ - CHECK_(result)); if ((verifier)->has_error()) return (result); (0 + CHECK_(result)); if ((verifier)->has_error()) return (result); ((void)0 class TypeOrigin VALUE_OBJ_CLASS_SPEC { private: diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 49def1e8d26..7ec43bd7e86 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -771,6 +771,17 @@ do_name( decrypt_name, "decrypt") \ do_signature(byteArray_int_int_byteArray_int_signature, "([BII[BI)V") \ \ + /* support for java.util.zip */ \ + do_class(java_util_zip_CRC32, "java/util/zip/CRC32") \ + do_intrinsic(_updateCRC32, java_util_zip_CRC32, update_name, int2_int_signature, F_SN) \ + do_name( update_name, "update") \ + do_intrinsic(_updateBytesCRC32, java_util_zip_CRC32, updateBytes_name, updateBytes_signature, F_SN) \ + do_name( updateBytes_name, "updateBytes") \ + do_signature(updateBytes_signature, "(I[BII)I") \ + do_intrinsic(_updateByteBufferCRC32, java_util_zip_CRC32, updateByteBuffer_name, updateByteBuffer_signature, F_SN) \ + do_name( updateByteBuffer_name, "updateByteBuffer") \ + do_signature(updateByteBuffer_signature, "(IJII)I") \ + \ /* support for sun.misc.Unsafe */ \ do_class(sun_misc_Unsafe, "sun/misc/Unsafe") \ \ diff --git a/hotspot/src/share/vm/code/debugInfo.hpp b/hotspot/src/share/vm/code/debugInfo.hpp index 3f65652d89c..7a4f7e2d41d 100644 --- a/hotspot/src/share/vm/code/debugInfo.hpp +++ b/hotspot/src/share/vm/code/debugInfo.hpp @@ -274,7 +274,7 @@ class DebugInfoReadStream : public CompressedReadStream { Method* read_method() { Method* o = (Method*)(code()->metadata_at(read_int())); assert(o == NULL || - o->is_metadata(), "meta data only"); + o->is_metaspace_object(), "meta data only"); return o; } ScopeValue* read_object_value(); diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index b790c3597d4..df269430ed2 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -655,8 +655,8 @@ inline Metadata* Dependencies::DepStream::recorded_metadata_at(int i) { } else { o = _deps->oop_recorder()->metadata_at(i); } - assert(o == NULL || o->is_metadata(), - err_msg("Should be perm " PTR_FORMAT, o)); + assert(o == NULL || o->is_metaspace_object(), + err_msg("Should be metadata " PTR_FORMAT, o)); return o; } @@ -989,7 +989,7 @@ Klass* ClassHierarchyWalker::find_witness_in(KlassDepChange& changes, assert(changes.involves_context(context_type), "irrelevant dependency"); Klass* new_type = changes.new_type(); - count_find_witness_calls(); + (void)count_find_witness_calls(); NOT_PRODUCT(deps_find_witness_singles++); // Current thread must be in VM (not native mode, as in CI): diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 53f8cd07be8..1dfc3ba8f07 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1081,11 +1081,6 @@ void nmethod::fix_oop_relocations(address begin, address end, bool initialize_im metadata_Relocation* reloc = iter.metadata_reloc(); reloc->fix_metadata_relocation(); } - - // There must not be any interfering patches or breakpoints. - assert(!(iter.type() == relocInfo::breakpoint_type - && iter.breakpoint_reloc()->active()), - "no active breakpoint"); } } @@ -2615,7 +2610,8 @@ void nmethod::print_relocations() { relocation_begin()-1+ip[1]); for (; ip < index_end; ip++) tty->print_cr(" (%d ?)", ip[0]); - tty->print_cr(" @" INTPTR_FORMAT ": index_size=%d", ip, *ip++); + tty->print_cr(" @" INTPTR_FORMAT ": index_size=%d", ip, *ip); + ip++; tty->print_cr("reloc_end @" INTPTR_FORMAT ":", ip); } } diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp index 679bc290ade..4fe6a2e4949 100644 --- a/hotspot/src/share/vm/code/relocInfo.cpp +++ b/hotspot/src/share/vm/code/relocInfo.cpp @@ -338,31 +338,6 @@ void RelocIterator::set_limit(address limit) { _limit = limit; } - -void PatchingRelocIterator:: prepass() { - // turn breakpoints off during patching - _init_state = (*this); // save cursor - while (next()) { - if (type() == relocInfo::breakpoint_type) { - breakpoint_reloc()->set_active(false); - } - } - (RelocIterator&)(*this) = _init_state; // reset cursor for client -} - - -void PatchingRelocIterator:: postpass() { - // turn breakpoints back on after patching - (RelocIterator&)(*this) = _init_state; // reset cursor again - while (next()) { - if (type() == relocInfo::breakpoint_type) { - breakpoint_Relocation* bpt = breakpoint_reloc(); - bpt->set_active(bpt->enabled()); - } - } -} - - // All the strange bit-encodings are in here. // The idea is to encode relocation data which are small integers // very efficiently (a single extra halfword). Larger chunks of @@ -704,51 +679,6 @@ void section_word_Relocation::unpack_data() { _target = address_from_scaled_offset(offset, base); } - -void breakpoint_Relocation::pack_data_to(CodeSection* dest) { - short* p = (short*) dest->locs_end(); - address point = dest->locs_point(); - - *p++ = _bits; - - assert(_target != NULL, "sanity"); - - if (internal()) normalize_address(_target, dest); - - jint target_bits = - (jint)( internal() ? scaled_offset (_target, point) - : runtime_address_to_index(_target) ); - if (settable()) { - // save space for set_target later - p = add_jint(p, target_bits); - } else { - p = add_var_int(p, target_bits); - } - - for (int i = 0; i < instrlen(); i++) { - // put placeholder words until bytes can be saved - p = add_short(p, (short)0x7777); - } - - dest->set_locs_end((relocInfo*) p); -} - - -void breakpoint_Relocation::unpack_data() { - _bits = live_bits(); - - int targetlen = datalen() - 1 - instrlen(); - jint target_bits = 0; - if (targetlen == 0) target_bits = 0; - else if (targetlen == 1) target_bits = *(data()+1); - else if (targetlen == 2) target_bits = relocInfo::jint_from_data(data()+1); - else { ShouldNotReachHere(); } - - _target = internal() ? address_from_scaled_offset(target_bits, addr()) - : index_to_runtime_address (target_bits); -} - - //// miscellaneous methods oop* oop_Relocation::oop_addr() { int n = _oop_index; @@ -933,81 +863,6 @@ address internal_word_Relocation::target() { return target; } - -breakpoint_Relocation::breakpoint_Relocation(int kind, address target, bool internal) { - bool active = false; - bool enabled = (kind == initialization); - bool removable = (kind != safepoint); - bool settable = (target == NULL); - - int bits = kind; - if (enabled) bits |= enabled_state; - if (internal) bits |= internal_attr; - if (removable) bits |= removable_attr; - if (settable) bits |= settable_attr; - - _bits = bits | high_bit; - _target = target; - - assert(this->kind() == kind, "kind encoded"); - assert(this->enabled() == enabled, "enabled encoded"); - assert(this->active() == active, "active encoded"); - assert(this->internal() == internal, "internal encoded"); - assert(this->removable() == removable, "removable encoded"); - assert(this->settable() == settable, "settable encoded"); -} - - -address breakpoint_Relocation::target() const { - return _target; -} - - -void breakpoint_Relocation::set_target(address x) { - assert(settable(), "must be settable"); - jint target_bits = - (jint)(internal() ? scaled_offset (x, addr()) - : runtime_address_to_index(x)); - short* p = &live_bits() + 1; - p = add_jint(p, target_bits); - assert(p == instrs(), "new target must fit"); - _target = x; -} - - -void breakpoint_Relocation::set_enabled(bool b) { - if (enabled() == b) return; - - if (b) { - set_bits(bits() | enabled_state); - } else { - set_active(false); // remove the actual breakpoint insn, if any - set_bits(bits() & ~enabled_state); - } -} - - -void breakpoint_Relocation::set_active(bool b) { - assert(!b || enabled(), "cannot activate a disabled breakpoint"); - - if (active() == b) return; - - // %%% should probably seize a lock here (might not be the right lock) - //MutexLockerEx ml_patch(Patching_lock, true); - //if (active() == b) return; // recheck state after locking - - if (b) { - set_bits(bits() | active_state); - if (instrlen() == 0) - fatal("breakpoints in original code must be undoable"); - pd_swap_in_breakpoint (addr(), instrs(), instrlen()); - } else { - set_bits(bits() & ~active_state); - pd_swap_out_breakpoint(addr(), instrs(), instrlen()); - } -} - - //--------------------------------------------------------------------------------- // Non-product code diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp index 5585b5df79d..68a7f3a5889 100644 --- a/hotspot/src/share/vm/code/relocInfo.hpp +++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -49,9 +49,6 @@ class NativeMovConstReg; // RelocIterator // A StackObj which iterates over the relocations associated with // a range of code addresses. Can be used to operate a copy of code. -// PatchingRelocIterator -// Specialized subtype of RelocIterator which removes breakpoints -// temporarily during iteration, then restores them. // BoundRelocation // An _internal_ type shared by packers and unpackers of relocations. // It pastes together a RelocationHolder with some pointers into @@ -204,15 +201,6 @@ class NativeMovConstReg; // immediate field must not straddle a unit of memory coherence. // //%note reloc_3 // -// relocInfo::breakpoint_type -- a conditional breakpoint in the code -// Value: none -// Instruction types: any whatsoever -// Data: [b [T]t i...] -// The b is a bit-packed word representing the breakpoint's attributes. -// The t is a target address which the breakpoint calls (when it is enabled). -// The i... is a place to store one or two instruction words overwritten -// by a trap, so that the breakpoint may be subsequently removed. -// // relocInfo::static_stub_type -- an extra stub for each static_call_type // Value: none // Instruction types: a virtual call: { set_oop; jump; } @@ -271,8 +259,8 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { section_word_type = 9, // internal, but a cross-section reference poll_type = 10, // polling instruction for safepoints poll_return_type = 11, // polling instruction for safepoints at return - breakpoint_type = 12, // an initialization barrier or safepoint - metadata_type = 13, // metadata that used to be oops + metadata_type = 12, // metadata that used to be oops + yet_unused_type_1 = 13, // Still unused yet_unused_type_2 = 14, // Still unused data_prefix_tag = 15, // tag for a prefix (carries data arguments) type_mask = 15 // A mask which selects only the above values @@ -312,7 +300,6 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { visitor(internal_word) \ visitor(poll) \ visitor(poll_return) \ - visitor(breakpoint) \ visitor(section_word) \ @@ -454,7 +441,7 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { public: enum { // Conservatively large estimate of maximum length (in shorts) - // of any relocation record (probably breakpoints are largest). + // of any relocation record. // Extended format is length prefix, data words, and tag/offset suffix. length_limit = 1 + 1 + (3*BytesPerWord/BytesPerShort) + 1, have_format = format_width > 0 @@ -571,8 +558,6 @@ class RelocIterator : public StackObj { void initialize(nmethod* nm, address begin, address limit); - friend class PatchingRelocIterator; - // make an uninitialized one, for PatchingRelocIterator: RelocIterator() { initialize_misc(); } public: @@ -779,9 +764,6 @@ class Relocation VALUE_OBJ_CLASS_SPEC { void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); } address pd_call_destination (address orig_addr = NULL); void pd_set_call_destination (address x); - void pd_swap_in_breakpoint (address x, short* instrs, int instrlen); - void pd_swap_out_breakpoint (address x, short* instrs, int instrlen); - static int pd_breakpoint_size (); // this extracts the address of an address in the code stream instead of the reloc data address* pd_address_in_code (); @@ -1302,87 +1284,6 @@ class poll_return_Relocation : public Relocation { void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); }; - -class breakpoint_Relocation : public Relocation { - relocInfo::relocType type() { return relocInfo::breakpoint_type; } - - enum { - // attributes which affect the interpretation of the data: - removable_attr = 0x0010, // buffer [i...] allows for undoing the trap - internal_attr = 0x0020, // the target is an internal addr (local stub) - settable_attr = 0x0040, // the target is settable - - // states which can change over time: - enabled_state = 0x0100, // breakpoint must be active in running code - active_state = 0x0200, // breakpoint instruction actually in code - - kind_mask = 0x000F, // mask for extracting kind - high_bit = 0x4000 // extra bit which is always set - }; - - public: - enum { - // kinds: - initialization = 1, - safepoint = 2 - }; - - // If target is NULL, 32 bits are reserved for a later set_target(). - static RelocationHolder spec(int kind, address target = NULL, bool internal_target = false) { - RelocationHolder rh = newHolder(); - new(rh) breakpoint_Relocation(kind, target, internal_target); - return rh; - } - - private: - // We require every bits value to NOT to fit into relocInfo::datalen_width, - // because we are going to actually store state in the reloc, and so - // cannot allow it to be compressed (and hence copied by the iterator). - - short _bits; // bit-encoded kind, attrs, & state - address _target; - - breakpoint_Relocation(int kind, address target, bool internal_target); - - friend class RelocIterator; - breakpoint_Relocation() { } - - short bits() const { return _bits; } - short& live_bits() const { return data()[0]; } - short* instrs() const { return data() + datalen() - instrlen(); } - int instrlen() const { return removable() ? pd_breakpoint_size() : 0; } - - void set_bits(short x) { - assert(live_bits() == _bits, "must be the only mutator of reloc info"); - live_bits() = _bits = x; - } - - public: - address target() const; - void set_target(address x); - - int kind() const { return bits() & kind_mask; } - bool enabled() const { return (bits() & enabled_state) != 0; } - bool active() const { return (bits() & active_state) != 0; } - bool internal() const { return (bits() & internal_attr) != 0; } - bool removable() const { return (bits() & removable_attr) != 0; } - bool settable() const { return (bits() & settable_attr) != 0; } - - void set_enabled(bool b); // to activate, you must also say set_active - void set_active(bool b); // actually inserts bpt (must be enabled 1st) - - // data is packed as 16 bits, followed by the target (1 or 2 words), followed - // if necessary by empty storage for saving away original instruction bytes. - void pack_data_to(CodeSection* dest); - void unpack_data(); - - // during certain operations, breakpoints must be out of the way: - void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { - assert(!active(), "cannot perform relocation on enabled breakpoints"); - } -}; - - // We know all the xxx_Relocation classes, so now we can define these: #define EACH_CASE(name) \ inline name##_Relocation* RelocIterator::name##_reloc() { \ @@ -1401,25 +1302,4 @@ inline RelocIterator::RelocIterator(nmethod* nm, address begin, address limit) { initialize(nm, begin, limit); } -// if you are going to patch code, you should use this subclass of -// RelocIterator -class PatchingRelocIterator : public RelocIterator { - private: - RelocIterator _init_state; - - void prepass(); // deactivates all breakpoints - void postpass(); // reactivates all enabled breakpoints - - // do not copy these puppies; it would have unpredictable side effects - // these are private and have no bodies defined because they should not be called - PatchingRelocIterator(const RelocIterator&); - void operator=(const RelocIterator&); - - public: - PatchingRelocIterator(nmethod* nm, address begin = NULL, address limit = NULL) - : RelocIterator(nm, begin, limit) { prepass(); } - - ~PatchingRelocIterator() { postpass(); } -}; - #endif // SHARE_VM_CODE_RELOCINFO_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp index 00ea5b54850..f75e518facc 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.cpp @@ -152,12 +152,9 @@ uint G1CardCounts::add_card_count(jbyte* card_ptr) { if (card_num < _committed_max_card_num) { count = (uint) _card_counts[card_num]; if (count < G1ConcRSHotCardLimit) { - _card_counts[card_num] += 1; + _card_counts[card_num] = + (jubyte)(MIN2((uintx)(_card_counts[card_num] + 1), G1ConcRSHotCardLimit)); } - assert(_card_counts[card_num] <= G1ConcRSHotCardLimit, - err_msg("Refinement count overflow? " - "new count: "UINT32_FORMAT, - (uint) _card_counts[card_num])); } } return count; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index 9cee1eb1ba2..218be0c0e40 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -47,7 +47,7 @@ void G1SATBCardTableModRefBS::enqueue(oop pre_val) { JavaThread* jt = (JavaThread*)thr; jt->satb_mark_queue().enqueue(pre_val); } else { - MutexLocker x(Shared_SATB_Q_lock); + MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag); JavaThread::satb_mark_queue_set().shared_satb_queue()->enqueue(pre_val); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index 7ef24358e15..22c84ec81ee 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -798,7 +798,7 @@ void HeapRegion::verify(VerifyOption vo, if (!g1->is_obj_dead_cond(obj, this, vo)) { if (obj->is_oop()) { Klass* klass = obj->klass(); - if (!klass->is_metadata()) { + if (!klass->is_metaspace_object()) { gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " "not metadata", klass, obj); *failures = true; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp index 0c12e98bea4..39f5835ffe5 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp @@ -70,6 +70,17 @@ ASPSOldGen::ASPSOldGen(PSVirtualSpace* vs, _virtual_space = vs; } +void ASPSOldGen::initialize_work(const char* perf_data_name, int level) { + + PSOldGen::initialize_work(perf_data_name, level); + + // The old gen can grow to gen_size_limit(). _reserve reflects only + // the current maximum that can be committed. + assert(_reserved.byte_size() <= gen_size_limit(), "Consistency check"); + + initialize_performance_counters(perf_data_name, level); +} + void ASPSOldGen::reset_after_change() { _reserved = MemRegion((HeapWord*)virtual_space()->low_boundary(), (HeapWord*)virtual_space()->high_boundary()); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp index 3de4f9793a6..eaa1f2b5509 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.hpp @@ -50,6 +50,8 @@ class ASPSOldGen : public PSOldGen { size_t max_gen_size() { return _reserved.byte_size(); } void set_gen_size_limit(size_t v) { _gen_size_limit = v; } + virtual void initialize_work(const char* perf_data_name, int level); + // After a shrink or expand reset the generation void reset_after_change(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp index b2134f10e92..82ea39b525a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -565,11 +565,9 @@ bool CardTableExtension::resize_commit_uncommit(int changed_region, if(new_start_aligned < new_end_for_commit) { MemRegion new_committed = MemRegion(new_start_aligned, new_end_for_commit); - if (!os::commit_memory((char*)new_committed.start(), - new_committed.byte_size())) { - vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR, - "card table expansion"); - } + os::commit_memory_or_exit((char*)new_committed.start(), + new_committed.byte_size(), !ExecMem, + "card table expansion"); } result = true; } else if (new_start_aligned > cur_committed.start()) { diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp index 7727017959d..7fba4f35813 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp @@ -1250,14 +1250,13 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold( avg_promoted()->deviation()); } - gclog_or_tty->print( " avg_promoted_padded_avg: %f" + gclog_or_tty->print_cr( " avg_promoted_padded_avg: %f" " avg_pretenured_padded_avg: %f" " tenuring_thresh: %d" " target_size: " SIZE_FORMAT, avg_promoted()->padded_average(), _avg_pretenured->padded_average(), tenuring_threshold, target_size); - tty->cr(); } set_survivor_size(target_size); @@ -1279,7 +1278,7 @@ void PSAdaptiveSizePolicy::update_averages(bool is_survivor_overflow, avg_promoted()->sample(promoted + _avg_pretenured->padded_average()); if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print( + gclog_or_tty->print_cr( "AdaptiveSizePolicy::update_averages:" " survived: " SIZE_FORMAT " promoted: " SIZE_FORMAT diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp index ed784f30d52..cf8f574ddfd 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp @@ -110,7 +110,7 @@ class PSOldGen : public CHeapObj { virtual void initialize(ReservedSpace rs, size_t alignment, const char* perf_data_name, int level); void initialize_virtual_space(ReservedSpace rs, size_t alignment); - void initialize_work(const char* perf_data_name, int level); + virtual void initialize_work(const char* perf_data_name, int level); virtual void initialize_performance_counters(const char* perf_data_name, int level); MemRegion reserved() const { return _reserved; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp index e194767073d..9999527302a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,7 +101,8 @@ bool PSVirtualSpace::expand_by(size_t bytes) { } char* const base_addr = committed_high_addr(); - bool result = special() || os::commit_memory(base_addr, bytes, alignment()); + bool result = special() || + os::commit_memory(base_addr, bytes, alignment(), !ExecMem); if (result) { _committed_high_addr += bytes; } @@ -154,7 +155,7 @@ PSVirtualSpace::expand_into(PSVirtualSpace* other_space, size_t bytes) { if (tmp_bytes > 0) { char* const commit_base = committed_high_addr(); if (other_space->special() || - os::commit_memory(commit_base, tmp_bytes, alignment())) { + os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) { // Reduce the reserved region in the other space. other_space->set_reserved(other_space->reserved_low_addr() + tmp_bytes, other_space->reserved_high_addr(), @@ -269,7 +270,8 @@ bool PSVirtualSpaceHighToLow::expand_by(size_t bytes) { } char* const base_addr = committed_low_addr() - bytes; - bool result = special() || os::commit_memory(base_addr, bytes, alignment()); + bool result = special() || + os::commit_memory(base_addr, bytes, alignment(), !ExecMem); if (result) { _committed_low_addr -= bytes; } @@ -322,7 +324,7 @@ size_t PSVirtualSpaceHighToLow::expand_into(PSVirtualSpace* other_space, if (tmp_bytes > 0) { char* const commit_base = committed_low_addr() - tmp_bytes; if (other_space->special() || - os::commit_memory(commit_base, tmp_bytes, alignment())) { + os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) { // Reduce the reserved region in the other space. other_space->set_reserved(other_space->reserved_low_addr(), other_space->reserved_high_addr() - tmp_bytes, diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 264d4fffbf6..77471ad3d5f 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,6 +102,9 @@ class AbstractInterpreter: AllStatic { java_lang_math_pow, // implementation of java.lang.Math.pow (x,y) java_lang_math_exp, // implementation of java.lang.Math.exp (x) java_lang_ref_reference_get, // implementation of java.lang.ref.Reference.get() + java_util_zip_CRC32_update, // implementation of java.util.zip.CRC32.update() + java_util_zip_CRC32_updateBytes, // implementation of java.util.zip.CRC32.updateBytes() + java_util_zip_CRC32_updateByteBuffer, // implementation of java.util.zip.CRC32.updateByteBuffer() number_of_method_entries, invalid = -1 }; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 8f0ec849cca..538b836f08a 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -481,9 +481,9 @@ BytecodeInterpreter::run(interpreterState istate) { // So we have a second version of the assertion which handles the case where EnableInvokeDynamic was // switched off because of the wrong classes. if (EnableInvokeDynamic || FLAG_IS_CMDLINE(EnableInvokeDynamic)) { - assert(abs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); + assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); } else { - const int extra_stack_entries = Method::extra_stack_entries_for_indy; + const int extra_stack_entries = Method::extra_stack_entries_for_jsr292; assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + extra_stack_entries + 1), "bad stack limit"); } @@ -1581,7 +1581,7 @@ run: #define ARRAY_LOADTO32(T, T2, format, stackRes, extra) \ { \ ARRAY_INTRO(-2); \ - extra; \ + (void)extra; \ SET_ ## stackRes(*(T2 *)(((address) arrObj->base(T)) + index * sizeof(T2)), \ -2); \ UPDATE_PC_AND_TOS_AND_CONTINUE(1, -1); \ @@ -1592,8 +1592,8 @@ run: { \ ARRAY_INTRO(-2); \ SET_ ## stackRes(*(T2 *)(((address) arrObj->base(T)) + index * sizeof(T2)), -1); \ - extra; \ - UPDATE_PC_AND_CONTINUE(1); \ + (void)extra; \ + UPDATE_PC_AND_CONTINUE(1); \ } CASE(_iaload): @@ -1617,7 +1617,7 @@ run: #define ARRAY_STOREFROM32(T, T2, format, stackSrc, extra) \ { \ ARRAY_INTRO(-3); \ - extra; \ + (void)extra; \ *(T2 *)(((address) arrObj->base(T)) + index * sizeof(T2)) = stackSrc( -1); \ UPDATE_PC_AND_TOS_AND_CONTINUE(1, -3); \ } @@ -1626,7 +1626,7 @@ run: #define ARRAY_STOREFROM64(T, T2, stackSrc, extra) \ { \ ARRAY_INTRO(-4); \ - extra; \ + (void)extra; \ *(T2 *)(((address) arrObj->base(T)) + index * sizeof(T2)) = stackSrc( -1); \ UPDATE_PC_AND_TOS_AND_CONTINUE(1, -4); \ } @@ -2233,7 +2233,7 @@ run: } Method* method = cache->f1_as_method(); - VERIFY_OOP(method); + if (VerifyOops) method->verify(); if (cache->has_appendix()) { ConstantPool* constants = METHOD->constants(); @@ -2265,8 +2265,7 @@ run: } Method* method = cache->f1_as_method(); - - VERIFY_OOP(method); + if (VerifyOops) method->verify(); if (cache->has_appendix()) { ConstantPool* constants = METHOD->constants(); diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 06554172bf1..dfd8b5b145a 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,6 +195,17 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) return kind; } +#ifndef CC_INTERP + if (UseCRC32Intrinsics && m->is_native()) { + // Use optimized stub code for CRC32 native methods. + switch (m->intrinsic_id()) { + case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; + case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; + case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; + } + } +#endif + // Native method? // Note: This test must come _before_ the test for intrinsic // methods. See also comments below. @@ -297,6 +308,9 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; case java_lang_math_log : tty->print("java_lang_math_log" ); break; case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; + case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; + case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; + case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; default: if (kind >= method_handle_invoke_FIRST && kind <= method_handle_invoke_LAST) { diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 53e50b1c7fe..9f7ed4c7e97 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -373,6 +373,12 @@ void TemplateInterpreterGenerator::generate_all() { method_entry(java_lang_math_pow ) method_entry(java_lang_ref_reference_get) + if (UseCRC32Intrinsics) { + method_entry(java_util_zip_CRC32_update) + method_entry(java_util_zip_CRC32_updateBytes) + method_entry(java_util_zip_CRC32_updateByteBuffer) + } + initialize_method_handle_entries(); // all native method kinds (must be one contiguous block) diff --git a/hotspot/src/share/vm/memory/allocation.cpp b/hotspot/src/share/vm/memory/allocation.cpp index c4393a65e22..c45dab1c4c5 100644 --- a/hotspot/src/share/vm/memory/allocation.cpp +++ b/hotspot/src/share/vm/memory/allocation.cpp @@ -71,13 +71,6 @@ bool MetaspaceObj::is_shared() const { return MetaspaceShared::is_in_shared_space(this); } -bool MetaspaceObj::is_metadata() const { - // GC Verify checks use this in guarantees. - // TODO: either replace them with is_metaspace_object() or remove them. - // is_metaspace_object() is slower than this test. This test doesn't - // seem very useful for metaspace objects anymore though. - return !Universe::heap()->is_in_reserved(this); -} bool MetaspaceObj::is_metaspace_object() const { return Metaspace::contains((void*)this); diff --git a/hotspot/src/share/vm/memory/allocation.hpp b/hotspot/src/share/vm/memory/allocation.hpp index bd38a94d451..17654f06984 100644 --- a/hotspot/src/share/vm/memory/allocation.hpp +++ b/hotspot/src/share/vm/memory/allocation.hpp @@ -264,7 +264,6 @@ class ClassLoaderData; class MetaspaceObj { public: - bool is_metadata() const; bool is_metaspace_object() const; // more specific test but slower bool is_shared() const; void print_address_on(outputStream* st) const; // nonvirtual address printing @@ -643,8 +642,15 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC { #define NEW_RESOURCE_ARRAY_IN_THREAD(thread, type, size)\ (type*) resource_allocate_bytes(thread, (size) * sizeof(type)) +#define NEW_RESOURCE_ARRAY_IN_THREAD_RETURN_NULL(thread, type, size)\ + (type*) resource_allocate_bytes(thread, (size) * sizeof(type), AllocFailStrategy::RETURN_NULL) + #define REALLOC_RESOURCE_ARRAY(type, old, old_size, new_size)\ - (type*) resource_reallocate_bytes((char*)(old), (old_size) * sizeof(type), (new_size) * sizeof(type) ) + (type*) resource_reallocate_bytes((char*)(old), (old_size) * sizeof(type), (new_size) * sizeof(type)) + +#define REALLOC_RESOURCE_ARRAY_RETURN_NULL(type, old, old_size, new_size)\ + (type*) resource_reallocate_bytes((char*)(old), (old_size) * sizeof(type),\ + (new_size) * sizeof(type), AllocFailStrategy::RETURN_NULL) #define FREE_RESOURCE_ARRAY(type, old, size)\ resource_free_bytes((char*)(old), (size) * sizeof(type)) @@ -655,28 +661,40 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC { #define NEW_RESOURCE_OBJ(type)\ NEW_RESOURCE_ARRAY(type, 1) -#define NEW_C_HEAP_ARRAY(type, size, memflags)\ - (type*) (AllocateHeap((size) * sizeof(type), memflags)) +#define NEW_RESOURCE_OBJ_RETURN_NULL(type)\ + NEW_RESOURCE_ARRAY_RETURN_NULL(type, 1) -#define REALLOC_C_HEAP_ARRAY(type, old, size, memflags)\ - (type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags)) - -#define FREE_C_HEAP_ARRAY(type, old, memflags) \ - FreeHeap((char*)(old), memflags) +#define NEW_C_HEAP_ARRAY3(type, size, memflags, pc, allocfail)\ + (type*) AllocateHeap(size * sizeof(type), memflags, pc, allocfail) #define NEW_C_HEAP_ARRAY2(type, size, memflags, pc)\ (type*) (AllocateHeap((size) * sizeof(type), memflags, pc)) -#define REALLOC_C_HEAP_ARRAY2(type, old, size, memflags, pc)\ - (type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags, pc)) +#define NEW_C_HEAP_ARRAY(type, size, memflags)\ + (type*) (AllocateHeap((size) * sizeof(type), memflags)) -#define NEW_C_HEAP_ARRAY3(type, size, memflags, pc, allocfail) \ - (type*) AllocateHeap(size * sizeof(type), memflags, pc, allocfail) +#define NEW_C_HEAP_ARRAY2_RETURN_NULL(type, size, memflags, pc)\ + NEW_C_HEAP_ARRAY3(type, size, memflags, pc, AllocFailStrategy::RETURN_NULL) + +#define NEW_C_HEAP_ARRAY_RETURN_NULL(type, size, memflags)\ + NEW_C_HEAP_ARRAY3(type, size, memflags, (address)0, AllocFailStrategy::RETURN_NULL) + +#define REALLOC_C_HEAP_ARRAY(type, old, size, memflags)\ + (type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags)) + +#define REALLOC_C_HEAP_ARRAY_RETURN_NULL(type, old, size, memflags)\ + (type*) (ReallocateHeap((char*)old, (size) * sizeof(type), memflags, AllocFailStrategy::RETURN_NULL)) + +#define FREE_C_HEAP_ARRAY(type, old, memflags) \ + FreeHeap((char*)(old), memflags) // allocate type in heap without calling ctor #define NEW_C_HEAP_OBJ(type, memflags)\ NEW_C_HEAP_ARRAY(type, 1, memflags) +#define NEW_C_HEAP_OBJ_RETURN_NULL(type, memflags)\ + NEW_C_HEAP_ARRAY_RETURN_NULL(type, 1, memflags) + // deallocate obj of type in heap without calling dtor #define FREE_C_HEAP_OBJ(objname, memflags)\ FreeHeap((char*)objname, memflags); @@ -721,13 +739,21 @@ public: // is set so that we always use malloc except for Solaris where we set the // limit to get mapped memory. template -class ArrayAllocator : StackObj { +class ArrayAllocator VALUE_OBJ_CLASS_SPEC { char* _addr; bool _use_malloc; size_t _size; + bool _free_in_destructor; public: - ArrayAllocator() : _addr(NULL), _use_malloc(false), _size(0) { } - ~ArrayAllocator() { free(); } + ArrayAllocator(bool free_in_destructor = true) : + _addr(NULL), _use_malloc(false), _size(0), _free_in_destructor(free_in_destructor) { } + + ~ArrayAllocator() { + if (_free_in_destructor) { + free(); + } + } + E* allocate(size_t length); void free(); }; diff --git a/hotspot/src/share/vm/memory/allocation.inline.hpp b/hotspot/src/share/vm/memory/allocation.inline.hpp index 138dd660a9c..f59ae5b4f0e 100644 --- a/hotspot/src/share/vm/memory/allocation.inline.hpp +++ b/hotspot/src/share/vm/memory/allocation.inline.hpp @@ -146,10 +146,7 @@ E* ArrayAllocator::allocate(size_t length) { vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (reserve)"); } - bool success = os::commit_memory(_addr, _size, false /* executable */); - if (!success) { - vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (commit)"); - } + os::commit_memory_or_exit(_addr, _size, !ExecMem, "Allocator (commit)"); return (E*)_addr; } diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index 7cc68debfe5..82336503eb4 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -110,11 +110,8 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, jbyte* guard_card = &_byte_map[_guard_index]; uintptr_t guard_page = align_size_down((uintptr_t)guard_card, _page_size); _guard_region = MemRegion((HeapWord*)guard_page, _page_size); - if (!os::commit_memory((char*)guard_page, _page_size, _page_size)) { - // Do better than this for Merlin - vm_exit_out_of_memory(_page_size, OOM_MMAP_ERROR, "card table last card"); - } - + os::commit_memory_or_exit((char*)guard_page, _page_size, _page_size, + !ExecMem, "card table last card"); *guard_card = last_card; _lowest_non_clean = @@ -312,12 +309,9 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { MemRegion(cur_committed.end(), new_end_for_commit); assert(!new_committed.is_empty(), "Region should not be empty here"); - if (!os::commit_memory((char*)new_committed.start(), - new_committed.byte_size(), _page_size)) { - // Do better than this for Merlin - vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR, - "card table expansion"); - } + os::commit_memory_or_exit((char*)new_committed.start(), + new_committed.byte_size(), _page_size, + !ExecMem, "card table expansion"); // Use new_end_aligned (as opposed to new_end_for_commit) because // the cur_committed region may include the guard region. } else if (new_end_aligned < cur_committed.end()) { @@ -418,7 +412,7 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { } // Touch the last card of the covered region to show that it // is committed (or SEGV). - debug_only(*byte_for(_covered[ind].last());) + debug_only((void) (*byte_for(_covered[ind].last()));) debug_only(verify_guard();) } diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index dbc0c87edce..5dfaf6f9701 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -549,3 +549,13 @@ bool FileMapInfo::is_in_shared_space(const void* p) { return false; } + +void FileMapInfo::print_shared_spaces() { + gclog_or_tty->print_cr("Shared Spaces:"); + for (int i = 0; i < MetaspaceShared::n_regions; i++) { + struct FileMapInfo::FileMapHeader::space_info* si = &_header._space[i]; + gclog_or_tty->print(" %s " INTPTR_FORMAT "-" INTPTR_FORMAT, + shared_region_name[i], + si->_base, si->_base + si->_used); + } +} diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp index a11914b9c01..ee4ccec5bfe 100644 --- a/hotspot/src/share/vm/memory/filemap.hpp +++ b/hotspot/src/share/vm/memory/filemap.hpp @@ -149,6 +149,7 @@ public: // Return true if given address is in the mapped shared space. bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); + void print_shared_spaces() NOT_CDS_RETURN; }; #endif // SHARE_VM_MEMORY_FILEMAP_HPP diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp index 2afecb68092..bf65c882cd6 100644 --- a/hotspot/src/share/vm/memory/heapInspection.cpp +++ b/hotspot/src/share/vm/memory/heapInspection.cpp @@ -157,7 +157,6 @@ KlassInfoTable::~KlassInfoTable() { } uint KlassInfoTable::hash(const Klass* p) { - assert(p->is_metadata(), "all klasses are metadata"); return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2); } diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index c840b9363ef..1522eddb76b 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -70,7 +70,7 @@ enum ChunkSizes { // in words. SpecializedChunk = 128, ClassSmallChunk = 256, SmallChunk = 512, - ClassMediumChunk = 1 * K, + ClassMediumChunk = 4 * K, MediumChunk = 8 * K, HumongousChunkGranularity = 8 }; @@ -580,7 +580,6 @@ class SpaceManager : public CHeapObj { // Number of small chunks to allocate to a manager // If class space manager, small chunks are unlimited static uint const _small_chunk_limit; - bool has_small_chunk_limit() { return !vs_list()->is_class(); } // Sum of all space in allocated chunks size_t _allocated_blocks_words; @@ -1298,13 +1297,18 @@ size_t MetaspaceGC::delta_capacity_until_GC(size_t word_size) { bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) { - size_t committed_capacity_bytes = MetaspaceAux::allocated_capacity_bytes(); // If the user wants a limit, impose one. - size_t max_metaspace_size_bytes = MaxMetaspaceSize; - size_t metaspace_size_bytes = MetaspaceSize; - if (!FLAG_IS_DEFAULT(MaxMetaspaceSize) && - MetaspaceAux::reserved_in_bytes() >= MaxMetaspaceSize) { - return false; + // The reason for someone using this flag is to limit reserved space. So + // for non-class virtual space, compare against virtual spaces that are reserved. + // For class virtual space, we only compare against the committed space, not + // reserved space, because this is a larger space prereserved for compressed + // class pointers. + if (!FLAG_IS_DEFAULT(MaxMetaspaceSize)) { + size_t real_allocated = Metaspace::space_list()->virtual_space_total() + + MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); + if (real_allocated >= MaxMetaspaceSize) { + return false; + } } // Class virtual space should always be expanded. Call GC for the other @@ -1318,11 +1322,12 @@ bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) { } - // If the capacity is below the minimum capacity, allow the // expansion. Also set the high-water-mark (capacity_until_GC) // to that minimum capacity so that a GC will not be induced // until that minimum capacity is exceeded. + size_t committed_capacity_bytes = MetaspaceAux::allocated_capacity_bytes(); + size_t metaspace_size_bytes = MetaspaceSize; if (committed_capacity_bytes < metaspace_size_bytes || capacity_until_GC() == 0) { set_capacity_until_GC(metaspace_size_bytes); @@ -1556,19 +1561,7 @@ bool Metadebug::test_metadata_failure() { // ChunkManager methods -// Verification of _free_chunks_total and _free_chunks_count does not -// work with the CMS collector because its use of additional locks -// complicate the mutex deadlock detection but it can still be useful -// for detecting errors in the chunk accounting with other collectors. - size_t ChunkManager::free_chunks_total() { -#ifdef ASSERT - if (!UseConcMarkSweepGC && !SpaceManager::expand_lock()->is_locked()) { - MutexLockerEx cl(SpaceManager::expand_lock(), - Mutex::_no_safepoint_check_flag); - slow_locked_verify_free_chunks_total(); - } -#endif return _free_chunks_total; } @@ -1866,13 +1859,11 @@ size_t SpaceManager::sum_waste_in_chunks_in_use(ChunkIndex index) const { Metachunk* chunk = chunks_in_use(index); // Count the free space in all the chunk but not the // current chunk from which allocations are still being done. - if (chunk != NULL) { - Metachunk* prev = chunk; - while (chunk != NULL && chunk != current_chunk()) { + while (chunk != NULL) { + if (chunk != current_chunk()) { result += chunk->free_word_size(); - prev = chunk; - chunk = chunk->next(); } + chunk = chunk->next(); } return result; } @@ -1961,8 +1952,7 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) { // chunks will be allocated. size_t chunk_word_size; if (chunks_in_use(MediumIndex) == NULL && - (!has_small_chunk_limit() || - sum_count_in_chunks_in_use(SmallIndex) < _small_chunk_limit)) { + sum_count_in_chunks_in_use(SmallIndex) < _small_chunk_limit) { chunk_word_size = (size_t) small_chunk_size(); if (word_size + Metachunk::overhead() > small_chunk_size()) { chunk_word_size = medium_chunk_size(); @@ -2608,14 +2598,14 @@ void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) { "->" SIZE_FORMAT "(" SIZE_FORMAT ")", prev_metadata_used, - allocated_capacity_bytes(), + allocated_used_bytes(), reserved_in_bytes()); } else { gclog_or_tty->print(" " SIZE_FORMAT "K" "->" SIZE_FORMAT "K" "(" SIZE_FORMAT "K)", prev_metadata_used / K, - allocated_capacity_bytes() / K, + allocated_used_bytes() / K, reserved_in_bytes()/ K); } @@ -2671,10 +2661,10 @@ void MetaspaceAux::print_on(outputStream* out, Metaspace::MetadataType mdtype) { // Print total fragmentation for class and data metaspaces separately void MetaspaceAux::print_waste(outputStream* out) { - size_t specialized_waste = 0, small_waste = 0, medium_waste = 0, large_waste = 0; - size_t specialized_count = 0, small_count = 0, medium_count = 0, large_count = 0; - size_t cls_specialized_waste = 0, cls_small_waste = 0, cls_medium_waste = 0, cls_large_waste = 0; - size_t cls_specialized_count = 0, cls_small_count = 0, cls_medium_count = 0, cls_large_count = 0; + size_t specialized_waste = 0, small_waste = 0, medium_waste = 0; + size_t specialized_count = 0, small_count = 0, medium_count = 0, humongous_count = 0; + size_t cls_specialized_waste = 0, cls_small_waste = 0, cls_medium_waste = 0; + size_t cls_specialized_count = 0, cls_small_count = 0, cls_medium_count = 0, cls_humongous_count = 0; ClassLoaderDataGraphMetaspaceIterator iter; while (iter.repeat()) { @@ -2686,8 +2676,7 @@ void MetaspaceAux::print_waste(outputStream* out) { small_count += msp->vsm()->sum_count_in_chunks_in_use(SmallIndex); medium_waste += msp->vsm()->sum_waste_in_chunks_in_use(MediumIndex); medium_count += msp->vsm()->sum_count_in_chunks_in_use(MediumIndex); - large_waste += msp->vsm()->sum_waste_in_chunks_in_use(HumongousIndex); - large_count += msp->vsm()->sum_count_in_chunks_in_use(HumongousIndex); + humongous_count += msp->vsm()->sum_count_in_chunks_in_use(HumongousIndex); cls_specialized_waste += msp->class_vsm()->sum_waste_in_chunks_in_use(SpecializedIndex); cls_specialized_count += msp->class_vsm()->sum_count_in_chunks_in_use(SpecializedIndex); @@ -2695,20 +2684,23 @@ void MetaspaceAux::print_waste(outputStream* out) { cls_small_count += msp->class_vsm()->sum_count_in_chunks_in_use(SmallIndex); cls_medium_waste += msp->class_vsm()->sum_waste_in_chunks_in_use(MediumIndex); cls_medium_count += msp->class_vsm()->sum_count_in_chunks_in_use(MediumIndex); - cls_large_waste += msp->class_vsm()->sum_waste_in_chunks_in_use(HumongousIndex); - cls_large_count += msp->class_vsm()->sum_count_in_chunks_in_use(HumongousIndex); + cls_humongous_count += msp->class_vsm()->sum_count_in_chunks_in_use(HumongousIndex); } } out->print_cr("Total fragmentation waste (words) doesn't count free space"); out->print_cr(" data: " SIZE_FORMAT " specialized(s) " SIZE_FORMAT ", " SIZE_FORMAT " small(s) " SIZE_FORMAT ", " - SIZE_FORMAT " medium(s) " SIZE_FORMAT, + SIZE_FORMAT " medium(s) " SIZE_FORMAT ", " + "large count " SIZE_FORMAT, specialized_count, specialized_waste, small_count, - small_waste, medium_count, medium_waste); + small_waste, medium_count, medium_waste, humongous_count); out->print_cr(" class: " SIZE_FORMAT " specialized(s) " SIZE_FORMAT ", " - SIZE_FORMAT " small(s) " SIZE_FORMAT, + SIZE_FORMAT " small(s) " SIZE_FORMAT ", " + SIZE_FORMAT " medium(s) " SIZE_FORMAT ", " + "large count " SIZE_FORMAT, cls_specialized_count, cls_specialized_waste, - cls_small_count, cls_small_waste); + cls_small_count, cls_small_waste, + cls_medium_count, cls_medium_waste, cls_humongous_count); } // Dump global metaspace things from the end of ClassLoaderDataGraph @@ -3049,18 +3041,24 @@ Metablock* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, if (Verbose && TraceMetadataChunkAllocation) { gclog_or_tty->print_cr("Metaspace allocation failed for size " SIZE_FORMAT, word_size); - if (loader_data->metaspace_or_null() != NULL) loader_data->metaspace_or_null()->dump(gclog_or_tty); + if (loader_data->metaspace_or_null() != NULL) loader_data->dump(gclog_or_tty); MetaspaceAux::dump(gclog_or_tty); } // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - report_java_out_of_memory("Metadata space"); + const char* space_string = (mdtype == ClassType) ? "Class Metadata space" : + "Metadata space"; + report_java_out_of_memory(space_string); if (JvmtiExport::should_post_resource_exhausted()) { JvmtiExport::post_resource_exhausted( JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR, - "Metadata space"); + space_string); + } + if (mdtype == ClassType) { + THROW_OOP_0(Universe::out_of_memory_error_class_metaspace()); + } else { + THROW_OOP_0(Universe::out_of_memory_error_metaspace()); } - THROW_OOP_0(Universe::out_of_memory_error_perm_gen()); } } return Metablock::initialize(result, word_size); diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp index d2c91827485..c7d61f7b732 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp @@ -826,35 +826,15 @@ public: bool reading() const { return true; } }; - -// Save bounds of shared spaces mapped in. -static char* _ro_base = NULL; -static char* _rw_base = NULL; -static char* _md_base = NULL; -static char* _mc_base = NULL; - // Return true if given address is in the mapped shared space. bool MetaspaceShared::is_in_shared_space(const void* p) { - if (_ro_base == NULL || _rw_base == NULL) { - return false; - } else { - return ((p >= _ro_base && p < (_ro_base + SharedReadOnlySize)) || - (p >= _rw_base && p < (_rw_base + SharedReadWriteSize))); - } + return UseSharedSpaces && FileMapInfo::current_info()->is_in_shared_space(p); } void MetaspaceShared::print_shared_spaces() { - gclog_or_tty->print_cr("Shared Spaces:"); - gclog_or_tty->print(" read-only " INTPTR_FORMAT "-" INTPTR_FORMAT, - _ro_base, _ro_base + SharedReadOnlySize); - gclog_or_tty->print(" read-write " INTPTR_FORMAT "-" INTPTR_FORMAT, - _rw_base, _rw_base + SharedReadWriteSize); - gclog_or_tty->cr(); - gclog_or_tty->print(" misc-data " INTPTR_FORMAT "-" INTPTR_FORMAT, - _md_base, _md_base + SharedMiscDataSize); - gclog_or_tty->print(" misc-code " INTPTR_FORMAT "-" INTPTR_FORMAT, - _mc_base, _mc_base + SharedMiscCodeSize); - gclog_or_tty->cr(); + if (UseSharedSpaces) { + FileMapInfo::current_info()->print_shared_spaces(); + } } @@ -874,6 +854,11 @@ bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) { assert(!DumpSharedSpaces, "Should not be called with DumpSharedSpaces"); + char* _ro_base = NULL; + char* _rw_base = NULL; + char* _md_base = NULL; + char* _mc_base = NULL; + // Map each shared region if ((_ro_base = mapinfo->map_region(ro)) != NULL && (_rw_base = mapinfo->map_region(rw)) != NULL && diff --git a/hotspot/src/share/vm/memory/referenceProcessorStats.hpp b/hotspot/src/share/vm/memory/referenceProcessorStats.hpp index 7f4a05ba97f..7497c09b92f 100644 --- a/hotspot/src/share/vm/memory/referenceProcessorStats.hpp +++ b/hotspot/src/share/vm/memory/referenceProcessorStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/sharedHeap.cpp b/hotspot/src/share/vm/memory/sharedHeap.cpp index 1dfccd0b519..fa4dd64ec2c 100644 --- a/hotspot/src/share/vm/memory/sharedHeap.cpp +++ b/hotspot/src/share/vm/memory/sharedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,6 @@ enum SH_process_strong_roots_tasks { SH_PS_SystemDictionary_oops_do, SH_PS_ClassLoaderDataGraph_oops_do, SH_PS_jvmti_oops_do, - SH_PS_StringTable_oops_do, SH_PS_CodeCache_oops_do, // Leave this one last. SH_PS_NumElements @@ -127,6 +126,8 @@ SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* outer, bool activate) { if (_active) { outer->change_strong_roots_parity(); + // Zero the claimed high water mark in the StringTable + StringTable::clear_parallel_claimed_index(); } } @@ -154,14 +155,16 @@ void SharedHeap::process_strong_roots(bool activate_scope, // Global (strong) JNI handles if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do)) JNIHandles::oops_do(roots); + // All threads execute this; the individual threads are task groups. CLDToOopClosure roots_from_clds(roots); CLDToOopClosure* roots_from_clds_p = (is_scavenging ? NULL : &roots_from_clds); - if (ParallelGCThreads > 0) { - Threads::possibly_parallel_oops_do(roots, roots_from_clds_p ,code_roots); + if (CollectedHeap::use_parallel_gc_threads()) { + Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, code_roots); } else { Threads::oops_do(roots, roots_from_clds_p, code_roots); } + if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do)) ObjectSynchronizer::oops_do(roots); if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do)) @@ -189,8 +192,12 @@ void SharedHeap::process_strong_roots(bool activate_scope, } } - if (!_process_strong_tasks->is_task_claimed(SH_PS_StringTable_oops_do)) { - if (so & SO_Strings) { + // All threads execute the following. A specific chunk of buckets + // from the StringTable are the individual tasks. + if (so & SO_Strings) { + if (CollectedHeap::use_parallel_gc_threads()) { + StringTable::possibly_parallel_oops_do(roots); + } else { StringTable::oops_do(roots); } } diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 2b4c5602a8e..3514886d0d9 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -111,7 +111,8 @@ LatestMethodOopCache* Universe::_loader_addClass_cache = NULL; LatestMethodOopCache* Universe::_pd_implies_cache = NULL; ActiveMethodOopsCache* Universe::_reflect_invoke_cache = NULL; oop Universe::_out_of_memory_error_java_heap = NULL; -oop Universe::_out_of_memory_error_perm_gen = NULL; +oop Universe::_out_of_memory_error_metaspace = NULL; +oop Universe::_out_of_memory_error_class_metaspace = NULL; oop Universe::_out_of_memory_error_array_size = NULL; oop Universe::_out_of_memory_error_gc_overhead_limit = NULL; objArrayOop Universe::_preallocated_out_of_memory_error_array = NULL; @@ -180,7 +181,8 @@ void Universe::oops_do(OopClosure* f, bool do_all) { f->do_oop((oop*)&_the_null_string); f->do_oop((oop*)&_the_min_jint_string); f->do_oop((oop*)&_out_of_memory_error_java_heap); - f->do_oop((oop*)&_out_of_memory_error_perm_gen); + f->do_oop((oop*)&_out_of_memory_error_metaspace); + f->do_oop((oop*)&_out_of_memory_error_class_metaspace); f->do_oop((oop*)&_out_of_memory_error_array_size); f->do_oop((oop*)&_out_of_memory_error_gc_overhead_limit); f->do_oop((oop*)&_preallocated_out_of_memory_error_array); @@ -531,7 +533,9 @@ void Universe::reinitialize_vtable_of(KlassHandle k_h, TRAPS) { if (vt) vt->initialize_vtable(false, CHECK); if (ko->oop_is_instance()) { InstanceKlass* ik = (InstanceKlass*)ko; - for (KlassHandle s_h(THREAD, ik->subklass()); s_h() != NULL; s_h = (THREAD, s_h()->next_sibling())) { + for (KlassHandle s_h(THREAD, ik->subklass()); + s_h() != NULL; + s_h = KlassHandle(THREAD, s_h()->next_sibling())) { reinitialize_vtable_of(s_h, CHECK); } } @@ -561,7 +565,8 @@ bool Universe::should_fill_in_stack_trace(Handle throwable) { // a potential loop which could happen if an out of memory occurs when attempting // to allocate the backtrace. return ((throwable() != Universe::_out_of_memory_error_java_heap) && - (throwable() != Universe::_out_of_memory_error_perm_gen) && + (throwable() != Universe::_out_of_memory_error_metaspace) && + (throwable() != Universe::_out_of_memory_error_class_metaspace) && (throwable() != Universe::_out_of_memory_error_array_size) && (throwable() != Universe::_out_of_memory_error_gc_overhead_limit)); } @@ -1012,7 +1017,8 @@ bool universe_post_init() { k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_OutOfMemoryError(), true, CHECK_false); k_h = instanceKlassHandle(THREAD, k); Universe::_out_of_memory_error_java_heap = k_h->allocate_instance(CHECK_false); - Universe::_out_of_memory_error_perm_gen = k_h->allocate_instance(CHECK_false); + Universe::_out_of_memory_error_metaspace = k_h->allocate_instance(CHECK_false); + Universe::_out_of_memory_error_class_metaspace = k_h->allocate_instance(CHECK_false); Universe::_out_of_memory_error_array_size = k_h->allocate_instance(CHECK_false); Universe::_out_of_memory_error_gc_overhead_limit = k_h->allocate_instance(CHECK_false); @@ -1045,7 +1051,9 @@ bool universe_post_init() { java_lang_Throwable::set_message(Universe::_out_of_memory_error_java_heap, msg()); msg = java_lang_String::create_from_str("Metadata space", CHECK_false); - java_lang_Throwable::set_message(Universe::_out_of_memory_error_perm_gen, msg()); + java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg()); + msg = java_lang_String::create_from_str("Class Metadata space", CHECK_false); + java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg()); msg = java_lang_String::create_from_str("Requested array size exceeds VM limit", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_array_size, msg()); @@ -1145,6 +1153,7 @@ bool universe_post_init() { // Initialize performance counters for metaspaces MetaspaceCounters::initialize_performance_counters(); + MemoryService::add_metaspace_memory_pools(); GC_locker::unlock(); // allow gc after bootstrapping diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 85397960f8c..24a95e84594 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -178,10 +178,12 @@ class Universe: AllStatic { static LatestMethodOopCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector static LatestMethodOopCache* _pd_implies_cache; // method for checking protection domain attributes static ActiveMethodOopsCache* _reflect_invoke_cache; // method for security checks - static oop _out_of_memory_error_java_heap; // preallocated error object (no backtrace) - static oop _out_of_memory_error_perm_gen; // preallocated error object (no backtrace) - static oop _out_of_memory_error_array_size;// preallocated error object (no backtrace) - static oop _out_of_memory_error_gc_overhead_limit; // preallocated error object (no backtrace) + // preallocated error objects (no backtrace) + static oop _out_of_memory_error_java_heap; + static oop _out_of_memory_error_metaspace; + static oop _out_of_memory_error_class_metaspace; + static oop _out_of_memory_error_array_size; + static oop _out_of_memory_error_gc_overhead_limit; static Array* _the_empty_int_array; // Canonicalized int array static Array* _the_empty_short_array; // Canonicalized short array @@ -352,7 +354,8 @@ class Universe: AllStatic { // may or may not have a backtrace. If error has a backtrace then the stack trace is already // filled in. static oop out_of_memory_error_java_heap() { return gen_out_of_memory_error(_out_of_memory_error_java_heap); } - static oop out_of_memory_error_perm_gen() { return gen_out_of_memory_error(_out_of_memory_error_perm_gen); } + static oop out_of_memory_error_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_metaspace); } + static oop out_of_memory_error_class_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_class_metaspace); } static oop out_of_memory_error_array_size() { return gen_out_of_memory_error(_out_of_memory_error_array_size); } static oop out_of_memory_error_gc_overhead_limit() { return gen_out_of_memory_error(_out_of_memory_error_gc_overhead_limit); } diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp index dc2fbe92e2a..ef1c20e972b 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp @@ -221,8 +221,8 @@ void ArrayKlass::oop_print_on(oop obj, outputStream* st) { // Verification -void ArrayKlass::verify_on(outputStream* st) { - Klass::verify_on(st); +void ArrayKlass::verify_on(outputStream* st, bool check_dictionary) { + Klass::verify_on(st, check_dictionary); if (component_mirror() != NULL) { guarantee(component_mirror()->klass() != NULL, "should have a class"); diff --git a/hotspot/src/share/vm/oops/arrayKlass.hpp b/hotspot/src/share/vm/oops/arrayKlass.hpp index f37a4d500ae..acf920e16d1 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.hpp +++ b/hotspot/src/share/vm/oops/arrayKlass.hpp @@ -152,7 +152,7 @@ class ArrayKlass: public Klass { void oop_print_on(oop obj, outputStream* st); // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff --git a/hotspot/src/share/vm/oops/compiledICHolder.cpp b/hotspot/src/share/vm/oops/compiledICHolder.cpp index c13b7559aa9..2b2cd2ae646 100644 --- a/hotspot/src/share/vm/oops/compiledICHolder.cpp +++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp @@ -48,8 +48,6 @@ void CompiledICHolder::print_value_on(outputStream* st) const { // Verification void CompiledICHolder::verify_on(outputStream* st) { - guarantee(holder_method()->is_metadata(), "should be in metaspace"); guarantee(holder_method()->is_method(), "should be method"); - guarantee(holder_klass()->is_metadata(), "should be in metaspace"); guarantee(holder_klass()->is_klass(), "should be klass"); } diff --git a/hotspot/src/share/vm/oops/constMethod.cpp b/hotspot/src/share/vm/oops/constMethod.cpp index 22f3b87da5a..4c0720908f7 100644 --- a/hotspot/src/share/vm/oops/constMethod.cpp +++ b/hotspot/src/share/vm/oops/constMethod.cpp @@ -440,7 +440,6 @@ void ConstMethod::collect_statistics(KlassSizeStats *sz) const { void ConstMethod::verify_on(outputStream* st) { guarantee(is_constMethod(), "object must be constMethod"); - guarantee(is_metadata(), err_msg("Should be metadata " PTR_FORMAT, this)); // Verification can occur during oop construction before the method or // other fields have been initialized. diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index c2879e2d02a..8033d7e3850 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -2095,12 +2095,10 @@ void ConstantPool::verify_on(outputStream* st) { CPSlot entry = slot_at(i); if (tag.is_klass()) { if (entry.is_resolved()) { - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); guarantee(entry.get_klass()->is_klass(), "should be klass"); } } else if (tag.is_unresolved_klass()) { if (entry.is_resolved()) { - guarantee(entry.get_klass()->is_metadata(), "should be metadata"); guarantee(entry.get_klass()->is_klass(), "should be klass"); } } else if (tag.is_symbol()) { @@ -2112,13 +2110,11 @@ void ConstantPool::verify_on(outputStream* st) { if (cache() != NULL) { // Note: cache() can be NULL before a class is completely setup or // in temporary constant pools used during constant pool merging - guarantee(cache()->is_metadata(), "should be metadata"); guarantee(cache()->is_constantPoolCache(), "should be constant pool cache"); } if (pool_holder() != NULL) { // Note: pool_holder() can be NULL in temporary constant pools // used during constant pool merging - guarantee(pool_holder()->is_metadata(), "should be metadata"); guarantee(pool_holder()->is_klass(), "should be klass"); } } diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 84f1cdd3e6d..886746d6bb6 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -3088,27 +3088,26 @@ class VerifyFieldClosure: public OopClosure { virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); } }; -void InstanceKlass::verify_on(outputStream* st) { - Klass::verify_on(st); - Thread *thread = Thread::current(); - +void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { #ifndef PRODUCT - // Avoid redundant verifies + // Avoid redundant verifies, this really should be in product. if (_verify_count == Universe::verify_count()) return; _verify_count = Universe::verify_count(); #endif - // Verify that klass is present in SystemDictionary - if (is_loaded() && !is_anonymous()) { + + // Verify Klass + Klass::verify_on(st, check_dictionary); + + // Verify that klass is present in SystemDictionary if not already + // verifying the SystemDictionary. + if (is_loaded() && !is_anonymous() && check_dictionary) { Symbol* h_name = name(); SystemDictionary::verify_obj_klass_present(h_name, class_loader_data()); } - // Verify static fields - VerifyFieldClosure blk; - // Verify vtables if (is_linked()) { - ResourceMark rm(thread); + ResourceMark rm; // $$$ This used to be done only for m/s collections. Doing it // always seemed a valid generalization. (DLD -- 6/00) vtable()->verify(st); @@ -3116,7 +3115,6 @@ void InstanceKlass::verify_on(outputStream* st) { // Verify first subklass if (subklass_oop() != NULL) { - guarantee(subklass_oop()->is_metadata(), "should be in metaspace"); guarantee(subklass_oop()->is_klass(), "should be klass"); } @@ -3128,7 +3126,6 @@ void InstanceKlass::verify_on(outputStream* st) { fatal(err_msg("subclass points to itself " PTR_FORMAT, sib)); } - guarantee(sib->is_metadata(), "should be in metaspace"); guarantee(sib->is_klass(), "should be klass"); guarantee(sib->super() == super, "siblings should have same superklass"); } @@ -3164,7 +3161,6 @@ void InstanceKlass::verify_on(outputStream* st) { if (methods() != NULL) { Array* methods = this->methods(); for (int j = 0; j < methods->length(); j++) { - guarantee(methods->at(j)->is_metadata(), "should be in metaspace"); guarantee(methods->at(j)->is_method(), "non-method in methods array"); } for (int j = 0; j < methods->length() - 1; j++) { @@ -3202,16 +3198,13 @@ void InstanceKlass::verify_on(outputStream* st) { // Verify other fields if (array_klasses() != NULL) { - guarantee(array_klasses()->is_metadata(), "should be in metaspace"); guarantee(array_klasses()->is_klass(), "should be klass"); } if (constants() != NULL) { - guarantee(constants()->is_metadata(), "should be in metaspace"); guarantee(constants()->is_constantPool(), "should be constant pool"); } const Klass* host = host_klass(); if (host != NULL) { - guarantee(host->is_metadata(), "should be in metaspace"); guarantee(host->is_klass(), "should be klass"); } } diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 7d09f8132ce..6c56a519558 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -1050,7 +1050,7 @@ public: const char* internal_name() const; // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 4739425568c..a719b88bbbe 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -377,7 +377,6 @@ void Klass::append_to_sibling_list() { } bool Klass::is_loader_alive(BoolObjectClosure* is_alive) { - assert(is_metadata(), "p is not meta-data"); assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace"); #ifdef ASSERT @@ -648,27 +647,24 @@ void Klass::collect_statistics(KlassSizeStats *sz) const { // Verification -void Klass::verify_on(outputStream* st) { - guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be"); - guarantee(this->is_metadata(), "should be in metaspace"); +void Klass::verify_on(outputStream* st, bool check_dictionary) { + // This can be expensive, but it is worth checking that this klass is actually + // in the CLD graph but not in production. assert(ClassLoaderDataGraph::contains((address)this), "Should be"); guarantee(this->is_klass(),"should be klass"); if (super() != NULL) { - guarantee(super()->is_metadata(), "should be in metaspace"); guarantee(super()->is_klass(), "should be klass"); } if (secondary_super_cache() != NULL) { Klass* ko = secondary_super_cache(); - guarantee(ko->is_metadata(), "should be in metaspace"); guarantee(ko->is_klass(), "should be klass"); } for ( uint i = 0; i < primary_super_limit(); i++ ) { Klass* ko = _primary_supers[i]; if (ko != NULL) { - guarantee(ko->is_metadata(), "should be in metaspace"); guarantee(ko->is_klass(), "should be klass"); } } @@ -680,7 +676,6 @@ void Klass::verify_on(outputStream* st) { void Klass::oop_verify_on(oop obj, outputStream* st) { guarantee(obj->is_oop(), "should be oop"); - guarantee(obj->klass()->is_metadata(), "should not be in Java heap"); guarantee(obj->klass()->is_klass(), "klass field is not a klass"); } diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index 6b0103abb5e..5f4094d4f1e 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -703,8 +703,8 @@ class Klass : public Metadata { virtual const char* internal_name() const = 0; // Verification - virtual void verify_on(outputStream* st); - void verify() { verify_on(tty); } + virtual void verify_on(outputStream* st, bool check_dictionary); + void verify(bool check_dictionary = true) { verify_on(tty, check_dictionary); } #ifndef PRODUCT void verify_vtable_index(int index); diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 1e8b1c3bb41..5941efb3b79 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1969,14 +1969,9 @@ void Method::collect_statistics(KlassSizeStats *sz) const { void Method::verify_on(outputStream* st) { guarantee(is_method(), "object must be method"); - guarantee(is_metadata(), "should be metadata"); guarantee(constants()->is_constantPool(), "should be constant pool"); - guarantee(constants()->is_metadata(), "should be metadata"); guarantee(constMethod()->is_constMethod(), "should be ConstMethod*"); - guarantee(constMethod()->is_metadata(), "should be metadata"); MethodData* md = method_data(); - guarantee(md == NULL || - md->is_metadata(), "should be metadata"); guarantee(md == NULL || md->is_methodData(), "should be method data"); } diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index f040206391e..f2f34910602 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -676,11 +676,9 @@ const char* ObjArrayKlass::internal_name() const { // Verification -void ObjArrayKlass::verify_on(outputStream* st) { - ArrayKlass::verify_on(st); - guarantee(element_klass()->is_metadata(), "should be in metaspace"); +void ObjArrayKlass::verify_on(outputStream* st, bool check_dictionary) { + ArrayKlass::verify_on(st, check_dictionary); guarantee(element_klass()->is_klass(), "should be klass"); - guarantee(bottom_klass()->is_metadata(), "should be in metaspace"); guarantee(bottom_klass()->is_klass(), "should be klass"); Klass* bk = bottom_klass(); guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass"); diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index 9905704ccab..d56a3de846d 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -151,7 +151,7 @@ class ObjArrayKlass : public ArrayKlass { const char* internal_name() const; // Verification - void verify_on(outputStream* st); + void verify_on(outputStream* st, bool check_dictionary); void oop_verify_on(oop obj, outputStream* st); }; diff --git a/hotspot/src/share/vm/oops/symbol.cpp b/hotspot/src/share/vm/oops/symbol.cpp index 8ee933bf135..f5fdfec9974 100644 --- a/hotspot/src/share/vm/oops/symbol.cpp +++ b/hotspot/src/share/vm/oops/symbol.cpp @@ -32,7 +32,9 @@ #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) { +Symbol::Symbol(const u1* name, int length, int refcount) { + _refcount = refcount; + _length = length; _identity_hash = os::random(); for (int i = 0; i < _length; i++) { byte_at_put(i, name[i]); diff --git a/hotspot/src/share/vm/oops/symbol.hpp b/hotspot/src/share/vm/oops/symbol.hpp index d06edf052fc..a71bdd454c3 100644 --- a/hotspot/src/share/vm/oops/symbol.hpp +++ b/hotspot/src/share/vm/oops/symbol.hpp @@ -27,6 +27,7 @@ #include "utilities/utf8.hpp" #include "memory/allocation.hpp" +#include "runtime/atomic.hpp" // A Symbol is a canonicalized string. // All Symbols reside in global SymbolTable and are reference counted. @@ -101,14 +102,22 @@ // type without virtual functions. class ClassLoaderData; -class Symbol : public MetaspaceObj { +// We separate the fields in SymbolBase from Symbol::_body so that +// Symbol::size(int) can correctly calculate the space needed. +class SymbolBase : public MetaspaceObj { + public: + ATOMIC_SHORT_PAIR( + volatile short _refcount, // needs atomic operation + unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) + ); + int _identity_hash; +}; + +class Symbol : private SymbolBase { friend class VMStructs; friend class SymbolTable; friend class MoveSymbols; private: - volatile int _refcount; - int _identity_hash; - unsigned short _length; // number of UTF8 characters in the symbol jbyte _body[1]; enum { @@ -117,7 +126,7 @@ class Symbol : public MetaspaceObj { }; static int size(int length) { - size_t sz = heap_word_size(sizeof(Symbol) + (length > 0 ? length - 1 : 0)); + size_t sz = heap_word_size(sizeof(SymbolBase) + (length > 0 ? length : 0)); return align_object_size(sz); } diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index 49ed1e8bcf0..2e212995f3e 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -406,10 +406,10 @@ develop(intx, WarmCallMaxSize, 999999, \ "size of the largest inlinable method") \ \ - product(intx, MaxNodeLimit, 65000, \ + product(intx, MaxNodeLimit, 80000, \ "Maximum number of nodes") \ \ - product(intx, NodeLimitFudgeFactor, 1000, \ + product(intx, NodeLimitFudgeFactor, 2000, \ "Fudge Factor for certain optimizations") \ \ product(bool, UseJumpTables, true, \ diff --git a/hotspot/src/share/vm/opto/chaitin.cpp b/hotspot/src/share/vm/opto/chaitin.cpp index 9d69b0f3b71..53ffc573284 100644 --- a/hotspot/src/share/vm/opto/chaitin.cpp +++ b/hotspot/src/share/vm/opto/chaitin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -435,6 +435,9 @@ void PhaseChaitin::Register_Allocate() { // Insert un-coalesced copies. Visit all Phis. Where inputs to a Phi do // not match the Phi itself, insert a copy. coalesce.insert_copies(_matcher); + if (C->failing()) { + return; + } } // After aggressive coalesce, attempt a first cut at coloring. diff --git a/hotspot/src/share/vm/opto/coalesce.cpp b/hotspot/src/share/vm/opto/coalesce.cpp index 74618fb410c..60c88dc12ba 100644 --- a/hotspot/src/share/vm/opto/coalesce.cpp +++ b/hotspot/src/share/vm/opto/coalesce.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -240,6 +240,8 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) { _unique = C->unique(); for( uint i=0; i<_phc._cfg._num_blocks; i++ ) { + C->check_node_count(NodeLimitFudgeFactor, "out of nodes in coalesce"); + if (C->failing()) return; Block *b = _phc._cfg._blocks[i]; uint cnt = b->num_preds(); // Number of inputs to the Phi diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index fd561a0c20c..c95226f110c 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -933,6 +933,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) { (call->as_CallLeaf()->_name != NULL && (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 || strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 || + strcmp(call->as_CallLeaf()->_name, "updateBytesCRC32") == 0 || strcmp(call->as_CallLeaf()->_name, "aescrypt_encryptBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_encryptAESCrypt") == 0 || diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 590770b7c72..a363b11a5b8 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -3332,9 +3332,14 @@ AllocateNode* AllocateNode::Ideal_allocation(Node* ptr, PhaseTransform* phase) { if (ptr == NULL) { // reduce dumb test in callers return NULL; } - ptr = ptr->uncast(); // strip a raw-to-oop cast - if (ptr == NULL) return NULL; - + if (ptr->is_CheckCastPP()) { // strip only one raw-to-oop cast + ptr = ptr->in(1); + if (ptr == NULL) return NULL; + } + // Return NULL for allocations with several casts: + // j.l.reflect.Array.newInstance(jobject, jint) + // Object.clone() + // to keep more precise type from last cast. if (ptr->is_Proj()) { Node* allo = ptr->in(0); if (allo != NULL && allo->is_Allocate()) { diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 728d892534b..df84634832a 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -291,6 +291,9 @@ class LibraryCallKit : public GraphKit { Node* inline_cipherBlockChaining_AESCrypt_predicate(bool decrypting); Node* get_key_start_from_aescrypt_object(Node* aescrypt_object); bool inline_encodeISOArray(); + bool inline_updateCRC32(); + bool inline_updateBytesCRC32(); + bool inline_updateByteBufferCRC32(); }; @@ -488,6 +491,12 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { is_predicted = true; break; + case vmIntrinsics::_updateCRC32: + case vmIntrinsics::_updateBytesCRC32: + case vmIntrinsics::_updateByteBufferCRC32: + if (!UseCRC32Intrinsics) return NULL; + break; + default: assert(id <= vmIntrinsics::LAST_COMPILER_INLINE, "caller responsibility"); assert(id != vmIntrinsics::_Object_init && id != vmIntrinsics::_invoke, "enum out of order?"); @@ -807,6 +816,13 @@ bool LibraryCallKit::try_to_inline() { case vmIntrinsics::_encodeISOArray: return inline_encodeISOArray(); + case vmIntrinsics::_updateCRC32: + return inline_updateCRC32(); + case vmIntrinsics::_updateBytesCRC32: + return inline_updateBytesCRC32(); + case vmIntrinsics::_updateByteBufferCRC32: + return inline_updateByteBufferCRC32(); + default: // If you get here, it may be that someone has added a new intrinsic // to the list in vmSymbols.hpp without implementing it here. @@ -884,7 +900,7 @@ Node* LibraryCallKit::generate_guard(Node* test, RegionNode* region, float true_ IfNode* iff = create_and_map_if(control(), test, true_prob, COUNT_UNKNOWN); - Node* if_slow = _gvn.transform( new (C) IfTrueNode(iff) ); + Node* if_slow = _gvn.transform(new (C) IfTrueNode(iff)); if (if_slow == top()) { // The slow branch is never taken. No need to build this guard. return NULL; @@ -893,7 +909,7 @@ Node* LibraryCallKit::generate_guard(Node* test, RegionNode* region, float true_ if (region != NULL) region->add_req(if_slow); - Node* if_fast = _gvn.transform( new (C) IfFalseNode(iff) ); + Node* if_fast = _gvn.transform(new (C) IfFalseNode(iff)); set_control(if_fast); return if_slow; @@ -912,8 +928,8 @@ inline Node* LibraryCallKit::generate_negative_guard(Node* index, RegionNode* re return NULL; // already stopped if (_gvn.type(index)->higher_equal(TypeInt::POS)) // [0,maxint] return NULL; // index is already adequately typed - Node* cmp_lt = _gvn.transform( new (C) CmpINode(index, intcon(0)) ); - Node* bol_lt = _gvn.transform( new (C) BoolNode(cmp_lt, BoolTest::lt) ); + Node* cmp_lt = _gvn.transform(new (C) CmpINode(index, intcon(0))); + Node* bol_lt = _gvn.transform(new (C) BoolNode(cmp_lt, BoolTest::lt)); Node* is_neg = generate_guard(bol_lt, region, PROB_MIN); if (is_neg != NULL && pos_index != NULL) { // Emulate effect of Parse::adjust_map_after_if. @@ -930,9 +946,9 @@ inline Node* LibraryCallKit::generate_nonpositive_guard(Node* index, bool never_ return NULL; // already stopped if (_gvn.type(index)->higher_equal(TypeInt::POS1)) // [1,maxint] return NULL; // index is already adequately typed - Node* cmp_le = _gvn.transform( new (C) CmpINode(index, intcon(0)) ); + Node* cmp_le = _gvn.transform(new (C) CmpINode(index, intcon(0))); BoolTest::mask le_or_eq = (never_negative ? BoolTest::eq : BoolTest::le); - Node* bol_le = _gvn.transform( new (C) BoolNode(cmp_le, le_or_eq) ); + Node* bol_le = _gvn.transform(new (C) BoolNode(cmp_le, le_or_eq)); Node* is_notp = generate_guard(bol_le, NULL, PROB_MIN); if (is_notp != NULL && pos_index != NULL) { // Emulate effect of Parse::adjust_map_after_if. @@ -968,9 +984,9 @@ inline Node* LibraryCallKit::generate_limit_guard(Node* offset, return NULL; // common case of whole-array copy Node* last = subseq_length; if (!zero_offset) // last += offset - last = _gvn.transform( new (C) AddINode(last, offset)); - Node* cmp_lt = _gvn.transform( new (C) CmpUNode(array_length, last) ); - Node* bol_lt = _gvn.transform( new (C) BoolNode(cmp_lt, BoolTest::lt) ); + last = _gvn.transform(new (C) AddINode(last, offset)); + Node* cmp_lt = _gvn.transform(new (C) CmpUNode(array_length, last)); + Node* bol_lt = _gvn.transform(new (C) BoolNode(cmp_lt, BoolTest::lt)); Node* is_over = generate_guard(bol_lt, region, PROB_MIN); return is_over; } @@ -1151,8 +1167,8 @@ bool LibraryCallKit::inline_string_equals() { Node* argument_cnt = load_String_length(no_ctrl, argument); // Check for receiver count != argument count - Node* cmp = _gvn.transform( new(C) CmpINode(receiver_cnt, argument_cnt) ); - Node* bol = _gvn.transform( new(C) BoolNode(cmp, BoolTest::ne) ); + Node* cmp = _gvn.transform(new(C) CmpINode(receiver_cnt, argument_cnt)); + Node* bol = _gvn.transform(new(C) BoolNode(cmp, BoolTest::ne)); Node* if_ne = generate_slow_guard(bol, NULL); if (if_ne != NULL) { phi->init_req(4, intcon(0)); @@ -1258,7 +1274,7 @@ Node* LibraryCallKit::string_indexOf(Node* string_object, ciTypeArray* target_ar Node* sourceOffset = load_String_offset(no_ctrl, string_object); Node* sourceCount = load_String_length(no_ctrl, string_object); - Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array, true)) ); + Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array, true))); jint target_length = target_array->length(); const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin)); const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot); @@ -1365,8 +1381,8 @@ bool LibraryCallKit::inline_string_indexOf() { Node* substr_cnt = load_String_length(no_ctrl, arg); // Check for substr count > string count - Node* cmp = _gvn.transform( new(C) CmpINode(substr_cnt, source_cnt) ); - Node* bol = _gvn.transform( new(C) BoolNode(cmp, BoolTest::gt) ); + Node* cmp = _gvn.transform(new(C) CmpINode(substr_cnt, source_cnt)); + Node* bol = _gvn.transform(new(C) BoolNode(cmp, BoolTest::gt)); Node* if_gt = generate_slow_guard(bol, NULL); if (if_gt != NULL) { result_phi->init_req(2, intcon(-1)); @@ -1375,8 +1391,8 @@ bool LibraryCallKit::inline_string_indexOf() { if (!stopped()) { // Check for substr count == 0 - cmp = _gvn.transform( new(C) CmpINode(substr_cnt, intcon(0)) ); - bol = _gvn.transform( new(C) BoolNode(cmp, BoolTest::eq) ); + cmp = _gvn.transform(new(C) CmpINode(substr_cnt, intcon(0))); + bol = _gvn.transform(new(C) BoolNode(cmp, BoolTest::eq)); Node* if_zero = generate_slow_guard(bol, NULL); if (if_zero != NULL) { result_phi->init_req(3, intcon(0)); @@ -1552,7 +1568,7 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { // Check PI/4 : abs(arg) Node *cmp = _gvn.transform(new (C) CmpDNode(pi4,abs)); // Check: If PI/4 < abs(arg) then go slow - Node *bol = _gvn.transform( new (C) BoolNode( cmp, BoolTest::lt ) ); + Node *bol = _gvn.transform(new (C) BoolNode( cmp, BoolTest::lt )); // Branch either way IfNode *iff = create_and_xform_if(control(),bol, PROB_STATIC_FREQUENT, COUNT_UNKNOWN); set_control(opt_iff(r,iff)); @@ -1617,8 +1633,8 @@ void LibraryCallKit::finish_pow_exp(Node* result, Node* x, Node* y, const TypeFu // to the runtime to properly handle corner cases IfNode* iff = create_and_xform_if(control(), bolisnum, PROB_STATIC_FREQUENT, COUNT_UNKNOWN); - Node* if_slow = _gvn.transform( new (C) IfFalseNode(iff) ); - Node* if_fast = _gvn.transform( new (C) IfTrueNode(iff) ); + Node* if_slow = _gvn.transform(new (C) IfFalseNode(iff)); + Node* if_fast = _gvn.transform(new (C) IfTrueNode(iff)); if (!if_slow->is_top()) { RegionNode* result_region = new (C) RegionNode(3); @@ -1704,42 +1720,42 @@ bool LibraryCallKit::inline_pow() { // Check x:0 Node *cmp = _gvn.transform(new (C) CmpDNode(x, zeronode)); // Check: If (x<=0) then go complex path - Node *bol1 = _gvn.transform( new (C) BoolNode( cmp, BoolTest::le ) ); + Node *bol1 = _gvn.transform(new (C) BoolNode( cmp, BoolTest::le )); // Branch either way IfNode *if1 = create_and_xform_if(control(),bol1, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); // Fast path taken; set region slot 3 - Node *fast_taken = _gvn.transform( new (C) IfFalseNode(if1) ); + Node *fast_taken = _gvn.transform(new (C) IfFalseNode(if1)); r->init_req(3,fast_taken); // Capture fast-control // Fast path not-taken, i.e. slow path - Node *complex_path = _gvn.transform( new (C) IfTrueNode(if1) ); + Node *complex_path = _gvn.transform(new (C) IfTrueNode(if1)); // Set fast path result - Node *fast_result = _gvn.transform( new (C) PowDNode(C, control(), x, y) ); + Node *fast_result = _gvn.transform(new (C) PowDNode(C, control(), x, y)); phi->init_req(3, fast_result); // Complex path // Build the second if node (if y is long) // Node for (long)y - Node *longy = _gvn.transform( new (C) ConvD2LNode(y)); + Node *longy = _gvn.transform(new (C) ConvD2LNode(y)); // Node for (double)((long) y) - Node *doublelongy= _gvn.transform( new (C) ConvL2DNode(longy)); + Node *doublelongy= _gvn.transform(new (C) ConvL2DNode(longy)); // Check (double)((long) y) : y Node *cmplongy= _gvn.transform(new (C) CmpDNode(doublelongy, y)); // Check if (y isn't long) then go to slow path - Node *bol2 = _gvn.transform( new (C) BoolNode( cmplongy, BoolTest::ne ) ); + Node *bol2 = _gvn.transform(new (C) BoolNode( cmplongy, BoolTest::ne )); // Branch either way IfNode *if2 = create_and_xform_if(complex_path,bol2, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - Node* ylong_path = _gvn.transform( new (C) IfFalseNode(if2)); + Node* ylong_path = _gvn.transform(new (C) IfFalseNode(if2)); - Node *slow_path = _gvn.transform( new (C) IfTrueNode(if2) ); + Node *slow_path = _gvn.transform(new (C) IfTrueNode(if2)); // Calculate DPow(abs(x), y)*(1 & (long)y) // Node for constant 1 Node *conone = longcon(1); // 1& (long)y - Node *signnode= _gvn.transform( new (C) AndLNode(conone, longy) ); + Node *signnode= _gvn.transform(new (C) AndLNode(conone, longy)); // A huge number is always even. Detect a huge number by checking // if y + 1 == y and set integer to be tested for parity to 0. @@ -1747,9 +1763,9 @@ bool LibraryCallKit::inline_pow() { // (long)9.223372036854776E18 = max_jlong // (double)(long)9.223372036854776E18 = 9.223372036854776E18 // max_jlong is odd but 9.223372036854776E18 is even - Node* yplus1 = _gvn.transform( new (C) AddDNode(y, makecon(TypeD::make(1)))); + Node* yplus1 = _gvn.transform(new (C) AddDNode(y, makecon(TypeD::make(1)))); Node *cmpyplus1= _gvn.transform(new (C) CmpDNode(yplus1, y)); - Node *bolyplus1 = _gvn.transform( new (C) BoolNode( cmpyplus1, BoolTest::eq ) ); + Node *bolyplus1 = _gvn.transform(new (C) BoolNode( cmpyplus1, BoolTest::eq )); Node* correctedsign = NULL; if (ConditionalMoveLimit != 0) { correctedsign = _gvn.transform( CMoveNode::make(C, NULL, bolyplus1, signnode, longcon(0), TypeLong::LONG)); @@ -1757,8 +1773,8 @@ bool LibraryCallKit::inline_pow() { IfNode *ifyplus1 = create_and_xform_if(ylong_path,bolyplus1, PROB_FAIR, COUNT_UNKNOWN); RegionNode *r = new (C) RegionNode(3); Node *phi = new (C) PhiNode(r, TypeLong::LONG); - r->init_req(1, _gvn.transform( new (C) IfFalseNode(ifyplus1))); - r->init_req(2, _gvn.transform( new (C) IfTrueNode(ifyplus1))); + r->init_req(1, _gvn.transform(new (C) IfFalseNode(ifyplus1))); + r->init_req(2, _gvn.transform(new (C) IfTrueNode(ifyplus1))); phi->init_req(1, signnode); phi->init_req(2, longcon(0)); correctedsign = _gvn.transform(phi); @@ -1771,11 +1787,11 @@ bool LibraryCallKit::inline_pow() { // Check (1&(long)y)==0? Node *cmpeq1 = _gvn.transform(new (C) CmpLNode(correctedsign, conzero)); // Check if (1&(long)y)!=0?, if so the result is negative - Node *bol3 = _gvn.transform( new (C) BoolNode( cmpeq1, BoolTest::ne ) ); + Node *bol3 = _gvn.transform(new (C) BoolNode( cmpeq1, BoolTest::ne )); // abs(x) - Node *absx=_gvn.transform( new (C) AbsDNode(x)); + Node *absx=_gvn.transform(new (C) AbsDNode(x)); // abs(x)^y - Node *absxpowy = _gvn.transform( new (C) PowDNode(C, control(), absx, y) ); + Node *absxpowy = _gvn.transform(new (C) PowDNode(C, control(), absx, y)); // -abs(x)^y Node *negabsxpowy = _gvn.transform(new (C) NegDNode (absxpowy)); // (1&(long)y)==1?-DPow(abs(x), y):DPow(abs(x), y) @@ -1786,8 +1802,8 @@ bool LibraryCallKit::inline_pow() { IfNode *ifyeven = create_and_xform_if(ylong_path,bol3, PROB_FAIR, COUNT_UNKNOWN); RegionNode *r = new (C) RegionNode(3); Node *phi = new (C) PhiNode(r, Type::DOUBLE); - r->init_req(1, _gvn.transform( new (C) IfFalseNode(ifyeven))); - r->init_req(2, _gvn.transform( new (C) IfTrueNode(ifyeven))); + r->init_req(1, _gvn.transform(new (C) IfFalseNode(ifyeven))); + r->init_req(2, _gvn.transform(new (C) IfTrueNode(ifyeven))); phi->init_req(1, absxpowy); phi->init_req(2, negabsxpowy); signresult = _gvn.transform(phi); @@ -1920,7 +1936,7 @@ LibraryCallKit::generate_min_max(vmIntrinsics::ID id, Node* x0, Node* y0) { int cmp_op = Op_CmpI; Node* xkey = xvalue; Node* ykey = yvalue; - Node* ideal_cmpxy = _gvn.transform( new(C) CmpINode(xkey, ykey) ); + Node* ideal_cmpxy = _gvn.transform(new(C) CmpINode(xkey, ykey)); if (ideal_cmpxy->is_Cmp()) { // E.g., if we have CmpI(length - offset, count), // it might idealize to CmpI(length, count + offset) @@ -2013,7 +2029,7 @@ LibraryCallKit::generate_min_max(vmIntrinsics::ID id, Node* x0, Node* y0) { default: if (cmpxy == NULL) cmpxy = ideal_cmpxy; - best_bol = _gvn.transform( new(C) BoolNode(cmpxy, BoolTest::lt) ); + best_bol = _gvn.transform(new(C) BoolNode(cmpxy, BoolTest::lt)); // and fall through: case BoolTest::lt: // x < y case BoolTest::le: // x <= y @@ -2073,7 +2089,7 @@ LibraryCallKit::classify_unsafe_addr(Node* &base, Node* &offset) { return Type::AnyPtr; } else if (base_type == TypePtr::NULL_PTR) { // Since this is a NULL+long form, we have to switch to a rawptr. - base = _gvn.transform( new (C) CastX2PNode(offset) ); + base = _gvn.transform(new (C) CastX2PNode(offset)); offset = MakeConX(0); return Type::RawPtr; } else if (base_type->base() == Type::RawPtr) { @@ -2467,7 +2483,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas case T_ADDRESS: // Repackage the long as a pointer. val = ConvL2X(val); - val = _gvn.transform( new (C) CastX2PNode(val) ); + val = _gvn.transform(new (C) CastX2PNode(val)); break; } @@ -2775,7 +2791,7 @@ bool LibraryCallKit::inline_unsafe_load_store(BasicType type, LoadStoreKind kind // SCMemProjNodes represent the memory state of a LoadStore. Their // main role is to prevent LoadStore nodes from being optimized away // when their results aren't used. - Node* proj = _gvn.transform( new (C) SCMemProjNode(load_store)); + Node* proj = _gvn.transform(new (C) SCMemProjNode(load_store)); set_memory(proj, alias_idx); // Add the trailing membar surrounding the access @@ -3010,8 +3026,8 @@ bool LibraryCallKit::inline_native_isInterrupted() { Node* rec_thr = argument(0); Node* tls_ptr = NULL; Node* cur_thr = generate_current_thread(tls_ptr); - Node* cmp_thr = _gvn.transform( new (C) CmpPNode(cur_thr, rec_thr) ); - Node* bol_thr = _gvn.transform( new (C) BoolNode(cmp_thr, BoolTest::ne) ); + Node* cmp_thr = _gvn.transform(new (C) CmpPNode(cur_thr, rec_thr)); + Node* bol_thr = _gvn.transform(new (C) BoolNode(cmp_thr, BoolTest::ne)); generate_slow_guard(bol_thr, slow_region); @@ -3022,36 +3038,36 @@ bool LibraryCallKit::inline_native_isInterrupted() { // 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)) ); - Node* bol_bit = _gvn.transform( new (C) BoolNode(cmp_bit, BoolTest::ne) ); + Node* cmp_bit = _gvn.transform(new (C) CmpINode(int_bit, intcon(0))); + Node* bol_bit = _gvn.transform(new (C) BoolNode(cmp_bit, BoolTest::ne)); IfNode* iff_bit = create_and_map_if(control(), bol_bit, PROB_UNLIKELY_MAG(3), COUNT_UNKNOWN); // First fast path: if (!TLS._interrupted) return false; - Node* false_bit = _gvn.transform( new (C) IfFalseNode(iff_bit) ); + Node* false_bit = _gvn.transform(new (C) IfFalseNode(iff_bit)); result_rgn->init_req(no_int_result_path, false_bit); result_val->init_req(no_int_result_path, intcon(0)); // drop through to next case - set_control( _gvn.transform(new (C) IfTrueNode(iff_bit)) ); + set_control( _gvn.transform(new (C) IfTrueNode(iff_bit))); // (c) Or, if interrupt bit is set and clear_int is false, use 2nd fast path. Node* clr_arg = argument(1); - Node* cmp_arg = _gvn.transform( new (C) CmpINode(clr_arg, intcon(0)) ); - Node* bol_arg = _gvn.transform( new (C) BoolNode(cmp_arg, BoolTest::ne) ); + Node* cmp_arg = _gvn.transform(new (C) CmpINode(clr_arg, intcon(0))); + Node* bol_arg = _gvn.transform(new (C) BoolNode(cmp_arg, BoolTest::ne)); IfNode* iff_arg = create_and_map_if(control(), bol_arg, PROB_FAIR, COUNT_UNKNOWN); // Second fast path: ... else if (!clear_int) return true; - Node* false_arg = _gvn.transform( new (C) IfFalseNode(iff_arg) ); + Node* false_arg = _gvn.transform(new (C) IfFalseNode(iff_arg)); result_rgn->init_req(no_clear_result_path, false_arg); result_val->init_req(no_clear_result_path, intcon(1)); // drop through to next case - set_control( _gvn.transform(new (C) IfTrueNode(iff_arg)) ); + set_control( _gvn.transform(new (C) IfTrueNode(iff_arg))); // (d) Otherwise, go to the slow path. slow_region->add_req(control()); - set_control( _gvn.transform(slow_region) ); + set_control( _gvn.transform(slow_region)); if (stopped()) { // There is no slow path. @@ -3107,7 +3123,7 @@ Node* LibraryCallKit::load_klass_from_mirror_common(Node* mirror, if (region == NULL) never_see_null = true; Node* p = basic_plus_adr(mirror, offset); const TypeKlassPtr* kls_type = TypeKlassPtr::OBJECT_OR_NULL; - Node* kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type) ); + Node* kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type)); Node* null_ctl = top(); kls = null_check_oop(kls, &null_ctl, never_see_null); if (region != NULL) { @@ -3129,9 +3145,9 @@ Node* LibraryCallKit::generate_access_flags_guard(Node* kls, int modifier_mask, Node* mods = make_load(NULL, modp, TypeInt::INT, T_INT); Node* mask = intcon(modifier_mask); Node* bits = intcon(modifier_bits); - Node* mbit = _gvn.transform( new (C) AndINode(mods, mask) ); - Node* cmp = _gvn.transform( new (C) CmpINode(mbit, bits) ); - Node* bol = _gvn.transform( new (C) BoolNode(cmp, BoolTest::ne) ); + Node* mbit = _gvn.transform(new (C) AndINode(mods, mask)); + Node* cmp = _gvn.transform(new (C) CmpINode(mbit, bits)); + Node* bol = _gvn.transform(new (C) BoolNode(cmp, BoolTest::ne)); return generate_fair_guard(bol, region); } Node* LibraryCallKit::generate_interface_guard(Node* kls, RegionNode* region) { @@ -3282,7 +3298,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. p = basic_plus_adr(kls, in_bytes(Klass::super_offset())); - kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL) ); + kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL)); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { @@ -3395,8 +3411,8 @@ bool LibraryCallKit::inline_native_subtype_check() { set_control(region->in(_prim_0_path)); // go back to first null check if (!stopped()) { // Since superc is primitive, make a guard for the superc==subc case. - Node* cmp_eq = _gvn.transform( new (C) CmpPNode(args[0], args[1]) ); - Node* bol_eq = _gvn.transform( new (C) BoolNode(cmp_eq, BoolTest::eq) ); + Node* cmp_eq = _gvn.transform(new (C) CmpPNode(args[0], args[1])); + Node* bol_eq = _gvn.transform(new (C) BoolNode(cmp_eq, BoolTest::eq)); generate_guard(bol_eq, region, PROB_FAIR); if (region->req() == PATH_LIMIT+1) { // A guard was added. If the added guard is taken, superc==subc. @@ -3461,11 +3477,11 @@ Node* LibraryCallKit::generate_array_guard_common(Node* kls, RegionNode* region, ? ((jint)Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift) : Klass::_lh_neutral_value); - Node* cmp = _gvn.transform( new(C) CmpINode(layout_val, intcon(nval)) ); + Node* cmp = _gvn.transform(new(C) CmpINode(layout_val, intcon(nval))); BoolTest::mask btest = BoolTest::lt; // correct for testing is_[obj]array // invert the test if we are looking for a non-array if (not_array) btest = BoolTest(btest).negate(); - Node* bol = _gvn.transform( new(C) BoolNode(cmp, btest) ); + Node* bol = _gvn.transform(new(C) BoolNode(cmp, btest)); return generate_fair_guard(bol, region); } @@ -3525,7 +3541,7 @@ bool LibraryCallKit::inline_native_newArray() { // Return the combined state. set_i_o( _gvn.transform(result_io) ); - set_all_memory( _gvn.transform(result_mem) ); + set_all_memory( _gvn.transform(result_mem)); C->set_has_split_ifs(true); // Has chance for split-if optimization set_result(result_reg, result_val); @@ -3678,8 +3694,8 @@ Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass, const TypePtr* native_call_addr = TypeMetadataPtr::make(method); Node* native_call = makecon(native_call_addr); - Node* chk_native = _gvn.transform( new(C) CmpPNode(target_call, native_call) ); - Node* test_native = _gvn.transform( new(C) BoolNode(chk_native, BoolTest::ne) ); + Node* chk_native = _gvn.transform(new(C) CmpPNode(target_call, native_call)); + Node* test_native = _gvn.transform(new(C) BoolNode(chk_native, BoolTest::ne)); return generate_slow_guard(test_native, slow_region); } @@ -3800,10 +3816,10 @@ bool LibraryCallKit::inline_native_hashcode(bool is_virtual, bool is_static) { // Test the header to see if it is unlocked. Node *lock_mask = _gvn.MakeConX(markOopDesc::biased_lock_mask_in_place); - Node *lmasked_header = _gvn.transform( new (C) AndXNode(header, lock_mask) ); + Node *lmasked_header = _gvn.transform(new (C) AndXNode(header, lock_mask)); Node *unlocked_val = _gvn.MakeConX(markOopDesc::unlocked_value); - Node *chk_unlocked = _gvn.transform( new (C) CmpXNode( lmasked_header, unlocked_val)); - Node *test_unlocked = _gvn.transform( new (C) BoolNode( chk_unlocked, BoolTest::ne) ); + Node *chk_unlocked = _gvn.transform(new (C) CmpXNode( lmasked_header, unlocked_val)); + Node *test_unlocked = _gvn.transform(new (C) BoolNode( chk_unlocked, BoolTest::ne)); generate_slow_guard(test_unlocked, slow_region); @@ -3813,17 +3829,17 @@ bool LibraryCallKit::inline_native_hashcode(bool is_virtual, bool is_static) { // vm: see markOop.hpp. Node *hash_mask = _gvn.intcon(markOopDesc::hash_mask); Node *hash_shift = _gvn.intcon(markOopDesc::hash_shift); - Node *hshifted_header= _gvn.transform( new (C) URShiftXNode(header, hash_shift) ); + Node *hshifted_header= _gvn.transform(new (C) URShiftXNode(header, hash_shift)); // This hack lets the hash bits live anywhere in the mark object now, as long // as the shift drops the relevant bits into the low 32 bits. Note that // Java spec says that HashCode is an int so there's no point in capturing // an 'X'-sized hashcode (32 in 32-bit build or 64 in 64-bit build). hshifted_header = ConvX2I(hshifted_header); - Node *hash_val = _gvn.transform( new (C) AndINode(hshifted_header, hash_mask) ); + Node *hash_val = _gvn.transform(new (C) AndINode(hshifted_header, hash_mask)); Node *no_hash_val = _gvn.intcon(markOopDesc::no_hash); - Node *chk_assigned = _gvn.transform( new (C) CmpINode( hash_val, no_hash_val)); - Node *test_assigned = _gvn.transform( new (C) BoolNode( chk_assigned, BoolTest::eq) ); + Node *chk_assigned = _gvn.transform(new (C) CmpINode( hash_val, no_hash_val)); + Node *test_assigned = _gvn.transform(new (C) BoolNode( chk_assigned, BoolTest::eq)); generate_slow_guard(test_assigned, slow_region); @@ -3854,7 +3870,7 @@ bool LibraryCallKit::inline_native_hashcode(bool is_virtual, bool is_static) { // Return the combined state. set_i_o( _gvn.transform(result_io) ); - set_all_memory( _gvn.transform(result_mem) ); + set_all_memory( _gvn.transform(result_mem)); set_result(result_reg, result_val); return true; @@ -3982,7 +3998,7 @@ bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) { Node *opt_isnan = _gvn.transform(ifisnan); assert( opt_isnan->is_If(), "Expect an IfNode"); IfNode *opt_ifisnan = (IfNode*)opt_isnan; - Node *iftrue = _gvn.transform( new (C) IfTrueNode(opt_ifisnan) ); + Node *iftrue = _gvn.transform(new (C) IfTrueNode(opt_ifisnan)); set_control(iftrue); @@ -4023,7 +4039,7 @@ bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) { Node *opt_isnan = _gvn.transform(ifisnan); assert( opt_isnan->is_If(), "Expect an IfNode"); IfNode *opt_ifisnan = (IfNode*)opt_isnan; - Node *iftrue = _gvn.transform( new (C) IfTrueNode(opt_ifisnan) ); + Node *iftrue = _gvn.transform(new (C) IfTrueNode(opt_ifisnan)); set_control(iftrue); @@ -4152,8 +4168,8 @@ void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, b // Compute the length also, if needed: Node* countx = size; - countx = _gvn.transform( new (C) SubXNode(countx, MakeConX(base_off)) ); - countx = _gvn.transform( new (C) URShiftXNode(countx, intcon(LogBytesPerLong) )); + countx = _gvn.transform(new (C) SubXNode(countx, MakeConX(base_off))); + countx = _gvn.transform(new (C) URShiftXNode(countx, intcon(LogBytesPerLong) )); const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; bool disjoint_bases = true; @@ -4357,9 +4373,9 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { } // Return the combined state. - set_control( _gvn.transform(result_reg) ); - set_i_o( _gvn.transform(result_i_o) ); - set_all_memory( _gvn.transform(result_mem) ); + set_control( _gvn.transform(result_reg)); + set_i_o( _gvn.transform(result_i_o)); + set_all_memory( _gvn.transform(result_mem)); } // original reexecute is set back here set_result(_gvn.transform(result_val)); @@ -4684,8 +4700,8 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, // are dest_head = dest[0..off] and dest_tail = dest[off+len..dest.length]. Node* dest_size = alloc->in(AllocateNode::AllocSize); Node* dest_length = alloc->in(AllocateNode::ALength); - Node* dest_tail = _gvn.transform( new(C) AddINode(dest_offset, - copy_length) ); + Node* dest_tail = _gvn.transform(new(C) AddINode(dest_offset, + copy_length)); // If there is a head section that needs zeroing, do it now. if (find_int_con(dest_offset, -1) != 0) { @@ -4701,8 +4717,8 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, // the copy to a more hardware-friendly word size of 64 bits. Node* tail_ctl = NULL; if (!stopped() && !dest_tail->eqv_uncast(dest_length)) { - Node* cmp_lt = _gvn.transform( new(C) CmpINode(dest_tail, dest_length) ); - Node* bol_lt = _gvn.transform( new(C) BoolNode(cmp_lt, BoolTest::lt) ); + Node* cmp_lt = _gvn.transform(new(C) CmpINode(dest_tail, dest_length)); + Node* bol_lt = _gvn.transform(new(C) BoolNode(cmp_lt, BoolTest::lt)); tail_ctl = generate_slow_guard(bol_lt, NULL); assert(tail_ctl != NULL || !stopped(), "must be an outcome"); } @@ -4745,7 +4761,7 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, dest_size); done_ctl->init_req(2, control()); done_mem->init_req(2, memory(adr_type)); - set_control( _gvn.transform(done_ctl) ); + set_control( _gvn.transform(done_ctl)); set_memory( _gvn.transform(done_mem), adr_type ); } } @@ -4832,18 +4848,18 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, // Clean up after the checked call. // The returned value is either 0 or -1^K, // where K = number of partially transferred array elements. - Node* cmp = _gvn.transform( new(C) CmpINode(checked_value, intcon(0)) ); - Node* bol = _gvn.transform( new(C) BoolNode(cmp, BoolTest::eq) ); + Node* cmp = _gvn.transform(new(C) CmpINode(checked_value, intcon(0))); + Node* bol = _gvn.transform(new(C) BoolNode(cmp, BoolTest::eq)); IfNode* iff = create_and_map_if(control(), bol, PROB_MAX, COUNT_UNKNOWN); // If it is 0, we are done, so transfer to the end. - Node* checks_done = _gvn.transform( new(C) IfTrueNode(iff) ); + Node* checks_done = _gvn.transform(new(C) IfTrueNode(iff)); result_region->init_req(checked_path, checks_done); result_i_o ->init_req(checked_path, checked_i_o); result_memory->init_req(checked_path, checked_mem); // If it is not zero, merge into the slow call. - set_control( _gvn.transform( new(C) IfFalseNode(iff) )); + set_control( _gvn.transform(new(C) IfFalseNode(iff) )); RegionNode* slow_reg2 = new(C) RegionNode(3); PhiNode* slow_i_o2 = new(C) PhiNode(slow_reg2, Type::ABIO); PhiNode* slow_mem2 = new(C) PhiNode(slow_reg2, Type::MEMORY, adr_type); @@ -4866,16 +4882,16 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, } else { // We must continue the copy exactly where it failed, or else // another thread might see the wrong number of writes to dest. - Node* checked_offset = _gvn.transform( new(C) XorINode(checked_value, intcon(-1)) ); + Node* checked_offset = _gvn.transform(new(C) XorINode(checked_value, intcon(-1))); Node* slow_offset = new(C) PhiNode(slow_reg2, TypeInt::INT); slow_offset->init_req(1, intcon(0)); slow_offset->init_req(2, checked_offset); slow_offset = _gvn.transform(slow_offset); // Adjust the arguments by the conditionally incoming offset. - Node* src_off_plus = _gvn.transform( new(C) AddINode(src_offset, slow_offset) ); - Node* dest_off_plus = _gvn.transform( new(C) AddINode(dest_offset, slow_offset) ); - Node* length_minus = _gvn.transform( new(C) SubINode(copy_length, slow_offset) ); + Node* src_off_plus = _gvn.transform(new(C) AddINode(src_offset, slow_offset)); + Node* dest_off_plus = _gvn.transform(new(C) AddINode(dest_offset, slow_offset)); + Node* length_minus = _gvn.transform(new(C) SubINode(copy_length, slow_offset)); // Tweak the node variables to adjust the code produced below: src_offset = src_off_plus; @@ -4914,7 +4930,7 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, } // Finished; return the combined state. - set_control( _gvn.transform(result_region) ); + set_control( _gvn.transform(result_region)); set_i_o( _gvn.transform(result_i_o) ); set_memory( _gvn.transform(result_memory), adr_type ); @@ -5096,10 +5112,10 @@ LibraryCallKit::generate_clear_array(const TypePtr* adr_type, int end_round = (-1 << scale) & (BytesPerLong - 1); Node* end = ConvI2X(slice_len); if (scale != 0) - end = _gvn.transform( new(C) LShiftXNode(end, intcon(scale) )); + end = _gvn.transform(new(C) LShiftXNode(end, intcon(scale) )); end_base += end_round; - end = _gvn.transform( new(C) AddXNode(end, MakeConX(end_base)) ); - end = _gvn.transform( new(C) AndXNode(end, MakeConX(~end_round)) ); + end = _gvn.transform(new(C) AddXNode(end, MakeConX(end_base))); + end = _gvn.transform(new(C) AndXNode(end, MakeConX(~end_round))); mem = ClearArrayNode::clear_memory(control(), mem, dest, start_con, end, &_gvn); } else if (start_con < 0 && dest_size != top()) { @@ -5108,8 +5124,8 @@ LibraryCallKit::generate_clear_array(const TypePtr* adr_type, Node* start = slice_idx; start = ConvI2X(start); if (scale != 0) - start = _gvn.transform( new(C) LShiftXNode( start, intcon(scale) )); - start = _gvn.transform( new(C) AddXNode(start, MakeConX(abase)) ); + start = _gvn.transform(new(C) LShiftXNode( start, intcon(scale) )); + start = _gvn.transform(new(C) AddXNode(start, MakeConX(abase))); if ((bump_bit | clear_low) != 0) { int to_clear = (bump_bit | clear_low); // Align up mod 8, then store a jint zero unconditionally @@ -5120,14 +5136,14 @@ LibraryCallKit::generate_clear_array(const TypePtr* adr_type, assert((abase & to_clear) == 0, "array base must be long-aligned"); } else { // Bump 'start' up to (or past) the next jint boundary: - start = _gvn.transform( new(C) AddXNode(start, MakeConX(bump_bit)) ); + start = _gvn.transform(new(C) AddXNode(start, MakeConX(bump_bit))); assert((abase & clear_low) == 0, "array base must be int-aligned"); } // Round bumped 'start' down to jlong boundary in body of array. - start = _gvn.transform( new(C) AndXNode(start, MakeConX(~to_clear)) ); + start = _gvn.transform(new(C) AndXNode(start, MakeConX(~to_clear))); if (bump_bit != 0) { // Store a zero to the immediately preceding jint: - Node* x1 = _gvn.transform( new(C) AddXNode(start, MakeConX(-bump_bit)) ); + Node* x1 = _gvn.transform(new(C) AddXNode(start, MakeConX(-bump_bit))); Node* p1 = basic_plus_adr(dest, x1); mem = StoreNode::make(_gvn, control(), mem, p1, adr_type, intcon(0), T_INT); mem = _gvn.transform(mem); @@ -5194,8 +5210,8 @@ LibraryCallKit::generate_block_arraycopy(const TypePtr* adr_type, Node* sptr = basic_plus_adr(src, src_off); Node* dptr = basic_plus_adr(dest, dest_off); Node* countx = dest_size; - countx = _gvn.transform( new (C) SubXNode(countx, MakeConX(dest_off)) ); - countx = _gvn.transform( new (C) URShiftXNode(countx, intcon(LogBytesPerLong)) ); + countx = _gvn.transform(new (C) SubXNode(countx, MakeConX(dest_off))); + countx = _gvn.transform(new (C) URShiftXNode(countx, intcon(LogBytesPerLong))); bool disjoint_bases = true; // since alloc != NULL generate_unchecked_arraycopy(adr_type, T_LONG, disjoint_bases, @@ -5360,6 +5376,117 @@ bool LibraryCallKit::inline_encodeISOArray() { return true; } +/** + * Calculate CRC32 for byte. + * int java.util.zip.CRC32.update(int crc, int b) + */ +bool LibraryCallKit::inline_updateCRC32() { + assert(UseCRC32Intrinsics, "need AVX and LCMUL instructions support"); + assert(callee()->signature()->size() == 2, "update has 2 parameters"); + // no receiver since it is static method + Node* crc = argument(0); // type: int + Node* b = argument(1); // type: int + + /* + * int c = ~ crc; + * b = timesXtoThe32[(b ^ c) & 0xFF]; + * b = b ^ (c >>> 8); + * crc = ~b; + */ + + Node* M1 = intcon(-1); + crc = _gvn.transform(new (C) XorINode(crc, M1)); + Node* result = _gvn.transform(new (C) XorINode(crc, b)); + result = _gvn.transform(new (C) AndINode(result, intcon(0xFF))); + + Node* base = makecon(TypeRawPtr::make(StubRoutines::crc_table_addr())); + Node* offset = _gvn.transform(new (C) LShiftINode(result, intcon(0x2))); + Node* adr = basic_plus_adr(top(), base, ConvI2X(offset)); + result = make_load(control(), adr, TypeInt::INT, T_INT); + + crc = _gvn.transform(new (C) URShiftINode(crc, intcon(8))); + result = _gvn.transform(new (C) XorINode(crc, result)); + result = _gvn.transform(new (C) XorINode(result, M1)); + set_result(result); + return true; +} + +/** + * Calculate CRC32 for byte[] array. + * int java.util.zip.CRC32.updateBytes(int crc, byte[] buf, int off, int len) + */ +bool LibraryCallKit::inline_updateBytesCRC32() { + assert(UseCRC32Intrinsics, "need AVX and LCMUL instructions support"); + assert(callee()->signature()->size() == 4, "updateBytes has 4 parameters"); + // no receiver since it is static method + Node* crc = argument(0); // type: int + Node* src = argument(1); // type: oop + Node* offset = argument(2); // type: int + Node* length = argument(3); // type: int + + const Type* src_type = src->Value(&_gvn); + const TypeAryPtr* top_src = src_type->isa_aryptr(); + if (top_src == NULL || top_src->klass() == NULL) { + // failed array check + return false; + } + + // Figure out the size and type of the elements we will be copying. + BasicType src_elem = src_type->isa_aryptr()->klass()->as_array_klass()->element_type()->basic_type(); + if (src_elem != T_BYTE) { + return false; + } + + // 'src_start' points to src array + scaled offset + Node* src_start = array_element_address(src, offset, src_elem); + + // We assume that range check is done by caller. + // TODO: generate range check (offset+length < src.length) in debug VM. + + // Call the stub. + address stubAddr = StubRoutines::updateBytesCRC32(); + const char *stubName = "updateBytesCRC32"; + + Node* call = make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::updateBytesCRC32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length); + Node* result = _gvn.transform(new (C) ProjNode(call, TypeFunc::Parms)); + set_result(result); + return true; +} + +/** + * Calculate CRC32 for ByteBuffer. + * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) + */ +bool LibraryCallKit::inline_updateByteBufferCRC32() { + assert(UseCRC32Intrinsics, "need AVX and LCMUL instructions support"); + assert(callee()->signature()->size() == 5, "updateByteBuffer has 4 parameters and one is long"); + // no receiver since it is static method + Node* crc = argument(0); // type: int + Node* src = argument(1); // type: long + Node* offset = argument(3); // type: int + Node* length = argument(4); // type: int + + src = ConvL2X(src); // adjust Java long to machine word + Node* base = _gvn.transform(new (C) CastX2PNode(src)); + offset = ConvI2X(offset); + + // 'src_start' points to src array + scaled offset + Node* src_start = basic_plus_adr(top(), base, offset); + + // Call the stub. + address stubAddr = StubRoutines::updateBytesCRC32(); + const char *stubName = "updateBytesCRC32"; + + Node* call = make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::updateBytesCRC32_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + crc, src_start, length); + Node* result = _gvn.transform(new (C) ProjNode(call, TypeFunc::Parms)); + set_result(result); + return true; +} + //----------------------------inline_reference_get---------------------------- // public T java.lang.ref.Reference.get(); bool LibraryCallKit::inline_reference_get() { diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index 4f3aad763f5..58de9b62587 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -985,6 +985,8 @@ Node *Matcher::xform( Node *n, int max_stack ) { mstack.push(n, Visit, NULL, -1); // set NULL as parent to indicate root while (mstack.is_nonempty()) { + C->check_node_count(NodeLimitFudgeFactor, "too many nodes matching instructions"); + if (C->failing()) return NULL; n = mstack.node(); // Leave node on stack Node_State nstate = mstack.state(); if (nstate == Visit) { diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index fc59cebdc55..aa03b5ff6c5 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -2930,7 +2930,9 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (remove_dead_region(phase, can_reshape)) return this; // Don't bother trying to transform a dead node - if (in(0) && in(0)->is_top()) return NULL; + if (in(0) && in(0)->is_top()) { + return NULL; + } // Eliminate volatile MemBars for scalar replaced objects. if (can_reshape && req() == (Precedent+1)) { @@ -2939,6 +2941,22 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { if ((opc == Op_MemBarAcquire || opc == Op_MemBarVolatile)) { // Volatile field loads and stores. Node* my_mem = in(MemBarNode::Precedent); + // The MembarAquire may keep an unused LoadNode alive through the Precedent edge + if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) { + // if the Precedent is a decodeN and its input (a Load) is used at more than one place, + // replace this Precedent (decodeN) with the Load instead. + if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) { + Node* load_node = my_mem->in(1); + set_req(MemBarNode::Precedent, load_node); + phase->is_IterGVN()->_worklist.push(my_mem); + my_mem = load_node; + } else { + assert(my_mem->unique_out() == this, "sanity"); + del_req(Precedent); + phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later + my_mem = NULL; + } + } if (my_mem != NULL && my_mem->is_Mem()) { const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); // Check for scalar replaced object reference. @@ -4384,7 +4402,7 @@ static void verify_memory_slice(const MergeMemNode* m, int alias_idx, Node* n) { } } #else // !ASSERT -#define verify_memory_slice(m,i,n) (0) // PRODUCT version is no-op +#define verify_memory_slice(m,i,n) (void)(0) // PRODUCT version is no-op #endif diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index d0aefad66b7..9a278c5ac1c 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -829,6 +829,28 @@ const TypeFunc* OptoRuntime::aescrypt_block_Type() { return TypeFunc::make(domain, range); } +/** + * int updateBytesCRC32(int crc, byte* b, int len) + */ +const TypeFunc* OptoRuntime::updateBytesCRC32_Type() { + // create input type (domain) + int num_args = 3; + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypeInt::INT; // crc + fields[argp++] = TypePtr::NOTNULL; // src + fields[argp++] = TypeInt::INT; // len + assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); + + // result type needed + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms+0] = TypeInt::INT; // crc result + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); + return TypeFunc::make(domain, range); +} + // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { // create input type (domain) diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index 295b7123757..b3f7ff4cb1a 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -284,6 +284,8 @@ private: static const TypeFunc* aescrypt_block_Type(); static const TypeFunc* cipherBlockChaining_aescrypt_Type(); + static const TypeFunc* updateBytesCRC32_Type(); + // leaf on stack replacement interpreter accessor types static const TypeFunc* osr_end_Type(); diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 737dcecd0e1..43da7494417 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -619,7 +619,7 @@ void collector_func_load(char* name, void* null_argument_3); #pragma weak collector_func_load #define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \ - ( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),0 : 0 ) + ( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),(void)0 : (void)0 ) #endif // __APPLE__ #endif // !_WINDOWS diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 85f3e2e0e41..f37ea34c46d 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -879,7 +879,7 @@ JNI_ENTRY(jint, jni_PushLocalFrame(JNIEnv *env, jint capacity)) env, capacity); #endif /* USDT2 */ //%note jni_11 - if (capacity < 0 && capacity > MAX_REASONABLE_LOCAL_CAPACITY) { + if (capacity < 0 || capacity > MAX_REASONABLE_LOCAL_CAPACITY) { #ifndef USDT2 DTRACE_PROBE1(hotspot_jni, PushLocalFrame__return, JNI_ERR); #else /* USDT2 */ diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 08e2f881cbe..da34f2e1316 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -3310,24 +3310,10 @@ JVM_ENTRY(jobject, JVM_CurrentClassLoader(JNIEnv *env)) JVM_END -// Utility object for collecting method holders walking down the stack -class KlassLink: public ResourceObj { - public: - KlassHandle klass; - KlassLink* next; - - KlassLink(KlassHandle k) { klass = k; next = NULL; } -}; - - JVM_ENTRY(jobjectArray, JVM_GetClassContext(JNIEnv *env)) JVMWrapper("JVM_GetClassContext"); ResourceMark rm(THREAD); JvmtiVMObjectAllocEventCollector oam; - // Collect linked list of (handles to) method holders - KlassLink* first = NULL; - KlassLink* last = NULL; - int depth = 0; vframeStream vfst(thread); if (SystemDictionary::reflect_CallerSensitive_klass() != NULL) { @@ -3341,32 +3327,23 @@ JVM_ENTRY(jobjectArray, JVM_GetClassContext(JNIEnv *env)) } // Collect method holders + GrowableArray* klass_array = new GrowableArray(); for (; !vfst.at_end(); vfst.security_next()) { Method* m = vfst.method(); // Native frames are not returned if (!m->is_ignored_by_security_stack_walk() && !m->is_native()) { Klass* holder = m->method_holder(); assert(holder->is_klass(), "just checking"); - depth++; - KlassLink* l = new KlassLink(KlassHandle(thread, holder)); - if (first == NULL) { - first = last = l; - } else { - last->next = l; - last = l; - } + klass_array->append(holder); } } // Create result array of type [Ljava/lang/Class; - objArrayOop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), depth, CHECK_NULL); + objArrayOop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), klass_array->length(), CHECK_NULL); // Fill in mirrors corresponding to method holders - int index = 0; - while (first != NULL) { - result->obj_at_put(index++, first->klass()->java_mirror()); - first = first->next; + for (int i = 0; i < klass_array->length(); i++) { + result->obj_at_put(i, klass_array->at(i)->java_mirror()); } - assert(index == depth, "just checking"); return (jobjectArray) JNIHandles::make_local(env, result); JVM_END diff --git a/hotspot/src/share/vm/prims/jvmti.xml b/hotspot/src/share/vm/prims/jvmti.xml index dbd6735aa73..c23a7b5e1c3 100644 --- a/hotspot/src/share/vm/prims/jvmti.xml +++ b/hotspot/src/share/vm/prims/jvmti.xml @@ -1897,7 +1897,7 @@ jvmtiEnv *jvmti; - + jvmtiMonitorStackDepthInfo diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index bb9da0034e4..ac1c796eb31 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -1137,7 +1137,12 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, if (VerifyMethodHandles && caller_jh != NULL && java_lang_invoke_MemberName::clazz(mname()) != NULL) { Klass* reference_klass = java_lang_Class::as_Klass(java_lang_invoke_MemberName::clazz(mname())); - if (reference_klass != NULL) { + if (reference_klass != NULL && reference_klass->oop_is_objArray()) { + reference_klass = ObjArrayKlass::cast(reference_klass)->bottom_klass(); + } + + // Reflection::verify_class_access can only handle instance classes. + if (reference_klass != NULL && reference_klass->oop_is_instance()) { // Emulate LinkResolver::check_klass_accessability. Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh)); if (!Reflection::verify_class_access(caller, diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 92f2349bb7c..3552ff2062f 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -159,7 +159,7 @@ WB_END WB_ENTRY(void, WB_NMTCommitMemory(JNIEnv* env, jobject o, jlong addr, jlong size)) - os::commit_memory((char *)(uintptr_t)addr, size); + os::commit_memory((char *)(uintptr_t)addr, size, !ExecMem); MemTracker::record_virtual_memory_type((address)(uintptr_t)addr, mtTest); WB_END diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7cfd7a42eb7..c52959d6976 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -849,7 +849,7 @@ bool Arguments::process_argument(const char* arg, arg_len = equal_sign - argname; } - Flag* found_flag = Flag::find_flag((char*)argname, arg_len, true); + Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true); if (found_flag != NULL) { char locked_message_buf[BUFLEN]; found_flag->get_locked_message(locked_message_buf, BUFLEN); @@ -870,6 +870,14 @@ bool Arguments::process_argument(const char* arg, } else { jio_fprintf(defaultStream::error_stream(), "Unrecognized VM option '%s'\n", argname); + Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true); + if (fuzzy_matched != NULL) { + jio_fprintf(defaultStream::error_stream(), + "Did you mean '%s%s%s'?\n", + (fuzzy_matched->is_bool()) ? "(+/-)" : "", + fuzzy_matched->name, + (fuzzy_matched->is_bool()) ? "" : "="); + } } // allow for commandline "commenting out" options like -XX:#+Verbose @@ -1566,6 +1574,17 @@ julong Arguments::limit_by_allocatable_memory(julong limit) { return result; } +void Arguments::set_heap_base_min_address() { + if (FLAG_IS_DEFAULT(HeapBaseMinAddress) && UseG1GC && HeapBaseMinAddress < 1*G) { + // By default HeapBaseMinAddress is 2G on all platforms except Solaris x86. + // G1 currently needs a lot of C-heap, so on Solaris we have to give G1 + // some extra space for the C-heap compared to other collectors. + // Use FLAG_SET_DEFAULT here rather than FLAG_SET_ERGO to make sure that + // code that checks for default values work correctly. + FLAG_SET_DEFAULT(HeapBaseMinAddress, 1*G); + } +} + void Arguments::set_heap_size() { if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { // Deprecated flag @@ -1885,21 +1904,6 @@ bool Arguments::check_vm_args_consistency() { // Note: Needs platform-dependent factoring. bool status = true; -#if ( (defined(COMPILER2) && defined(SPARC))) - // NOTE: The call to VM_Version_init depends on the fact that VM_Version_init - // on sparc doesn't require generation of a stub as is the case on, e.g., - // x86. Normally, VM_Version_init must be called from init_globals in - // init.cpp, which is called by the initial java thread *after* arguments - // have been parsed. VM_Version_init gets called twice on sparc. - extern void VM_Version_init(); - VM_Version_init(); - if (!VM_Version::has_v9()) { - jio_fprintf(defaultStream::error_stream(), - "V8 Machine detected, Server requires V9\n"); - status = false; - } -#endif /* COMPILER2 && SPARC */ - // Allow both -XX:-UseStackBanging and -XX:-UseBoundThreads in non-product // builds so the cost of stack banging can be measured. #if (defined(PRODUCT) && defined(SOLARIS)) @@ -2217,11 +2221,24 @@ bool Arguments::check_vm_args_consistency() { status = false; } - if (ReservedCodeCacheSize < InitialCodeCacheSize) { + // Check lower bounds of the code cache + // Template Interpreter code is approximately 3X larger in debug builds. + uint min_code_cache_size = (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)) + CodeCacheMinimumFreeSpace; + if (InitialCodeCacheSize < (uintx)os::vm_page_size()) { jio_fprintf(defaultStream::error_stream(), - "Invalid ReservedCodeCacheSize: %dK. Should be greater than InitialCodeCacheSize=%dK\n", + "Invalid InitialCodeCacheSize=%dK. Must be at least %dK.\n", InitialCodeCacheSize/K, + os::vm_page_size()/K); + status = false; + } else if (ReservedCodeCacheSize < InitialCodeCacheSize) { + jio_fprintf(defaultStream::error_stream(), + "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n", ReservedCodeCacheSize/K, InitialCodeCacheSize/K); status = false; + } else if (ReservedCodeCacheSize < min_code_cache_size) { + jio_fprintf(defaultStream::error_stream(), + "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K, + min_code_cache_size/K); + status = false; } return status; @@ -2622,10 +2639,20 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, // -Xoss } else if (match_option(option, "-Xoss", &tail)) { // HotSpot does not have separate native and Java stacks, ignore silently for compatibility - // -Xmaxjitcodesize + } else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) { + julong long_CodeCacheExpansionSize = 0; + ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size()); + if (errcode != arg_in_range) { + jio_fprintf(defaultStream::error_stream(), + "Invalid argument: %s. Must be at least %luK.\n", option->optionString, + os::vm_page_size()/K); + return JNI_EINVAL; + } + FLAG_SET_CMDLINE(uintx, CodeCacheExpansionSize, (uintx)long_CodeCacheExpansionSize); } else if (match_option(option, "-Xmaxjitcodesize", &tail) || match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) { julong long_ReservedCodeCacheSize = 0; + ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1); if (errcode != arg_in_range) { jio_fprintf(defaultStream::error_stream(), @@ -3525,6 +3552,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } } + set_heap_base_min_address(); + // Set heap size based on available physical memory set_heap_size(); diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 0a4350ee3c5..0e84208a218 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -315,6 +315,8 @@ class Arguments : AllStatic { // limits the given memory size by the maximum amount of memory this process is // currently allowed to allocate or reserve. static julong limit_by_allocatable_memory(julong size); + // Setup HeapBaseMinAddress + static void set_heap_base_min_address(); // Setup heap size static void set_heap_size(); // Based on automatic selection criteria, should the diff --git a/hotspot/src/share/vm/runtime/atomic.cpp b/hotspot/src/share/vm/runtime/atomic.cpp index dbb66b2f63f..87c80ad3335 100644 --- a/hotspot/src/share/vm/runtime/atomic.cpp +++ b/hotspot/src/share/vm/runtime/atomic.cpp @@ -80,3 +80,32 @@ jlong Atomic::add(jlong add_value, volatile jlong* dest) { } return old; } + +void Atomic::inc(volatile short* dest) { + // Most platforms do not support atomic increment on a 2-byte value. However, + // if the value occupies the most significant 16 bits of an aligned 32-bit + // word, then we can do this with an atomic add of 0x10000 to the 32-bit word. + // + // The least significant parts of this 32-bit word will never be affected, even + // in case of overflow/underflow. + // + // Use the ATOMIC_SHORT_PAIR macro to get the desired alignment. +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(0x10000, (volatile int*)(dest)); +#endif +} + +void Atomic::dec(volatile short* dest) { +#ifdef VM_LITTLE_ENDIAN + assert((intx(dest) & 0x03) == 0x02, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest-1)); +#else + assert((intx(dest) & 0x03) == 0x00, "wrong alignment"); + (void)Atomic::add(-0x10000, (volatile int*)(dest)); +#endif +} + diff --git a/hotspot/src/share/vm/runtime/atomic.hpp b/hotspot/src/share/vm/runtime/atomic.hpp index ae40def88d6..3f35c3de22a 100644 --- a/hotspot/src/share/vm/runtime/atomic.hpp +++ b/hotspot/src/share/vm/runtime/atomic.hpp @@ -64,11 +64,13 @@ class Atomic : AllStatic { // Atomically increment location inline static void inc (volatile jint* dest); + static void inc (volatile jshort* dest); inline static void inc_ptr(volatile intptr_t* dest); inline static void inc_ptr(volatile void* dest); // Atomically decrement a location inline static void dec (volatile jint* dest); + static void dec (volatile jshort* dest); inline static void dec_ptr(volatile intptr_t* dest); inline static void dec_ptr(volatile void* dest); @@ -95,4 +97,24 @@ class Atomic : AllStatic { inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); }; +// To use Atomic::inc(jshort* dest) and Atomic::dec(jshort* dest), the address must be specially +// aligned, such that (*dest) occupies the upper 16 bits of an aligned 32-bit word. The best way to +// achieve is to place your short value next to another short value, which doesn't need atomic ops. +// +// Example +// ATOMIC_SHORT_PAIR( +// volatile short _refcount, // needs atomic operation +// unsigned short _length // number of UTF8 characters in the symbol (does not need atomic op) +// ); + +#ifdef VM_LITTLE_ENDIAN +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + non_atomic_decl; \ + atomic_decl +#else +#define ATOMIC_SHORT_PAIR(atomic_decl, non_atomic_decl) \ + atomic_decl ; \ + non_atomic_decl +#endif + #endif // SHARE_VM_RUNTIME_ATOMIC_HPP diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index e5caf604d98..92af92e92eb 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -387,7 +387,6 @@ void frame::interpreter_frame_set_locals(intptr_t* locs) { Method* frame::interpreter_frame_method() const { assert(is_interpreted_frame(), "interpreted frame expected"); Method* m = *interpreter_frame_method_addr(); - assert(m->is_metadata(), "bad Method* in interpreter frame"); assert(m->is_method(), "not a Method*"); return m; } @@ -713,7 +712,8 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose Method* m = ((nmethod *)_cb)->method(); if (m != NULL) { m->name_and_sig_as_C_string(buf, buflen); - st->print("J %s", buf); + st->print("J %s @ " PTR_FORMAT " [" PTR_FORMAT "+" SIZE_FORMAT "]", + buf, _pc, _cb->code_begin(), _pc - _cb->code_begin()); } else { st->print("J " PTR_FORMAT, pc()); } diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index 9d0b938fae1..a6c47bfe1de 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -73,12 +73,6 @@ bool Flag::is_unlocked() const { strcmp(kind, "{C2 diagnostic}") == 0 || strcmp(kind, "{ARCH diagnostic}") == 0 || strcmp(kind, "{Shark diagnostic}") == 0) { - if (strcmp(name, "EnableInvokeDynamic") == 0 && UnlockExperimentalVMOptions && !UnlockDiagnosticVMOptions) { - // transitional logic to allow tests to run until they are changed - static int warned; - if (++warned == 1) warning("Use -XX:+UnlockDiagnosticVMOptions before EnableInvokeDynamic flag"); - return true; - } return UnlockDiagnosticVMOptions; } else if (strcmp(kind, "{experimental}") == 0 || strcmp(kind, "{C2 experimental}") == 0 || @@ -282,14 +276,14 @@ static Flag flagTable[] = { Flag* Flag::flags = flagTable; size_t Flag::numFlags = (sizeof(flagTable) / sizeof(Flag)); -inline bool str_equal(const char* s, char* q, size_t len) { +inline bool str_equal(const char* s, const char* q, size_t len) { // s is null terminated, q is not! if (strlen(s) != (unsigned int) len) return false; return strncmp(s, q, len) == 0; } // Search the flag table for a named flag -Flag* Flag::find_flag(char* name, size_t length, bool allow_locked) { +Flag* Flag::find_flag(const char* name, size_t length, bool allow_locked) { for (Flag* current = &flagTable[0]; current->name != NULL; current++) { if (str_equal(current->name, name, length)) { // Found a matching entry. Report locked flags only if allowed. @@ -307,6 +301,52 @@ Flag* Flag::find_flag(char* name, size_t length, bool allow_locked) { return NULL; } +// Compute string similarity based on Dice's coefficient +static float str_similar(const char* str1, const char* str2, size_t len2) { + int len1 = (int) strlen(str1); + int total = len1 + (int) len2; + + int hit = 0; + + for (int i = 0; i < len1 -1; ++i) { + for (int j = 0; j < (int) len2 -1; ++j) { + if ((str1[i] == str2[j]) && (str1[i+1] == str2[j+1])) { + ++hit; + break; + } + } + } + + return 2.0f * (float) hit / (float) total; +} + +Flag* Flag::fuzzy_match(const char* name, size_t length, bool allow_locked) { + float VMOptionsFuzzyMatchSimilarity = 0.7f; + Flag* match = NULL; + float score; + float max_score = -1; + + for (Flag* current = &flagTable[0]; current->name != NULL; current++) { + score = str_similar(current->name, name, length); + if (score > max_score) { + max_score = score; + match = current; + } + } + + if (!(match->is_unlocked() || match->is_unlocker())) { + if (!allow_locked) { + return NULL; + } + } + + if (max_score < VMOptionsFuzzyMatchSimilarity) { + return NULL; + } + + return match; +} + // Returns the address of the index'th element static Flag* address_of_flag(CommandLineFlagWithType flag) { assert((size_t)flag < Flag::numFlags, "bad command line flag index"); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index b1adcf7fce1..d07785d0b61 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -220,7 +220,8 @@ struct Flag { // number of flags static size_t numFlags; - static Flag* find_flag(char* name, size_t length, bool allow_locked = false); + static Flag* find_flag(const char* name, size_t length, bool allow_locked = false); + static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false); bool is_bool() const { return strcmp(type, "bool") == 0; } bool get_bool() const { return *((bool*) addr); } @@ -644,6 +645,9 @@ class CommandLineFlags { product(bool, UseAESIntrinsics, false, \ "use intrinsics for AES versions of crypto") \ \ + product(bool, UseCRC32Intrinsics, false, \ + "use intrinsics for java.util.zip.CRC32") \ + \ develop(bool, TraceCallFixup, false, \ "traces all call fixups") \ \ @@ -3160,6 +3164,9 @@ class CommandLineFlags { product_pd(uintx, InitialCodeCacheSize, \ "Initial code cache size (in bytes)") \ \ + develop_pd(uintx, CodeCacheMinimumUseSpace, \ + "Minimum code cache size (in bytes) required to start VM.") \ + \ product_pd(uintx, ReservedCodeCacheSize, \ "Reserved code cache size (in bytes) - maximum code cache size") \ \ diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 7775d9410d5..93a60cd06d6 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -647,10 +647,13 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, address caller #ifndef ASSERT NOT_PRODUCT(inc_stat_counter(&num_mallocs, 1)); NOT_PRODUCT(inc_stat_counter(&alloc_bytes, size)); + MemTracker::Tracker tkr = MemTracker::get_realloc_tracker(); void* ptr = ::realloc(memblock, size); if (ptr != NULL) { - MemTracker::record_realloc((address)memblock, (address)ptr, size, memflags, + tkr.record((address)memblock, (address)ptr, size, memflags, caller == 0 ? CALLER_PC : caller); + } else { + tkr.discard(); } return ptr; #else @@ -1456,7 +1459,7 @@ bool os::create_stack_guard_pages(char* addr, size_t bytes) { char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint) { char* result = pd_reserve_memory(bytes, addr, alignment_hint); if (result != NULL) { - MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC); + MemTracker::record_virtual_memory_reserve((address)result, bytes, mtNone, CALLER_PC); } return result; @@ -1466,7 +1469,7 @@ char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, MEMFLAGS flags) { char* result = pd_reserve_memory(bytes, addr, alignment_hint); if (result != NULL) { - MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC); + MemTracker::record_virtual_memory_reserve((address)result, bytes, mtNone, CALLER_PC); MemTracker::record_virtual_memory_type((address)result, flags); } @@ -1476,7 +1479,7 @@ char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint, char* os::attempt_reserve_memory_at(size_t bytes, char* addr) { char* result = pd_attempt_reserve_memory_at(bytes, addr); if (result != NULL) { - MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC); + MemTracker::record_virtual_memory_reserve((address)result, bytes, mtNone, CALLER_PC); } return result; } @@ -1503,18 +1506,36 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint, return res; } +void os::commit_memory_or_exit(char* addr, size_t bytes, bool executable, + const char* mesg) { + pd_commit_memory_or_exit(addr, bytes, executable, mesg); + MemTracker::record_virtual_memory_commit((address)addr, bytes, CALLER_PC); +} + +void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, + bool executable, const char* mesg) { + os::pd_commit_memory_or_exit(addr, size, alignment_hint, executable, mesg); + MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC); +} + bool os::uncommit_memory(char* addr, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_uncommit_tracker(); bool res = pd_uncommit_memory(addr, bytes); if (res) { - MemTracker::record_virtual_memory_uncommit((address)addr, bytes); + tkr.record((address)addr, bytes); + } else { + tkr.discard(); } return res; } bool os::release_memory(char* addr, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); bool res = pd_release_memory(addr, bytes); if (res) { - MemTracker::record_virtual_memory_release((address)addr, bytes); + tkr.record((address)addr, bytes); + } else { + tkr.discard(); } return res; } @@ -1525,8 +1546,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset, bool allow_exec) { char* result = pd_map_memory(fd, file_name, file_offset, addr, bytes, read_only, allow_exec); if (result != NULL) { - MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC); - MemTracker::record_virtual_memory_commit((address)result, bytes, CALLER_PC); + MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, mtNone, CALLER_PC); } return result; } @@ -1539,10 +1559,12 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset, } bool os::unmap_memory(char *addr, size_t bytes) { + MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); bool result = pd_unmap_memory(addr, bytes); if (result) { - MemTracker::record_virtual_memory_uncommit((address)addr, bytes); - MemTracker::record_virtual_memory_release((address)addr, bytes); + tkr.record((address)addr, bytes); + } else { + tkr.discard(); } return result; } diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 3f2554399f4..e1866919df4 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -78,6 +78,10 @@ enum ThreadPriority { // JLS 20.20.1-3 CriticalPriority = 11 // Critical thread priority }; +// Executable parameter flag for os::commit_memory() and +// os::commit_memory_or_exit(). +const bool ExecMem = true; + // Typedef for structured exception handling support typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); @@ -104,9 +108,16 @@ class os: AllStatic { static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr); static void pd_split_reserved_memory(char *base, size_t size, size_t split, bool realloc); - static bool pd_commit_memory(char* addr, size_t bytes, bool executable = false); + static bool pd_commit_memory(char* addr, size_t bytes, bool executable); static bool pd_commit_memory(char* addr, size_t size, size_t alignment_hint, - bool executable = false); + bool executable); + // Same as pd_commit_memory() that either succeeds or calls + // vm_exit_out_of_memory() with the specified mesg. + static void pd_commit_memory_or_exit(char* addr, size_t bytes, + bool executable, const char* mesg); + static void pd_commit_memory_or_exit(char* addr, size_t size, + size_t alignment_hint, + bool executable, const char* mesg); static bool pd_uncommit_memory(char* addr, size_t bytes); static bool pd_release_memory(char* addr, size_t bytes); @@ -261,9 +272,16 @@ class os: AllStatic { 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); - static bool commit_memory(char* addr, size_t bytes, bool executable = false); + static bool commit_memory(char* addr, size_t bytes, bool executable); static bool commit_memory(char* addr, size_t size, size_t alignment_hint, - bool executable = false); + bool executable); + // Same as commit_memory() that either succeeds or calls + // vm_exit_out_of_memory() with the specified mesg. + static void commit_memory_or_exit(char* addr, size_t bytes, + bool executable, const char* mesg); + static void commit_memory_or_exit(char* addr, size_t size, + size_t alignment_hint, + bool executable, const char* mesg); static bool uncommit_memory(char* addr, size_t bytes); static bool release_memory(char* addr, size_t bytes); diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index 15869cc5c0e..f06a7f922aa 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -458,7 +458,7 @@ bool Reflection::verify_class_access(Klass* current_class, Klass* new_class, boo // doesn't have a classloader. if ((current_class == NULL) || (current_class == new_class) || - (InstanceKlass::cast(new_class)->is_public()) || + (new_class->is_public()) || is_same_class_package(current_class, new_class)) { return true; } diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index fe55e8b0e6b..874f5939146 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -813,8 +813,11 @@ address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread, // 3. Implict null exception in nmethod if (!cb->is_nmethod()) { - guarantee(cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(), - "exception happened outside interpreter, nmethods and vtable stubs (1)"); + bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(); + if (!is_in_blob) { + cb->print(); + fatal(err_msg("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc)); + } Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc); // There is no handler here, so we will simply unwind. return StubRoutines::throw_NullPointerException_at_call_entry(); @@ -2731,7 +2734,7 @@ VMRegPair *SharedRuntime::find_callee_arguments(Symbol* sig, bool has_receiver, // ResourceObject, so do not put any ResourceMarks in here. char *s = sig->as_C_string(); int len = (int)strlen(s); - *s++; len--; // Skip opening paren + s++; len--; // Skip opening paren char *t = s+len; while( *(--t) != ')' ) ; // Find close paren diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index c559865b821..a1179acd543 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,6 +125,9 @@ address StubRoutines::_aescrypt_decryptBlock = NULL; address StubRoutines::_cipherBlockChaining_encryptAESCrypt = NULL; address StubRoutines::_cipherBlockChaining_decryptAESCrypt = NULL; +address StubRoutines::_updateBytesCRC32 = NULL; +address StubRoutines::_crc_table_adr = NULL; + double (* StubRoutines::_intrinsic_log )(double) = NULL; double (* StubRoutines::_intrinsic_log10 )(double) = NULL; double (* StubRoutines::_intrinsic_exp )(double) = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 7ad66371300..b8d61ea0cbf 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -204,6 +204,9 @@ class StubRoutines: AllStatic { static address _cipherBlockChaining_encryptAESCrypt; static address _cipherBlockChaining_decryptAESCrypt; + static address _updateBytesCRC32; + static address _crc_table_adr; + // These are versions of the java.lang.Math methods which perform // the same operations as the intrinsic version. They are used for // constant folding in the compiler to ensure equivalence. If the @@ -342,6 +345,9 @@ class StubRoutines: AllStatic { static address cipherBlockChaining_encryptAESCrypt() { return _cipherBlockChaining_encryptAESCrypt; } static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; } + static address updateBytesCRC32() { return _updateBytesCRC32; } + static address crc_table_addr() { return _crc_table_adr; } + static address select_fill_function(BasicType t, bool aligned, const char* &name); static address zero_aligned_words() { return _zero_aligned_words; } diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 79642c2e4a9..eb2e256b1a0 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -220,7 +220,7 @@ Thread::Thread() { set_osthread(NULL); set_resource_area(new (mtThread)ResourceArea()); set_handle_area(new (mtThread) HandleArea(NULL)); - set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray(300, true)); + set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray(30, true)); set_active_handles(NULL); set_free_handle_block(NULL); set_last_handle_mark(NULL); diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp index ba68e887e17..9096a034cef 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -533,11 +533,13 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) { lower_high() + lower_needs <= lower_high_boundary(), "must not expand beyond region"); if (!os::commit_memory(lower_high(), lower_needs, _executable)) { - debug_only(warning("os::commit_memory failed")); + debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT + ", lower_needs=" SIZE_FORMAT ", %d) failed", + lower_high(), lower_needs, _executable);) return false; } else { _lower_high += lower_needs; - } + } } if (middle_needs > 0) { assert(lower_high_boundary() <= middle_high() && @@ -545,7 +547,10 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) { "must not expand beyond region"); if (!os::commit_memory(middle_high(), middle_needs, middle_alignment(), _executable)) { - debug_only(warning("os::commit_memory failed")); + debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT + ", middle_needs=" SIZE_FORMAT ", " SIZE_FORMAT + ", %d) failed", middle_high(), middle_needs, + middle_alignment(), _executable);) return false; } _middle_high += middle_needs; @@ -555,7 +560,9 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) { upper_high() + upper_needs <= upper_high_boundary(), "must not expand beyond region"); if (!os::commit_memory(upper_high(), upper_needs, _executable)) { - debug_only(warning("os::commit_memory failed")); + debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT + ", upper_needs=" SIZE_FORMAT ", %d) failed", + upper_high(), upper_needs, _executable);) return false; } else { _upper_high += upper_needs; diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index dff270f1631..94b24eec8ea 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -379,7 +379,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; 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) \ + volatile_nonstatic_field(Symbol, _refcount, short) \ nonstatic_field(Symbol, _identity_hash, int) \ nonstatic_field(Symbol, _length, unsigned short) \ unchecked_nonstatic_field(Symbol, _body, sizeof(jbyte)) /* NOTE: no type */ \ @@ -437,10 +437,6 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; static_field(Universe, _main_thread_group, oop) \ static_field(Universe, _system_thread_group, oop) \ static_field(Universe, _the_empty_class_klass_array, objArrayOop) \ - static_field(Universe, _out_of_memory_error_java_heap, oop) \ - static_field(Universe, _out_of_memory_error_perm_gen, oop) \ - static_field(Universe, _out_of_memory_error_array_size, oop) \ - static_field(Universe, _out_of_memory_error_gc_overhead_limit, oop) \ static_field(Universe, _null_ptr_exception_instance, oop) \ static_field(Universe, _arithmetic_exception_instance, oop) \ static_field(Universe, _vm_exception, oop) \ diff --git a/hotspot/src/share/vm/services/diagnosticArgument.cpp b/hotspot/src/share/vm/services/diagnosticArgument.cpp index e3e14053270..0a1c20d8a2c 100644 --- a/hotspot/src/share/vm/services/diagnosticArgument.cpp +++ b/hotspot/src/share/vm/services/diagnosticArgument.cpp @@ -247,7 +247,7 @@ template <> void DCmdArgument::init_value(TRAPS) { } else { _value._time = 0; _value._nanotime = 0; - strcmp(_value._unit, "ns"); + strcpy(_value._unit, "ns"); } } diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 872d19829a3..0808ebd0acd 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -894,12 +894,6 @@ JVM_ENTRY(jobject, jmm_GetMemoryUsage(JNIEnv* env, jboolean heap)) } } - // In our current implementation, we make sure that all non-heap - // pools have defined init and max sizes. Heap pools do not matter, - // as we never use total_init and total_max for them. - assert(heap || !has_undefined_init_size, "Undefined init size"); - assert(heap || !has_undefined_max_size, "Undefined max size"); - MemoryUsage usage((heap ? InitialHeapSize : total_init), total_used, total_committed, diff --git a/hotspot/src/share/vm/services/memBaseline.cpp b/hotspot/src/share/vm/services/memBaseline.cpp index c2d04106c8b..21eb8b5d422 100644 --- a/hotspot/src/share/vm/services/memBaseline.cpp +++ b/hotspot/src/share/vm/services/memBaseline.cpp @@ -130,7 +130,7 @@ bool MemBaseline::baseline_malloc_summary(const MemPointerArray* malloc_records) if (malloc_ptr->is_arena_record()) { // see if arena memory record present MemPointerRecord* next_malloc_ptr = (MemPointerRecordEx*)malloc_itr.peek_next(); - if (next_malloc_ptr->is_arena_memory_record()) { + if (next_malloc_ptr != NULL && next_malloc_ptr->is_arena_memory_record()) { assert(next_malloc_ptr->is_memory_record_of_arena(malloc_ptr), "Arena records do not match"); size = next_malloc_ptr->size(); diff --git a/hotspot/src/share/vm/services/memPtr.hpp b/hotspot/src/share/vm/services/memPtr.hpp index d98ca80c457..c54f0934a94 100644 --- a/hotspot/src/share/vm/services/memPtr.hpp +++ b/hotspot/src/share/vm/services/memPtr.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -457,9 +457,8 @@ class SeqMemPointerRecord : public MemPointerRecord { public: SeqMemPointerRecord(): _seq(0){ } - SeqMemPointerRecord(address addr, MEMFLAGS flags, size_t size) - : MemPointerRecord(addr, flags, size) { - _seq = SequenceGenerator::next(); + SeqMemPointerRecord(address addr, MEMFLAGS flags, size_t size, jint seq) + : MemPointerRecord(addr, flags, size), _seq(seq) { } SeqMemPointerRecord(const SeqMemPointerRecord& copy_from) @@ -488,8 +487,8 @@ class SeqMemPointerRecordEx : public MemPointerRecordEx { SeqMemPointerRecordEx(): _seq(0) { } SeqMemPointerRecordEx(address addr, MEMFLAGS flags, size_t size, - address pc): MemPointerRecordEx(addr, flags, size, pc) { - _seq = SequenceGenerator::next(); + jint seq, address pc): + MemPointerRecordEx(addr, flags, size, pc), _seq(seq) { } SeqMemPointerRecordEx(const SeqMemPointerRecordEx& copy_from) diff --git a/hotspot/src/share/vm/services/memRecorder.cpp b/hotspot/src/share/vm/services/memRecorder.cpp index 776ad223c00..afe7bd245df 100644 --- a/hotspot/src/share/vm/services/memRecorder.cpp +++ b/hotspot/src/share/vm/services/memRecorder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,10 +69,11 @@ MemRecorder::MemRecorder() { if (_pointer_records != NULL) { // recode itself + address pc = CURRENT_PC; record((address)this, (MemPointerRecord::malloc_tag()|mtNMT|otNMTRecorder), - sizeof(MemRecorder), CALLER_PC); + sizeof(MemRecorder), SequenceGenerator::next(), pc); record((address)_pointer_records, (MemPointerRecord::malloc_tag()|mtNMT|otNMTRecorder), - _pointer_records->instance_size(),CURRENT_PC); + _pointer_records->instance_size(), SequenceGenerator::next(), pc); } } @@ -116,7 +117,8 @@ int MemRecorder::sort_record_fn(const void* e1, const void* e2) { } } -bool MemRecorder::record(address p, MEMFLAGS flags, size_t size, address pc) { +bool MemRecorder::record(address p, MEMFLAGS flags, size_t size, jint seq, address pc) { + assert(seq > 0, "No sequence number"); #ifdef ASSERT if (MemPointerRecord::is_virtual_memory_record(flags)) { assert((flags & MemPointerRecord::tag_masks) != 0, "bad virtual memory record"); @@ -133,11 +135,11 @@ bool MemRecorder::record(address p, MEMFLAGS flags, size_t size, address pc) { #endif if (MemTracker::track_callsite()) { - SeqMemPointerRecordEx ap(p, flags, size, pc); + SeqMemPointerRecordEx ap(p, flags, size, seq, pc); debug_only(check_dup_seq(ap.seq());) return _pointer_records->append(&ap); } else { - SeqMemPointerRecord ap(p, flags, size); + SeqMemPointerRecord ap(p, flags, size, seq); debug_only(check_dup_seq(ap.seq());) return _pointer_records->append(&ap); } diff --git a/hotspot/src/share/vm/services/memRecorder.hpp b/hotspot/src/share/vm/services/memRecorder.hpp index 9d6bf2b7e0b..c52fad72eae 100644 --- a/hotspot/src/share/vm/services/memRecorder.hpp +++ b/hotspot/src/share/vm/services/memRecorder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -220,7 +220,7 @@ class MemRecorder : public CHeapObj { ~MemRecorder(); // record a memory operation - bool record(address addr, MEMFLAGS flags, size_t size, address caller_pc = 0); + bool record(address addr, MEMFLAGS flags, size_t size, jint seq, address caller_pc = 0); // linked list support inline void set_next(MemRecorder* rec) { diff --git a/hotspot/src/share/vm/services/memReporter.cpp b/hotspot/src/share/vm/services/memReporter.cpp index 0311675f349..9d0f45ada36 100644 --- a/hotspot/src/share/vm/services/memReporter.cpp +++ b/hotspot/src/share/vm/services/memReporter.cpp @@ -188,30 +188,51 @@ void BaselineReporter::diff_callsites(const MemBaseline& cur, const MemBaseline& (MallocCallsitePointer*)prev_malloc_itr.current(); while (cur_malloc_callsite != NULL || prev_malloc_callsite != NULL) { - if (prev_malloc_callsite == NULL || - cur_malloc_callsite->addr() < prev_malloc_callsite->addr()) { + if (prev_malloc_callsite == NULL) { + assert(cur_malloc_callsite != NULL, "sanity check"); + // this is a new callsite _outputer.diff_malloc_callsite(cur_malloc_callsite->addr(), amount_in_current_scale(cur_malloc_callsite->amount()), cur_malloc_callsite->count(), diff_in_current_scale(cur_malloc_callsite->amount(), 0), diff(cur_malloc_callsite->count(), 0)); cur_malloc_callsite = (MallocCallsitePointer*)cur_malloc_itr.next(); - } else if (prev_malloc_callsite == NULL || - cur_malloc_callsite->addr() > prev_malloc_callsite->addr()) { - _outputer.diff_malloc_callsite(cur_malloc_callsite->addr(), - amount_in_current_scale(prev_malloc_callsite->amount()), - prev_malloc_callsite->count(), + } else if (cur_malloc_callsite == NULL) { + assert(prev_malloc_callsite != NULL, "Sanity check"); + // this callsite is already gone + _outputer.diff_malloc_callsite(prev_malloc_callsite->addr(), + 0, 0, diff_in_current_scale(0, prev_malloc_callsite->amount()), diff(0, prev_malloc_callsite->count())); prev_malloc_callsite = (MallocCallsitePointer*)prev_malloc_itr.next(); - } else { // the same callsite - _outputer.diff_malloc_callsite(cur_malloc_callsite->addr(), - amount_in_current_scale(cur_malloc_callsite->amount()), - cur_malloc_callsite->count(), - diff_in_current_scale(cur_malloc_callsite->amount(), prev_malloc_callsite->amount()), - diff(cur_malloc_callsite->count(), prev_malloc_callsite->count())); - cur_malloc_callsite = (MallocCallsitePointer*)cur_malloc_itr.next(); - prev_malloc_callsite = (MallocCallsitePointer*)prev_malloc_itr.next(); + } else { + assert(cur_malloc_callsite != NULL, "Sanity check"); + assert(prev_malloc_callsite != NULL, "Sanity check"); + if (cur_malloc_callsite->addr() < prev_malloc_callsite->addr()) { + // this is a new callsite + _outputer.diff_malloc_callsite(cur_malloc_callsite->addr(), + amount_in_current_scale(cur_malloc_callsite->amount()), + cur_malloc_callsite->count(), + diff_in_current_scale(cur_malloc_callsite->amount(), 0), + diff(cur_malloc_callsite->count(), 0)); + cur_malloc_callsite = (MallocCallsitePointer*)cur_malloc_itr.next(); + } else if (cur_malloc_callsite->addr() > prev_malloc_callsite->addr()) { + // this callsite is already gone + _outputer.diff_malloc_callsite(prev_malloc_callsite->addr(), + 0, 0, + diff_in_current_scale(0, prev_malloc_callsite->amount()), + diff(0, prev_malloc_callsite->count())); + prev_malloc_callsite = (MallocCallsitePointer*)prev_malloc_itr.next(); + } else { + // the same callsite + _outputer.diff_malloc_callsite(cur_malloc_callsite->addr(), + amount_in_current_scale(cur_malloc_callsite->amount()), + cur_malloc_callsite->count(), + diff_in_current_scale(cur_malloc_callsite->amount(), prev_malloc_callsite->amount()), + diff(cur_malloc_callsite->count(), prev_malloc_callsite->count())); + cur_malloc_callsite = (MallocCallsitePointer*)cur_malloc_itr.next(); + prev_malloc_callsite = (MallocCallsitePointer*)prev_malloc_itr.next(); + } } } @@ -222,6 +243,7 @@ void BaselineReporter::diff_callsites(const MemBaseline& cur, const MemBaseline& VMCallsitePointer* prev_vm_callsite = (VMCallsitePointer*)prev_vm_itr.current(); while (cur_vm_callsite != NULL || prev_vm_callsite != NULL) { if (prev_vm_callsite == NULL || cur_vm_callsite->addr() < prev_vm_callsite->addr()) { + // this is a new callsite _outputer.diff_virtual_memory_callsite(cur_vm_callsite->addr(), amount_in_current_scale(cur_vm_callsite->reserved_amount()), amount_in_current_scale(cur_vm_callsite->committed_amount()), @@ -229,9 +251,10 @@ void BaselineReporter::diff_callsites(const MemBaseline& cur, const MemBaseline& diff_in_current_scale(cur_vm_callsite->committed_amount(), 0)); cur_vm_callsite = (VMCallsitePointer*)cur_vm_itr.next(); } else if (cur_vm_callsite == NULL || cur_vm_callsite->addr() > prev_vm_callsite->addr()) { + // this callsite is already gone _outputer.diff_virtual_memory_callsite(prev_vm_callsite->addr(), - amount_in_current_scale(prev_vm_callsite->reserved_amount()), - amount_in_current_scale(prev_vm_callsite->committed_amount()), + amount_in_current_scale(0), + amount_in_current_scale(0), diff_in_current_scale(0, prev_vm_callsite->reserved_amount()), diff_in_current_scale(0, prev_vm_callsite->committed_amount())); prev_vm_callsite = (VMCallsitePointer*)prev_vm_itr.next(); diff --git a/hotspot/src/share/vm/services/memTracker.cpp b/hotspot/src/share/vm/services/memTracker.cpp index 0e6f7c42e57..e0a1b29a8e9 100644 --- a/hotspot/src/share/vm/services/memTracker.cpp +++ b/hotspot/src/share/vm/services/memTracker.cpp @@ -69,6 +69,7 @@ int MemTracker::_thread_count = 255; volatile jint MemTracker::_pooled_recorder_count = 0; volatile unsigned long MemTracker::_processing_generation = 0; volatile bool MemTracker::_worker_thread_idle = false; +volatile jint MemTracker::_pending_op_count = 0; volatile bool MemTracker::_slowdown_calling_thread = false; debug_only(intx MemTracker::_main_thread_tid = 0;) NOT_PRODUCT(volatile jint MemTracker::_pending_recorder_count = 0;) @@ -337,92 +338,14 @@ void MemTracker::release_thread_recorder(MemRecorder* rec) { Atomic::inc(&_pooled_recorder_count); } -/* - * This is the most important method in whole nmt implementation. - * - * Create a memory record. - * 1. When nmt is in single-threaded bootstrapping mode, no lock is needed as VM - * still in single thread mode. - * 2. For all threads other than JavaThread, ThreadCritical is needed - * to write to recorders to global recorder. - * 3. For JavaThreads that are not longer visible by safepoint, also - * need to take ThreadCritical and records are written to global - * recorders, since these threads are NOT walked by Threads.do_thread(). - * 4. JavaThreads that are running in native state, have to transition - * to VM state before writing to per-thread recorders. - * 5. JavaThreads that are running in VM state do not need any lock and - * records are written to per-thread recorders. - * 6. For a thread has yet to attach VM 'Thread', they need to take - * ThreadCritical to write to global recorder. - * - * Important note: - * NO LOCK should be taken inside ThreadCritical lock !!! - */ -void MemTracker::create_memory_record(address addr, MEMFLAGS flags, - size_t size, address pc, Thread* thread) { - assert(addr != NULL, "Sanity check"); - if (!shutdown_in_progress()) { - // single thread, we just write records direct to global recorder,' - // with any lock - if (_state == NMT_bootstrapping_single_thread) { - assert(_main_thread_tid == os::current_thread_id(), "wrong thread"); - thread = NULL; - } else { - if (thread == NULL) { - // don't use Thread::current(), since it is possible that - // the calling thread has yet to attach to VM 'Thread', - // which will result assertion failure - thread = ThreadLocalStorage::thread(); - } - } - - if (thread != NULL) { - // slow down all calling threads except NMT worker thread, so it - // can catch up. - if (_slowdown_calling_thread && thread != _worker_thread) { - os::yield_all(); - } - - if (thread->is_Java_thread() && ((JavaThread*)thread)->is_safepoint_visible()) { - JavaThread* java_thread = (JavaThread*)thread; - JavaThreadState state = java_thread->thread_state(); - if (SafepointSynchronize::safepoint_safe(java_thread, state)) { - // JavaThreads that are safepoint safe, can run through safepoint, - // so ThreadCritical is needed to ensure no threads at safepoint create - // new records while the records are being gathered and the sequence number is changing - ThreadCritical tc; - create_record_in_recorder(addr, flags, size, pc, java_thread); - } else { - create_record_in_recorder(addr, flags, size, pc, java_thread); - } - } else { - // other threads, such as worker and watcher threads, etc. need to - // take ThreadCritical to write to global recorder - ThreadCritical tc; - create_record_in_recorder(addr, flags, size, pc, NULL); - } - } else { - if (_state == NMT_bootstrapping_single_thread) { - // single thread, no lock needed - create_record_in_recorder(addr, flags, size, pc, NULL); - } else { - // for thread has yet to attach VM 'Thread', we can not use VM mutex. - // use native thread critical instead - ThreadCritical tc; - create_record_in_recorder(addr, flags, size, pc, NULL); - } - } - } -} - // write a record to proper recorder. No lock can be taken from this method // down. -void MemTracker::create_record_in_recorder(address addr, MEMFLAGS flags, - size_t size, address pc, JavaThread* thread) { +void MemTracker::write_tracking_record(address addr, MEMFLAGS flags, + size_t size, jint seq, address pc, JavaThread* thread) { MemRecorder* rc = get_thread_recorder(thread); if (rc != NULL) { - rc->record(addr, flags, size, pc); + rc->record(addr, flags, size, seq, pc); } } @@ -487,39 +410,43 @@ void MemTracker::sync() { return; } } - _sync_point_skip_count = 0; { // This method is running at safepoint, with ThreadCritical lock, // it should guarantee that NMT is fully sync-ed. ThreadCritical tc; - SequenceGenerator::reset(); + // We can NOT execute NMT sync-point if there are pending tracking ops. + if (_pending_op_count == 0) { + SequenceGenerator::reset(); + _sync_point_skip_count = 0; - // walk all JavaThreads to collect recorders - SyncThreadRecorderClosure stc; - Threads::threads_do(&stc); + // walk all JavaThreads to collect recorders + SyncThreadRecorderClosure stc; + Threads::threads_do(&stc); - _thread_count = stc.get_thread_count(); - MemRecorder* pending_recorders = get_pending_recorders(); + _thread_count = stc.get_thread_count(); + MemRecorder* pending_recorders = get_pending_recorders(); - if (_global_recorder != NULL) { - _global_recorder->set_next(pending_recorders); - pending_recorders = _global_recorder; - _global_recorder = NULL; + if (_global_recorder != NULL) { + _global_recorder->set_next(pending_recorders); + pending_recorders = _global_recorder; + _global_recorder = NULL; + } + + // see if NMT has too many outstanding recorder instances, it usually + // means that worker thread is lagging behind in processing them. + if (!AutoShutdownNMT) { + _slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count); + } + + // check _worker_thread with lock to avoid racing condition + if (_worker_thread != NULL) { + _worker_thread->at_sync_point(pending_recorders, InstanceKlass::number_of_instance_classes()); + } + assert(SequenceGenerator::peek() == 1, "Should not have memory activities during sync-point"); + } else { + _sync_point_skip_count ++; } - - // see if NMT has too many outstanding recorder instances, it usually - // means that worker thread is lagging behind in processing them. - if (!AutoShutdownNMT) { - _slowdown_calling_thread = (MemRecorder::_instance_count > MAX_RECORDER_THREAD_RATIO * _thread_count); - } - - // check _worker_thread with lock to avoid racing condition - if (_worker_thread != NULL) { - _worker_thread->at_sync_point(pending_recorders, InstanceKlass::number_of_instance_classes()); - } - - assert(SequenceGenerator::peek() == 1, "Should not have memory activities during sync-point"); } } @@ -708,3 +635,243 @@ void MemTracker::print_tracker_stats(outputStream* st) { } #endif + +// Tracker Implementation + +/* + * Create a tracker. + * This is a fairly complicated constructor, as it has to make two important decisions: + * 1) Does it need to take ThreadCritical lock to write tracking record + * 2) Does it need to pre-reserve a sequence number for the tracking record + * + * The rules to determine if ThreadCritical is needed: + * 1. When nmt is in single-threaded bootstrapping mode, no lock is needed as VM + * still in single thread mode. + * 2. For all threads other than JavaThread, ThreadCritical is needed + * to write to recorders to global recorder. + * 3. For JavaThreads that are no longer visible by safepoint, also + * need to take ThreadCritical and records are written to global + * recorders, since these threads are NOT walked by Threads.do_thread(). + * 4. JavaThreads that are running in safepoint-safe states do not stop + * for safepoints, ThreadCritical lock should be taken to write + * memory records. + * 5. JavaThreads that are running in VM state do not need any lock and + * records are written to per-thread recorders. + * 6. For a thread has yet to attach VM 'Thread', they need to take + * ThreadCritical to write to global recorder. + * + * The memory operations that need pre-reserve sequence numbers: + * The memory operations that "release" memory blocks and the + * operations can fail, need to pre-reserve sequence number. They + * are realloc, uncommit and release. + * + * The reason for pre-reserve sequence number, is to prevent race condition: + * Thread 1 Thread 2 + * + * + * + * + * if Thread 2 happens to obtain the memory address Thread 1 just released, + * then NMT can mistakenly report the memory is free. + * + * Noticeably, free() does not need pre-reserve sequence number, because the call + * does not fail, so we can alway write "release" record before the memory is actaully + * freed. + * + * For realloc, uncommit and release, following coding pattern should be used: + * + * MemTracker::Tracker tkr = MemTracker::get_realloc_tracker(); + * ptr = ::realloc(...); + * if (ptr == NULL) { + * tkr.record(...) + * } else { + * tkr.discard(); + * } + * + * MemTracker::Tracker tkr = MemTracker::get_virtual_memory_uncommit_tracker(); + * if (uncommit(...)) { + * tkr.record(...); + * } else { + * tkr.discard(); + * } + * + * MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); + * if (release(...)) { + * tkr.record(...); + * } else { + * tkr.discard(); + * } + * + * Since pre-reserved sequence number is only good for the generation that it is acquired, + * when there is pending Tracker that reserved sequence number, NMT sync-point has + * to be skipped to prevent from advancing generation. This is done by inc and dec + * MemTracker::_pending_op_count, when MemTracker::_pending_op_count > 0, NMT sync-point is skipped. + * Not all pre-reservation of sequence number will increment pending op count. For JavaThreads + * that honor safepoints, safepoint can not occur during the memory operations, so the + * pre-reserved sequence number won't cross the generation boundry. + */ +MemTracker::Tracker::Tracker(MemoryOperation op, Thread* thr) { + _op = NoOp; + _seq = 0; + if (MemTracker::is_on()) { + _java_thread = NULL; + _op = op; + + // figure out if ThreadCritical lock is needed to write this operation + // to MemTracker + if (MemTracker::is_single_threaded_bootstrap()) { + thr = NULL; + } else if (thr == NULL) { + // don't use Thread::current(), since it is possible that + // the calling thread has yet to attach to VM 'Thread', + // which will result assertion failure + thr = ThreadLocalStorage::thread(); + } + + if (thr != NULL) { + // Check NMT load + MemTracker::check_NMT_load(thr); + + if (thr->is_Java_thread() && ((JavaThread*)thr)->is_safepoint_visible()) { + _java_thread = (JavaThread*)thr; + JavaThreadState state = _java_thread->thread_state(); + // JavaThreads that are safepoint safe, can run through safepoint, + // so ThreadCritical is needed to ensure no threads at safepoint create + // new records while the records are being gathered and the sequence number is changing + _need_thread_critical_lock = + SafepointSynchronize::safepoint_safe(_java_thread, state); + } else { + _need_thread_critical_lock = true; + } + } else { + _need_thread_critical_lock + = !MemTracker::is_single_threaded_bootstrap(); + } + + // see if we need to pre-reserve sequence number for this operation + if (_op == Realloc || _op == Uncommit || _op == Release) { + if (_need_thread_critical_lock) { + ThreadCritical tc; + MemTracker::inc_pending_op_count(); + _seq = SequenceGenerator::next(); + } else { + // for the threads that honor safepoints, no safepoint can occur + // during the lifespan of tracker, so we don't need to increase + // pending op count. + _seq = SequenceGenerator::next(); + } + } + } +} + +void MemTracker::Tracker::discard() { + if (MemTracker::is_on() && _seq != 0) { + if (_need_thread_critical_lock) { + ThreadCritical tc; + MemTracker::dec_pending_op_count(); + } + _seq = 0; + } +} + + +void MemTracker::Tracker::record(address old_addr, address new_addr, size_t size, + MEMFLAGS flags, address pc) { + assert(old_addr != NULL && new_addr != NULL, "Sanity check"); + assert(_op == Realloc || _op == NoOp, "Wrong call"); + if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp) { + assert(_seq > 0, "Need pre-reserve sequence number"); + if (_need_thread_critical_lock) { + ThreadCritical tc; + // free old address, use pre-reserved sequence number + MemTracker::write_tracking_record(old_addr, MemPointerRecord::free_tag(), + 0, _seq, pc, _java_thread); + MemTracker::write_tracking_record(new_addr, flags | MemPointerRecord::malloc_tag(), + size, SequenceGenerator::next(), pc, _java_thread); + // decrement MemTracker pending_op_count + MemTracker::dec_pending_op_count(); + } else { + // free old address, use pre-reserved sequence number + MemTracker::write_tracking_record(old_addr, MemPointerRecord::free_tag(), + 0, _seq, pc, _java_thread); + MemTracker::write_tracking_record(new_addr, flags | MemPointerRecord::malloc_tag(), + size, SequenceGenerator::next(), pc, _java_thread); + } + _seq = 0; + } +} + +void MemTracker::Tracker::record(address addr, size_t size, MEMFLAGS flags, address pc) { + // OOM already? + if (addr == NULL) return; + + if (MemTracker::is_on() && NMT_CAN_TRACK(flags) && _op != NoOp) { + bool pre_reserved_seq = (_seq != 0); + address pc = CALLER_CALLER_PC; + MEMFLAGS orig_flags = flags; + + // or the tagging flags + switch(_op) { + case Malloc: + flags |= MemPointerRecord::malloc_tag(); + break; + case Free: + flags = MemPointerRecord::free_tag(); + break; + case Realloc: + fatal("Use the other Tracker::record()"); + break; + case Reserve: + case ReserveAndCommit: + flags |= MemPointerRecord::virtual_memory_reserve_tag(); + break; + case Commit: + flags = MemPointerRecord::virtual_memory_commit_tag(); + break; + case Type: + flags |= MemPointerRecord::virtual_memory_type_tag(); + break; + case Uncommit: + assert(pre_reserved_seq, "Need pre-reserve sequence number"); + flags = MemPointerRecord::virtual_memory_uncommit_tag(); + break; + case Release: + assert(pre_reserved_seq, "Need pre-reserve sequence number"); + flags = MemPointerRecord::virtual_memory_release_tag(); + break; + case ArenaSize: + // a bit of hack here, add a small postive offset to arena + // address for its size record, so the size record is sorted + // right after arena record. + flags = MemPointerRecord::arena_size_tag(); + addr += sizeof(void*); + break; + case StackRelease: + flags = MemPointerRecord::virtual_memory_release_tag(); + break; + default: + ShouldNotReachHere(); + } + + // write memory tracking record + if (_need_thread_critical_lock) { + ThreadCritical tc; + if (_seq == 0) _seq = SequenceGenerator::next(); + MemTracker::write_tracking_record(addr, flags, size, _seq, pc, _java_thread); + if (_op == ReserveAndCommit) { + MemTracker::write_tracking_record(addr, orig_flags | MemPointerRecord::virtual_memory_commit_tag(), + size, SequenceGenerator::next(), pc, _java_thread); + } + if (pre_reserved_seq) MemTracker::dec_pending_op_count(); + } else { + if (_seq == 0) _seq = SequenceGenerator::next(); + MemTracker::write_tracking_record(addr, flags, size, _seq, pc, _java_thread); + if (_op == ReserveAndCommit) { + MemTracker::write_tracking_record(addr, orig_flags | MemPointerRecord::virtual_memory_commit_tag(), + size, SequenceGenerator::next(), pc, _java_thread); + } + } + _seq = 0; + } +} + diff --git a/hotspot/src/share/vm/services/memTracker.hpp b/hotspot/src/share/vm/services/memTracker.hpp index a7d06755288..dc7b78859d3 100644 --- a/hotspot/src/share/vm/services/memTracker.hpp +++ b/hotspot/src/share/vm/services/memTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,6 +54,18 @@ class MemTracker : AllStatic { NMT_sequence_overflow // overflow the sequence number }; + class Tracker { + public: + void discard() { } + + void record(address addr, size_t size = 0, MEMFLAGS flags = mtNone, address pc = NULL) { } + void record(address old_addr, address new_addr, size_t size, + MEMFLAGS flags, address pc = NULL) { } + }; + + private: + static Tracker _tkr; + public: static inline void init_tracking_options(const char* option_line) { } @@ -68,19 +80,18 @@ class MemTracker : AllStatic { static inline void record_malloc(address addr, size_t size, MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { } static inline void record_free(address addr, MEMFLAGS flags, Thread* thread = NULL) { } - static inline void record_realloc(address old_addr, address new_addr, size_t size, - MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { } static inline void record_arena_size(address addr, size_t size) { } static inline void record_virtual_memory_reserve(address addr, size_t size, - address pc = 0, Thread* thread = NULL) { } + MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { } + static inline void record_virtual_memory_reserve_and_commit(address addr, size_t size, + MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { } static inline void record_virtual_memory_commit(address addr, size_t size, address pc = 0, Thread* thread = NULL) { } - static inline void record_virtual_memory_uncommit(address addr, size_t size, - Thread* thread = NULL) { } - static inline void record_virtual_memory_release(address addr, size_t size, - Thread* thread = NULL) { } static inline void record_virtual_memory_type(address base, MEMFLAGS flags, Thread* thread = NULL) { } + static inline Tracker get_realloc_tracker() { return _tkr; } + static inline Tracker get_virtual_memory_uncommit_tracker() { return _tkr; } + static inline Tracker get_virtual_memory_release_tracker() { return _tkr; } static inline bool baseline() { return false; } static inline bool has_baseline() { return false; } @@ -164,6 +175,45 @@ class MemTracker : AllStatic { NMT_shutdown // shutdown }; + public: + class Tracker : public StackObj { + friend class MemTracker; + public: + enum MemoryOperation { + NoOp, // no op + Malloc, // malloc + Realloc, // realloc + Free, // free + Reserve, // virtual memory reserve + Commit, // virtual memory commit + ReserveAndCommit, // virtual memory reserve and commit + StackAlloc = ReserveAndCommit, // allocate thread stack + Type, // assign virtual memory type + Uncommit, // virtual memory uncommit + Release, // virtual memory release + ArenaSize, // set arena size + StackRelease // release thread stack + }; + + + protected: + Tracker(MemoryOperation op, Thread* thr = NULL); + + public: + void discard(); + + void record(address addr, size_t size = 0, MEMFLAGS flags = mtNone, address pc = NULL); + void record(address old_addr, address new_addr, size_t size, + MEMFLAGS flags, address pc = NULL); + + private: + bool _need_thread_critical_lock; + JavaThread* _java_thread; + MemoryOperation _op; // memory operation + jint _seq; // reserved sequence number + }; + + public: // native memory tracking level enum NMTLevel { @@ -276,109 +326,74 @@ class MemTracker : AllStatic { // record a 'malloc' call static inline void record_malloc(address addr, size_t size, MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { - if (is_on() && NMT_CAN_TRACK(flags)) { - assert(size > 0, "Sanity check"); - create_memory_record(addr, (flags|MemPointerRecord::malloc_tag()), size, pc, thread); - } + Tracker tkr(Tracker::Malloc, thread); + tkr.record(addr, size, flags, pc); } // record a 'free' call static inline void record_free(address addr, MEMFLAGS flags, Thread* thread = NULL) { - if (is_on() && NMT_CAN_TRACK(flags)) { - create_memory_record(addr, MemPointerRecord::free_tag(), 0, 0, thread); - } - } - // record a 'realloc' call - static inline void record_realloc(address old_addr, address new_addr, size_t size, - MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { - if (is_on() && NMT_CAN_TRACK(flags)) { - assert(size > 0, "Sanity check"); - record_free(old_addr, flags, thread); - record_malloc(new_addr, size, flags, pc, thread); - } + Tracker tkr(Tracker::Free, thread); + tkr.record(addr, 0, flags, DEBUG_CALLER_PC); } - // record arena memory size static inline void record_arena_size(address addr, size_t size) { - // we add a positive offset to arena address, so we can have arena memory record - // sorted after arena record - if (is_on() && !UseMallocOnly) { - assert(addr != NULL, "Sanity check"); - create_memory_record((addr + sizeof(void*)), MemPointerRecord::arena_size_tag(), size, - DEBUG_CALLER_PC, NULL); - } + Tracker tkr(Tracker::ArenaSize); + tkr.record(addr, size); } // record a virtual memory 'reserve' call static inline void record_virtual_memory_reserve(address addr, size_t size, - address pc = 0, Thread* thread = NULL) { - if (is_on()) { - assert(size > 0, "Sanity check"); - create_memory_record(addr, MemPointerRecord::virtual_memory_reserve_tag(), - size, pc, thread); - } + MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { + assert(size > 0, "Sanity check"); + Tracker tkr(Tracker::Reserve, thread); + tkr.record(addr, size, flags, pc); } static inline void record_thread_stack(address addr, size_t size, Thread* thr, address pc = 0) { - if (is_on()) { - assert(size > 0 && thr != NULL, "Sanity check"); - create_memory_record(addr, MemPointerRecord::virtual_memory_reserve_tag() | mtThreadStack, - size, pc, thr); - create_memory_record(addr, MemPointerRecord::virtual_memory_commit_tag() | mtThreadStack, - size, pc, thr); - } + Tracker tkr(Tracker::StackAlloc, thr); + tkr.record(addr, size, mtThreadStack, pc); } static inline void release_thread_stack(address addr, size_t size, Thread* thr) { - if (is_on()) { - assert(size > 0 && thr != NULL, "Sanity check"); - assert(!thr->is_Java_thread(), "too early"); - create_memory_record(addr, MemPointerRecord::virtual_memory_uncommit_tag() | mtThreadStack, - size, DEBUG_CALLER_PC, thr); - create_memory_record(addr, MemPointerRecord::virtual_memory_release_tag() | mtThreadStack, - size, DEBUG_CALLER_PC, thr); - } + Tracker tkr(Tracker::StackRelease, thr); + tkr.record(addr, size, mtThreadStack, DEBUG_CALLER_PC); } // record a virtual memory 'commit' call static inline void record_virtual_memory_commit(address addr, size_t size, address pc, Thread* thread = NULL) { - if (is_on()) { - assert(size > 0, "Sanity check"); - create_memory_record(addr, MemPointerRecord::virtual_memory_commit_tag(), - size, pc, thread); - } + Tracker tkr(Tracker::Commit, thread); + tkr.record(addr, size, mtNone, pc); } - // record a virtual memory 'uncommit' call - static inline void record_virtual_memory_uncommit(address addr, size_t size, - Thread* thread = NULL) { - if (is_on()) { - assert(size > 0, "Sanity check"); - create_memory_record(addr, MemPointerRecord::virtual_memory_uncommit_tag(), - size, DEBUG_CALLER_PC, thread); - } + static inline void record_virtual_memory_reserve_and_commit(address addr, size_t size, + MEMFLAGS flags, address pc, Thread* thread = NULL) { + Tracker tkr(Tracker::ReserveAndCommit, thread); + tkr.record(addr, size, flags, pc); } - // record a virtual memory 'release' call - static inline void record_virtual_memory_release(address addr, size_t size, - Thread* thread = NULL) { - if (is_on()) { - assert(size > 0, "Sanity check"); - create_memory_record(addr, MemPointerRecord::virtual_memory_release_tag(), - size, DEBUG_CALLER_PC, thread); - } - } // record memory type on virtual memory base address static inline void record_virtual_memory_type(address base, MEMFLAGS flags, Thread* thread = NULL) { - if (is_on()) { - assert(base > 0, "wrong base address"); - assert((flags & (~mt_masks)) == 0, "memory type only"); - create_memory_record(base, (flags | MemPointerRecord::virtual_memory_type_tag()), - 0, DEBUG_CALLER_PC, thread); - } + Tracker tkr(Tracker::Type); + tkr.record(base, 0, flags); + } + + // Get memory trackers for memory operations that can result race conditions. + // The memory tracker has to be obtained before realloc, virtual memory uncommit + // and virtual memory release, and call tracker.record() method if operation + // succeeded, or tracker.discard() to abort the tracking. + static inline Tracker get_realloc_tracker() { + return Tracker(Tracker::Realloc); + } + + static inline Tracker get_virtual_memory_uncommit_tracker() { + return Tracker(Tracker::Uncommit); + } + + static inline Tracker get_virtual_memory_release_tracker() { + return Tracker(Tracker::Release); } @@ -444,6 +459,31 @@ class MemTracker : AllStatic { static MemRecorder* get_pending_recorders(); static void delete_all_pending_recorders(); + // write a memory tracking record in recorder + static void write_tracking_record(address addr, MEMFLAGS type, + size_t size, jint seq, address pc, JavaThread* thread); + + static bool is_single_threaded_bootstrap() { + return _state == NMT_bootstrapping_single_thread; + } + + static void check_NMT_load(Thread* thr) { + assert(thr != NULL, "Sanity check"); + if (_slowdown_calling_thread && thr != _worker_thread) { + os::yield_all(); + } + } + + static void inc_pending_op_count() { + Atomic::inc(&_pending_op_count); + } + + static void dec_pending_op_count() { + Atomic::dec(&_pending_op_count); + assert(_pending_op_count >= 0, "Sanity check"); + } + + private: // retrieve a pooled memory record or create new one if there is not // one available @@ -522,6 +562,12 @@ class MemTracker : AllStatic { // if NMT should slow down calling thread to allow // worker thread to catch up static volatile bool _slowdown_calling_thread; + + // pending memory op count. + // Certain memory ops need to pre-reserve sequence number + // before memory operation can happen to avoid race condition. + // See MemTracker::Tracker for detail + static volatile jint _pending_op_count; }; #endif // !INCLUDE_NMT diff --git a/hotspot/src/share/vm/services/memoryManager.cpp b/hotspot/src/share/vm/services/memoryManager.cpp index 3996d2163c8..d5e54f5ff15 100644 --- a/hotspot/src/share/vm/services/memoryManager.cpp +++ b/hotspot/src/share/vm/services/memoryManager.cpp @@ -61,6 +61,10 @@ MemoryManager* MemoryManager::get_code_cache_memory_manager() { return (MemoryManager*) new CodeCacheMemoryManager(); } +MemoryManager* MemoryManager::get_metaspace_memory_manager() { + return (MemoryManager*) new MetaspaceMemoryManager(); +} + GCMemoryManager* MemoryManager::get_copy_memory_manager() { return (GCMemoryManager*) new CopyMemoryManager(); } diff --git a/hotspot/src/share/vm/services/memoryManager.hpp b/hotspot/src/share/vm/services/memoryManager.hpp index 370d830e977..99bd6d47d67 100644 --- a/hotspot/src/share/vm/services/memoryManager.hpp +++ b/hotspot/src/share/vm/services/memoryManager.hpp @@ -56,6 +56,7 @@ public: enum Name { Abstract, CodeCache, + Metaspace, Copy, MarkSweepCompact, ParNew, @@ -88,6 +89,7 @@ public: // Static factory methods to get a memory manager of a specific type static MemoryManager* get_code_cache_memory_manager(); + static MemoryManager* get_metaspace_memory_manager(); static GCMemoryManager* get_copy_memory_manager(); static GCMemoryManager* get_msc_memory_manager(); static GCMemoryManager* get_parnew_memory_manager(); @@ -108,6 +110,14 @@ public: const char* name() { return "CodeCacheManager"; } }; +class MetaspaceMemoryManager : public MemoryManager { +public: + MetaspaceMemoryManager() : MemoryManager() {} + + MemoryManager::Name kind() { return MemoryManager::Metaspace; } + const char *name() { return "Metaspace Manager"; } +}; + class GCStatInfo : public ResourceObj { private: size_t _index; diff --git a/hotspot/src/share/vm/services/memoryPool.cpp b/hotspot/src/share/vm/services/memoryPool.cpp index e2895b1f816..b28e14bb500 100644 --- a/hotspot/src/share/vm/services/memoryPool.cpp +++ b/hotspot/src/share/vm/services/memoryPool.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "memory/metaspace.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" @@ -33,6 +34,7 @@ #include "services/memoryManager.hpp" #include "services/memoryPool.hpp" #include "utilities/macros.hpp" +#include "utilities/globalDefinitions.hpp" MemoryPool::MemoryPool(const char* name, PoolType type, @@ -256,3 +258,39 @@ MemoryUsage CodeHeapPool::get_memory_usage() { return MemoryUsage(initial_size(), used, committed, maxSize); } + +MetaspacePool::MetaspacePool() : + MemoryPool("Metaspace", NonHeap, capacity_in_bytes(), calculate_max_size(), true, false) { } + +MemoryUsage MetaspacePool::get_memory_usage() { + size_t committed = align_size_down_(capacity_in_bytes(), os::vm_page_size()); + return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); +} + +size_t MetaspacePool::used_in_bytes() { + return MetaspaceAux::allocated_used_bytes(Metaspace::NonClassType); +} + +size_t MetaspacePool::capacity_in_bytes() const { + return MetaspaceAux::allocated_capacity_bytes(Metaspace::NonClassType); +} + +size_t MetaspacePool::calculate_max_size() const { + return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize : max_uintx; +} + +CompressedKlassSpacePool::CompressedKlassSpacePool() : + MemoryPool("Compressed Class Space", NonHeap, capacity_in_bytes(), ClassMetaspaceSize, true, false) { } + +size_t CompressedKlassSpacePool::used_in_bytes() { + return MetaspaceAux::allocated_used_bytes(Metaspace::ClassType); +} + +size_t CompressedKlassSpacePool::capacity_in_bytes() const { + return MetaspaceAux::allocated_capacity_bytes(Metaspace::ClassType); +} + +MemoryUsage CompressedKlassSpacePool::get_memory_usage() { + size_t committed = align_size_down_(capacity_in_bytes(), os::vm_page_size()); + return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); +} diff --git a/hotspot/src/share/vm/services/memoryPool.hpp b/hotspot/src/share/vm/services/memoryPool.hpp index 82606185340..08efe08e838 100644 --- a/hotspot/src/share/vm/services/memoryPool.hpp +++ b/hotspot/src/share/vm/services/memoryPool.hpp @@ -222,4 +222,21 @@ public: size_t used_in_bytes() { return _codeHeap->allocated_capacity(); } }; +class MetaspacePool : public MemoryPool { + size_t calculate_max_size() const; + size_t capacity_in_bytes() const; + public: + MetaspacePool(); + MemoryUsage get_memory_usage(); + size_t used_in_bytes(); +}; + +class CompressedKlassSpacePool : public MemoryPool { + size_t capacity_in_bytes() const; + public: + CompressedKlassSpacePool(); + MemoryUsage get_memory_usage(); + size_t used_in_bytes(); +}; + #endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 75693dbcf69..bf0fb9cad24 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -35,6 +35,7 @@ #include "memory/memRegion.hpp" #include "memory/tenuredGeneration.hpp" #include "oops/oop.inline.hpp" +#include "runtime/globals.hpp" #include "runtime/javaCalls.hpp" #include "services/classLoadingService.hpp" #include "services/lowMemoryDetector.hpp" @@ -60,9 +61,11 @@ GrowableArray* MemoryService::_pools_list = GrowableArray* MemoryService::_managers_list = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(init_managers_list_size, true); -GCMemoryManager* MemoryService::_minor_gc_manager = NULL; -GCMemoryManager* MemoryService::_major_gc_manager = NULL; -MemoryPool* MemoryService::_code_heap_pool = NULL; +GCMemoryManager* MemoryService::_minor_gc_manager = NULL; +GCMemoryManager* MemoryService::_major_gc_manager = NULL; +MemoryPool* MemoryService::_code_heap_pool = NULL; +MemoryPool* MemoryService::_metaspace_pool = NULL; +MemoryPool* MemoryService::_compressed_class_pool = NULL; class GcThreadCountClosure: public ThreadClosure { private: @@ -399,6 +402,22 @@ void MemoryService::add_code_heap_memory_pool(CodeHeap* heap) { _managers_list->append(mgr); } +void MemoryService::add_metaspace_memory_pools() { + MemoryManager* mgr = MemoryManager::get_metaspace_memory_manager(); + + _metaspace_pool = new MetaspacePool(); + mgr->add_pool(_metaspace_pool); + _pools_list->append(_metaspace_pool); + + if (UseCompressedKlassPointers) { + _compressed_class_pool = new CompressedKlassSpacePool(); + mgr->add_pool(_compressed_class_pool); + _pools_list->append(_compressed_class_pool); + } + + _managers_list->append(mgr); +} + MemoryManager* MemoryService::get_memory_manager(instanceHandle mh) { for (int i = 0; i < _managers_list->length(); i++) { MemoryManager* mgr = _managers_list->at(i); diff --git a/hotspot/src/share/vm/services/memoryService.hpp b/hotspot/src/share/vm/services/memoryService.hpp index 44cf62ea3cb..8ae6994bf44 100644 --- a/hotspot/src/share/vm/services/memoryService.hpp +++ b/hotspot/src/share/vm/services/memoryService.hpp @@ -73,6 +73,9 @@ private: // Code heap memory pool static MemoryPool* _code_heap_pool; + static MemoryPool* _metaspace_pool; + static MemoryPool* _compressed_class_pool; + static void add_generation_memory_pool(Generation* gen, MemoryManager* major_mgr, MemoryManager* minor_mgr); @@ -121,6 +124,7 @@ private: public: static void set_universe_heap(CollectedHeap* heap); static void add_code_heap_memory_pool(CodeHeap* heap); + static void add_metaspace_memory_pools(); static MemoryPool* get_memory_pool(instanceHandle pool); static MemoryManager* get_memory_manager(instanceHandle mgr); diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index 03289c7e9ac..222ae383cd1 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -327,27 +327,30 @@ DeadlockCycle* ThreadService::find_deadlocks_at_safepoint(bool concurrent_locks) while (waitingToLockMonitor != NULL || waitingToLockBlocker != NULL) { cycle->add_thread(currentThread); if (waitingToLockMonitor != NULL) { - currentThread = Threads::owning_thread_from_monitor_owner( - (address)waitingToLockMonitor->owner(), - false /* no locking needed */); - if (currentThread == NULL) { - // This function is called at a safepoint so the JavaThread - // that owns waitingToLockMonitor should be findable, but - // if it is not findable, then the previous currentThread is - // blocked permanently. We record this as a deadlock. - num_deadlocks++; + address currentOwner = (address)waitingToLockMonitor->owner(); + if (currentOwner != NULL) { + currentThread = Threads::owning_thread_from_monitor_owner( + currentOwner, + false /* no locking needed */); + if (currentThread == NULL) { + // This function is called at a safepoint so the JavaThread + // that owns waitingToLockMonitor should be findable, but + // if it is not findable, then the previous currentThread is + // blocked permanently. We record this as a deadlock. + num_deadlocks++; - cycle->set_deadlock(true); + cycle->set_deadlock(true); - // add this cycle to the deadlocks list - if (deadlocks == NULL) { - deadlocks = cycle; - } else { - last->set_next(cycle); + // add this cycle to the deadlocks list + if (deadlocks == NULL) { + deadlocks = cycle; + } else { + last->set_next(cycle); + } + last = cycle; + cycle = new DeadlockCycle(); + break; } - last = cycle; - cycle = new DeadlockCycle(); - break; } } else { if (concurrent_locks) { diff --git a/hotspot/src/share/vm/shark/sharkBuilder.cpp b/hotspot/src/share/vm/shark/sharkBuilder.cpp index f9c22bd1696..8e83dd18ec8 100644 --- a/hotspot/src/share/vm/shark/sharkBuilder.cpp +++ b/hotspot/src/share/vm/shark/sharkBuilder.cpp @@ -471,7 +471,7 @@ Value* SharkBuilder::CreateInlineOop(jobject object, const char* name) { Value* SharkBuilder::CreateInlineMetadata(Metadata* metadata, llvm::PointerType* type, const char* name) { assert(metadata != NULL, "inlined metadata must not be NULL"); - assert(metadata->is_metadata(), "sanity check"); + assert(metadata->is_metaspace_object(), "sanity check"); return CreateLoad( CreateIntToPtr( code_buffer_address(code_buffer()->inline_Metadata(metadata)), diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index c530bbc3c16..6b1d9a8850f 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -158,7 +158,7 @@ Declares a structure type that can be used in other events. - + @@ -203,7 +203,7 @@ Declares a structure type that can be used in other events. - + @@ -211,7 +211,7 @@ Declares a structure type that can be used in other events. - + @@ -240,14 +240,14 @@ Declares a structure type that can be used in other events. - + - + - + diff --git a/hotspot/src/share/vm/utilities/bitMap.cpp b/hotspot/src/share/vm/utilities/bitMap.cpp index 152b40d39c1..01825d30225 100644 --- a/hotspot/src/share/vm/utilities/bitMap.cpp +++ b/hotspot/src/share/vm/utilities/bitMap.cpp @@ -41,7 +41,7 @@ BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) : - _map(map), _size(size_in_bits) + _map(map), _size(size_in_bits), _map_allocator(false) { assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption."); assert(size_in_bits >= 0, "just checking"); @@ -49,7 +49,7 @@ BitMap::BitMap(bm_word_t* map, idx_t size_in_bits) : BitMap::BitMap(idx_t size_in_bits, bool in_resource_area) : - _map(NULL), _size(0) + _map(NULL), _size(0), _map_allocator(false) { assert(sizeof(bm_word_t) == BytesPerWord, "Implementation assumption."); resize(size_in_bits, in_resource_area); @@ -65,8 +65,10 @@ void BitMap::resize(idx_t size_in_bits, bool in_resource_area) { if (in_resource_area) { _map = NEW_RESOURCE_ARRAY(bm_word_t, new_size_in_words); } else { - if (old_map != NULL) FREE_C_HEAP_ARRAY(bm_word_t, _map, mtInternal); - _map = NEW_C_HEAP_ARRAY(bm_word_t, new_size_in_words, mtInternal); + if (old_map != NULL) { + _map_allocator.free(); + } + _map = _map_allocator.allocate(new_size_in_words); } Copy::disjoint_words((HeapWord*)old_map, (HeapWord*) _map, MIN2(old_size_in_words, new_size_in_words)); diff --git a/hotspot/src/share/vm/utilities/bitMap.hpp b/hotspot/src/share/vm/utilities/bitMap.hpp index 2486533ab86..c4cac118b33 100644 --- a/hotspot/src/share/vm/utilities/bitMap.hpp +++ b/hotspot/src/share/vm/utilities/bitMap.hpp @@ -48,6 +48,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC { } RangeSizeHint; private: + ArrayAllocator _map_allocator; bm_word_t* _map; // First word in bitmap idx_t _size; // Size of bitmap (in bits) @@ -113,7 +114,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC { public: // Constructs a bitmap with no map, and size 0. - BitMap() : _map(NULL), _size(0) {} + BitMap() : _map(NULL), _size(0), _map_allocator(false) {} // Constructs a bitmap with the given map and size. BitMap(bm_word_t* map, idx_t size_in_bits); diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 089cd3e0811..32c6f35d8a5 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -194,15 +194,15 @@ class Exceptions { #define HAS_PENDING_EXCEPTION (((ThreadShadow*)THREAD)->has_pending_exception()) #define CLEAR_PENDING_EXCEPTION (((ThreadShadow*)THREAD)->clear_pending_exception()) -#define CHECK THREAD); if (HAS_PENDING_EXCEPTION) return ; (0 -#define CHECK_(result) THREAD); if (HAS_PENDING_EXCEPTION) return result; (0 +#define CHECK THREAD); if (HAS_PENDING_EXCEPTION) return ; (void)(0 +#define CHECK_(result) THREAD); if (HAS_PENDING_EXCEPTION) return result; (void)(0 #define CHECK_0 CHECK_(0) #define CHECK_NH CHECK_(Handle()) #define CHECK_NULL CHECK_(NULL) #define CHECK_false CHECK_(false) -#define CHECK_AND_CLEAR THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return; } (0 -#define CHECK_AND_CLEAR_(result) THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (0 +#define CHECK_AND_CLEAR THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return; } (void)(0 +#define CHECK_AND_CLEAR_(result) THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (void)(0 #define CHECK_AND_CLEAR_0 CHECK_AND_CLEAR_(0) #define CHECK_AND_CLEAR_NH CHECK_AND_CLEAR_(Handle()) #define CHECK_AND_CLEAR_NULL CHECK_AND_CLEAR_(NULL) @@ -282,7 +282,7 @@ class Exceptions { CLEAR_PENDING_EXCEPTION; \ ex->print(); \ ShouldNotReachHere(); \ - } (0 + } (void)(0 // ExceptionMark is a stack-allocated helper class for local exception handling. // It is used with the EXCEPTION_MARK macro. diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp index 980b7e973e0..aea96c8581c 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -340,8 +340,12 @@ bool GenericTaskQueue::push_slow(E t, uint dirty_n_elems) { if (dirty_n_elems == N - 1) { // Actually means 0, so do the push. uint localBot = _bottom; - // g++ complains if the volatile result of the assignment is unused. - const_cast(_elems[localBot] = t); + // g++ complains if the volatile result of the assignment is + // unused, so we cast the volatile away. We cannot cast directly + // to void, because gcc treats that as not using the result of the + // assignment. However, casting to E& means that we trigger an + // unused-value warning. So, we cast the E& to void. + (void)const_cast(_elems[localBot] = t); OrderAccess::release_store(&_bottom, increment_index(localBot)); TASKQUEUE_STATS_ONLY(stats.record_push()); return true; @@ -397,7 +401,12 @@ bool GenericTaskQueue::pop_global(E& t) { return false; } - const_cast(t = _elems[oldAge.top()]); + // g++ complains if the volatile result of the assignment is + // unused, so we cast the volatile away. We cannot cast directly + // to void, because gcc treats that as not using the result of the + // assignment. However, casting to E& means that we trigger an + // unused-value warning. So, we cast the E& to void. + (void) const_cast(t = _elems[oldAge.top()]); Age newAge(oldAge); newAge.increment(); Age resAge = _age.cmpxchg(newAge, oldAge); @@ -640,8 +649,12 @@ GenericTaskQueue::push(E t) { uint dirty_n_elems = dirty_size(localBot, top); assert(dirty_n_elems < N, "n_elems out of range."); if (dirty_n_elems < max_elems()) { - // g++ complains if the volatile result of the assignment is unused. - const_cast(_elems[localBot] = t); + // g++ complains if the volatile result of the assignment is + // unused, so we cast the volatile away. We cannot cast directly + // to void, because gcc treats that as not using the result of the + // assignment. However, casting to E& means that we trigger an + // unused-value warning. So, we cast the E& to void. + (void) const_cast(_elems[localBot] = t); OrderAccess::release_store(&_bottom, increment_index(localBot)); TASKQUEUE_STATS_ONLY(stats.record_push()); return true; @@ -665,7 +678,12 @@ GenericTaskQueue::pop_local(E& t) { // This is necessary to prevent any read below from being reordered // before the store just above. OrderAccess::fence(); - const_cast(t = _elems[localBot]); + // g++ complains if the volatile result of the assignment is + // unused, so we cast the volatile away. We cannot cast directly + // to void, because gcc treats that as not using the result of the + // assignment. However, casting to E& means that we trigger an + // unused-value warning. So, we cast the E& to void. + (void) const_cast(t = _elems[localBot]); // This is a second read of "age"; the "size()" above is the first. // If there's still at least one element in the queue, based on the // "_bottom" and "age" we've read, then there can be no interference with diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index f7b940b52e7..64f753bc75c 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -799,6 +799,14 @@ void VMError::report(outputStream* st) { VMError* volatile VMError::first_error = NULL; volatile jlong VMError::first_error_tid = -1; +// An error could happen before tty is initialized or after it has been +// destroyed. Here we use a very simple unbuffered fdStream for printing. +// Only out.print_raw() and out.print_raw_cr() should be used, as other +// printing methods need to allocate large buffer on stack. To format a +// string, use jio_snprintf() with a static buffer or use staticBufferStream. +fdStream VMError::out(defaultStream::output_fd()); +fdStream VMError::log; // error log used by VMError::report_and_die() + /** Expand a pattern into a buffer starting at pos and open a file using constructed path */ static int expand_and_open(const char* pattern, char* buf, size_t buflen, size_t pos) { int fd = -1; @@ -853,13 +861,6 @@ void VMError::report_and_die() { // Don't allocate large buffer on stack static char buffer[O_BUFLEN]; - // An error could happen before tty is initialized or after it has been - // destroyed. Here we use a very simple unbuffered fdStream for printing. - // Only out.print_raw() and out.print_raw_cr() should be used, as other - // printing methods need to allocate large buffer on stack. To format a - // string, use jio_snprintf() with a static buffer or use staticBufferStream. - static fdStream out(defaultStream::output_fd()); - // How many errors occurred in error handler when reporting first_error. static int recursive_error_count; @@ -868,7 +869,6 @@ void VMError::report_and_die() { static bool out_done = false; // done printing to standard out static bool log_done = false; // done saving error log static bool transmit_report_done = false; // done error reporting - static fdStream log; // error log // disble NMT to avoid further exception MemTracker::shutdown(MemTracker::NMT_error_reporting); diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index f298c1edbf5..1b1608bdc90 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,6 +96,9 @@ class VMError : public StackObj { return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); } + static fdStream out; + static fdStream log; // error log used by VMError::report_and_die() + public: // Constructor for crashes diff --git a/hotspot/test/compiler/7088419/CRCTest.java b/hotspot/test/compiler/7088419/CRCTest.java new file mode 100644 index 00000000000..fa1f520cca8 --- /dev/null +++ b/hotspot/test/compiler/7088419/CRCTest.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7088419 + @run main CRCTest + @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32 + */ + +import java.nio.ByteBuffer; +import java.util.zip.CRC32; +import java.util.zip.Checksum; + +public class CRCTest { + + public static void main(String[] args) throws Exception { + + byte[] b = initializedBytes(4096 * 4096); + + { + CRC32 crc1 = new CRC32(); + CRC32 crc2 = new CRC32(); + CRC32 crc3 = new CRC32(); + CRC32 crc4 = new CRC32(); + + crc1.update(b, 0, b.length); + updateSerial(crc2, b, 0, b.length); + updateDirect(crc3, b, 0, b.length); + updateSerialSlow(crc4, b, 0, b.length); + + check(crc1, crc2); + check(crc3, crc4); + check(crc1, crc3); + + crc1.update(17); + crc2.update(17); + crc3.update(17); + crc4.update(17); + + crc1.update(b, 1, b.length-2); + updateSerial(crc2, b, 1, b.length-2); + updateDirect(crc3, b, 1, b.length-2); + updateSerialSlow(crc4, b, 1, b.length-2); + + check(crc1, crc2); + check(crc3, crc4); + check(crc1, crc3); + + report("finished huge crc", crc1, crc2, crc3, crc4); + + for (int i = 0; i < 256; i++) { + for (int j = 0; j < 256; j += 1) { + crc1.update(b, i, j); + updateSerial(crc2, b, i, j); + updateDirect(crc3, b, i, j); + updateSerialSlow(crc4, b, i, j); + + check(crc1, crc2); + check(crc3, crc4); + check(crc1, crc3); + + } + } + + report("finished small survey crc", crc1, crc2, crc3, crc4); + } + + } + + private static void report(String s, Checksum crc1, Checksum crc2, + Checksum crc3, Checksum crc4) { + System.out.println(s + ", crc1 = " + crc1.getValue() + + ", crc2 = " + crc2.getValue()+ + ", crc3 = " + crc3.getValue()+ + ", crc4 = " + crc4.getValue()); + } + + private static void check(Checksum crc1, Checksum crc2) throws Exception { + if (crc1.getValue() != crc2.getValue()) { + String s = "value 1 = " + crc1.getValue() + ", value 2 = " + crc2.getValue(); + System.err.println(s); + throw new Exception(s); + } + } + + private static byte[] initializedBytes(int M) { + byte[] bytes = new byte[M]; + for (int i = 0; i < bytes.length; i++) { + bytes[i] = (byte) i; + } + return bytes; + } + + private static void updateSerial(Checksum crc, byte[] b, int start, int length) { + for (int i = 0; i < length; i++) + crc.update(b[i+start]); + } + + private static void updateSerialSlow(Checksum crc, byte[] b, int start, int length) { + for (int i = 0; i < length; i++) + crc.update(b[i+start]); + crc.getValue(); + } + + private static void updateDirect(CRC32 crc3, byte[] b, int start, int length) { + ByteBuffer buf = ByteBuffer.allocateDirect(length); + buf.put(b, start, length); + buf.flip(); + crc3.update(buf); + } +} diff --git a/hotspot/test/compiler/8005956/PolynomialRoot.java b/hotspot/test/compiler/8005956/PolynomialRoot.java new file mode 100644 index 00000000000..ce896ae651e --- /dev/null +++ b/hotspot/test/compiler/8005956/PolynomialRoot.java @@ -0,0 +1,776 @@ +//package com.polytechnik.utils; +/* + * (C) Vladislav Malyshkin 2010 + * This file is under GPL version 3. + * + */ + +/** Polynomial root. + * @version $Id: PolynomialRoot.java,v 1.105 2012/08/18 00:00:05 mal Exp $ + * @author Vladislav Malyshkin mal@gromco.com + */ + +/** +* @test +* @bug 8005956 +* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block +* +* @run main PolynomialRoot +*/ + +public class PolynomialRoot { + + +public static int findPolynomialRoots(final int n, + final double [] p, + final double [] re_root, + final double [] im_root) +{ + if(n==4) + { + return root4(p,re_root,im_root); + } + else if(n==3) + { + return root3(p,re_root,im_root); + } + else if(n==2) + { + return root2(p,re_root,im_root); + } + else if(n==1) + { + return root1(p,re_root,im_root); + } + else + { + throw new RuntimeException("n="+n+" is not supported yet"); + } +} + + + +static final double SQRT3=Math.sqrt(3.0),SQRT2=Math.sqrt(2.0); + + +private static final boolean PRINT_DEBUG=false; + +public static int root4(final double [] p,final double [] re_root,final double [] im_root) +{ + if(PRINT_DEBUG) System.err.println("=====================root4:p="+java.util.Arrays.toString(p)); + final double vs=p[4]; + if(PRINT_DEBUG) System.err.println("p[4]="+p[4]); + if(!(Math.abs(vs)>EPS)) + { + re_root[0]=re_root[1]=re_root[2]=re_root[3]= + im_root[0]=im_root[1]=im_root[2]=im_root[3]=Double.NaN; + return -1; + } + +/* zsolve_quartic.c - finds the complex roots of + * x^4 + a x^3 + b x^2 + c x + d = 0 + */ + final double a=p[3]/vs,b=p[2]/vs,c=p[1]/vs,d=p[0]/vs; + if(PRINT_DEBUG) System.err.println("input a="+a+" b="+b+" c="+c+" d="+d); + + + final double r4 = 1.0 / 4.0; + final double q2 = 1.0 / 2.0, q4 = 1.0 / 4.0, q8 = 1.0 / 8.0; + final double q1 = 3.0 / 8.0, q3 = 3.0 / 16.0; + final int mt; + + /* Deal easily with the cases where the quartic is degenerate. The + * ordering of solutions is done explicitly. */ + if (0 == b && 0 == c) + { + if (0 == d) + { + re_root[0]=-a; + im_root[0]=im_root[1]=im_root[2]=im_root[3]=0; + re_root[1]=re_root[2]=re_root[3]=0; + return 4; + } + else if (0 == a) + { + if (d > 0) + { + final double sq4 = Math.sqrt(Math.sqrt(d)); + re_root[0]=sq4*SQRT2/2; + im_root[0]=re_root[0]; + re_root[1]=-re_root[0]; + im_root[1]=re_root[0]; + re_root[2]=-re_root[0]; + im_root[2]=-re_root[0]; + re_root[3]=re_root[0]; + im_root[3]=-re_root[0]; + if(PRINT_DEBUG) System.err.println("Path a=0 d>0"); + } + else + { + final double sq4 = Math.sqrt(Math.sqrt(-d)); + re_root[0]=sq4; + im_root[0]=0; + re_root[1]=0; + im_root[1]=sq4; + re_root[2]=0; + im_root[2]=-sq4; + re_root[3]=-sq4; + im_root[3]=0; + if(PRINT_DEBUG) System.err.println("Path a=0 d<0"); + } + return 4; + } + } + + if (0.0 == c && 0.0 == d) + { + root2(new double []{p[2],p[3],p[4]},re_root,im_root); + re_root[2]=im_root[2]=re_root[3]=im_root[3]=0; + return 4; + } + + if(PRINT_DEBUG) System.err.println("G Path c="+c+" d="+d); + final double [] u=new double[3]; + + if(PRINT_DEBUG) System.err.println("Generic Path"); + /* For non-degenerate solutions, proceed by constructing and + * solving the resolvent cubic */ + final double aa = a * a; + final double pp = b - q1 * aa; + final double qq = c - q2 * a * (b - q4 * aa); + final double rr = d - q4 * a * (c - q4 * a * (b - q3 * aa)); + final double rc = q2 * pp , rc3 = rc / 3; + final double sc = q4 * (q4 * pp * pp - rr); + final double tc = -(q8 * qq * q8 * qq); + if(PRINT_DEBUG) System.err.println("aa="+aa+" pp="+pp+" qq="+qq+" rr="+rr+" rc="+rc+" sc="+sc+" tc="+tc); + final boolean flag_realroots; + + /* This code solves the resolvent cubic in a convenient fashion + * for this implementation of the quartic. If there are three real + * roots, then they are placed directly into u[]. If two are + * complex, then the real root is put into u[0] and the real + * and imaginary part of the complex roots are placed into + * u[1] and u[2], respectively. */ + { + final double qcub = (rc * rc - 3 * sc); + final double rcub = (rc*(2 * rc * rc - 9 * sc) + 27 * tc); + + final double Q = qcub / 9; + final double R = rcub / 54; + + final double Q3 = Q * Q * Q; + final double R2 = R * R; + + final double CR2 = 729 * rcub * rcub; + final double CQ3 = 2916 * qcub * qcub * qcub; + + if(PRINT_DEBUG) System.err.println("CR2="+CR2+" CQ3="+CQ3+" R="+R+" Q="+Q); + + if (0 == R && 0 == Q) + { + flag_realroots=true; + u[0] = -rc3; + u[1] = -rc3; + u[2] = -rc3; + } + else if (CR2 == CQ3) + { + flag_realroots=true; + final double sqrtQ = Math.sqrt (Q); + if (R > 0) + { + u[0] = -2 * sqrtQ - rc3; + u[1] = sqrtQ - rc3; + u[2] = sqrtQ - rc3; + } + else + { + u[0] = -sqrtQ - rc3; + u[1] = -sqrtQ - rc3; + u[2] = 2 * sqrtQ - rc3; + } + } + else if (R2 < Q3) + { + flag_realroots=true; + final double ratio = (R >= 0?1:-1) * Math.sqrt (R2 / Q3); + final double theta = Math.acos (ratio); + final double norm = -2 * Math.sqrt (Q); + + u[0] = norm * Math.cos (theta / 3) - rc3; + u[1] = norm * Math.cos ((theta + 2.0 * Math.PI) / 3) - rc3; + u[2] = norm * Math.cos ((theta - 2.0 * Math.PI) / 3) - rc3; + } + else + { + flag_realroots=false; + final double A = -(R >= 0?1:-1)*Math.pow(Math.abs(R)+Math.sqrt(R2-Q3),1.0/3.0); + final double B = Q / A; + + u[0] = A + B - rc3; + u[1] = -0.5 * (A + B) - rc3; + u[2] = -(SQRT3*0.5) * Math.abs (A - B); + } + if(PRINT_DEBUG) System.err.println("u[0]="+u[0]+" u[1]="+u[1]+" u[2]="+u[2]+" qq="+qq+" disc="+((CR2 - CQ3) / 2125764.0)); + } + /* End of solution to resolvent cubic */ + + /* Combine the square roots of the roots of the cubic + * resolvent appropriately. Also, calculate 'mt' which + * designates the nature of the roots: + * mt=1 : 4 real roots + * mt=2 : 0 real roots + * mt=3 : 2 real roots + */ + + + final double w1_re,w1_im,w2_re,w2_im,w3_re,w3_im,mod_w1w2,mod_w1w2_squared; + if (flag_realroots) + { + mod_w1w2=-1; + mt = 2; + int jmin=0; + double vmin=Math.abs(u[jmin]); + for(int j=1;j<3;j++) + { + final double vx=Math.abs(u[j]); + if(vx=0) + { + w1_re=Math.sqrt(u1); + w1_im=0; + } + else + { + w1_re=0; + w1_im=Math.sqrt(-u1); + } + if(u2>=0) + { + w2_re=Math.sqrt(u2); + w2_im=0; + } + else + { + w2_re=0; + w2_im=Math.sqrt(-u2); + } + if(PRINT_DEBUG) System.err.println("u1="+u1+" u2="+u2+" jmin="+jmin); + } + else + { + mt = 3; + final double w_mod2_sq=u[1]*u[1]+u[2]*u[2],w_mod2=Math.sqrt(w_mod2_sq),w_mod=Math.sqrt(w_mod2); + if(w_mod2_sq<=0) + { + w1_re=w1_im=0; + } + else + { + // calculate square root of a complex number (u[1],u[2]) + // the result is in the (w1_re,w1_im) + final double absu1=Math.abs(u[1]),absu2=Math.abs(u[2]),w; + if(absu1>=absu2) + { + final double t=absu2/absu1; + w=Math.sqrt(absu1*0.5 * (1.0 + Math.sqrt(1.0 + t * t))); + if(PRINT_DEBUG) System.err.println(" Path1 "); + } + else + { + final double t=absu1/absu2; + w=Math.sqrt(absu2*0.5 * (t + Math.sqrt(1.0 + t * t))); + if(PRINT_DEBUG) System.err.println(" Path1a "); + } + if(u[1]>=0) + { + w1_re=w; + w1_im=u[2]/(2*w); + if(PRINT_DEBUG) System.err.println(" Path2 "); + } + else + { + final double vi = (u[2] >= 0) ? w : -w; + w1_re=u[2]/(2*vi); + w1_im=vi; + if(PRINT_DEBUG) System.err.println(" Path2a "); + } + } + final double absu0=Math.abs(u[0]); + if(w_mod2>=absu0) + { + mod_w1w2=w_mod2; + mod_w1w2_squared=w_mod2_sq; + w2_re=w1_re; + w2_im=-w1_im; + } + else + { + mod_w1w2=-1; + mod_w1w2_squared=w_mod2*absu0; + if(u[0]>=0) + { + w2_re=Math.sqrt(absu0); + w2_im=0; + } + else + { + w2_re=0; + w2_im=Math.sqrt(absu0); + } + } + if(PRINT_DEBUG) System.err.println("u[0]="+u[0]+"u[1]="+u[1]+" u[2]="+u[2]+" absu0="+absu0+" w_mod="+w_mod+" w_mod2="+w_mod2); + } + + /* Solve the quadratic in order to obtain the roots + * to the quartic */ + if(mod_w1w2>0) + { + // a shorcut to reduce rounding error + w3_re=qq/(-8)/mod_w1w2; + w3_im=0; + } + else if(mod_w1w2_squared>0) + { + // regular path + final double mqq8n=qq/(-8)/mod_w1w2_squared; + w3_re=mqq8n*(w1_re*w2_re-w1_im*w2_im); + w3_im=-mqq8n*(w1_re*w2_im+w2_re*w1_im); + } + else + { + // typically occur when qq==0 + w3_re=w3_im=0; + } + + final double h = r4 * a; + if(PRINT_DEBUG) System.err.println("w1_re="+w1_re+" w1_im="+w1_im+" w2_re="+w2_re+" w2_im="+w2_im+" w3_re="+w3_re+" w3_im="+w3_im+" h="+h); + + re_root[0]=w1_re+w2_re+w3_re-h; + im_root[0]=w1_im+w2_im+w3_im; + re_root[1]=-(w1_re+w2_re)+w3_re-h; + im_root[1]=-(w1_im+w2_im)+w3_im; + re_root[2]=w2_re-w1_re-w3_re-h; + im_root[2]=w2_im-w1_im-w3_im; + re_root[3]=w1_re-w2_re-w3_re-h; + im_root[3]=w1_im-w2_im-w3_im; + + return 4; +} + + + + static void setRandomP(final double [] p,final int n,java.util.Random r) + { + if(r.nextDouble()<0.1) + { + // integer coefficiens + for(int j=0;j=0;k--) + { + final double res1=(res*rex-ims*imx)+p[k]; + final double ims1=(ims*rex+res*imx); + res=res1; + ims=ims1; + sabs+=xabs*sabs+p[k]; + } + sabs=Math.abs(sabs); + if(false && sabs>1/eps? + (!(Math.abs(res/sabs)<=eps)||!(Math.abs(ims/sabs)<=eps)) + : + (!(Math.abs(res)<=eps)||!(Math.abs(ims)<=eps))) + { + throw new RuntimeException( + getPolinomTXT(p)+"\n"+ + "\t x.r="+rex+" x.i="+imx+"\n"+ + "res/sabs="+(res/sabs)+" ims/sabs="+(ims/sabs)+ + " sabs="+sabs+ + "\nres="+res+" ims="+ims+" n="+n+" eps="+eps+" "+ + " sabs>1/eps="+(sabs>1/eps)+ + " f1="+(!(Math.abs(res/sabs)<=eps)||!(Math.abs(ims/sabs)<=eps))+ + " f2="+(!(Math.abs(res)<=eps)||!(Math.abs(ims)<=eps))+ + " "+txt); + } + } + + static String getPolinomTXT(final double [] p) + { + final StringBuilder buf=new StringBuilder(); + buf.append("order="+(p.length-1)+"\t"); + for(int k=0;k-1;) + { + for(int dr=3;dr-->0;) + { + setRandomP(p,n,rn); + for(int j=0;j<=dg;j++) + { + p[j]=0; + } + if(dr==0) + { + p[0]=-1+2.0*rn.nextDouble(); + } + else if(dr==1) + { + p[0]=p[1]=0; + } + + findPolynomialRoots(n,p,rex,imx); + + for(int j=0;j'?"); + if (outputWithError.getExitValue() == 0) { + throw new RuntimeException("Not expected to get exit value 0"); + } + + // The last JAVA process should run successfully for the purpose of sanity check + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+PrintGC", + "-version" + ); + OutputAnalyzer outputWithNoError = new OutputAnalyzer(pb.start()); + outputWithNoError.shouldNotContain("Did you mean '(+/-)PrintGC'?"); + outputWithNoError.shouldHaveExitValue(0); + } +} + diff --git a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java new file mode 100644 index 00000000000..440f91cbd85 --- /dev/null +++ b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.List; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryManagerMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; + +import java.lang.management.RuntimeMXBean; +import java.lang.management.ManagementFactory; + +/* @test TestMetaspaceMemoryPool + * @bug 8000754 + * @summary Tests that a MemoryPoolMXBeans is created for metaspace and that a + * MemoryManagerMXBean is created. + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:MaxMetaspaceSize=60m TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers TestMetaspaceMemoryPool + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:ClassMetaspaceSize=60m TestMetaspaceMemoryPool + */ +public class TestMetaspaceMemoryPool { + public static void main(String[] args) { + verifyThatMetaspaceMemoryManagerExists(); + verifyMemoryPool(getMemoryPool("Metaspace"), isFlagDefined("MaxMetaspaceSize")); + + if (runsOn64bit()) { + if (usesCompressedOops()) { + MemoryPoolMXBean cksPool = getMemoryPool("Compressed Class Space"); + verifyMemoryPool(cksPool, true); + } + } + } + + private static boolean runsOn64bit() { + return !System.getProperty("sun.arch.data.model").equals("32"); + } + + private static boolean usesCompressedOops() { + return isFlagDefined("+UseCompressedOops"); + } + + private static boolean isFlagDefined(String name) { + RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); + List args = runtimeMxBean.getInputArguments(); + for (String arg : args) { + if (arg.startsWith("-XX:" + name)) { + return true; + } + } + return false; + } + + private static void verifyThatMetaspaceMemoryManagerExists() { + List managers = ManagementFactory.getMemoryManagerMXBeans(); + for (MemoryManagerMXBean manager : managers) { + if (manager.getName().equals("Metaspace Manager")) { + return; + } + } + + throw new RuntimeException("Expected to find a metaspace memory manager"); + } + + private static MemoryPoolMXBean getMemoryPool(String name) { + List pools = ManagementFactory.getMemoryPoolMXBeans(); + for (MemoryPoolMXBean pool : pools) { + if (pool.getName().equals(name)) { + return pool; + } + } + + throw new RuntimeException("Expected to find a memory pool with name " + name); + } + + private static void verifyMemoryPool(MemoryPoolMXBean pool, boolean isMaxDefined) { + MemoryUsage mu = pool.getUsage(); + assertDefined(mu.getInit(), "init"); + assertDefined(mu.getUsed(), "used"); + assertDefined(mu.getCommitted(), "committed"); + + if (isMaxDefined) { + assertDefined(mu.getMax(), "max"); + } else { + assertUndefined(mu.getMax(), "max"); + } + } + + private static void assertDefined(long value, String name) { + assertTrue(value != -1, "Expected " + name + " to be defined"); + } + + private static void assertUndefined(long value, String name) { + assertEquals(value, -1, "Expected " + name + " to be undefined"); + } + + private static void assertEquals(long actual, long expected, String msg) { + assertTrue(actual == expected, msg); + } + + private static void assertTrue(boolean condition, String msg) { + if (!condition) { + throw new RuntimeException(msg); + } + } +} diff --git a/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java b/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java new file mode 100644 index 00000000000..57125599649 --- /dev/null +++ b/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 AdaptiveGCBoundary + * @summary UseAdaptiveGCBoundary is broken + * @bug 8014546 + * @key gc + * @key regression + * @library /testlibrary + * @run main/othervm AdaptiveGCBoundary + * @author jon.masamitsu@oracle.com + */ + +import com.oracle.java.testlibrary.*; + +public class AdaptiveGCBoundary { + public static void main(String args[]) throws Exception { + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-showversion", + "-XX:+UseParallelGC", + "-XX:+UseAdaptiveGCBoundary", + "-XX:+PrintCommandLineFlags", + SystemGCCaller.class.getName() + ); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldContain("+UseAdaptiveGCBoundary"); + + output.shouldNotContain("error"); + + output.shouldHaveExitValue(0); + } + static class SystemGCCaller { + public static void main(String [] args) { + System.gc(); + } + } +} diff --git a/hotspot/test/runtime/7196045/Test7196045.java b/hotspot/test/runtime/7196045/Test7196045.java index 59704f72590..4c6fcc8c072 100644 --- a/hotspot/test/runtime/7196045/Test7196045.java +++ b/hotspot/test/runtime/7196045/Test7196045.java @@ -26,7 +26,7 @@ * @test * @bug 7196045 * @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API. - * @run main/othervm Test7196045 + * @run main/othervm -XX:+UsePerfData Test7196045 */ import java.lang.management.ManagementFactory; diff --git a/hotspot/test/runtime/8001071/Test8001071.java b/hotspot/test/runtime/8001071/Test8001071.java new file mode 100644 index 00000000000..df03e197de8 --- /dev/null +++ b/hotspot/test/runtime/8001071/Test8001071.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 sun.misc.Unsafe; +import java.lang.reflect.Field; + +@SuppressWarnings("sunapi") +public class Test8001071 { + public static Unsafe unsafe; + + static { + try { + Field f = Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + unsafe = (Unsafe) f.get(null); + } catch ( Exception e ) { + e.printStackTrace(); + } + } + + public static void main(String args[]) { + unsafe.getObject(new Test8001071(), Short.MAX_VALUE); + } + +} diff --git a/hotspot/test/runtime/8001071/Test8001071.sh b/hotspot/test/runtime/8001071/Test8001071.sh new file mode 100644 index 00000000000..79ba2fe503d --- /dev/null +++ b/hotspot/test/runtime/8001071/Test8001071.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. + +# 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 8001071 +## @summary Add simple range check into VM implemenation of Unsafe access methods +## @compile Test8001071.java +## @run shell Test8001071.sh +## @author filipp.zhinkin@oracle.com + +VERSION=`${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1` + +if [ -n "`echo $VERSION | grep debug`" -o -n "`echo $VERSION | grep jvmg`" ]; then + echo "Build type check passed" + echo "Continue testing" +else + echo "Fastdebug build is required for this test" + exit 0 +fi + +${TESTJAVA}/bin/java -cp ${TESTCLASSES} ${TESTVMOPTS} Test8001071 2>&1 + +HS_ERR_FILE=hs_err_pid*.log + +if [ ! -f $HS_ERR_FILE ] +then + echo "hs_err_pid log file was not found" + echo "Test failed" + exit 1 +fi + +grep "assert(byte_offset < p_size) failed: Unsafe access: offset.*> object's size.*" $HS_ERR_FILE + +if [ "0" = "$?" ]; +then + echo "Range check assertion failed as expected" + echo "Test passed" + exit 0 +else + echo "Range check assertion was not failed" + echo "Test failed" + exit 1 +fi diff --git a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java new file mode 100644 index 00000000000..1f1894419ab --- /dev/null +++ b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7167142 + * @summary Warn if unused .hotspot_compiler file is present + * @library /testlibrary + */ + +import java.io.PrintWriter; +import com.oracle.java.testlibrary.*; + +public class CompilerConfigFileWarning { + public static void main(String[] args) throws Exception { + String vmVersion = System.getProperty("java.vm.version"); + if (vmVersion.toLowerCase().contains("debug") || vmVersion.toLowerCase().contains("jvmg")) { + System.out.println("Skip on debug builds since we'll always read the file there"); + return; + } + + PrintWriter pw = new PrintWriter(".hotspot_compiler"); + pw.println("aa"); + pw.close(); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("warning: .hotspot_compiler file is present but has been ignored. Run with -XX:CompileCommandFile=.hotspot_compiler to load the file."); + } +} diff --git a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java new file mode 100644 index 00000000000..470808eaff3 --- /dev/null +++ b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7167142 + * @summary Warn if unused .hotspot_rc file is present + * @library /testlibrary + */ + +import java.io.PrintWriter; +import com.oracle.java.testlibrary.*; + +public class ConfigFileWarning { + public static void main(String[] args) throws Exception { + String vmVersion = System.getProperty("java.vm.version"); + if (vmVersion.toLowerCase().contains("debug") || vmVersion.toLowerCase().contains("jvmg")) { + System.out.println("Skip on debug builds since we'll always read the file there"); + return; + } + + PrintWriter pw = new PrintWriter(".hotspotrc"); + pw.println("aa"); + pw.close(); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("warning: .hotspotrc file is present but has been ignored. Run with -XX:Flags=.hotspotrc to load the file."); + } +} diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java new file mode 100644 index 00000000000..0e9bb07762f --- /dev/null +++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 CdsDifferentObjectAlignment + * @summary Testing CDS (class data sharing) using varying object alignment. + * Using different object alignment for each dump/load pair. + * This is a negative test; using object alignment for loading that + * is different from object alignment for creating a CDS file + * should fail when loading. + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class CdsDifferentObjectAlignment { + public static void main(String[] args) throws Exception { + String nativeWordSize = System.getProperty("sun.arch.data.model"); + if (!Platform.is64bit()) { + System.out.println("ObjectAlignmentInBytes for CDS is only " + + "supported on 64bit platforms; this plaform is " + + nativeWordSize); + System.out.println("Skipping the test"); + } else { + createAndLoadSharedArchive(16, 64); + createAndLoadSharedArchive(64, 32); + } + } + + + // Parameters are object alignment expressed in bytes + private static void + createAndLoadSharedArchive(int createAlignment, int loadAlignment) + throws Exception { + String createAlignmentArgument = "-XX:ObjectAlignmentInBytes=" + + createAlignment; + String loadAlignmentArgument = "-XX:ObjectAlignmentInBytes=" + + loadAlignment; + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xshare:dump", + createAlignmentArgument); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Loading classes to share"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xshare:on", + loadAlignmentArgument, + "-version"); + + output = new OutputAnalyzer(pb.start()); + String expectedErrorMsg = + String.format( + "The shared archive file's ObjectAlignmentInBytes of %d " + + "does not equal the current ObjectAlignmentInBytes of %d", + createAlignment, + loadAlignment); + + output.shouldContain(expectedErrorMsg); + output.shouldHaveExitValue(1); + } +} diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java new file mode 100644 index 00000000000..e95bae3a790 --- /dev/null +++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 CdsSameObjectAlignment + * @summary Testing CDS (class data sharing) using varying object alignment. + * Using same object alignment for each dump/load pair + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class CdsSameObjectAlignment { + public static void main(String[] args) throws Exception { + String nativeWordSize = System.getProperty("sun.arch.data.model"); + if (!Platform.is64bit()) { + System.out.println("ObjectAlignmentInBytes for CDS is only " + + "supported on 64bit platforms; this plaform is " + + nativeWordSize); + System.out.println("Skipping the test"); + } else { + dumpAndLoadSharedArchive(8); + dumpAndLoadSharedArchive(16); + dumpAndLoadSharedArchive(32); + dumpAndLoadSharedArchive(64); + } + } + + private static void + dumpAndLoadSharedArchive(int objectAlignmentInBytes) throws Exception { + String objectAlignmentArg = "-XX:ObjectAlignmentInBytes=" + + objectAlignmentInBytes; + System.out.println("dumpAndLoadSharedArchive(): objectAlignmentInBytes = " + + objectAlignmentInBytes); + + // create shared archive + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xshare:dump", + objectAlignmentArg); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Loading classes to share"); + output.shouldHaveExitValue(0); + + + // run using the shared archive + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xshare:on", + objectAlignmentArg, + "-version"); + + output = new OutputAnalyzer(pb.start()); + + try { + output.shouldContain("sharing"); + output.shouldHaveExitValue(0); + } catch (RuntimeException e) { + // CDS uses absolute addresses for performance. + // It will try to reserve memory at a specific address; + // there is a chance such reservation will fail + // If it does, it is NOT considered a failure of the feature, + // rather a possible expected outcome, though not likely + output.shouldContain( + "Unable to reserve shared space at required address"); + output.shouldHaveExitValue(1); + } + } +} diff --git a/hotspot/test/serviceability/threads/TestFalseDeadLock.java b/hotspot/test/serviceability/threads/TestFalseDeadLock.java new file mode 100644 index 00000000000..7ee0fe1116f --- /dev/null +++ b/hotspot/test/serviceability/threads/TestFalseDeadLock.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.lang.management.ManagementFactory; +import java.lang.management.ThreadMXBean; +import java.util.Random; + +/* + * @test + * @bug 8016304 + * @summary Make sure no deadlock is reported for this program which has no deadlocks. + * @run main/othervm TestFalseDeadLock + */ + +/* + * This test will not provoke the bug every time it is run since the bug is intermittent. + * The test has a fixed running time of 5 seconds. + */ + +public class TestFalseDeadLock { + private static ThreadMXBean bean; + private static volatile boolean running = true; + private static volatile boolean found = false; + + public static void main(String[] args) throws Exception { + bean = ManagementFactory.getThreadMXBean(); + Thread[] threads = new Thread[500]; + for (int i = 0; i < threads.length; i++) { + Test t = new Test(); + threads[i] = new Thread(t); + threads[i].start(); + } + try { + Thread.sleep(5000); + } catch (InterruptedException ex) { + } + running = false; + for (Thread t : threads) { + t.join(); + } + if (found) { + throw new Exception("Deadlock reported, but there is no deadlock."); + } + } + + public static class Test implements Runnable { + public void run() { + Random r = new Random(); + while (running) { + try { + synchronized (this) { + wait(r.nextInt(1000) + 1); + } + } catch (InterruptedException ex) { + } + recurse(2000); + } + if (bean.findDeadlockedThreads() != null) { + System.out.println("FOUND!"); + found = true; + } + } + + private void recurse(int i) { + if (!running) { + // It is important for the test to call println here + // since there are locks inside that path. + System.out.println("Hullo"); + } + else if (i > 0) { + recurse(i - 1); + } + } + } +} diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java new file mode 100644 index 00000000000..cfc1a271c13 --- /dev/null +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.oracle.java.testlibrary; + +public class Platform { + private static final String osName = System.getProperty("os.name"); + private static final String dataModel = System.getProperty("sun.arch.data.model"); + private static final String vmVersion = System.getProperty("java.vm.version"); + + public static boolean is64bit() { + return dataModel.equals("64"); + } + + public static boolean isSolaris() { + return osName.toLowerCase().startsWith("sunos"); + } + + public static boolean isWindows() { + return osName.toLowerCase().startsWith("win"); + } + + public static boolean isOSX() { + return osName.toLowerCase().startsWith("mac"); + } + + public static boolean isLinux() { + return osName.toLowerCase().startsWith("linux"); + } + + public static String getOsName() { + return osName; + } + + public static boolean isDebugBuild() { + return vmVersion.toLowerCase().contains("debug"); + } + + public static String getVMVersion() { + return vmVersion; + } +} diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java index 42203d17ff0..6e0fdae6564 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java @@ -112,10 +112,8 @@ public final class ProcessTools { * @return String[] with platform specific arguments, empty if there are none */ public static String[] getPlatformSpecificVMArgs() { - String osName = System.getProperty("os.name"); - String dataModel = System.getProperty("sun.arch.data.model"); - if (osName.equals("SunOS") && dataModel.equals("64")) { + if (Platform.is64bit() && Platform.isSolaris()) { return new String[] { "-d64" }; } diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 73376e06bf1..ed78f7ecae7 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -216,3 +216,6 @@ e3065fb07877c7e96e8b93416fe2ab9a4c9eb2a5 jdk8-b91 1ab5d8d6eab81e65c6c3cf21739474cd67a0e7cf jdk8-b92 d583a491d63c49eeda4869525048075da1cb596e jdk8-b93 c84658e1740df64931005a9bc4c8ecef38eb47c3 jdk8-b94 +b8c5f4b6f0fffb44618fc609a584953c4ed67c0b jdk8-b95 +6121efd299235b057f3de94b0a4158c388c2907c jdk8-b96 +6c830db28d21108f32af990ecf4d80a75887980d jdk8-b97 diff --git a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.transform.TransformerFactory b/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.transform.TransformerFactory deleted file mode 100644 index a607891fefd..00000000000 --- a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.transform.TransformerFactory +++ /dev/null @@ -1 +0,0 @@ -com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl diff --git a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.xpath.XPathFactory b/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.xpath.XPathFactory deleted file mode 100644 index ff1d5560075..00000000000 --- a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/javax.xml.xpath.XPathFactory +++ /dev/null @@ -1 +0,0 @@ -com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl \ No newline at end of file diff --git a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/org.apache.xml.dtm.DTMManager b/jaxp/src/com/sun/org/apache/xalan/META-INF/services/org.apache.xml.dtm.DTMManager deleted file mode 100644 index 6edf8469ef7..00000000000 --- a/jaxp/src/com/sun/org/apache/xalan/META-INF/services/org.apache.xml.dtm.DTMManager +++ /dev/null @@ -1 +0,0 @@ -com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java index ff9b1a6e6a5..034d8eec84b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java @@ -23,26 +23,11 @@ package com.sun.org.apache.xalan.internal.utils; -import java.io.InputStream; -import java.io.IOException; -import java.io.File; -import java.io.FileInputStream; - -import java.util.Properties; -import java.io.BufferedReader; -import java.io.InputStreamReader; - /** * This class is duplicated for each JAXP subpackage so keep it in sync. * It is package private and therefore is not exposed as part of the JAXP * API. *

      - * This code is designed to implement the JAXP 1.1 spec pluggability - * feature and is designed to run on JDK version 1.1 and - * later, and to compile on JDK 1.2 and onward. - * The code also runs both as part of an unbundled jar file and - * when bundled as part of the JDK. - *

      * This class was moved from the javax.xml.parsers.ObjectFactory * class and modified to be used as a general utility for creating objects * dynamically. @@ -57,329 +42,9 @@ public class ObjectFactory { private static final String XALAN_INTERNAL = "com.sun.org.apache.xalan.internal"; private static final String XERCES_INTERNAL = "com.sun.org.apache.xerces.internal"; - // name of default properties file to look for in JDK's jre/lib directory - private static final String DEFAULT_PROPERTIES_FILENAME = - "xalan.properties"; - - private static final String SERVICES_PATH = "META-INF/services/"; - /** Set to true for debugging */ private static final boolean DEBUG = false; - /** cache the contents of the xalan.properties file. - * Until an attempt has been made to read this file, this will - * be null; if the file does not exist or we encounter some other error - * during the read, this will be empty. - */ - private static Properties fXalanProperties = null; - - /*** - * Cache the time stamp of the xalan.properties file so - * that we know if it's been modified and can invalidate - * the cache when necessary. - */ - private static long fLastModified = -1; - - // - // Public static methods - // - - /** - * Finds the implementation Class object in the specified order. The - * specified order is the following: - *

        - *
      1. query the system property using System.getProperty - *
      2. read META-INF/services/factoryId file - *
      3. use fallback classname - *
      - * - * @return instance of factory, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - public static Object createObject(String factoryId, String fallbackClassName) - throws ConfigurationError { - return createObject(factoryId, null, fallbackClassName); - } // createObject(String,String):Object - - /** - * Finds the implementation Class object in the specified order. The - * specified order is the following: - *
        - *
      1. query the system property using System.getProperty - *
      2. read $java.home/lib/propertiesFilename file - *
      3. read META-INF/services/factoryId file - *
      4. use fallback classname - *
      - * - * @return instance of factory, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param propertiesFilename The filename in the $java.home/lib directory - * of the properties file. If none specified, - * ${java.home}/lib/xalan.properties will be used. - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - static Object createObject(String factoryId, - String propertiesFilename, - String fallbackClassName) - throws ConfigurationError - { - Class factoryClass = lookUpFactoryClass(factoryId, - propertiesFilename, - fallbackClassName); - - if (factoryClass == null) { - throw new ConfigurationError( - "Provider for " + factoryId + " cannot be found", null); - } - - try{ - Object instance = factoryClass.newInstance(); - if (DEBUG) debugPrintln("created new instance of factory " + factoryId); - return instance; - } catch (Exception x) { - throw new ConfigurationError( - "Provider for factory " + factoryId - + " could not be instantiated: " + x, x); - } - } // createObject(String,String,String):Object - - /** - * Finds the implementation Class object in the specified order. The - * specified order is the following: - *
        - *
      1. query the system property using System.getProperty - *
      2. read $java.home/lib/propertiesFilename file - *
      3. read META-INF/services/factoryId file - *
      4. use fallback classname - *
      - * - * @return Class object of factory, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param propertiesFilename The filename in the $java.home/lib directory - * of the properties file. If none specified, - * ${java.home}/lib/xalan.properties will be used. - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - public static Class lookUpFactoryClass(String factoryId) - throws ConfigurationError - { - return lookUpFactoryClass(factoryId, null, null); - } // lookUpFactoryClass(String):Class - - /** - * Finds the implementation Class object in the specified order. The - * specified order is the following: - *
        - *
      1. query the system property using System.getProperty - *
      2. read $java.home/lib/propertiesFilename file - *
      3. read META-INF/services/factoryId file - *
      4. use fallback classname - *
      - * - * @return Class object that provides factory service, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param propertiesFilename The filename in the $java.home/lib directory - * of the properties file. If none specified, - * ${java.home}/lib/xalan.properties will be used. - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - public static Class lookUpFactoryClass(String factoryId, - String propertiesFilename, - String fallbackClassName) - throws ConfigurationError - { - String factoryClassName = lookUpFactoryClassName(factoryId, - propertiesFilename, - fallbackClassName); - ClassLoader cl = findClassLoader(); - - if (factoryClassName == null) { - factoryClassName = fallbackClassName; - } - - // assert(className != null); - try{ - Class providerClass = findProviderClass(factoryClassName, - cl, - true); - if (DEBUG) debugPrintln("created new instance of " + providerClass + - " using ClassLoader: " + cl); - return providerClass; - } catch (ClassNotFoundException x) { - throw new ConfigurationError( - "Provider " + factoryClassName + " not found", x); - } catch (Exception x) { - throw new ConfigurationError( - "Provider "+factoryClassName+" could not be instantiated: "+x, - x); - } - } // lookUpFactoryClass(String,String,String):Class - - /** - * Finds the name of the required implementation class in the specified - * order. The specified order is the following: - *
        - *
      1. query the system property using System.getProperty - *
      2. read $java.home/lib/propertiesFilename file - *
      3. read META-INF/services/factoryId file - *
      4. use fallback classname - *
      - * - * @return name of class that provides factory service, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param propertiesFilename The filename in the $java.home/lib directory - * of the properties file. If none specified, - * ${java.home}/lib/xalan.properties will be used. - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - static String lookUpFactoryClassName(String factoryId, - String propertiesFilename, - String fallbackClassName) - { - // Use the system property first - try { - String systemProp = SecuritySupport.getSystemProperty(factoryId); - if (systemProp != null) { - if (DEBUG) debugPrintln("found system property, value=" + systemProp); - return systemProp; - } - } catch (SecurityException se) { - // Ignore and continue w/ next location - } - - // Try to read from propertiesFilename, or - // $java.home/lib/xalan.properties - String factoryClassName = null; - // no properties file name specified; use - // $JAVA_HOME/lib/xalan.properties: - if (propertiesFilename == null) { - File propertiesFile = null; - boolean propertiesFileExists = false; - try { - String javah = SecuritySupport.getSystemProperty("java.home"); - propertiesFilename = javah + File.separator + - "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME; - propertiesFile = new File(propertiesFilename); - propertiesFileExists = SecuritySupport.getFileExists(propertiesFile); - } catch (SecurityException e) { - // try again... - fLastModified = -1; - fXalanProperties = null; - } - - synchronized (ObjectFactory.class) { - boolean loadProperties = false; - FileInputStream fis = null; - try { - // file existed last time - if(fLastModified >= 0) { - if(propertiesFileExists && - (fLastModified < (fLastModified = SecuritySupport.getLastModified(propertiesFile)))) { - loadProperties = true; - } else { - // file has stopped existing... - if(!propertiesFileExists) { - fLastModified = -1; - fXalanProperties = null; - } // else, file wasn't modified! - } - } else { - // file has started to exist: - if(propertiesFileExists) { - loadProperties = true; - fLastModified = SecuritySupport.getLastModified(propertiesFile); - } // else, nothing's changed - } - if(loadProperties) { - // must never have attempted to read xalan.properties - // before (or it's outdeated) - fXalanProperties = new Properties(); - fis = SecuritySupport.getFileInputStream(propertiesFile); - fXalanProperties.load(fis); - } - } catch (Exception x) { - fXalanProperties = null; - fLastModified = -1; - // assert(x instanceof FileNotFoundException - // || x instanceof SecurityException) - // In both cases, ignore and continue w/ next location - } - finally { - // try to close the input stream if one was opened. - if (fis != null) { - try { - fis.close(); - } - // Ignore the exception. - catch (IOException exc) {} - } - } - } - if(fXalanProperties != null) { - factoryClassName = fXalanProperties.getProperty(factoryId); - } - } else { - FileInputStream fis = null; - try { - fis = SecuritySupport.getFileInputStream(new File(propertiesFilename)); - Properties props = new Properties(); - props.load(fis); - factoryClassName = props.getProperty(factoryId); - } catch (Exception x) { - // assert(x instanceof FileNotFoundException - // || x instanceof SecurityException) - // In both cases, ignore and continue w/ next location - } - finally { - // try to close the input stream if one was opened. - if (fis != null) { - try { - fis.close(); - } - // Ignore the exception. - catch (IOException exc) {} - } - } - } - if (factoryClassName != null) { - if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" - + factoryClassName); - return factoryClassName; - } - - // Try Jar Service Provider Mechanism - return findJarServiceProviderName(factoryId); - } // lookUpFactoryClass(String,String):String - - // - // Private static methods - // /** Prints a message to standard error if debugging is enabled. */ private static void debugPrintln(String msg) { @@ -393,7 +58,6 @@ public class ObjectFactory { * the context ClassLoader. */ public static ClassLoader findClassLoader() - throws ConfigurationError { if (System.getSecurityManager()!=null) { //this will ensure bootclassloader is used @@ -452,8 +116,8 @@ public class ObjectFactory { } // findClassLoader():ClassLoader /** - * Create an instance of a class using the same classloader for the ObjectFactory by default - * or bootclassloader when Security Manager is in place + * Create an instance of a class using the same class loader for the ObjectFactory by default + * or boot class loader when Security Manager is in place */ public static Object newInstance(String className, boolean doFallback) throws ConfigurationError @@ -491,10 +155,10 @@ public class ObjectFactory { } /** - * Find a Class using the same classloader for the ObjectFactory by default - * or bootclassloader when Security Manager is in place + * Find a Class using the same class loader for the ObjectFactory by default + * or boot class loader when Security Manager is in place */ - public static Class findProviderClass(String className, boolean doFallback) + public static Class findProviderClass(String className, boolean doFallback) throws ClassNotFoundException, ConfigurationError { if (System.getSecurityManager()!=null) { @@ -508,7 +172,7 @@ public class ObjectFactory { /** * Find a Class using the specified ClassLoader */ - static Class findProviderClass(String className, ClassLoader cl, + private static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { @@ -531,7 +195,7 @@ public class ObjectFactory { throw e; } - Class providerClass; + Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works @@ -567,93 +231,4 @@ public class ObjectFactory { return providerClass; } - /** - * Find the name of service provider using Jar Service Provider Mechanism - * - * @return instance of provider class if found or null - */ - private static String findJarServiceProviderName(String factoryId) - { - String serviceId = SERVICES_PATH + factoryId; - InputStream is = null; - - // First try the Context ClassLoader - ClassLoader cl = findClassLoader(); - - is = SecuritySupport.getResourceAsStream(cl, serviceId); - - // If no provider found then try the current ClassLoader - if (is == null) { - ClassLoader current = ObjectFactory.class.getClassLoader(); - if (cl != current) { - cl = current; - is = SecuritySupport.getResourceAsStream(cl, serviceId); - } - } - - if (is == null) { - // No provider found - return null; - } - - if (DEBUG) debugPrintln("found jar resource=" + serviceId + - " using ClassLoader: " + cl); - - // Read the service provider name in UTF-8 as specified in - // the jar spec. Unfortunately this fails in Microsoft - // VJ++, which does not implement the UTF-8 - // encoding. Theoretically, we should simply let it fail in - // that case, since the JVM is obviously broken if it - // doesn't support such a basic standard. But since there - // are still some users attempting to use VJ++ for - // development, we have dropped in a fallback which makes a - // second attempt using the platform's default encoding. In - // VJ++ this is apparently ASCII, which is a subset of - // UTF-8... and since the strings we'll be reading here are - // also primarily limited to the 7-bit ASCII range (at - // least, in English versions), this should work well - // enough to keep us on the air until we're ready to - // officially decommit from VJ++. [Edited comment from - // jkesselm] - BufferedReader rd; - try { - rd = new BufferedReader(new InputStreamReader(is, "UTF-8")); - } catch (java.io.UnsupportedEncodingException e) { - rd = new BufferedReader(new InputStreamReader(is)); - } - - String factoryClassName = null; - try { - // XXX Does not handle all possible input as specified by the - // Jar Service Provider specification - factoryClassName = rd.readLine(); - } catch (IOException x) { - // No provider found - return null; - } - finally { - try { - // try to close the reader. - rd.close(); - } - // Ignore the exception. - catch (IOException exc) {} - } - - if (factoryClassName != null && - ! "".equals(factoryClassName)) { - if (DEBUG) debugPrintln("found in resource, value=" - + factoryClassName); - - // Note: here we do not want to fall back to the current - // ClassLoader because we want to avoid the case where the - // resource file was found using one ClassLoader and the - // provider class was instantiated using a different one. - return factoryClassName; - } - - // No provider found - return null; - } - } // class ObjectFactory diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java index e2df8e31c36..a81cd779594 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Transform.java @@ -23,34 +23,30 @@ package com.sun.org.apache.xalan.internal.xsltc.cmdline; -import java.io.FileNotFoundException; -import java.net.MalformedURLException; -import java.net.UnknownHostException; -import java.util.Vector; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import javax.xml.transform.sax.SAXSource; - +import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM; +import com.sun.org.apache.xalan.internal.xsltc.StripFilter; import com.sun.org.apache.xalan.internal.xsltc.TransletException; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; -import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM; +import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter; import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xalan.internal.xsltc.runtime.Constants; import com.sun.org.apache.xalan.internal.xsltc.runtime.Parameter; import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory; +import com.sun.org.apache.xml.internal.dtm.DTMWSFilter; import com.sun.org.apache.xml.internal.serializer.SerializationHandler; - +import java.io.FileNotFoundException; +import java.net.MalformedURLException; +import java.net.UnknownHostException; +import java.util.Vector; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.sax.SAXSource; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -import com.sun.org.apache.xalan.internal.xsltc.StripFilter; -import com.sun.org.apache.xml.internal.dtm.DTMWSFilter; -import com.sun.org.apache.xalan.internal.xsltc.dom.DOMWSFilter; -import com.sun.org.apache.xalan.internal.utils.ObjectFactory; - /** * @author Jacek Ambroziak * @author Santiago Pericas-Geertsen @@ -115,8 +111,7 @@ final public class Transform { // Set the DOM's DOM builder as the XMLReader's SAX2 content handler XSLTCDTMManager dtmManager = - (XSLTCDTMManager)XSLTCDTMManager.getDTMManagerClass() - .newInstance(); + XSLTCDTMManager.createNewDTMManagerInstance(); DTMWSFilter wsfilter; if (translet != null && translet instanceof StripFilter) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 9669bf734ad..3c186a1172b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java @@ -52,6 +52,7 @@ import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.AttributesImpl; @@ -476,8 +477,15 @@ public class Parser implements Constants, ContentHandler { factory.setNamespaceAware(true); } final SAXParser parser = factory.newSAXParser(); - parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, - _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD)); + try { + parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, + _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD)); + } catch (SAXNotRecognizedException e) { + ErrorMsg err = new ErrorMsg(ErrorMsg.WARNING_MSG, + parser.getClass().getName() + ": " + e.getMessage()); + reportError(WARNING, err); + } + final XMLReader reader = parser.getXMLReader(); return(parse(reader, input)); } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java index 90655c6fe45..8595d82bc21 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java @@ -449,7 +449,7 @@ public class ErrorMessages extends ListResourceBundle { * Note to translators: access to the stylesheet target is denied */ {ErrorMsg.ACCESSING_XSLT_TARGET_ERR, - "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed."}, + "Could not read stylesheet target ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalStylesheet property."}, /* * Note to translators: This message represents an internal error in diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java index d5695187c0f..79f982489a5 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java @@ -156,8 +156,7 @@ public final class DocumentCache implements DOMCache { public DocumentCache(int size) throws SAXException { this(size, null); try { - _dtmManager = (XSLTCDTMManager)XSLTCDTMManager.getDTMManagerClass() - .newInstance(); + _dtmManager = XSLTCDTMManager.createNewDTMManagerInstance(); } catch (Exception e) { throw new SAXException(e); } @@ -255,6 +254,7 @@ public final class DocumentCache implements DOMCache { * Returns a document either by finding it in the cache or * downloading it and putting it in the cache. */ + @Override public DOM retrieveDocument(String baseURI, String href, Translet trs) { CachedDocument doc; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java index 43eb1024c3e..0cc6d073164 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java @@ -30,7 +30,6 @@ import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stax.StAXSource; - import com.sun.org.apache.xml.internal.dtm.DTM; import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase; import com.sun.org.apache.xml.internal.dtm.DTMException; @@ -42,7 +41,6 @@ import com.sun.org.apache.xml.internal.utils.SystemIDResolver; import com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX; import com.sun.org.apache.xalan.internal.xsltc.trax.StAXEvent2SAX; import com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX; -import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import org.xml.sax.InputSource; import org.xml.sax.SAXNotRecognizedException; @@ -55,13 +53,6 @@ import org.xml.sax.XMLReader; public class XSLTCDTMManager extends DTMManagerDefault { - /** The default class name to use as the manager. */ - private static final String DEFAULT_CLASS_NAME = - "com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager"; - - private static final String DEFAULT_PROP_NAME = - "com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager"; - /** Set this to true if you want a dump of the DTM after creation */ private static final boolean DUMPTREE = false; @@ -88,42 +79,13 @@ public class XSLTCDTMManager extends DTMManagerDefault } /** - * Look up the class that provides the XSLTC DTM Manager service. - * The following lookup procedure is used to find the service provider. - *
        - *
      1. The value of the - * com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager property, is - * checked.
      2. - *
      3. The xalan.propeties file is checked for a property - * of the same name.
      4. - *
      5. The - * META-INF/services/com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager - * file is checked. - *
      - * The default is com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager. + * Creates a new instance of the XSLTC DTM Manager service. + * Creates a new instance of the default class + * com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager. */ - public static Class getDTMManagerClass() { - return getDTMManagerClass(true); - } - - public static Class getDTMManagerClass(boolean useServicesMechanism) { - Class mgrClass = null; - if (useServicesMechanism) { - mgrClass = ObjectFactory.lookUpFactoryClass(DEFAULT_PROP_NAME, - null, - DEFAULT_CLASS_NAME); - } else { - try { - mgrClass = ObjectFactory.findProviderClass(DEFAULT_CLASS_NAME, true); - } catch (Exception e) { - //will not happen - } - } - // If no class found, default to this one. (This should never happen - - // the ObjectFactory has already been told that the current class is - // the default). - return (mgrClass != null) ? mgrClass : XSLTCDTMManager.class; - } + public static XSLTCDTMManager createNewDTMManagerInstance() { + return newInstance(); + } /** * Get an instance of a DTM, loaded with the content from the @@ -146,6 +108,7 @@ public class XSLTCDTMManager extends DTMManagerDefault * * @return a non-null DTM reference. */ + @Override public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java index 554e1fd998d..ddefee2fe0c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java @@ -955,6 +955,9 @@ public final class BasisLibrary { if (Double.isNaN(d) || Double.isInfinite(d)) return(Double.toString(d)); + //Convert -0.0 to +0.0 other values remains the same + d = d + 0.0; + // Use the XPath formatter to ignore locales StringBuffer result = threadLocalStringBuffer.get(); result.setLength(0); diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java index a15d8fad536..fdd89643721 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java @@ -23,6 +23,17 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; +import com.sun.org.apache.xalan.internal.XalanConstants; +import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.ObjectFactory; +import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants; +import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; +import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; +import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; +import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager; +import com.sun.org.apache.xml.internal.utils.StopParseException; +import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -37,11 +48,9 @@ import java.util.Properties; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; - import javax.xml.XMLConstants; -import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParser; -import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.ErrorListener; import javax.xml.transform.Source; @@ -58,23 +67,9 @@ import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TemplatesHandler; import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stax.*; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stax.*; - -import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler; -import com.sun.org.apache.xml.internal.utils.StopParseException; - -import com.sun.org.apache.xalan.internal.XalanConstants; -import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants; -import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; -import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; -import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; -import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager; -import com.sun.org.apache.xalan.internal.utils.ObjectFactory; -import com.sun.org.apache.xalan.internal.utils.FactoryImpl; -import com.sun.org.apache.xalan.internal.utils.SecuritySupport; - import org.xml.sax.InputSource; import org.xml.sax.XMLFilter; import org.xml.sax.XMLReader; @@ -200,14 +195,6 @@ public class TransformerFactoryImpl */ private int _indentNumber = -1; - /** - * The provider of the XSLTC DTM Manager service. This is fixed for any - * instance of this class. In order to change service providers, a new - * XSLTC TransformerFactory must be instantiated. - * @see XSLTCDTMManager#getDTMManagerClass() - */ - private Class m_DTMManagerClass; - /** *

      State of secure processing feature.

      */ @@ -246,7 +233,6 @@ public class TransformerFactoryImpl } private TransformerFactoryImpl(boolean useServicesMechanism) { - this.m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(useServicesMechanism); this._useServicesMechanism = useServicesMechanism; String defaultAccess = XalanConstants.EXTERNAL_ACCESS_DEFAULT; @@ -269,6 +255,7 @@ public class TransformerFactoryImpl * @param listener The error listener to use with the TransformerFactory * @throws IllegalArgumentException */ + @Override public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { @@ -286,6 +273,7 @@ public class TransformerFactoryImpl * * @return The error listener used with the TransformerFactory */ + @Override public ErrorListener getErrorListener() { return _errorListener; } @@ -298,6 +286,7 @@ public class TransformerFactoryImpl * @return An object representing the attribute value * @throws IllegalArgumentException */ + @Override public Object getAttribute(String name) throws IllegalArgumentException { @@ -337,6 +326,7 @@ public class TransformerFactoryImpl * @param value An object representing the attribute value * @throws IllegalArgumentException */ + @Override public void setAttribute(String name, Object value) throws IllegalArgumentException { @@ -459,6 +449,7 @@ public class TransformerFactoryImpl * or the Transformers or Templates it creates cannot support this feature. * @throws NullPointerException If the name parameter is null. */ + @Override public void setFeature(String name, boolean value) throws TransformerConfigurationException { @@ -503,6 +494,7 @@ public class TransformerFactoryImpl * @param name The feature name * @return 'true' if feature is supported, 'false' if not */ + @Override public boolean getFeature(String name) { // All supported features should be listed here String[] features = { @@ -554,6 +546,7 @@ public class TransformerFactoryImpl * @return The URLResolver used for this TransformerFactory and all * Templates and Transformer objects created using this factory */ + @Override public URIResolver getURIResolver() { return _uriResolver; } @@ -568,6 +561,7 @@ public class TransformerFactoryImpl * @param resolver The URLResolver used for this TransformerFactory and all * Templates and Transformer objects created using this factory */ + @Override public void setURIResolver(URIResolver resolver) { _uriResolver = resolver; } @@ -587,13 +581,14 @@ public class TransformerFactoryImpl * @return A Source object suitable for passing to the TransformerFactory. * @throws TransformerConfigurationException */ + @Override public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseId; - XMLReader reader = null; - InputSource isource = null; + XMLReader reader; + InputSource isource; /** @@ -675,6 +670,7 @@ public class TransformerFactoryImpl * @return A Transformer object that simply copies the source to the result. * @throws TransformerConfigurationException */ + @Override public Transformer newTransformer() throws TransformerConfigurationException { @@ -700,6 +696,7 @@ public class TransformerFactoryImpl * @return A Templates object that can be used to create Transformers. * @throws TransformerConfigurationException */ + @Override public Transformer newTransformer(Source source) throws TransformerConfigurationException { @@ -763,6 +760,7 @@ public class TransformerFactoryImpl * @return A Templates object that can be used to create Transformers. * @throws TransformerConfigurationException */ + @Override public Templates newTemplates(Source source) throws TransformerConfigurationException { @@ -796,7 +794,7 @@ public class TransformerFactoryImpl // If _autoTranslet is true, we will try to load the bytecodes // from the translet classes without compiling the stylesheet. if (_autoTranslet) { - byte[][] bytecodes = null; + byte[][] bytecodes; String transletClassName = getTransletBaseName(source); if (_packageName != null) @@ -918,7 +916,7 @@ public class TransformerFactoryImpl // Check that the transformation went well before returning if (bytecodes == null) { Vector errs = xsltc.getErrors(); - ErrorMsg err = null; + ErrorMsg err; if (errs != null) { err = (ErrorMsg)errs.elementAt(errs.size()-1); } else { @@ -963,6 +961,7 @@ public class TransformerFactoryImpl * @return A TemplatesHandler object that can handle SAX events * @throws TransformerConfigurationException */ + @Override public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { @@ -982,6 +981,7 @@ public class TransformerFactoryImpl * @return A TransformerHandler object that can handle SAX events * @throws TransformerConfigurationException */ + @Override public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { @@ -1002,6 +1002,7 @@ public class TransformerFactoryImpl * @return A TransformerHandler object that can handle SAX events * @throws TransformerConfigurationException */ + @Override public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { @@ -1022,6 +1023,7 @@ public class TransformerFactoryImpl * @return A TransformerHandler object that can handle SAX events * @throws TransformerConfigurationException */ + @Override public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { @@ -1039,6 +1041,7 @@ public class TransformerFactoryImpl * @return An XMLFilter object, or null if this feature is not supported. * @throws TransformerConfigurationException */ + @Override public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { @@ -1056,6 +1059,7 @@ public class TransformerFactoryImpl * @return An XMLFilter object, or null if this feature is not supported. * @throws TransformerConfigurationException */ + @Override public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { @@ -1087,6 +1091,7 @@ public class TransformerFactoryImpl * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ + @Override public void error(TransformerException e) throws TransformerException { @@ -1115,6 +1120,7 @@ public class TransformerFactoryImpl * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ + @Override public void fatalError(TransformerException e) throws TransformerException { @@ -1143,6 +1149,7 @@ public class TransformerFactoryImpl * @throws TransformerException if the application chooses to discontinue * the transformation (never does in our case). */ + @Override public void warning(TransformerException e) throws TransformerException { @@ -1166,6 +1173,7 @@ public class TransformerFactoryImpl * @param xsltc The compiler that resuests the document * @return An InputSource with the loaded document */ + @Override public InputSource loadSource(String href, String context, XSLTC xsltc) { try { if (_uriResolver != null) { @@ -1252,7 +1260,7 @@ public class TransformerFactoryImpl Vector bytecodes = new Vector(); int fileLength = (int)transletFile.length(); if (fileLength > 0) { - FileInputStream input = null; + FileInputStream input; try { input = new FileInputStream(transletFile); } @@ -1284,6 +1292,7 @@ public class TransformerFactoryImpl // Find all the auxiliary files which have a name pattern of "transletClass$nnn.class". final String transletAuxPrefix = transletName + "$"; File[] auxfiles = transletParentFile.listFiles(new FilenameFilter() { + @Override public boolean accept(File dir, String name) { return (name.endsWith(".class") && name.startsWith(transletAuxPrefix)); @@ -1347,7 +1356,7 @@ public class TransformerFactoryImpl xslFile = new File(xslFileName); // Construct the path for the jar file - String jarPath = null; + String jarPath; if (_destinationDirectory != null) jarPath = _destinationDirectory + "/" + _jarFileName; else { @@ -1372,7 +1381,7 @@ public class TransformerFactoryImpl } // Create a ZipFile object for the jar file - ZipFile jarFile = null; + ZipFile jarFile; try { jarFile = new ZipFile(file); } @@ -1490,7 +1499,7 @@ public class TransformerFactoryImpl if (file.exists()) return systemId; else { - URL url = null; + URL url; try { url = new URL(systemId); } @@ -1509,9 +1518,9 @@ public class TransformerFactoryImpl } /** - * Returns the Class object the provides the XSLTC DTM Manager service. + * Returns a new instance of the XSLTC DTM Manager service. */ - protected Class getDTMManagerClass() { - return m_DTMManagerClass; + protected final XSLTCDTMManager createNewDTMManagerInstance() { + return XSLTCDTMManager.createNewDTMManagerInstance(); } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java index e1bb5141b64..cd4b4be14e2 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java @@ -96,6 +96,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * resolved. * @return The systemID that was set with setSystemId(String id) */ + @Override public String getSystemId() { return _systemId; } @@ -106,6 +107,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * resolved. * @param id Base URI for this stylesheet */ + @Override public void setSystemId(String id) { _systemId = id; } @@ -116,6 +118,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * order to set parameters and output properties. * @return The Transformer object */ + @Override public Transformer getTransformer() { return _transformer; } @@ -127,6 +130,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * @param result A Result instance, should not be null * @throws IllegalArgumentException if result is invalid for some reason */ + @Override public void setResult(Result result) throws IllegalArgumentException { _result = result; @@ -166,6 +170,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.characters() * Receive notification of character data. */ + @Override public void characters(char[] ch, int start, int length) throws SAXException { @@ -176,6 +181,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.startDocument() * Receive notification of the beginning of a document. */ + @Override public void startDocument() throws SAXException { // Make sure setResult() was called before the first SAX event if (_result == null) { @@ -189,10 +195,8 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { // Create an internal DOM (not W3C) and get SAX2 input handler try { - dtmManager = - (XSLTCDTMManager)_transformer.getTransformerFactory() - .getDTMManagerClass() - .newInstance(); + dtmManager = _transformer.getTransformerFactory() + .createNewDTMManagerInstance(); } catch (Exception e) { throw new SAXException(e); } @@ -230,6 +234,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.endDocument() * Receive notification of the end of a document. */ + @Override public void endDocument() throws SAXException { // Signal to the DOMBuilder that the document is complete _handler.endDocument(); @@ -260,6 +265,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.startElement() * Receive notification of the beginning of an element. */ + @Override public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException @@ -271,6 +277,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.endElement() * Receive notification of the end of an element. */ + @Override public void endElement(String namespaceURI, String localName, String qname) throws SAXException { @@ -281,6 +288,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.processingInstruction() * Receive notification of a processing instruction. */ + @Override public void processingInstruction(String target, String data) throws SAXException { @@ -290,6 +298,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.startCDATA() */ + @Override public void startCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.startCDATA(); @@ -299,6 +308,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.endCDATA() */ + @Override public void endCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.endCDATA(); @@ -309,6 +319,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ext.LexicalHandler.comment() * Receieve notification of a comment */ + @Override public void comment(char[] ch, int start, int length) throws SAXException { @@ -322,6 +333,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Receive notification of ignorable whitespace in element * content. Similar to characters(char[], int, int). */ + @Override public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { @@ -332,6 +344,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.setDocumentLocator() * Receive an object for locating the origin of SAX document events. */ + @Override public void setDocumentLocator(Locator locator) { _locator = locator; @@ -344,6 +357,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.skippedEntity() * Receive notification of a skipped entity. */ + @Override public void skippedEntity(String name) throws SAXException { _handler.skippedEntity(name); } @@ -352,6 +366,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.startPrefixMapping() * Begin the scope of a prefix-URI Namespace mapping. */ + @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { _handler.startPrefixMapping(prefix, uri); @@ -361,6 +376,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { * Implements org.xml.sax.ContentHandler.endPrefixMapping() * End the scope of a prefix-URI Namespace mapping. */ + @Override public void endPrefixMapping(String prefix) throws SAXException { _handler.endPrefixMapping(prefix); } @@ -368,6 +384,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.startDTD() */ + @Override public void startDTD(String name, String publicId, String systemId) throws SAXException { @@ -379,6 +396,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.endDTD() */ + @Override public void endDTD() throws SAXException { if (_lexHandler != null) { _lexHandler.endDTD(); @@ -388,6 +406,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.startEntity() */ + @Override public void startEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.startEntity(name); @@ -397,6 +416,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.LexicalHandler.endEntity() */ + @Override public void endEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.endEntity(name); @@ -406,6 +426,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.DTDHandler.unparsedEntityDecl() */ + @Override public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException { @@ -418,6 +439,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.DTDHandler.notationDecl() */ + @Override public void notationDecl(String name, String publicId, String systemId) throws SAXException { @@ -429,6 +451,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.DeclHandler.attributeDecl() */ + @Override public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException { @@ -440,6 +463,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.DeclHandler.elementDecl() */ + @Override public void elementDecl(String name, String model) throws SAXException { @@ -451,6 +475,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.DeclHandler.externalEntityDecl() */ + @Override public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException { @@ -462,6 +487,7 @@ public class TransformerHandlerImpl implements TransformerHandler, DeclHandler { /** * Implements org.xml.sax.ext.DeclHandler.externalEntityDecl() */ + @Override public void internalEntityDecl(String name, String value) throws SAXException { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java index a32ab8267f8..63446e734e2 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java @@ -99,10 +99,6 @@ import org.xml.sax.ext.LexicalHandler; public final class TransformerImpl extends Transformer implements DOMCache, ErrorListener { - private final static String EMPTY_STRING = ""; - private final static String NO_STRING = "no"; - private final static String YES_STRING = "yes"; - private final static String XML_STRING = "xml"; private final static String LEXICAL_HANDLER_PROPERTY = "http://xml.org/sax/properties/lexical-handler"; @@ -156,7 +152,7 @@ public final class TransformerImpl extends Transformer private TransletOutputHandlerFactory _tohFactory = null; /** - * A reference to a internal DOM represenation of the input. + * A reference to a internal DOM representation of the input. */ private DOM _dom = null; @@ -238,6 +234,7 @@ public final class TransformerImpl extends Transformer _errorListener = errorListener; } + @Override public void displayMessage(String msg) { if(_errorListener == null) { System.err.println(msg); @@ -323,6 +320,7 @@ public final class TransformerImpl extends Transformer * @param result Will contain the output from the transformation * @throws TransformerException */ + @Override public void transform(Source source, Result result) throws TransformerException { @@ -465,7 +463,7 @@ public final class TransformerImpl extends Transformer // System Id may be in one of several forms, (1) a uri // that starts with 'file:', (2) uri that starts with 'http:' // or (3) just a filename on the local system. - URL url = null; + URL url; if (systemId.startsWith("file:")) { // if StreamResult(File) or setSystemID(File) was used, // the systemId will be URI encoded as a result of File.toURI(), @@ -537,7 +535,7 @@ public final class TransformerImpl extends Transformer */ private DOM getDOM(Source source) throws TransformerException { try { - DOM dom = null; + DOM dom; if (source != null) { DTMWSFilter wsfilter; @@ -552,8 +550,7 @@ public final class TransformerImpl extends Transformer if (_dtmManager == null) { _dtmManager = - (XSLTCDTMManager)_tfactory.getDTMManagerClass() - .newInstance(); + _tfactory.createNewDTMManagerInstance(); _dtmManager.setServicesMechnism(_useServicesMechanism); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, @@ -676,8 +673,8 @@ public final class TransformerImpl extends Transformer } } else if (source instanceof StAXSource) { final StAXSource staxSource = (StAXSource)source; - StAXEvent2SAX staxevent2sax = null; - StAXStream2SAX staxStream2SAX = null; + StAXEvent2SAX staxevent2sax; + StAXStream2SAX staxStream2SAX; if (staxSource.getXMLEventReader() != null) { final XMLEventReader xmlEventReader = staxSource.getXMLEventReader(); staxevent2sax = new StAXEvent2SAX(xmlEventReader); @@ -770,6 +767,7 @@ public final class TransformerImpl extends Transformer * * @return The error event handler currently in effect */ + @Override public ErrorListener getErrorListener() { return _errorListener; } @@ -783,6 +781,7 @@ public final class TransformerImpl extends Transformer * @param listener The error event listener to use * @throws IllegalArgumentException */ + @Override public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { @@ -830,7 +829,7 @@ public final class TransformerImpl extends Transformer // Return a 'null' string if no CDATA section elements were specified if (cdata == null) return null; - StringBuffer result = new StringBuffer(); + final StringBuilder result = new StringBuilder(); // Get an enumeration of all the elements in the hashtable Enumeration elements = cdata.keys(); @@ -857,6 +856,7 @@ public final class TransformerImpl extends Transformer * * @return Properties in effect for this Transformer */ + @Override public Properties getOutputProperties() { return (Properties) _properties.clone(); } @@ -870,6 +870,7 @@ public final class TransformerImpl extends Transformer * @param name A non-null string that contains the name of the property * @throws IllegalArgumentException if the property name is not known */ + @Override public String getOutputProperty(String name) throws IllegalArgumentException { @@ -889,6 +890,7 @@ public final class TransformerImpl extends Transformer * @param properties The properties to use for the Transformer * @throws IllegalArgumentException Never, errors are ignored */ + @Override public void setOutputProperties(Properties properties) throws IllegalArgumentException { @@ -925,6 +927,7 @@ public final class TransformerImpl extends Transformer * @param value The value to assign to the property * @throws IllegalArgumentException Never, errors are ignored */ + @Override public void setOutputProperty(String name, String value) throws IllegalArgumentException { @@ -1205,6 +1208,7 @@ public final class TransformerImpl extends Transformer * @param name The name of the parameter * @param value The value to assign to the parameter */ + @Override public void setParameter(String name, Object value) { if (value == null) { @@ -1228,6 +1232,7 @@ public final class TransformerImpl extends Transformer * Clear all parameters set with setParameter. Clears the translet's * parameter stack. */ + @Override public void clearParameters() { if (_isIdentity && _parameters != null) { _parameters.clear(); @@ -1245,6 +1250,7 @@ public final class TransformerImpl extends Transformer * @param name The name of the parameter * @return An object that contains the value assigned to the parameter */ + @Override public final Object getParameter(String name) { if (_isIdentity) { return (_parameters != null) ? _parameters.get(name) : null; @@ -1260,6 +1266,7 @@ public final class TransformerImpl extends Transformer * * @return The URLResolver object currently in use */ + @Override public URIResolver getURIResolver() { return _uriResolver; } @@ -1270,6 +1277,7 @@ public final class TransformerImpl extends Transformer * * @param resolver The URIResolver to use in document() */ + @Override public void setURIResolver(URIResolver resolver) { _uriResolver = resolver; } @@ -1288,6 +1296,7 @@ public final class TransformerImpl extends Transformer * @param href The href argument passed to the document function. * @param translet A reference to the translet requesting the document */ + @Override public DOM retrieveDocument(String baseURI, String href, Translet translet) { try { // Argument to document function was: document(''); @@ -1330,6 +1339,7 @@ public final class TransformerImpl extends Transformer * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ + @Override public void error(TransformerException e) throws TransformerException { @@ -1358,6 +1368,7 @@ public final class TransformerImpl extends Transformer * @throws TransformerException if the application chooses to discontinue * the transformation (always does in our case). */ + @Override public void fatalError(TransformerException e) throws TransformerException { @@ -1386,6 +1397,7 @@ public final class TransformerImpl extends Transformer * @throws TransformerException if the application chooses to discontinue * the transformation (never does in our case). */ + @Override public void warning(TransformerException e) throws TransformerException { @@ -1406,6 +1418,7 @@ public final class TransformerImpl extends Transformer * created * @since 1.5 */ + @Override public void reset() { _method = null; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index bef160df947..25c45c04be9 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -105,8 +105,6 @@ public final class Util { if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); - reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, - xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD)); } catch (Exception e ) { try { @@ -138,6 +136,14 @@ public final class Util { reader.setFeature ("http://xml.org/sax/features/namespace-prefixes",false); + try { + reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, + xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD)); + } catch (SAXNotRecognizedException e) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + e.getMessage()); + } + xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties index 3f453386c34..19c4ba19595 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n @@ -71,14 +68,14 @@ unsupported-encoding = Codierung {0} wird nicht unterst\u00FCtzt. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde bei der Normalisierung im DOM gefunden. -UndeclaredEntRefInAttrValue = Attribut \"{0}\" Wert \"{1}\" referenzierte eine nicht deklarierte Entit\u00E4t. +UndeclaredEntRefInAttrValue = Attribut "{0}" Wert "{1}" referenzierte eine nicht deklarierte Entit\u00E4t. NullLocalElementName = Lokaler Nullname wurde bei der Namespace-Normalisierung von Element {0} gefunden. NullLocalAttrName = Lokaler Nullname wurde bei der Namespace-Normalisierung von Attribut {0} gefunden. #Error codes used in DOMParser -InvalidDocumentClassName = Der Klassenname der Dokument-Factory \"{0}\", mit dem der DOM-Baum erstellt wurde, hat nicht den Typ org.w3c.dom.Document. -MissingDocumentClassName = Der Klassenname der Dokument-Factory \"{0}\", mit dem der DOM-Baum erstellt wurde, konnte nicht gefunden werden. -CannotCreateDocumentClass = Die Klasse mit dem Namen \"{0}\" konnte nicht als org.w3c.dom.Document erstellt werden. +InvalidDocumentClassName = Der Klassenname der Dokument-Factory "{0}", mit dem der DOM-Baum erstellt wurde, hat nicht den Typ org.w3c.dom.Document. +MissingDocumentClassName = Der Klassenname der Dokument-Factory "{0}", mit dem der DOM-Baum erstellt wurde, konnte nicht gefunden werden. +CannotCreateDocumentClass = Die Klasse mit dem Namen "{0}" konnte nicht als org.w3c.dom.Document erstellt werden. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = Eigenschaft "{0}" muss vor der Eigenschaft "{1}" festgelegt werden. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties index bf9e5e08081..26f25eb9db9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_es.properties 3019 2011-02-28 19:57:14Z joehw $ +# @version $Id: DOMMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n @@ -71,14 +68,14 @@ unsupported-encoding = La codificaci\u00F3n {0} no est\u00E1 soportada. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en DOM durante la normalizaci\u00F3n. -UndeclaredEntRefInAttrValue = El atributo \"{0}\" con valor \"{1}\" ha hecho referencia a una entidad que no se declar\u00F3. +UndeclaredEntRefInAttrValue = El atributo "{0}" con valor "{1}" ha hecho referencia a una entidad que no se declar\u00F3. NullLocalElementName = Se ha encontrado un nombre local nulo durante la normalizaci\u00F3n del espacio de nombres del elemento {0}. NullLocalAttrName = Se ha encontrado un nombre local nulo durante la normalizaci\u00F3n del espacio de nombres del atributo {0}. #Error codes used in DOMParser -InvalidDocumentClassName = El nombre de clase de la f\u00E1brica de documentos \"{0}\" utilizado para construir el \u00E1rbol DOM no es del tipo org.w3c.dom.Document. -MissingDocumentClassName = No se ha encontrado el nombre de clase de la f\u00E1brica de documentos \"{0}\" utilizado para construir el \u00E1rbol DOM. -CannotCreateDocumentClass = No se ha podido construir la clase con el nombre \"{0}\" como un org.w3c.dom.Document. +InvalidDocumentClassName = El nombre de clase de la f\u00E1brica de documentos "{0}" utilizado para construir el \u00E1rbol DOM no es del tipo org.w3c.dom.Document. +MissingDocumentClassName = No se ha encontrado el nombre de clase de la f\u00E1brica de documentos "{0}" utilizado para construir el \u00E1rbol DOM. +CannotCreateDocumentClass = No se ha podido construir la clase con el nombre "{0}" como un org.w3c.dom.Document. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = La propiedad ''{0}'' debe definirse antes de definir la propiedad ''{1}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties index 5a26ff7d999..cd1aed4acdc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n @@ -71,14 +68,14 @@ unsupported-encoding = L''encodage {0} n''est pas pris en charge. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 trouv\u00E9 dans le DOM au cours de la normalisation. -UndeclaredEntRefInAttrValue = La valeur de l''attribut \"{0}\", \"{1}\", r\u00E9f\u00E9ren\u00E7ait une entit\u00E9 non d\u00E9clar\u00E9e. +UndeclaredEntRefInAttrValue = La valeur de l''attribut "{0}", "{1}", r\u00E9f\u00E9ren\u00E7ait une entit\u00E9 non d\u00E9clar\u00E9e. NullLocalElementName = Un nom local NULL a \u00E9t\u00E9 d\u00E9tect\u00E9 au cours de la normalisation de l''espace de noms de l''\u00E9l\u00E9ment {0}. NullLocalAttrName = Un nom local NULL a \u00E9t\u00E9 d\u00E9tect\u00E9 au cours de la normalisation de l''espace de noms de l''attribut {0}. #Error codes used in DOMParser -InvalidDocumentClassName = Le nom de classe de la fabrique de documents \"{0}\" utilis\u00E9e pour construire l''arborescence DOM n''est pas de type org.w3c.dom.Document. -MissingDocumentClassName = Le nom de classe de la fabrique de documents \"{0}\" utilis\u00E9e pour construire l''arborescence DOM est introuvable. -CannotCreateDocumentClass = La classe nomm\u00E9e \"{0}\" n''a pas pu \u00EAtre construite en tant que org.w3c.dom.Document. +InvalidDocumentClassName = Le nom de classe de la fabrique de documents "{0}" utilis\u00E9e pour construire l''arborescence DOM n''est pas de type org.w3c.dom.Document. +MissingDocumentClassName = Le nom de classe de la fabrique de documents "{0}" utilis\u00E9e pour construire l''arborescence DOM est introuvable. +CannotCreateDocumentClass = La classe nomm\u00E9e "{0}" n''a pas pu \u00EAtre construite en tant que org.w3c.dom.Document. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = La propri\u00E9t\u00E9 ''{0}'' doit \u00EAtre d\u00E9finie avant la propri\u00E9t\u00E9 ''{1}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties index 5e38b1bcc3b..35b5be5ea63 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id$ +# @version $Id: DOMMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n @@ -71,14 +68,14 @@ unsupported-encoding = La codifica {0} non \u00E8 supportata. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) in DOM durante la normalizzazione. -UndeclaredEntRefInAttrValue = L''attributo \"{0}\" con valore \"{1}\" fa riferimento a un''entit\u00E0 non dichiarata. +UndeclaredEntRefInAttrValue = L''attributo "{0}" con valore "{1}" fa riferimento a un''entit\u00E0 non dichiarata. NullLocalElementName = \u00C8 stato rilevato un nome locale nullo durante la normalizzazione dello spazio di nomi dell''elemento {0}. NullLocalAttrName = \u00C8 stato rilevato un nome locale nullo durante la normalizzazione dello spazio di nomi dell''attributo {0}. #Error codes used in DOMParser -InvalidDocumentClassName = Il nome classe del document factory \"{0}\" utilizzato per creare la struttura DOM non \u00E8 di tipo org.w3c.dom.Document. -MissingDocumentClassName = Impossibile trovare il nome classe del document factory \"{0}\" utilizzato per creare la struttura DOM. -CannotCreateDocumentClass = Impossibile creare la classe denominata \"{0}\" come org.w3c.dom.Document. +InvalidDocumentClassName = Il nome classe del document factory "{0}" utilizzato per creare la struttura DOM non \u00E8 di tipo org.w3c.dom.Document. +MissingDocumentClassName = Impossibile trovare il nome classe del document factory "{0}" utilizzato per creare la struttura DOM. +CannotCreateDocumentClass = Impossibile creare la classe denominata "{0}" come org.w3c.dom.Document. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = Impostare la propriet\u00E0 ''{0}'' prima di impostare la propriet\u00E0 ''{1}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties index 28e5f7a6d57..4b0b83dfa96 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n @@ -71,14 +68,14 @@ unsupported-encoding = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F #Error codes used in DOM Normalizer InvalidXMLCharInDOM = \u6B63\u898F\u5316\u4E2D\u306BDOM\u5185\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 -UndeclaredEntRefInAttrValue = \u5C5E\u6027\"{0}\"\u306E\u5024\"{1}\"\u3067\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 +UndeclaredEntRefInAttrValue = \u5C5E\u6027"{0}"\u306E\u5024"{1}"\u3067\u53C2\u7167\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 NullLocalElementName = \u8981\u7D20{0}\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u6B63\u898F\u5316\u4E2D\u306Bnull\u306E\u30ED\u30FC\u30AB\u30EB\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 NullLocalAttrName = \u5C5E\u6027{0}\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u6B63\u898F\u5316\u4E2D\u306Bnull\u306E\u30ED\u30FC\u30AB\u30EB\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 #Error codes used in DOMParser -InvalidDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA\"{0}\"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u30BF\u30A4\u30D7org.w3c.dom.Document\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 -MissingDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA\"{0}\"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002 -CannotCreateDocumentClass = \"{0}\"\u3068\u3044\u3046\u540D\u524D\u306E\u30AF\u30E9\u30B9\u3092org.w3c.dom.Document\u3068\u3057\u3066\u69CB\u7BC9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 +InvalidDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA"{0}"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u30BF\u30A4\u30D7org.w3c.dom.Document\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 +MissingDocumentClassName = DOM\u30C4\u30EA\u30FC\u306E\u69CB\u7BC9\u306B\u4F7F\u7528\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30D5\u30A1\u30AF\u30C8\u30EA"{0}"\u306E\u30AF\u30E9\u30B9\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002 +CannotCreateDocumentClass = "{0}"\u3068\u3044\u3046\u540D\u524D\u306E\u30AF\u30E9\u30B9\u3092org.w3c.dom.Document\u3068\u3057\u3066\u69CB\u7BC9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = \u30D7\u30ED\u30D1\u30C6\u30A3''{1}''\u3092\u8A2D\u5B9A\u3059\u308B\u524D\u306B\u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u3092\u8A2D\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties index 7db32296fef..25bafbbd34d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n @@ -71,14 +68,14 @@ unsupported-encoding = {0} \uC778\uCF54\uB529\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC #Error codes used in DOM Normalizer InvalidXMLCharInDOM = \uC815\uADDC\uD654 \uC911 DOM\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. -UndeclaredEntRefInAttrValue = \uC18D\uC131 \"{0}\" \uAC12 \"{1}\"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uB97C \uCC38\uC870\uD588\uC2B5\uB2C8\uB2E4. +UndeclaredEntRefInAttrValue = \uC18D\uC131 "{0}" \uAC12 "{1}"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uB97C \uCC38\uC870\uD588\uC2B5\uB2C8\uB2E4. NullLocalElementName = {0} \uC694\uC18C\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC815\uADDC\uD654 \uC911 \uB110 \uB85C\uCEEC \uC774\uB984\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. NullLocalAttrName = {0} \uC18D\uC131\uC758 \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC815\uADDC\uD654 \uC911 \uB110 \uB85C\uCEEC \uC774\uB984\uC774 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. #Error codes used in DOMParser -InvalidDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC \"{0}\"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC740 org.w3c.dom.Document \uC720\uD615\uC774 \uC544\uB2D9\uB2C8\uB2E4. -MissingDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC \"{0}\"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -CannotCreateDocumentClass = \uC774\uB984\uC774 \"{0}\"\uC778 \uD074\uB798\uC2A4\uB97C org.w3c.dom.Document\uB85C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +InvalidDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC "{0}"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC740 org.w3c.dom.Document \uC720\uD615\uC774 \uC544\uB2D9\uB2C8\uB2E4. +MissingDocumentClassName = DOM \uD2B8\uB9AC \uC0DD\uC131\uC5D0 \uC0AC\uC6A9\uB41C \uBB38\uC11C \uD329\uD1A0\uB9AC "{0}"\uC758 \uD074\uB798\uC2A4 \uC774\uB984\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +CannotCreateDocumentClass = \uC774\uB984\uC774 "{0}"\uC778 \uD074\uB798\uC2A4\uB97C org.w3c.dom.Document\uB85C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = ''{1}'' \uC18D\uC131\uC744 \uC124\uC815\uD558\uAE30 \uC804\uC5D0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD574\uC57C \uD569\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties index 279f42aebc7..5054b344d37 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n @@ -71,14 +68,14 @@ unsupported-encoding = A codifica\u00E7\u00E3o {0} n\u00E3o \u00E9 suportada. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no DOM durante a normaliza\u00E7\u00E3o. -UndeclaredEntRefInAttrValue = O atributo \"{0}\" valor \"{1}\" mencionou uma entidade que n\u00E3o foi declarada. +UndeclaredEntRefInAttrValue = O atributo "{0}" valor "{1}" mencionou uma entidade que n\u00E3o foi declarada. NullLocalElementName = Um nome de local nulo foi encontrado durante a normaliza\u00E7\u00E3o do namespace do elemento {0}. NullLocalAttrName = Um nome de local nulo foi encontrado durante a normaliza\u00E7\u00E3o do namespace do atributo {0}. #Error codes used in DOMParser -InvalidDocumentClassName = O nome da classe do factory do documento \"{0}\" usado para construir a \u00E1rvore DOM n\u00E3o \u00E9 do tipo org.w3c.dom.Document. -MissingDocumentClassName = N\u00E3o foi poss\u00EDvel encontrar o nome da classe do factory do documento \"{0}\" usado para construir a \u00E1rvore DOM. -CannotCreateDocumentClass = N\u00E3o foi poss\u00EDvel construir a classe com o nome \"{0}\" como um org.w3c.dom.Document. +InvalidDocumentClassName = O nome da classe do factory do documento "{0}" usado para construir a \u00E1rvore DOM n\u00E3o \u00E9 do tipo org.w3c.dom.Document. +MissingDocumentClassName = N\u00E3o foi poss\u00EDvel encontrar o nome da classe do factory do documento "{0}" usado para construir a \u00E1rvore DOM. +CannotCreateDocumentClass = N\u00E3o foi poss\u00EDvel construir a classe com o nome "{0}" como um org.w3c.dom.Document. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = A propriedade ''{0}'' deve ser estabelecida antes da defini\u00E7\u00E3o da propriedade ''{1}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties index beae1b21ecd..2558ec3a5ed 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n @@ -71,14 +68,14 @@ unsupported-encoding = Kodningen {0} st\u00F6ds inte. #Error codes used in DOM Normalizer InvalidXMLCharInDOM = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i DOM vid normalisering. -UndeclaredEntRefInAttrValue = Attributet \"{0}\" med v\u00E4rdet \"{1}\" refererade en enhet som inte har deklarerats. +UndeclaredEntRefInAttrValue = Attributet "{0}" med v\u00E4rdet "{1}" refererade en enhet som inte har deklarerats. NullLocalElementName = Ett lokalt namn med null-v\u00E4rde p\u00E5tr\u00E4ffades vid namnrymdsnormalisering av elementet {0}. NullLocalAttrName = Ett lokalt namn med null-v\u00E4rde p\u00E5tr\u00E4ffades vid namnrymdsnormalisering av attributet {0}. #Error codes used in DOMParser -InvalidDocumentClassName = Klassnamnet p\u00E5 dokumentfabrik \"{0}\" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det \u00E4r inte typ org.w3c.dom.Document. -MissingDocumentClassName = Hittade inte klassnamnet p\u00E5 dokumentfabrik \"{0}\" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det. -CannotCreateDocumentClass = Klassen \"{0}\" kunde inte konstrueras som org.w3c.dom.Document. +InvalidDocumentClassName = Klassnamnet p\u00E5 dokumentfabrik "{0}" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det \u00E4r inte typ org.w3c.dom.Document. +MissingDocumentClassName = Hittade inte klassnamnet p\u00E5 dokumentfabrik "{0}" som anv\u00E4nds vid konstruktion av DOM-tr\u00E4det. +CannotCreateDocumentClass = Klassen "{0}" kunde inte konstrueras som org.w3c.dom.Document. # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = Egenskapen ''{0}'' m\u00E5ste anges f\u00F6re inst\u00E4llning av egenskapen ''{1}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties index 222f07ed9ed..ccc991a6e16 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n @@ -71,14 +68,14 @@ unsupported-encoding = \u4E0D\u652F\u6301\u7F16\u7801{0}\u3002 #Error codes used in DOM Normalizer InvalidXMLCharInDOM = \u8FDB\u884C\u89C4\u8303\u5316\u65F6, \u5728 DOM \u4E2D\u627E\u5230\u7684 XML \u5B57\u7B26 (Unicode: 0x{0}) \u65E0\u6548\u3002 -UndeclaredEntRefInAttrValue = \u5C5E\u6027 \"{0}\" \u503C \"{1}\" \u5F15\u7528\u4E86\u672A\u58F0\u660E\u7684\u5B9E\u4F53\u3002 +UndeclaredEntRefInAttrValue = \u5C5E\u6027 "{0}" \u503C "{1}" \u5F15\u7528\u4E86\u672A\u58F0\u660E\u7684\u5B9E\u4F53\u3002 NullLocalElementName = \u5BF9\u5143\u7D20{0}\u8FDB\u884C\u540D\u79F0\u7A7A\u95F4\u89C4\u8303\u5316\u65F6\u9047\u5230\u4E86\u7A7A\u672C\u5730\u540D\u79F0\u3002 NullLocalAttrName = \u5BF9\u5C5E\u6027{0}\u8FDB\u884C\u540D\u79F0\u7A7A\u95F4\u89C4\u8303\u5316\u65F6\u9047\u5230\u4E86\u7A7A\u672C\u5730\u540D\u79F0\u3002 #Error codes used in DOMParser -InvalidDocumentClassName = \u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 \"{0}\" \u7684\u7C7B\u540D\u4E0D\u662F org.w3c.dom.Document \u7C7B\u578B\u3002 -MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 \"{0}\" \u7684\u7C7B\u540D\u3002 -CannotCreateDocumentClass = \u540D\u4E3A \"{0}\" \u7684\u7C7B\u65E0\u6CD5\u6784\u9020\u4E3A org.w3c.dom.Document\u3002 +InvalidDocumentClassName = \u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 "{0}" \u7684\u7C7B\u540D\u4E0D\u662F org.w3c.dom.Document \u7C7B\u578B\u3002 +MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u4E8E\u6784\u9020 DOM \u6811\u7684\u6587\u6863\u5DE5\u5382 "{0}" \u7684\u7C7B\u540D\u3002 +CannotCreateDocumentClass = \u540D\u4E3A "{0}" \u7684\u7C7B\u65E0\u6CD5\u6784\u9020\u4E3A org.w3c.dom.Document\u3002 # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = \u5FC5\u987B\u5728\u8BBE\u7F6E\u5C5E\u6027 ''{1}'' \u4E4B\u524D\u8BBE\u7F6E\u5C5E\u6027 ''{0}''\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties index f9a4c0341fc..4ae403e235f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # DOM implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DOMMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DOMMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n @@ -71,14 +68,14 @@ unsupported-encoding = \u4E0D\u652F\u63F4\u7DE8\u78BC {0}\u3002 #Error codes used in DOM Normalizer InvalidXMLCharInDOM = \u6B63\u898F\u5316\u671F\u9593\u5728 DOM \u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 -UndeclaredEntRefInAttrValue = \u5C6C\u6027 \"{0}\" \u503C \"{1}\" \u53C3\u7167\u672A\u5BA3\u544A\u7684\u500B\u9AD4\u3002 +UndeclaredEntRefInAttrValue = \u5C6C\u6027 "{0}" \u503C "{1}" \u53C3\u7167\u672A\u5BA3\u544A\u7684\u5BE6\u9AD4\u3002 NullLocalElementName = \u5143\u7D20 {0} \u547D\u540D\u7A7A\u9593\u6B63\u898F\u5316\u671F\u9593\uFF0C\u51FA\u73FE\u7A7A\u503C\u5340\u57DF\u540D\u7A31\u3002 NullLocalAttrName = \u5C6C\u6027 {0} \u547D\u540D\u7A7A\u9593\u6B63\u898F\u5316\u671F\u9593\uFF0C\u51FA\u73FE\u7A7A\u503C\u5340\u57DF\u540D\u7A31\u3002 #Error codes used in DOMParser -InvalidDocumentClassName = \u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 \"{0}\" \u985E\u5225\u540D\u7A31\u4E26\u975E\u985E\u578B org.w3c.dom.Document\u3002 -MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 \"{0}\" \u985E\u5225\u540D\u7A31\u3002 -CannotCreateDocumentClass = \u540D\u7A31\u70BA \"{0}\" \u7684\u985E\u5225\u7121\u6CD5\u5EFA\u69CB\u70BA org.w3c.dom.Document\u3002 +InvalidDocumentClassName = \u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 "{0}" \u985E\u5225\u540D\u7A31\u4E26\u975E\u985E\u578B org.w3c.dom.Document\u3002 +MissingDocumentClassName = \u627E\u4E0D\u5230\u7528\u65BC\u5EFA\u69CB DOM \u6A39\u72C0\u7D50\u69CB\u7684\u6587\u4EF6\u8655\u7406\u7AD9 "{0}" \u985E\u5225\u540D\u7A31\u3002 +CannotCreateDocumentClass = \u540D\u7A31\u70BA "{0}" \u7684\u985E\u5225\u7121\u6CD5\u5EFA\u69CB\u70BA org.w3c.dom.Document\u3002 # Error codes used by JAXP DocumentBuilder jaxp-order-not-supported = \u8A2D\u5B9A\u5C6C\u6027 ''{1}'' \u4E4B\u524D\uFF0C\u5FC5\u9808\u8A2D\u5B9A\u5C6C\u6027 ''{0}''\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties index ad146ca1987..14baff4c0cf 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n FieldCannotBeNull={0} kann nicht mit "Null"-Parameter aufgerufen werden. -UnknownField={0} mit unbekanntem Feld aufgerufen\:{1} +UnknownField={0} mit unbekanntem Feld aufgerufen:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=Jahr \= {0}, Monat \= {1}, Tag \= {2}, Stunde\= {3}, Minute \= {4}, Sekunde \= {5}, fractionalSecond \= {6}, Zeitzone \= {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender. +InvalidXGCValue-milli=Jahr = {0}, Monat = {1}, Tag = {2}, Stunde= {3}, Minute = {4}, Sekunde = {5}, fractionalSecond = {6}, Zeitzone = {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=Jahr \= {0}, Monat \= {1}, Tag \= {2}, Stunde\= {3}, Minute \= {4}, Sekunde \= {5}, fractionalSecond \= {6}, Zeitzone \= {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender. +InvalidXGCValue-fractional=Jahr = {0}, Monat = {1}, Tag = {2}, Stunde= {3}, Minute = {4}, Sekunde = {5}, fractionalSecond = {6}, Zeitzone = {7} ist keine g\u00FCltige Darstellung eines XML-Wertes f\u00FCr einen gregorianischen Kalender. InvalidXGCFields=Ung\u00FCltige Gruppe von Feldern f\u00FCr XMLGregorianCalendar festgelegt diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties index 41f6c95b524..73bfbc7af94 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n FieldCannotBeNull=no se puede llamar a {0} con un par\u00E1metro ''nulo''. -UnknownField=se ha llamado a {0} con un campo desconocido\:{1} +UnknownField=se ha llamado a {0} con un campo desconocido:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=A\u00F1o \= {0}, Mes \= {1}, D\u00EDa \= {2}, Hora \= {3}, Minuto \= {4}, Segundo \= {5}, Segundo Fraccionario \= {6}, Zona Horaria \= {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML. +InvalidXGCValue-milli=A\u00F1o = {0}, Mes = {1}, D\u00EDa = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, Segundo Fraccionario = {6}, Zona Horaria = {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=A\u00F1o \= {0}, Mes \= {1}, D\u00EDa \= {2}, Hora \= {3}, Minuto \= {4}, Segundo \= {5}, Segundo Fraccionario \= {6}, Zona Horaria \= {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML. +InvalidXGCValue-fractional=A\u00F1o = {0}, Mes = {1}, D\u00EDa = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, Segundo Fraccionario = {6}, Zona Horaria = {7} , no es una representaci\u00F3n v\u00E1lida de un valor del calendario gregoriano XML. InvalidXGCFields=Juego de campos no v\u00E1lido definido para el calendario gregoriano XML diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties index 50aa2ccbd5a..e45255b69b2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n FieldCannotBeNull=Impossible d''appeler {0} avec le param\u00E8tre ''null''. -UnknownField={0} a \u00E9t\u00E9 appel\u00E9 avec un champ inconnu \: {1} +UnknownField={0} a \u00E9t\u00E9 appel\u00E9 avec un champ inconnu : {1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=Ann\u00E9e \= {0}, Mois \= {1}, Jour \= {2}, Heure \= {3}, Minute \= {4}, Seconde \= {5}, Fraction de seconde \= {6}, Fuseau horaire \= {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides. +InvalidXGCValue-milli=Ann\u00E9e = {0}, Mois = {1}, Jour = {2}, Heure = {3}, Minute = {4}, Seconde = {5}, Fraction de seconde = {6}, Fuseau horaire = {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=Ann\u00E9e \= {0}, Mois \= {1}, Jour \= {2}, Heure \= {3}, Minute \= {4}, Seconde \= {5}, Fraction de seconde \= {6}, Fuseau horaire \= {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides. +InvalidXGCValue-fractional=Ann\u00E9e = {0}, Mois = {1}, Jour = {2}, Heure = {3}, Minute = {4}, Seconde = {5}, Fraction de seconde = {6}, Fuseau horaire = {7} ne repr\u00E9sentent pas des valeurs de calendrier gr\u00E9gorien XML valides. InvalidXGCFields=Ensemble de champs non valide pour XMLGregorianCalendar diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties index 667f8715ef5..e08b8e0870c 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n FieldCannotBeNull=Impossibile richiamare {0} con un parametro ''null''. -UnknownField={0} richiamato con un campo sconosciuto\:{1} +UnknownField={0} richiamato con un campo sconosciuto:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=Anno \= {0}, mese \= {1}, giorno \= {2}, ora \= {3}, minuto \= {4}, secondo \= {5}, frazione di secondo \= {6}, fuso orario \= {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML. +InvalidXGCValue-milli=Anno = {0}, mese = {1}, giorno = {2}, ora = {3}, minuto = {4}, secondo = {5}, frazione di secondo = {6}, fuso orario = {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=Anno \= {0}, mese \= {1}, giorno \= {2}, ora \= {3}, minuto \= {4}, secondo \= {5}, frazione di secondo \= {6}, fuso orario \= {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML. +InvalidXGCValue-fractional=Anno = {0}, mese = {1}, giorno = {2}, ora = {3}, minuto = {4}, secondo = {5}, frazione di secondo = {6}, fuso orario = {7} non \u00E8 una rappresentazione valida di un valore di calendario gregoriano XML. InvalidXGCFields=Impostato set di campi non valido per XMLGregorianCalendar diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties index f51ba16fcdf..1cfe77062cc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n FieldCannotBeNull={0}\u306F''null''\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u547C\u3073\u51FA\u305B\u307E\u305B\u3093\u3002 -UnknownField={0}\u306F\u4E0D\u660E\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u3067\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F\: {1} +UnknownField={0}\u306F\u4E0D\u660E\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u3067\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F: {1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=\u5E74\={0}\u3001\u6708\={1}\u3001\u65E5\={2}\u3001\u6642\={3}\u3001\u5206\={4}\u3001\u79D2\={5}\u3001\u5C0F\u6570\u79D2\={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 +InvalidXGCValue-milli=\u5E74={0}\u3001\u6708={1}\u3001\u65E5={2}\u3001\u6642={3}\u3001\u5206={4}\u3001\u79D2={5}\u3001\u5C0F\u6570\u79D2={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=\u5E74\={0}\u3001\u6708\={1}\u3001\u65E5\={2}\u3001\u6642\={3}\u3001\u5206\={4}\u3001\u79D2\={5}\u3001\u5C0F\u6570\u79D2\={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 +InvalidXGCValue-fractional=\u5E74={0}\u3001\u6708={1}\u3001\u65E5={2}\u3001\u6642={3}\u3001\u5206={4}\u3001\u79D2={5}\u3001\u5C0F\u6570\u79D2={6}\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3={7}\u306F\u3001XML\u30B0\u30EC\u30B4\u30EA\u30AA\u66A6\u306E\u5024\u306E\u6709\u52B9\u306A\u8868\u73FE\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 InvalidXGCFields=XMLGregorianCalendar\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u30FB\u30BB\u30C3\u30C8\u304C\u7121\u52B9\u3067\u3059 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties index f3b05ec7434..bbc91843e32 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n FieldCannotBeNull={0}\uC740(\uB294) ''null'' \uB9E4\uAC1C\uBCC0\uC218\uB85C \uD638\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. -UnknownField={0}\uC774(\uAC00) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uB85C \uD638\uCD9C\uB428\:{1} +UnknownField={0}\uC774(\uAC00) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uB85C \uD638\uCD9C\uB428:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=\uC5F0\uB3C4 \= {0}, \uC6D4 \= {1}, \uB0A0\uC9DC \= {2}, \uC2DC\uAC04 \= {3}, \uBD84 \= {4}, \uCD08 \= {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 \= {6}, \uC2DC\uAC04\uB300 \= {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4. +InvalidXGCValue-milli=\uC5F0\uB3C4 = {0}, \uC6D4 = {1}, \uB0A0\uC9DC = {2}, \uC2DC\uAC04 = {3}, \uBD84 = {4}, \uCD08 = {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 = {6}, \uC2DC\uAC04\uB300 = {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=\uC5F0\uB3C4 \= {0}, \uC6D4 \= {1}, \uB0A0\uC9DC \= {2}, \uC2DC\uAC04 \= {3}, \uBD84 \= {4}, \uCD08 \= {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 \= {6}, \uC2DC\uAC04\uB300 \= {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4. +InvalidXGCValue-fractional=\uC5F0\uB3C4 = {0}, \uC6D4 = {1}, \uB0A0\uC9DC = {2}, \uC2DC\uAC04 = {3}, \uBD84 = {4}, \uCD08 = {5}, \uC18C\uC218\uC810 \uC774\uD558 \uCD08 = {6}, \uC2DC\uAC04\uB300 = {7}\uC740(\uB294) XML \uC591\uB825 \uAC12\uC5D0 \uBD80\uC801\uD569\uD55C \uD615\uC2DD\uC785\uB2C8\uB2E4. InvalidXGCFields=XMLGregorianCalendar\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uD544\uB4DC \uC9D1\uD569\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties index e8cc6814088..8f836ee7b0e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n FieldCannotBeNull={0} n\u00E3o pode ser chamado com o par\u00E2metro ''null''. -UnknownField={0} chamado com um campo desconhecido\:{1} +UnknownField={0} chamado com um campo desconhecido:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=Ano \= {0}, M\u00EAs \= {1}, Dia \= {2}, Hora \= {3}, Minuto \= {4}, Segundo \= {5}, fractionalSecond \= {6}, Fuso hor\u00E1rio \= {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML. +InvalidXGCValue-milli=Ano = {0}, M\u00EAs = {1}, Dia = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, fractionalSecond = {6}, Fuso hor\u00E1rio = {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=Ano \= {0}, M\u00EAs \= {1}, Dia \= {2}, Hora \= {3}, Minuto \= {4}, Segundo \= {5}, fractionalSecond \= {6}, Fuso hor\u00E1rio \= {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML. +InvalidXGCValue-fractional=Ano = {0}, M\u00EAs = {1}, Dia = {2}, Hora = {3}, Minuto = {4}, Segundo = {5}, fractionalSecond = {6}, Fuso hor\u00E1rio = {7} , n\u00E3o \u00E9 uma representa\u00E7\u00E3o v\u00E1lida de um valor do Calend\u00E1rio Gregoriano XML. InvalidXGCFields=Conjunto inv\u00E1lido de conjunto de campos para XMLGregorianCalendar diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties index 79766e3144f..4778bdabbc6 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n FieldCannotBeNull={0} kan inte anropas med null-parameter. -UnknownField={0} anropades med ok\u00E4nt f\u00E4lt\:{1} +UnknownField={0} anropades med ok\u00E4nt f\u00E4lt:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=\u00C5r \= {0}, m\u00E5nad \= {1}, dag \= {2}, timme \= {3}, minut \= {4}, sekund \= {5}, br\u00E5kdelssekund \= {6}, tidszon \= {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML. +InvalidXGCValue-milli=\u00C5r = {0}, m\u00E5nad = {1}, dag = {2}, timme = {3}, minut = {4}, sekund = {5}, br\u00E5kdelssekund = {6}, tidszon = {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML. #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=\u00C5r \= {0}, m\u00E5nad \= {1}, dag \= {2}, timme \= {3}, minut \= {4}, sekund \= {5}, br\u00E5kdelssekund \= {6}, tidszon \= {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML. +InvalidXGCValue-fractional=\u00C5r = {0}, m\u00E5nad = {1}, dag = {2}, timme = {3}, minut = {4}, sekund = {5}, br\u00E5kdelssekund = {6}, tidszon = {7} \u00E4r ogiltigt v\u00E4rde f\u00F6r gregoriansk kalender i XML. InvalidXGCFields=Ogiltig upps\u00E4ttning med f\u00E4lt angivet i XMLGregorianCalendar diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties index 105ca572bbe..19950952522 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n FieldCannotBeNull=\u65E0\u6CD5\u4F7F\u7528 ''null'' \u53C2\u6570\u8C03\u7528{0}\u3002 -UnknownField=\u4F7F\u7528\u672A\u77E5\u5B57\u6BB5\u8C03\u7528\u4E86{0}\: {1} +UnknownField=\u4F7F\u7528\u672A\u77E5\u5B57\u6BB5\u8C03\u7528\u4E86{0}: {1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=\u5E74 \= {0}, \u6708 \= {1}, \u65E5 \= {2}, \u5C0F\u65F6 \= {3}, \u5206 \= {4}, \u79D2 \= {5}, \u5C0F\u6570\u79D2 \= {6}, \u65F6\u533A \= {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002 +InvalidXGCValue-milli=\u5E74 = {0}, \u6708 = {1}, \u65E5 = {2}, \u5C0F\u65F6 = {3}, \u5206 = {4}, \u79D2 = {5}, \u5C0F\u6570\u79D2 = {6}, \u65F6\u533A = {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002 #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=\u5E74 \= {0}, \u6708 \= {1}, \u65E5 \= {2}, \u5C0F\u65F6 \= {3}, \u5206 \= {4}, \u79D2 \= {5}, \u5C0F\u6570\u79D2 \= {6}, \u65F6\u533A \= {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002 +InvalidXGCValue-fractional=\u5E74 = {0}, \u6708 = {1}, \u65E5 = {2}, \u5C0F\u65F6 = {3}, \u5206 = {4}, \u79D2 = {5}, \u5C0F\u6570\u79D2 = {6}, \u65F6\u533A = {7} \u4E0D\u662F XML \u683C\u91CC\u5386\u503C\u7684\u6709\u6548\u8868\u793A\u3002 InvalidXGCFields=\u4E3A XMLGregorianCalendar \u8BBE\u7F6E\u7684\u5B57\u6BB5\u96C6\u65E0\u6548 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties index 0e3f7082bf3..dd2442b1120 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties @@ -1,46 +1,43 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Datatype API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: DatatypeMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: DatatypeMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n FieldCannotBeNull=\u7121\u6CD5\u4F7F\u7528 ''null'' \u53C3\u6578\u547C\u53EB {0} -UnknownField=\u4F7F\u7528\u4E0D\u660E\u7684\u6B04\u4F4D\u547C\u53EB {0}\:{1} +UnknownField=\u4F7F\u7528\u4E0D\u660E\u7684\u6B04\u4F4D\u547C\u53EB {0}:{1} #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-milli=\u5E74 \= {0}\u3001\u6708 \= {1}\uFF0C\u65E5 \= {2}\uFF0C\u5C0F\u6642 \= {3}\uFF0C\u5206\u9418\uFF0C \= {4}\uFF0C\u79D2 \= {5}\uFF0C\u5C0F\u6578\u79D2 \= {6}\uFF0C\u6642\u5340\uFF0C \= {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002 +InvalidXGCValue-milli=\u5E74 = {0}\u3001\u6708 = {1}\uFF0C\u65E5 = {2}\uFF0C\u5C0F\u6642 = {3}\uFF0C\u5206\u9418\uFF0C = {4}\uFF0C\u79D2 = {5}\uFF0C\u5C0F\u6578\u79D2 = {6}\uFF0C\u6642\u5340\uFF0C = {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002 #There are two similar keys 'InvalidXMLGreogorianCalendarValue' . Suffix (year, month) has been added and are used as per the context. -InvalidXGCValue-fractional=\u5E74 \= {0}\u3001\u6708 \= {1}\uFF0C\u65E5 \= {2}\uFF0C\u5C0F\u6642 \= {3}\uFF0C\u5206\u9418\uFF0C \= {4}\uFF0C\u79D2 \= {5}\uFF0C\u5C0F\u6578\u79D2 \= {6}\uFF0C\u6642\u5340\uFF0C \= {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002 +InvalidXGCValue-fractional=\u5E74 = {0}\u3001\u6708 = {1}\uFF0C\u65E5 = {2}\uFF0C\u5C0F\u6642 = {3}\uFF0C\u5206\u9418\uFF0C = {4}\uFF0C\u79D2 = {5}\uFF0C\u5C0F\u6578\u79D2 = {6}\uFF0C\u6642\u5340\uFF0C = {7}\uFF0C\u4E0D\u662F XML \u516C\u66C6\u503C\u7684\u6709\u6548\u8868\u793A\u6CD5\u3002 InvalidXGCFields=XMLGregorianCalendar \u8A2D\u5B9A\u4E86\u7121\u6548\u7684\u6B04\u4F4D\u96C6 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties index 83e0753b13d..8a349c53778 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ # Messages for message reporting BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties index b526aaf066c..9c02b32abf9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ # Messages for message reporting BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties index 53d17ecefd2..9e12758e6bb 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ # Messages for message reporting BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. @@ -45,7 +42,7 @@ SchemaFactorySourceUnrecognized = Le param\u00E8tre source de type ''{0}'' n''es # Validator error messages SourceParameterNull = Le param\u00E8tre source ne peut pas \u00EAtre NULL. -SourceNotAccepted = Le param\u00E8tre source de type ''{0}'' n''est pas accept\u00E9 par ce contr\u00F4le de validation (validator). +SourceNotAccepted = Le param\u00E8tre source de type ''{0}'' n''est pas accept\u00E9 par ce valideur. SourceResultMismatch = Le param\u00E8tre source de type ''{0}'' n''est pas compatible avec le param\u00E8tre de r\u00E9sultat de type ''{1}''. # TypeInfoProvider error messages diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties index b7be5ce3401..86a927e085c 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ # Messages for message reporting BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties index 758d20fe98e..122feead430 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties index b6b0c4314f0..8f01010d5d1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ # Messages for message reporting BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties index 818ccf89a09..0ec9da84643 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ # Messages for message reporting BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties index 38faacbb38e..83884aeb7c8 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ # Messages for message reporting BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties index cf4bd163f2a..757845f41ba 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties index 60ffc01dbf7..4d78213a044 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces JAXP Validation API implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: JAXPValidationMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: JAXPValidationMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties index 311204978ef..78add948a60 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. @@ -48,7 +45,7 @@ feature-not-recognized = Feature "{0}" ist unbekannt. true-not-supported = Status "True" f\u00FCr Feature "{0}" wird nicht unterst\u00FCtzt. false-not-supported = Status "False" f\u00FCr Feature "{0}" wird nicht unterst\u00FCtzt. feature-read-only = Feature "{0}" ist schreibgesch\u00FCtzt. -jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist. +jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: Feature kann nicht auf "false" gesetzt werden, wenn Security Manager vorhanden ist. # property messages property-not-supported = Eigenschaft "{0}" wird nicht unterst\u00FCtzt. @@ -60,5 +57,5 @@ incompatible-class = Der f\u00FCr Eigenschaft "{0}" angegebene Wert kann nicht i start-document-not-called=Eigenschaft "{0}" sollte aufgerufen werden, nachdem das startDocument-Ereignis ausgel\u00F6st wurde nullparameter=Namensparameter f\u00FCr "{0}" ist null -errorHandlerNotSet=Warnung\: Validierung wurde eingeschaltet, aber es wurde kein org.xml.sax.ErrorHandler festgelegt. Dies ist wahrscheinlich nicht beabsichtigt. Parser druckt die ersten {0} Fehler mit einem Standard-ErrorHandler. Rufen Sie die Methode "setErrorHandler" auf, um dies zu beheben. -errorHandlerDebugMsg=Fehler\: URI \= "{0}", Zeile \= "{1}", \: {2} +errorHandlerNotSet=Warnung: Validierung wurde eingeschaltet, aber es wurde kein org.xml.sax.ErrorHandler festgelegt. Dies ist wahrscheinlich nicht beabsichtigt. Parser druckt die ersten {0} Fehler mit einem Standard-ErrorHandler. Rufen Sie die Methode "setErrorHandler" auf, um dies zu beheben. +errorHandlerDebugMsg=Fehler: URI = "{0}", Zeile = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties index 377aac9cd69..60d5cfe3f74 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. @@ -60,5 +57,5 @@ incompatible-class = El valor especificado para la propiedad ''{0}'' no se puede start-document-not-called=La propiedad "{0}" debe llamarse despu\u00E9s de que se haya devuelto el evento startDocument nullparameter=el par\u00E1metro de nombre para "{0}" es nulo -errorHandlerNotSet=Advertencia\: se activ\u00F3 la validaci\u00F3n pero no se defini\u00F3 un org.xml.sax.ErrorHandler, lo cual probablemente sea un resultado no deseado. El analizador utilizar\u00E1 un ErrorHandler por defecto para imprimir los primeros {0} errores. Llame al m\u00E9todo ''setErrorHandler'' para solucionarlo. -errorHandlerDebugMsg=Error\: URI \= "{0}", L\u00EDnea \= "{1}", \: {2} +errorHandlerNotSet=Advertencia: se activ\u00F3 la validaci\u00F3n pero no se defini\u00F3 un org.xml.sax.ErrorHandler, lo cual probablemente sea un resultado no deseado. El analizador utilizar\u00E1 un ErrorHandler por defecto para imprimir los primeros {0} errores. Llame al m\u00E9todo ''setErrorHandler'' para solucionarlo. +errorHandlerDebugMsg=Error: URI = "{0}", L\u00EDnea = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties index 5d7dbb92a47..97e7f3d98c1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. @@ -60,5 +57,5 @@ incompatible-class = La valeur indiqu\u00E9e pour la propri\u00E9t\u00E9 ''{0}'' start-document-not-called=La propri\u00E9t\u00E9 "{0}" doit \u00EAtre appel\u00E9e apr\u00E8s qu''un \u00E9v\u00E9nement startDocument est g\u00E9n\u00E9r\u00E9 nullparameter=le param\u00E8tre de nom pour "{0}" est NULL -errorHandlerNotSet=Avertissement \: la validation a \u00E9t\u00E9 activ\u00E9e mais aucun \u00E9l\u00E9ment org.xml.sax.ErrorHandler n''a \u00E9t\u00E9 d\u00E9fini, ce qui devrait probablement \u00EAtre le cas. L''analyseur utilisera un gestionnaire d''erreurs par d\u00E9faut pour imprimer les {0} premi\u00E8res erreurs. Appelez la m\u00E9thode ''setErrorHandler'' pour r\u00E9soudre ce probl\u00E8me. -errorHandlerDebugMsg=Erreur \: URI \= "{0}", ligne \= "{1}", \: {2} +errorHandlerNotSet=Avertissement : la validation a \u00E9t\u00E9 activ\u00E9e mais aucun \u00E9l\u00E9ment org.xml.sax.ErrorHandler n''a \u00E9t\u00E9 d\u00E9fini, ce qui devrait probablement \u00EAtre le cas. L''analyseur utilisera un gestionnaire d''erreurs par d\u00E9faut pour imprimer les {0} premi\u00E8res erreurs. Appelez la m\u00E9thode ''setErrorHandler'' pour r\u00E9soudre ce probl\u00E8me. +errorHandlerDebugMsg=Erreur : URI = "{0}", ligne = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties index 182ccba41cf..773b9a2d8d9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. @@ -60,5 +57,5 @@ incompatible-class = Impossibile eseguire la conversione cast del valore specifi start-document-not-called=Richiamare la propriet\u00E0 "{0}" dopo l''esecuzione dell''evento startDocument nullparameter=il parametro del nome per "{0}" \u00E8 nullo -errorHandlerNotSet=Avvertenza\: la convalida \u00E8 stata attivata, ma org.xml.sax.ErrorHandler non \u00E8 stato impostato, il che potrebbe essere un errore. Il parser utilizzer\u00E0 un ErrorHandler predefinito per visualizzare i primi {0} errori. Richiamare il metodo ''setErrorHandler'' per correggere questo problema. -errorHandlerDebugMsg=Errore\: URI \= "{0}", riga \= "{1}", \: {2} +errorHandlerNotSet=Avvertenza: la convalida \u00E8 stata attivata, ma org.xml.sax.ErrorHandler non \u00E8 stato impostato, il che potrebbe essere un errore. Il parser utilizzer\u00E0 un ErrorHandler predefinito per visualizzare i primi {0} errori. Richiamare il metodo ''setErrorHandler'' per correggere questo problema. +errorHandlerDebugMsg=Errore: URI = "{0}", riga = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties index 1bcf36606f0..5301c2f2ca7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 @@ -60,5 +57,5 @@ incompatible-class = \u30D7\u30ED\u30D1\u30C6\u30A3''{0}''\u306B\u6307\u5B9A\u30 start-document-not-called=startDocument\u30A4\u30D9\u30F3\u30C8\u304C\u30B9\u30ED\u30FC\u3055\u308C\u305F\u5F8C\u3001\u30D7\u30ED\u30D1\u30C6\u30A3"{0}"\u3092\u547C\u3073\u51FA\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 nullparameter="{0}"\u306E\u540D\u524D\u30D1\u30E9\u30E1\u30FC\u30BF\u304Cnull\u3067\u3059 -errorHandlerNotSet=\u8B66\u544A\: \u691C\u8A3C\u306F\u30AA\u30F3\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u304C\u3001org.xml.sax.ErrorHandler\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5FC5\u8981\u3068\u3055\u308C\u3066\u3044\u308B\u30CF\u30F3\u30C9\u30E9\u306F\u3053\u306E\u30CF\u30F3\u30C9\u30E9\u3067\u306F\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D1\u30FC\u30B5\u30FC\u3067\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306EErrorHandler\u3092\u4F7F\u7528\u3057\u3066\u6700\u521D\u306E{0}\u30A8\u30E9\u30FC\u304C\u51FA\u529B\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u554F\u984C\u3092\u4FEE\u6B63\u3059\u308B\u306B\u306F\u3001''setErrorHandler''\u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -errorHandlerDebugMsg=\u30A8\u30E9\u30FC\: URI \= "{0}"\u3001\u884C \= "{1}"\u3001\: {2} +errorHandlerNotSet=\u8B66\u544A: \u691C\u8A3C\u306F\u30AA\u30F3\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u304C\u3001org.xml.sax.ErrorHandler\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5FC5\u8981\u3068\u3055\u308C\u3066\u3044\u308B\u30CF\u30F3\u30C9\u30E9\u306F\u3053\u306E\u30CF\u30F3\u30C9\u30E9\u3067\u306F\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u30D1\u30FC\u30B5\u30FC\u3067\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306EErrorHandler\u3092\u4F7F\u7528\u3057\u3066\u6700\u521D\u306E{0}\u30A8\u30E9\u30FC\u304C\u51FA\u529B\u3055\u308C\u307E\u3059\u3002\u3053\u306E\u554F\u984C\u3092\u4FEE\u6B63\u3059\u308B\u306B\u306F\u3001''setErrorHandler''\u30E1\u30BD\u30C3\u30C9\u3092\u547C\u3073\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +errorHandlerDebugMsg=\u30A8\u30E9\u30FC: URI = "{0}"\u3001\u884C = "{1}"\u3001: {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties index 262052ce099..032a96d1e5a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. @@ -39,7 +36,7 @@ FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\u # JAXP messages schema-not-supported = \uC9C0\uC815\uB41C \uC2A4\uD0A4\uB9C8 \uC5B8\uC5B4\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. -jaxp-order-not-supported = ''{1}'' \uC18D\uC131\uC744 \uC124\uC815\uD558\uAE30 \uC804\uC5D0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD574\uC57C \uD569\uB2C8\uB2E4. +jaxp-order-not-supported = ''{1}'' \uC18D\uC131\uC744 \uC124\uC815\uD558\uAE30 \uC804\uC5D0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD574\uC57C \uD569\uB2C8\uB2E4. schema-already-specified = \uB110\uC774 \uC544\uB2CC \uC2A4\uD0A4\uB9C8 \uAC1D\uCCB4\uAC00 \uC774\uBBF8 \uC9C0\uC815\uB41C \uACBD\uC6B0 ''{0}'' \uC18D\uC131\uC744 \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. # feature messages @@ -60,5 +57,5 @@ incompatible-class = ''{0}'' \uC18D\uC131\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C start-document-not-called="{0}" \uC18D\uC131\uC740 startDocument \uC774\uBCA4\uD2B8\uAC00 \uBC1C\uC0DD\uB41C \uD6C4 \uD638\uCD9C\uD574\uC57C \uD569\uB2C8\uB2E4. nullparameter="{0}"\uC5D0 \uB300\uD55C \uC774\uB984 \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uB110\uC785\uB2C8\uB2E4. -errorHandlerNotSet=\uACBD\uACE0\: \uAC80\uC99D\uC774 \uC124\uC815\uB418\uC5C8\uC9C0\uB9CC org.xml.sax.ErrorHandler\uAC00 \uC801\uC808\uD788 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uAE30\uBCF8 ErrorHandler\uB97C \uC0AC\uC6A9\uD558\uC5EC \uCC98\uC74C {0}\uAC1C\uC758 \uC624\uB958\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4. \uC774 \uC624\uB958\uB97C \uC218\uC815\uD558\uB824\uBA74 ''setErrorHandler'' \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD558\uC2ED\uC2DC\uC624. -errorHandlerDebugMsg=\uC624\uB958\: URI \= "{0}", \uD589 \= "{1}", \: {2} +errorHandlerNotSet=\uACBD\uACE0: \uAC80\uC99D\uC774 \uC124\uC815\uB418\uC5C8\uC9C0\uB9CC org.xml.sax.ErrorHandler\uAC00 \uC801\uC808\uD788 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uAE30\uBCF8 ErrorHandler\uB97C \uC0AC\uC6A9\uD558\uC5EC \uCC98\uC74C {0}\uAC1C\uC758 \uC624\uB958\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4. \uC774 \uC624\uB958\uB97C \uC218\uC815\uD558\uB824\uBA74 ''setErrorHandler'' \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD558\uC2ED\uC2DC\uC624. +errorHandlerDebugMsg=\uC624\uB958: URI = "{0}", \uD589 = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties index 8fde7087716..95425106f4f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. @@ -54,11 +51,11 @@ jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\ property-not-supported = A propriedade ''{0}'' n\u00E3o \u00E9 suportada. property-not-recognized = A propriedade ''{0}'' n\u00E3o \u00E9 reconhecida. property-read-only = A propriedade ''{0}'' \u00E9 somente para leitura. -property-not-parsing-supported = A propriedade ''{0}'' n\u00E3o \u00E9 suportada durante o parse. +property-not-parsing-supported = A propriedade ''{0}'' n\u00E3o \u00E9 suportada durante o parsing. dom-node-read-not-supported = N\u00E3o \u00E9 poss\u00EDvel ler a propriedade do n\u00F3 de DOM. N\u00E3o existe uma \u00E1rvore de DOM. incompatible-class = O valor especificado para a propriedade ''{0}'' n\u00E3o pode ser transmitido para ''{1}''. start-document-not-called=A propriedade "{0}" deve ser chamada ap\u00F3s o evento startDocument ser lan\u00E7ado nullparameter=o par\u00E2metro de nome de "{0}" \u00E9 nulo -errorHandlerNotSet=Advert\u00EAncia\: A valida\u00E7\u00E3o foi ativada, mas um org.xml.sax.ErrorHandler n\u00E3o foi definido, provavelmente porque n\u00E3o era necess\u00E1rio. O parser usar\u00E1 um ErrorHandler default para imprimir os primeiros {0} erros. Chame o m\u00E9todo ''setErrorHandler'' para corrigir o problema. -errorHandlerDebugMsg=Erro\: URI \= "{0}", Linha \= "{1}", \: {2} +errorHandlerNotSet=Advert\u00EAncia: A valida\u00E7\u00E3o foi ativada, mas um org.xml.sax.ErrorHandler n\u00E3o foi definido, provavelmente porque n\u00E3o era necess\u00E1rio. O parser usar\u00E1 um ErrorHandler default para imprimir os primeiros {0} erros. Chame o m\u00E9todo ''setErrorHandler'' para corrigir o problema. +errorHandlerDebugMsg=Erro: URI = "{0}", Linha = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties index 690a74064e8..1a5df9858d6 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. @@ -60,5 +57,5 @@ incompatible-class = V\u00E4rdet angivet f\u00F6r egenskapen ''{0}'' kan inte om start-document-not-called=Egenskapen "{0}" b\u00F6r anropas efter startDocument-h\u00E4ndelsen utl\u00F6ses nullparameter=namnparametern f\u00F6r "{0}" \u00E4r null -errorHandlerNotSet=Varning\: valideringen startades, men det fanns ingen angiven org.xml.sax.ErrorHandler. Parser anv\u00E4nder ErrorHandler av standardtyp vid utskrift av de f\u00F6rsta {0} felen. Korrigera felet genom anrop av setErrorHandler-metoden. -errorHandlerDebugMsg=Fel\: URI \= "{0}", Rad \= "{1}", \: {2} +errorHandlerNotSet=Varning: valideringen startades, men det fanns ingen angiven org.xml.sax.ErrorHandler. Parser anv\u00E4nder ErrorHandler av standardtyp vid utskrift av de f\u00F6rsta {0} felen. Korrigera felet genom anrop av setErrorHandler-metoden. +errorHandlerDebugMsg=Fel: URI = "{0}", Rad = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties index dcfdb68b143..4c425d1705d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 @@ -54,11 +51,11 @@ jaxp-secureprocessing-feature = FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security property-not-supported = \u4E0D\u652F\u6301\u5C5E\u6027 ''{0}''\u3002 property-not-recognized = \u65E0\u6CD5\u8BC6\u522B\u5C5E\u6027 ''{0}''\u3002 property-read-only = \u5C5E\u6027 ''{0}'' \u4E3A\u53EA\u8BFB\u3002 -property-not-parsing-supported = \u6267\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u4E0D\u652F\u6301\u5C5E\u6027 ''{0}''\u3002 +property-not-parsing-supported = \u89E3\u6790\u65F6\u4E0D\u652F\u6301\u5C5E\u6027 ''{0}''\u3002 dom-node-read-not-supported = \u65E0\u6CD5\u8BFB\u53D6 DOM \u8282\u70B9\u5C5E\u6027\u3002\u4E0D\u5B58\u5728 DOM \u6811\u3002 incompatible-class = \u4E3A\u5C5E\u6027 ''{0}'' \u6307\u5B9A\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3A{1}\u3002 start-document-not-called=\u5E94\u5728\u629B\u51FA startDocument \u4E8B\u4EF6\u540E\u8C03\u7528\u5C5E\u6027 "{0}" nullparameter="{0}" \u7684\u540D\u79F0\u53C2\u6570\u4E3A\u7A7A\u503C -errorHandlerNotSet=\u8B66\u544A\: \u5DF2\u542F\u7528\u9A8C\u8BC1, \u4F46\u672A\u8BBE\u7F6E org.xml.sax.ErrorHandler, \u8FD9\u53EF\u80FD\u4E0D\u662F\u9884\u671F\u7ED3\u679C\u3002\u8BED\u6CD5\u5206\u6790\u5668\u5C06\u4F7F\u7528\u9ED8\u8BA4 ErrorHandler \u6765\u8F93\u51FA\u524D {0} \u4E2A\u9519\u8BEF\u3002\u8BF7\u8C03\u7528 ''setErrorHandler'' \u65B9\u6CD5\u4EE5\u89E3\u51B3\u6B64\u95EE\u9898\u3002 -errorHandlerDebugMsg=\u9519\u8BEF\: URI \= "{0}", \u884C \= "{1}", \: {2} +errorHandlerNotSet=\u8B66\u544A: \u5DF2\u542F\u7528\u9A8C\u8BC1, \u4F46\u672A\u8BBE\u7F6E org.xml.sax.ErrorHandler, \u8FD9\u53EF\u80FD\u4E0D\u662F\u9884\u671F\u7ED3\u679C\u3002\u89E3\u6790\u5668\u5C06\u4F7F\u7528\u9ED8\u8BA4 ErrorHandler \u6765\u8F93\u51FA\u524D {0} \u4E2A\u9519\u8BEF\u3002\u8BF7\u8C03\u7528 ''setErrorHandler'' \u65B9\u6CD5\u4EE5\u89E3\u51B3\u6B64\u95EE\u9898\u3002 +errorHandlerDebugMsg=\u9519\u8BEF: URI = "{0}", \u884C = "{1}", : {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties index 603df70cddc..7ee58dcddbf 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces # SAX implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: SAXMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: SAXMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 @@ -60,5 +57,5 @@ incompatible-class = \u70BA\u5C6C\u6027 ''{0}'' \u6307\u5B9A\u7684\u503C\u4E0D\u start-document-not-called=\u767C\u751F startDocument \u4E8B\u4EF6\u4E4B\u5F8C\uFF0C\u61C9\u547C\u53EB\u5C6C\u6027 "{0}"\u3002 nullparameter="{0}" \u7684\u540D\u7A31\u53C3\u6578\u70BA\u7A7A\u503C -errorHandlerNotSet=\u8B66\u544A\: \u5DF2\u958B\u555F\u9A57\u8B49\uFF0C\u4F46\u662F\u672A\u8A2D\u5B9A org.xml.sax.ErrorHandler\uFF0C\u9019\u53EF\u80FD\u4E0D\u662F\u6240\u8981\u7684\u72C0\u614B\u3002\u5256\u6790\u5668\u5C07\u4F7F\u7528\u9810\u8A2D\u7684 ErrorHandler \u4F86\u5217\u5370\u7B2C\u4E00\u500B {0} \u932F\u8AA4\u3002\u8ACB\u547C\u53EB ''setErrorHandler'' \u65B9\u6CD5\u4F86\u4FEE\u6B63\u6B64\u554F\u984C\u3002 -errorHandlerDebugMsg=\u932F\u8AA4\: URI \= "{0}"\uFF0C\u884C \= "{1}"\uFF0C\: {2} +errorHandlerNotSet=\u8B66\u544A: \u5DF2\u958B\u555F\u9A57\u8B49\uFF0C\u4F46\u662F\u672A\u8A2D\u5B9A org.xml.sax.ErrorHandler\uFF0C\u9019\u53EF\u80FD\u4E0D\u662F\u6240\u8981\u7684\u72C0\u614B\u3002\u5256\u6790\u5668\u5C07\u4F7F\u7528\u9810\u8A2D\u7684 ErrorHandler \u4F86\u5217\u5370\u7B2C\u4E00\u500B {0} \u932F\u8AA4\u3002\u8ACB\u547C\u53EB ''setErrorHandler'' \u65B9\u6CD5\u4F86\u4FEE\u6B63\u6B64\u554F\u984C\u3002 +errorHandlerDebugMsg=\u932F\u8AA4: URI = "{0}"\uFF0C\u884C = "{1}"\uFF0C: {2} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties index 58c045b8d32..6bb6cebb0a3 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. @@ -39,10 +36,10 @@ FallbackChild = Andere Elemente aus Namespace "http://www.w3.org/2001/XInclude" HrefMissing = "href"-Attribut eines "include"-Elements fehlt. RecursiveInclude = Rekursives "include" ermittelt. Dokument "{0}" wurde bereits verarbeitet. InvalidParseValue = Ung\u00FCltiger Wert f\u00FCr "parse"-Attribut bei "include"-Element: "{0}". -XMLParseError = Fehler beim Versuch, XML-Datei zu parsen (href="{0}"). Grund: {1} +XMLParseError = Fehler beim Versuch, XML-Datei zu parsen (href=''{0}''). Ursache: {1} XMLResourceError = Include-Vorgang nicht erfolgreich. Zur\u00FCck zu Fallback. Ressourcenfehler beim Lesen der Datei als XML (href="{0}"). Grund: {1} TextResourceError = Include-Vorgang nicht erfolgreich. Zur\u00FCck zu Fallback. Ressourcenfehler beim Lesen der Datei als Text (href="{0}"). Grund: {1} -NO_XPointerSchema = Schema f\u00FCr \"{0}\" wird standardm\u00E4\u00DFig nicht unterst\u00FCtzt. Definieren Sie Ihr eigenes Schema f\u00FCr {0}. Siehe http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = Schema f\u00FCr "{0}" wird standardm\u00E4\u00DFig nicht unterst\u00FCtzt. Definieren Sie Ihr eigenes Schema f\u00FCr {0}. Siehe http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = Keine Subressource von XPointer-Prozessor f\u00FCr Zeiger {0} identifiziert. NonDuplicateNotation = Mehrere Notationen mit dem Namen "{0}" wurden verwendet, die aber nicht als Duplikate ermittelt wurden. NonDuplicateUnparsedEntity = Mehrere nicht geparste Entit\u00E4ten mit dem Namen "{0}" wurden verwendet, die aber nicht als Duplikate ermittelt wurden. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties index 2bf1f2b47b0..26ccc9aef76 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. @@ -39,10 +36,10 @@ FallbackChild = No se permite que los elementos del espacio de nombres ''http:// HrefMissing = Falta el atributo 'href' de un elemento 'include'. RecursiveInclude = Se ha detectado un elemento include recursivo. El documento ''{0}'' ya se ha procesado. InvalidParseValue = Valor no v\u00E1lido para el atributo ''parse'' en el elemento ''include'': ''{0}''. -XMLParseError = Error al intentar analizar el archivo XML (href=''{0}''). Motivo: {1} +XMLParseError = Error al intentar analizar el archivo XML (href=''{0}''). Motivo: {1} XMLResourceError = Fallo de la operaci\u00F3n include, conversi\u00F3n a fallback. Error del recurso al leer el archivo como XML (href=''{0}''). Motivo: {1} TextResourceError = Fallo de la operaci\u00F3n include, conversi\u00F3n a fallback. Error del recurso al leer el archivo como texto (href=''{0}''). Motivo: {1} -NO_XPointerSchema = El esquema para \"{0}\" no est\u00E1 soportado por defecto. Defina su propio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = El esquema para "{0}" no est\u00E1 soportado por defecto. Defina su propio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = El procesador XPointer no ha identificado el subrecurso para el puntero {0}. NonDuplicateNotation = Se han utilizado varias notaciones con el nombre''{0}'', pero no se ha determinado que sean duplicados. NonDuplicateUnparsedEntity = Se han utilizado varias entidades no analizadas con el nombre''{0}'', pero no se ha determinado que sean duplicados. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties index 9a22cb4e2f2..fa5962f5147 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. @@ -42,7 +39,7 @@ InvalidParseValue = Valeur non valide pour l''attribut ''parse'' sur l''\u00E9l\ XMLParseError = Erreur lors de la tentative d''analyse du fichier XML (href=''{0}''). Raison : {1} XMLResourceError = Echec de l''op\u00E9ration Include, r\u00E9tablissement de l''\u00E9l\u00E9ment fallback. Erreur de ressource lors de la lecture du fichier en tant que XML (href=''{0}''). Raison : {1} TextResourceError = Echec de l''op\u00E9ration Include, r\u00E9tablissement de l''\u00E9l\u00E9ment fallback. Erreur de ressource lors de la lecture du fichier en tant que texte (href=''{0}''). Raison : {1} -NO_XPointerSchema = Par d\u00E9faut, le sch\u00E9ma pour \"{0}\" n''est pas pris en charge. D\u00E9finissez votre propre sch\u00E9ma pour {0}. Reportez-vous \u00E0 l''adresse http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = Par d\u00E9faut, le sch\u00E9ma pour "{0}" n''est pas pris en charge. D\u00E9finissez votre propre sch\u00E9ma pour {0}. Reportez-vous \u00E0 l''adresse http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = Aucune sous-ressource n''est identifi\u00E9e par le processeur XPointer pour le pointeur {0}. NonDuplicateNotation = Plusieurs notations portant le nom ''{0}'' ont \u00E9t\u00E9 utilis\u00E9es, mais elles n''ont pas \u00E9t\u00E9 consid\u00E9r\u00E9es comme des doublons. NonDuplicateUnparsedEntity = Plusieurs entit\u00E9s non analys\u00E9es portant le nom ''{0}'' ont \u00E9t\u00E9 utilis\u00E9es, mais elles n''ont pas \u00E9t\u00E9 consid\u00E9r\u00E9es comme des doublons. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties index 1cdc5442130..38e08cb92a9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. @@ -39,10 +36,10 @@ FallbackChild = Gli elementi dello spazio di nomi ''http://www.w3.org/2001/XIncl HrefMissing = Manca l'attributo 'href' di un elemento 'include'. RecursiveInclude = Inclusione ricorsiva rilevata. Il documento ''{0}'' \u00E8 gi\u00E0 stato elaborato. InvalidParseValue = Valore non valido per l''attributo ''parse'' nell''elemento ''include'': ''{0}''. -XMLParseError = Errore nel tentativo di analizzare il file XML (href=''{0}''). Motivo: {1} +XMLParseError = Errore durante il tentativo di analizzare il file XML (href=''{0}''). Causa: {1} XMLResourceError = Operazione di inclusione non riuscita. Verr\u00E0 ripristinato il fallback. Errore di risorsa durante la lettura del file come XML (href=''{0}''). Motivo: {1} TextResourceError = Operazione di inclusione non riuscita. Verr\u00E0 ripristinato il fallback. Errore di risorsa durante la lettura del file come testo (href=''{0}''). Motivo: {1} -NO_XPointerSchema = Lo schema per \"{0}\" non \u00E8 supportato per impostazione predefinita. Definire il proprio schema per {0}. Vedere http://apache.org/xml/properties/xpointer-schema. +NO_XPointerSchema = Lo schema per "{0}" non \u00E8 supportato per impostazione predefinita. Definire il proprio schema per {0}. Vedere http://apache.org/xml/properties/xpointer-schema. NO_SubResourceIdentified = Nessuna risorsa secondaria identificata dal processore XPointer per il puntatore {0}. NonDuplicateNotation = Sono state utilizzate pi\u00F9 notazioni con il nome ''{0}'', ma \u00E8 stato determinato che non sono duplicati. NonDuplicateUnparsedEntity = Sono state utilizzate pi\u00F9 entit\u00E0 non analizzate con il nome ''{0}'', ma \u00E8 stato determinato che non sono duplicati. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties index 6b88fe82e05..2034e72751e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 @@ -42,7 +39,7 @@ InvalidParseValue = ''include''\u8981\u7D20\u306E''parse''\u5C5E\u6027\u306E\u50 XMLParseError = XML\u30D5\u30A1\u30A4\u30EB\u306E\u89E3\u6790\u8A66\u884C\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1} XMLResourceError = \u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u64CD\u4F5C\u304C\u5931\u6557\u3057\u3001\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u306B\u623B\u308A\u307E\u3059\u3002\u30D5\u30A1\u30A4\u30EB\u3092XML\u3068\u3057\u3066\u8AAD\u53D6\u308A\u4E2D\u306B\u30EA\u30BD\u30FC\u30B9\u30FB\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1} TextResourceError = \u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u64CD\u4F5C\u304C\u5931\u6557\u3057\u3001\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u306B\u623B\u308A\u307E\u3059\u3002\u30D5\u30A1\u30A4\u30EB\u3092\u30C6\u30AD\u30B9\u30C8\u3068\u3057\u3066\u8AAD\u53D6\u308A\u4E2D\u306B\u30EA\u30BD\u30FC\u30B9\u30FB\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F(href=''{0}'')\u3002\u7406\u7531: {1} -NO_XPointerSchema = \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001\"{0}\"\u306E\u30B9\u30AD\u30FC\u30DE\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002{0}\u306B\u5BFE\u3057\u3066\u72EC\u81EA\u306E\u30B9\u30AD\u30FC\u30DE\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002http://apache.org/xml/properties/xpointer-schema\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044 +NO_XPointerSchema = \u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u306F\u3001"{0}"\u306E\u30B9\u30AD\u30FC\u30DE\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002{0}\u306B\u5BFE\u3057\u3066\u72EC\u81EA\u306E\u30B9\u30AD\u30FC\u30DE\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002http://apache.org/xml/properties/xpointer-schema\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044 NO_SubResourceIdentified = \u30DD\u30A4\u30F3\u30BF{0}\u306EXPointer\u30D7\u30ED\u30BB\u30C3\u30B5\u3067\u306F\u30B5\u30D6\u30EA\u30BD\u30FC\u30B9\u306F\u8B58\u5225\u3055\u308C\u307E\u305B\u3093\u3002 NonDuplicateNotation = \u540D\u524D\u304C''{0}''\u306E\u8907\u6570\u306E\u8868\u8A18\u6CD5\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u308C\u3089\u306E\u8868\u8A18\u6CD5\u306F\u91CD\u8907\u3068\u307F\u306A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 NonDuplicateUnparsedEntity = \u540D\u524D\u304C''{0}''\u306E\u8907\u6570\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u3053\u308C\u3089\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306F\u91CD\u8907\u3068\u307F\u306A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties index 570b7a7d583..40783603303 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. @@ -39,10 +36,10 @@ FallbackChild = ''include'' \uC678\uC5D0 \uB2E4\uB978 ''http://www.w3.org/2001/X HrefMissing = 'include' \uC694\uC18C\uC758 'href' \uC18D\uC131\uC774 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4. RecursiveInclude = \uC21C\uD658 include\uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. ''{0}'' \uBB38\uC11C\uAC00 \uC774\uBBF8 \uCC98\uB9AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. InvalidParseValue = ''include'' \uC694\uC18C\uC5D0 ''parse'' \uC18D\uC131\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uAC12\uC774 \uC788\uC74C: ''{0}''. -XMLParseError = XML \uD30C\uC77C(href=''{0}'')\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\uC6D0\uC778: {1} +XMLParseError = XML \uD30C\uC77C(href=''{0}'')\uC758 \uAD6C\uBB38\uC744 \uBD84\uC11D\uD558\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1} XMLResourceError = Include \uC791\uC5C5\uC744 \uC2E4\uD328\uD558\uC5EC fallback\uC73C\uB85C \uBCF5\uC6D0\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. \uD30C\uC77C\uC744 XML(href=''{0}'')\uB85C \uC77D\uB294 \uC911 \uB9AC\uC18C\uC2A4 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1} TextResourceError = Include \uC791\uC5C5\uC744 \uC2E4\uD328\uD558\uC5EC fallback\uC73C\uB85C \uBCF5\uC6D0\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. \uD30C\uC77C\uC744 \uD14D\uC2A4\uD2B8(href=''{0}'')\uB85C \uC77D\uB294 \uC911 \uB9AC\uC18C\uC2A4 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: {1} -NO_XPointerSchema = \uAE30\uBCF8\uC801\uC73C\uB85C \"{0}\"\uC5D0 \uB300\uD55C \uC2A4\uD0A4\uB9C8\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. {0}\uC5D0 \uB300\uD574 \uACE0\uC720\uD55C \uC2A4\uD0A4\uB9C8\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624. http://apache.org/xml/properties/xpointer-schema\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. +NO_XPointerSchema = \uAE30\uBCF8\uC801\uC73C\uB85C "{0}"\uC5D0 \uB300\uD55C \uC2A4\uD0A4\uB9C8\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. {0}\uC5D0 \uB300\uD574 \uACE0\uC720\uD55C \uC2A4\uD0A4\uB9C8\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624. http://apache.org/xml/properties/xpointer-schema\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. NO_SubResourceIdentified = {0} \uD3EC\uC778\uD130\uC5D0 \uB300\uD55C XPointer \uD504\uB85C\uC138\uC11C\uAC00 \uC2DD\uBCC4\uD55C \uD558\uC704 \uB9AC\uC18C\uC2A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. NonDuplicateNotation = \uC774\uB984\uC774 ''{0}''\uC774\uC9C0\uB9CC \uC911\uBCF5\uB41C \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC9C0 \uC54A\uC740 \uD45C\uAE30\uBC95\uC774 \uC5EC\uB7EC \uAC1C \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4. NonDuplicateUnparsedEntity = \uC774\uB984\uC774 ''{0}''\uC774\uC9C0\uB9CC \uC911\uBCF5\uB41C \uAC83\uC73C\uB85C \uD655\uC778\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uAC00 \uC5EC\uB7EC \uAC1C \uC0AC\uC6A9\uB418\uC5C8\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties index 5abd8266549..c40d3342d3e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. @@ -39,10 +36,10 @@ FallbackChild = Elementos do namespace ''http://www.w3.org/2001/XInclude'', dife HrefMissing = O atributo 'href' de um elemento 'include' n\u00E3o foi encontrado. RecursiveInclude = Inclus\u00E3o recursiva detectada. O documento ''{0}'' j\u00E1 foi processado. InvalidParseValue = Valor inv\u00E1lido para o atributo ''parse'' no elemento ''include'': ''{0}''. -XMLParseError = Erro ao tentar fazer parse do arquivo XML (href=''{0}''). Motivo: {1} +XMLParseError = Erro ao tentar fazer parse do arquivo XML (href=''{0}''). Motivo: {1} XMLResourceError = Falha na opera\u00E7\u00E3o de inclus\u00E3o; revertendo para fallback. Erro do recurso ao ler o arquivo como XML (href=''{0}''). Motivo: {1} TextResourceError = Falha na opera\u00E7\u00E3o de inclus\u00E3o; revertendo para fallback. Erro do recurso ao ler o arquivo como texto (href=''{0}''). Motivo: {1} -NO_XPointerSchema = Por default, o esquema para \"{0}\" n\u00E3o \u00E9 suportado. Defina seu pr\u00F3prio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = Por default, o esquema para "{0}" n\u00E3o \u00E9 suportado. Defina seu pr\u00F3prio esquema para {0}. Consulte http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = Nenhum Sub-recurso foi identificado pelo Processador XPointer do Ponteiro {0}. NonDuplicateNotation = Foram usadas v\u00E1rias nota\u00E7\u00F5es que tinham o nome ''{0}'', mas n\u00E3o foram determinadas como duplica\u00E7\u00F5es. NonDuplicateUnparsedEntity = Foram usadas v\u00E1rias entidades que tinham o nome ''{0}'', mas n\u00E3o foram determinadas como duplica\u00E7\u00F5es. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties index 426a5fa82bd..c75a115c60e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties @@ -1,37 +1,34 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n # Messages for erroneous input -NoFallback = Ett \''include\'' med href \''{0}\'' utf\u00F6rdes inte, hittade inget \u00E5terskapningselement (''fallback''). +NoFallback = Ett ''include'' med href ''{0}'' utf\u00F6rdes inte, hittade inget \u00E5terskapningselement (''fallback''). MultipleFallbacks = [underordnade] i ett 'include'-element f\u00E5r inte inneh\u00E5lla fler \u00E4n ett 'fallback'-element. FallbackParent = Ett 'fallback'-element hittades utan n\u00E5got 'include' som \u00F6verordnat element. IncludeChild = Element fr\u00E5n namnrymd ''http://www.w3.org/2001/XInclude'', ut\u00F6ver ''fallback'', \u00E4r inte till\u00E5tna som underordnade i ''include''-element. Hittade d\u00E4remot ''{0}''. @@ -42,7 +39,7 @@ InvalidParseValue = Ogiltigt v\u00E4rde f\u00F6r ''parse''-attribut i ''include' XMLParseError = Fel vid f\u00F6rs\u00F6k att tolka XML-fil (href=''{0}''). Orsak: {1} XMLResourceError = Inkluderings\u00E5tg\u00E4rden utf\u00F6rdes inte, \u00E5terst\u00E4ller genom att \u00E5terskapa. Resursfel vid l\u00E4sning av fil som XML (href=''{0}''). Orsak: {1} TextResourceError = Inkluderings\u00E5tg\u00E4rden utf\u00F6rdes inte, \u00E5terst\u00E4ller genom att \u00E5terskapa. Resursfel vid l\u00E4sning av fil som text (href=''{0}''). Orsak: {1} -NO_XPointerSchema = Schema f\u00F6r \"{0}\" st\u00F6ds inte som standard. Definiera ett eget schema f\u00F6r {0}.Se http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = Schema f\u00F6r "{0}" st\u00F6ds inte som standard. Definiera ett eget schema f\u00F6r {0}.Se http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = Ingen Subresource har identifierats av XPointer-processorn f\u00F6r pekare {0}. NonDuplicateNotation = Flera noteringar anv\u00E4nds med namnet ''{0}'', men som inte fastst\u00E4lls som dubbletter. NonDuplicateUnparsedEntity = Flera otolkade enheter anv\u00E4nds med namnet ''{0}'', men som inte fastst\u00E4lls som dubbletter. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties index bcbb3aa3f70..3231b731892 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 @@ -39,13 +36,13 @@ FallbackChild = \u4E0D\u5141\u8BB8\u5C06\u540D\u79F0\u7A7A\u95F4 ''http://www.w3 HrefMissing = \u7F3A\u5C11 'include' \u5143\u7D20\u7684 'href' \u5C5E\u6027\u3002 RecursiveInclude = \u68C0\u6D4B\u5230\u9012\u5F52 include\u3002\u5DF2\u5904\u7406\u6587\u6863 ''{0}''\u3002 InvalidParseValue = ''include'' \u5143\u7D20\u7684 ''parse'' \u5C5E\u6027\u7684\u503C\u65E0\u6548: ''{0}''\u3002 -XMLParseError = \u5C1D\u8BD5\u5BF9 XML \u6587\u4EF6 (href=''{0}'') \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u51FA\u9519\u3002\u539F\u56E0: {1} +XMLParseError = \u5C1D\u8BD5\u89E3\u6790 XML \u6587\u4EF6 (href=''{0}'') \u65F6\u51FA\u9519\u3002\u539F\u56E0: {1} XMLResourceError = Include \u64CD\u4F5C\u5931\u8D25, \u5E76\u8FD8\u539F\u4E3A fallback\u3002\u4EE5 XML (href=''{0}'') \u683C\u5F0F\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u73B0\u8D44\u6E90\u9519\u8BEF\u3002\u539F\u56E0: {1} TextResourceError = Include \u64CD\u4F5C\u5931\u8D25, \u5E76\u8FD8\u539F\u4E3A fallback\u3002\u4EE5\u6587\u672C (href=''{0}'') \u683C\u5F0F\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u73B0\u8D44\u6E90\u9519\u8BEF\u3002\u539F\u56E0: {1} -NO_XPointerSchema = \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u4E0D\u652F\u6301 \"{0}\" \u7684\u65B9\u6848\u3002\u8BF7\u4E3A{0}\u5B9A\u4E49\u60A8\u81EA\u5DF1\u7684\u65B9\u6848\u3002\u8BF7\u8BBF\u95EE http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = \u9ED8\u8BA4\u60C5\u51B5\u4E0B, \u4E0D\u652F\u6301 "{0}" \u7684\u65B9\u6848\u3002\u8BF7\u4E3A{0}\u5B9A\u4E49\u60A8\u81EA\u5DF1\u7684\u65B9\u6848\u3002\u8BF7\u8BBF\u95EE http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = \u65E0\u6CD5\u901A\u8FC7 XPointer Processor for Pointer {0} \u8BC6\u522B Subresource\u3002 NonDuplicateNotation = \u4F7F\u7528\u4E86\u591A\u4E2A\u540D\u4E3A ''{0}'' \u7684\u8BB0\u53F7, \u4F46\u672A\u5C06\u8FD9\u4E9B\u8BB0\u53F7\u786E\u5B9A\u4E3A\u91CD\u590D\u9879\u3002 -NonDuplicateUnparsedEntity = \u4F7F\u7528\u4E86\u591A\u4E2A\u540D\u4E3A ''{0}'' \u7684\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53, \u4F46\u672A\u5C06\u8FD9\u4E9B\u5B9E\u4F53\u786E\u5B9A\u4E3A\u91CD\u590D\u9879\u3002 +NonDuplicateUnparsedEntity = \u4F7F\u7528\u4E86\u591A\u4E2A\u540D\u4E3A ''{0}'' \u7684\u672A\u89E3\u6790\u5B9E\u4F53, \u4F46\u672A\u5C06\u8FD9\u4E9B\u5B9E\u4F53\u786E\u5B9A\u4E3A\u91CD\u590D\u9879\u3002 XpointerMissing = \u7F3A\u5C11 href \u5C5E\u6027\u65F6, \u5FC5\u987B\u5B58\u5728 xpointer \u5C5E\u6027\u3002 AcceptMalformed = 'include' \u5143\u7D20\u7684 'accept' \u5C5E\u6027\u7684\u503C\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8303\u56F4 #x20 \u81F3 #x7E \u4EE5\u5916\u7684\u5B57\u7B26\u3002 AcceptLanguageMalformed = 'include' \u5143\u7D20\u7684 'accept-language' \u5C5E\u6027\u7684\u503C\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8303\u56F4 #x20 \u81F3 #x7E \u4EE5\u5916\u7684\u5B57\u7B26\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties index 11cff31525e..949992305f9 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 @@ -39,20 +36,20 @@ FallbackChild = \u4F86\u81EA\u547D\u540D\u7A7A\u9593 ''http://www.w3.org/2001/XI HrefMissing = \u907A\u6F0F 'include' \u5143\u7D20\u7684 'href' \u5C6C\u6027\u3002 RecursiveInclude = \u5075\u6E2C\u5230\u905E\u8FF4\u5305\u542B\u3002\u5DF2\u7D93\u8655\u7406\u6587\u4EF6 ''{0}''\u3002 InvalidParseValue = ''include'' \u5143\u7D20\u4E0A ''parse'' \u5C6C\u6027\u7684\u7121\u6548\u503C: ''{0}''\u3002 -XMLParseError = \u5617\u8A66\u5256\u6790 XML \u6A94\u6848\u6642\u767C\u751F\u932F\u8AA4 (href=''{0}'')\u3002\u539F\u56E0: {1} +XMLParseError = \u5617\u8A66\u5256\u6790 XML \u6A94\u6848 (href=''{0}'') \u6642\u767C\u751F\u932F\u8AA4\u3002\u539F\u56E0: {1} XMLResourceError = \u5305\u542B\u4F5C\u696D\u5931\u6557\uFF0C\u56DE\u5FA9\u81F3\u5F8C\u63F4\u3002\u4EE5 XML (href=''{0}'') \u65B9\u5F0F\u8B80\u53D6\u6A94\u6848\u6642\u767C\u751F\u8CC7\u6E90\u932F\u8AA4\u3002\u539F\u56E0: {1} TextResourceError = \u5305\u542B\u4F5C\u696D\u5931\u6557\uFF0C\u56DE\u5FA9\u81F3\u5F8C\u63F4\u3002\u4EE5\u6587\u5B57 (href=''{0}'') \u65B9\u5F0F\u8B80\u53D6\u6A94\u6848\u6642\u767C\u751F\u8CC7\u6E90\u932F\u8AA4\u3002\u539F\u56E0: {1} -NO_XPointerSchema = \u9810\u8A2D\u4E0D\u652F\u63F4 \"{0}\" \u7684\u7DB1\u8981\u3002\u8ACB\u70BA {0} \u5B9A\u7FA9\u60A8\u81EA\u5DF1\u7684\u7DB1\u8981\u3002\u8ACB\u53C3\u95B1 http://apache.org/xml/properties/xpointer-schema +NO_XPointerSchema = \u9810\u8A2D\u4E0D\u652F\u63F4 "{0}" \u7684\u7DB1\u8981\u3002\u8ACB\u70BA {0} \u5B9A\u7FA9\u60A8\u81EA\u5DF1\u7684\u7DB1\u8981\u3002\u8ACB\u53C3\u95B1 http://apache.org/xml/properties/xpointer-schema NO_SubResourceIdentified = XPointer \u8655\u7406\u5668\u672A\u80FD\u70BA\u6307\u6A19 {0} \u8B58\u5225\u4EFB\u4F55\u5B50\u8CC7\u6E90\u3002 NonDuplicateNotation = \u4F7F\u7528\u540D\u7A31\u70BA ''{0}'' \u7684\u591A\u500B\u8868\u793A\u6CD5\uFF0C\u4F46\u662F\u672A\u80FD\u5224\u65B7\u9019\u4E9B\u8868\u793A\u6CD5\u91CD\u8907\u3002 -NonDuplicateUnparsedEntity = \u4F7F\u7528\u540D\u7A31\u70BA ''{0}'' \u7684\u591A\u500B\u672A\u5256\u6790\u500B\u9AD4\uFF0C\u4F46\u662F\u672A\u80FD\u5224\u65B7\u9019\u4E9B\u500B\u9AD4\u91CD\u8907\u3002 +NonDuplicateUnparsedEntity = \u4F7F\u7528\u540D\u7A31\u70BA ''{0}'' \u7684\u591A\u500B\u672A\u5256\u6790\u5BE6\u9AD4\uFF0C\u4F46\u662F\u672A\u80FD\u5224\u65B7\u9019\u4E9B\u5BE6\u9AD4\u91CD\u8907\u3002 XpointerMissing = \u6C92\u6709 href \u5C6C\u6027\u6642\uFF0C\u5FC5\u9808\u6709 xpointer \u5C6C\u6027\u3002 AcceptMalformed = 'include' \u5143\u7D20\u7684 'accept' \u5C6C\u6027\u503C\u4E2D\uFF0C\u4E0D\u5141\u8A31\u7BC4\u570D #x20 \u81F3 #x7E \u4E4B\u5916\u7684\u5B57\u5143\u3002 AcceptLanguageMalformed = 'include' \u5143\u7D20\u7684 'accept-language' \u5C6C\u6027\u503C\u4E2D\uFF0C\u4E0D\u5141\u8A31\u7BC4\u570D #x20 \u81F3 #x7E \u4E4B\u5916\u7684\u5B57\u5143\u3002 RootElementRequired = \u683C\u5F0F\u6B63\u78BA\u7684\u6587\u4EF6\u9700\u8981\u6839\u5143\u7D20\u3002 MultipleRootElements = \u683C\u5F0F\u6B63\u78BA\u7684\u6587\u4EF6\u4E0D\u53EF\u5305\u542B\u591A\u500B\u6839\u5143\u7D20\u3002 ContentIllegalAtTopLevel = \u53D6\u4EE3 'include' \u5143\u7D20\u4F5C\u70BA\u6700\u4E0A\u5C64\u4F86\u6E90 infoset \u7684\u6587\u4EF6\u5143\u7D20\u4E0D\u80FD\u5305\u542B\u5B57\u5143\u3002 -UnexpandedEntityReferenceIllegal = \u53D6\u4EE3 'include' \u5143\u7D20\u4F5C\u70BA\u6700\u4E0A\u5C64\u4F86\u6E90 infoset \u7684\u6587\u4EF6\u5143\u7D20\u4E0D\u80FD\u5305\u542B\u672A\u5C55\u958B\u7684\u500B\u9AD4\u53C3\u7167\u3002 +UnexpandedEntityReferenceIllegal = \u53D6\u4EE3 'include' \u5143\u7D20\u4F5C\u70BA\u6700\u4E0A\u5C64\u4F86\u6E90 infoset \u7684\u6587\u4EF6\u5143\u7D20\u4E0D\u80FD\u5305\u542B\u672A\u5C55\u958B\u7684\u5BE6\u9AD4\u53C3\u7167\u3002 HrefFragmentIdentifierIllegal = \u4E0D\u53EF\u4F7F\u7528\u7247\u6BB5 ID\u3002\u4E0D\u5141\u8A31 ''href'' \u5C6C\u6027\u503C ''{0}''\u3002 HrefSyntacticallyInvalid = ''href'' \u5C6C\u6027\u503C ''{0}'' \u53E5\u6CD5\u7121\u6548\u3002\u5957\u7528\u9041\u96E2\u898F\u5247\u4E4B\u5F8C\uFF0C\u503C\u70BA\u53E5\u6CD5\u6B63\u78BA\u7684 URI \u6216 IRI\u3002 XPointerStreamability = \u6307\u5B9A xpointer \u6307\u5411\u4F86\u6E90 infoset \u4E2D\u7684\u4F4D\u7F6E\u3002\u7531\u65BC\u8655\u7406\u5668\u4E32\u6D41\u7279\u6027\uFF0C\u56E0\u6B64\u7121\u6CD5\u5B58\u53D6\u6B64\u4F4D\u7F6E\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties index 3bf9ebdc987..1a5d62af9bb 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties @@ -261,8 +261,8 @@ # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags ReferenceToExternalEntity = The external entity reference \"&{0};\" is not permitted in an attribute value. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalDTD property. + AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalDTD property. # 4.1 Character and Entity References EntityNotDeclared = The entity \"{0}\" was referenced, but not declared. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties index 3cf21e56482..f22a2afa345 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Prolog des Dokuments gefunden. InvalidCharInXMLDecl = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der XML-Deklaration gefunden. # 2.4 Character Data and Markup - CDEndInContent = Zeichenfolge"\"]]>\" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert. + CDEndInContent = Zeichenfolge""]]>" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert. # 2.7 CDATA Sections - CDSectUnterminated = CDATA-Abschnitt muss mit \"]]>\" enden. + CDSectUnterminated = CDATA-Abschnitt muss mit "]]>" enden. # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML-Deklaration darf nur ganz am Anfang des Dokuments enthalten sein. - EqRequiredInXMLDecl = Zeichen " = " muss auf \"{0}\" in der XML-Deklaration folgen. - QuoteRequiredInXMLDecl = Der Wert nach \"{0}\" in der XML-Deklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein. - XMLDeclUnterminated = XML-Deklaration muss mit \"?>\" enden. + EqRequiredInXMLDecl = Zeichen " = " muss auf "{0}" in der XML-Deklaration folgen. + QuoteRequiredInXMLDecl = Der Wert nach "{0}" in der XML-Deklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein. + XMLDeclUnterminated = XML-Deklaration muss mit "?>" enden. VersionInfoRequired = Version ist in der XML-Deklaration erforderlich. SpaceRequiredBeforeVersionInXMLDecl = Leerstelle vor dem Versionspseudoattribut in der XML-Deklaration erforderlich. SpaceRequiredBeforeEncodingInXMLDecl = Leerstelle vor dem Codierungspseudoattribut in der XML-Deklaration erforderlich. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=Referenz ist nicht zul\u00E4ssig in angeh\u00E4ngtem Abschnitt. # 2.9 Standalone Document Declaration - SDDeclInvalid = Standalone-Dokumentdeklarationswert muss \"Ja\" oder \"Nein\" und nicht \"{0}\" sein. + SDDeclInvalid = Standalone-Dokumentdeklarationswert muss "Ja" oder "Nein" und nicht "{0}" sein. # 2.12 Language Identification - XMLLangInvalid = xml:lang-Attributwert \"{0}\" ist eine ung\u00FCltige Sprach-ID. + XMLLangInvalid = xml:lang-Attributwert "{0}" ist eine ung\u00FCltige Sprach-ID. # 3. Logical Structures - ETagRequired = Elementtyp \"{0}\" muss mit dem entsprechenden Endtag \"\" beendet werden. + ETagRequired = Elementtyp "{0}" muss mit dem entsprechenden Endtag "" beendet werden. # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = Auf Elementtyp \"{0}\" m\u00FCssen entweder Attributspezifikationen, \">\" oder \"/>\" folgen. - EqRequiredInAttribute = Mit Elementtyp \"{0}\" verkn\u00FCpfter Attributname \"{1}\" muss vom Zeichen " = " gefolgt werden. - OpenQuoteExpected = \u00D6ffnendes Anf\u00FChrungszeichen wird f\u00FCr Attribut \"{1}\" erwartet, das mit Elementtyp \"{0}\" verkn\u00FCpft ist. - CloseQuoteExpected = Schlie\u00DFendes Anf\u00FChrungszeichen wird f\u00FCr Attribut \"{1}\" erwartet, das mit Elementtyp \"{0}\" verkn\u00FCpft ist. - AttributeNotUnique = Attribut \"{1}\" wurde bereits f\u00FCr Element \"{0}\" angegeben. - AttributeNSNotUnique = An Namespace \"{2}\" gebundenes Attribut \"{1}\" wurde bereits f\u00FCr Element \"{0}\" angegeben. - ETagUnterminated = Endtag f\u00FCr Elementtyp \"{0}\" muss mit einem ">"-Begrenzungszeichen enden. + ElementUnterminated = Auf Elementtyp "{0}" m\u00FCssen entweder Attributspezifikationen, ">" oder "/>" folgen. + EqRequiredInAttribute = Mit Elementtyp "{0}" verkn\u00FCpfter Attributname "{1}" muss vom Zeichen " = " gefolgt werden. + OpenQuoteExpected = \u00D6ffnendes Anf\u00FChrungszeichen wird f\u00FCr Attribut "{1}" erwartet, das mit Elementtyp "{0}" verkn\u00FCpft ist. + CloseQuoteExpected = Schlie\u00DFendes Anf\u00FChrungszeichen wird f\u00FCr Attribut "{1}" erwartet, das mit Elementtyp "{0}" verkn\u00FCpft ist. + AttributeNotUnique = Attribut "{1}" wurde bereits f\u00FCr Element "{0}" angegeben. + AttributeNSNotUnique = An Namespace "{2}" gebundenes Attribut "{1}" wurde bereits f\u00FCr Element "{0}" angegeben. + ETagUnterminated = Endtag f\u00FCr Elementtyp "{0}" muss mit einem ">"-Begrenzungszeichen enden. MarkupNotRecognizedInContent = Der Content von Elementen muss aus ordnungsgem\u00E4\u00DF formatierten Zeichendaten oder Markups bestehen. DoctypeIllegalInContent = DOCTYPE ist nicht zul\u00E4ssig in Content. # 4.1 Character and Entity References ReferenceUnterminated = Referenz muss mit einem ";"-Begrenzungszeichen beendet werden. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = Referenz muss vollst\u00E4ndig in derselben geparsten Entit\u00E4t enthalten sein. - ElementEntityMismatch = Element \"{0}\" muss innerhalb derselben Entit\u00E4t beginnen und enden. + ElementEntityMismatch = Element "{0}" muss innerhalb derselben Entit\u00E4t beginnen und enden. MarkupEntityMismatch=XML-Dokumentstrukturen m\u00FCssen innerhalb derselben Entit\u00E4t beginnen und enden. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{2}) wurde im Wert des Attributs \"{1}\" gefunden. Element ist \"{0}\". + InvalidCharInAttValue = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{2}) wurde im Wert des Attributs "{1}" gefunden. Element ist "{0}". InvalidCharInComment = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde im Kommentar gefunden. InvalidCharInPI = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der Verarbeitungsanweisung gefunden. InvalidCharInInternalSubset = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der internen Teilmenge der DTD gefunden. InvalidCharInTextDecl = Ung\u00FCltiges XML-Zeichen (Unicode: 0x{0}) wurde in der Textdeklaration gefunden. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = Wert des Attributs \"{1}\" muss mit einem einzelnen oder doppelten Anf\u00FChrungszeichen beginnen. - LessthanInAttValue = Wert des Attributs \"{1}\", das mit Elementtyp \"{0}\" verkn\u00FCpft ist, darf nicht das Zeichen "<" enthalten. - AttributeValueUnterminated = Wert f\u00FCr Attribut \"{1}\" muss mit dem entsprechenden Anf\u00FChrungszeichen enden. + QuoteRequiredInAttValue = Wert des Attributs "{1}" muss mit einem einzelnen oder doppelten Anf\u00FChrungszeichen beginnen. + LessthanInAttValue = Wert des Attributs "{1}", das mit Elementtyp "{0}" verkn\u00FCpft ist, darf nicht das Zeichen "<" enthalten. + AttributeValueUnterminated = Wert f\u00FCr Attribut "{1}" muss mit dem entsprechenden Anf\u00FChrungszeichen enden. # 2.5 Comments - InvalidCommentStart = Kommentar muss mit \"\" enden. + InvalidCommentStart = Kommentar muss mit "" enden. COMMENT_NOT_IN_ONE_ENTITY = Kommentar ist nicht in derselben Entit\u00E4t enthalten. # 2.6 Processing Instructions PITargetRequired = Verarbeitungsanweisung muss mit dem Namen des Ziels beginnen. SpaceRequiredInPI = Leerstelle ist zwischen dem Ziel der Verarbeitungsanweisung und den Daten erforderlich. - PIUnterminated = Verarbeitungsanweisung muss mit \"?>\" enden. - ReservedPITarget = Verarbeitungsanweisungsziel, das \"[xX][mM][lL]\" entspricht, ist nicht zul\u00E4ssig. + PIUnterminated = Verarbeitungsanweisung muss mit "?>" enden. + ReservedPITarget = Verarbeitungsanweisungsziel, das "[xX][mM][lL]" entspricht, ist nicht zul\u00E4ssig. PI_NOT_IN_ONE_ENTITY = Verarbeitungsanweisung ist nicht in derselben Entit\u00E4t enthalten. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Ung\u00FCltige Version \"{0}\". - VersionNotSupported = XML-Version \"{0}\" wird nicht unterst\u00FCtzt. Nur XML 1.0 wird unterst\u00FCtzt. - VersionNotSupported11 = XML-Version \"{0}\" wird nicht unterst\u00FCtzt. Nur XML 1.0 und XML 1.1 werden unterst\u00FCtzt. + VersionInfoInvalid = Ung\u00FCltige Version "{0}". + VersionNotSupported = XML-Version "{0}" wird nicht unterst\u00FCtzt. Nur XML 1.0 wird unterst\u00FCtzt. + VersionNotSupported11 = XML-Version "{0}" wird nicht unterst\u00FCtzt. Nur XML 1.0 und XML 1.1 werden unterst\u00FCtzt. VersionMismatch= Eine Entit\u00E4t kann keine andere Entit\u00E4t einer sp\u00E4teren Version enthalten. # 4.1 Character and Entity References - DigitRequiredInCharRef = Auf \"&#\" in einer Zeichenreferenz muss umgehend eine Dezimaldarstellung folgen. - HexdigitRequiredInCharRef = Auf \"&#x\" in einer Zeichenreferenz muss umgehend eine hexadezimale Darstellung folgen. + DigitRequiredInCharRef = Auf "&#" in einer Zeichenreferenz muss umgehend eine Dezimaldarstellung folgen. + HexdigitRequiredInCharRef = Auf "&#x" in einer Zeichenreferenz muss umgehend eine hexadezimale Darstellung folgen. SemicolonRequiredInCharRef = Zeichenreferenz muss mit dem Begrenzungszeichen ";" enden. - InvalidCharRef = Zeichenreferenz \"&#{0}\" ist ein ung\u00FCltiges XML-Zeichen. + InvalidCharRef = Zeichenreferenz "&#{0}" ist ein ung\u00FCltiges XML-Zeichen. NameRequiredInReference = Auf "&" in der Entit\u00E4tsreferenz muss umgehend der Entit\u00E4tsname folgen. - SemicolonRequiredInReference = Referenz zu Entit\u00E4t \"{0}\" muss mit dem Begrenzungszeichen ";" enden. + SemicolonRequiredInReference = Referenz zu Entit\u00E4t "{0}" muss mit dem Begrenzungszeichen ";" enden. # 4.3.1 The Text Declaration TextDeclMustBeFirst = Textdeklaration darf nur ganz am Anfang der externen geparsten Entit\u00E4t enthalten sein. - EqRequiredInTextDecl = Zeichen " = " muss auf \"{0}\" in der Textdeklaration folgen. - QuoteRequiredInTextDecl = Der Wert nach \"{0}\" in der Textdeklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein. - CloseQuoteMissingInTextDecl = Schlie\u00DFendes Anf\u00FChrungszeichen im Wert nach \"{0}\" in der Textdeklaration fehlt. + EqRequiredInTextDecl = Zeichen " = " muss auf "{0}" in der Textdeklaration folgen. + QuoteRequiredInTextDecl = Der Wert nach "{0}" in der Textdeklaration muss eine Zeichenfolge in Anf\u00FChrungszeichen sein. + CloseQuoteMissingInTextDecl = Schlie\u00DFendes Anf\u00FChrungszeichen im Wert nach "{0}" in der Textdeklaration fehlt. SpaceRequiredBeforeVersionInTextDecl = Leerstelle vor dem Versionspseudoattribut in der Textdeklaration erforderlich. SpaceRequiredBeforeEncodingInTextDecl = Leerstelle vor dem Codierungspseudoattribut in der Textdeklaration erforderlich. - TextDeclUnterminated = Textdeklaration muss mit \"?>\" enden. + TextDeclUnterminated = Textdeklaration muss mit "?>" enden. EncodingDeclRequired = Codierungsdeklaration ist in der Textdeklaration erforderlich. NoMorePseudoAttributes = Es sind keine weiteren Pseudoattribute zul\u00E4ssig. MorePseudoAttributes = Es werden weitere Pseudoattribute erwartet. @@ -143,13 +140,13 @@ CommentNotInOneEntity = Kommentar muss vollst\u00E4ndig in derselben geparsten Entit\u00E4t enthalten sein. PINotInOneEntity = Verarbeitungsanweisung muss vollst\u00E4ndig in derselben geparsten Entit\u00E4t enthalten sein. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Ung\u00FCltiger Codierungsname \"{0}\". - EncodingByteOrderUnsupported = Angegebene Bytereihenfolge f\u00FCr die Codierung von \"{0}\" wird nicht unterst\u00FCtzt. + EncodingDeclInvalid = Ung\u00FCltiger Codierungsname "{0}". + EncodingByteOrderUnsupported = Angegebene Bytereihenfolge f\u00FCr die Codierung von "{0}" wird nicht unterst\u00FCtzt. InvalidByte = Ung\u00FCltiges Byte {0} von {1}-Byte-UTF-8-Sequenz. ExpectedByte = Byte {0} von {1}-Byte-UTF-8-Sequenz erwartet. InvalidHighSurrogate = High-Surrogate-Bits in UTF-8-Sequenz d\u00FCrfen 0x10 nicht \u00FCberschreiten, gefunden wurde aber 0x{0}. - OperationNotSupported = Vorgang \"{0}\" nicht unterst\u00FCtzt von {1}-Reader. - InvalidASCII = Byte \"{0}\" geh\u00F6rt nicht zum (7-Bit) ASCII-Zeichensatz. + OperationNotSupported = Vorgang "{0}" nicht unterst\u00FCtzt von {1}-Reader. + InvalidASCII = Byte "{0}" geh\u00F6rt nicht zum (7-Bit) ASCII-Zeichensatz. CharConversionFailure = Eine Entit\u00E4t, f\u00FCr die eine bestimmte Codierung ermittelt wurde, darf keine Sequenzen enthalten, die in dieser Codierung ung\u00FCltig sind. # DTD Messages @@ -169,135 +166,135 @@ PubidCharIllegal = Zeichen (Unicode: 0x{0}) ist nicht zul\u00E4ssig in der \u00F6ffentlichen ID. SpaceRequiredBetweenPublicAndSystem = Leerstellen erforderlich zwischen publicId und systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Leerstelle nach \"" enden. - PEReferenceWithinMarkup = Parameterentit\u00E4tsreferenz \"%{0};\" darf nicht in Markup in der internen Teilmenge der DTD vorkommen. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Leerstelle nach "" enden. + PEReferenceWithinMarkup = Parameterentit\u00E4tsreferenz "%{0};" darf nicht in Markup in der internen Teilmenge der DTD vorkommen. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Die Markup-Deklarationen, die in der Dokumenttypdeklaration enthalten sind bzw. auf die von der Dokumenttypdeklaration verwiesen wird, m\u00FCssen ordnungsgem\u00E4\u00DF formatiert sein. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklaration f\u00FCr \"xml:space\" muss als aufgez\u00E4hlter Typ angegeben werden, dessen einzigen m\u00F6glichen Werte \"default\" und \"preserve\" sind. + MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklaration f\u00FCr "xml:space" muss als aufgez\u00E4hlter Typ angegeben werden, dessen einzigen m\u00F6glichen Werte "default" und "preserve" sind. # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Leerstelle nach \"" enden. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Leerstelle nach Elementtyp "{0}" in der Elementtypdeklaration erforderlich. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Constraint ist nach dem Elementtyp "{0}" in der Elementtypdeklaration erforderlich. + ElementDeclUnterminated = Deklaration f\u00FCr Elementtyp "{0}" muss mit ">" enden. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Das Zeichen "(" oder ein Elementtyp ist in der Deklaration des Elementtyps \"{0}\" erforderlich. - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Das Zeichen ")" ist in der Deklaration des Elementtyps \"{0}\" erforderlich. + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Das Zeichen "(" oder ein Elementtyp ist in der Deklaration des Elementtyps "{0}" erforderlich. + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Das Zeichen ")" ist in der Deklaration des Elementtyps "{0}" erforderlich. # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Ein Elementtyp ist in der Deklaration des Elementtyps \"{0}\" erforderlich. - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Das Zeichen ")" ist in der Deklaration des Elementtyps \"{0}\" erforderlich. - MixedContentUnterminated = Das Mischcontentmodell \"{0}\" muss mit \")*\" enden, wenn die Typen der untergeordneten Elemente eingeschr\u00E4nkt sind. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Ein Elementtyp ist in der Deklaration des Elementtyps "{0}" erforderlich. + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Das Zeichen ")" ist in der Deklaration des Elementtyps "{0}" erforderlich. + MixedContentUnterminated = Das Mischcontentmodell "{0}" muss mit ")*" enden, wenn die Typen der untergeordneten Elemente eingeschr\u00E4nkt sind. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Leerstelle nach \"\" enden. - IgnoreSectUnterminated = Der ausgeschlossene Bedingungsabschnitt muss mit \"]]>\" enden. + IncludeSectUnterminated = Der eingeschlossene Bedingungsabschnitt muss mit "]]>" enden. + IgnoreSectUnterminated = Der ausgeschlossene Bedingungsabschnitt muss mit "]]>" enden. # 4.1 Character and Entity References NameRequiredInPEReference = Auf "%" in der Parameterentit\u00E4tsreferenz muss umgehend der Entit\u00E4tsname folgen. - SemicolonRequiredInPEReference = Parameterentit\u00E4tsreferenz \"%{0};\" muss mit dem Begrenzungszeichen ";" enden. + SemicolonRequiredInPEReference = Parameterentit\u00E4tsreferenz "%{0};" muss mit dem Begrenzungszeichen ";" enden. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Leerstelle nach \"" enden. - MSG_DUPLICATE_ENTITY_DEFINITION = Entit\u00E4t \"{0}\" wurde mehrmals deklariert. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Leerstelle zwischen dem Entit\u00E4tsnamen "{0}" und der Definition in der Entit\u00E4tsdeklaration erforderlich. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Leerstelle zwischen "NDATA" und dem Notationsnamen in der Deklaration f\u00FCr die Entit\u00E4t "{0} erforderlich. + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Leerstelle vor "NDATA" in der Deklaration f\u00FCr die Entit\u00E4t "{0} erforderlich. + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Notationsname ist nach "NDATA" in der Deklaration f\u00FCr die Entit\u00E4t "{0} erforderlich. + EntityDeclUnterminated = Deklaration f\u00FCr Entit\u00E4t "{0}" muss mit ">" enden. + MSG_DUPLICATE_ENTITY_DEFINITION = Entit\u00E4t "{0}" wurde mehrmals deklariert. # 4.2.2 External Entities - ExternalIDRequired = Externe Entit\u00E4tsdeklaration muss mit \"SYSTEM\" oder \"PUBLIC\" beginnen. - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Leerstelle zwischen \"PUBLIC\" und der \u00F6ffentlichen ID erforderlich. + ExternalIDRequired = Externe Entit\u00E4tsdeklaration muss mit "SYSTEM" oder "PUBLIC" beginnen. + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Leerstelle zwischen "PUBLIC" und der \u00F6ffentlichen ID erforderlich. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Leerstelle zwischen der \u00F6ffentlichen ID und der System-ID erforderlich. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Leerstelle zwischen \"SYSTEM\" und der System-ID erforderlich. - MSG_URI_FRAGMENT_IN_SYSTEMID = Fragment-ID darf nicht als Teil der System-ID \"{0}\" angegeben werden. + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Leerstelle zwischen "SYSTEM" und der System-ID erforderlich. + MSG_URI_FRAGMENT_IN_SYSTEMID = Fragment-ID darf nicht als Teil der System-ID "{0}" angegeben werden. # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Leerstelle nach \"" enden. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Leerstelle nach dem Notationsnamen "{0}" in der Notationsdeklaration erforderlich. + ExternalIDorPublicIDRequired = Deklaration f\u00FCr die Notation "{0}" muss eine System- oder eine \u00F6ffentliche ID enthalten. + NotationDeclUnterminated = Deklaration f\u00FCr die Notation "{0}" muss mit ">" enden. # Validation messages - DuplicateTypeInMixedContent = Elementtyp \"{1}\" wurde bereits im Contentmodell der Elementdeklaration\"{0}\" angegeben. - ENTITIESInvalid = Attributwert \"{1}\" mit dem Typ ENTITIES muss aus den Namen von mindestens einer geparsten Entit\u00E4t bestehen. - ENTITYInvalid = Attributwert \"{1}\" mit dem Typ ENTITY muss aus dem Namen einer geparsten Entit\u00E4t bestehen. - IDDefaultTypeInvalid = ID-Attribut \"{0}\" muss den deklarierten Standardwert \"#IMPLIED\" oder \"#REQUIRED\" haben. - IDInvalid = Attributwert \"{0}\" mit dem Typ ID muss ein Name sein. - IDInvalidWithNamespaces = Attributwert \"{0}\" mit dem Typ ID muss ein NCName sein, wenn Namespaces aktiviert sind. - IDNotUnique = Attributwert \"{0}\" mit dem Typ ID muss eindeutig im Dokument sein. - IDREFInvalid = Attributwert \"{0}\" mit dem Typ IDREF muss ein Name sein. - IDREFInvalidWithNamespaces = Attributwert \"{0}\" mit dem Typ IDREF muss ein NCName sein, wenn Namespaces aktiviert sind. - IDREFSInvalid = Attributwert \"{0}\" mit dem Typ IDREFS muss mindestens ein Name sein. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ersatztext der Parameterentit\u00E4t \"{0}\" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten, wenn die Entit\u00E4tsreferenz als vollst\u00E4ndige Deklaration verwendet wird. - ImproperDeclarationNesting = Ersatztext der Parameterentit\u00E4t \"{0}\" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten. - ImproperGroupNesting = Ersatztext der Parameterentit\u00E4t \"{0}\" muss ordnungsgem\u00E4\u00DF verschachtelte Klammernpaare enthalten. - INVALID_PE_IN_CONDITIONAL = Ersatztext der Parameterentit\u00E4t \"{0}\" muss den gesamten Bedingungsabschnitt oder nur INCLUDE oder IGNORE enthalten. - MSG_ATTRIBUTE_NOT_DECLARED = Attribut \"{1}\" muss f\u00FCr Elementtyp \"{0}\" deklariert werden. - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attribut \"{0}\" mit Wert \"{1}\" muss einen Wert aus der Liste \"{2}\" haben. - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Der Wert \"{1}\" des Attributs \"{0}\" darf nicht von der Normalisierung (zu \"{2}\") in einem Standalone-Dokument ge\u00E4ndert werden. - MSG_CONTENT_INCOMPLETE = Content des Elementtyps \"{0}\" ist unvollst\u00E4ndig. Muss \"{1}\" entsprechen. - MSG_CONTENT_INVALID = Content des Elementtyps \"{0}\" muss \"{1}\" entsprechen. - MSG_CONTENT_INVALID_SPECIFIED = Content des Elementtyps \"{0}\" muss \"{1}\" entsprechen. Untergeordnete Elemente mit dem Typ \"{2}\" sind nicht zul\u00E4ssig. - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attribut \"{1}\" f\u00FCr Elementtyp \"{0}\" hat einen Standardwert und muss in einem Standalone-Dokument angegeben werden. - MSG_DUPLICATE_ATTDEF = Attribut \"{1}\" ist bereits deklariert f\u00FCr Elementtyp \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = Elementtyp \"{0}\" darf nicht mehrmals deklariert werden. - MSG_ELEMENT_NOT_DECLARED = Elementtyp \"{0}\" muss deklariert werden. + DuplicateTypeInMixedContent = Elementtyp "{1}" wurde bereits im Contentmodell der Elementdeklaration"{0}" angegeben. + ENTITIESInvalid = Attributwert "{1}" mit dem Typ ENTITIES muss aus den Namen von mindestens einer geparsten Entit\u00E4t bestehen. + ENTITYInvalid = Attributwert "{1}" mit dem Typ ENTITY muss aus dem Namen einer geparsten Entit\u00E4t bestehen. + IDDefaultTypeInvalid = ID-Attribut "{0}" muss den deklarierten Standardwert "#IMPLIED" oder "#REQUIRED" haben. + IDInvalid = Attributwert "{0}" mit dem Typ ID muss ein Name sein. + IDInvalidWithNamespaces = Attributwert "{0}" mit dem Typ ID muss ein NCName sein, wenn Namespaces aktiviert sind. + IDNotUnique = Attributwert "{0}" mit dem Typ ID muss eindeutig im Dokument sein. + IDREFInvalid = Attributwert "{0}" mit dem Typ IDREF muss ein Name sein. + IDREFInvalidWithNamespaces = Attributwert "{0}" mit dem Typ IDREF muss ein NCName sein, wenn Namespaces aktiviert sind. + IDREFSInvalid = Attributwert "{0}" mit dem Typ IDREFS muss mindestens ein Name sein. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ersatztext der Parameterentit\u00E4t "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten, wenn die Entit\u00E4tsreferenz als vollst\u00E4ndige Deklaration verwendet wird. + ImproperDeclarationNesting = Ersatztext der Parameterentit\u00E4t "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Deklarationen enthalten. + ImproperGroupNesting = Ersatztext der Parameterentit\u00E4t "{0}" muss ordnungsgem\u00E4\u00DF verschachtelte Klammernpaare enthalten. + INVALID_PE_IN_CONDITIONAL = Ersatztext der Parameterentit\u00E4t "{0}" muss den gesamten Bedingungsabschnitt oder nur INCLUDE oder IGNORE enthalten. + MSG_ATTRIBUTE_NOT_DECLARED = Attribut "{1}" muss f\u00FCr Elementtyp "{0}" deklariert werden. + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attribut "{0}" mit Wert "{1}" muss einen Wert aus der Liste "{2}" haben. + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Der Wert "{1}" des Attributs "{0}" darf nicht von der Normalisierung (zu "{2}") in einem Standalone-Dokument ge\u00E4ndert werden. + MSG_CONTENT_INCOMPLETE = Content des Elementtyps "{0}" ist unvollst\u00E4ndig. Muss "{1}" entsprechen. + MSG_CONTENT_INVALID = Content des Elementtyps "{0}" muss "{1}" entsprechen. + MSG_CONTENT_INVALID_SPECIFIED = Content des Elementtyps "{0}" muss "{1}" entsprechen. Untergeordnete Elemente mit dem Typ "{2}" sind nicht zul\u00E4ssig. + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attribut "{1}" f\u00FCr Elementtyp "{0}" hat einen Standardwert und muss in einem Standalone-Dokument angegeben werden. + MSG_DUPLICATE_ATTDEF = Attribut "{1}" ist bereits deklariert f\u00FCr Elementtyp "{0}". + MSG_ELEMENT_ALREADY_DECLARED = Elementtyp "{0}" darf nicht mehrmals deklariert werden. + MSG_ELEMENT_NOT_DECLARED = Elementtyp "{0}" muss deklariert werden. MSG_GRAMMAR_NOT_FOUND = Dokument ist ung\u00FCltig. Keine Grammatik gefunden. - MSG_ELEMENT_WITH_ID_REQUIRED = Element mit \"{0}\" ist im Dokument erforderlich. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referenz zur externen Entit\u00E4t \"{0}\" ist in einem Standalone-Dokument nicht zul\u00E4ssig. - MSG_FIXED_ATTVALUE_INVALID = Attribut \"{1}\" mit Wert \"{2}\" muss den Wert\"{3}\" haben. - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp \"{0}\" hat bereits ein Attribut \"{1}\" mit dem Typ ID. Ein zweites Attribut \"{2}\" mit dem Typ ID ist nicht zul\u00E4ssig. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp \"{0}\" hat bereits ein Attribut \"{1}\" mit dem Typ NOTATION. Ein zweites Attribut \"{2}\" mit dem Typ NOTATION ist nicht zul\u00E4ssig. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notation \"{1}\" muss deklariert werden, wenn sie in der Notationstypliste f\u00FCr Attribut \"{0}\" referenziert wird. - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notation \"{1}\" muss deklariert werden, wenn sie in der Deklaration der nicht geparsten Entit\u00E4t f\u00FCr \"{0}\" referenziert wird. - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referenz zur Entit\u00E4t \"{0}\", die in einer externen geparsten Entit\u00E4t deklariert wird, ist in einem Standalone-Dokument nicht zul\u00E4ssig. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attribut \"{1}\" ist erforderlich und muss f\u00FCr Elementtyp \"{0}\" angegeben werden. + MSG_ELEMENT_WITH_ID_REQUIRED = Element mit "{0}" ist im Dokument erforderlich. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referenz zur externen Entit\u00E4t "{0}" ist in einem Standalone-Dokument nicht zul\u00E4ssig. + MSG_FIXED_ATTVALUE_INVALID = Attribut "{1}" mit Wert "{2}" muss den Wert"{3}" haben. + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp "{0}" hat bereits ein Attribut "{1}" mit dem Typ ID. Ein zweites Attribut "{2}" mit dem Typ ID ist nicht zul\u00E4ssig. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp "{0}" hat bereits ein Attribut "{1}" mit dem Typ NOTATION. Ein zweites Attribut "{2}" mit dem Typ NOTATION ist nicht zul\u00E4ssig. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notation "{1}" muss deklariert werden, wenn sie in der Notationstypliste f\u00FCr Attribut "{0}" referenziert wird. + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notation "{1}" muss deklariert werden, wenn sie in der Deklaration der nicht geparsten Entit\u00E4t f\u00FCr "{0}" referenziert wird. + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referenz zur Entit\u00E4t "{0}", die in einer externen geparsten Entit\u00E4t deklariert wird, ist in einem Standalone-Dokument nicht zul\u00E4ssig. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attribut "{1}" ist erforderlich und muss f\u00FCr Elementtyp "{0}" angegeben werden. MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Es d\u00FCrfen keine Leerstellen zwischen Elementen in einem Standalone-Dokument vorkommen, die in einer externen geparsten Entit\u00E4t mit Elementcontent deklariert sind. - NMTOKENInvalid = Attributwert \"{0}\" mit dem Typ NMTOKEN muss ein Namenstoken sein. - NMTOKENSInvalid = Attributwert \"{0}\" mit dem Typ NMTOKENS muss mindestens ein Namenstoken sein. - NoNotationOnEmptyElement = Elementtyp \"{0}\", der als EMPTY deklariert wurde, kann nicht das Attribut \"{1}\" mit dem Typ NOTATION deklarieren. - RootElementTypeMustMatchDoctypedecl = Dokument-Root-Element \"{1}\"muss mit DOCTYPE-Root \"{0}\" \u00FCbereinstimmen. - UndeclaredElementInContentSpec = Contentmodell des Elements \"{0}\" verweist auf das nicht deklarierte Element \"{1}\". - UniqueNotationName = Deklaration f\u00FCr die Notation \"{0}\" ist nicht eindeutig. Ein jeweiliger Name darf nicht in mehreren Notationsdeklarationen deklariert werden. + NMTOKENInvalid = Attributwert "{0}" mit dem Typ NMTOKEN muss ein Namenstoken sein. + NMTOKENSInvalid = Attributwert "{0}" mit dem Typ NMTOKENS muss mindestens ein Namenstoken sein. + NoNotationOnEmptyElement = Elementtyp "{0}", der als EMPTY deklariert wurde, kann nicht das Attribut "{1}" mit dem Typ NOTATION deklarieren. + RootElementTypeMustMatchDoctypedecl = Dokument-Root-Element "{1}"muss mit DOCTYPE-Root "{0}" \u00FCbereinstimmen. + UndeclaredElementInContentSpec = Contentmodell des Elements "{0}" verweist auf das nicht deklarierte Element "{1}". + UniqueNotationName = Deklaration f\u00FCr die Notation "{0}" ist nicht eindeutig. Ein jeweiliger Name darf nicht in mehreren Notationsdeklarationen deklariert werden. ENTITYFailedInitializeGrammar = ENTITYDatatype-Validator: Nicht erfolgreich. Initialisierungsmethode muss mit einer g\u00FCltigen Grammatikreferenz aufgerufen werden. \t - ENTITYNotUnparsed = ENTITY \"{0}\" ist geparst. - ENTITYNotValid = ENTITY \"{0}\" ist nicht g\u00FCltig. + ENTITYNotUnparsed = ENTITY "{0}" ist geparst. + ENTITYNotValid = ENTITY "{0}" ist nicht g\u00FCltig. EmptyList = Werte der Typen ENTITIES, IDREFS und NMTOKENS d\u00FCrfen keine leeren Listen sein. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = Externe Entit\u00E4tsreferenz \"&{0};\" ist in einem Attributwert nicht zul\u00E4ssig. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = Externe Entit\u00E4tsreferenz "&{0};" ist in einem Attributwert nicht zul\u00E4ssig. + AccessExternalDTD = Externe DTD: Lesen von externer DTD "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. + AccessExternalEntity = Externe Entity: Lesen von externem Dokument "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. # 4.1 Character and Entity References - EntityNotDeclared = Entit\u00E4t \"{0}\" wurde referenziert aber nicht deklariert. - ReferenceToUnparsedEntity = Nicht geparste Entit\u00E4tsreferenz \"&{0};\" ist nicht zul\u00E4ssig. - RecursiveReference = Rekursive Entit\u00E4tsreferenz \"{0}\". (Referenzpfad: {1}), - RecursiveGeneralReference = Rekursive allgemeine Entit\u00E4tsreferenz \"&{0};\". (Referenzpfad: {1}), - RecursivePEReference = Rekursive Parameterentit\u00E4tsreferenz \"%{0};\". (Referenzpfad: {1}), + EntityNotDeclared = Entit\u00E4t "{0}" wurde referenziert aber nicht deklariert. + ReferenceToUnparsedEntity = Nicht geparste Entit\u00E4tsreferenz "&{0};" ist nicht zul\u00E4ssig. + RecursiveReference = Rekursive Entit\u00E4tsreferenz "{0}". (Referenzpfad: {1}), + RecursiveGeneralReference = Rekursive allgemeine Entit\u00E4tsreferenz "&{0};". (Referenzpfad: {1}), + RecursivePEReference = Rekursive Parameterentit\u00E4tsreferenz "%{0};". (Referenzpfad: {1}), # 4.3.3 Character Encoding in Entities EncodingNotSupported = Codierung "{0}" wird nicht unterst\u00FCtzt. EncodingRequired = Eine nicht in UTF-8 oder UTF-16 codierte geparste Entit\u00E4t muss eine Codierungsdeklaration enthalten. @@ -305,14 +302,14 @@ # Namespaces support # 4. Using Qualified Names IllegalQName = Element oder Attribut stimmt nicht mit QName-Production \u00FCberein: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = Element \"{0}\" darf nicht \"xmlns\" als Pr\u00E4fix enthalten. - ElementPrefixUnbound = Pr\u00E4fix \"{0}\" f\u00FCr Element \"{1}\" ist nicht gebunden. - AttributePrefixUnbound = Pr\u00E4fix \"{2}\" f\u00FCr Attribut \"{1}\", das mit Elementtyp \"{0}\" verkn\u00FCpft ist, ist nicht gebunden. - EmptyPrefixedAttName = Wert des Attributs \"{0}\" ist ung\u00FCltig. Namespace Bindings mit Pr\u00E4fix d\u00FCrfen nicht leer sein. - PrefixDeclared = Namespace-Pr\u00E4fix \"{0}\" wurde nicht deklariert. + ElementXMLNSPrefix = Element "{0}" darf nicht "xmlns" als Pr\u00E4fix enthalten. + ElementPrefixUnbound = Pr\u00E4fix "{0}" f\u00FCr Element "{1}" ist nicht gebunden. + AttributePrefixUnbound = Pr\u00E4fix "{2}" f\u00FCr Attribut "{1}", das mit Elementtyp "{0}" verkn\u00FCpft ist, ist nicht gebunden. + EmptyPrefixedAttName = Wert des Attributs "{0}" ist ung\u00FCltig. Namespace Bindings mit Pr\u00E4fix d\u00FCrfen nicht leer sein. + PrefixDeclared = Namespace-Pr\u00E4fix "{0}" wurde nicht deklariert. CantBindXMLNS = Pr\u00E4fix "xmlns" kann nicht explizit an einen Namespace gebunden werden. Umgekehrt kann auch der Namespace f\u00FCr "xmlns" nicht explizit an ein Pr\u00E4fix gebunden werden. CantBindXML = Pr\u00E4fix "xml" kann nicht an einen anderen Namespace als den gew\u00F6hnlichen gebunden werden. Umgekehrt kann auch der Namespace f\u00FCr "xml" nicht an ein anderes Pr\u00E4fix als "xml" gebunden werden. - MSG_ATT_DEFAULT_INVALID = defaultValue \"{1}\" von Attribut \"{0}\" ist aufgrund der lexikalischen Constraints dieses Attributtyps nicht g\u00FCltig. + MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" von Attribut "{0}" ist aufgrund der lexikalischen Constraints dieses Attributtyps nicht g\u00FCltig. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=Parser hat mehr als \"{0}\" Entit\u00E4tserweiterungen in diesem Dokument gefunden. Dies ist der durch die Anwendung vorgeschriebene Grenzwert. +EntityExpansionLimitExceeded=Parser hat mehr als "{0}" Entit\u00E4tserweiterungen in diesem Dokument gefunden. Dies ist der durch die Anwendung vorgeschriebene Grenzwert. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= Element \"{0}\" hat mehr als \"{1}\" Attribute. \"{1}\" ist der durch die Anwendung vorgeschriebene Grenzwert. +ElementAttributeLimit= Element "{0}" hat mehr als "{1}" Attribute. "{1}" ist der durch die Anwendung vorgeschriebene Grenzwert. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties index 5ebfaf0eb2a..7864be97e07 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el pr\u00F3logo del documento. InvalidCharInXMLDecl = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la declaraci\u00F3n XML. # 2.4 Character Data and Markup - CDEndInContent = La secuencia de caracteres \"]]>\" no debe aparecer en el contenido, a menos que se utilice para marcar el final de una secci\u00F3n CDATA. + CDEndInContent = La secuencia de caracteres "]]>" no debe aparecer en el contenido, a menos que se utilice para marcar el final de una secci\u00F3n CDATA. # 2.7 CDATA Sections - CDSectUnterminated = La secci\u00F3n CDATA debe finalizar en \"]]>\". + CDSectUnterminated = La secci\u00F3n CDATA debe finalizar en "]]>". # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = La declaraci\u00F3n XML s\u00F3lo puede aparecer al principio del documento. - EqRequiredInXMLDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de \"{0}\" en la declaraci\u00F3n XML. - QuoteRequiredInXMLDecl = El valor despu\u00E9s de \"{0}\" en la declaraci\u00F3n XML debe ser una cadena con comillas. - XMLDeclUnterminated = La declaraci\u00F3n XML debe finalizar en \"?>\". + EqRequiredInXMLDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de "{0}" en la declaraci\u00F3n XML. + QuoteRequiredInXMLDecl = El valor despu\u00E9s de "{0}" en la declaraci\u00F3n XML debe ser una cadena con comillas. + XMLDeclUnterminated = La declaraci\u00F3n XML debe finalizar en "?>". VersionInfoRequired = La versi\u00F3n es necesaria en la declaraci\u00F3n XML. SpaceRequiredBeforeVersionInXMLDecl = Es necesario un espacio en blanco antes del pseudo atributo version en la declaraci\u00F3n XML. SpaceRequiredBeforeEncodingInXMLDecl = Es necesario un espacio en blanco antes del pseudo atributo encoding en la declaraci\u00F3n XML. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=La referencia no est\u00E1 permitida en la secci\u00F3n final. # 2.9 Standalone Document Declaration - SDDeclInvalid = El valor de declaraci\u00F3n del documento aut\u00F3nomo debe ser \"yes\" o \"no\", pero nunca \"{0}\". + SDDeclInvalid = El valor de declaraci\u00F3n del documento aut\u00F3nomo debe ser "yes" o "no", pero nunca "{0}". # 2.12 Language Identification - XMLLangInvalid = El valor del atributo xml:lang \"{0}\" es un identificador de idioma no v\u00E1lido. + XMLLangInvalid = El valor del atributo xml:lang "{0}" es un identificador de idioma no v\u00E1lido. # 3. Logical Structures - ETagRequired = El tipo de elemento \"{0}\" debe finalizar por la etiqueta final coincidente \"\". + ETagRequired = El tipo de elemento "{0}" debe finalizar por la etiqueta final coincidente "". # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = El tipo de elemento \"{0}\" debe ir seguido de una de estas especificaciones de atributo: \">\" o \"/>\". - EqRequiredInAttribute = El nombre de atributo \"{1}\" asociado a un tipo de elemento \"{0}\" debe ir seguido del car\u00E1cter '' = ''. - OpenQuoteExpected = Las comillas de apertura se deben utilizar para el atributo \"{1}\" asociado a un tipo de elemento \"{0}\". - CloseQuoteExpected = Las comillas de cierre se deben utilizar para el atributo \"{1}\" asociado a un tipo de elemento \"{0}\". - AttributeNotUnique = El atributo \"{1}\" ya se ha especificado para el elemento \"{0}\". - AttributeNSNotUnique = El atributo \"{1}\" enlazado al espacio de nombres \"{2}\" ya se ha especificado para el elemento \"{0}\". - ETagUnterminated = La etiqueta final para el tipo de elemento \"{0}\" debe finalizar en un delimitador ''>''. + ElementUnterminated = El tipo de elemento "{0}" debe ir seguido de una de estas especificaciones de atributo: ">" o "/>". + EqRequiredInAttribute = El nombre de atributo "{1}" asociado a un tipo de elemento "{0}" debe ir seguido del car\u00E1cter '' = ''. + OpenQuoteExpected = Las comillas de apertura se deben utilizar para el atributo "{1}" asociado a un tipo de elemento "{0}". + CloseQuoteExpected = Las comillas de cierre se deben utilizar para el atributo "{1}" asociado a un tipo de elemento "{0}". + AttributeNotUnique = El atributo "{1}" ya se ha especificado para el elemento "{0}". + AttributeNSNotUnique = El atributo "{1}" enlazado al espacio de nombres "{2}" ya se ha especificado para el elemento "{0}". + ETagUnterminated = La etiqueta final para el tipo de elemento "{0}" debe finalizar en un delimitador ''>''. MarkupNotRecognizedInContent = El contenido de los elementos debe constar de marcadores o datos de car\u00E1cter con un formato correcto. DoctypeIllegalInContent = No se permite un DOCTYPE en el contenido. # 4.1 Character and Entity References ReferenceUnterminated = La referencia debe finalizar con un delimitador ';'. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = La referencia debe incluirse totalmente en la misma entidad analizada. - ElementEntityMismatch = El elemento \"{0}\" debe empezar y finalizar en la misma entidad. + ElementEntityMismatch = El elemento "{0}" debe empezar y finalizar en la misma entidad. MarkupEntityMismatch=Las estructuras del documento XML deben empezar y finalizar en la misma entidad. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{2}) no v\u00E1lido en el valor del atributo \"{1}\" y el elemento es \"{0}\". + InvalidCharInAttValue = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{2}) no v\u00E1lido en el valor del atributo "{1}" y el elemento es "{0}". InvalidCharInComment = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el comentario. InvalidCharInPI = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la instrucci\u00F3n de procesamiento. InvalidCharInInternalSubset = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en el subconjunto interno del DTD. InvalidCharInTextDecl = Se ha encontrado un car\u00E1cter XML (Unicode: 0x{0}) no v\u00E1lido en la declaraci\u00F3n de texto. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = El valor del atributo \"{1}\" debe empezar por un car\u00E1cter de comillas dobles o simples. - LessthanInAttValue = El valor del atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no debe contener el car\u00E1cter ''<''. - AttributeValueUnterminated = El valor para el atributo \"{1}\" debe finalizar en un car\u00E1cter de comillas coincidentes. + QuoteRequiredInAttValue = El valor del atributo "{1}" debe empezar por un car\u00E1cter de comillas dobles o simples. + LessthanInAttValue = El valor del atributo "{1}" asociado a un tipo de elemento "{0}" no debe contener el car\u00E1cter ''<''. + AttributeValueUnterminated = El valor para el atributo "{1}" debe finalizar en un car\u00E1cter de comillas coincidentes. # 2.5 Comments - InvalidCommentStart = El comentario debe empezar por \"\". + InvalidCommentStart = El comentario debe empezar por "". COMMENT_NOT_IN_ONE_ENTITY = El comentario no est\u00E1 incluido en la misma entidad. # 2.6 Processing Instructions PITargetRequired = La instrucci\u00F3n de procesamiento debe empezar por el nombre del destino. SpaceRequiredInPI = Es necesario un espacio en blanco entre el destino de la instrucci\u00F3n de procesamiento y los datos. - PIUnterminated = La instrucci\u00F3n de procesamiento debe finalizar en \"?>\". - ReservedPITarget = El destino de la instrucci\u00F3n de procesamiento que coincide con \"[xX][mM][lL]\" no est\u00E1 permitido. + PIUnterminated = La instrucci\u00F3n de procesamiento debe finalizar en "?>". + ReservedPITarget = El destino de la instrucci\u00F3n de procesamiento que coincide con "[xX][mM][lL]" no est\u00E1 permitido. PI_NOT_IN_ONE_ENTITY = La instrucci\u00F3n de procesamiento no est\u00E1 incluida en la misma entidad. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Versi\u00F3n no v\u00E1lida \"{0}\". - VersionNotSupported = La versi\u00F3n XML \"{0}\" no est\u00E1 soportada, s\u00F3lo la versi\u00F3n XML 1.0 est\u00E1 soportada. - VersionNotSupported11 = La versi\u00F3n XML \"{0}\" no est\u00E1 soportada, s\u00F3lo las versiones XML 1.0 y XML 1.1 est\u00E1n soportadas. + VersionInfoInvalid = Versi\u00F3n no v\u00E1lida "{0}". + VersionNotSupported = La versi\u00F3n XML "{0}" no est\u00E1 soportada, s\u00F3lo la versi\u00F3n XML 1.0 est\u00E1 soportada. + VersionNotSupported11 = La versi\u00F3n XML "{0}" no est\u00E1 soportada, s\u00F3lo las versiones XML 1.0 y XML 1.1 est\u00E1n soportadas. VersionMismatch= Una entidad no puede incluir otra entidad de una versi\u00F3n posterior. # 4.1 Character and Entity References - DigitRequiredInCharRef = Una representaci\u00F3n decimal debe aparecer inmediatamente despu\u00E9s de \"&#\" en una referencia de caracteres. - HexdigitRequiredInCharRef = Una representaci\u00F3n hexadecimal debe aparecer inmediatamente despu\u00E9s de \"&#\" en una referencia de caracteres. + DigitRequiredInCharRef = Una representaci\u00F3n decimal debe aparecer inmediatamente despu\u00E9s de "&#" en una referencia de caracteres. + HexdigitRequiredInCharRef = Una representaci\u00F3n hexadecimal debe aparecer inmediatamente despu\u00E9s de "&#" en una referencia de caracteres. SemicolonRequiredInCharRef = La referencia de caracteres debe finalizar en el delimitador ';'. - InvalidCharRef = La referencia de caracteres \"&#{0}\" es un car\u00E1cter XML no v\u00E1lido. + InvalidCharRef = La referencia de caracteres "&#{0}" es un car\u00E1cter XML no v\u00E1lido. NameRequiredInReference = El nombre de la entidad debe aparecer inmediatamente despu\u00E9s de '&' en la referencia de entidades. - SemicolonRequiredInReference = La referencia a la entidad \"{0}\" debe finalizar en el delimitador '';''. + SemicolonRequiredInReference = La referencia a la entidad "{0}" debe finalizar en el delimitador '';''. # 4.3.1 The Text Declaration TextDeclMustBeFirst = La declaraci\u00F3n de texto s\u00F3lo puede aparecer al principio de la entidad analizada externa. - EqRequiredInTextDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de \"{0}\" en la declaraci\u00F3n de texto. - QuoteRequiredInTextDecl = El valor despu\u00E9s de \"{0}\" en la declaraci\u00F3n de texto debe ser una cadena con comillas. - CloseQuoteMissingInTextDecl = Faltan las comillas de cierre en el valor despu\u00E9s de \"{0}\" en la declaraci\u00F3n de texto. + EqRequiredInTextDecl = El car\u00E1cter '' = '' debe aparecer despu\u00E9s de "{0}" en la declaraci\u00F3n de texto. + QuoteRequiredInTextDecl = El valor despu\u00E9s de "{0}" en la declaraci\u00F3n de texto debe ser una cadena con comillas. + CloseQuoteMissingInTextDecl = Faltan las comillas de cierre en el valor despu\u00E9s de "{0}" en la declaraci\u00F3n de texto. SpaceRequiredBeforeVersionInTextDecl = Es necesario un espacio en blanco antes del pseudo atributo version en la declaraci\u00F3n de texto. SpaceRequiredBeforeEncodingInTextDecl = Es necesario un espacio en blanco antes del pseudo atributo encoding en la declaraci\u00F3n de texto. - TextDeclUnterminated = La declaraci\u00F3n de texto debe finalizar en \"?>\". + TextDeclUnterminated = La declaraci\u00F3n de texto debe finalizar en "?>". EncodingDeclRequired = La declaraci\u00F3n de codificaci\u00F3n es necesaria en la declaraci\u00F3n de texto. NoMorePseudoAttributes = No se permiten m\u00E1s pseudo atributos. MorePseudoAttributes = Se esperan m\u00E1s pseudo atributos. @@ -143,13 +140,13 @@ CommentNotInOneEntity = El comentario debe incluirse totalmente en la misma entidad analizada. PINotInOneEntity = La instrucci\u00F3n de procesamiento debe incluirse totalmente en la misma entidad analizada. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Nombre de codificaci\u00F3n no v\u00E1lido \"{0}\". - EncodingByteOrderUnsupported = El orden de bytes proporcionado para la codificaci\u00F3n \"{0}\" no est\u00E1 soportado. + EncodingDeclInvalid = Nombre de codificaci\u00F3n no v\u00E1lido "{0}". + EncodingByteOrderUnsupported = El orden de bytes proporcionado para la codificaci\u00F3n "{0}" no est\u00E1 soportado. InvalidByte = Byte no v\u00E1lido {0} de la secuencia UTF-8 de {1} bytes ExpectedByte = Byte esperado {0} de la secuencia UTF-8 de {1} bytes. InvalidHighSurrogate = Los bits de sustituci\u00F3n superior en la secuencia UTF-8 no deben exceder 0x10 pero se han encontrado 0x{0}. - OperationNotSupported = La operaci\u00F3n \"{0}\" no est\u00E1 soportada por el lector {1}. - InvalidASCII = El byte \"{0}\"no es un miembro del juego de caracteres ASCII (7 bits). + OperationNotSupported = La operaci\u00F3n "{0}" no est\u00E1 soportada por el lector {1}. + InvalidASCII = El byte "{0}"no es un miembro del juego de caracteres ASCII (7 bits). CharConversionFailure = Una entidad con una codificaci\u00F3n determinada no debe contener secuencias no permitidas en dicha codificaci\u00F3n. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = El car\u00E1cter (Unicode: 0x{0}) no est\u00E1 permitido en el identificador p\u00FAblico. SpaceRequiredBetweenPublicAndSystem = Son necesarios espacios en blanco entre publicId y systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Es necesario un espacio en blanco despu\u00E9s de \"''. - PEReferenceWithinMarkup = La referencia de entidad del par\u00E1metro \"%{0};\" no puede producirse en el marcador en el subconjunto interno del DTD. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Es necesario un espacio en blanco despu\u00E9s de "''. + PEReferenceWithinMarkup = La referencia de entidad del par\u00E1metro "%{0};" no puede producirse en el marcador en el subconjunto interno del DTD. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Las declaraciones de marcador que se incluyen o a las que apunta la declaraci\u00F3n de tipo de documento deben tener el formato correcto. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = La declaraci\u00F3n de atributo para \"xml:space\" debe ofrecerse como un tipo enumerado cuyos \u00FAnicos valores posibles son \"default\" y \"preserve\". + MSG_XML_SPACE_DECLARATION_ILLEGAL = La declaraci\u00F3n de atributo para "xml:space" debe ofrecerse como un tipo enumerado cuyos \u00FAnicos valores posibles son "default" y "preserve". # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Es necesario un espacio en blanco despu\u00E9s de \"''. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Es necesario un espacio en blanco despu\u00E9s del tipo de elemento "{0}" en la declaraci\u00F3n de tipo de elemento. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Es necesaria la restricci\u00F3n despu\u00E9s del tipo de elemento "{0}" en la declaraci\u00F3n de tipo de elemento. + ElementDeclUnterminated = La declaraci\u00F3n para el tipo de elemento "{0}" debe finalizar en ''>''. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un car\u00E1cter ''('' o un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento \"{0}\". + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un car\u00E1cter ''('' o un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento "{0}". # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento \"{0}\". - MixedContentUnterminated = El modelo de contenido mixto \"{0}\" debe finalizar en \")*\" cuando los tipos de elementos secundarios est\u00E1n restringidos. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo de elemento es necesario en la declaraci\u00F3n de tipo de elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un car\u00E1cter '')'' es necesario en la declaraci\u00F3n de tipo de elemento "{0}". + MixedContentUnterminated = El modelo de contenido mixto "{0}" debe finalizar en ")*" cuando los tipos de elementos secundarios est\u00E1n restringidos. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Es necesario un espacio en blanco despu\u00E9s de \"\". - IgnoreSectUnterminated = La secci\u00F3n condicional excluida debe finalizar en \"]]>\". + IncludeSectUnterminated = La secci\u00F3n condicional incluida debe finalizar en "]]>". + IgnoreSectUnterminated = La secci\u00F3n condicional excluida debe finalizar en "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = El nombre de la entidad debe aparecer inmediatamente despu\u00E9s de '%' en la referencia de entidad de par\u00E1metro. - SemicolonRequiredInPEReference = La referencia de entidad de par\u00E1metro \"%{0};\" debe finalizar en el delimitador '';''. + SemicolonRequiredInPEReference = La referencia de entidad de par\u00E1metro "%{0};" debe finalizar en el delimitador '';''. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Es necesario un espacio en blanco despu\u00E9s de \"''. - MSG_DUPLICATE_ENTITY_DEFINITION = La entidad \"{0}\" se ha declarado m\u00E1s de una vez. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Es necesario un espacio en blanco entre el nombre de entidad "{0}" y la definici\u00F3n en la declaraci\u00F3n de entidad. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Es necesario un espacio en blanco entre "NDATA" y el nombre de notaci\u00F3n en la declaraci\u00F3n para la entidad "{0}". + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Es necesario un espacio en blanco antes de "NDATA" en la declaraci\u00F3n para la entidad "{0}". + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = El nombre de notaci\u00F3n es necesario despu\u00E9s de "NDATA" en la declaraci\u00F3n para la entidad "{0}". + EntityDeclUnterminated = La declaraci\u00F3n para la entidad "{0}" debe finalizar en ''>''. + MSG_DUPLICATE_ENTITY_DEFINITION = La entidad "{0}" se ha declarado m\u00E1s de una vez. # 4.2.2 External Entities - ExternalIDRequired = La declaraci\u00F3n de entidad externa debe empezar por \"SYSTEM\" o \"PUBLIC\". - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre \"PUBLIC\" y el identificador p\u00FAblico. + ExternalIDRequired = La declaraci\u00F3n de entidad externa debe empezar por "SYSTEM" o "PUBLIC". + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre "PUBLIC" y el identificador p\u00FAblico. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre el identificador p\u00FAblico y el identificador del sistema. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre \"SYSTEM\" y el identificador del sistema. - MSG_URI_FRAGMENT_IN_SYSTEMID = No se debe especificar el identificador del fragmento como parte del identificador del sistema \"{0}\". + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Es necesario un espacio en blanco entre "SYSTEM" y el identificador del sistema. + MSG_URI_FRAGMENT_IN_SYSTEMID = No se debe especificar el identificador del fragmento como parte del identificador del sistema "{0}". # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Es necesario un espacio en blanco despu\u00E9s de \"''. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Es necesario un espacio en blanco despu\u00E9s del nombre de la notaci\u00F3n "{0}" en la declaraci\u00F3n de notaci\u00F3n. + ExternalIDorPublicIDRequired = La declaraci\u00F3n para la notaci\u00F3n "{0}" debe incluir un identificador p\u00FAblico o del sistema. + NotationDeclUnterminated = La declaraci\u00F3n para la notaci\u00F3n "{0}" debe finalizar en ''>''. # Validation messages - DuplicateTypeInMixedContent = El tipo de elemento \"{1}\" ya se especific\u00F3 en el modelo de contenido de la declaraci\u00F3n de elementos \"{0}\". - ENTITIESInvalid = El valor de atributo \"{1}\" del tipo ENTITIES debe ser el nombre de una o m\u00E1s entidades no analizadas. - ENTITYInvalid = El valor de atributo \"{1}\" del tipo ENTITY debe ser el nombre de una entidad no analizada. - IDDefaultTypeInvalid = El atributo de identificador \"{0}\" debe tener un valor por defecto declarado de \"#IMPLIED\" o \"#REQUIRED\". - IDInvalid = El valor de atributo \"{0}\" del tipo ID debe ser un nombre. - IDInvalidWithNamespaces = El valor de atributo \"{0}\" del tipo ID debe ser un NCName cuando los espacios de nombres est\u00E9n activados. - IDNotUnique = El valor de atributo \"{0}\" del tipo ID debe ser \u00FAnico en el documento. - IDREFInvalid = El valor de atributo \"{0}\" del tipo IDREF debe ser un nombre. - IDREFInvalidWithNamespaces = El valor de atributo \"{0}\" del tipo IDREF debe ser un NCName cuando los espacios de nombres est\u00E9n activados. - IDREFSInvalid = El valor de atributo \"{0}\" del tipo IDREFS debe ser uno o m\u00E1s nombres. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro \"{0}\" debe incluir declaraciones correctamente anidadas cuando la referencia de entidad se utiliza como una declaraci\u00F3n completa. - ImproperDeclarationNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro \"{0}\" debe incluir declaraciones correctamente anidadas. - ImproperGroupNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro \"{0}\" debe incluir pares de par\u00E9ntesis correctamente anidados. - INVALID_PE_IN_CONDITIONAL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro \"{0}\" debe incluir la secci\u00F3n condicional completa o s\u00F3lo INCLUDE o IGNORE. - MSG_ATTRIBUTE_NOT_DECLARED = El atributo \"{1}\" se debe haber declarado para el tipo de elemento \"{0}\". - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = El atributo \"{0}\" con el valor \"{1}\" debe tener un valor de la lista \"{2}\". - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = El valor \"{1}\" del atributo \"{0}\" no se debe cambiar mediante la normalizaci\u00F3n (a \"{2}\") en un documento aut\u00F3nomo. - MSG_CONTENT_INCOMPLETE = El contenido del tipo de elemento \"{0}\" es incompleto, debe coincidir con \"{1}\". - MSG_CONTENT_INVALID = El contenido del tipo de elemento \"{0}\" debe coincidir con \"{1}\". - MSG_CONTENT_INVALID_SPECIFIED = El contenido del tipo de elemento \"{0}\" debe coincidir con \"{1}\". Los secundarios del tipo \"{2}\" no est\u00E1n permitidos. - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = El atributo \"{1}\" para el tipo de elemento \"{0}\" tiene un valor por defecto y debe especificarse en un documento aut\u00F3nomo. - MSG_DUPLICATE_ATTDEF = El atributo \"{1}\" ya se ha declarado para el tipo de elemento \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = El tipo de elemento \"{0}\" no debe declararse m\u00E1s de una vez. - MSG_ELEMENT_NOT_DECLARED = El tipo de elemento \"{0}\" debe declararse. + DuplicateTypeInMixedContent = El tipo de elemento "{1}" ya se especific\u00F3 en el modelo de contenido de la declaraci\u00F3n de elementos "{0}". + ENTITIESInvalid = El valor de atributo "{1}" del tipo ENTITIES debe ser el nombre de una o m\u00E1s entidades no analizadas. + ENTITYInvalid = El valor de atributo "{1}" del tipo ENTITY debe ser el nombre de una entidad no analizada. + IDDefaultTypeInvalid = El atributo de identificador "{0}" debe tener un valor por defecto declarado de "#IMPLIED" o "#REQUIRED". + IDInvalid = El valor de atributo "{0}" del tipo ID debe ser un nombre. + IDInvalidWithNamespaces = El valor de atributo "{0}" del tipo ID debe ser un NCName cuando los espacios de nombres est\u00E9n activados. + IDNotUnique = El valor de atributo "{0}" del tipo ID debe ser \u00FAnico en el documento. + IDREFInvalid = El valor de atributo "{0}" del tipo IDREF debe ser un nombre. + IDREFInvalidWithNamespaces = El valor de atributo "{0}" del tipo IDREF debe ser un NCName cuando los espacios de nombres est\u00E9n activados. + IDREFSInvalid = El valor de atributo "{0}" del tipo IDREFS debe ser uno o m\u00E1s nombres. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir declaraciones correctamente anidadas cuando la referencia de entidad se utiliza como una declaraci\u00F3n completa. + ImproperDeclarationNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir declaraciones correctamente anidadas. + ImproperGroupNesting = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir pares de par\u00E9ntesis correctamente anidados. + INVALID_PE_IN_CONDITIONAL = El texto de sustituci\u00F3n de la entidad del par\u00E1metro "{0}" debe incluir la secci\u00F3n condicional completa o s\u00F3lo INCLUDE o IGNORE. + MSG_ATTRIBUTE_NOT_DECLARED = El atributo "{1}" se debe haber declarado para el tipo de elemento "{0}". + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = El atributo "{0}" con el valor "{1}" debe tener un valor de la lista "{2}". + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = El valor "{1}" del atributo "{0}" no se debe cambiar mediante la normalizaci\u00F3n (a "{2}") en un documento aut\u00F3nomo. + MSG_CONTENT_INCOMPLETE = El contenido del tipo de elemento "{0}" es incompleto, debe coincidir con "{1}". + MSG_CONTENT_INVALID = El contenido del tipo de elemento "{0}" debe coincidir con "{1}". + MSG_CONTENT_INVALID_SPECIFIED = El contenido del tipo de elemento "{0}" debe coincidir con "{1}". Los secundarios del tipo "{2}" no est\u00E1n permitidos. + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = El atributo "{1}" para el tipo de elemento "{0}" tiene un valor por defecto y debe especificarse en un documento aut\u00F3nomo. + MSG_DUPLICATE_ATTDEF = El atributo "{1}" ya se ha declarado para el tipo de elemento "{0}". + MSG_ELEMENT_ALREADY_DECLARED = El tipo de elemento "{0}" no debe declararse m\u00E1s de una vez. + MSG_ELEMENT_NOT_DECLARED = El tipo de elemento "{0}" debe declararse. MSG_GRAMMAR_NOT_FOUND = El documento no es v\u00E1lido: no se ha encontrado la gram\u00E1tica. - MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con el identificador \"{0}\" debe aparecer en el documento. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La referencia a la entidad externa \"{0}\" no est\u00E1 permitida en un documento aut\u00F3nomo. - MSG_FIXED_ATTVALUE_INVALID = El atributo \"{1}\" con el valor \"{2}\" debe tener un valor de \"{3}\". - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = El tipo de elemento \"{0}\" ya tiene un atributo \"{1}\" del tipo ID, un segundo atributo \"{2}\" del tipo ID no est\u00E1 permitido. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = El tipo de elemento \"{0}\" ya tiene un atributo \"{1}\" del tipo NOTATION, un segundo atributo \"{2}\" del tipo NOTATION no est\u00E1 permitido. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notaci\u00F3n \"{1}\" debe declararse cuando se hace referencia a la misma en la lista de tipos de notaci\u00F3n para el atributo \"{0}\". - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notaci\u00F3n \"{1}\" debe declararse cuando se hace referencia a la misma en la declaraci\u00F3n de entidad no analizada para \"{0}\". - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La referencia a la entidad \"{0}\" declarada en una entidad analizada externa no est\u00E1 permitida en un documento aut\u00F3nomo. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = El atributo \"{1}\" es necesario y debe especificarse para el tipo de elemento \"{0}\". + MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con el identificador "{0}" debe aparecer en el documento. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La referencia a la entidad externa "{0}" no est\u00E1 permitida en un documento aut\u00F3nomo. + MSG_FIXED_ATTVALUE_INVALID = El atributo "{1}" con el valor "{2}" debe tener un valor de "{3}". + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = El tipo de elemento "{0}" ya tiene un atributo "{1}" del tipo ID, un segundo atributo "{2}" del tipo ID no est\u00E1 permitido. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = El tipo de elemento "{0}" ya tiene un atributo "{1}" del tipo NOTATION, un segundo atributo "{2}" del tipo NOTATION no est\u00E1 permitido. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notaci\u00F3n "{1}" debe declararse cuando se hace referencia a la misma en la lista de tipos de notaci\u00F3n para el atributo "{0}". + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notaci\u00F3n "{1}" debe declararse cuando se hace referencia a la misma en la declaraci\u00F3n de entidad no analizada para "{0}". + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La referencia a la entidad "{0}" declarada en una entidad analizada externa no est\u00E1 permitida en un documento aut\u00F3nomo. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = El atributo "{1}" es necesario y debe especificarse para el tipo de elemento "{0}". MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = No debe incluirse un espacio en blanco entre los elementos declarados en una entidad analizada externa con el contenido del elemento en un documento aut\u00F3nomo. - NMTOKENInvalid = El valor de atributo \"{0}\" del tipo NMTOKEN debe ser un elemento de nombre. - NMTOKENSInvalid = El valor de atributo \"{0}\" del tipo NMTOKENS debe ser uno o m\u00E1s elementos de nombre. - NoNotationOnEmptyElement = El tipo de elemento \"{0}\" que se declar\u00F3 como EMPTY no puede declarar el atributo \"{1}\" del tipo NOTATION. - RootElementTypeMustMatchDoctypedecl = El elemento ra\u00EDz del documento \"{1}\", debe coincidir con la ra\u00EDz DOCTYPE \"{0}\". - UndeclaredElementInContentSpec = El modelo de contenido del elemento \"{0}\" hace referencia al elemento no declarado \"{1}\". - UniqueNotationName = La declaraci\u00F3n de la notaci\u00F3n \"{0}\" no es \u00FAnica. Un nombre determinado no debe declararse en m\u00E1s de una declaraci\u00F3n de notaci\u00F3n. + NMTOKENInvalid = El valor de atributo "{0}" del tipo NMTOKEN debe ser un token de nombre. + NMTOKENSInvalid = El valor de atributo "{0}" del tipo NMTOKENS debe ser uno o m\u00E1s tokens de nombre. + NoNotationOnEmptyElement = El tipo de elemento "{0}" que se declar\u00F3 como EMPTY no puede declarar el atributo "{1}" del tipo NOTATION. + RootElementTypeMustMatchDoctypedecl = El elemento ra\u00EDz del documento "{1}", debe coincidir con la ra\u00EDz DOCTYPE "{0}". + UndeclaredElementInContentSpec = El modelo de contenido del elemento "{0}" hace referencia al elemento no declarado "{1}". + UniqueNotationName = La declaraci\u00F3n de la notaci\u00F3n "{0}" no es \u00FAnica. Un nombre determinado no debe declararse en m\u00E1s de una declaraci\u00F3n de notaci\u00F3n. ENTITYFailedInitializeGrammar = Fallo del validador ENTITYDatatype. Es necesario llamar al m\u00E9todo de inicializaci\u00F3n con una referencia de gram\u00E1tica v\u00E1lida. \t - ENTITYNotUnparsed = ENTITY \"{0}\"no est\u00E1 sin analizar. - ENTITYNotValid = ENTITY \"{0}\" no es v\u00E1lida. + ENTITYNotUnparsed = ENTITY "{0}"no est\u00E1 sin analizar. + ENTITYNotValid = ENTITY "{0}" no es v\u00E1lida. EmptyList = El valor de tipo ENTITIES, IDREFS y NMTOKENS no puede ser una lista vac\u00EDa. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = La referencia de entidad externa \"&{0};\" no est\u00E1 permitida en un valor de atributo. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = La referencia de entidad externa "&{0};" no est\u00E1 permitida en un valor de atributo. + AccessExternalDTD = DTD externa: fallo al leer DTD externa ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. + AccessExternalEntity = Entidad externa: fallo al leer el documento externo ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. # 4.1 Character and Entity References - EntityNotDeclared = Se hizo referencia a la entidad \"{0}\", pero no se declar\u00F3. - ReferenceToUnparsedEntity = La referencia de entidad no analizada \"&{0};\" no est\u00E1 permitida. - RecursiveReference = Referencia de entidad recursiva \"{0}\". (Ruta de acceso de referencia: {1}), - RecursiveGeneralReference = Referencia de entidad general recursiva \"&{0};\". (Ruta de acceso de referencia: {1}), - RecursivePEReference = Referencia de entidad de par\u00E1metro recursiva \"%{0};\". (Ruta de acceso de referencia: {1}), + EntityNotDeclared = Se hizo referencia a la entidad "{0}", pero no se declar\u00F3. + ReferenceToUnparsedEntity = La referencia de entidad no analizada "&{0};" no est\u00E1 permitida. + RecursiveReference = Referencia de entidad recursiva "{0}". (Ruta de acceso de referencia: {1}), + RecursiveGeneralReference = Referencia de entidad general recursiva "&{0};". (Ruta de acceso de referencia: {1}), + RecursivePEReference = Referencia de entidad de par\u00E1metro recursiva "%{0};". (Ruta de acceso de referencia: {1}), # 4.3.3 Character Encoding in Entities - EncodingNotSupported = La codificaci\u00F3n \"{0}\" no est\u00E1 soportada. + EncodingNotSupported = La codificaci\u00F3n "{0}" no est\u00E1 soportada. EncodingRequired = Una entidad analizada no codificada en UTF-8 o UTF-16 debe contener una declaraci\u00F3n de codificaci\u00F3n. # Namespaces support # 4. Using Qualified Names IllegalQName = El elemento o el atributo no coinciden con la producci\u00F3n del QName: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = El elemento \"{0}\" no puede tener \"xmlns\" como prefijo. - ElementPrefixUnbound = El prefijo \"{0}\" para el elemento \"{1}\" no est\u00E1 enlazado. - AttributePrefixUnbound = El prefijo \"{2}\" para el atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no est\u00E1 enlazado. - EmptyPrefixedAttName = El valor del atributo \"{0}\" no es v\u00E1lido. Los enlaces de espacio de nombres utilizados de prefijo no pueden estar vac\u00EDos. - PrefixDeclared = El prefijo de espacio de nombres \"{0}\" no se ha declarado. + ElementXMLNSPrefix = El elemento "{0}" no puede tener "xmlns" como prefijo. + ElementPrefixUnbound = El prefijo "{0}" para el elemento "{1}" no est\u00E1 enlazado. + AttributePrefixUnbound = El prefijo "{2}" para el atributo "{1}" asociado a un tipo de elemento "{0}" no est\u00E1 enlazado. + EmptyPrefixedAttName = El valor del atributo "{0}" no es v\u00E1lido. Los enlaces de espacio de nombres utilizados de prefijo no pueden estar vac\u00EDos. + PrefixDeclared = El prefijo de espacio de nombres "{0}" no se ha declarado. CantBindXMLNS = El prefijo "xmlns" no puede enlazarse a ning\u00FAn espacio de nombres expl\u00EDcitamente; tampoco puede enlazarse el espacio de nombres para "xmlns" a cualquier prefijo expl\u00EDcitamente. CantBindXML = El prefijo "xml" no puede enlazarse a ning\u00FAn espacio de nombres que no sea el habitual; tampoco puede enlazarse el espacio de nombres para "xml" a cualquier prefijo que no sea "xml". - MSG_ATT_DEFAULT_INVALID = El valor por defecto \"{1}\" del atributo \"{0}\" no es legal para las restricciones l\u00E9xicas de este tipo de atributo. + MSG_ATT_DEFAULT_INVALID = El valor por defecto "{1}" del atributo "{0}" no es legal para las restricciones l\u00E9xicas de este tipo de atributo. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=El analizador ha encontrado m\u00E1s de \"{0}\"ampliaciones de entidad en este documento; \u00E9ste es el l\u00EDmite impuesto por la aplicaci\u00F3n. +EntityExpansionLimitExceeded=El analizador ha encontrado m\u00E1s de "{0}"ampliaciones de entidad en este documento; \u00E9ste es el l\u00EDmite impuesto por la aplicaci\u00F3n. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= El elemento \"{0}\" tiene m\u00E1s de \"{1}\" atributos, \"{1}\" es el l\u00EDmite impuesto por la aplicaci\u00F3n. +ElementAttributeLimit= El elemento "{0}" tiene m\u00E1s de "{1}" atributos, "{1}" es el l\u00EDmite impuesto por la aplicaci\u00F3n. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties index f60b07301ee..915a6e7b180 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le prologue du document. InvalidCharInXMLDecl = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la d\u00E9claration XML. # 2.4 Character Data and Markup - CDEndInContent = La s\u00E9quence de caract\u00E8res \"]]>\" ne doit pas figurer dans le contenu sauf si elle est utilis\u00E9e pour baliser la fin d'une section CDATA. + CDEndInContent = La s\u00E9quence de caract\u00E8res "]]>" ne doit pas figurer dans le contenu sauf si elle est utilis\u00E9e pour baliser la fin d'une section CDATA. # 2.7 CDATA Sections - CDSectUnterminated = La section CDATA doit se terminer par \"]]>\". + CDSectUnterminated = La section CDATA doit se terminer par "]]>". # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = La d\u00E9claration XML ne peut figurer qu'au d\u00E9but du document. - EqRequiredInXMLDecl = Le caract\u00E8re ''='' doit suivre \"{0}\" dans la d\u00E9claration XML. - QuoteRequiredInXMLDecl = La valeur suivant \"{0}\" dans la d\u00E9claration XML doit \u00EAtre une cha\u00EEne entre guillemets. - XMLDeclUnterminated = La d\u00E9claration XML doit se terminer par \"?>\". + EqRequiredInXMLDecl = Le caract\u00E8re ''='' doit suivre "{0}" dans la d\u00E9claration XML. + QuoteRequiredInXMLDecl = La valeur suivant "{0}" dans la d\u00E9claration XML doit \u00EAtre une cha\u00EEne entre guillemets. + XMLDeclUnterminated = La d\u00E9claration XML doit se terminer par "?>". VersionInfoRequired = La version est obligatoire dans la d\u00E9claration XML. SpaceRequiredBeforeVersionInXMLDecl = Un espace est obligatoire devant le pseudo-attribut version dans la d\u00E9claration XML. SpaceRequiredBeforeEncodingInXMLDecl = Un espace est obligatoire devant le pseudo-attribut encoding dans la d\u00E9claration XML. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=R\u00E9f\u00E9rence non autoris\u00E9e dans la section de fin. # 2.9 Standalone Document Declaration - SDDeclInvalid = La valeur de d\u00E9claration de document autonome doit \u00EAtre \"oui\" ou \"non\", mais pas \"{0}\". + SDDeclInvalid = La valeur de d\u00E9claration de document autonome doit \u00EAtre "oui" ou "non", mais pas "{0}". # 2.12 Language Identification - XMLLangInvalid = La valeur d''attribut xml:lang \"{0}\" est un identificateur de langue non valide. + XMLLangInvalid = La valeur d''attribut xml:lang "{0}" est un identificateur de langue non valide. # 3. Logical Structures - ETagRequired = Le type d''\u00E9l\u00E9ment \"{0}\" doit se terminer par la balise de fin correspondante \"\". + ETagRequired = Le type d''\u00E9l\u00E9ment "{0}" doit se terminer par la balise de fin correspondante "". # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = Le type d''\u00E9l\u00E9ment \"{0}\" doit \u00EAtre suivi des sp\u00E9cifications d''attribut, \">\" ou \"/>\". - EqRequiredInAttribute = Le nom d''attribut \"{1}\" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment \"{0}\" doit \u00EAtre suivi du caract\u00E8re ''=''. - OpenQuoteExpected = Des guillemets ouvrants sont attendus pour l''attribut \"{1}\" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment \"{0}\". - CloseQuoteExpected = Des guillemets fermants sont attendus pour l''attribut \"{1}\" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment \"{0}\". - AttributeNotUnique = L''attribut \"{1}\" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment \"{0}\". - AttributeNSNotUnique = L''attribut \"{1}\" li\u00E9 \u00E0 l''espace de noms \"{2}\" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment \"{0}\". - ETagUnterminated = La balise de fin pour le type d''\u00E9l\u00E9ment \"{0}\" doit se terminer par un d\u00E9limiteur ''>''. + ElementUnterminated = Le type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre suivi des sp\u00E9cifications d''attribut, ">" ou "/>". + EqRequiredInAttribute = Le nom d''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre suivi du caract\u00E8re ''=''. + OpenQuoteExpected = Des guillemets ouvrants sont attendus pour l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}". + CloseQuoteExpected = Des guillemets fermants sont attendus pour l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}". + AttributeNotUnique = L''attribut "{1}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment "{0}". + AttributeNSNotUnique = L''attribut "{1}" li\u00E9 \u00E0 l''espace de noms "{2}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 pour l''\u00E9l\u00E9ment "{0}". + ETagUnterminated = La balise de fin pour le type d''\u00E9l\u00E9ment "{0}" doit se terminer par un d\u00E9limiteur ''>''. MarkupNotRecognizedInContent = Le contenu des \u00E9l\u00E9ments doit inclure un balisage ou des caract\u00E8res au format correct. DoctypeIllegalInContent = Un DOCTYPE n'est pas autoris\u00E9 dans le contenu. # 4.1 Character and Entity References ReferenceUnterminated = La r\u00E9f\u00E9rence doit se terminer par un d\u00E9limiteur ';'. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = La r\u00E9f\u00E9rence doit \u00EAtre enti\u00E8rement incluse dans la m\u00EAme entit\u00E9 analys\u00E9e. - ElementEntityMismatch = L''\u00E9l\u00E9ment \"{0}\" doit commencer et se terminer dans la m\u00EAme entit\u00E9. + ElementEntityMismatch = L''\u00E9l\u00E9ment "{0}" doit commencer et se terminer dans la m\u00EAme entit\u00E9. MarkupEntityMismatch=Les structures de document XML doivent commencer et se terminer dans la m\u00EAme entit\u00E9. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = Un caract\u00E8re XML non valide (Unicode : 0x{2}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la valeur de l''attribut \"{1}\" et l''\u00E9l\u00E9ment est \"{0}\". + InvalidCharInAttValue = Un caract\u00E8re XML non valide (Unicode : 0x{2}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la valeur de l''attribut "{1}" et l''\u00E9l\u00E9ment est "{0}". InvalidCharInComment = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le commentaire. InvalidCharInPI = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans l''instruction de traitement. InvalidCharInInternalSubset = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans le sous-ensemble interne de la DTD. InvalidCharInTextDecl = Un caract\u00E8re XML non valide (Unicode : 0x{0}) a \u00E9t\u00E9 d\u00E9tect\u00E9 dans la d\u00E9claration textuelle. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = La valeur de l''attribut \"{1}\" doit commencer par une apostrophe ou des guillemets. - LessthanInAttValue = La valeur de l''attribut \"{1}\" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment \"{0}\" ne doit pas contenir le caract\u00E8re ''<''. - AttributeValueUnterminated = La valeur de l''attribut \"{1}\" doit se terminer par les guillemets correspondants. + QuoteRequiredInAttValue = La valeur de l''attribut "{1}" doit commencer par une apostrophe ou des guillemets. + LessthanInAttValue = La valeur de l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" ne doit pas contenir le caract\u00E8re ''<''. + AttributeValueUnterminated = La valeur de l''attribut "{1}" doit se terminer par les guillemets correspondants. # 2.5 Comments - InvalidCommentStart = Le commentaire doit commencer par \"\". + InvalidCommentStart = Le commentaire doit commencer par "". COMMENT_NOT_IN_ONE_ENTITY = Le commentaire n'est pas compris dans la m\u00EAme entit\u00E9. # 2.6 Processing Instructions PITargetRequired = L'instruction de traitement doit commencer par le nom de la cible. SpaceRequiredInPI = Un espace est obligatoire entre les donn\u00E9es et la cible de l'instruction de traitement. - PIUnterminated = L'instruction de traitement doit se terminer par \"?>\". - ReservedPITarget = La cible de l'instruction de traitement correspondant \u00E0 \"[xX][mM][lL]\" n'est pas autoris\u00E9e. + PIUnterminated = L'instruction de traitement doit se terminer par "?>". + ReservedPITarget = La cible de l'instruction de traitement correspondant \u00E0 "[xX][mM][lL]" n'est pas autoris\u00E9e. PI_NOT_IN_ONE_ENTITY = L'instruction de traitement n'est pas comprise dans la m\u00EAme entit\u00E9. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Version \"{0}\" non valide. - VersionNotSupported = La version XML \"{0}\" n''est pas prise en charge. Seule la version XML 1.0 est prise en charge. - VersionNotSupported11 = La version XML \"{0}\" n''est pas prise en charge. Seules les versions XML 1.0 et XML 1.1 sont prises en charge. + VersionInfoInvalid = Version "{0}" non valide. + VersionNotSupported = La version XML "{0}" n''est pas prise en charge. Seule la version XML 1.0 est prise en charge. + VersionNotSupported11 = La version XML "{0}" n''est pas prise en charge. Seules les versions XML 1.0 et XML 1.1 sont prises en charge. VersionMismatch= Une entit\u00E9 ne peut pas inclure une autre entit\u00E9 d'une version ult\u00E9rieure. # 4.1 Character and Entity References - DigitRequiredInCharRef = Une repr\u00E9sentation d\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne \"&#\" dans une r\u00E9f\u00E9rence de caract\u00E8re. - HexdigitRequiredInCharRef = Une repr\u00E9sentation hexad\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne \"&#x\" dans une r\u00E9f\u00E9rence de caract\u00E8re. + DigitRequiredInCharRef = Une repr\u00E9sentation d\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne "&#" dans une r\u00E9f\u00E9rence de caract\u00E8re. + HexdigitRequiredInCharRef = Une repr\u00E9sentation hexad\u00E9cimale doit imm\u00E9diatement suivre la cha\u00EEne "&#x" dans une r\u00E9f\u00E9rence de caract\u00E8re. SemicolonRequiredInCharRef = La r\u00E9f\u00E9rence de caract\u00E8re doit se terminer par le d\u00E9limiteur ';'. - InvalidCharRef = La r\u00E9f\u00E9rence de caract\u00E8re \"&#{0}\" est un caract\u00E8re XML non valide. + InvalidCharRef = La r\u00E9f\u00E9rence de caract\u00E8re "&#{0}" est un caract\u00E8re XML non valide. NameRequiredInReference = Le nom de l'identit\u00E9 doit imm\u00E9diatement suivre le caract\u00E8re "&" dans la r\u00E9f\u00E9rence d'entit\u00E9. - SemicolonRequiredInReference = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 \"{0}\" doit se terminer par le d\u00E9limiteur '';''. + SemicolonRequiredInReference = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 "{0}" doit se terminer par le d\u00E9limiteur '';''. # 4.3.1 The Text Declaration TextDeclMustBeFirst = La d\u00E9claration textuelle ne doit figurer qu'au d\u00E9but de l'entit\u00E9 analys\u00E9e externe. - EqRequiredInTextDecl = Le caract\u00E8re ''='' doit suivre \"{0}\" dans la d\u00E9claration textuelle. - QuoteRequiredInTextDecl = La valeur suivant \"{0}\" dans la d\u00E9claration textuelle doit \u00EAtre une cha\u00EEne entre guillemets. - CloseQuoteMissingInTextDecl = Dans la valeur suivant \"{0}\" dans la d\u00E9claration textuelle, il manque les guillemets fermants. + EqRequiredInTextDecl = Le caract\u00E8re ''='' doit suivre "{0}" dans la d\u00E9claration textuelle. + QuoteRequiredInTextDecl = La valeur suivant "{0}" dans la d\u00E9claration textuelle doit \u00EAtre une cha\u00EEne entre guillemets. + CloseQuoteMissingInTextDecl = Dans la valeur suivant "{0}" dans la d\u00E9claration textuelle, il manque les guillemets fermants. SpaceRequiredBeforeVersionInTextDecl = Un espace est obligatoire devant le pseudo-attribut version dans la d\u00E9claration textuelle. SpaceRequiredBeforeEncodingInTextDecl = Un espace est obligatoire devant le pseudo-attribut encoding dans la d\u00E9claration textuelle. - TextDeclUnterminated = La d\u00E9claration textuelle doit se terminer par \"?>\". + TextDeclUnterminated = La d\u00E9claration textuelle doit se terminer par "?>". EncodingDeclRequired = La d\u00E9claration d'encodage est obligatoire dans la d\u00E9claration textuelle. NoMorePseudoAttributes = Aucun autre pseudo-attribut n'est autoris\u00E9. MorePseudoAttributes = D'autres pseudo-attributs sont attendus. @@ -143,13 +140,13 @@ CommentNotInOneEntity = Le commentaire doit \u00EAtre enti\u00E8rement inclus dans la m\u00EAme entit\u00E9 analys\u00E9e. PINotInOneEntity = L'instruction de traitement doit \u00EAtre enti\u00E8rement incluse dans la m\u00EAme entit\u00E9 analys\u00E9e. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Nom d''encodage \"{0}\" non valide. - EncodingByteOrderUnsupported = L''ordre des octets donn\u00E9 pour encoder \"{0}\" n''est pas pris en charge. + EncodingDeclInvalid = Nom d''encodage "{0}" non valide. + EncodingByteOrderUnsupported = L''ordre des octets donn\u00E9 pour encoder "{0}" n''est pas pris en charge. InvalidByte = Octet {0} de la s\u00E9quence UTF-8 \u00E0 {1} octets non valide. ExpectedByte = Octet {0} de la s\u00E9quence UTF-8 \u00E0 {1} octets attendu. InvalidHighSurrogate = Les bits de substitution sup\u00E9rieurs (High surrogate) dans la s\u00E9quence UTF-8 ne doivent pas d\u00E9passer 0x10 mais des bits 0x{0} ont \u00E9t\u00E9 d\u00E9tect\u00E9s. - OperationNotSupported = Op\u00E9ration \"{0}\" non prise en charge par le lecteur {1}. - InvalidASCII = L''octet \"{0}\" n''appartient pas au jeu de caract\u00E8res ASCII (7 bits). + OperationNotSupported = Op\u00E9ration "{0}" non prise en charge par le lecteur {1}. + InvalidASCII = L''octet "{0}" n''appartient pas au jeu de caract\u00E8res ASCII (7 bits). CharConversionFailure = Une entit\u00E9 respectant un certain encodage ne doit pas contenir de s\u00E9quences non admises dans cet encodage. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = Ce caract\u00E8re (Unicode : 0x{0}) n''est pas autoris\u00E9 dans l''identificateur public. SpaceRequiredBetweenPublicAndSystem = Des espaces sont obligatoires entre les ID publicId et systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Un espace est obligatoire apr\u00E8s \"''. - PEReferenceWithinMarkup = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre \"%{0};\" ne peut pas survenir dans le balisage du sous-ensemble interne de la DTD. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Un espace est obligatoire apr\u00E8s "''. + PEReferenceWithinMarkup = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre "%{0};" ne peut pas survenir dans le balisage du sous-ensemble interne de la DTD. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Les d\u00E9clarations de balisage contenues dans la d\u00E9claration de type de document ou sur lesquelles pointe cette derni\u00E8re doivent avoir un format correct. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = La d\u00E9claration d'attribut pour \"xml:space\" doit \u00EAtre pr\u00E9sent\u00E9e comme type \u00E9num\u00E9r\u00E9 dont les seules valeurs possibles sont \"default\" et \"preserve\". + MSG_XML_SPACE_DECLARATION_ILLEGAL = La d\u00E9claration d'attribut pour "xml:space" doit \u00EAtre pr\u00E9sent\u00E9e comme type \u00E9num\u00E9r\u00E9 dont les seules valeurs possibles sont "default" et "preserve". # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Un espace est obligatoire apr\u00E8s \"''. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Un espace est obligatoire apr\u00E8s le type d''\u00E9l\u00E9ment "{0}" dans la d\u00E9claration de type d''\u00E9l\u00E9ment. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = La contrainte est obligatoire apr\u00E8s le type d''\u00E9l\u00E9ment "{0}" dans la d\u00E9claration de type d''\u00E9l\u00E9ment. + ElementDeclUnterminated = La d\u00E9claration du type d''\u00E9l\u00E9ment "{0}" doit se terminer par ''>''. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un caract\u00E8re ''('' ou un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment \"{0}\". + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un caract\u00E8re ''('' ou un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}". # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment \"{0}\". - MixedContentUnterminated = Le mod\u00E8le de contenu mixte \"{0}\" doit se terminer par \")*\" lorsque les types d''\u00E9l\u00E9ment enfant sont contraints. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un type d''\u00E9l\u00E9ment est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un caract\u00E8re '')'' est obligatoire dans la d\u00E9claration du type d''\u00E9l\u00E9ment "{0}". + MixedContentUnterminated = Le mod\u00E8le de contenu mixte "{0}" doit se terminer par ")*" lorsque les types d''\u00E9l\u00E9ment enfant sont contraints. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Un espace est obligatoire apr\u00E8s \"\". - IgnoreSectUnterminated = La section conditionnelle exclue doit se terminer par \"]]>\". + IncludeSectUnterminated = La section conditionnelle incluse doit se terminer par "]]>". + IgnoreSectUnterminated = La section conditionnelle exclue doit se terminer par "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = Le nom de l'entit\u00E9 doit imm\u00E9diatement suivre le caract\u00E8re "%" dans la r\u00E9f\u00E9rence d'entit\u00E9 de param\u00E8tre. - SemicolonRequiredInPEReference = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre \"%{0};\" doit se terminer par le d\u00E9limiteur '';''. + SemicolonRequiredInPEReference = La r\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre "%{0};" doit se terminer par le d\u00E9limiteur '';''. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Un espace est obligatoire apr\u00E8s \"''. - MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E9 \"{0}\" est d\u00E9clar\u00E9e plusieurs fois. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Un espace est obligatoire entre le nom de l''entit\u00E9 "{0}" et la d\u00E9finition dans la d\u00E9claration d''entit\u00E9. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Un espace est obligatoire entre "NDATA" et le nom de notation dans la d\u00E9claration de l''entit\u00E9 "{0}". + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Un espace est obligatoire avant "NDATA" dans la d\u00E9claration de l''entit\u00E9 "{0}". + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Le nom de notation est obligatoire apr\u00E8s "NDATA" dans la d\u00E9claration de l''entit\u00E9 "{0}". + EntityDeclUnterminated = La d\u00E9claration de l''entit\u00E9 "{0}" doit se terminer par ''>''. + MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E9 "{0}" est d\u00E9clar\u00E9e plusieurs fois. # 4.2.2 External Entities - ExternalIDRequired = La d\u00E9claration d'entit\u00E9 externe doit commencer par \"SYSTEM\" ou \"PUBLIC\". - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Un espace est obligatoire entre \"PUBLIC\" et l'identificateur public. + ExternalIDRequired = La d\u00E9claration d'entit\u00E9 externe doit commencer par "SYSTEM" ou "PUBLIC". + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Un espace est obligatoire entre "PUBLIC" et l'identificateur public. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Un espace est obligatoire entre l'identificateur public et l'identificateur syst\u00E8me. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Un espace est obligatoire entre \"SYSTEM\" et l'identificateur syst\u00E8me. - MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificateur du fragment ne doit pas \u00EAtre sp\u00E9cifi\u00E9 comme faisant partie de l''identificateur syst\u00E8me \"{0}\". + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Un espace est obligatoire entre "SYSTEM" et l'identificateur syst\u00E8me. + MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificateur du fragment ne doit pas \u00EAtre sp\u00E9cifi\u00E9 comme faisant partie de l''identificateur syst\u00E8me "{0}". # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Un espace est obligatoire apr\u00E8s \"''. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Un espace est obligatoire apr\u00E8s le nom de notation "{0}" dans la d\u00E9claration de notation. + ExternalIDorPublicIDRequired = La d\u00E9claration de la notation "{0}" doit inclure un identificateur syst\u00E8me ou public. + NotationDeclUnterminated = La d\u00E9claration de la notation "{0}" doit se terminer par ''>''. # Validation messages - DuplicateTypeInMixedContent = Le type d''\u00E9l\u00E9ment \"{1}\" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 dans le mod\u00E8le de contenu de la d\u00E9claration d''\u00E9l\u00E9ment \"{0}\". - ENTITIESInvalid = La valeur d''attribut \"{1}\" de type ENTITIES doit correspondre au nom d''au moins une entit\u00E9 non analys\u00E9e. - ENTITYInvalid = La valeur d''attribut \"{1}\" de type ENTITY doit correspondre au nom d''une entit\u00E9 non analys\u00E9e. - IDDefaultTypeInvalid = L''attribut d''ID \"{0}\" doit avoir une valeur par d\u00E9faut d\u00E9clar\u00E9e de \"#IMPLIED\" ou \"#REQUIRED\". - IDInvalid = La valeur d''attribut \"{0}\" de type ID doit \u00EAtre un nom. - IDInvalidWithNamespaces = La valeur d''attribut \"{0}\" de type ID doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s. - IDNotUnique = La valeur d''attribut \"{0}\" de type ID doit \u00EAtre unique dans le document. - IDREFInvalid = La valeur d''attribut \"{0}\" de type IDREF doit \u00EAtre un nom. - IDREFInvalidWithNamespaces = La valeur d''attribut \"{0}\" de type IDREF doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s. - IDREFSInvalid = Une valeur d''attribut \"{0}\" de type IDREFS doit correspondre \u00E0 au moins un nom. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre \"{0}\" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es lorsque la r\u00E9f\u00E9rence d''entit\u00E9 est utilis\u00E9e comme d\u00E9claration compl\u00E8te. - ImproperDeclarationNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre \"{0}\" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es. - ImproperGroupNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre \"{0}\" doit inclure des paires de parenth\u00E8ses correctement imbriqu\u00E9es. - INVALID_PE_IN_CONDITIONAL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre \"{0}\" doit inclure la section conditionnelle compl\u00E8te ou seulement INCLUDE ou IGNORE. - MSG_ATTRIBUTE_NOT_DECLARED = L''attribut \"{1}\" doit \u00EAtre d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment \"{0}\". - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attribut \"{0}\" de valeur \"{1}\" doit avoir une valeur issue de la liste \"{2}\". - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = La valeur \"{1}\" de l''attribut \"{0}\" ne doit pas \u00EAtre modifi\u00E9e par normalisation (et devenir \"{2}\") dans un document autonome. - MSG_CONTENT_INCOMPLETE = Le contenu du type d''\u00E9l\u00E9ment \"{0}\" est incomplet. Il doit correspondre \u00E0 \"{1}\". - MSG_CONTENT_INVALID = Le contenu du type d''\u00E9l\u00E9ment \"{0}\" doit correspondre \u00E0 \"{1}\". - MSG_CONTENT_INVALID_SPECIFIED = Le contenu du type d''\u00E9l\u00E9ment \"{0}\" doit correspondre \u00E0 \"{1}\". Les enfants de type \"{2}\" ne sont pas autoris\u00E9s. - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attribut \"{1}\" du type d''\u00E9l\u00E9ment \"{0}\" a une valeur par d\u00E9faut et doit \u00EAtre sp\u00E9cifi\u00E9 dans un document autonome. - MSG_DUPLICATE_ATTDEF = L''attribut \"{1}\" est d\u00E9j\u00E0 d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = Le type d''\u00E9l\u00E9ment \"{0}\" ne doit pas \u00EAtre d\u00E9clar\u00E9 plusieurs fois. - MSG_ELEMENT_NOT_DECLARED = Le type d''\u00E9l\u00E9ment \"{0}\" doit \u00EAtre d\u00E9clar\u00E9. + DuplicateTypeInMixedContent = Le type d''\u00E9l\u00E9ment "{1}" a d\u00E9j\u00E0 \u00E9t\u00E9 sp\u00E9cifi\u00E9 dans le mod\u00E8le de contenu de la d\u00E9claration d''\u00E9l\u00E9ment "{0}". + ENTITIESInvalid = La valeur d''attribut "{1}" de type ENTITIES doit correspondre au nom d''au moins une entit\u00E9 non analys\u00E9e. + ENTITYInvalid = La valeur d''attribut "{1}" de type ENTITY doit correspondre au nom d''une entit\u00E9 non analys\u00E9e. + IDDefaultTypeInvalid = L''attribut d''ID "{0}" doit avoir une valeur par d\u00E9faut d\u00E9clar\u00E9e de "#IMPLIED" ou "#REQUIRED". + IDInvalid = La valeur d''attribut "{0}" de type ID doit \u00EAtre un nom. + IDInvalidWithNamespaces = La valeur d''attribut "{0}" de type ID doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s. + IDNotUnique = La valeur d''attribut "{0}" de type ID doit \u00EAtre unique dans le document. + IDREFInvalid = La valeur d''attribut "{0}" de type IDREF doit \u00EAtre un nom. + IDREFInvalidWithNamespaces = La valeur d''attribut "{0}" de type IDREF doit \u00EAtre un NCName lorsque les espaces de noms sont activ\u00E9s. + IDREFSInvalid = Une valeur d''attribut "{0}" de type IDREFS doit correspondre \u00E0 au moins un nom. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es lorsque la r\u00E9f\u00E9rence d''entit\u00E9 est utilis\u00E9e comme d\u00E9claration compl\u00E8te. + ImproperDeclarationNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des d\u00E9clarations correctement imbriqu\u00E9es. + ImproperGroupNesting = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure des paires de parenth\u00E8ses correctement imbriqu\u00E9es. + INVALID_PE_IN_CONDITIONAL = Le texte de remplacement de l''entit\u00E9 de param\u00E8tre "{0}" doit inclure la section conditionnelle compl\u00E8te ou seulement INCLUDE ou IGNORE. + MSG_ATTRIBUTE_NOT_DECLARED = L''attribut "{1}" doit \u00EAtre d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment "{0}". + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attribut "{0}" de valeur "{1}" doit avoir une valeur issue de la liste "{2}". + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = La valeur "{1}" de l''attribut "{0}" ne doit pas \u00EAtre modifi\u00E9e par normalisation (et devenir "{2}") dans un document autonome. + MSG_CONTENT_INCOMPLETE = Le contenu du type d''\u00E9l\u00E9ment "{0}" est incomplet. Il doit correspondre \u00E0 "{1}". + MSG_CONTENT_INVALID = Le contenu du type d''\u00E9l\u00E9ment "{0}" doit correspondre \u00E0 "{1}". + MSG_CONTENT_INVALID_SPECIFIED = Le contenu du type d''\u00E9l\u00E9ment "{0}" doit correspondre \u00E0 "{1}". Les enfants de type "{2}" ne sont pas autoris\u00E9s. + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attribut "{1}" du type d''\u00E9l\u00E9ment "{0}" a une valeur par d\u00E9faut et doit \u00EAtre sp\u00E9cifi\u00E9 dans un document autonome. + MSG_DUPLICATE_ATTDEF = L''attribut "{1}" est d\u00E9j\u00E0 d\u00E9clar\u00E9 pour le type d''\u00E9l\u00E9ment "{0}". + MSG_ELEMENT_ALREADY_DECLARED = Le type d''\u00E9l\u00E9ment "{0}" ne doit pas \u00EAtre d\u00E9clar\u00E9 plusieurs fois. + MSG_ELEMENT_NOT_DECLARED = Le type d''\u00E9l\u00E9ment "{0}" doit \u00EAtre d\u00E9clar\u00E9. MSG_GRAMMAR_NOT_FOUND = Le document n'est pas valide : aucune grammaire d\u00E9tect\u00E9e. - MSG_ELEMENT_WITH_ID_REQUIRED = Un \u00E9l\u00E9ment avec l''identificateur \"{0}\" doit figurer dans le document. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 externe \"{0}\" n''est pas autoris\u00E9e dans le document autonome. - MSG_FIXED_ATTVALUE_INVALID = L''attribut \"{1}\" de valeur \"{2}\" doit avoir une valeur de \"{3}\". - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Le type d''\u00E9l\u00E9ment \"{0}\" a d\u00E9j\u00E0 l''attribut \"{1}\" de type ID. Un deuxi\u00E8me attribut \"{2}\" de type ID n''est pas autoris\u00E9. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Le type d''\u00E9l\u00E9ment \"{0}\" a d\u00E9j\u00E0 l''attribut \"{1}\" de type NOTATION. Un deuxi\u00E8me attribut \"{2}\" de type NOTATION n''est pas autoris\u00E9. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notation \"{1}\" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la liste des types de notation de l''attribut \"{0}\". - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notation \"{1}\" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la d\u00E9claration d''entit\u00E9 non analys\u00E9e pour \"{0}\". - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 \"{0}\" d\u00E9clar\u00E9e dans une entit\u00E9 analys\u00E9e externe n''est pas autoris\u00E9e dans un document autonome. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attribut \"{1}\" est obligatoire et doit \u00EAtre sp\u00E9cifi\u00E9 pour le type d''\u00E9l\u00E9ment \"{0}\". + MSG_ELEMENT_WITH_ID_REQUIRED = Un \u00E9l\u00E9ment avec l''identificateur "{0}" doit figurer dans le document. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 externe "{0}" n''est pas autoris\u00E9e dans le document autonome. + MSG_FIXED_ATTVALUE_INVALID = L''attribut "{1}" de valeur "{2}" doit avoir une valeur de "{3}". + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Le type d''\u00E9l\u00E9ment "{0}" a d\u00E9j\u00E0 l''attribut "{1}" de type ID. Un deuxi\u00E8me attribut "{2}" de type ID n''est pas autoris\u00E9. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Le type d''\u00E9l\u00E9ment "{0}" a d\u00E9j\u00E0 l''attribut "{1}" de type NOTATION. Un deuxi\u00E8me attribut "{2}" de type NOTATION n''est pas autoris\u00E9. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notation "{1}" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la liste des types de notation de l''attribut "{0}". + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notation "{1}" doit \u00EAtre d\u00E9clar\u00E9e lorsqu''elle est r\u00E9f\u00E9renc\u00E9e dans la d\u00E9claration d''entit\u00E9 non analys\u00E9e pour "{0}". + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = La r\u00E9f\u00E9rence \u00E0 l''entit\u00E9 "{0}" d\u00E9clar\u00E9e dans une entit\u00E9 analys\u00E9e externe n''est pas autoris\u00E9e dans un document autonome. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attribut "{1}" est obligatoire et doit \u00EAtre sp\u00E9cifi\u00E9 pour le type d''\u00E9l\u00E9ment "{0}". MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Aucun espace ne doit figurer entre les \u00E9l\u00E9ments d\u00E9clar\u00E9s dans une entit\u00E9 analys\u00E9e externe avec le contenu des \u00E9l\u00E9ments dans un document autonome. - NMTOKENInvalid = La valeur d''attribut \"{0}\" de type NMTOKEN doit correspondre \u00E0 un jeton de nom. - NMTOKENSInvalid = La valeur d''attribut \"{0}\" de type NMTOKENS doit correspondre \u00E0 au moins un jeton de nom. - NoNotationOnEmptyElement = Le type d''\u00E9l\u00E9ment \"{0}\" d\u00E9clar\u00E9 EMPTY ne peut pas d\u00E9clarer un attribut \"{1}\" de type NOTATION. - RootElementTypeMustMatchDoctypedecl = L''\u00E9l\u00E9ment racine de document \"{1}\" doit correspondre \u00E0 la racine DOCTYPE \"{0}\". - UndeclaredElementInContentSpec = Le mod\u00E8le de contenu de l''\u00E9l\u00E9ment \"{0}\" fait r\u00E9f\u00E9rence \u00E0 l''\u00E9l\u00E9ment non d\u00E9clar\u00E9 \"{1}\". - UniqueNotationName = La d\u00E9claration de la notation \"{0}\" n''est pas unique. Une valeur Name donn\u00E9e ne doit pas \u00EAtre d\u00E9clar\u00E9e dans plusieurs d\u00E9clarations de notation. - ENTITYFailedInitializeGrammar = Contr\u00F4le de validation ENTITYDatatype : \u00E9chec. Besoin d'appeler une m\u00E9thode d'initialisation avec une r\u00E9f\u00E9rence de grammaire valide. \t - ENTITYNotUnparsed = La valeur ENTITY \"{0}\" est analys\u00E9e. - ENTITYNotValid = La valeur ENTITY \"{0}\" n''est pas valide. + NMTOKENInvalid = La valeur d''attribut "{0}" de type NMTOKEN doit correspondre \u00E0 un jeton de nom. + NMTOKENSInvalid = La valeur d''attribut "{0}" de type NMTOKENS doit correspondre \u00E0 au moins un jeton de nom. + NoNotationOnEmptyElement = Le type d''\u00E9l\u00E9ment "{0}" d\u00E9clar\u00E9 EMPTY ne peut pas d\u00E9clarer un attribut "{1}" de type NOTATION. + RootElementTypeMustMatchDoctypedecl = L''\u00E9l\u00E9ment racine de document "{1}" doit correspondre \u00E0 la racine DOCTYPE "{0}". + UndeclaredElementInContentSpec = Le mod\u00E8le de contenu de l''\u00E9l\u00E9ment "{0}" fait r\u00E9f\u00E9rence \u00E0 l''\u00E9l\u00E9ment non d\u00E9clar\u00E9 "{1}". + UniqueNotationName = La d\u00E9claration de la notation "{0}" n''est pas unique. Une valeur Name donn\u00E9e ne doit pas \u00EAtre d\u00E9clar\u00E9e dans plusieurs d\u00E9clarations de notation. + ENTITYFailedInitializeGrammar = Valideur ENTITYDatatype : \u00E9chec. Besoin d'appeler une m\u00E9thode d'initialisation avec une r\u00E9f\u00E9rence de grammaire valide. \t + ENTITYNotUnparsed = La valeur ENTITY "{0}" est analys\u00E9e. + ENTITYNotValid = La valeur ENTITY "{0}" n''est pas valide. EmptyList = Une valeur de type ENTITIES, IDREFS et NMTOKENS ne peut pas correspondre \u00E0 une liste vide. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = La r\u00E9f\u00E9rence d''entit\u00E9 externe \"&{0};\" n''est pas autoris\u00E9e dans une valeur d''attribut. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = La r\u00E9f\u00E9rence d''entit\u00E9 externe "&{0};" n''est pas autoris\u00E9e dans une valeur d''attribut. + AccessExternalDTD = DTD externe : \u00E9chec de la lecture de la DTD externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. + AccessExternalEntity = Entit\u00E9 externe : \u00E9chec de la lecture du document externe ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. # 4.1 Character and Entity References - EntityNotDeclared = L''entit\u00E9 \"{0}\" \u00E9tait r\u00E9f\u00E9renc\u00E9e, mais pas d\u00E9clar\u00E9e. - ReferenceToUnparsedEntity = La r\u00E9f\u00E9rence d''entit\u00E9 non analys\u00E9e \"&{0};\" n''est pas autoris\u00E9e. - RecursiveReference = R\u00E9f\u00E9rence d''entit\u00E9 r\u00E9cursive \"{0}\". (Chemin de r\u00E9f\u00E9rence : {1}), - RecursiveGeneralReference = R\u00E9f\u00E9rence d''entit\u00E9 g\u00E9n\u00E9rale r\u00E9cursive \"&{0};\". (Chemin de r\u00E9f\u00E9rence : {1}), - RecursivePEReference = R\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre r\u00E9cursive \"%{0};\". (Chemin de r\u00E9f\u00E9rence : {1}), + EntityNotDeclared = L''entit\u00E9 "{0}" \u00E9tait r\u00E9f\u00E9renc\u00E9e, mais pas d\u00E9clar\u00E9e. + ReferenceToUnparsedEntity = La r\u00E9f\u00E9rence d''entit\u00E9 non analys\u00E9e "&{0};" n''est pas autoris\u00E9e. + RecursiveReference = R\u00E9f\u00E9rence d''entit\u00E9 r\u00E9cursive "{0}". (Chemin de r\u00E9f\u00E9rence : {1}), + RecursiveGeneralReference = R\u00E9f\u00E9rence d''entit\u00E9 g\u00E9n\u00E9rale r\u00E9cursive "&{0};". (Chemin de r\u00E9f\u00E9rence : {1}), + RecursivePEReference = R\u00E9f\u00E9rence d''entit\u00E9 de param\u00E8tre r\u00E9cursive "%{0};". (Chemin de r\u00E9f\u00E9rence : {1}), # 4.3.3 Character Encoding in Entities - EncodingNotSupported = L''encodage \"{0}\" n''est pas pris en charge. + EncodingNotSupported = L''encodage "{0}" n''est pas pris en charge. EncodingRequired = Une entit\u00E9 analys\u00E9e sans encodage UTF-8 ou UTF-16 doit contenir une d\u00E9claration d'encodage. # Namespaces support # 4. Using Qualified Names IllegalQName = L'\u00E9l\u00E9ment ou l'attribut ne correspond pas \u00E0 la production QName : QName::=(NCName':')?NCName. - ElementXMLNSPrefix = L''\u00E9l\u00E9ment \"{0}\" ne peut pas avoir \"xmlns\" comme pr\u00E9fixe. - ElementPrefixUnbound = Le pr\u00E9fixe \"{0}\" de l''\u00E9l\u00E9ment \"{1}\" n''est pas li\u00E9. - AttributePrefixUnbound = Le pr\u00E9fixe \"{2}\" de l''attribut \"{1}\" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment \"{0}\" n''est pas li\u00E9. - EmptyPrefixedAttName = La valeur de l''attribut \"{0}\" n''est pas valide. Les liaisons d''espaces de noms pr\u00E9fix\u00E9s ne peuvent pas \u00EAtre vides. - PrefixDeclared = Le pr\u00E9fixe d''espace de noms \"{0}\" n''\u00E9tait pas d\u00E9clar\u00E9. + ElementXMLNSPrefix = L''\u00E9l\u00E9ment "{0}" ne peut pas avoir "xmlns" comme pr\u00E9fixe. + ElementPrefixUnbound = Le pr\u00E9fixe "{0}" de l''\u00E9l\u00E9ment "{1}" n''est pas li\u00E9. + AttributePrefixUnbound = Le pr\u00E9fixe "{2}" de l''attribut "{1}" associ\u00E9 \u00E0 un type d''\u00E9l\u00E9ment "{0}" n''est pas li\u00E9. + EmptyPrefixedAttName = La valeur de l''attribut "{0}" n''est pas valide. Les liaisons d''espaces de noms pr\u00E9fix\u00E9s ne peuvent pas \u00EAtre vides. + PrefixDeclared = Le pr\u00E9fixe d''espace de noms "{0}" n''\u00E9tait pas d\u00E9clar\u00E9. CantBindXMLNS = Le pr\u00E9fixe "xmlns" ne peut pas \u00EAtre li\u00E9 \u00E0 un espace de noms de fa\u00E7on explicite, pas plus que l'espace de noms de "xmlns" \u00E0 un pr\u00E9fixe quelconque. CantBindXML = Le pr\u00E9fixe "xml" ne peut pas \u00EAtre li\u00E9 \u00E0 un autre espace de noms que son espace de noms habituel. L'espace de noms de "xml" ne peut pas non plus \u00EAtre li\u00E9 \u00E0 un autre pr\u00E9fixe que "xml". - MSG_ATT_DEFAULT_INVALID = La valeur par d\u00E9faut \"{1}\" de l''attribut \"{0}\" n''est pas admise conform\u00E9ment aux contraintes lexicales de ce type d''attribut. + MSG_ATT_DEFAULT_INVALID = La valeur par d\u00E9faut "{1}" de l''attribut "{0}" n''est pas admise conform\u00E9ment aux contraintes lexicales de ce type d''attribut. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=L''analyseur a rencontr\u00E9 plus de \"{0}\" d\u00E9veloppements d''entit\u00E9 dans ce document. Il s''agit de la limite impos\u00E9e par l''application. +EntityExpansionLimitExceeded=L''analyseur a rencontr\u00E9 plus de "{0}" d\u00E9veloppements d''entit\u00E9 dans ce document. Il s''agit de la limite impos\u00E9e par l''application. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= L''\u00E9l\u00E9ment \"{0}\" a plus de \"{1}\" attributs. \"{1}\" est la limite impos\u00E9e par l''application. +ElementAttributeLimit= L''\u00E9l\u00E9ment "{0}" a plus de "{1}" attributs. "{1}" est la limite impos\u00E9e par l''application. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties index e525777850b..5222b2e51f3 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel prologo del documento. InvalidCharInXMLDecl = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella dichiarazione XML. # 2.4 Character Data and Markup - CDEndInContent = La sequenza di caratteri \"]]>\" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA. + CDEndInContent = La sequenza di caratteri "]]>" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA. # 2.7 CDATA Sections - CDSectUnterminated = La sezione CDATA deve terminare con \"]]>\". + CDSectUnterminated = La sezione CDATA deve terminare con "]]>". # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = La dichiarazione XML pu\u00F2 comparire solo all'inizio del documento. - EqRequiredInXMLDecl = Il carattere '' = '' deve seguire \"{0}\" nella dichiarazione XML. - QuoteRequiredInXMLDecl = Il valore che segue \"{0}\" nella dichiarazione XML deve essere una stringa compresa tra apici. - XMLDeclUnterminated = La dichiarazione XML deve terminare con \"?>\". + EqRequiredInXMLDecl = Il carattere '' = '' deve seguire "{0}" nella dichiarazione XML. + QuoteRequiredInXMLDecl = Il valore che segue "{0}" nella dichiarazione XML deve essere una stringa compresa tra apici. + XMLDeclUnterminated = La dichiarazione XML deve terminare con "?>". VersionInfoRequired = La versione \u00E8 obbligatoria nella dichiarazione XML. SpaceRequiredBeforeVersionInXMLDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo della versione nella dichiarazione XML. SpaceRequiredBeforeEncodingInXMLDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo di codifica nella dichiarazione XML. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=Il riferimento non \u00E8 consentito nella sezione finale. # 2.9 Standalone Document Declaration - SDDeclInvalid = Il valore della dichiarazione del documento standalone deve essere \"yes\" o \"no\", non \"{0}\". + SDDeclInvalid = Il valore della dichiarazione del documento standalone deve essere "yes" o "no", non "{0}". # 2.12 Language Identification - XMLLangInvalid = Il valore dell''attributo xml:lang \"{0}\" \u00E8 un identificativo di lingua non valido. + XMLLangInvalid = Il valore dell''attributo xml:lang "{0}" \u00E8 un identificativo di lingua non valido. # 3. Logical Structures - ETagRequired = Il tipo di elemento \"{0}\" deve terminare con la corrispondente tag finale \"\". + ETagRequired = Il tipo di elemento "{0}" deve terminare con la corrispondente tag finale "". # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = Il tipo di elemento \"{0}\" deve essere seguito dalle specifiche di attributo \">\" o \"/>\". - EqRequiredInAttribute = Il nome attributo \"{1}\" associato a un tipo di elemento \"{0}\" deve essere seguito dal carattere '' = ''. - OpenQuoteExpected = \u00C8 previsto un apice di apertura per l''attributo \"{1}\" associato a un tipo di elemento \"{0}\". - CloseQuoteExpected = \u00C8 previsto un apice di chiusura per l''attributo \"{1}\" associato a un tipo di elemento \"{0}\". - AttributeNotUnique = L''attributo \"{1}\" \u00E8 gi\u00E0 stato specificato per l''elemento \"{0}\". - AttributeNSNotUnique = L''attributo \"{1}\" associato allo spazio di nomi \"{2}\" \u00E8 gi\u00E0 stato specificato per l''elemento \"{0}\". - ETagUnterminated = La tag finale per il tipo di elemento \"{0}\" deve terminare con un delimitatore ''>''. + ElementUnterminated = Il tipo di elemento "{0}" deve essere seguito dalle specifiche di attributo ">" o "/>". + EqRequiredInAttribute = Il nome attributo "{1}" associato a un tipo di elemento "{0}" deve essere seguito dal carattere '' = ''. + OpenQuoteExpected = \u00C8 previsto un apice di apertura per l''attributo "{1}" associato a un tipo di elemento "{0}". + CloseQuoteExpected = \u00C8 previsto un apice di chiusura per l''attributo "{1}" associato a un tipo di elemento "{0}". + AttributeNotUnique = L''attributo "{1}" \u00E8 gi\u00E0 stato specificato per l''elemento "{0}". + AttributeNSNotUnique = L''attributo "{1}" associato allo spazio di nomi "{2}" \u00E8 gi\u00E0 stato specificato per l''elemento "{0}". + ETagUnterminated = La tag finale per il tipo di elemento "{0}" deve terminare con un delimitatore ''>''. MarkupNotRecognizedInContent = Il contenuto degli elementi deve essere composto da dati o markup di caratteri con formato corretto. DoctypeIllegalInContent = DOCTYPE non \u00E8 consentito nel contenuto. # 4.1 Character and Entity References ReferenceUnterminated = Il riferimento deve terminare con un delimitatore ';'. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = Il riferimento deve essere compreso completamente all'interno della stessa entit\u00E0 analizzata. - ElementEntityMismatch = L''elemento \"{0}\" deve iniziare e finire con la stessa entit\u00E0. + ElementEntityMismatch = L''elemento "{0}" deve iniziare e finire con la stessa entit\u00E0. MarkupEntityMismatch=Le strutture di documenti XML devono iniziare e finire con la stessa entit\u00E0. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{2}) nel valore dell''attributo \"{1}\". L''elemento \u00E8 \"{0}\". + InvalidCharInAttValue = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{2}) nel valore dell''attributo "{1}". L''elemento \u00E8 "{0}". InvalidCharInComment = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel commento. InvalidCharInPI = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nell''istruzione di elaborazione. InvalidCharInInternalSubset = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nel set secondario interno del DTD. InvalidCharInTextDecl = \u00C8 stato trovato un carattere XML non valido (Unicode: 0x{0}) nella dichiarazione testuale. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = Il valore dell''attributo \"{1}\" deve iniziare con un apice o una virgoletta. - LessthanInAttValue = Il valore dell''attributo \"{1}\" associato a un tipo di elemento \"{0}\" non deve essere contenere il carattere ''<''. - AttributeValueUnterminated = Il valore dell''attributo \"{1}\" deve terminare con un apice corrispondente. + QuoteRequiredInAttValue = Il valore dell''attributo "{1}" deve iniziare con un apice o una virgoletta. + LessthanInAttValue = Il valore dell''attributo "{1}" associato a un tipo di elemento "{0}" non deve essere contenere il carattere ''<''. + AttributeValueUnterminated = Il valore dell''attributo "{1}" deve terminare con un apice corrispondente. # 2.5 Comments - InvalidCommentStart = Il commento deve iniziare con \"\". + InvalidCommentStart = Il commento deve iniziare con "". COMMENT_NOT_IN_ONE_ENTITY = Il commento non \u00E8 compreso all'interno della stessa entit\u00E0. # 2.6 Processing Instructions PITargetRequired = L'istruzione di elaborazione deve iniziare con il nome della destinazione. SpaceRequiredInPI = \u00C8 richiesto uno spazio tra la destinazione delle istruzioni di elaborazione e i dati. - PIUnterminated = L'istruzione di elaborazione deve terminare con \"?>\". - ReservedPITarget = Non \u00E8 consentita una destinazione di istruzione di elaborazione corrispondente a \"[xX][mM][lL]\". + PIUnterminated = L'istruzione di elaborazione deve terminare con "?>". + ReservedPITarget = Non \u00E8 consentita una destinazione di istruzione di elaborazione corrispondente a "[xX][mM][lL]". PI_NOT_IN_ONE_ENTITY = L'istruzione di elaborazione non \u00E8 compresa all'interno della stessa entit\u00E0. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Versione \"{0}\" non valida. - VersionNotSupported = La versione XML \"{0}\" non \u00E8 supportata. Solo la versione XML 1.0 \u00E8 supportata. - VersionNotSupported11 = La versione XML \"{0}\" non \u00E8 supportata. Solo le versioni XML 1.0 e XML 1.1 sono supportate. + VersionInfoInvalid = Versione "{0}" non valida. + VersionNotSupported = La versione XML "{0}" non \u00E8 supportata. Solo la versione XML 1.0 \u00E8 supportata. + VersionNotSupported11 = La versione XML "{0}" non \u00E8 supportata. Solo le versioni XML 1.0 e XML 1.1 sono supportate. VersionMismatch= Un'entit\u00E0 non pu\u00F2 includerne un'altra con una versione successiva. # 4.1 Character and Entity References - DigitRequiredInCharRef = Una rappresentazione decimale deve seguire immediatamente \"&#\" in un riferimento di carattere. - HexdigitRequiredInCharRef = Una rappresentazione esadecimale deve seguire immediatamente \"&#\" in un riferimento di carattere. + DigitRequiredInCharRef = Una rappresentazione decimale deve seguire immediatamente "&#" in un riferimento di carattere. + HexdigitRequiredInCharRef = Una rappresentazione esadecimale deve seguire immediatamente "&#" in un riferimento di carattere. SemicolonRequiredInCharRef = Il riferimento di carattere deve terminare con il delimitatore ';'. - InvalidCharRef = Il riferimento di carattere \"&#{0}\" \u00E8 un carattere XML non valido. + InvalidCharRef = Il riferimento di carattere "&#{0}" \u00E8 un carattere XML non valido. NameRequiredInReference = Il nome entit\u00E0 deve seguire immediatamente '&' nel riferimento di entit\u00E0. - SemicolonRequiredInReference = Il riferimento di entit\u00E0 \"{0}\" deve terminare con il delimitatore '';''. + SemicolonRequiredInReference = Il riferimento di entit\u00E0 "{0}" deve terminare con il delimitatore '';''. # 4.3.1 The Text Declaration TextDeclMustBeFirst = La dichiarazione di testo pu\u00F2 comparire solo all'inizio dell'entit\u00E0 esterna analizzata. - EqRequiredInTextDecl = Il carattere '' = '' deve seguire \"{0}\" nella dichiarazione di testo. - QuoteRequiredInTextDecl = Il valore che segue \"{0}\" nella dichiarazione di testo deve essere una stringa compresa tra apici. - CloseQuoteMissingInTextDecl = manca l''apice di chiusura nel valore che segue \"{0}\" nella dichiarazione di testo. + EqRequiredInTextDecl = Il carattere '' = '' deve seguire "{0}" nella dichiarazione di testo. + QuoteRequiredInTextDecl = Il valore che segue "{0}" nella dichiarazione di testo deve essere una stringa compresa tra apici. + CloseQuoteMissingInTextDecl = manca l''apice di chiusura nel valore che segue "{0}" nella dichiarazione di testo. SpaceRequiredBeforeVersionInTextDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo della versione nella dichiarazione del testo. SpaceRequiredBeforeEncodingInTextDecl = \u00C8 richiesto uno spazio prima dell'attributo pseudo di codifica nella dichiarazione del testo. - TextDeclUnterminated = La dichiarazione di testo deve terminare con \"?>\". + TextDeclUnterminated = La dichiarazione di testo deve terminare con "?>". EncodingDeclRequired = La dichiarazione di codifica \u00E8 obbligatoria nella dichiarazione di testo. NoMorePseudoAttributes = Non sono consentiti altri attributi pseudo. MorePseudoAttributes = Sono previsti altri attributi pseudo. @@ -143,13 +140,13 @@ CommentNotInOneEntity = Il commento deve essere compreso completamente all'interno della stessa entit\u00E0 analizzata. PINotInOneEntity = L'istruzione di elaborazione deve essere compresa completamente all'interno della stessa entit\u00E0 analizzata. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Nome codifica \"{0}\" non valido. - EncodingByteOrderUnsupported = L''ordine di byte specificato per la codifica \"{0}\" non \u00E8 supportato. + EncodingDeclInvalid = Nome codifica "{0}" non valido. + EncodingByteOrderUnsupported = L''ordine di byte specificato per la codifica "{0}" non \u00E8 supportato. InvalidByte = Byte non valido {0} della sequenza UTF-8 a {1} byte. ExpectedByte = \u00C8 previsto il byte {0} della sequenza UTF-8 a {1} byte. InvalidHighSurrogate = I bit per surrogato alto nella sequenza UTF-8 non devono superare 0x10, ma \u00E8 stato trovato 0x{0}. - OperationNotSupported = Operazione \"{0}\" non supportata dal processo di lettura {1}. - InvalidASCII = Il byte \"{0}\" non fa parte del set di caratteri ASCII (a 7 bit). + OperationNotSupported = Operazione "{0}" non supportata dal processo di lettura {1}. + InvalidASCII = Il byte "{0}" non fa parte del set di caratteri ASCII (a 7 bit). CharConversionFailure = Un'entit\u00E0 che deve trovarsi in una determinata codifica non pu\u00F2 contenere sequenze non valide in quella codifica. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = Il carattere (Unicode: 0x{0}) non \u00E8 consentito nell''identificativo pubblico. SpaceRequiredBetweenPublicAndSystem = Sono richiesti spazi tra publicId e systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u00C8 richiesto uno spazio dopo \"''. - PEReferenceWithinMarkup = Il riferimento di entit\u00E0 di parametro \"%{0};\" non pu\u00F2 essere presente nel markup del set secondario interno del DTD. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u00C8 richiesto uno spazio dopo "''. + PEReferenceWithinMarkup = Il riferimento di entit\u00E0 di parametro "%{0};" non pu\u00F2 essere presente nel markup del set secondario interno del DTD. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Le dichiarazioni di markup contenute o indicate dalla dichiarazione del tipo di documento devono avere un formato corretto. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = La dichiarazione di attributo \"xml:space\" deve essere specificata come tipo enumerato, i cui unici possibili valori sono \"default\" e \"preserve\". + MSG_XML_SPACE_DECLARATION_ILLEGAL = La dichiarazione di attributo "xml:space" deve essere specificata come tipo enumerato, i cui unici possibili valori sono "default" e "preserve". # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u00C8 richiesto uno spazio dopo \"''. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u00C8 richiesto uno spazio dopo il tipo di elemento "{0}" nella dichiarazione del tipo di elemento. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u00C8 richiesto uno vincolo dopo il tipo di elemento "{0}" nella dichiarazione del tipo di elemento. + ElementDeclUnterminated = La dichiarazione per il tipo di elemento "{0}" deve terminare con ''>''. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un carattere ''('' o un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento \"{0}\". + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Un carattere ''('' o un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}". # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento \"{0}\". - MixedContentUnterminated = Il modello di contenuto misto \"{0}\" deve terminare con \")*\" se i tipi di elementi figlio hanno vincoli. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = Un tipo di elemento \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Un carattere '')'' \u00E8 obbligatorio nella dichiarazione del tipo di elemento "{0}". + MixedContentUnterminated = Il modello di contenuto misto "{0}" deve terminare con ")*" se i tipi di elementi figlio hanno vincoli. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u00C8 richiesto uno spazio dopo \"\". - IgnoreSectUnterminated = La sezione condizionale esclusa deve terminare con \"]]>\". + IncludeSectUnterminated = La sezione condizionale inclusa deve terminare con "]]>". + IgnoreSectUnterminated = La sezione condizionale esclusa deve terminare con "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = Il nome entit\u00E0 deve seguire immediatamente '%' nel riferimento di entit\u00E0 di parametro. - SemicolonRequiredInPEReference = Il riferimento di entit\u00E0 di parametro \"%{0};\" deve terminare con il delimitatore '';''. + SemicolonRequiredInPEReference = Il riferimento di entit\u00E0 di parametro "%{0};" deve terminare con il delimitatore '';''. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u00C8 richiesto uno spazio dopo \"''. - MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E0 \"{0}\" \u00E8 stata dichiarata pi\u00F9 volte. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u00C8 richiesto uno spazio tra il nome entit\u00E0 "{0}" e la definizione nella dichiarazione dell''entit\u00E0: + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u00C8 richiesto uno spazio tra "NDATA" e il nome notazione nella dichiarazione dell''entit\u00E0 "{0}". + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u00C8 richiesto uno spazio prima di "NDATA" nella dichiarazione dell''entit\u00E0 "{0}". + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Il nome notazione \u00E8 obbligatorio dopo "NDATA" nella dichiarazione dell''entit\u00E0 "{0}". + EntityDeclUnterminated = La dichiarazione per l''entit\u00E0 "{0}" deve terminare con ''>''. + MSG_DUPLICATE_ENTITY_DEFINITION = L''entit\u00E0 "{0}" \u00E8 stata dichiarata pi\u00F9 volte. # 4.2.2 External Entities - ExternalIDRequired = La dichiarazione di entit\u00E0 esterna deve iniziare con \"SYSTEM\" o \"PUBLIC\". - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra \"PUBLIC\" e l'identificativo pubblico. + ExternalIDRequired = La dichiarazione di entit\u00E0 esterna deve iniziare con "SYSTEM" o "PUBLIC". + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra "PUBLIC" e l'identificativo pubblico. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra l'identificativo pubblico e quello di sistema. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra \"SYSTEM\" e l'identificativo di sistema. - MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificativo di frammento non deve essere specificato nell''identificativo di sistema \"{0}\". + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u00C8 richiesto uno spazio tra "SYSTEM" e l'identificativo di sistema. + MSG_URI_FRAGMENT_IN_SYSTEMID = L''identificativo di frammento non deve essere specificato nell''identificativo di sistema "{0}". # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u00C8 richiesto uno spazio dopo \"''. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u00C8 richiesto uno spazio dopo il nome notazione "{0}" nella dichiarazione della notazione. + ExternalIDorPublicIDRequired = La dichiarazione per la notazione "{0}" deve includere un identificativo di sistema o pubblico. + NotationDeclUnterminated = La dichiarazione per la notazione "{0}" deve terminare con ''>''. # Validation messages - DuplicateTypeInMixedContent = Il tipo di elemento \"{1}\" \u00E8 gi\u00E0 stato specificato nel modello di contenuto della dichiarazione di elemento \"{0}\". - ENTITIESInvalid = Il valore di attributo \"{1}\" di tipo ENTITIES deve corrispondere ai nomi di una o pi\u00F9 entit\u00E0 non analizzate. - ENTITYInvalid = Il valore di attributo \"{1}\" di tipo ENTITY deve corrispondere al nome di un''entit\u00E0 non analizzata. - IDDefaultTypeInvalid = Nell''attributo ID \"{0}\" deve essere dichiarato un valore predefinito \"#IMPLIED\" o \"#REQUIRED\". - IDInvalid = Il valore di attributo \"{0}\" di tipo ID deve essere un nome. - IDInvalidWithNamespaces = Il valore di attributo \"{0}\" di tipo ID deve essere un NCName se sono abilitati gli spazi di nomi. - IDNotUnique = Il valore di attributo \"{0}\" di tipo ID deve essere univoco all''interno del documento. - IDREFInvalid = Il valore di attributo \"{0}\" di tipo IDREF deve essere un nome. - IDREFInvalidWithNamespaces = Il valore di attributo \"{0}\" di tipo IDREF deve essere un NCName se sono abilitati gli spazi di nomi. - IDREFSInvalid = Il valore di attributo \"{0}\" di tipo IDREFS deve corrispondere a uno o pi\u00F9 nomi. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Il testo di sostituzione dell''entit\u00E0 di parametro \"{0}\" deve includere dichiarazioni nidificate correttamente se il riferimento dell''entit\u00E0 \u00E8 utilizzato come dichiarazione completa. - ImproperDeclarationNesting = Il testo di sostituzione dell''entit\u00E0 di parametro \"{0}\" deve includere dichiarazioni nidificate correttamente. - ImproperGroupNesting = Il testo di sostituzione dell''entit\u00E0 di parametro \"{0}\" deve includere coppie di parentesi nidificate correttamente. - INVALID_PE_IN_CONDITIONAL = Il testo di sostituzione dell''entit\u00E0 di parametro \"{0}\" deve includere tutta la sezione condizionale oppure solo INCLUDE o IGNORE. - MSG_ATTRIBUTE_NOT_DECLARED = Dichiarare l''attributo \"{1}\" per il tipo di elemento \"{0}\". - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attributo \"{0}\" con valore \"{1}\" deve avere un valore della lista \"{2}\". - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Il valore \"{1}\" dell''attributo \"{0}\" non deve essere modificato dalla normalizzazione (in \"{2}\") in un documento standalone. - MSG_CONTENT_INCOMPLETE = Il contenuto del tipo di elemento \"{0}\" \u00E8 incompleto. Deve corrispondere a \"{1}\". - MSG_CONTENT_INVALID = Il contenuto del tipo di elemento \"{0}\" deve corrispondere a \"{1}\". - MSG_CONTENT_INVALID_SPECIFIED = Il contenuto del tipo di elemento \"{0}\" deve corrispondere a \"{1}\". Non sono consentiti elementi figlio di tipo \"{2}\". - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attributo \"{1}\" per il tipo di elemento \"{0}\" ha un valore predefinito e deve essere specificato in un documento standalone. - MSG_DUPLICATE_ATTDEF = L''attributo \"{1}\" \u00E8 gi\u00E0 stato dichiarato per il tipo di elemento \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = Il tipo di elemento \"{0}\" non deve essere dichiarato pi\u00F9 volte. - MSG_ELEMENT_NOT_DECLARED = Il tipo di elemento \"{0}\" deve essere dichiarato. + DuplicateTypeInMixedContent = Il tipo di elemento "{1}" \u00E8 gi\u00E0 stato specificato nel modello di contenuto della dichiarazione di elemento "{0}". + ENTITIESInvalid = Il valore di attributo "{1}" di tipo ENTITIES deve corrispondere ai nomi di una o pi\u00F9 entit\u00E0 non analizzate. + ENTITYInvalid = Il valore di attributo "{1}" di tipo ENTITY deve corrispondere al nome di un''entit\u00E0 non analizzata. + IDDefaultTypeInvalid = Nell''attributo ID "{0}" deve essere dichiarato un valore predefinito "#IMPLIED" o "#REQUIRED". + IDInvalid = Il valore di attributo "{0}" di tipo ID deve essere un nome. + IDInvalidWithNamespaces = Il valore di attributo "{0}" di tipo ID deve essere un NCName se sono abilitati gli spazi di nomi. + IDNotUnique = Il valore di attributo "{0}" di tipo ID deve essere univoco all''interno del documento. + IDREFInvalid = Il valore di attributo "{0}" di tipo IDREF deve essere un nome. + IDREFInvalidWithNamespaces = Il valore di attributo "{0}" di tipo IDREF deve essere un NCName se sono abilitati gli spazi di nomi. + IDREFSInvalid = Il valore di attributo "{0}" di tipo IDREFS deve corrispondere a uno o pi\u00F9 nomi. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere dichiarazioni nidificate correttamente se il riferimento dell''entit\u00E0 \u00E8 utilizzato come dichiarazione completa. + ImproperDeclarationNesting = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere dichiarazioni nidificate correttamente. + ImproperGroupNesting = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere coppie di parentesi nidificate correttamente. + INVALID_PE_IN_CONDITIONAL = Il testo di sostituzione dell''entit\u00E0 di parametro "{0}" deve includere tutta la sezione condizionale oppure solo INCLUDE o IGNORE. + MSG_ATTRIBUTE_NOT_DECLARED = Dichiarare l''attributo "{1}" per il tipo di elemento "{0}". + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = L''attributo "{0}" con valore "{1}" deve avere un valore della lista "{2}". + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = Il valore "{1}" dell''attributo "{0}" non deve essere modificato dalla normalizzazione (in "{2}") in un documento standalone. + MSG_CONTENT_INCOMPLETE = Il contenuto del tipo di elemento "{0}" \u00E8 incompleto. Deve corrispondere a "{1}". + MSG_CONTENT_INVALID = Il contenuto del tipo di elemento "{0}" deve corrispondere a "{1}". + MSG_CONTENT_INVALID_SPECIFIED = Il contenuto del tipo di elemento "{0}" deve corrispondere a "{1}". Non sono consentiti elementi figlio di tipo "{2}". + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = L''attributo "{1}" per il tipo di elemento "{0}" ha un valore predefinito e deve essere specificato in un documento standalone. + MSG_DUPLICATE_ATTDEF = L''attributo "{1}" \u00E8 gi\u00E0 stato dichiarato per il tipo di elemento "{0}". + MSG_ELEMENT_ALREADY_DECLARED = Il tipo di elemento "{0}" non deve essere dichiarato pi\u00F9 volte. + MSG_ELEMENT_NOT_DECLARED = Il tipo di elemento "{0}" deve essere dichiarato. MSG_GRAMMAR_NOT_FOUND = Documento non valido: nessuna grammatica trovata. - MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con identificativo \"{0}\" deve esistere nel documento. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Il riferimento all''entit\u00E0 esterna \"{0}\" non \u00E8 consentito in un documento standalone. - MSG_FIXED_ATTVALUE_INVALID = L''attributo \"{1}\" con valore \"{2}\" deve avere un valore \"{3}\". - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Il tipo di elemento \"{0}\" ha gi\u00E0 un attributo \"{1}\" di tipo ID. Non \u00E8 consentito un secondo attributo \"{2}\" di tipo ID. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Il tipo di elemento \"{0}\" ha gi\u00E0 un attributo \"{1}\" di tipo NOTATION. Non \u00E8 consentito un secondo attributo \"{2}\" di tipo NOTATION. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notazione \"{1}\" deve essere dichiarata se vi viene fatto riferimento nella lista dei tipi di notazione per l''attributo \"{0}\". - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notazione \"{1}\" deve essere dichiarata se vi viene fatto riferimento dichiarazione di entit\u00E0 non analizzata per \"{0}\". - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Il riferimento all''entit\u00E0 \"{0}\" dichiarata in un''entit\u00E0 esterna analizzata non \u00E8 consentito in un documento standalone. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attributo \"{1}\" \u00E8 obbligatorio e deve essere specificato per il tipo di elemento \"{0}\". + MSG_ELEMENT_WITH_ID_REQUIRED = Un elemento con identificativo "{0}" deve esistere nel documento. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Il riferimento all''entit\u00E0 esterna "{0}" non \u00E8 consentito in un documento standalone. + MSG_FIXED_ATTVALUE_INVALID = L''attributo "{1}" con valore "{2}" deve avere un valore "{3}". + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Il tipo di elemento "{0}" ha gi\u00E0 un attributo "{1}" di tipo ID. Non \u00E8 consentito un secondo attributo "{2}" di tipo ID. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Il tipo di elemento "{0}" ha gi\u00E0 un attributo "{1}" di tipo NOTATION. Non \u00E8 consentito un secondo attributo "{2}" di tipo NOTATION. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = La notazione "{1}" deve essere dichiarata se vi viene fatto riferimento nella lista dei tipi di notazione per l''attributo "{0}". + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = La notazione "{1}" deve essere dichiarata se vi viene fatto riferimento dichiarazione di entit\u00E0 non analizzata per "{0}". + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Il riferimento all''entit\u00E0 "{0}" dichiarata in un''entit\u00E0 esterna analizzata non \u00E8 consentito in un documento standalone. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = L''attributo "{1}" \u00E8 obbligatorio e deve essere specificato per il tipo di elemento "{0}". MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Non deve esistere nessuno spazio tra gli elementi dichiarati in un'entit\u00E0 esterna analizzata con il contenuto dell'elemento in un documento standalone. - NMTOKENInvalid = Il valore di attributo \"{0}\" di tipo NMTOKEN deve essere un token di nome. - NMTOKENSInvalid = Il valore di attributo \"{0}\" di tipo NMTOKENS deve corrispondere a uno o pi\u00F9 token di nomi. - NoNotationOnEmptyElement = Il tipo di elemento \"{0}\" dichiarato come EMPTY non pu\u00F2 dichiarare l''attributo \"{1}\" di tipo NOTATION. - RootElementTypeMustMatchDoctypedecl = L''elemento radice \"{1}\" del documento deve corrispondere alla radice DOCTYPE \"{0}\". - UndeclaredElementInContentSpec = Il modello di contenuto dell''elemento \"{0}\" fa riferimento a un elemento \"{1}\" non dichiarato. - UniqueNotationName = La dichiarazione per la notazione \"{0}\" non \u00E8 univoca. Un nome non deve essere dichiarato pi\u00F9 volte nella dichiarazione di una notazione. + NMTOKENInvalid = Il valore di attributo "{0}" di tipo NMTOKEN deve essere un token di nome. + NMTOKENSInvalid = Il valore di attributo "{0}" di tipo NMTOKENS deve corrispondere a uno o pi\u00F9 token di nomi. + NoNotationOnEmptyElement = Il tipo di elemento "{0}" dichiarato come EMPTY non pu\u00F2 dichiarare l''attributo "{1}" di tipo NOTATION. + RootElementTypeMustMatchDoctypedecl = L''elemento radice "{1}" del documento deve corrispondere alla radice DOCTYPE "{0}". + UndeclaredElementInContentSpec = Il modello di contenuto dell''elemento "{0}" fa riferimento a un elemento "{1}" non dichiarato. + UniqueNotationName = La dichiarazione per la notazione "{0}" non \u00E8 univoca. Un nome non deve essere dichiarato pi\u00F9 volte nella dichiarazione di una notazione. ENTITYFailedInitializeGrammar = ENTITYDatatype Validator: errore. \u00C8 necessario richiamare il metodo di inizializzazione con un riferimento di grammatica valido. \t - ENTITYNotUnparsed = ENTITY \"{0}\" non analizzata. - ENTITYNotValid = ENTITY \"{0}\" non valida. + ENTITYNotUnparsed = ENTITY "{0}" non analizzata. + ENTITYNotValid = ENTITY "{0}" non valida. EmptyList = I valori di tipo ENTITIES, IDREFS e NMTOKENS non possono essere una lista vuota. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = Il riferimento di entit\u00E0 esterna \"&{0};\" non \u00E8 consentito in un valore di attributo. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = Il riferimento di entit\u00E0 esterna "&{0};" non \u00E8 consentito in un valore di attributo. + AccessExternalDTD = DTD esterna: lettura della DTD esterna ''{0}'' non riuscita. Accesso ''{1}'' non consentito. + AccessExternalEntity = Entit\u00E0 esterna: lettura del documento esterno ''{0}'' non riuscita. Accesso ''{1}'' non consentito. # 4.1 Character and Entity References - EntityNotDeclared = L''entit\u00E0 \"{0}\" \u00E8 indicata da un riferimento, ma non \u00E8 dichiarata. - ReferenceToUnparsedEntity = Il riferimento di entit\u00E0 non analizzata \"&{0};\" non \u00E8 consentito. - RecursiveReference = Riferimento di entit\u00E0 ricorsivo \"{0}\" (percorso riferimento: {1}). - RecursiveGeneralReference = Riferimento di entit\u00E0 generale ricorsivo \"&{0};\" (percorso riferimento: {1}). - RecursivePEReference = Riferimento di entit\u00E0 parametro ricorsivo \"%{0};\" (percorso riferimento: {1}). + EntityNotDeclared = L''entit\u00E0 "{0}" \u00E8 indicata da un riferimento, ma non \u00E8 dichiarata. + ReferenceToUnparsedEntity = Il riferimento di entit\u00E0 non analizzata "&{0};" non \u00E8 consentito. + RecursiveReference = Riferimento di entit\u00E0 ricorsivo "{0}" (percorso riferimento: {1}). + RecursiveGeneralReference = Riferimento di entit\u00E0 generale ricorsivo "&{0};" (percorso riferimento: {1}). + RecursivePEReference = Riferimento di entit\u00E0 parametro ricorsivo "%{0};" (percorso riferimento: {1}). # 4.3.3 Character Encoding in Entities - EncodingNotSupported = La codifica \"{0}\" non \u00E8 supportata. + EncodingNotSupported = La codifica "{0}" non \u00E8 supportata. EncodingRequired = Un'entit\u00E0 analizzata non codificata in UTF-8 o UTF-16 deve contenere una dichiarazione di codifica. # Namespaces support # 4. Using Qualified Names IllegalQName = L'elemento o l'attributo non corrisponde alla produzione del QName: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = L''elemento \"{0}\" non pu\u00F2 avere \"xmlns\" come prefisso. - ElementPrefixUnbound = Il prefisso \"{0}\" per l''elemento \"{1}\" non \u00E8 associato. - AttributePrefixUnbound = Il prefisso \"{2}\" per l''attributo \"{1}\" associato a un tipo di elemento \"{0}\" non \u00E8 associato. - EmptyPrefixedAttName = Il valore dell''attributo \"{0}\" non \u00E8 valido. Le associazioni di spazi di nomi con prefisso non possono essere vuote. - PrefixDeclared = Il prefisso spazio di nomi \"{0}\" non \u00E8 stato dichiarato. + ElementXMLNSPrefix = L''elemento "{0}" non pu\u00F2 avere "xmlns" come prefisso. + ElementPrefixUnbound = Il prefisso "{0}" per l''elemento "{1}" non \u00E8 associato. + AttributePrefixUnbound = Il prefisso "{2}" per l''attributo "{1}" associato a un tipo di elemento "{0}" non \u00E8 associato. + EmptyPrefixedAttName = Il valore dell''attributo "{0}" non \u00E8 valido. Le associazioni di spazi di nomi con prefisso non possono essere vuote. + PrefixDeclared = Il prefisso spazio di nomi "{0}" non \u00E8 stato dichiarato. CantBindXMLNS = Il prefisso "xmlns" non pu\u00F2 essere associato esplicitamente a uno spazio di nomi, n\u00E9 lo spazio di nomi per "xmlns" pu\u00F2 essere associato esplicitamente a un prefisso. CantBindXML = Il prefisso "xml" non pu\u00F2 essere associato a uno spazio di nomi diverso da quello al quale appartiene, n\u00E9 lo spazio di nomi per "xml" pu\u00F2 essere associato a un prefisso diverso da "xml". - MSG_ATT_DEFAULT_INVALID = defaultValue \"{1}\" dell''attributo \"{0}\" non valido per i vincoli lessicali di questo tipo di attributo. + MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" dell''attributo "{0}" non valido per i vincoli lessicali di questo tipo di attributo. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=Il parser ha rilevato pi\u00F9 \"{0}\" espansioni di entit\u00E0 nel documento. Questo \u00E8 il limite imposto dall''applicazione. +EntityExpansionLimitExceeded=Il parser ha rilevato pi\u00F9 "{0}" espansioni di entit\u00E0 nel documento. Questo \u00E8 il limite imposto dall''applicazione. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= L''elemento \"{0}\" contiene pi\u00F9 di \"{1}\" attributi. \"{1}\" \u00E8 il limite imposto dall''applicazione. +ElementAttributeLimit= L''elemento "{0}" contiene pi\u00F9 di "{1}" attributi. "{1}" \u00E8 il limite imposto dall''applicazione. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties index ed548694ec4..66ed730953c 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D7\u30ED\u30ED\u30FC\u30B0\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 InvalidCharInXMLDecl = XML\u5BA3\u8A00\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 # 2.4 Character Data and Markup - CDEndInContent = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9\"]]>\"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 + CDEndInContent = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9"]]>"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 # 2.7 CDATA Sections - CDSectUnterminated = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306F\"]]>\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + CDSectUnterminated = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML\u5BA3\u8A00\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u5148\u982D\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 - EqRequiredInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001\"{0}\"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 - QuoteRequiredInXMLDecl = XML\u5BA3\u8A00\u306E\"{0}\"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - XMLDeclUnterminated = XML\u5BA3\u8A00\u306F\"?>\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + EqRequiredInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001"{0}"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 + QuoteRequiredInXMLDecl = XML\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + XMLDeclUnterminated = XML\u5BA3\u8A00\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 VersionInfoRequired = XML\u5BA3\u8A00\u306B\u306F\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002 SpaceRequiredBeforeVersionInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 SpaceRequiredBeforeEncodingInXMLDecl = XML\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=\u5F8C\u7D9A\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u306F\u53C2\u7167\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 # 2.9 Standalone Document Declaration - SDDeclInvalid = \u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5BA3\u8A00\u306E\u5024\u306F\u3001\"{0}\"\u3067\u306F\u306A\u304F\u3001\"yes\"\u307E\u305F\u306F\"no\"\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + SDDeclInvalid = \u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5BA3\u8A00\u306E\u5024\u306F\u3001"{0}"\u3067\u306F\u306A\u304F\u3001"yes"\u307E\u305F\u306F"no"\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 2.12 Language Identification - XMLLangInvalid = xml:lang\u5C5E\u6027\u306E\u5024\"{0}\"\u306F\u7121\u52B9\u306A\u8A00\u8A9E\u8B58\u5225\u5B50\u3067\u3059\u3002 + XMLLangInvalid = xml:lang\u5C5E\u6027\u306E\u5024"{0}"\u306F\u7121\u52B9\u306A\u8A00\u8A9E\u8B58\u5225\u5B50\u3067\u3059\u3002 # 3. Logical Structures - ETagRequired = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u7D42\u4E86\u30BF\u30B0\"\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ETagRequired = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u7D42\u4E86\u30BF\u30B0""\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5F8C\u306B\u306F\u3001\u5C5E\u6027\u6307\u5B9A\">\"\u307E\u305F\u306F\"/>\"\u304C\u5FC5\u8981\u3067\u3059\u3002 - EqRequiredInAttribute = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\u540D\"{1}\"\u306E\u5F8C\u306B\u306F\u3001'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 - OpenQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\"{1}\"\u306B\u306F\u3001\u958B\u59CB\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002 - CloseQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\"{1}\"\u306B\u306F\u3001\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002 - AttributeNotUnique = \u5C5E\u6027\"{1}\"\u306F\u8981\u7D20\"{0}\"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 - AttributeNSNotUnique = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\"{2}\"\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u305F\u5C5E\u6027\"{1}\"\u306F\u8981\u7D20\"{0}\"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 - ETagUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u7D42\u4E86\u30BF\u30B0\u306F''>''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ElementUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u306F\u3001\u5C5E\u6027\u6307\u5B9A">"\u307E\u305F\u306F"/>"\u304C\u5FC5\u8981\u3067\u3059\u3002 + EqRequiredInAttribute = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\u540D"{1}"\u306E\u5F8C\u306B\u306F\u3001'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 + OpenQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306B\u306F\u3001\u958B\u59CB\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002 + CloseQuoteExpected = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306B\u306F\u3001\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u5FC5\u8981\u3067\u3059\u3002 + AttributeNotUnique = \u5C5E\u6027"{1}"\u306F\u8981\u7D20"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + AttributeNSNotUnique = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9"{2}"\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u305F\u5C5E\u6027"{1}"\u306F\u8981\u7D20"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + ETagUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u7D42\u4E86\u30BF\u30B0\u306F''>''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 MarkupNotRecognizedInContent = \u8981\u7D20\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u3001\u6574\u5F62\u5F0F\u306E\u6587\u5B57\u30C7\u30FC\u30BF\u307E\u305F\u306F\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 DoctypeIllegalInContent = \u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u306FDOCTYPE\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 # 4.1 Character and Entity References ReferenceUnterminated = \u53C2\u7167\u306F';'\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = \u53C2\u7167\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ElementEntityMismatch = \u8981\u7D20\"{0}\"\u306F\u3001\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u3067\u958B\u59CB\u304A\u3088\u3073\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ElementEntityMismatch = \u8981\u7D20"{0}"\u306F\u3001\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u3067\u958B\u59CB\u304A\u3088\u3073\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 MarkupEntityMismatch=XML\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u69CB\u9020\u306F\u3001\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u3067\u958B\u59CB\u304A\u3088\u3073\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = \u5C5E\u6027\"{1}\"\u306E\u5024\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{2})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u8981\u7D20\u306F\"{0}\"\u3067\u3059\u3002 + InvalidCharInAttValue = \u5C5E\u6027"{1}"\u306E\u5024\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{2})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u8981\u7D20\u306F"{0}"\u3067\u3059\u3002 InvalidCharInComment = \u30B3\u30E1\u30F3\u30C8\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 InvalidCharInPI = \u51E6\u7406\u547D\u4EE4\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 InvalidCharInInternalSubset = DTD\u306E\u5185\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 InvalidCharInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306B\u7121\u52B9\u306AXML\u6587\u5B57(Unicode: 0x{0})\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = \u5C5E\u6027\"{1}\"\u306E\u5024\u306E\u5148\u982D\u306B\u306F\u3001\u4E00\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u307E\u305F\u306F\u4E8C\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 - LessthanInAttValue = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\"{1}\"\u306E\u5024\u306B\u306F\u3001''<''\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 - AttributeValueUnterminated = \u5C5E\u6027\"{1}\"\u306E\u5024\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5F15\u7528\u7B26\u6587\u5B57\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + QuoteRequiredInAttValue = \u5C5E\u6027"{1}"\u306E\u5024\u306E\u5148\u982D\u306B\u306F\u3001\u4E00\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u307E\u305F\u306F\u4E8C\u91CD\u5F15\u7528\u7B26\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 + LessthanInAttValue = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306E\u5024\u306B\u306F\u3001''<''\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 + AttributeValueUnterminated = \u5C5E\u6027"{1}"\u306E\u5024\u306F\u3001\u5BFE\u5FDC\u3059\u308B\u5F15\u7528\u7B26\u6587\u5B57\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 2.5 Comments - InvalidCommentStart = \u30B3\u30E1\u30F3\u30C8\u306E\u5148\u982D\u306B\u306F\"\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + InvalidCommentStart = \u30B3\u30E1\u30F3\u30C8\u306E\u5148\u982D\u306B\u306F""\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 COMMENT_NOT_IN_ONE_ENTITY = \u30B3\u30E1\u30F3\u30C8\u304C\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u56F2\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002 # 2.6 Processing Instructions PITargetRequired = \u51E6\u7406\u547D\u4EE4\u306E\u5148\u982D\u306B\u306F\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002 SpaceRequiredInPI = \u51E6\u7406\u547D\u4EE4\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u30C7\u30FC\u30BF\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 - PIUnterminated = \u51E6\u7406\u547D\u4EE4\u306F\"?>\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ReservedPITarget = \"[xX][mM][lL]\"\u3068\u4E00\u81F4\u3059\u308B\u51E6\u7406\u547D\u4EE4\u30BF\u30FC\u30B2\u30C3\u30C8\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + PIUnterminated = \u51E6\u7406\u547D\u4EE4\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ReservedPITarget = "[xX][mM][lL]"\u3068\u4E00\u81F4\u3059\u308B\u51E6\u7406\u547D\u4EE4\u30BF\u30FC\u30B2\u30C3\u30C8\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 PI_NOT_IN_ONE_ENTITY = \u51E6\u7406\u547D\u4EE4\u304C\u540C\u3058\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u56F2\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002 # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = \u30D0\u30FC\u30B8\u30E7\u30F3\"{0}\"\u306F\u7121\u52B9\u3067\u3059\u3002 - VersionNotSupported = XML\u30D0\u30FC\u30B8\u30E7\u30F3\"{0}\"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u306E\u307F\u3067\u3059\u3002 - VersionNotSupported11 = XML\u30D0\u30FC\u30B8\u30E7\u30F3\"{0}\"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u304A\u3088\u3073XML 1.1\u306E\u307F\u3067\u3059\u3002 + VersionInfoInvalid = \u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u7121\u52B9\u3067\u3059\u3002 + VersionNotSupported = XML\u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u306E\u307F\u3067\u3059\u3002 + VersionNotSupported11 = XML\u30D0\u30FC\u30B8\u30E7\u30F3"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u306E\u306FXML 1.0\u304A\u3088\u3073XML 1.1\u306E\u307F\u3067\u3059\u3002 VersionMismatch= \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u5F8C\u7D9A\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u5225\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 # 4.1 Character and Entity References - DigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300110\u9032\u8868\u73FE\u306F\"&#\"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - HexdigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300116\u9032\u8868\u73FE\u306F\"&#x\"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + DigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300110\u9032\u8868\u73FE\u306F"&#"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + HexdigitRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u3067\u306F\u300116\u9032\u8868\u73FE\u306F"&#x"\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 SemicolonRequiredInCharRef = \u6587\u5B57\u53C2\u7167\u306F';'\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - InvalidCharRef = \u6587\u5B57\u53C2\u7167\"&#{0}\"\u306F\u7121\u52B9\u306AXML\u6587\u5B57\u3067\u3059\u3002 + InvalidCharRef = \u6587\u5B57\u53C2\u7167"&#{0}"\u306F\u7121\u52B9\u306AXML\u6587\u5B57\u3067\u3059\u3002 NameRequiredInReference = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D\u306F'&'\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - SemicolonRequiredInReference = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u3078\u306E\u53C2\u7167\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + SemicolonRequiredInReference = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 4.3.1 The Text Declaration TextDeclMustBeFirst = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306F\u3001\u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u5148\u982D\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 - EqRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\"{0}\"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 - QuoteRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E\"{0}\"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - CloseQuoteMissingInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E\"{0}\"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306B\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u3042\u308A\u307E\u305B\u3093\u3002 + EqRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001"{0}"\u306E\u5F8C\u306B'' = ''\u6587\u5B57\u304C\u5FC5\u8981\u3067\u3059\u3002 + QuoteRequiredInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306F\u3001\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u6587\u5B57\u5217\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + CloseQuoteMissingInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306E"{0}"\u306E\u5F8C\u306B\u7D9A\u304F\u5024\u306B\u7D42\u4E86\u5F15\u7528\u7B26\u304C\u3042\u308A\u307E\u305B\u3093\u3002 SpaceRequiredBeforeVersionInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 SpaceRequiredBeforeEncodingInTextDecl = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u7591\u4F3C\u5C5E\u6027\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 - TextDeclUnterminated = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306F\"?>\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + TextDeclUnterminated = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306F"?>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 EncodingDeclRequired = \u30C6\u30AD\u30B9\u30C8\u5BA3\u8A00\u306B\u306F\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5BA3\u8A00\u304C\u5FC5\u8981\u3067\u3059\u3002 NoMorePseudoAttributes = \u3053\u308C\u4EE5\u4E0A\u306E\u7591\u4F3C\u5C5E\u6027\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 MorePseudoAttributes = \u7591\u4F3C\u5C5E\u6027\u304C\u3055\u3089\u306B\u5FC5\u8981\u3067\u3059\u3002 @@ -143,13 +140,13 @@ CommentNotInOneEntity = \u30B3\u30E1\u30F3\u30C8\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 PINotInOneEntity = \u51E6\u7406\u547D\u4EE4\u306F\u3001\u540C\u3058\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5185\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D\"{0}\"\u304C\u7121\u52B9\u3067\u3059\u3002 - EncodingByteOrderUnsupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\"{0}\"\u306B\u6307\u5B9A\u3055\u308C\u305F\u30D0\u30A4\u30C8\u9806\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + EncodingDeclInvalid = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D"{0}"\u304C\u7121\u52B9\u3067\u3059\u3002 + EncodingByteOrderUnsupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"{0}"\u306B\u6307\u5B9A\u3055\u308C\u305F\u30D0\u30A4\u30C8\u9806\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 InvalidByte = {1}\u30D0\u30A4\u30C8\u306EUTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u30D0\u30A4\u30C8{0}\u304C\u7121\u52B9\u3067\u3059\u3002 ExpectedByte = {1}\u30D0\u30A4\u30C8\u306EUTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u30D0\u30A4\u30C8{0}\u304C\u5FC5\u8981\u3067\u3059\u3002 InvalidHighSurrogate = UTF-8\u30B7\u30FC\u30B1\u30F3\u30B9\u306E\u4E0A\u4F4D\u30B5\u30ED\u30B2\u30FC\u30C8\u30FB\u30D3\u30C3\u30C8\u306E\u4E0A\u9650\u306F0x10\u3067\u3059\u304C\u30010x{0}\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002 - OperationNotSupported = \u64CD\u4F5C\"{0}\"\u306F{1}\u30EA\u30FC\u30C0\u30FC\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - InvalidASCII = \u30D0\u30A4\u30C8\"{0}\"\u306F\u3001(7\u30D3\u30C3\u30C8) ASCII\u30AD\u30E3\u30E9\u30AF\u30BF\u30FB\u30BB\u30C3\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + OperationNotSupported = \u64CD\u4F5C"{0}"\u306F{1}\u30EA\u30FC\u30C0\u30FC\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + InvalidASCII = \u30D0\u30A4\u30C8"{0}"\u306F\u3001(7\u30D3\u30C3\u30C8) ASCII\u30AD\u30E3\u30E9\u30AF\u30BF\u30FB\u30BB\u30C3\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 CharConversionFailure = \u7279\u5B9A\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3042\u308B\u3068\u78BA\u5B9A\u3055\u308C\u305F\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u305D\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u4E0D\u6B63\u306A\u30B7\u30FC\u30B1\u30F3\u30B9\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = \u516C\u958B\u8B58\u5225\u5B50\u3067\u306F\u3001\u6587\u5B57(Unicode: 0x{0})\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002 SpaceRequiredBetweenPublicAndSystem = \u516C\u958B\u8B58\u5225\u5B50\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\"''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - PEReferenceWithinMarkup = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"%{0};\"\u306F\u3001DTD\u306E\u5185\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306E\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u5185\u306B\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001"''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + PEReferenceWithinMarkup = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u306F\u3001DTD\u306E\u5185\u90E8\u30B5\u30D6\u30BB\u30C3\u30C8\u306E\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u5185\u306B\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u306B\u542B\u307E\u308C\u308B\u304B\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7\u5BA3\u8A00\u304C\u6307\u3057\u3066\u3044\u308B\u30DE\u30FC\u30AF\u30A2\u30C3\u30D7\u5BA3\u8A00\u306F\u6574\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = \"xml:space\"\u306E\u5C5E\u6027\u5BA3\u8A00\u306F\u3001\"default\"\u304A\u3088\u3073\"preserve\"\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u308B\u5217\u6319\u30BF\u30A4\u30D7\u3068\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space"\u306E\u5C5E\u6027\u5BA3\u8A00\u306F\u3001"default"\u304A\u3088\u3073"preserve"\u306E\u307F\u3092\u4F7F\u7528\u3067\u304D\u308B\u5217\u6319\u30BF\u30A4\u30D7\u3068\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\"''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u8981\u7D20\u30BF\u30A4\u30D7\u5BA3\u8A00\u3067\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5F8C\u306B\u5236\u7D04\u304C\u5FC5\u8981\u3067\u3059\u3002 + ElementDeclUnterminated = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5BA3\u8A00\u306B\u306F''(''\u6587\u5B57\u307E\u305F\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F''(''\u6587\u5B57\u307E\u305F\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002 # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5BA3\u8A00\u306B\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002 - MixedContentUnterminated = \u5B50\u8981\u7D20\u306E\u30BF\u30A4\u30D7\u304C\u5236\u7D04\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u6DF7\u5408\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\"{0}\"\u306F\")*\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5BA3\u8A00\u306B\u306F'')''\u304C\u5FC5\u8981\u3067\u3059\u3002 + MixedContentUnterminated = \u5B50\u8981\u7D20\u306E\u30BF\u30A4\u30D7\u304C\u5236\u7D04\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u6DF7\u5408\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB"{0}"\u306F")*"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5C5E\u6027\u30EA\u30B9\u30C8\u5BA3\u8A00\u3067\u306F\u3001\"\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IgnoreSectUnterminated = \u9664\u5916\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u6700\u5F8C\u306F\"]]>\"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IncludeSectUnterminated = \u5305\u542B\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IgnoreSectUnterminated = \u9664\u5916\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u6700\u5F8C\u306F"]]>"\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 4.1 Character and Entity References NameRequiredInPEReference = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D\u306F'%'\u306E\u76F4\u5F8C\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - SemicolonRequiredInPEReference = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"%{0};\"\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + SemicolonRequiredInPEReference = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u306F'';''\u30C7\u30EA\u30DF\u30BF\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001\"''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_DUPLICATE_ENTITY_DEFINITION = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u304C\u8907\u6570\u56DE\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u306F\u3001\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u540D"{0}"\u3068\u5B9A\u7FA9\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u3068\u8868\u8A18\u540D\u306E\u9593\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u306E\u524D\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u3067\u306F\u3001"NDATA"\u306E\u5F8C\u306B\u8868\u8A18\u540D\u304C\u5FC5\u8981\u3067\u3059\u3002 + EntityDeclUnterminated = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_DUPLICATE_ENTITY_DEFINITION = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u304C\u8907\u6570\u56DE\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002 # 4.2.2 External Entities - ExternalIDRequired = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u306E\u5148\u982D\u306B\u306F\"SYSTEM\"\u307E\u305F\u306F\"PUBLIC\"\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \"PUBLIC\"\u3068\u516C\u958B\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + ExternalIDRequired = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u306E\u5148\u982D\u306B\u306F"SYSTEM"\u307E\u305F\u306F"PUBLIC"\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC"\u3068\u516C\u958B\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u516C\u958B\u8B58\u5225\u5B50\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \"SYSTEM\"\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_URI_FRAGMENT_IN_SYSTEMID = \u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u8B58\u5225\u5B50\u306F\u3001\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\"{0}\"\u306E\u4E00\u90E8\u3068\u3057\u3066\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM"\u3068\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u306E\u9593\u306B\u306F\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_URI_FRAGMENT_IN_SYSTEMID = \u30D5\u30E9\u30B0\u30E1\u30F3\u30C8\u8B58\u5225\u5B50\u306F\u3001\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50"{0}"\u306E\u4E00\u90E8\u3068\u3057\u3066\u6307\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u306F\u3001\"''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u306F\u3001\u8868\u8A18\u540D"{0}"\u306E\u5F8C\u306B\u7A7A\u767D\u304C\u5FC5\u8981\u3067\u3059\u3002 + ExternalIDorPublicIDRequired = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u306B\u306F\u3001\u30B7\u30B9\u30C6\u30E0\u8B58\u5225\u5B50\u307E\u305F\u306F\u516C\u958B\u8B58\u5225\u5B50\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + NotationDeclUnterminated = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u306F''>''\u3067\u7D42\u4E86\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # Validation messages - DuplicateTypeInMixedContent = \u8981\u7D20\u30BF\u30A4\u30D7\"{1}\"\u306F\u3001\u8981\u7D20\u5BA3\u8A00\"{0}\"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 - ENTITIESInvalid = \u30BF\u30A4\u30D7ENTITIES\u306E\u5C5E\u6027\u5024\"{1}\"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ENTITYInvalid = \u30BF\u30A4\u30D7ENTITY\u306E\u5C5E\u6027\u5024\"{1}\"\u306F\u3001\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDDefaultTypeInvalid = ID\u5C5E\u6027\"{0}\"\u306B\u306F\u3001\"#IMPLIED\"\u307E\u305F\u306F\"#REQUIRED\"\u306E\u5BA3\u8A00\u6E08\u30C7\u30D5\u30A9\u30EB\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDInvalid = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024\"{0}\"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDNotUnique = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\u4E00\u610F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDREFInvalid = \u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDREFInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024\"{0}\"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - IDREFSInvalid = \u30BF\u30A4\u30D7IDREFS\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u304C\u5B8C\u5168\u306A\u5BA3\u8A00\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ImproperDeclarationNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - ImproperGroupNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u4E38\u30AB\u30C3\u30B3\u306E\u30DA\u30A2\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - INVALID_PE_IN_CONDITIONAL = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u5168\u4F53\u304B\u3001INCLUDE\u307E\u305F\u306FIGNORE\u306E\u307F\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_ATTRIBUTE_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u5BFE\u3057\u3066\u5C5E\u6027\"{1}\"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5024\"{1}\"\u3092\u6301\u3064\u5C5E\u6027\"{0}\"\u306B\u306F\u3001\u30EA\u30B9\u30C8\"{2}\"\u304B\u3089\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5C5E\u6027\"{0}\"\u306E\u5024\"{1}\"\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6B63\u898F\u5316\u306B\u3088\u3063\u3066(\"{2}\"\u306B)\u5909\u66F4\u3055\u308C\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_CONTENT_INCOMPLETE = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u4E0D\u5B8C\u5168\u3067\u3059\u3002\"{1}\"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_CONTENT_INVALID = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\"{1}\"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_CONTENT_INVALID_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\"{1}\"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7\"{2}\"\u306E\u5B50\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306E\u5C5E\u6027\"{1}\"\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u6301\u3061\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_DUPLICATE_ATTDEF = \u5C5E\u6027\"{1}\"\u306F\u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002 - MSG_ELEMENT_ALREADY_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306F\u8907\u6570\u56DE\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 - MSG_ELEMENT_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + DuplicateTypeInMixedContent = \u8981\u7D20\u30BF\u30A4\u30D7"{1}"\u306F\u3001\u8981\u7D20\u5BA3\u8A00"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u3059\u3067\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + ENTITIESInvalid = \u30BF\u30A4\u30D7ENTITIES\u306E\u5C5E\u6027\u5024"{1}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ENTITYInvalid = \u30BF\u30A4\u30D7ENTITY\u306E\u5C5E\u6027\u5024"{1}"\u306F\u3001\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDDefaultTypeInvalid = ID\u5C5E\u6027"{0}"\u306B\u306F\u3001"#IMPLIED"\u307E\u305F\u306F"#REQUIRED"\u306E\u5BA3\u8A00\u6E08\u30C7\u30D5\u30A9\u30EB\u30C8\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDInvalid = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDNotUnique = \u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\u4E00\u610F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDREFInvalid = \u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDREFInvalidWithNamespaces = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u304C\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u5834\u5408\u3001\u30BF\u30A4\u30D7IDREF\u306E\u5C5E\u6027\u5024"{0}"\u306FNCName\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + IDREFSInvalid = \u30BF\u30A4\u30D7IDREFS\u306E\u5C5E\u6027\u5024"{0}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\u304C\u5B8C\u5168\u306A\u5BA3\u8A00\u3068\u3057\u3066\u4F7F\u7528\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ImproperDeclarationNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + ImproperGroupNesting = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u9069\u5207\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u4E38\u30AB\u30C3\u30B3\u306E\u30DA\u30A2\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + INVALID_PE_IN_CONDITIONAL = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u306E\u7F6E\u63DB\u30C6\u30AD\u30B9\u30C8\u306B\u306F\u3001\u6761\u4EF6\u4ED8\u304D\u30BB\u30AF\u30B7\u30E7\u30F3\u5168\u4F53\u304B\u3001INCLUDE\u307E\u305F\u306FIGNORE\u306E\u307F\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_ATTRIBUTE_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u5C5E\u6027"{1}"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5024"{1}"\u3092\u6301\u3064\u5C5E\u6027"{0}"\u306B\u306F\u3001\u30EA\u30B9\u30C8"{2}"\u304B\u3089\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5C5E\u6027"{0}"\u306E\u5024"{1}"\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6B63\u898F\u5316\u306B\u3088\u3063\u3066("{2}"\u306B)\u5909\u66F4\u3055\u308C\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_CONTENT_INCOMPLETE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u4E0D\u5B8C\u5168\u3067\u3059\u3002"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_CONTENT_INVALID = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_CONTENT_INVALID_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F"{1}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7"{2}"\u306E\u5B50\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306E\u5C5E\u6027"{1}"\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u6301\u3061\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_DUPLICATE_ATTDEF = \u5C5E\u6027"{1}"\u306F\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u3059\u3067\u306B\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + MSG_ELEMENT_ALREADY_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306F\u8907\u6570\u56DE\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 + MSG_ELEMENT_NOT_DECLARED = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 MSG_GRAMMAR_NOT_FOUND = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u7121\u52B9\u3067\u3059\u3002\u69CB\u6587\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 - MSG_ELEMENT_WITH_ID_REQUIRED = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u8B58\u5225\u5B50\"{0}\"\u3092\u6301\u3064\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - MSG_FIXED_ATTVALUE_INVALID = \u5024\"{2}\"\u3092\u6301\u3064\u5C5E\u6027\"{1}\"\u306B\u306F\u3001\"{3}\"\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002 - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u306F\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\"{1}\"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027\"{2}\"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027\"{1}\"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027\"{2}\"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5C5E\u6027\"{0}\"\u306E\u8868\u8A18\u6CD5\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5\"{1}\"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \"{0}\"\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5\"{1}\"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5C5E\u6027\"{1}\"\u304C\u5FC5\u8981\u3067\u3059\u3002\u3053\u306E\u5C5E\u6027\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u5BFE\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_ELEMENT_WITH_ID_REQUIRED = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u8B58\u5225\u5B50"{0}"\u3092\u6301\u3064\u8981\u7D20\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + MSG_FIXED_ATTVALUE_INVALID = \u5024"{2}"\u3092\u6301\u3064\u5C5E\u6027"{1}"\u306B\u306F\u3001"{3}"\u306E\u5024\u304C\u5FC5\u8981\u3067\u3059\u3002 + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u306F\u3001\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027"{1}"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7ID\u306E\u5C5E\u6027"{2}"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{1}"\u304C\u3059\u3067\u306B\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{2}"\u3092\u3082\u30461\u3064\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5C5E\u6027"{0}"\u306E\u8868\u8A18\u6CD5\u30BF\u30A4\u30D7\u30FB\u30EA\u30B9\u30C8\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5"{1}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = "{0}"\u306E\u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u5BA3\u8A00\u3067\u53C2\u7167\u3055\u308C\u308B\u5834\u5408\u3001\u8868\u8A18\u6CD5"{1}"\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u3078\u306E\u53C2\u7167\u306F\u3001\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5C5E\u6027"{1}"\u304C\u5FC5\u8981\u3067\u3059\u3002\u3053\u306E\u5C5E\u6027\u306F\u3001\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u5BFE\u3057\u3066\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3067\u306F\u3001\u8981\u7D20\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u6301\u3064\u5916\u90E8\u306E\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3067\u5BA3\u8A00\u3055\u308C\u308B\u8981\u7D20\u9593\u306B\u7A7A\u767D\u306F\u4E0D\u8981\u3067\u3059\u3002 - NMTOKENInvalid = \u30BF\u30A4\u30D7NMTOKEN\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u3001\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - NMTOKENSInvalid = \u30BF\u30A4\u30D7NMTOKENS\u306E\u5C5E\u6027\u5024\"{0}\"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - NoNotationOnEmptyElement = EMPTY\u3068\u5BA3\u8A00\u3055\u308C\u305F\u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u3067\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027\"{1}\"\u3092\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002 - RootElementTypeMustMatchDoctypedecl = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30EB\u30FC\u30C8\u8981\u7D20\"{1}\"\u306FDOCTYPE\u30EB\u30FC\u30C8\"{0}\"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - UndeclaredElementInContentSpec = \u8981\u7D20\"{0}\"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u672A\u5BA3\u8A00\u306E\u8981\u7D20\"{1}\"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002 - UniqueNotationName = \u8868\u8A18\u6CD5\"{0}\"\u306E\u5BA3\u8A00\u304C\u4E00\u610F\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u540C\u3058\u540D\u524D\u3092\u8907\u6570\u306E\u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 + NMTOKENInvalid = \u30BF\u30A4\u30D7NMTOKEN\u306E\u5C5E\u6027\u5024"{0}"\u306F\u3001\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + NMTOKENSInvalid = \u30BF\u30A4\u30D7NMTOKENS\u306E\u5C5E\u6027\u5024"{0}"\u306F\u30011\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u30C8\u30FC\u30AF\u30F3\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + NoNotationOnEmptyElement = EMPTY\u3068\u5BA3\u8A00\u3055\u308C\u305F\u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u3067\u306F\u3001\u30BF\u30A4\u30D7NOTATION\u306E\u5C5E\u6027"{1}"\u3092\u5BA3\u8A00\u3067\u304D\u307E\u305B\u3093\u3002 + RootElementTypeMustMatchDoctypedecl = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30EB\u30FC\u30C8\u8981\u7D20"{1}"\u306FDOCTYPE\u30EB\u30FC\u30C8"{0}"\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + UndeclaredElementInContentSpec = \u8981\u7D20"{0}"\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30E2\u30C7\u30EB\u3067\u672A\u5BA3\u8A00\u306E\u8981\u7D20"{1}"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002 + UniqueNotationName = \u8868\u8A18\u6CD5"{0}"\u306E\u5BA3\u8A00\u304C\u4E00\u610F\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u540C\u3058\u540D\u524D\u3092\u8907\u6570\u306E\u8868\u8A18\u6CD5\u5BA3\u8A00\u3067\u5BA3\u8A00\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 ENTITYFailedInitializeGrammar = ENTITYDatatype\u30D0\u30EA\u30C7\u30FC\u30BF: \u6709\u52B9\u306A\u69CB\u6587\u53C2\u7167\u306B\u3088\u308B\u521D\u671F\u5316\u30E1\u30BD\u30C3\u30C9\u306E\u547C\u51FA\u3057\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 \t - ENTITYNotUnparsed = ENTITY \"{0}\"\u306F\u672A\u89E3\u6790\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 - ENTITYNotValid = ENTITY \"{0}\"\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + ENTITYNotUnparsed = ENTITY "{0}"\u306F\u672A\u89E3\u6790\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + ENTITYNotValid = ENTITY "{0}"\u306F\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 EmptyList = \u30BF\u30A4\u30D7ENTITIES\u3001IDREFS\u304A\u3088\u3073NMTOKENS\u306E\u5024\u306F\u7A7A\u306E\u30EA\u30B9\u30C8\u306B\u3067\u304D\u307E\u305B\u3093\u3002 # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"&{0};\"\u306F\u3001\u5C5E\u6027\u5024\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u306F\u3001\u5C5E\u6027\u5024\u3067\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + AccessExternalDTD = \u5916\u90E8DTD: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8DTD ''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + AccessExternalEntity = \u5916\u90E8\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u5916\u90E8\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 # 4.1 Character and Entity References - EntityNotDeclared = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\"{0}\"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - ReferenceToUnparsedEntity = \u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"&{0};\"\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - RecursiveReference = \u518D\u5E30\u7684\u306A\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"{0}\"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 - RecursiveGeneralReference = \u518D\u5E30\u7684\u306A\u4E00\u822C\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"&{0};\"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 - RecursivePEReference = \u518D\u5E30\u7684\u306A\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167\"%{0};\"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 + EntityNotDeclared = \u30A8\u30F3\u30C6\u30A3\u30C6\u30A3"{0}"\u304C\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + ReferenceToUnparsedEntity = \u672A\u89E3\u6790\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u306F\u8A31\u53EF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + RecursiveReference = \u518D\u5E30\u7684\u306A\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"{0}"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 + RecursiveGeneralReference = \u518D\u5E30\u7684\u306A\u4E00\u822C\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"&{0};"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 + RecursivePEReference = \u518D\u5E30\u7684\u306A\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u53C2\u7167"%{0};"\u3067\u3059\u3002(\u53C2\u7167\u30D1\u30B9: {1})\u3001 # 4.3.3 Character Encoding in Entities - EncodingNotSupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\"{0}\"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + EncodingNotSupported = \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"{0}"\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 EncodingRequired = \u30A8\u30F3\u30B3\u30FC\u30C9\u304CUTF-8\u3068UTF-16\u306E\u3044\u305A\u308C\u3067\u3082\u306A\u3044\u89E3\u6790\u6E08\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306B\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u5BA3\u8A00\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 # Namespaces support # 4. Using Qualified Names IllegalQName = \u8981\u7D20\u307E\u305F\u306F\u5C5E\u6027\u304CQName\u751F\u6210\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093: QName::=(NCName':')?NCName\u3002 - ElementXMLNSPrefix = \u8981\u7D20\"{0}\"\u306E\u63A5\u982D\u8F9E\u3068\u3057\u3066\"xmlns\"\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 - ElementPrefixUnbound = \u8981\u7D20\"{1}\"\u306E\u63A5\u982D\u8F9E\"{0}\"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - AttributePrefixUnbound = \u8981\u7D20\u30BF\u30A4\u30D7\"{0}\"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027\"{1}\"\u306E\u63A5\u982D\u8F9E\"{2}\"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - EmptyPrefixedAttName = \u5C5E\u6027\"{0}\"\u306E\u5024\u304C\u7121\u52B9\u3067\u3059\u3002\u63A5\u982D\u8F9E\u306E\u4ED8\u3044\u305F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002 - PrefixDeclared = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E\"{0}\"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + ElementXMLNSPrefix = \u8981\u7D20"{0}"\u306E\u63A5\u982D\u8F9E\u3068\u3057\u3066"xmlns"\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002 + ElementPrefixUnbound = \u8981\u7D20"{1}"\u306E\u63A5\u982D\u8F9E"{0}"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + AttributePrefixUnbound = \u8981\u7D20\u30BF\u30A4\u30D7"{0}"\u306B\u95A2\u9023\u4ED8\u3051\u3089\u308C\u3066\u3044\u308B\u5C5E\u6027"{1}"\u306E\u63A5\u982D\u8F9E"{2}"\u304C\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + EmptyPrefixedAttName = \u5C5E\u6027"{0}"\u306E\u5024\u304C\u7121\u52B9\u3067\u3059\u3002\u63A5\u982D\u8F9E\u306E\u4ED8\u3044\u305F\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002 + PrefixDeclared = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306E\u63A5\u982D\u8F9E"{0}"\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 CantBindXMLNS = \u63A5\u982D\u8F9E"xmlns"\u306F\u3001\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u660E\u793A\u7684\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002\u307E\u305F\u3001"xmlns"\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3082\u3001\u63A5\u982D\u8F9E\u306B\u660E\u793A\u7684\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002 CantBindXML = \u63A5\u982D\u8F9E"xml"\u306F\u3001\u901A\u5E38\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u4EE5\u5916\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002\u307E\u305F\u3001"xml"\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u3082\u3001"xml"\u4EE5\u5916\u306E\u63A5\u982D\u8F9E\u306B\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3002 - MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027\"{0}\"\u306EdefaultValue \"{1}\"\u306F\u3001\u3053\u306E\u5C5E\u6027\u30BF\u30A4\u30D7\u306E\u5B57\u53E5\u5236\u7D04\u306B\u95A2\u3057\u3066\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027"{0}"\u306EdefaultValue "{1}"\u306F\u3001\u3053\u306E\u5C5E\u6027\u30BF\u30A4\u30D7\u306E\u5B57\u53E5\u5236\u7D04\u306B\u95A2\u3057\u3066\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=\u30D1\u30FC\u30B5\u30FC\u306B\u3088\u3063\u3066\u3001\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\"{0}\"\u3092\u8D85\u3048\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u62E1\u5F35\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 +EntityExpansionLimitExceeded=\u30D1\u30FC\u30B5\u30FC\u306B\u3088\u3063\u3066\u3001\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067"{0}"\u3092\u8D85\u3048\u308B\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u62E1\u5F35\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F\u3002\u3053\u308C\u306F\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= \u8981\u7D20\"{0}\"\u306B\"{1}\"\u3092\u8D85\u3048\u308B\u5C5E\u6027\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\"{1}\"\u306F\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 +ElementAttributeLimit= \u8981\u7D20"{0}"\u306B"{1}"\u3092\u8D85\u3048\u308B\u5C5E\u6027\u304C\u5B58\u5728\u3057\u307E\u3059\u3002"{1}"\u306F\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306B\u3088\u308B\u5236\u9650\u3067\u3059\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties index 882f8085758..0613c417993 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = \uBB38\uC11C\uC758 \uD504\uB864\uB85C\uADF8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. InvalidCharInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. # 2.4 Character Data and Markup - CDEndInContent = \uBB38\uC790 \uC2DC\uD000\uC2A4 \"]]>\"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + CDEndInContent = \uBB38\uC790 \uC2DC\uD000\uC2A4 "]]>"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. # 2.7 CDATA Sections - CDSectUnterminated = CDATA \uC139\uC158\uC740 \"]]>\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + CDSectUnterminated = CDATA \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML \uC120\uC5B8\uC740 \uBB38\uC11C \uB9E8 \uC55E\uC5D0\uB9CC \uB098\uD0C0\uB0A0 \uC218 \uC788\uC2B5\uB2C8\uB2E4. - EqRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \"{0}\" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. - QuoteRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C \"{0}\" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - XMLDeclUnterminated = XML \uC120\uC5B8\uC740 \"?>\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + EqRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 "{0}" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. + QuoteRequiredInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + XMLDeclUnterminated = XML \uC120\uC5B8\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. VersionInfoRequired = XML \uC120\uC5B8\uC5D0\uB294 \uBC84\uC804\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. SpaceRequiredBeforeVersionInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \uBC84\uC804 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. SpaceRequiredBeforeEncodingInXMLDecl = XML \uC120\uC5B8\uC5D0\uC11C\uB294 \uC778\uCF54\uB529 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=\uD6C4\uD589 \uC139\uC158\uC5D0\uC11C\uB294 \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. # 2.9 Standalone Document Declaration - SDDeclInvalid = \uB3C5\uB9BD\uD615 \uBB38\uC11C \uC120\uC5B8 \uAC12\uC740 \"{0}\"\uC774(\uAC00) \uC544\uB2CC \"yes\" \uB610\uB294 \"no\"\uC5EC\uC57C \uD569\uB2C8\uB2E4. + SDDeclInvalid = \uB3C5\uB9BD\uD615 \uBB38\uC11C \uC120\uC5B8 \uAC12\uC740 "{0}"\uC774(\uAC00) \uC544\uB2CC "yes" \uB610\uB294 "no"\uC5EC\uC57C \uD569\uB2C8\uB2E4. # 2.12 Language Identification - XMLLangInvalid = xml:lang \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC5B8\uC5B4 \uC2DD\uBCC4\uC790\uC785\uB2C8\uB2E4. + XMLLangInvalid = xml:lang \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC5B8\uC5B4 \uC2DD\uBCC4\uC790\uC785\uB2C8\uB2E4. # 3. Logical Structures - ETagRequired = \uC694\uC18C \uC720\uD615 \"{0}\"\uC740(\uB294) \uC9DD\uC774 \uB9DE\uB294 \uC885\uB8CC \uD0DC\uADF8 \"\"(\uC73C)\uB85C \uC885\uB8CC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + ETagRequired = \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) \uC9DD\uC774 \uB9DE\uB294 \uC885\uB8CC \uD0DC\uADF8 ""(\uC73C)\uB85C \uC885\uB8CC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = \uC694\uC18C \uC720\uD615 \"{0}\" \uB2E4\uC74C\uC5D0\uB294 \uC18D\uC131 \uC0AC\uC591 \">\" \uB610\uB294 \"/>\"\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. - EqRequiredInAttribute = \uC694\uC18C \uC720\uD615 \"{0}\"\uACFC(\uC640) \uC5F0\uAD00\uB41C \uC18D\uC131 \uC774\uB984 \"{1}\" \uB2E4\uC74C\uC5D0\uB294 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. - OpenQuoteExpected = \uC694\uC18C \uC720\uD615 \"{0}\"\uACFC(\uC640) \uC5F0\uAD00\uB41C \"{1}\" \uC18D\uC131\uC5D0\uB294 \uC5EC\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. - CloseQuoteExpected = \uC694\uC18C \uC720\uD615 \"{0}\"\uACFC(\uC640) \uC5F0\uAD00\uB41C \"{1}\" \uC18D\uC131\uC5D0\uB294 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. - AttributeNotUnique = \"{1}\" \uC18D\uC131\uC774 \"{0}\" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - AttributeNSNotUnique = \"{2}\" \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB41C \"{1}\" \uC18D\uC131\uC774 \"{0}\" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - ETagUnterminated = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 \uB300\uD55C \uC885\uB8CC \uD0DC\uADF8\uB294 ''>'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + ElementUnterminated = \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0\uB294 \uC18D\uC131 \uC0AC\uC591 ">" \uB610\uB294 "/>"\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. + EqRequiredInAttribute = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C \uC18D\uC131 \uC774\uB984 "{1}" \uB2E4\uC74C\uC5D0\uB294 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. + OpenQuoteExpected = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC5D0\uB294 \uC5EC\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. + CloseQuoteExpected = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC5D0\uB294 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. + AttributeNotUnique = "{1}" \uC18D\uC131\uC774 "{0}" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + AttributeNSNotUnique = "{2}" \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB41C "{1}" \uC18D\uC131\uC774 "{0}" \uC694\uC18C\uC5D0 \uB300\uD574 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + ETagUnterminated = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uC885\uB8CC \uD0DC\uADF8\uB294 ''>'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. MarkupNotRecognizedInContent = \uC694\uC18C \uCF58\uD150\uCE20\uB294 \uC62C\uBC14\uB978 \uD615\uC2DD\uC758 \uBB38\uC790 \uB370\uC774\uD130 \uB610\uB294 \uB9C8\uD06C\uC5C5\uC73C\uB85C \uAD6C\uC131\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. DoctypeIllegalInContent = \uCF58\uD150\uCE20\uC5D0\uC11C\uB294 DOCTYPE\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. # 4.1 Character and Entity References ReferenceUnterminated = \uCC38\uC870\uB294 ';' \uAD6C\uBD84\uC790\uB85C \uC885\uB8CC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = \uCC38\uC870\uB294 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - ElementEntityMismatch = \"{0}\" \uC694\uC18C\uB294 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC2DC\uC791\uB418\uACE0 \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + ElementEntityMismatch = "{0}" \uC694\uC18C\uB294 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC2DC\uC791\uB418\uACE0 \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. MarkupEntityMismatch=XML \uBB38\uC11C \uAD6C\uC870\uB294 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC2DC\uC791\uB418\uACE0 \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = \"{1}\" \uC18D\uC131\uC758 \uAC12\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{2})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC73C\uBA70 \uC694\uC18C\uAC00 \"{0}\"\uC785\uB2C8\uB2E4. + InvalidCharInAttValue = "{1}" \uC18D\uC131\uC758 \uAC12\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{2})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC73C\uBA70 \uC694\uC18C\uAC00 "{0}"\uC785\uB2C8\uB2E4. InvalidCharInComment = \uC8FC\uC11D\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. InvalidCharInPI = \uCC98\uB9AC \uBA85\uB839\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. InvalidCharInInternalSubset = DTD\uC758 \uB0B4\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. InvalidCharInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C \uBD80\uC801\uD569\uD55C XML \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = \"{1}\" \uC18D\uC131\uC758 \uAC12\uC740 \uC791\uC740 \uB530\uC634\uD45C \uB610\uB294 \uD070 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4. - LessthanInAttValue = \uC694\uC18C \uC720\uD615 \"{0}\"\uACFC(\uC640) \uC5F0\uAD00\uB41C \"{1}\" \uC18D\uC131\uC758 \uAC12\uC5D0\uB294 ''<'' \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. - AttributeValueUnterminated = \"{1}\" \uC18D\uC131\uC758 \uAC12\uC740 \uC9DD\uC774 \uB9DE\uB294 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + QuoteRequiredInAttValue = "{1}" \uC18D\uC131\uC758 \uAC12\uC740 \uC791\uC740 \uB530\uC634\uD45C \uB610\uB294 \uD070 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4. + LessthanInAttValue = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC758 \uAC12\uC5D0\uB294 ''<'' \uBB38\uC790\uAC00 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + AttributeValueUnterminated = "{1}" \uC18D\uC131\uC758 \uAC12\uC740 \uC9DD\uC774 \uB9DE\uB294 \uB530\uC634\uD45C \uBB38\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 2.5 Comments - InvalidCommentStart = \uC8FC\uC11D\uC740 \"\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + InvalidCommentStart = \uC8FC\uC11D\uC740 ""\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. COMMENT_NOT_IN_ONE_ENTITY = \uC8FC\uC11D\uC774 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0 \uC548\uC5D0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. # 2.6 Processing Instructions PITargetRequired = \uCC98\uB9AC \uBA85\uB839\uC740 \uB300\uC0C1 \uC774\uB984\uC73C\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4. SpaceRequiredInPI = \uCC98\uB9AC \uBA85\uB839 \uB300\uC0C1\uACFC \uB370\uC774\uD130 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - PIUnterminated = \uCC98\uB9AC \uBA85\uB839\uC740 \"?>\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. - ReservedPITarget = \"[xX][mM][lL]\"\uACFC \uC77C\uCE58\uD558\uB294 \uCC98\uB9AC \uBA85\uB839 \uB300\uC0C1\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + PIUnterminated = \uCC98\uB9AC \uBA85\uB839\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + ReservedPITarget = "[xX][mM][lL]"\uACFC \uC77C\uCE58\uD558\uB294 \uCC98\uB9AC \uBA85\uB839 \uB300\uC0C1\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. PI_NOT_IN_ONE_ENTITY = \uCC98\uB9AC \uBA85\uB839\uC774 \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0 \uC548\uC5D0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = \"{0}\"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uBC84\uC804\uC785\uB2C8\uB2E4. - VersionNotSupported = XML \uBC84\uC804 \"{0}\"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4. - VersionNotSupported11 = XML \uBC84\uC804 \"{0}\"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0 \uBC0F XML 1.1\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4. + VersionInfoInvalid = "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uBC84\uC804\uC785\uB2C8\uB2E4. + VersionNotSupported = XML \uBC84\uC804 "{0}"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4. + VersionNotSupported11 = XML \uBC84\uC804 "{0}"\uC740(\uB294) \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. XML 1.0 \uBC0F XML 1.1\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4. VersionMismatch= \uD558\uB098\uC758 \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uC774\uD6C4 \uBC84\uC804\uC758 \uB2E4\uB978 \uC5D4\uD2F0\uD2F0\uAC00 \uD3EC\uD568\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. # 4.1 Character and Entity References - DigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 \"&#\" \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC2ED\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. - HexdigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 \"&#x\" \uBC14\uB85C \uB2E4\uC74C\uC5D0 16\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. + DigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 "&#" \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC2ED\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. + HexdigitRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uC5D0\uC11C\uB294 "&#x" \uBC14\uB85C \uB2E4\uC74C\uC5D0 16\uC9C4\uC218 \uD45C\uD604\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. SemicolonRequiredInCharRef = \uBB38\uC790 \uCC38\uC870\uB294 ';' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. - InvalidCharRef = \uBB38\uC790 \uCC38\uC870 \"&#{0}\"\uC740(\uB294) \uBD80\uC801\uD569\uD55C XML \uBB38\uC790\uC785\uB2C8\uB2E4. + InvalidCharRef = \uBB38\uC790 \uCC38\uC870 "&#{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C XML \uBB38\uC790\uC785\uB2C8\uB2E4. NameRequiredInReference = \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC5D0\uC11C\uB294 '&' \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC5D4\uD2F0\uD2F0 \uC774\uB984\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. - SemicolonRequiredInReference = \"{0}\" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uB294 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + SemicolonRequiredInReference = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uB294 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 4.3.1 The Text Declaration TextDeclMustBeFirst = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uB9E8 \uC55E\uC5D0\uB9CC \uB098\uD0C0\uB0A0 \uC218 \uC788\uC2B5\uB2C8\uB2E4. - EqRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C\uB294 \"{0}\" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. - QuoteRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C \"{0}\" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - CloseQuoteMissingInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C \"{0}\" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC758 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + EqRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C\uB294 "{0}" \uB2E4\uC74C\uC5D0 '' = '' \uBB38\uC790\uAC00 \uC640\uC57C \uD569\uB2C8\uB2E4. + QuoteRequiredInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC740 \uB530\uC634\uD45C\uAC00 \uBD99\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + CloseQuoteMissingInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uC11C "{0}" \uB2E4\uC74C\uC5D0 \uC624\uB294 \uAC12\uC758 \uB2EB\uB294 \uB530\uC634\uD45C\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4. SpaceRequiredBeforeVersionInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uBC84\uC804 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. SpaceRequiredBeforeEncodingInTextDecl = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \uC778\uCF54\uB529 \uC758\uC0AC \uC18D\uC131 \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - TextDeclUnterminated = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 \"?>\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + TextDeclUnterminated = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC740 "?>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. EncodingDeclRequired = \uD14D\uC2A4\uD2B8 \uC120\uC5B8\uC5D0\uB294 \uC778\uCF54\uB529 \uC120\uC5B8\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. NoMorePseudoAttributes = \uC758\uC0AC \uC18D\uC131\uC740 \uB354 \uC774\uC0C1 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. MorePseudoAttributes = \uC758\uC0AC \uC18D\uC131\uC774 \uB354 \uD544\uC694\uD569\uB2C8\uB2E4. @@ -143,13 +140,13 @@ CommentNotInOneEntity = \uC8FC\uC11D\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. PINotInOneEntity = \uCC98\uB9AC \uBA85\uB839\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uB3D9\uC77C\uD55C \uC5D4\uD2F0\uD2F0\uC5D0 \uC644\uC804\uD788 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = \"{0}\"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC778\uCF54\uB529 \uC774\uB984\uC785\uB2C8\uB2E4. - EncodingByteOrderUnsupported = \"{0}\" \uC778\uCF54\uB529\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C \uBC14\uC774\uD2B8 \uC21C\uC11C\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + EncodingDeclInvalid = "{0}"\uC740(\uB294) \uBD80\uC801\uD569\uD55C \uC778\uCF54\uB529 \uC774\uB984\uC785\uB2C8\uB2E4. + EncodingByteOrderUnsupported = "{0}" \uC778\uCF54\uB529\uC5D0 \uB300\uD574 \uC81C\uACF5\uB41C \uBC14\uC774\uD2B8 \uC21C\uC11C\uB294 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. InvalidByte = {0}\uC740(\uB294) {1}\uBC14\uC774\uD2B8 UTF-8 \uC2DC\uD000\uC2A4\uC5D0 \uB300\uD574 \uBD80\uC801\uD569\uD55C \uBC14\uC774\uD2B8\uC785\uB2C8\uB2E4. ExpectedByte = {1}\uBC14\uC774\uD2B8 UTF-8 \uC2DC\uD000\uC2A4\uC5D0 \uD544\uC694\uD55C \uBC14\uC774\uD2B8\uB294 {0}\uC785\uB2C8\uB2E4. InvalidHighSurrogate = UTF-8 \uC2DC\uD000\uC2A4\uC758 \uB192\uC740 \uB300\uB9AC \uBE44\uD2B8\uB294 0x10\uC744 \uCD08\uACFC\uD558\uC9C0 \uC54A\uC544\uC57C \uD558\uC9C0\uB9CC 0x{0}\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - OperationNotSupported = {1} \uC77D\uAE30 \uD504\uB85C\uADF8\uB7A8\uC740 \"{0}\" \uC791\uC5C5\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - InvalidASCII = \uBC14\uC774\uD2B8 \"{0}\"\uC740(\uB294) (7\uBE44\uD2B8) ASCII \uBB38\uC790 \uC9D1\uD569\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + OperationNotSupported = {1} \uC77D\uAE30 \uD504\uB85C\uADF8\uB7A8\uC740 "{0}" \uC791\uC5C5\uC744 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + InvalidASCII = \uBC14\uC774\uD2B8 "{0}"\uC740(\uB294) (7\uBE44\uD2B8) ASCII \uBB38\uC790 \uC9D1\uD569\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. CharConversionFailure = \uD2B9\uC815 \uC778\uCF54\uB529 \uD615\uC2DD\uC774\uC5B4\uC57C \uD558\uB294 \uAC83\uC73C\uB85C \uD655\uC778\uB41C \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uD574\uB2F9 \uC778\uCF54\uB529\uC5D0 \uBD80\uC801\uD569\uD55C \uC2DC\uD000\uC2A4\uAC00 \uD3EC\uD568\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uC5D0\uB294 \uBB38\uC790(\uC720\uB2C8\uCF54\uB4DC: 0x{0})\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. SpaceRequiredBetweenPublicAndSystem = publicId\uC640 systemId \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \"''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. - PEReferenceWithinMarkup = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 \"%{0};\"\uC740 DTD\uC758 \uB0B4\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0 \uC788\uB294 \uB9C8\uD06C\uC5C5 \uC548\uC5D0 \uD45C\uC2DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 "''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + PEReferenceWithinMarkup = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "%{0};"\uC740 DTD\uC758 \uB0B4\uBD80 \uBD80\uBD84 \uC9D1\uD569\uC5D0 \uC788\uB294 \uB9C8\uD06C\uC5C5 \uC548\uC5D0 \uD45C\uC2DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC744 \uD3EC\uD568\uD558\uAC70\uB098 \uBB38\uC11C \uC720\uD615 \uC120\uC5B8\uC774 \uAC00\uB9AC\uD0A4\uB294 \uB9C8\uD06C\uC5C5 \uC120\uC5B8\uC740 \uC62C\uBC14\uB978 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = \"xml:space\"\uC5D0 \uB300\uD55C \uC18D\uC131 \uC120\uC5B8\uC740 \"default\" \uBC0F \"preserve\" \uAC12\uB9CC \uAC00\uB2A5\uD55C \uC5F4\uAC70 \uC720\uD615\uC73C\uB85C \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space"\uC5D0 \uB300\uD55C \uC18D\uC131 \uC120\uC5B8\uC740 "default" \uBC0F "preserve" \uAC12\uB9CC \uAC00\uB2A5\uD55C \uC5F4\uAC70 \uC720\uD615\uC73C\uB85C \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \"''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \uC694\uC18C \uC720\uD615 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC694\uC18C \uC720\uD615 "{0}" \uB2E4\uC74C\uC5D0 \uC81C\uC57D \uC870\uAC74\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + ElementDeclUnterminated = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uC120\uC5B8\uC5D0\uB294 ''('' \uBB38\uC790 \uB610\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 ''('' \uBB38\uC790 \uB610\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uC120\uC5B8\uC5D0\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. - MixedContentUnterminated = \uD558\uC704 \uC694\uC18C \uC720\uD615\uC774 \uC81C\uD55C\uB418\uB294 \uACBD\uC6B0 \uD63C\uD569 \uCF58\uD150\uCE20 \uBAA8\uB378 \"{0}\"\uC740(\uB294) \")*\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 \uC694\uC18C \uC720\uD615\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uC120\uC5B8\uC5D0\uB294 '')''\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. + MixedContentUnterminated = \uD558\uC704 \uC694\uC18C \uC720\uD615\uC774 \uC81C\uD55C\uB418\uB294 \uACBD\uC6B0 \uD63C\uD569 \uCF58\uD150\uCE20 \uBAA8\uB378 "{0}"\uC740(\uB294) ")*"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = attribute-list \uC120\uC5B8\uC5D0\uC11C\uB294 \"\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. - IgnoreSectUnterminated = \uC81C\uC678\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC740 \"]]>\"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + IncludeSectUnterminated = \uD3EC\uD568\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + IgnoreSectUnterminated = \uC81C\uC678\uB41C \uC870\uAC74\uBD80 \uC139\uC158\uC740 "]]>"\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 4.1 Character and Entity References NameRequiredInPEReference = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC5D0\uC11C\uB294 '%' \uBC14\uB85C \uB2E4\uC74C\uC5D0 \uC5D4\uD2F0\uD2F0 \uC774\uB984\uC774 \uC640\uC57C \uD569\uB2C8\uB2E4. - SemicolonRequiredInPEReference = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 \"%{0};\"\uC740 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + SemicolonRequiredInPEReference = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "%{0};"\uC740 '';'' \uAD6C\uBD84\uC790\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 \"''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. - MSG_DUPLICATE_ENTITY_DEFINITION = \"{0}\" \uC5D4\uD2F0\uD2F0\uAC00 \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C\uB294 \uC5D4\uD2F0\uD2F0 \uC774\uB984 "{0}"\uACFC(\uC640) \uC815\uC758 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA"\uC640 \uD45C\uAE30\uBC95 \uC774\uB984 \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA" \uC55E\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uC11C\uB294 "NDATA" \uB2E4\uC74C\uC5D0 \uD45C\uAE30\uBC95 \uC774\uB984\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + EntityDeclUnterminated = "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + MSG_DUPLICATE_ENTITY_DEFINITION = "{0}" \uC5D4\uD2F0\uD2F0\uAC00 \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. # 4.2.2 External Entities - ExternalIDRequired = \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC740 \"SYSTEM\" \uB610\uB294 \"PUBLIC\"\uC73C\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4. - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \"PUBLIC\"\uACFC \uACF5\uC6A9 \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + ExternalIDRequired = \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC740 "SYSTEM" \uB610\uB294 "PUBLIC"\uC73C\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC"\uACFC \uACF5\uC6A9 \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uC640 \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \"SYSTEM\"\uACFC \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. - MSG_URI_FRAGMENT_IN_SYSTEMID = \uBD80\uBD84 \uC2DD\uBCC4\uC790\uB294 \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \"{0}\"\uC758 \uC77C\uBD80\uB85C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM"\uACFC \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 \uC0AC\uC774\uC5D0\uB294 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + MSG_URI_FRAGMENT_IN_SYSTEMID = \uBD80\uBD84 \uC2DD\uBCC4\uC790\uB294 \uC2DC\uC2A4\uD15C \uC2DD\uBCC4\uC790 "{0}"\uC758 \uC77C\uBD80\uB85C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C\uB294 \"''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C\uB294 \uD45C\uAE30\uBC95 \uC774\uB984 "{0}" \uB2E4\uC74C\uC5D0 \uACF5\uBC31\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. + ExternalIDorPublicIDRequired = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC5D0\uB294 \uC2DC\uC2A4\uD15C \uB610\uB294 \uACF5\uC6A9 \uC2DD\uBCC4\uC790\uAC00 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + NotationDeclUnterminated = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC740 ''>''\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4. # Validation messages - DuplicateTypeInMixedContent = \uC694\uC18C \uC720\uD615 \"{1}\"\uC774(\uAC00) \uC694\uC18C \uC120\uC5B8 \"{0}\"\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC5D0 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - ENTITIESInvalid = ENTITIES \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{1}\"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uD558\uB098 \uC774\uC0C1\uC758 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - ENTITYInvalid = ENTITY \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{1}\"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - IDDefaultTypeInvalid = ID \uC18D\uC131 \"{0}\"\uC758 \uC120\uC5B8\uB41C \uAE30\uBCF8\uAC12\uC740 \"#IMPLIED\" \uB610\uB294 \"#REQUIRED\"\uC5EC\uC57C \uD569\uB2C8\uB2E4. - IDInvalid = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - IDInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - IDNotUnique = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uBB38\uC11C \uB0B4\uC5D0\uC11C \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4. - IDREFInvalid = IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - IDREFInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - IDREFSInvalid = IDREFS \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uAC00 \uC804\uCCB4 \uC120\uC5B8\uC73C\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \"{0}\"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - ImproperDeclarationNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \"{0}\"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - ImproperGroupNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \"{0}\"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uAD04\uD638 \uC30D\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - INVALID_PE_IN_CONDITIONAL = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \"{0}\"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC804\uCCB4 \uC870\uAC74\uBD80 \uC139\uC158\uC774 \uD3EC\uD568\uB418\uAC70\uB098 INCLUDE \uB610\uB294 IGNORE\uB9CC \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_ATTRIBUTE_NOT_DECLARED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 \uB300\uD55C \"{1}\" \uC18D\uC131\uC744 \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4. - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \uAC12\uC774 \"{1}\"\uC778 \"{0}\" \uC18D\uC131\uC5D0\uB294 \"{2}\" \uBAA9\uB85D\uC758 \uAC12\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \"{0}\" \uC18D\uC131\uC758 \"{1}\" \uAC12\uC740 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C \uC815\uADDC\uD654\uC5D0 \uC758\uD574 \"{2}\"(\uC73C)\uB85C \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. - MSG_CONTENT_INCOMPLETE = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uCF58\uD150\uCE20\uAC00 \uBD88\uC644\uC804\uD569\uB2C8\uB2E4. \uD574\uB2F9 \uCF58\uD150\uCE20\uB294 \"{1}\"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. - MSG_CONTENT_INVALID = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uCF58\uD150\uCE20\uB294 \"{1}\"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. - MSG_CONTENT_INVALID_SPECIFIED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC758 \uCF58\uD150\uCE20\uB294 \"{1}\"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. \"{2}\" \uC720\uD615\uC758 \uD558\uC704 \uD56D\uBAA9\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 \uB300\uD55C \"{1}\" \uC18D\uC131\uC5D0 \uAE30\uBCF8\uAC12\uC774 \uC788\uC73C\uBA70 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_DUPLICATE_ATTDEF = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 \uB300\uD55C \"{1}\" \uC18D\uC131\uC774 \uC774\uBBF8 \uC120\uC5B8\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. - MSG_ELEMENT_ALREADY_DECLARED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC740(\uB294) \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. - MSG_ELEMENT_NOT_DECLARED = \uC694\uC18C \uC720\uD615 \"{0}\"\uC744(\uB97C) \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4. + DuplicateTypeInMixedContent = \uC694\uC18C \uC720\uD615 "{1}"\uC774(\uAC00) \uC694\uC18C \uC120\uC5B8 "{0}"\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC5D0 \uC774\uBBF8 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + ENTITIESInvalid = ENTITIES \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{1}"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uD558\uB098 \uC774\uC0C1\uC758 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + ENTITYInvalid = ENTITY \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{1}"\uC740(\uB294) \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + IDDefaultTypeInvalid = ID \uC18D\uC131 "{0}"\uC758 \uC120\uC5B8\uB41C \uAE30\uBCF8\uAC12\uC740 "#IMPLIED" \uB610\uB294 "#REQUIRED"\uC5EC\uC57C \uD569\uB2C8\uB2E4. + IDInvalid = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + IDInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + IDNotUnique = ID \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uBB38\uC11C \uB0B4\uC5D0\uC11C \uACE0\uC720\uD574\uC57C \uD569\uB2C8\uB2E4. + IDREFInvalid = IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + IDREFInvalidWithNamespaces = \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 IDREF \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) NCName\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + IDREFSInvalid = IDREFS \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uAC00 \uC804\uCCB4 \uC120\uC5B8\uC73C\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + ImproperDeclarationNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + ImproperGroupNesting = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC81C\uB300\uB85C \uC911\uCCA9\uB41C \uAD04\uD638 \uC30D\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + INVALID_PE_IN_CONDITIONAL = \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 "{0}"\uC758 \uB300\uCCB4 \uD14D\uC2A4\uD2B8\uC5D0\uB294 \uC804\uCCB4 \uC870\uAC74\uBD80 \uC139\uC158\uC774 \uD3EC\uD568\uB418\uAC70\uB098 INCLUDE \uB610\uB294 IGNORE\uB9CC \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_ATTRIBUTE_NOT_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC744 \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4. + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \uAC12\uC774 "{1}"\uC778 "{0}" \uC18D\uC131\uC5D0\uB294 "{2}" \uBAA9\uB85D\uC758 \uAC12\uC774 \uC0AC\uC6A9\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = "{0}" \uC18D\uC131\uC758 "{1}" \uAC12\uC740 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C \uC815\uADDC\uD654\uC5D0 \uC758\uD574 "{2}"(\uC73C)\uB85C \uBCC0\uACBD\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + MSG_CONTENT_INCOMPLETE = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uAC00 \uBD88\uC644\uC804\uD569\uB2C8\uB2E4. \uD574\uB2F9 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. + MSG_CONTENT_INVALID = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. + MSG_CONTENT_INVALID_SPECIFIED = \uC694\uC18C \uC720\uD615 "{0}"\uC758 \uCF58\uD150\uCE20\uB294 "{1}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. "{2}" \uC720\uD615\uC758 \uD558\uC704 \uD56D\uBAA9\uC740 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC5D0 \uAE30\uBCF8\uAC12\uC774 \uC788\uC73C\uBA70 \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_DUPLICATE_ATTDEF = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD55C "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC120\uC5B8\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. + MSG_ELEMENT_ALREADY_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) \uB450 \uBC88 \uC774\uC0C1 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + MSG_ELEMENT_NOT_DECLARED = \uC694\uC18C \uC720\uD615 "{0}"\uC744(\uB97C) \uC120\uC5B8\uD574\uC57C \uD569\uB2C8\uB2E4. MSG_GRAMMAR_NOT_FOUND = \uBB38\uC11C\uAC00 \uBD80\uC801\uD569\uD568: \uBB38\uBC95\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - MSG_ELEMENT_WITH_ID_REQUIRED = \uC2DD\uBCC4\uC790\uAC00 \"{0}\"\uC778 \uC694\uC18C\uAC00 \uBB38\uC11C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \"{0}\"\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - MSG_FIXED_ATTVALUE_INVALID = \uAC12\uC774 \"{2}\"\uC778 \"{1}\" \uC18D\uC131\uC758 \uAC12\uC740 \"{3}\"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 ID \uC720\uD615\uC758 \"{1}\" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C ID \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 \"{2}\"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 NOTATION \uC720\uD615\uC758 \"{1}\" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C NOTATION \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 \"{2}\"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \"{1}\" \uD45C\uAE30\uBC95\uC740 \"{0}\" \uC18D\uC131\uC5D0 \uB300\uD55C \uD45C\uAE30\uBC95 \uC720\uD615 \uBAA9\uB85D\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \"{1}\" \uD45C\uAE30\uBC95\uC740 \"{0}\"\uC5D0 \uB300\uD574 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC120\uC5B8\uB41C \"{0}\" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \"{1}\" \uC18D\uC131\uC774 \uD544\uC694\uD558\uBA70 \uC694\uC18C \uC720\uD615 \"{0}\"\uC5D0 \uB300\uD574 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_ELEMENT_WITH_ID_REQUIRED = \uC2DD\uBCC4\uC790\uAC00 "{0}"\uC778 \uC694\uC18C\uAC00 \uBB38\uC11C\uC5D0 \uB098\uD0C0\uB098\uC57C \uD569\uB2C8\uB2E4. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 "{0}"\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + MSG_FIXED_ATTVALUE_INVALID = \uAC12\uC774 "{2}"\uC778 "{1}" \uC18D\uC131\uC758 \uAC12\uC740 "{3}"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 ID \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C ID \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 "{2}"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 NOTATION \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC774 \uC774\uBBF8 \uC788\uC73C\uBBC0\uB85C NOTATION \uC720\uD615\uC758 \uB450\uBC88\uC9F8 \uC18D\uC131 "{2}"\uC774(\uAC00) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = "{1}" \uD45C\uAE30\uBC95\uC740 "{0}" \uC18D\uC131\uC5D0 \uB300\uD55C \uD45C\uAE30\uBC95 \uC720\uD615 \uBAA9\uB85D\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = "{1}" \uD45C\uAE30\uBC95\uC740 "{0}"\uC5D0 \uB300\uD574 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uC120\uC5B8\uC5D0\uC11C \uCC38\uC870\uB418\uB294 \uACBD\uC6B0 \uC120\uC5B8\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC120\uC5B8\uB41C "{0}" \uC5D4\uD2F0\uD2F0\uC5D0 \uB300\uD55C \uCC38\uC870\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = "{1}" \uC18D\uC131\uC774 \uD544\uC694\uD558\uBA70 \uC694\uC18C \uC720\uD615 "{0}"\uC5D0 \uB300\uD574 \uC9C0\uC815\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \uB3C5\uB9BD\uD615 \uBB38\uC11C\uC5D0\uC11C\uB294 \uC694\uC18C \uCF58\uD150\uCE20\uB97C \uAC00\uC9C0\uBA70 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC678\uBD80 \uC5D4\uD2F0\uD2F0\uC5D0\uC11C \uC120\uC5B8\uB41C \uC694\uC18C \uC0AC\uC774\uC5D0 \uACF5\uBC31\uC774 \uC5C6\uC5B4\uC57C \uD569\uB2C8\uB2E4. - NMTOKENInvalid = NMTOKEN \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - NMTOKENSInvalid = NMTOKENS \uC720\uD615\uC758 \uC18D\uC131\uAC12 \"{0}\"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. - NoNotationOnEmptyElement = EMPTY\uB85C \uC120\uC5B8\uB41C \uC694\uC18C \uC720\uD615 \"{0}\"\uC740(\uB294) NOTATION \uC720\uD615\uC758 \"{1}\" \uC18D\uC131\uC744 \uC120\uC5B8\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - RootElementTypeMustMatchDoctypedecl = \uBB38\uC11C \uB8E8\uD2B8 \uC694\uC18C \"{1}\"\uC740(\uB294) DOCTYPE \uB8E8\uD2B8 \"{0}\"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. - UndeclaredElementInContentSpec = \"{0}\" \uC694\uC18C\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC774 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC694\uC18C \"{1}\"\uC744(\uB97C) \uCC38\uC870\uD569\uB2C8\uB2E4. - UniqueNotationName = \"{0}\" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC774 \uACE0\uC720\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC81C\uACF5\uB41C \uC774\uB984\uC740 \uB450 \uAC1C \uC774\uC0C1\uC758 \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + NMTOKENInvalid = NMTOKEN \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + NMTOKENSInvalid = NMTOKENS \uC720\uD615\uC758 \uC18D\uC131\uAC12 "{0}"\uC740(\uB294) \uD558\uB098 \uC774\uC0C1\uC758 \uC774\uB984 \uD1A0\uD070\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. + NoNotationOnEmptyElement = EMPTY\uB85C \uC120\uC5B8\uB41C \uC694\uC18C \uC720\uD615 "{0}"\uC740(\uB294) NOTATION \uC720\uD615\uC758 "{1}" \uC18D\uC131\uC744 \uC120\uC5B8\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + RootElementTypeMustMatchDoctypedecl = \uBB38\uC11C \uB8E8\uD2B8 \uC694\uC18C "{1}"\uC740(\uB294) DOCTYPE \uB8E8\uD2B8 "{0}"\uACFC(\uC640) \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. + UndeclaredElementInContentSpec = "{0}" \uC694\uC18C\uC758 \uCF58\uD150\uCE20 \uBAA8\uB378\uC774 \uC120\uC5B8\uB418\uC9C0 \uC54A\uC740 \uC694\uC18C "{1}"\uC744(\uB97C) \uCC38\uC870\uD569\uB2C8\uB2E4. + UniqueNotationName = "{0}" \uD45C\uAE30\uBC95\uC5D0 \uB300\uD55C \uC120\uC5B8\uC774 \uACE0\uC720\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC81C\uACF5\uB41C \uC774\uB984\uC740 \uB450 \uAC1C \uC774\uC0C1\uC758 \uD45C\uAE30\uBC95 \uC120\uC5B8\uC5D0\uC11C \uC120\uC5B8\uB418\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. ENTITYFailedInitializeGrammar = ENTITYDatatype \uAC80\uC99D\uAE30: \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC801\uD569\uD55C \uBB38\uBC95 \uCC38\uC870\uB85C \uCD08\uAE30\uD654 \uBA54\uC18C\uB4DC\uB97C \uD638\uCD9C\uD574\uC57C \uD569\uB2C8\uB2E4. \t - ENTITYNotUnparsed = ENTITY \"{0}\"\uC758 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. - ENTITYNotValid = ENTITY \"{0}\"\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. + ENTITYNotUnparsed = ENTITY "{0}"\uC758 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. + ENTITYNotValid = ENTITY "{0}"\uC774(\uAC00) \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. EmptyList = ENTITIES, IDREFS \uBC0F NMTOKENS \uC720\uD615\uC758 \uAC12\uC740 \uBE48 \uBAA9\uB85D\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 \"&{0};\"\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = \uC18D\uC131\uAC12\uC5D0\uC11C\uB294 \uC678\uBD80 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "&{0};"\uC774 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + AccessExternalDTD = \uC678\uBD80 DTD: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC678\uBD80 DTD ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. + AccessExternalEntity = \uC678\uBD80 \uC5D4\uD2F0\uD2F0: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC678\uBD80 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. # 4.1 Character and Entity References - EntityNotDeclared = \"{0}\" \uC5D4\uD2F0\uD2F0\uAC00 \uCC38\uC870\uB418\uC5C8\uC9C0\uB9CC \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. - ReferenceToUnparsedEntity = \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 \"&{0};\"\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - RecursiveReference = \"{0}\"\uC740(\uB294) \uC21C\uD658 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). - RecursiveGeneralReference = \"&{0};\"\uC740 \uC21C\uD658 \uC77C\uBC18 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). - RecursivePEReference = \"%{0};\"\uC740 \uC21C\uD658 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). + EntityNotDeclared = "{0}" \uC5D4\uD2F0\uD2F0\uAC00 \uCC38\uC870\uB418\uC5C8\uC9C0\uB9CC \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. + ReferenceToUnparsedEntity = \uAD6C\uBB38\uC774 \uBD84\uC11D\uB418\uC9C0 \uC54A\uC740 \uC5D4\uD2F0\uD2F0 \uCC38\uC870 "&{0};"\uC740(\uB294) \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + RecursiveReference = "{0}"\uC740(\uB294) \uC21C\uD658 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). + RecursiveGeneralReference = "&{0};"\uC740 \uC21C\uD658 \uC77C\uBC18 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). + RecursivePEReference = "%{0};"\uC740 \uC21C\uD658 \uB9E4\uAC1C\uBCC0\uC218 \uC5D4\uD2F0\uD2F0 \uCC38\uC870\uC785\uB2C8\uB2E4(\uCC38\uC870 \uACBD\uB85C: {1}). # 4.3.3 Character Encoding in Entities - EncodingNotSupported = \"{0}\" \uC778\uCF54\uB529\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + EncodingNotSupported = "{0}" \uC778\uCF54\uB529\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. EncodingRequired = UTF-8 \uB610\uB294 UTF-16\uC73C\uB85C \uC778\uCF54\uB529\uB418\uC9C0 \uC54A\uC740 \uAD6C\uBB38\uC774 \uBD84\uC11D\uB41C \uC5D4\uD2F0\uD2F0\uC5D0\uB294 \uC778\uCF54\uB529 \uC120\uC5B8\uC774 \uD3EC\uD568\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. # Namespaces support # 4. Using Qualified Names IllegalQName = \uC694\uC18C \uB610\uB294 \uC18D\uC131\uC774 QName \uC791\uC131\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC74C: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = \"{0}\" \uC694\uC18C\uC5D0\uB294 \"xmlns\"\uAC00 \uC811\uB450\uC5B4\uB85C \uC0AC\uC6A9\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - ElementPrefixUnbound = \"{1}\" \uC694\uC18C\uC5D0 \uB300\uD55C \"{0}\" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. - AttributePrefixUnbound = \uC694\uC18C \uC720\uD615 \"{0}\"\uACFC(\uC640) \uC5F0\uAD00\uB41C \"{1}\" \uC18D\uC131\uC758 \"{2}\" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. - EmptyPrefixedAttName = \"{0}\" \uC18D\uC131\uC758 \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC811\uB450\uC5B4\uAC00 \uC9C0\uC815\uB41C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uBC14\uC778\uB529\uC740 \uBE44\uC6CC \uB458 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - PrefixDeclared = \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4 \"{0}\"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. + ElementXMLNSPrefix = "{0}" \uC694\uC18C\uC5D0\uB294 "xmlns"\uAC00 \uC811\uB450\uC5B4\uB85C \uC0AC\uC6A9\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + ElementPrefixUnbound = "{1}" \uC694\uC18C\uC5D0 \uB300\uD55C "{0}" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. + AttributePrefixUnbound = \uC694\uC18C \uC720\uD615 "{0}"\uACFC(\uC640) \uC5F0\uAD00\uB41C "{1}" \uC18D\uC131\uC758 "{2}" \uC811\uB450\uC5B4\uAC00 \uBC14\uC778\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. + EmptyPrefixedAttName = "{0}" \uC18D\uC131\uC758 \uAC12\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. \uC811\uB450\uC5B4\uAC00 \uC9C0\uC815\uB41C \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uBC14\uC778\uB529\uC740 \uBE44\uC6CC \uB458 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + PrefixDeclared = \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC811\uB450\uC5B4 "{0}"\uC774(\uAC00) \uC120\uC5B8\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. CantBindXMLNS = "xmlns" \uC811\uB450\uC5B4\uB294 \uBA85\uC2DC\uC801\uC73C\uB85C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "xmlns"\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB3C4 \uBA85\uC2DC\uC801\uC73C\uB85C \uC811\uB450\uC5B4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. CantBindXML = "xml" \uC811\uB450\uC5B4\uB294 \uC77C\uBC18 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uAC00 \uC544\uB2CC \uB2E4\uB978 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "xml"\uC5D0 \uB300\uD55C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uB3C4 "xml" \uC774\uC678\uC758 \uC811\uB450\uC5B4\uC5D0 \uBC14\uC778\uB4DC\uB420 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - MSG_ATT_DEFAULT_INVALID = \"{0}\" \uC18D\uC131\uC758 defaultValue \"{1}\"\uC740(\uB294) \uC774 \uC18D\uC131 \uC720\uD615\uC758 \uB809\uC2DC\uCE7C \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD55C \uAC12\uC73C\uB85C \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. + MSG_ATT_DEFAULT_INVALID = "{0}" \uC18D\uC131\uC758 defaultValue "{1}"\uC740(\uB294) \uC774 \uC18D\uC131 \uC720\uD615\uC758 \uB809\uC2DC\uCE7C \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD55C \uAC12\uC73C\uB85C \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=\uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774 \uBB38\uC11C\uC5D0\uC11C \"{0}\"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC5D4\uD2F0\uD2F0 \uD655\uC7A5\uC744 \uBC1C\uACAC\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB294 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. +EntityExpansionLimitExceeded=\uAD6C\uBB38 \uBD84\uC11D\uAE30\uAC00 \uC774 \uBB38\uC11C\uC5D0\uC11C "{0}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC5D4\uD2F0\uD2F0 \uD655\uC7A5\uC744 \uBC1C\uACAC\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB294 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= \"{0}\" \uC694\uC18C\uC5D0 \"{1}\"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC18D\uC131\uC774 \uC788\uC2B5\uB2C8\uB2E4. \"{1}\"\uC740(\uB294) \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. +ElementAttributeLimit= "{0}" \uC694\uC18C\uC5D0 "{1}"\uAC1C\uB97C \uCD08\uACFC\uD558\uB294 \uC18D\uC131\uC774 \uC788\uC2B5\uB2C8\uB2E4. "{1}"\uC740(\uB294) \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC5D0\uC11C \uC801\uC6A9\uD558\uB294 \uC81C\uD55C\uC785\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties index 57770dcde09..6bf2f30654e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no pr\u00F3logo do documento. InvalidCharInXMLDecl = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na declara\u00E7\u00E3o XML. # 2.4 Character Data and Markup - CDEndInContent = A sequ\u00EAncia de caracteres \"]]>\" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA. + CDEndInContent = A sequ\u00EAncia de caracteres "]]>" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA. # 2.7 CDATA Sections - CDSectUnterminated = A se\u00E7\u00E3o CDATA deve terminar com \"]]>\". + CDSectUnterminated = A se\u00E7\u00E3o CDATA deve terminar com "]]>". # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = A declara\u00E7\u00E3o XML pode aparecer somente bem no in\u00EDcio do documento. - EqRequiredInXMLDecl = O caractere '' = '' deve estar ap\u00F3s \"{0}\" na declara\u00E7\u00E3o XML. - QuoteRequiredInXMLDecl = O valor ap\u00F3s \"{0}\" na declara\u00E7\u00E3o XML deve ser uma string entre aspas. - XMLDeclUnterminated = A declara\u00E7\u00E3o XML deve terminar com \"?>\". + EqRequiredInXMLDecl = O caractere '' = '' deve estar ap\u00F3s "{0}" na declara\u00E7\u00E3o XML. + QuoteRequiredInXMLDecl = O valor ap\u00F3s "{0}" na declara\u00E7\u00E3o XML deve ser uma string entre aspas. + XMLDeclUnterminated = A declara\u00E7\u00E3o XML deve terminar com "?>". VersionInfoRequired = A vers\u00E3o \u00E9 obrigat\u00F3ria na declara\u00E7\u00E3o XML. SpaceRequiredBeforeVersionInXMLDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes do pseudo-atributo da vers\u00E3o na declara\u00E7\u00E3o XML. SpaceRequiredBeforeEncodingInXMLDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de codificar o pseudo-atributo na declara\u00E7\u00E3o XML. @@ -71,85 +68,85 @@ ReferenceIllegalInTrailingMisc=A refer\u00EAncia n\u00E3o \u00E9 permitida na se\u00E7\u00E3o \u00E0 esquerda. # 2.9 Standalone Document Declaration - SDDeclInvalid = O valor da declara\u00E7\u00E3o do documento stand-alone deve ser \"sim\" ou \"n\u00E3o\", mas n\u00E3o deve ser \"{0}\". + SDDeclInvalid = O valor da declara\u00E7\u00E3o do documento stand-alone deve ser "sim" ou "n\u00E3o", mas n\u00E3o deve ser "{0}". # 2.12 Language Identification - XMLLangInvalid = O valor do atributo xml:lang \"{0}\" \u00E9 um identificador de idioma inv\u00E1lido. + XMLLangInvalid = O valor do atributo xml:lang "{0}" \u00E9 um identificador de idioma inv\u00E1lido. # 3. Logical Structures - ETagRequired = O tipo de elemento {0}\" deve ser encerrado pela tag final correspondente \"\". + ETagRequired = O tipo de elemento {0}" deve ser encerrado pela tag final correspondente "". # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = O tipo de elemento \"{0}\" deve ser seguido pelas especifica\u00E7\u00F5es do atributo, \">\" ou \"/>\". - EqRequiredInAttribute = O nome do atributo \"{1}\" associado a um tipo de elemento \"{0}\" deve ser seguido do caractere '' = ''. - OpenQuoteExpected = S\u00E3o esperadas aspas de abertura para o atributo \"{1}\" associado a um tipo de elemento \"{0}\". - CloseQuoteExpected = S\u00E3o esperadas aspas de fechamento para o atributo \"{1}\" associado a um tipo de elemento \"{0}\". - AttributeNotUnique = O atributo \"{1}\" j\u00E1 foi especificado para o elemento \"{0}\". - AttributeNSNotUnique = O atributo \"{1}\" vinculado ao namespace \"{2}\" j\u00E1 foi especificado para o elemento \"{0}\". - ETagUnterminated = A tag final do tipo de elemento \"{0}\" deve terminar com um delimitador ''>". + ElementUnterminated = O tipo de elemento "{0}" deve ser seguido pelas especifica\u00E7\u00F5es do atributo, ">" ou "/>". + EqRequiredInAttribute = O nome do atributo "{1}" associado a um tipo de elemento "{0}" deve ser seguido do caractere '' = ''. + OpenQuoteExpected = S\u00E3o esperadas aspas de abertura para o atributo "{1}" associado a um tipo de elemento "{0}". + CloseQuoteExpected = S\u00E3o esperadas aspas de fechamento para o atributo "{1}" associado a um tipo de elemento "{0}". + AttributeNotUnique = O atributo "{1}" j\u00E1 foi especificado para o elemento "{0}". + AttributeNSNotUnique = O atributo "{1}" vinculado ao namespace "{2}" j\u00E1 foi especificado para o elemento "{0}". + ETagUnterminated = A tag final do tipo de elemento "{0}" deve terminar com um delimitador ''>". MarkupNotRecognizedInContent = O conte\u00FAdo dos elementos deve consistir em dados ou marca\u00E7\u00E3o do caractere correto. DoctypeIllegalInContent = Um DOCTYPE n\u00E3o \u00E9 permitido no conte\u00FAdo. # 4.1 Character and Entity References ReferenceUnterminated = A refer\u00EAncia deve ser encerrada por um delimitador ';'. # 4.3.2 Well-Formed Parsed Entities - ReferenceNotInOneEntity = A refer\u00EAncia deve estar totalmente contida na mesma entidade submetida a parse. - ElementEntityMismatch = O elemento \"{0}\" deve come\u00E7ar e terminar com a mesma entidade. + ReferenceNotInOneEntity = A refer\u00EAncia deve estar totalmente contida na mesma entidade submetida a parsing. + ElementEntityMismatch = O elemento "{0}" deve come\u00E7ar e terminar com a mesma entidade. MarkupEntityMismatch=As estruturas do documento XML devem come\u00E7ar e terminar com a mesma entidade. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = Um caractere XML inv\u00E1lido (Unicode: 0x {2}) foi encontrado no valor do atributo \"{1}\" e o elemento \u00E9 \"{0}\". + InvalidCharInAttValue = Um caractere XML inv\u00E1lido (Unicode: 0x {2}) foi encontrado no valor do atributo "{1}" e o elemento \u00E9 "{0}". InvalidCharInComment = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado no coment\u00E1rio. InvalidCharInPI = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na instru\u00E7\u00E3o de processamento. InvalidCharInInternalSubset = Um caractere XML inv\u00E1lido (Unicode: 0x {0}) foi encontrado no subconjunto interno do DTD. InvalidCharInTextDecl = Um caractere XML inv\u00E1lido (Unicode: 0x{0}) foi encontrado na declara\u00E7\u00E3o de texto. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = O valor do atributo \"{1}\" deve come\u00E7ar com aspas simples ou duplas. - LessthanInAttValue = O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00E3o deve conter o caractere ''<''. - AttributeValueUnterminated = O valor do atributo \"{1}\" deve terminar com as aspas correspondentes. + QuoteRequiredInAttValue = O valor do atributo "{1}" deve come\u00E7ar com aspas simples ou duplas. + LessthanInAttValue = O valor do atributo "{1}" associado a um tipo de elemento "{0}" n\u00E3o deve conter o caractere ''<''. + AttributeValueUnterminated = O valor do atributo "{1}" deve terminar com as aspas correspondentes. # 2.5 Comments - InvalidCommentStart = O coment\u00E1rio deve come\u00E7ar com \"\". + InvalidCommentStart = O coment\u00E1rio deve come\u00E7ar com "". COMMENT_NOT_IN_ONE_ENTITY = O coment\u00E1rio n\u00E3o est\u00E1 entre chaves na mesma entidade. # 2.6 Processing Instructions PITargetRequired = A instru\u00E7\u00E3o de processamento deve come\u00E7ar com o nome do destino. SpaceRequiredInPI = O espa\u00E7o em branco \u00E9 obrigat\u00F3rio entre o destino da instru\u00E7\u00E3o de processamento e os dados. - PIUnterminated = A instru\u00E7\u00E3o de processamento deve terminar com \"?>\". - ReservedPITarget = O destino da instru\u00E7\u00E3o de processamento correspondente \"[xX][mM][lL]\" n\u00E3o \u00E9 permitido. + PIUnterminated = A instru\u00E7\u00E3o de processamento deve terminar com "?>". + ReservedPITarget = O destino da instru\u00E7\u00E3o de processamento correspondente "[xX][mM][lL]" n\u00E3o \u00E9 permitido. PI_NOT_IN_ONE_ENTITY = A instru\u00E7\u00E3o de processamento n\u00E3o est\u00E1 entre chaves na mesma entidade. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Vers\u00E3o inv\u00E1lida \"{0}\". - VersionNotSupported = Vers\u00E3o XML \"{0}\" n\u00E3o suportada; somente XML 1.0 \u00E9 suportada. - VersionNotSupported11 = Vers\u00E3o XML \"{0}\" n\u00E3o suportada, somente XML 1.0 e XML 1.1 s\u00E3o suportadas. + VersionInfoInvalid = Vers\u00E3o inv\u00E1lida "{0}". + VersionNotSupported = Vers\u00E3o XML "{0}" n\u00E3o suportada; somente XML 1.0 \u00E9 suportada. + VersionNotSupported11 = Vers\u00E3o XML "{0}" n\u00E3o suportada, somente XML 1.0 e XML 1.1 s\u00E3o suportadas. VersionMismatch= Uma entidade n\u00E3o pode incluir outra entidade de uma vers\u00E3o posterior. # 4.1 Character and Entity References - DigitRequiredInCharRef = Uma representa\u00E7\u00E3o decimal deve seguir imediatamente o \"&#\" em uma refer\u00EAncia de caractere. - HexdigitRequiredInCharRef = Uma representa\u00E7\u00E3o hexadecimal deve seguir imediatamente o \"&#\" em uma refer\u00EAncia de caractere. + DigitRequiredInCharRef = Uma representa\u00E7\u00E3o decimal deve seguir imediatamente o "&#" em uma refer\u00EAncia de caractere. + HexdigitRequiredInCharRef = Uma representa\u00E7\u00E3o hexadecimal deve seguir imediatamente o "&#" em uma refer\u00EAncia de caractere. SemicolonRequiredInCharRef = A refer\u00EAncia de caractere deve terminar com o delimitador ';'. - InvalidCharRef = A refer\u00EAncia do caractere \"&#{0}\" \u00E9 um caractere XML inv\u00E1lido. + InvalidCharRef = A refer\u00EAncia do caractere "&#{0}" \u00E9 um caractere XML inv\u00E1lido. NameRequiredInReference = O nome da entidade deve seguir imediatamente o '&' na refer\u00EAncia da entidade. - SemicolonRequiredInReference = A refer\u00EAncia \u00E0 entidade \"{0}\" deve terminar com o delimitador '';''. + SemicolonRequiredInReference = A refer\u00EAncia \u00E0 entidade "{0}" deve terminar com o delimitador '';''. # 4.3.1 The Text Declaration - TextDeclMustBeFirst = A declara\u00E7\u00E3o de texto somente pode aparecer bem no in\u00EDcio da entidade externa submetida a parse. - EqRequiredInTextDecl = O caractere '' = '' deve estar ap\u00F3s \"{0}\" na declara\u00E7\u00E3o de texto. - QuoteRequiredInTextDecl = O valor ap\u00F3s \"{0}\" na declara\u00E7\u00E3o de texto deve ser uma string entre aspas. - CloseQuoteMissingInTextDecl = n\u00E3o foi encontrada a aspa de fechamento no valor ap\u00F3s "{0}\" na declara\u00E7\u00E3o de texto. + TextDeclMustBeFirst = A declara\u00E7\u00E3o de texto somente pode aparecer bem no in\u00EDcio da entidade externa submetida a parsing. + EqRequiredInTextDecl = O caractere '' = '' deve estar ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto. + QuoteRequiredInTextDecl = O valor ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto deve ser uma string entre aspas. + CloseQuoteMissingInTextDecl = n\u00E3o foi encontrada a aspa de fechamento no valor ap\u00F3s "{0}" na declara\u00E7\u00E3o de texto. SpaceRequiredBeforeVersionInTextDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes do pseudo-atributo da vers\u00E3o na declara\u00E7\u00E3o de texto. SpaceRequiredBeforeEncodingInTextDecl = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de codificar o pseudo-atributo na declara\u00E7\u00E3o de texto. - TextDeclUnterminated = A declara\u00E7\u00E3o de texto deve terminar com \"?>\". + TextDeclUnterminated = A declara\u00E7\u00E3o de texto deve terminar com "?>". EncodingDeclRequired = A declara\u00E7\u00E3o de codifica\u00E7\u00E3o \u00E9 necess\u00E1ria na declara\u00E7\u00E3o de texto. NoMorePseudoAttributes = N\u00E3o s\u00E3o mais permitidos pseudo-atributos. MorePseudoAttributes = S\u00E3o esperados mais pseudo-atributos. PseudoAttrNameExpected = \u00C9 esperado um nome de um pseudo-atributo. # 4.3.2 Well-Formed Parsed Entities - CommentNotInOneEntity = O coment\u00E1rio deve estar totalmente contido na mesma entidade submetida a parse. - PINotInOneEntity = A instru\u00E7\u00E3o de processamento deve estar totalmente contida na mesma entidade submetida a parse. + CommentNotInOneEntity = O coment\u00E1rio deve estar totalmente contido na mesma entidade submetida a parsing. + PINotInOneEntity = A instru\u00E7\u00E3o de processamento deve estar totalmente contida na mesma entidade submetida a parsing. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Nome da codifica\u00E7\u00E3o inv\u00E1lida \"{0}\". - EncodingByteOrderUnsupported = A ordem de bytes fornecida para codifica\u00E7\u00E3o \"{0}\" n\u00E3o \u00E9 suportada. + EncodingDeclInvalid = Nome da codifica\u00E7\u00E3o inv\u00E1lida "{0}". + EncodingByteOrderUnsupported = A ordem de bytes fornecida para codifica\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada. InvalidByte = Byte inv\u00E1lido {0} da sequ\u00EAncia UTF-8 do byte {1}. ExpectedByte = Esperava {0} byte da sequ\u00EAncia UTF-8 do byte {1}. InvalidHighSurrogate = Os bits substitutos altos na sequ\u00EAncia da UTF-8 n\u00E3o devem exceder 0x10 mas foi encontrado 0x{0}. - OperationNotSupported = A opera\u00E7\u00E3o \"{0}\" n\u00E3o \u00E9 suportada pelo leitor {1}. - InvalidASCII = O byte \"{0}\" n\u00E3o \u00E9 membro do conjunto de caracteres ASCII (7 bits). + OperationNotSupported = A opera\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada pelo leitor {1}. + InvalidASCII = O byte "{0}" n\u00E3o \u00E9 membro do conjunto de caracteres ASCII (7 bits). CharConversionFailure = Uma entidade destinada a estar em uma determinada codifica\u00E7\u00E3o n\u00E3o deve conter sequ\u00EAncias inv\u00E1lidas na referida codifica\u00E7\u00E3o. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = O caractere XML (Unicode: 0x{0}) n\u00E3o \u00E9 permitido no identificador p\u00FAblico. SpaceRequiredBetweenPublicAndSystem = Espa\u00E7os em branco s\u00E3o necess\u00E1rios entre publicId e systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s \"''. - PEReferenceWithinMarkup = A refer\u00EAncia da entidade do par\u00E2metro \"%{0};\" n\u00E3o pode ocorrer na marca\u00E7\u00E3o no subconjunto interno do DTD. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s "''. + PEReferenceWithinMarkup = A refer\u00EAncia da entidade do par\u00E2metro "%{0};" n\u00E3o pode ocorrer na marca\u00E7\u00E3o no subconjunto interno do DTD. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = As declara\u00E7\u00F5es de marca\u00E7\u00E3o contidas ou apontadas pela declara\u00E7\u00E3o do tipo de documento devem estar corretas. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = Deve ser fornecida a declara\u00E7\u00E3o do atributo para \"xml:space\" como um tipo enumerado, cujo os \u00FAnicos valores poss\u00EDveis s\u00E3o \"default\" e \"preserve\". + MSG_XML_SPACE_DECLARATION_ILLEGAL = Deve ser fornecida a declara\u00E7\u00E3o do atributo para "xml:space" como um tipo enumerado, cujo os \u00FAnicos valores poss\u00EDveis s\u00E3o "default" e "preserve". # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s \"''. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s o tipo de elemento "{0}" na declara\u00E7\u00E3o do tipo de elemento. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = A restri\u00E7\u00E3o \u00E9 necess\u00E1ria ap\u00F3s o tipo de elemento "{0}" na declara\u00E7\u00E3o do tipo de elemento. + ElementDeclUnterminated = A declara\u00E7\u00E3o do tipo de elemento "{0}" deve terminar com ''>''. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere ''('' ou um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento \"{0}\". + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere ''('' ou um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento "{0}". # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u00C9 necess\u00E1rio um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento \"{0}\". - MixedContentUnterminated = O modelo de conte\u00FAdo misto \"{0}\" deve terminar com \")*\" quando os tipos de elementos filhos forem restringidos. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u00C9 necess\u00E1rio um tipo de elemento na declara\u00E7\u00E3o do tipo de elemento "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u00C9 necess\u00E1rio um caractere '')'' na declara\u00E7\u00E3o do tipo de elemento "{0}". + MixedContentUnterminated = O modelo de conte\u00FAdo misto "{0}" deve terminar com ")*" quando os tipos de elementos filhos forem restringidos. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s \"\". - IgnoreSectUnterminated = A se\u00E7\u00E3o condicional exclu\u00EDda deve terminar com \"]]>\". + IncludeSectUnterminated = A se\u00E7\u00E3o condicional inclu\u00EDda deve terminar com "]]>". + IgnoreSectUnterminated = A se\u00E7\u00E3o condicional exclu\u00EDda deve terminar com "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = O nome da entidade deve seguir imediatamente o '%' na refer\u00EAncia da entidade do par\u00E2metro. - SemicolonRequiredInPEReference = A refer\u00EAncia da entidade do par\u00E2metro \"%{0};\" deve terminar com o delimitador '';". + SemicolonRequiredInPEReference = A refer\u00EAncia da entidade do par\u00E2metro "%{0};" deve terminar com o delimitador '';". # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s \"''. - MSG_DUPLICATE_ENTITY_DEFINITION = A entidade \"{0}\" foi declarada mais de uma vez. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre o nome da entidade "{0}" e a defini\u00E7\u00E3o da declara\u00E7\u00E3o da entidade. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u00C9 necess\u00E1rio um espa\u00E7o em branco entre "NDATA" e o nome da nota\u00E7\u00E3o na declara\u00E7\u00E3o da entidade "{0}". + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio antes de "NDATA" na declara\u00E7\u00E3o da entidade "{0}". + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = O nome da nota\u00E7\u00E3o \u00E9 necess\u00E1rio ap\u00F3s "NDATA" na declara\u00E7\u00E3o da entidade "{0}". + EntityDeclUnterminated = A declara\u00E7\u00E3o da entidade "{0}" deve terminar com ''>''. + MSG_DUPLICATE_ENTITY_DEFINITION = A entidade "{0}" foi declarada mais de uma vez. # 4.2.2 External Entities - ExternalIDRequired = A declara\u00E7\u00E3o da entidade externa deve come\u00E7ar com \"SYSTEM\" ou \"PUBLIC\". - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre \"PUBLIC\" e o identificador p\u00FAblico. + ExternalIDRequired = A declara\u00E7\u00E3o da entidade externa deve come\u00E7ar com "SYSTEM" ou "PUBLIC". + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre "PUBLIC" e o identificador p\u00FAblico. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre o identificador p\u00FAblico e o identificador do sistema. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre \"SYSTEM\" e o identificador do sistema. - MSG_URI_FRAGMENT_IN_SYSTEMID = O identificador do fragmento n\u00E3o deve ser especificado como parte do identificador do sistema \"{0}\". + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = O espa\u00E7o em branco \u00E9 necess\u00E1rio entre "SYSTEM" e o identificador do sistema. + MSG_URI_FRAGMENT_IN_SYSTEMID = O identificador do fragmento n\u00E3o deve ser especificado como parte do identificador do sistema "{0}". # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s \"''. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = O espa\u00E7o em branco \u00E9 necess\u00E1rio ap\u00F3s o nome da nota\u00E7\u00E3o "{0}" na declara\u00E7\u00E3o de nota\u00E7\u00E3o. + ExternalIDorPublicIDRequired = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" deve incluir um identificador p\u00FAblico ou do sistema. + NotationDeclUnterminated = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" deve terminar com ''>''. # Validation messages - DuplicateTypeInMixedContent = O tipo de elemento \"{1}\" j\u00E1 foi especificado no modelo de conte\u00FAdo da declara\u00E7\u00E3o do elemento \"{0}\". - ENTITIESInvalid = O valor do atributo \"{1}\" do tipo ENTITIES deve ser o nome de uma ou mais entidades n\u00E3o submetidas a parse. - ENTITYInvalid = O valor do atributo \"{1}\" do tipo ENTITY deve ser o nome de uma entidade n\u00E3o submetida a parse. - IDDefaultTypeInvalid = O atributo do ID \"{0}\" deve ter um default declarado \"#IMPLIED\" ou \"#REQUIRED\". - IDInvalid = O valor do atributo \"{0}\" do ID de tipo deve ser um nome. - IDInvalidWithNamespaces = O valor do atributo \"{0}\" do ID de tipo deve ser um NCName quando os namespaces estiverem ativados. - IDNotUnique = O valor do atributo \"{0}\" do ID de tipo deve ser exclusivo no documento. - IDREFInvalid = O valor do atributo \"{0}\" do IDREF de tipo deve ser um nome. - IDREFInvalidWithNamespaces = O valor do atributo \"{0}\" do IDREF de tipo deve ser um NCName quando os namespaces estiverem ativados. - IDREFSInvalid = O valor do atributo \"{0}\" de tipo IDREFS deve ter um ou mais nomes. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro \"{0}\" deve incluir as declara\u00E7\u00F5es aninhadas corretamente quando a refer\u00EAncia da entidade for usada como uma declara\u00E7\u00E3o completa. - ImproperDeclarationNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro \"{0}\" deve incluir as declara\u00E7\u00F5es aninhadas corretamente. - ImproperGroupNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro \"{0}\" deve incluir pares de par\u00EAnteses aninhados corretamente. - INVALID_PE_IN_CONDITIONAL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro \"{0}\" deve incluir a se\u00E7\u00E3o condicional inteira ou apenas INCLUDE ou IGNORE. - MSG_ATTRIBUTE_NOT_DECLARED = O atributo \"{1}\" deve ser declarado para o tipo de elemento \"{0}\". - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = O atributo \"{0}\" com o valor \"{1}\" deve ter um valor da lista \"{2}\". - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = O valor \"{1}\" do atributo \"{0}\" n\u00E3o deve ser alterado por meio da normaliza\u00E7\u00E3o (para \"{2}\") em um documento stand-alone. - MSG_CONTENT_INCOMPLETE = O conte\u00FAdo do tipo de elemento \"{0}\" est\u00E1 incompleto; ele deve corresponder a \"{1}\". - MSG_CONTENT_INVALID = O conte\u00FAdo do tipo de elemento \"{0}\" deve corresponder a \"{1}\". - MSG_CONTENT_INVALID_SPECIFIED = O conte\u00FAdo do tipo de elemento \"{0}\" deve corresponder a \"{1}\". N\u00E3o s\u00E3o permitidos os filhos do tipo \"{2}\". - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = O atributo \"{1}\" do tipo de elemento \"{0}\" tem um valor default e deve ser especificado em um documento stand-alone. - MSG_DUPLICATE_ATTDEF = O atributo \"{1}\" j\u00E1 foi declarado para o tipo de elemento \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = O tipo de elemento \"{0}\" n\u00E3o deve ser declarado mais de uma vez. - MSG_ELEMENT_NOT_DECLARED = O tipo de elemento \"{0}\" deve ser declarado. + DuplicateTypeInMixedContent = O tipo de elemento "{1}" j\u00E1 foi especificado no modelo de conte\u00FAdo da declara\u00E7\u00E3o do elemento "{0}". + ENTITIESInvalid = O valor do atributo "{1}" do tipo ENTITIES deve ser o nome de uma ou mais entidades n\u00E3o submetidas a parsing. + ENTITYInvalid = O valor do atributo "{1}" do tipo ENTITY deve ser o nome de uma entidade n\u00E3o submetida a parsing. + IDDefaultTypeInvalid = O atributo do ID "{0}" deve ter um default declarado "#IMPLIED" ou "#REQUIRED". + IDInvalid = O valor do atributo "{0}" do ID de tipo deve ser um nome. + IDInvalidWithNamespaces = O valor do atributo "{0}" do ID de tipo deve ser um NCName quando os namespaces estiverem ativados. + IDNotUnique = O valor do atributo "{0}" do ID de tipo deve ser exclusivo no documento. + IDREFInvalid = O valor do atributo "{0}" do IDREF de tipo deve ser um nome. + IDREFInvalidWithNamespaces = O valor do atributo "{0}" do IDREF de tipo deve ser um NCName quando os namespaces estiverem ativados. + IDREFSInvalid = O valor do atributo "{0}" de tipo IDREFS deve ter um ou mais nomes. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir as declara\u00E7\u00F5es aninhadas corretamente quando a refer\u00EAncia da entidade for usada como uma declara\u00E7\u00E3o completa. + ImproperDeclarationNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir as declara\u00E7\u00F5es aninhadas corretamente. + ImproperGroupNesting = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir pares de par\u00EAnteses aninhados corretamente. + INVALID_PE_IN_CONDITIONAL = O texto de substitui\u00E7\u00E3o da entidade do par\u00E2metro "{0}" deve incluir a se\u00E7\u00E3o condicional inteira ou apenas INCLUDE ou IGNORE. + MSG_ATTRIBUTE_NOT_DECLARED = O atributo "{1}" deve ser declarado para o tipo de elemento "{0}". + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = O atributo "{0}" com o valor "{1}" deve ter um valor da lista "{2}". + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = O valor "{1}" do atributo "{0}" n\u00E3o deve ser alterado por meio da normaliza\u00E7\u00E3o (para "{2}") em um documento stand-alone. + MSG_CONTENT_INCOMPLETE = O conte\u00FAdo do tipo de elemento "{0}" est\u00E1 incompleto; ele deve corresponder a "{1}". + MSG_CONTENT_INVALID = O conte\u00FAdo do tipo de elemento "{0}" deve corresponder a "{1}". + MSG_CONTENT_INVALID_SPECIFIED = O conte\u00FAdo do tipo de elemento "{0}" deve corresponder a "{1}". N\u00E3o s\u00E3o permitidos os filhos do tipo "{2}". + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = O atributo "{1}" do tipo de elemento "{0}" tem um valor default e deve ser especificado em um documento stand-alone. + MSG_DUPLICATE_ATTDEF = O atributo "{1}" j\u00E1 foi declarado para o tipo de elemento "{0}". + MSG_ELEMENT_ALREADY_DECLARED = O tipo de elemento "{0}" n\u00E3o deve ser declarado mais de uma vez. + MSG_ELEMENT_NOT_DECLARED = O tipo de elemento "{0}" deve ser declarado. MSG_GRAMMAR_NOT_FOUND = O documento \u00E9 inv\u00E1lido: nenhuma gram\u00E1tica encontrada. - MSG_ELEMENT_WITH_ID_REQUIRED = Um elemento com o identificador \"{0}\" deve aparecer no documento. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = A refer\u00EAncia \u00E0 entidade externa \"{0}\" n\u00E3o \u00E9 permitida em um documento stand-alone. - MSG_FIXED_ATTVALUE_INVALID = O atributo \"{1}\" com o valor \"{2}\" deve ter um valor \"{3}\". - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = O tipo de elemento \"{0}\" j\u00E1 tem o atributo \"{1}\" do ID do tipo; um segundo atributo \"{2}\" do ID de tipo n\u00E3o \u00E9 permitido. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = O tipo de elemento \"{0}\" j\u00E1 tem o atributo \"{1}\" do tipo NOTATION; um segundo atributo \"{2}\" do tipo NOTATION n\u00E3o \u00E9 permitido. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = A nota\u00E7\u00E3o \"{1}\" deve ser declarada quando referenciada na lista de tipos de nota\u00E7\u00E3o do atributo \"{0}\". - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = A nota\u00E7\u00E3o \"{1}\" deve ser declarada quando referenciada na declara\u00E7\u00E3o da entidade n\u00E3o submetida a parse para \"{0}\". - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = A refer\u00EAncia \u00E0 entidade \"{0}\" declarada em uma entidade externa submetida a parse n\u00E3o \u00E9 permitida em um documento stand-alone. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = O atributo \"{1}\" \u00E9 necess\u00E1rio e deve ser especificado para o tipo de elemento \"{0}\". - MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = N\u00E3o deve haver espa\u00E7o em branco entre os elementos declarados em uma entidade externa submetida a parse com o conte\u00FAdo do elemento em um documento stand-alone. - NMTOKENInvalid = O valor do atributo \"{0}\" do tipo NMTOKEN deve ser um token de nome. - NMTOKENSInvalid = O valor do atributo \"{0}\" do tipo NMTOKENS deve ter um ou mais tokens de nome. - NoNotationOnEmptyElement = O tipo de elemento \"{0}\" que foi declarado EMPTY n\u00E3o pode declarar o atributo \"{1}\" do tipo NOTATION. - RootElementTypeMustMatchDoctypedecl = O elemento-raiz do documento \"{1}\" deve corresponder \u00E0 raiz de DOCTYPE \"{0}\". - UndeclaredElementInContentSpec = O modelo do conte\u00FAdo do elemento \"{0}\" refere-se ao elemento n\u00E3o declarado \"{1}\". - UniqueNotationName = A declara\u00E7\u00E3o da nota\u00E7\u00E3o \"{0}\" n\u00E3o \u00E9 exclusiva. Um Nome fornecido n\u00E3o deve ser declarado em mais de uma declara\u00E7\u00E3o de nota\u00E7\u00E3o. + MSG_ELEMENT_WITH_ID_REQUIRED = Um elemento com o identificador "{0}" deve aparecer no documento. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = A refer\u00EAncia \u00E0 entidade externa "{0}" n\u00E3o \u00E9 permitida em um documento stand-alone. + MSG_FIXED_ATTVALUE_INVALID = O atributo "{1}" com o valor "{2}" deve ter um valor "{3}". + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = O tipo de elemento "{0}" j\u00E1 tem o atributo "{1}" do ID do tipo; um segundo atributo "{2}" do ID de tipo n\u00E3o \u00E9 permitido. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = O tipo de elemento "{0}" j\u00E1 tem o atributo "{1}" do tipo NOTATION; um segundo atributo "{2}" do tipo NOTATION n\u00E3o \u00E9 permitido. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = A nota\u00E7\u00E3o "{1}" deve ser declarada quando referenciada na lista de tipos de nota\u00E7\u00E3o do atributo "{0}". + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = A nota\u00E7\u00E3o "{1}" deve ser declarada quando referenciada na declara\u00E7\u00E3o da entidade n\u00E3o submetida a parsing para "{0}". + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = A refer\u00EAncia \u00E0 entidade "{0}" declarada em uma entidade externa submetida a parsing n\u00E3o \u00E9 permitida em um documento stand-alone. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = O atributo "{1}" \u00E9 necess\u00E1rio e deve ser especificado para o tipo de elemento "{0}". + MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = N\u00E3o deve haver espa\u00E7o em branco entre os elementos declarados em uma entidade externa submetida a parsing com o conte\u00FAdo do elemento em um documento stand-alone. + NMTOKENInvalid = O valor do atributo "{0}" do tipo NMTOKEN deve ser um token de nome. + NMTOKENSInvalid = O valor do atributo "{0}" do tipo NMTOKENS deve ter um ou mais tokens de nome. + NoNotationOnEmptyElement = O tipo de elemento "{0}" que foi declarado EMPTY n\u00E3o pode declarar o atributo "{1}" do tipo NOTATION. + RootElementTypeMustMatchDoctypedecl = O elemento-raiz do documento "{1}" deve corresponder \u00E0 raiz de DOCTYPE "{0}". + UndeclaredElementInContentSpec = O modelo do conte\u00FAdo do elemento "{0}" refere-se ao elemento n\u00E3o declarado "{1}". + UniqueNotationName = A declara\u00E7\u00E3o da nota\u00E7\u00E3o "{0}" n\u00E3o \u00E9 exclusiva. Um Nome fornecido n\u00E3o deve ser declarado em mais de uma declara\u00E7\u00E3o de nota\u00E7\u00E3o. ENTITYFailedInitializeGrammar = Validador de ENTITYDatatype: Falha ao chamar o m\u00E9todo de inicializa\u00E7\u00E3o com uma refer\u00EAncia de Gram\u00E1tica v\u00E1lida. \t - ENTITYNotUnparsed = ENTITY \"{0}\" n\u00E3o \u00E9 submetida a parse. - ENTITYNotValid = ENTITY \"{0}\" n\u00E3o \u00E9 v\u00E1lida. + ENTITYNotUnparsed = ENTITY "{0}" n\u00E3o \u00E9 submetida a parsing. + ENTITYNotValid = ENTITY "{0}" n\u00E3o \u00E9 v\u00E1lida. EmptyList = O valor dos tipos ENTITIES, IDREFS e NMTOKENS n\u00E3o pode estar na lista vazia. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = A refer\u00EAncia da entidade externa \"&{0};\" n\u00E3o \u00E9 permitida em um valor do atributo. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = A refer\u00EAncia da entidade externa "&{0};" n\u00E3o \u00E9 permitida em um valor do atributo. + AccessExternalDTD = DTD Externo: falha ao ler o DTD ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. + AccessExternalEntity = Entidade Externa: falha ao ler o documento ''{0}'' externo porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. # 4.1 Character and Entity References - EntityNotDeclared = A entidade \"{0}\" foi referenciada, mas n\u00E3o declarada. - ReferenceToUnparsedEntity = A refer\u00EAncia da entidade n\u00E3o submetida a parse \"&{0};\" n\u00E3o \u00E9 permitida. - RecursiveReference = Refer\u00EAncia da entidade recursiva \"{0}\". (Caminho de refer\u00EAncia: {1}), - RecursiveGeneralReference = Refer\u00EAncia geral da entidade recursiva \"&{0};\". (Caminho de refer\u00EAncia: {1}), - RecursivePEReference = Refer\u00EAncia da entidade do par\u00E2metro recursivo \"%{0};\". (Caminho de refer\u00EAncia: {1}), + EntityNotDeclared = A entidade "{0}" foi referenciada, mas n\u00E3o declarada. + ReferenceToUnparsedEntity = A refer\u00EAncia da entidade n\u00E3o submetida a parsing "&{0};" n\u00E3o \u00E9 permitida. + RecursiveReference = Refer\u00EAncia da entidade recursiva "{0}". (Caminho de refer\u00EAncia: {1}), + RecursiveGeneralReference = Refer\u00EAncia geral da entidade recursiva "&{0};". (Caminho de refer\u00EAncia: {1}), + RecursivePEReference = Refer\u00EAncia da entidade do par\u00E2metro recursivo "%{0};". (Caminho de refer\u00EAncia: {1}), # 4.3.3 Character Encoding in Entities - EncodingNotSupported = A codifica\u00E7\u00E3o \"{0}\" n\u00E3o \u00E9 suportada. - EncodingRequired = Uma entidade submetida a parse n\u00E3o codificada em UTF-8 nem em UTF-16 deve conter uma declara\u00E7\u00E3o de codifica\u00E7\u00E3o. + EncodingNotSupported = A codifica\u00E7\u00E3o "{0}" n\u00E3o \u00E9 suportada. + EncodingRequired = Uma entidade submetida a parsing n\u00E3o codificada em UTF-8 nem em UTF-16 deve conter uma declara\u00E7\u00E3o de codifica\u00E7\u00E3o. # Namespaces support # 4. Using Qualified Names IllegalQName = O elemento ou o atributo n\u00E3o correspondem \u00E0 produ\u00E7\u00E3o QName: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = O elemento \"{0}\" n\u00E3o pode ter \"xmlns\" como seu prefixo. - ElementPrefixUnbound = O prefixo \"{0}\" do elemento \"{1}\" n\u00E3o est\u00E1 vinculado. - AttributePrefixUnbound = O prefixo \"{2}\" do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00E3o est\u00E1 vinculado. - EmptyPrefixedAttName = O valor do atributo \"{0}\" \u00E9 inv\u00E1lido. Associa\u00E7\u00F5es de namespace prefixadas n\u00E3o podem ficar vazias. - PrefixDeclared = O prefixo do namespace \"{0}\" n\u00E3o foi declarado. + ElementXMLNSPrefix = O elemento "{0}" n\u00E3o pode ter "xmlns" como seu prefixo. + ElementPrefixUnbound = O prefixo "{0}" do elemento "{1}" n\u00E3o est\u00E1 vinculado. + AttributePrefixUnbound = O prefixo "{2}" do atributo "{1}" associado a um tipo de elemento "{0}" n\u00E3o est\u00E1 vinculado. + EmptyPrefixedAttName = O valor do atributo "{0}" \u00E9 inv\u00E1lido. Associa\u00E7\u00F5es de namespace prefixadas n\u00E3o podem ficar vazias. + PrefixDeclared = O prefixo do namespace "{0}" n\u00E3o foi declarado. CantBindXMLNS = O prefixo "xmlns" n\u00E3o pode ser vinculado a um namespace explicitamente, assim como o namespace de "xmlns" n\u00E3o pode ser vinculado a um prefixo explicitamente. CantBindXML = O prefixo "xml" n\u00E3o pode ser vinculado a um namespace diferente do namespace comum, assim como o namespace de "xml" n\u00E3o pode ser vinculado a um prefixo diferente de "xml". - MSG_ATT_DEFAULT_INVALID = O defaultValue \"{1}\" do atributo \"{0}\" n\u00E3o \u00E9 v\u00E1lido para as restri\u00E7\u00F5es l\u00E9xicas deste tipo de atributo. + MSG_ATT_DEFAULT_INVALID = O defaultValue "{1}" do atributo "{0}" n\u00E3o \u00E9 v\u00E1lido para as restri\u00E7\u00F5es l\u00E9xicas deste tipo de atributo. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=O parser detectou mais de \"{0}\" expans\u00F5es da entidade neste documento. Este \u00E9 o limite imposto pela aplica\u00E7\u00E3o. +EntityExpansionLimitExceeded=O parser detectou mais de "{0}" expans\u00F5es da entidade neste documento. Este \u00E9 o limite imposto pela aplica\u00E7\u00E3o. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= O elemento \"{0}\" tem mais de \"{1}\" atributos. \"{1}\" \u00E9 o limite imposto pela aplica\u00E7\u00E3o. +ElementAttributeLimit= O elemento "{0}" tem mais de "{1}" atributos. "{1}" \u00E9 o limite imposto pela aplica\u00E7\u00E3o. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties index 8c0bb0f0f8d..4502150a6e4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i dokumentets prolog. InvalidCharInXMLDecl = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i XML-deklarationen. # 2.4 Character Data and Markup - CDEndInContent = Teckensekvensen \"]]>\" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion. + CDEndInContent = Teckensekvensen "]]>" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion. # 2.7 CDATA Sections - CDSectUnterminated = CDATA-sektionen m\u00E5ste sluta med \"]]>\". + CDSectUnterminated = CDATA-sektionen m\u00E5ste sluta med "]]>". # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML-deklarationen f\u00E5r endast f\u00F6rekomma allra \u00F6verst i dokumentet. - EqRequiredInXMLDecl = Tecknet '' = '' m\u00E5ste anges efter \"{0}\" i XML-deklarationen. - QuoteRequiredInXMLDecl = V\u00E4rdet som f\u00F6ljer \"{0}\" i XML-deklarationen m\u00E5ste omges av citattecken. - XMLDeclUnterminated = XML-deklarationen m\u00E5ste avslutas med \"?>\". + EqRequiredInXMLDecl = Tecknet '' = '' m\u00E5ste anges efter "{0}" i XML-deklarationen. + QuoteRequiredInXMLDecl = V\u00E4rdet som f\u00F6ljer "{0}" i XML-deklarationen m\u00E5ste omges av citattecken. + XMLDeclUnterminated = XML-deklarationen m\u00E5ste avslutas med "?>". VersionInfoRequired = Versionen kr\u00E4vs i XML-deklarationen. SpaceRequiredBeforeVersionInXMLDecl = Tomt utrymme kr\u00E4vs f\u00F6re versionens pseudoattribut i XML-deklarationen. SpaceRequiredBeforeEncodingInXMLDecl = Tomt utrymme kr\u00E4vs f\u00F6re kodningens pseudoattribut i XML-deklarationen. @@ -71,70 +68,70 @@ ReferenceIllegalInTrailingMisc=Referensen \u00E4r inte till\u00E5ten i efterf\u00F6ljande avsnitt. # 2.9 Standalone Document Declaration - SDDeclInvalid = Deklarationsv\u00E4rdet f\u00F6r frist\u00E5ende dokument m\u00E5ste vara \"yes\" eller \"no\", inte \"{0}\". + SDDeclInvalid = Deklarationsv\u00E4rdet f\u00F6r frist\u00E5ende dokument m\u00E5ste vara "yes" eller "no", inte "{0}". # 2.12 Language Identification - XMLLangInvalid = Attributv\u00E4rdet \"{0}\" f\u00F6r xml:lang \u00E4r en ogiltig spr\u00E5kidentifierare. + XMLLangInvalid = Attributv\u00E4rdet "{0}" f\u00F6r xml:lang \u00E4r en ogiltig spr\u00E5kidentifierare. # 3. Logical Structures - ETagRequired = Elementtyp \"{0}\" m\u00E5ste avslutas med matchande sluttagg \"\". + ETagRequired = Elementtyp "{0}" m\u00E5ste avslutas med matchande sluttagg "". # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = Elementtyp \"{0}\" m\u00E5ste f\u00F6ljas av n\u00E5gondera av attributspecifikationerna \">\" eller \"/>\". - EqRequiredInAttribute = Attributnamnet \"{1}\" som associeras med elementtyp \"{0}\" m\u00E5ste f\u00F6ljas av likhetstecknet ('' = ''). - OpenQuoteExpected = \u00D6ppningscitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet \"{1}\" som associeras med elementtyp \"{0}\". - CloseQuoteExpected = Slutcitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet \"{1}\" som associeras med elementtyp \"{0}\". - AttributeNotUnique = Attributet \"{1}\" har redan angetts f\u00F6r elementet \"{0}\". - AttributeNSNotUnique = Attributet \"{1}\" bundet till namnrymden \"{2}\" har redan angetts f\u00F6r elementet \"{0}\". - ETagUnterminated = Sluttaggen f\u00F6r elementtyp \"{0}\" m\u00E5ste avslutas med en ''>''-avgr\u00E4nsare. + ElementUnterminated = Elementtyp "{0}" m\u00E5ste f\u00F6ljas av n\u00E5gondera av attributspecifikationerna ">" eller "/>". + EqRequiredInAttribute = Attributnamnet "{1}" som associeras med elementtyp "{0}" m\u00E5ste f\u00F6ljas av likhetstecknet ('' = ''). + OpenQuoteExpected = \u00D6ppningscitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet "{1}" som associeras med elementtyp "{0}". + CloseQuoteExpected = Slutcitattecken f\u00F6rv\u00E4ntas f\u00F6r attributet "{1}" som associeras med elementtyp "{0}". + AttributeNotUnique = Attributet "{1}" har redan angetts f\u00F6r elementet "{0}". + AttributeNSNotUnique = Attributet "{1}" bundet till namnrymden "{2}" har redan angetts f\u00F6r elementet "{0}". + ETagUnterminated = Sluttaggen f\u00F6r elementtyp "{0}" m\u00E5ste avslutas med en ''>''-avgr\u00E4nsare. MarkupNotRecognizedInContent = Elementinneh\u00E5llet m\u00E5ste best\u00E5 av v\u00E4lformulerad(e) teckendata eller kodtext. DoctypeIllegalInContent = DOCTYPE \u00E4r inte till\u00E5tet i inneh\u00E5llet. # 4.1 Character and Entity References ReferenceUnterminated = Referensen m\u00E5ste avslutas med en ';'-avgr\u00E4nsare. # 4.3.2 Well-Formed Parsed Entities ReferenceNotInOneEntity = Referensen m\u00E5ste finnas med inom samma tolkade enhet. - ElementEntityMismatch = Elementet \"{0}\" m\u00E5ste b\u00F6rja och sluta inom samma enhet. + ElementEntityMismatch = Elementet "{0}" m\u00E5ste b\u00F6rja och sluta inom samma enhet. MarkupEntityMismatch=XML-dokumentstrukturer m\u00E5ste b\u00F6rja och sluta inom samma enhet. # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = Ett ogiltigt XML-tecken (Unicode: 0x{2}) hittades i attributv\u00E4rdet \"{1}\" och elementet \u00E4r \"{0}\". + InvalidCharInAttValue = Ett ogiltigt XML-tecken (Unicode: 0x{2}) hittades i attributv\u00E4rdet "{1}" och elementet \u00E4r "{0}". InvalidCharInComment = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i kommentaren. - InvalidCharInPI = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades bearbetningsinstruktionen. + InvalidCharInPI = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i bearbetningsinstruktionen. InvalidCharInInternalSubset = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i den interna delm\u00E4ngden i DTD. InvalidCharInTextDecl = Ett ogiltigt XML-tecken (Unicode: 0x{0}) hittades i textdeklarationen. # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = Attributv\u00E4rdet \"{1}\" m\u00E5ste b\u00F6rja med antingen enkelt eller dubbelt citattecken. - LessthanInAttValue = Attributv\u00E4rdet \"{1}\" som associeras med elementtyp \"{0}\" f\u00E5r inte inneh\u00E5lla n\u00E5got ''<''-tecken. - AttributeValueUnterminated = Attributv\u00E4rdet \"{1}\" m\u00E5ste avslutas med matchande citattecken. + QuoteRequiredInAttValue = Attributv\u00E4rdet "{1}" m\u00E5ste b\u00F6rja med antingen enkelt eller dubbelt citattecken. + LessthanInAttValue = Attributv\u00E4rdet "{1}" som associeras med elementtyp "{0}" f\u00E5r inte inneh\u00E5lla n\u00E5got ''<''-tecken. + AttributeValueUnterminated = Attributv\u00E4rdet "{1}" m\u00E5ste avslutas med matchande citattecken. # 2.5 Comments - InvalidCommentStart = Kommentarer m\u00E5ste inledas med \"\". + InvalidCommentStart = Kommentarer m\u00E5ste inledas med "". COMMENT_NOT_IN_ONE_ENTITY = Kommentaren innesluts inte i samma enhet. # 2.6 Processing Instructions PITargetRequired = Bearbetningsinstruktionen m\u00E5ste b\u00F6rja med m\u00E5lnamnet. SpaceRequiredInPI = Tomt utrymme kr\u00E4vs mellan bearbetningsinstruktionens m\u00E5l och data. - PIUnterminated = Bearbetningsinstruktionen m\u00E5ste avslutas med \"?>\". - ReservedPITarget = Bearbetningsinstruktionens m\u00E5lmatchning \"[xX][mM][lL]\" \u00E4r inte till\u00E5ten. + PIUnterminated = Bearbetningsinstruktionen m\u00E5ste avslutas med "?>". + ReservedPITarget = Bearbetningsinstruktionens m\u00E5lmatchning "[xX][mM][lL]" \u00E4r inte till\u00E5ten. PI_NOT_IN_ONE_ENTITY = Bearbetningsinstruktionen innesluts inte i samma enhet. # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = Ogiltig version \"{0}\". - VersionNotSupported = XML-versionen \"{0}\" st\u00F6ds inte, endast XML 1.0 st\u00F6ds. - VersionNotSupported11 = XML-versionen \"{0}\" st\u00F6ds inte, endast XML 1.0 och XML 1.1 st\u00F6ds. + VersionInfoInvalid = Ogiltig version "{0}". + VersionNotSupported = XML-versionen "{0}" st\u00F6ds inte, endast XML 1.0 st\u00F6ds. + VersionNotSupported11 = XML-versionen "{0}" st\u00F6ds inte, endast XML 1.0 och XML 1.1 st\u00F6ds. VersionMismatch= En enhet kan inte inkludera n\u00E5gon annan enhet som har en senare version. # 4.1 Character and Entity References - DigitRequiredInCharRef = Ett decimalt uttryck m\u00E5ste anges direkt efter \"&#\" i en teckenreferens. - HexdigitRequiredInCharRef = Ett hexadecimalt uttryck m\u00E5ste anges direkt efter \"&#x\" i en teckenreferens. + DigitRequiredInCharRef = Ett decimalt uttryck m\u00E5ste anges direkt efter "&#" i en teckenreferens. + HexdigitRequiredInCharRef = Ett hexadecimalt uttryck m\u00E5ste anges direkt efter "&#x" i en teckenreferens. SemicolonRequiredInCharRef = Teckenreferensen m\u00E5ste avslutas med ';'-avgr\u00E4nsare. - InvalidCharRef = Teckenreferensen \"&#{0}\" \u00E4r ett ogiltigt XML-tecken. + InvalidCharRef = Teckenreferensen "&#{0}" \u00E4r ett ogiltigt XML-tecken. NameRequiredInReference = Enhetsnamnet m\u00E5ste omedelbart f\u00F6ljas av '&' i enhetsreferensen. - SemicolonRequiredInReference = Referensen till enhet \"{0}\" m\u00E5ste avslutas med '';''-avgr\u00E4nsare. + SemicolonRequiredInReference = Referensen till enhet "{0}" m\u00E5ste avslutas med '';''-avgr\u00E4nsare. # 4.3.1 The Text Declaration TextDeclMustBeFirst = Textdeklarationen m\u00E5ste anges direkt i b\u00F6rjan av externt tolkad enhet. - EqRequiredInTextDecl = Ett likhetstecken ('' = '') m\u00E5ste anges efter \"{0}\" i textdeklarationen. - QuoteRequiredInTextDecl = V\u00E4rdet som f\u00F6ljer \"{0}\" i textdeklarationen m\u00E5ste omges av citattecken. - CloseQuoteMissingInTextDecl = avslutande citattecken saknas f\u00F6r v\u00E4rdet efter \"{0}\" i textdeklarationen. + EqRequiredInTextDecl = Ett likhetstecken ('' = '') m\u00E5ste anges efter "{0}" i textdeklarationen. + QuoteRequiredInTextDecl = V\u00E4rdet som f\u00F6ljer "{0}" i textdeklarationen m\u00E5ste omges av citattecken. + CloseQuoteMissingInTextDecl = avslutande citattecken saknas f\u00F6r v\u00E4rdet efter "{0}" i textdeklarationen. SpaceRequiredBeforeVersionInTextDecl = Tomt utrymme kr\u00E4vs f\u00F6re versionens pseudoattribut i textdeklarationen. SpaceRequiredBeforeEncodingInTextDecl = Tomt utrymme kr\u00E4vs f\u00F6re kodningens pseudoattribut i textdeklarationen. - TextDeclUnterminated = Textdeklarationen m\u00E5ste avslutas med \"?>\". + TextDeclUnterminated = Textdeklarationen m\u00E5ste avslutas med "?>". EncodingDeclRequired = Koddeklaration kr\u00E4vs i textdeklarationen. NoMorePseudoAttributes = Inga fler pseudoattribut \u00E4r till\u00E5tna. MorePseudoAttributes = Ytterligare pseudoattribut f\u00F6rv\u00E4ntas. @@ -143,13 +140,13 @@ CommentNotInOneEntity = Kommentaren m\u00E5ste finnas med inom samma tolkade enhet. PINotInOneEntity = Bearbetningsinstruktionen m\u00E5ste finnas med inom samma tolkade enhet. # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = Ogiltigt kodnamn, \"{0}\". - EncodingByteOrderUnsupported = Angiven byteordningsf\u00F6ljd i kodning \"{0}\" st\u00F6ds inte. + EncodingDeclInvalid = Ogiltigt kodnamn, "{0}". + EncodingByteOrderUnsupported = Angiven byteordningsf\u00F6ljd i kodning "{0}" st\u00F6ds inte. InvalidByte = Ogiltig byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte. ExpectedByte = F\u00F6rv\u00E4ntad byte {0} i UTF-8-sekvensen f\u00F6r {1}-byte. InvalidHighSurrogate = H\u00F6ga surrogatbitar i UTF-8-sekvens f\u00E5r inte \u00F6verskrida 0x10, men 0x{0} hittades. - OperationNotSupported = Operation \"{0}\" st\u00F6ds inte i l\u00E4saren {1}. - InvalidASCII = Byte \"{0}\" ing\u00E5r inte i ASCII-teckenupps\u00E4ttningen (7 bitar). + OperationNotSupported = Operation "{0}" st\u00F6ds inte i l\u00E4saren {1}. + InvalidASCII = Byte "{0}" ing\u00E5r inte i ASCII-teckenupps\u00E4ttningen (7 bitar). CharConversionFailure = En enhet som fastst\u00E4lls anv\u00E4nda ett visst kodformat f\u00E5r inte inneh\u00E5lla sekvenser som \u00E4r otill\u00E5tna i kodningen. # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = Tecknet (Unicode: 0x{0}) \u00E4r inte till\u00E5tet i den allm\u00E4nna identifieraren. SpaceRequiredBetweenPublicAndSystem = Tomma utrymmen kr\u00E4vs mellan publicId och systemId. # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Tomt utrymme kr\u00E4vs efter \"''. - PEReferenceWithinMarkup = Parameterreferensen \"%{0};\" f\u00E5r inte f\u00F6rekomma i kodtexten i den interna delm\u00E4ngden i DTD. + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = Tomt utrymme kr\u00E4vs efter "''. + PEReferenceWithinMarkup = Parameterreferensen "%{0};" f\u00E5r inte f\u00F6rekomma i kodtexten i den interna delm\u00E4ngden i DTD. MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = Kodtextdeklarationerna som finns med eller pekas till fr\u00E5n dokumenttypdeklarationen m\u00E5ste vara v\u00E4lformulerade. # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklarationen f\u00F6r \"xml:space\" m\u00E5ste anges som uppr\u00E4kningstyp vars enda m\u00F6jliga v\u00E4rden \u00E4r \"default\" och \"preserve\". + MSG_XML_SPACE_DECLARATION_ILLEGAL = Attributdeklarationen f\u00F6r "xml:space" m\u00E5ste anges som uppr\u00E4kningstyp vars enda m\u00F6jliga v\u00E4rden \u00E4r "default" och "preserve". # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = Tomt utrymme kr\u00E4vs efter \"''. + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = Tomt utrymme kr\u00E4vs efter elementtyp "{0}" i elementtypdeklarationen. + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = Begr\u00E4nsningen kr\u00E4vs efter elementtyp "{0}" i elementtypdeklarationen. + ElementDeclUnterminated = Deklarationen f\u00F6r elementtyp "{0}" m\u00E5ste avslutas med ''>''. # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Tecknet ''('' eller en elementtyp m\u00E5ste anges i deklarationen av elementtyp \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp \"{0}\". + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = Tecknet ''('' eller en elementtyp m\u00E5ste anges i deklarationen av elementtyp "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp "{0}". # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = En elementtyp m\u00E5ste anges i deklarationen av elementtyp \"{0}\". - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp \"{0}\". - MixedContentUnterminated = Modellen med blandat inneh\u00E5ll \"{0}\" m\u00E5ste avslutas med \")*\" om typer av underordnade element \u00E4r begr\u00E4nsade. + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = En elementtyp m\u00E5ste anges i deklarationen av elementtyp "{0}". + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = Tecknet '')'' m\u00E5ste anges i deklarationen av elementtyp "{0}". + MixedContentUnterminated = Modellen med blandat inneh\u00E5ll "{0}" m\u00E5ste avslutas med ")*" om typer av underordnade element \u00E4r begr\u00E4nsade. # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = Tomt utrymme kr\u00E4vs efter \"\". - IgnoreSectUnterminated = Exkluderat villkorsavsnitt m\u00E5ste avslutas med \"]]>\". + IncludeSectUnterminated = Inkluderat villkorsavsnitt m\u00E5ste avslutas med "]]>". + IgnoreSectUnterminated = Exkluderat villkorsavsnitt m\u00E5ste avslutas med "]]>". # 4.1 Character and Entity References NameRequiredInPEReference = Enhetsnamnet m\u00E5ste omedelbart f\u00F6ljas av '%' i parameterreferensen. - SemicolonRequiredInPEReference = Parameterreferensen \"%{0};\" m\u00E5ste avslutas med '';''-avgr\u00E4nsare. + SemicolonRequiredInPEReference = Parameterreferensen "%{0};" m\u00E5ste avslutas med '';''-avgr\u00E4nsare. # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = Tomt utrymme kr\u00E4vs efter \"''. - MSG_DUPLICATE_ENTITY_DEFINITION = Enheten \"{0}\" har deklarerats mer \u00E4n en g\u00E5ng. + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = Tomt utrymme kr\u00E4vs mellan enhetsnamnet "{0}" och definitionen i enhetsdeklarationen. + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = Tomt utrymme kr\u00E4vs mellan "NDATA" och notationsnamnet i deklarationen f\u00F6r enheten "{0}". + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = Tomt utrymme kr\u00E4vs f\u00F6re "NDATA" i deklarationen f\u00F6r enheten "{0}". + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = Notationsnamnet m\u00E5ste anges efter "NDATA" i deklarationen f\u00F6r enheten "{0}". + EntityDeclUnterminated = Deklarationen f\u00F6r enheten "{0}" m\u00E5ste avslutas med ''>''. + MSG_DUPLICATE_ENTITY_DEFINITION = Enheten "{0}" har deklarerats mer \u00E4n en g\u00E5ng. # 4.2.2 External Entities - ExternalIDRequired = Den externa enhetsdeklarationen m\u00E5ste inledas med antingen \"SYSTEM\" eller \"PUBLIC\". - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan \"PUBLIC\" och den allm\u00E4nna identifieraren. + ExternalIDRequired = Den externa enhetsdeklarationen m\u00E5ste inledas med antingen "SYSTEM" eller "PUBLIC". + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan "PUBLIC" och den allm\u00E4nna identifieraren. MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan den allm\u00E4nna identifieraren och systemidentifieraren. - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan \"SYSTEM\" och systemidentifieraren. - MSG_URI_FRAGMENT_IN_SYSTEMID = Fragmentidentifieraren f\u00E5r inte anges som del av systemidentifieraren \"{0}\". + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = Tomt utrymme kr\u00E4vs mellan "SYSTEM" och systemidentifieraren. + MSG_URI_FRAGMENT_IN_SYSTEMID = Fragmentidentifieraren f\u00E5r inte anges som del av systemidentifieraren "{0}". # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = Tomt utrymme kr\u00E4vs efter \"''. + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = Tomt utrymme kr\u00E4vs efter notationsnamnet "{0}" i notationsdeklarationen. + ExternalIDorPublicIDRequired = Deklarationen f\u00F6r notationen "{0}" m\u00E5ste inkludera systemidentifierare eller allm\u00E4n identifierare. + NotationDeclUnterminated = Deklarationen f\u00F6r notationen "{0}" m\u00E5ste avslutas med ''>''. # Validation messages - DuplicateTypeInMixedContent = Elementtyp \"{1}\" har redan angetts i modellen med inneh\u00E5ll f\u00F6r elementdeklarationen \"{0}\". - ENTITIESInvalid = Attributv\u00E4rdet \"{1}\" av typen ENTITIES m\u00E5ste motsvara namnen p\u00E5 en eller flera otolkade enheter. - ENTITYInvalid = Attributv\u00E4rdet \"{1}\" av typen ENTITY m\u00E5ste motsvara namnet p\u00E5 en otolkad enhet. - IDDefaultTypeInvalid = Id-attributet \"{0}\" m\u00E5ste inneh\u00E5lla deklarerat standardv\u00E4rde \"#IMPLIED\" eller \"#REQUIRED\". - IDInvalid = Attributv\u00E4rdet \"{0}\" av typen ID m\u00E5ste vara ett namn. - IDInvalidWithNamespaces = Attributv\u00E4rdet \"{0}\" av typen ID m\u00E5ste vara NCName om namnrymder anv\u00E4nds. - IDNotUnique = Attributv\u00E4rdet \"{0}\" av typen ID m\u00E5ste vara unikt inom dokumentet. - IDREFInvalid = Attributv\u00E4rdet \"{0}\" av typen IDREF m\u00E5ste vara ett namn. - IDREFInvalidWithNamespaces = Attributv\u00E4rdet \"{0}\" av typen IDREF m\u00E5ste vara NCName om namnrymder anv\u00E4nds. - IDREFSInvalid = Attributv\u00E4rdet \"{0}\" av typen IDREFS m\u00E5ste vara ett eller flera namn. - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ers\u00E4ttningstexten f\u00F6r parameterenheten \"{0}\" m\u00E5ste inkludera korrekt kapslade deklarationer om enhetsreferensen anv\u00E4nds som fullst\u00E4ndig deklaration. - ImproperDeclarationNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten \"{0}\" m\u00E5ste inkludera deklarationer som \u00E4r korrekt kapslade. - ImproperGroupNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten \"{0}\" m\u00E5ste inkludera parentespar som \u00E4r korrekt kapslade. - INVALID_PE_IN_CONDITIONAL = Ers\u00E4ttningstexten f\u00F6r parameterenheten \"{0}\" m\u00E5st inkludera hela villkorsavsnittet eller endast INCLUDE eller IGNORE. - MSG_ATTRIBUTE_NOT_DECLARED = Attributet \"{1}\" m\u00E5ste deklareras f\u00F6r elementtyp \"{0}\". - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attributet \"{0}\" med v\u00E4rdet \"{1}\" m\u00E5ste ha ett v\u00E4rde fr\u00E5n listan \"{2}\". - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = V\u00E4rdet \"{1}\" f\u00F6r attributet \"{0}\" f\u00E5r inte \u00E4ndras vid normalisering (till \"{2}\") i ett frist\u00E5ende dokument. - MSG_CONTENT_INCOMPLETE = Inneh\u00E5llet i elementtyp \"{0}\" \u00E4r ofullst\u00E4ndigt, det m\u00E5ste matcha \"{1}\". - MSG_CONTENT_INVALID = Inneh\u00E5llet i elementtyp \"{0}\" m\u00E5ste matcha \"{1}\". - MSG_CONTENT_INVALID_SPECIFIED = Inneh\u00E5llet i elementtyp \"{0}\" m\u00E5ste matcha \"{1}\". Underordnade till typ \"{2}\" \u00E4r inte till\u00E5tna. - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attributet \"{1}\" f\u00F6r elementtyp \"{0}\" har ett standardv\u00E4rde och m\u00E5ste anges i ett frist\u00E5ende dokument. - MSG_DUPLICATE_ATTDEF = Attributet \"{1}\" har redan deklarerats f\u00F6r elementtyp \"{0}\". - MSG_ELEMENT_ALREADY_DECLARED = Elementtyp \"{0}\" f\u00E5r deklareras endast en g\u00E5ng. - MSG_ELEMENT_NOT_DECLARED = Elementtyp \"{0}\" m\u00E5ste deklareras. + DuplicateTypeInMixedContent = Elementtyp "{1}" har redan angetts i modellen med inneh\u00E5ll f\u00F6r elementdeklarationen "{0}". + ENTITIESInvalid = Attributv\u00E4rdet "{1}" av typen ENTITIES m\u00E5ste motsvara namnen p\u00E5 en eller flera otolkade enheter. + ENTITYInvalid = Attributv\u00E4rdet "{1}" av typen ENTITY m\u00E5ste motsvara namnet p\u00E5 en otolkad enhet. + IDDefaultTypeInvalid = Id-attributet "{0}" m\u00E5ste inneh\u00E5lla deklarerat standardv\u00E4rde "#IMPLIED" eller "#REQUIRED". + IDInvalid = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara ett namn. + IDInvalidWithNamespaces = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara NCName om namnrymder anv\u00E4nds. + IDNotUnique = Attributv\u00E4rdet "{0}" av typen ID m\u00E5ste vara unikt inom dokumentet. + IDREFInvalid = Attributv\u00E4rdet "{0}" av typen IDREF m\u00E5ste vara ett namn. + IDREFInvalidWithNamespaces = Attributv\u00E4rdet "{0}" av typen IDREF m\u00E5ste vara NCName om namnrymder anv\u00E4nds. + IDREFSInvalid = Attributv\u00E4rdet "{0}" av typen IDREFS m\u00E5ste vara ett eller flera namn. + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera korrekt kapslade deklarationer om enhetsreferensen anv\u00E4nds som fullst\u00E4ndig deklaration. + ImproperDeclarationNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera deklarationer som \u00E4r korrekt kapslade. + ImproperGroupNesting = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5ste inkludera parentespar som \u00E4r korrekt kapslade. + INVALID_PE_IN_CONDITIONAL = Ers\u00E4ttningstexten f\u00F6r parameterenheten "{0}" m\u00E5st inkludera hela villkorsavsnittet eller endast INCLUDE eller IGNORE. + MSG_ATTRIBUTE_NOT_DECLARED = Attributet "{1}" m\u00E5ste deklareras f\u00F6r elementtyp "{0}". + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = Attributet "{0}" med v\u00E4rdet "{1}" m\u00E5ste ha ett v\u00E4rde fr\u00E5n listan "{2}". + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = V\u00E4rdet "{1}" f\u00F6r attributet "{0}" f\u00E5r inte \u00E4ndras vid normalisering (till "{2}") i ett frist\u00E5ende dokument. + MSG_CONTENT_INCOMPLETE = Inneh\u00E5llet i elementtyp "{0}" \u00E4r ofullst\u00E4ndigt, det m\u00E5ste matcha "{1}". + MSG_CONTENT_INVALID = Inneh\u00E5llet i elementtyp "{0}" m\u00E5ste matcha "{1}". + MSG_CONTENT_INVALID_SPECIFIED = Inneh\u00E5llet i elementtyp "{0}" m\u00E5ste matcha "{1}". Underordnade till typ "{2}" \u00E4r inte till\u00E5tna. + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = Attributet "{1}" f\u00F6r elementtyp "{0}" har ett standardv\u00E4rde och m\u00E5ste anges i ett frist\u00E5ende dokument. + MSG_DUPLICATE_ATTDEF = Attributet "{1}" har redan deklarerats f\u00F6r elementtyp "{0}". + MSG_ELEMENT_ALREADY_DECLARED = Elementtyp "{0}" f\u00E5r deklareras endast en g\u00E5ng. + MSG_ELEMENT_NOT_DECLARED = Elementtyp "{0}" m\u00E5ste deklareras. MSG_GRAMMAR_NOT_FOUND = Dokumentet \u00E4r ogiltigt: hittade ingen grammatik. - MSG_ELEMENT_WITH_ID_REQUIRED = Ett element med identifieraren \"{0}\" m\u00E5ste finnas med i dokumentet. - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referens till den externa enheten \"{0}\" \u00E4r inte till\u00E5tet i frist\u00E5ende dokument. - MSG_FIXED_ATTVALUE_INVALID = Attributet \"{1}\" med v\u00E4rdet \"{2}\" m\u00E5ste ha v\u00E4rdet \"{3}\". - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp \"{0}\" har redan attributet \"{1}\" av id-typ, ett andra attribut \"{2}\" av samma typ \u00E4r inte till\u00E5tet. - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp \"{0}\" har redan attributet \"{1}\" av NOTATION-typ, ett andra attribut \"{2}\" av samma typ \u00E4r inte till\u00E5tet. - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notationen \"{1}\" m\u00E5ste deklareras vid referens i notationstyplistan f\u00F6r attributet \"{0}\". - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notationen \"{1}\" m\u00E5ste deklareras vid referens i otolkad enhetsdeklaration f\u00F6r \"{0}\". - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referensen till enheten \"{0}\" som har deklarerats i en externt tolkad enhet \u00E4r inte till\u00E5tet i frist\u00E5ende dokument. - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attributet \"{1}\" m\u00E5ste anges f\u00F6r elementtyp \"{0}\". + MSG_ELEMENT_WITH_ID_REQUIRED = Ett element med identifieraren "{0}" m\u00E5ste finnas med i dokumentet. + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = Referens till den externa enheten "{0}" \u00E4r inte till\u00E5tet i frist\u00E5ende dokument. + MSG_FIXED_ATTVALUE_INVALID = Attributet "{1}" med v\u00E4rdet "{2}" m\u00E5ste ha v\u00E4rdet "{3}". + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = Elementtyp "{0}" har redan attributet "{1}" av id-typ, ett andra attribut "{2}" av samma typ \u00E4r inte till\u00E5tet. + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = Elementtyp "{0}" har redan attributet "{1}" av NOTATION-typ, ett andra attribut "{2}" av samma typ \u00E4r inte till\u00E5tet. + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = Notationen "{1}" m\u00E5ste deklareras vid referens i notationstyplistan f\u00F6r attributet "{0}". + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = Notationen "{1}" m\u00E5ste deklareras vid referens i otolkad enhetsdeklaration f\u00F6r "{0}". + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = Referensen till enheten "{0}" som har deklarerats i en externt tolkad enhet \u00E4r inte till\u00E5tet i frist\u00E5ende dokument. + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = Attributet "{1}" m\u00E5ste anges f\u00F6r elementtyp "{0}". MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = Tomt utrymme f\u00E5r inte f\u00F6rekomma mellan element som har deklarerats i en externt tolkad enhet med elementinneh\u00E5ll i frist\u00E5ende dokument. - NMTOKENInvalid = Attributv\u00E4rdet \"{0}\" av typen NMTOKEN m\u00E5ste vara ett namntecken. - NMTOKENSInvalid = Attributv\u00E4rdet \"{0}\" av typen NMTOKENS m\u00E5ste vara ett eller flera namntecken. - NoNotationOnEmptyElement = Elementtyp \"{0}\" med deklarationen EMPTY kan inte deklareras med attributet \"{1}\" av typen NOTATION. - RootElementTypeMustMatchDoctypedecl = Dokumentrotelementet \"{1}\" m\u00E5ste matcha DOCTYPE-roten \"{0}\". - UndeclaredElementInContentSpec = Modellen med inneh\u00E5ll f\u00F6r elementet \"{0}\" refererar till elementet \"{1}\" som inte har deklarerats. - UniqueNotationName = Deklarationen f\u00F6r notationen \"{0}\" \u00E4r inte unik. Ett namn f\u00E5r inte deklareras i fler \u00E4n en notationsdeklaration. + NMTOKENInvalid = Attributv\u00E4rdet "{0}" av typen NMTOKEN m\u00E5ste vara ett namntecken. + NMTOKENSInvalid = Attributv\u00E4rdet "{0}" av typen NMTOKENS m\u00E5ste vara ett eller flera namntecken. + NoNotationOnEmptyElement = Elementtyp "{0}" med deklarationen EMPTY kan inte deklareras med attributet "{1}" av typen NOTATION. + RootElementTypeMustMatchDoctypedecl = Dokumentrotelementet "{1}" m\u00E5ste matcha DOCTYPE-roten "{0}". + UndeclaredElementInContentSpec = Modellen med inneh\u00E5ll f\u00F6r elementet "{0}" refererar till elementet "{1}" som inte har deklarerats. + UniqueNotationName = Deklarationen f\u00F6r notationen "{0}" \u00E4r inte unik. Ett namn f\u00E5r inte deklareras i fler \u00E4n en notationsdeklaration. ENTITYFailedInitializeGrammar = ENTITYDatatype-validerare: Behov att anropa initieringsmetod med giltig grammatikreferens utf\u00F6rdes inte. \t - ENTITYNotUnparsed = ENTITY \"{0}\" \u00E4r otolkat. - ENTITYNotValid = ENTITY \"{0}\" \u00E4r inte giltigt. + ENTITYNotUnparsed = ENTITY "{0}" \u00E4r otolkat. + ENTITYNotValid = ENTITY "{0}" \u00E4r inte giltigt. EmptyList = V\u00E4rdet f\u00F6r typ ENTITIES, IDREFS och NMTOKENS f\u00E5r inte vara en tom lista. # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = Den externa enhetsreferensen \"&{0};\" till\u00E5ts inte i ett attributv\u00E4rde. - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = Den externa enhetsreferensen "&{0};" till\u00E5ts inte i ett attributv\u00E4rde. + AccessExternalDTD = Extern DTD: Kunde inte l\u00E4sa extern DTD ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. + AccessExternalEntity = Extern enhet: Kunde inte l\u00E4sa externt dokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. # 4.1 Character and Entity References - EntityNotDeclared = Enheten \"{0}\" har refererats, men \u00E4r inte deklarerad. - ReferenceToUnparsedEntity = Den otolkade enhetsreferensen \"&{0};\" \u00E4r inte till\u00E5ten. - RecursiveReference = Rekursiv enhetsreferens \"{0}\". (Referenss\u00F6kv\u00E4g: {1}), - RecursiveGeneralReference = Rekursiv allm\u00E4n enhetsreferens \"&{0};\". (Referenss\u00F6kv\u00E4g: {1}), - RecursivePEReference = Rekursiv parameterreferens \"%{0};\". (Referenss\u00F6kv\u00E4g: {1}), + EntityNotDeclared = Enheten "{0}" har refererats, men \u00E4r inte deklarerad. + ReferenceToUnparsedEntity = Den otolkade enhetsreferensen "&{0};" \u00E4r inte till\u00E5ten. + RecursiveReference = Rekursiv enhetsreferens "{0}". (Referenss\u00F6kv\u00E4g: {1}), + RecursiveGeneralReference = Rekursiv allm\u00E4n enhetsreferens "&{0};". (Referenss\u00F6kv\u00E4g: {1}), + RecursivePEReference = Rekursiv parameterreferens "%{0};". (Referenss\u00F6kv\u00E4g: {1}), # 4.3.3 Character Encoding in Entities - EncodingNotSupported = Kodningen \"{0}\" st\u00F6ds inte. + EncodingNotSupported = Kodningen "{0}" st\u00F6ds inte. EncodingRequired = En tolkad enhet som inte \u00E4r kodad i varken UTF-8 eller UTF-16 m\u00E5ste ha en kodningsdeklaration. # Namespaces support # 4. Using Qualified Names IllegalQName = Element eller attribut matchar inte QName-produktion: QName::=(NCName':')?NCName. - ElementXMLNSPrefix = Elementet \"{0}\" kan inte anv\u00E4ndas med \"xmlns\" som prefix. - ElementPrefixUnbound = Prefixet \"{0}\" f\u00F6r elementet \"{1}\" \u00E4r inte bundet. - AttributePrefixUnbound = Prefixet \"{2}\" f\u00F6r attributet \"{1}\" som associeras med elementtyp \"{0}\" \u00E4r inte bundet. - EmptyPrefixedAttName = Ogiltigt v\u00E4rde f\u00F6r attributet \"{0}\". Namnrymdsbindningar som prefix kanske inte \u00E4r tomma. - PrefixDeclared = Namnrymdsprefixet \"{0}\" har inte deklarerats. + ElementXMLNSPrefix = Elementet "{0}" kan inte anv\u00E4ndas med "xmlns" som prefix. + ElementPrefixUnbound = Prefixet "{0}" f\u00F6r elementet "{1}" \u00E4r inte bundet. + AttributePrefixUnbound = Prefixet "{2}" f\u00F6r attributet "{1}" som associeras med elementtyp "{0}" \u00E4r inte bundet. + EmptyPrefixedAttName = Ogiltigt v\u00E4rde f\u00F6r attributet "{0}". Namnrymdsbindningar som prefix kanske inte \u00E4r tomma. + PrefixDeclared = Namnrymdsprefixet "{0}" har inte deklarerats. CantBindXMLNS = Prefixet "xmlns" kan inte bindas till en specifik namnrymd och namnrymden f\u00F6r "xmlns" kan inte heller bindas till ett specifikt prefix. CantBindXML = Prefixet "xml" kan inte bindas till en namnrymd ut\u00F6ver den vanliga och namnrymden f\u00F6r "xml" kan inte heller bindas till n\u00E5got annat prefix \u00E4n "xml". - MSG_ATT_DEFAULT_INVALID = defaultValue \"{1}\" f\u00F6r attributet \"{0}\" \u00E4r inte till\u00E5tet vad g\u00E4ller de lexikala begr\u00E4nsningarna f\u00F6r denna attributtyp. + MSG_ATT_DEFAULT_INVALID = defaultValue "{1}" f\u00F6r attributet "{0}" \u00E4r inte till\u00E5tet vad g\u00E4ller de lexikala begr\u00E4nsningarna f\u00F6r denna attributtyp. # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=Parsern har p\u00E5tr\u00E4ffat fler \u00E4n \"{0}\" enhetstill\u00E4gg i dokumentet - applikationens gr\u00E4nsv\u00E4rde har uppn\u00E5tts. +EntityExpansionLimitExceeded=Parsern har p\u00E5tr\u00E4ffat fler \u00E4n "{0}" enhetstill\u00E4gg i dokumentet - applikationens gr\u00E4nsv\u00E4rde har uppn\u00E5tts. # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= Elementet \"{0}\" har fler \u00E4n \"{1}\" attribut, \"{1}\" \u00E4r applikationens gr\u00E4nsv\u00E4rde. +ElementAttributeLimit= Elementet "{0}" har fler \u00E4n "{1}" attribut, "{1}" \u00E4r applikationens gr\u00E4nsv\u00E4rde. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties index 74a7a061c2b..d327fe3f3eb 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = \u5728\u6587\u6863\u524D\u8A00\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 InvalidCharInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 # 2.4 Character Data and Markup - CDEndInContent = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 \"]]>\" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002 + CDEndInContent = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 "]]>" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002 # 2.7 CDATA Sections - CDSectUnterminated = CDATA \u8282\u5FC5\u987B\u4EE5 \"]]>\" \u7ED3\u5C3E\u3002 + CDSectUnterminated = CDATA \u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002 # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML \u58F0\u660E\u53EA\u80FD\u51FA\u73B0\u5728\u6587\u6863\u7684\u6700\u5F00\u5934\u5904\u3002 - EqRequiredInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D, \"{0}\" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002 - QuoteRequiredInXMLDecl = XML \u58F0\u660E\u4E2D \"{0}\" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002 - XMLDeclUnterminated = XML \u58F0\u660E\u5FC5\u987B\u4EE5 \"?>\" \u7ED3\u5C3E\u3002 + EqRequiredInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D, "{0}" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002 + QuoteRequiredInXMLDecl = XML \u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002 + XMLDeclUnterminated = XML \u58F0\u660E\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002 VersionInfoRequired = XML \u58F0\u660E\u4E2D\u9700\u8981\u6B64\u7248\u672C\u3002 SpaceRequiredBeforeVersionInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u7684\u7248\u672C\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002 SpaceRequiredBeforeEncodingInXMLDecl = \u5728 XML \u58F0\u660E\u4E2D\u7684\u7F16\u7801\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002 @@ -71,85 +68,85 @@ ReferenceIllegalInTrailingMisc=\u5C3E\u968F\u8282\u4E2D\u4E0D\u5141\u8BB8\u6709\u5F15\u7528\u3002 # 2.9 Standalone Document Declaration - SDDeclInvalid = \u72EC\u7ACB\u6587\u6863\u58F0\u660E\u503C\u5FC5\u987B\u4E3A \"\u662F\" \u6216 \"\u5426\", \u4E0D\u80FD\u4E3A \"{0}\"\u3002 + SDDeclInvalid = \u72EC\u7ACB\u6587\u6863\u58F0\u660E\u503C\u5FC5\u987B\u4E3A "\u662F" \u6216 "\u5426", \u4E0D\u80FD\u4E3A "{0}"\u3002 # 2.12 Language Identification - XMLLangInvalid = xml:lang \u5C5E\u6027\u503C \"{0}\" \u662F\u65E0\u6548\u7684\u8BED\u8A00\u6807\u8BC6\u7B26\u3002 + XMLLangInvalid = xml:lang \u5C5E\u6027\u503C "{0}" \u662F\u65E0\u6548\u7684\u8BED\u8A00\u6807\u8BC6\u7B26\u3002 # 3. Logical Structures - ETagRequired = \u5143\u7D20\u7C7B\u578B \"{0}\" \u5FC5\u987B\u7531\u5339\u914D\u7684\u7ED3\u675F\u6807\u8BB0 \"\" \u7EC8\u6B62\u3002 + ETagRequired = \u5143\u7D20\u7C7B\u578B "{0}" \u5FC5\u987B\u7531\u5339\u914D\u7684\u7ED3\u675F\u6807\u8BB0 "" \u7EC8\u6B62\u3002 # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = \u5143\u7D20\u7C7B\u578B \"{0}\" \u5FC5\u987B\u540E\u8DDF\u5C5E\u6027\u89C4\u8303 \">\" \u6216 \"/>\"\u3002 - EqRequiredInAttribute = \u4E0E\u5143\u7D20\u7C7B\u578B \"{0}\" \u76F8\u5173\u8054\u7684\u5C5E\u6027\u540D \"{1}\" \u5FC5\u987B\u540E\u8DDF '' = '' \u5B57\u7B26\u3002 - OpenQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B \"{0}\" \u76F8\u5173\u8054\u7684\u5C5E\u6027 \"{1}\" \u5E94\u6709\u5DE6\u5F15\u53F7\u3002 - CloseQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B \"{0}\" \u76F8\u5173\u8054\u7684\u5C5E\u6027 \"{1}\" \u5E94\u6709\u53F3\u5F15\u53F7\u3002 - AttributeNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u5C5E\u6027 \"{1}\"\u3002 - AttributeNSNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7ED1\u5B9A\u5230\u540D\u79F0\u7A7A\u95F4 \"{2}\" \u7684\u5C5E\u6027 \"{1}\"\u3002 - ETagUnterminated = \u5143\u7D20\u7C7B\u578B \"{0}\" \u7684\u7ED3\u675F\u6807\u8BB0\u5FC5\u987B\u4EE5 ''>'' \u5206\u9694\u7B26\u7ED3\u675F\u3002 + ElementUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u5FC5\u987B\u540E\u8DDF\u5C5E\u6027\u89C4\u8303 ">" \u6216 "/>"\u3002 + EqRequiredInAttribute = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027\u540D "{1}" \u5FC5\u987B\u540E\u8DDF '' = '' \u5B57\u7B26\u3002 + OpenQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u5E94\u6709\u5DE6\u5F15\u53F7\u3002 + CloseQuoteExpected = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u5E94\u6709\u53F3\u5F15\u53F7\u3002 + AttributeNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u5C5E\u6027 "{1}"\u3002 + AttributeNSNotUnique = \u5DF2\u7ECF\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7ED1\u5B9A\u5230\u540D\u79F0\u7A7A\u95F4 "{2}" \u7684\u5C5E\u6027 "{1}"\u3002 + ETagUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u7684\u7ED3\u675F\u6807\u8BB0\u5FC5\u987B\u4EE5 ''>'' \u5206\u9694\u7B26\u7ED3\u675F\u3002 MarkupNotRecognizedInContent = \u5143\u7D20\u5185\u5BB9\u5FC5\u987B\u7531\u683C\u5F0F\u6B63\u786E\u7684\u5B57\u7B26\u6570\u636E\u6216\u6807\u8BB0\u7EC4\u6210\u3002 DoctypeIllegalInContent = \u5185\u5BB9\u4E2D\u4E0D\u5141\u8BB8\u6709 DOCTYPE\u3002 # 4.1 Character and Entity References ReferenceUnterminated = \u5F15\u7528\u5FC5\u987B\u4EE5 ';' \u5206\u9694\u7B26\u7EC8\u6B62\u3002 # 4.3.2 Well-Formed Parsed Entities - ReferenceNotInOneEntity = \u5F15\u7528\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u5185\u3002 - ElementEntityMismatch = \u5143\u7D20 \"{0}\" \u5FC5\u987B\u4ECE\u5934\u81F3\u5C3E\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002 + ReferenceNotInOneEntity = \u5F15\u7528\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002 + ElementEntityMismatch = \u5143\u7D20 "{0}" \u5FC5\u987B\u4ECE\u5934\u81F3\u5C3E\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002 MarkupEntityMismatch=XML \u6587\u6863\u7ED3\u6784\u5FC5\u987B\u4ECE\u5934\u81F3\u5C3E\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002 # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = \u5728 \"{1}\" \u5C5E\u6027\u503C\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{2}), \u5E76\u4E14\u5143\u7D20\u4E3A \"{0}\"\u3002 + InvalidCharInAttValue = \u5728 "{1}" \u5C5E\u6027\u503C\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{2}), \u5E76\u4E14\u5143\u7D20\u4E3A "{0}"\u3002 InvalidCharInComment = \u5728\u6CE8\u91CA\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 InvalidCharInPI = \u5728\u5904\u7406\u6307\u4EE4\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 InvalidCharInInternalSubset = \u5728 DTD \u7684\u5185\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 InvalidCharInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u627E\u5230\u65E0\u6548\u7684 XML \u5B57\u7B26 (Unicode: 0x{0})\u3002 # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = \"{1}\" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5355\u5F15\u53F7\u5B57\u7B26\u6216\u53CC\u5F15\u53F7\u5B57\u7B26\u5F00\u5934\u3002 - LessthanInAttValue = \u4E0E\u5143\u7D20\u7C7B\u578B \"{0}\" \u76F8\u5173\u8054\u7684 \"{1}\" \u5C5E\u6027\u503C\u4E0D\u80FD\u5305\u542B ''<'' \u5B57\u7B26\u3002 - AttributeValueUnterminated = \"{1}\" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5339\u914D\u7684\u5F15\u53F7\u5B57\u7B26\u7ED3\u5C3E\u3002 + QuoteRequiredInAttValue = "{1}" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5355\u5F15\u53F7\u5B57\u7B26\u6216\u53CC\u5F15\u53F7\u5B57\u7B26\u5F00\u5934\u3002 + LessthanInAttValue = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684 "{1}" \u5C5E\u6027\u503C\u4E0D\u80FD\u5305\u542B ''<'' \u5B57\u7B26\u3002 + AttributeValueUnterminated = "{1}" \u5C5E\u6027\u503C\u5FC5\u987B\u4EE5\u5339\u914D\u7684\u5F15\u53F7\u5B57\u7B26\u7ED3\u5C3E\u3002 # 2.5 Comments - InvalidCommentStart = \u6CE8\u91CA\u5FC5\u987B\u4EE5 \"\" \u7ED3\u5C3E\u3002 + InvalidCommentStart = \u6CE8\u91CA\u5FC5\u987B\u4EE5 "" \u7ED3\u5C3E\u3002 COMMENT_NOT_IN_ONE_ENTITY = \u6CE8\u91CA\u6CA1\u6709\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002 # 2.6 Processing Instructions PITargetRequired = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u4EE5\u76EE\u6807\u540D\u79F0\u5F00\u5934\u3002 SpaceRequiredInPI = \u5728\u5904\u7406\u6307\u4EE4\u76EE\u6807\u548C\u6570\u636E\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 - PIUnterminated = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u4EE5 \"?>\" \u7ED3\u5C3E\u3002 - ReservedPITarget = \u4E0D\u5141\u8BB8\u6709\u5339\u914D \"[xX][mM][lL]\" \u7684\u5904\u7406\u6307\u4EE4\u76EE\u6807\u3002 + PIUnterminated = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002 + ReservedPITarget = \u4E0D\u5141\u8BB8\u6709\u5339\u914D "[xX][mM][lL]" \u7684\u5904\u7406\u6307\u4EE4\u76EE\u6807\u3002 PI_NOT_IN_ONE_ENTITY = \u5904\u7406\u6307\u4EE4\u6CA1\u6709\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5B9E\u4F53\u5185\u3002 # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = \u7248\u672C \"{0}\" \u65E0\u6548\u3002 - VersionNotSupported = \u4E0D\u652F\u6301 XML \u7248\u672C \"{0}\", \u53EA\u652F\u6301 XML 1.0\u3002 - VersionNotSupported11 = \u4E0D\u652F\u6301 XML \u7248\u672C \"{0}\", \u53EA\u652F\u6301 XML 1.0 \u548C XML 1.1\u3002 + VersionInfoInvalid = \u7248\u672C "{0}" \u65E0\u6548\u3002 + VersionNotSupported = \u4E0D\u652F\u6301 XML \u7248\u672C "{0}", \u53EA\u652F\u6301 XML 1.0\u3002 + VersionNotSupported11 = \u4E0D\u652F\u6301 XML \u7248\u672C "{0}", \u53EA\u652F\u6301 XML 1.0 \u548C XML 1.1\u3002 VersionMismatch= \u5B9E\u4F53\u4E0D\u80FD\u5305\u542B\u8F83\u9AD8\u7248\u672C\u7684\u53E6\u4E00\u4E2A\u5B9E\u4F53\u3002 # 4.1 Character and Entity References - DigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 \"&#\" \u540E\u9762\u3002 - HexdigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u516D\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 \"&#x\" \u540E\u9762\u3002 + DigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 "&#" \u540E\u9762\u3002 + HexdigitRequiredInCharRef = \u5728\u5B57\u7B26\u5F15\u7528\u4E2D, \u5341\u516D\u8FDB\u5236\u8868\u793A\u65B9\u6CD5\u5FC5\u987B\u7D27\u8DDF\u5728 "&#x" \u540E\u9762\u3002 SemicolonRequiredInCharRef = \u5B57\u7B26\u5F15\u7528\u5FC5\u987B\u4EE5 ';' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002 - InvalidCharRef = \u5B57\u7B26\u5F15\u7528 \"&#{0}\" \u662F\u65E0\u6548\u7684 XML \u5B57\u7B26\u3002 + InvalidCharRef = \u5B57\u7B26\u5F15\u7528 "&#{0}" \u662F\u65E0\u6548\u7684 XML \u5B57\u7B26\u3002 NameRequiredInReference = \u5728\u5B9E\u4F53\u5F15\u7528\u4E2D, \u5B9E\u4F53\u540D\u79F0\u5FC5\u987B\u7D27\u8DDF\u5728 '&' \u540E\u9762\u3002 - SemicolonRequiredInReference = \u5BF9\u5B9E\u4F53 \"{0}\" \u7684\u5F15\u7528\u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002 + SemicolonRequiredInReference = \u5BF9\u5B9E\u4F53 "{0}" \u7684\u5F15\u7528\u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002 # 4.3.1 The Text Declaration - TextDeclMustBeFirst = \u6587\u672C\u58F0\u660E\u53EA\u80FD\u51FA\u73B0\u5728\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u7684\u6700\u5F00\u5934\u5904\u3002 - EqRequiredInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D, \"{0}\" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002 - QuoteRequiredInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D \"{0}\" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002 - CloseQuoteMissingInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D \"{0}\" \u540E\u9762\u8DDF\u968F\u7684\u503C\u7F3A\u5C11\u53F3\u5F15\u53F7\u3002 + TextDeclMustBeFirst = \u6587\u672C\u58F0\u660E\u53EA\u80FD\u51FA\u73B0\u5728\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u7684\u6700\u5F00\u5934\u5904\u3002 + EqRequiredInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D, "{0}" \u540E\u9762\u5FC5\u987B\u8DDF\u6709 '' = '' \u5B57\u7B26\u3002 + QuoteRequiredInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u5FC5\u987B\u662F\u7528\u5F15\u53F7\u62EC\u8D77\u6765\u7684\u5B57\u7B26\u4E32\u3002 + CloseQuoteMissingInTextDecl = \u6587\u672C\u58F0\u660E\u4E2D "{0}" \u540E\u9762\u8DDF\u968F\u7684\u503C\u7F3A\u5C11\u53F3\u5F15\u53F7\u3002 SpaceRequiredBeforeVersionInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u7684\u7248\u672C\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002 SpaceRequiredBeforeEncodingInTextDecl = \u5728\u6587\u672C\u58F0\u660E\u4E2D\u7684\u7F16\u7801\u4F2A\u5C5E\u6027\u524D\u9762\u5FC5\u987B\u6709\u7A7A\u683C\u3002 - TextDeclUnterminated = \u6587\u672C\u58F0\u660E\u5FC5\u987B\u4EE5 \"?>\" \u7ED3\u5C3E\u3002 + TextDeclUnterminated = \u6587\u672C\u58F0\u660E\u5FC5\u987B\u4EE5 "?>" \u7ED3\u5C3E\u3002 EncodingDeclRequired = \u6587\u672C\u58F0\u660E\u4E2D\u9700\u8981\u7F16\u7801\u58F0\u660E\u3002 NoMorePseudoAttributes = \u4E0D\u5141\u8BB8\u4F7F\u7528\u66F4\u591A\u7684\u4F2A\u5C5E\u6027\u3002 MorePseudoAttributes = \u5E94\u8BE5\u6709\u66F4\u591A\u7684\u4F2A\u5C5E\u6027\u3002 PseudoAttrNameExpected = \u5E94\u8BE5\u6709\u4F2A\u5C5E\u6027\u540D\u3002 # 4.3.2 Well-Formed Parsed Entities - CommentNotInOneEntity = \u6CE8\u91CA\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u5185\u3002 - PINotInOneEntity = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u5185\u3002 + CommentNotInOneEntity = \u6CE8\u91CA\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002 + PINotInOneEntity = \u5904\u7406\u6307\u4EE4\u5FC5\u987B\u5B8C\u5168\u5305\u542B\u5728\u540C\u4E00\u4E2A\u5DF2\u89E3\u6790\u5B9E\u4F53\u5185\u3002 # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = \u7F16\u7801\u540D\u79F0 \"{0}\" \u65E0\u6548\u3002 - EncodingByteOrderUnsupported = \u4E0D\u652F\u6301\u7F16\u7801 \"{0}\" \u7684\u7ED9\u5B9A\u5B57\u8282\u987A\u5E8F\u3002 + EncodingDeclInvalid = \u7F16\u7801\u540D\u79F0 "{0}" \u65E0\u6548\u3002 + EncodingByteOrderUnsupported = \u4E0D\u652F\u6301\u7F16\u7801 "{0}" \u7684\u7ED9\u5B9A\u5B57\u8282\u987A\u5E8F\u3002 InvalidByte = {1} \u5B57\u8282\u7684 UTF-8 \u5E8F\u5217\u7684\u5B57\u8282 {0} \u65E0\u6548\u3002 ExpectedByte = \u5E94\u4E3A {1} \u5B57\u8282\u7684 UTF-8 \u5E8F\u5217\u7684\u5B57\u8282 {0}\u3002 InvalidHighSurrogate = UTF-8 \u5E8F\u5217\u4E2D\u7684\u9AD8\u4EE3\u7406\u4F4D\u4E0D\u80FD\u8D85\u8FC7 0x10, \u4F46\u627E\u5230 0x{0}\u3002 - OperationNotSupported = {1}\u8BFB\u8FDB\u7A0B\u4E0D\u652F\u6301\u64CD\u4F5C \"{0}\"\u3002 - InvalidASCII = \u5B57\u8282 \"{0}\" \u4E0D\u662F (7 \u4F4D) ASCII \u5B57\u7B26\u96C6\u7684\u6210\u5458\u3002 + OperationNotSupported = {1}\u8BFB\u8FDB\u7A0B\u4E0D\u652F\u6301\u64CD\u4F5C "{0}"\u3002 + InvalidASCII = \u5B57\u8282 "{0}" \u4E0D\u662F (7 \u4F4D) ASCII \u5B57\u7B26\u96C6\u7684\u6210\u5458\u3002 CharConversionFailure = \u786E\u5B9A\u5C5E\u4E8E\u67D0\u4E2A\u7F16\u7801\u7684\u5B9E\u4F53\u4E0D\u80FD\u5305\u542B\u5728\u8BE5\u7F16\u7801\u4E2D\u975E\u6CD5\u7684\u5E8F\u5217\u3002 # DTD Messages @@ -169,150 +166,150 @@ PubidCharIllegal = \u516C\u5171\u6807\u8BC6\u7B26\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u8BE5\u5B57\u7B26 (Unicode: 0x{0})\u3002 SpaceRequiredBetweenPublicAndSystem = \u5728 publicId \u548C systemId \u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u6863\u7C7B\u578B\u58F0\u660E\u4E2D\u7684 \"'' \u7ED3\u5C3E\u3002 - PEReferenceWithinMarkup = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 \"%{0};\" \u4E0D\u80FD\u51FA\u73B0\u5728 DTD \u7684\u5185\u90E8\u5B50\u96C6\u4E2D\u7684\u6807\u8BB0\u5185\u3002 + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u6863\u7C7B\u578B\u58F0\u660E\u4E2D\u7684 "'' \u7ED3\u5C3E\u3002 + PEReferenceWithinMarkup = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};" \u4E0D\u80FD\u51FA\u73B0\u5728 DTD \u7684\u5185\u90E8\u5B50\u96C6\u4E2D\u7684\u6807\u8BB0\u5185\u3002 MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u6587\u6863\u7C7B\u578B\u58F0\u660E\u5305\u542B\u6216\u6307\u5411\u7684\u6807\u8BB0\u58F0\u660E\u5FC5\u987B\u683C\u5F0F\u6B63\u786E\u3002 # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = \"xml:space\" \u7684\u5C5E\u6027\u58F0\u660E\u5FC5\u987B\u6307\u5B9A\u4E3A\u679A\u4E3E\u7C7B\u578B, \u5B83\u7684\u53EF\u80FD\u503C\u53EA\u6709 \"default\" \u548C \"preserve\"\u3002 + MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space" \u7684\u5C5E\u6027\u58F0\u660E\u5FC5\u987B\u6307\u5B9A\u4E3A\u679A\u4E3E\u7C7B\u578B, \u5B83\u7684\u53EF\u80FD\u503C\u53EA\u6709 "default" \u548C "preserve"\u3002 # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684 \"'' \u7ED3\u5C3E\u3002 + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684\u5143\u7D20\u7C7B\u578B "{0}" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002 + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u5728\u5143\u7D20\u7C7B\u578B\u58F0\u660E\u4E2D\u7684\u5143\u7D20\u7C7B\u578B "{0}" \u540E\u9762\u9700\u8981\u6709\u7EA6\u675F\u6761\u4EF6\u3002 + ElementDeclUnterminated = \u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002 # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B \"{0}\" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 ''('' \u5B57\u7B26\u6216\u5143\u7D20\u7C7B\u578B\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B \"{0}\" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002 + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 ''('' \u5B57\u7B26\u6216\u5143\u7D20\u7C7B\u578B\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002 # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5728\u5143\u7D20\u7C7B\u578B \"{0}\" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5143\u7D20\u7C7B\u578B\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5728\u5143\u7D20\u7C7B\u578B \"{0}\" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002 - MixedContentUnterminated = \u5F53\u5B50\u5143\u7D20\u7C7B\u578B\u53D7\u7EA6\u675F\u65F6, \u6DF7\u5408\u5185\u5BB9\u6A21\u578B \"{0}\" \u5FC5\u987B\u4EE5 \")*\" \u7ED3\u5C3E\u3002 + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709\u5143\u7D20\u7C7B\u578B\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5728\u5143\u7D20\u7C7B\u578B "{0}" \u7684\u58F0\u660E\u4E2D\u9700\u8981\u6709 '')''\u3002 + MixedContentUnterminated = \u5F53\u5B50\u5143\u7D20\u7C7B\u578B\u53D7\u7EA6\u675F\u65F6, \u6DF7\u5408\u5185\u5BB9\u6A21\u578B "{0}" \u5FC5\u987B\u4EE5 ")*" \u7ED3\u5C3E\u3002 # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5728\u5C5E\u6027\u5217\u8868\u58F0\u660E\u4E2D\u7684 \"\" \u7ED3\u5C3E\u3002 - IgnoreSectUnterminated = \u6392\u9664\u7684\u6761\u4EF6\u8282\u5FC5\u987B\u4EE5 \"]]>\" \u7ED3\u5C3E\u3002 + IncludeSectUnterminated = \u5305\u542B\u7684\u6761\u4EF6\u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002 + IgnoreSectUnterminated = \u6392\u9664\u7684\u6761\u4EF6\u8282\u5FC5\u987B\u4EE5 "]]>" \u7ED3\u5C3E\u3002 # 4.1 Character and Entity References NameRequiredInPEReference = \u5728\u53C2\u6570\u5B9E\u4F53\u5F15\u7528\u4E2D, \u5B9E\u4F53\u540D\u79F0\u5FC5\u987B\u7D27\u8DDF\u5728 '%' \u540E\u9762\u3002 - SemicolonRequiredInPEReference = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 \"%{0};\" \u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002 + SemicolonRequiredInPEReference = \u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};" \u5FC5\u987B\u4EE5 '';'' \u5206\u9694\u7B26\u7ED3\u5C3E\u3002 # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684 \"'' \u7ED3\u5C3E\u3002 - MSG_DUPLICATE_ENTITY_DEFINITION = \u5B9E\u4F53 \"{0}\" \u58F0\u660E\u4E86\u591A\u6B21\u3002 + MSG_SPACE_REQUIRED_AFTER_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5B9E\u4F53\u58F0\u660E\u4E2D\u7684\u5B9E\u4F53\u540D\u79F0 "{0}" \u548C\u5B9A\u4E49\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 + MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u548C\u8BB0\u53F7\u540D\u79F0\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 + MSG_SPACE_REQUIRED_BEFORE_NDATA_IN_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u524D\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002 + MSG_NOTATION_NAME_REQUIRED_FOR_UNPARSED_ENTITYDECL = \u5728\u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u4E2D\u7684 "NDATA" \u540E\u9762\u9700\u8981\u6709\u8BB0\u53F7\u540D\u79F0\u3002 + EntityDeclUnterminated = \u5B9E\u4F53 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002 + MSG_DUPLICATE_ENTITY_DEFINITION = \u5B9E\u4F53 "{0}" \u58F0\u660E\u4E86\u591A\u6B21\u3002 # 4.2.2 External Entities - ExternalIDRequired = \u5916\u90E8\u5B9E\u4F53\u58F0\u660E\u5FC5\u987B\u4EE5 \"SYSTEM\" \u6216 \"PUBLIC\" \u5F00\u5934\u3002 - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u5728 \"PUBLIC\" \u548C\u516C\u5171\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 + ExternalIDRequired = \u5916\u90E8\u5B9E\u4F53\u58F0\u660E\u5FC5\u987B\u4EE5 "SYSTEM" \u6216 "PUBLIC" \u5F00\u5934\u3002 + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \u5728 "PUBLIC" \u548C\u516C\u5171\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u5728\u516C\u5171\u6807\u8BC6\u7B26\u548C\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u5728 \"SYSTEM\" \u548C\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 - MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5\u6807\u8BC6\u7B26\u4E0D\u80FD\u6307\u5B9A\u4E3A\u7CFB\u7EDF\u6807\u8BC6\u7B26 \"{0}\" \u7684\u4E00\u90E8\u5206\u3002 + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \u5728 "SYSTEM" \u548C\u7CFB\u7EDF\u6807\u8BC6\u7B26\u4E4B\u95F4\u9700\u8981\u6709\u7A7A\u683C\u3002 + MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5\u6807\u8BC6\u7B26\u4E0D\u80FD\u6307\u5B9A\u4E3A\u7CFB\u7EDF\u6807\u8BC6\u7B26 "{0}" \u7684\u4E00\u90E8\u5206\u3002 # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8BB0\u53F7\u58F0\u660E\u4E2D\u7684 \"'' \u7ED3\u5C3E\u3002 + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8BB0\u53F7\u58F0\u660E\u4E2D\u7684\u8BB0\u53F7\u540D\u79F0 "{0}" \u540E\u9762\u9700\u8981\u6709\u7A7A\u683C\u3002 + ExternalIDorPublicIDRequired = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u5305\u542B\u7CFB\u7EDF\u6807\u8BC6\u7B26\u6216\u516C\u5171\u6807\u8BC6\u7B26\u3002 + NotationDeclUnterminated = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u5FC5\u987B\u4EE5 ''>'' \u7ED3\u5C3E\u3002 # Validation messages - DuplicateTypeInMixedContent = \u5728\u5143\u7D20\u58F0\u660E \"{0}\" \u7684\u5185\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7ECF\u6307\u5B9A\u4E86\u5143\u7D20\u7C7B\u578B \"{1}\"\u3002 - ENTITIESInvalid = \u7C7B\u578B\u4E3A ENTITIES \u7684\u5C5E\u6027\u503C \"{1}\" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u7684\u540D\u79F0\u3002 - ENTITYInvalid = \u7C7B\u578B\u4E3A ENTITY \u7684\u5C5E\u6027\u503C \"{1}\" \u5FC5\u987B\u662F\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u7684\u540D\u79F0\u3002 - IDDefaultTypeInvalid = ID \u5C5E\u6027 \"{0}\" \u5FC5\u987B\u5177\u6709\u5DF2\u58F0\u660E\u7684\u9ED8\u8BA4\u503C \"#IMPLIED\" \u6216 \"#REQUIRED\"\u3002 - IDInvalid = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F\u540D\u79F0\u3002 - IDInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F NCName\u3002 - IDNotUnique = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C \"{0}\" \u5728\u6587\u6863\u5185\u5FC5\u987B\u662F\u552F\u4E00\u7684\u3002 - IDREFInvalid = \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F\u540D\u79F0\u3002 - IDREFInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F NCName\u3002 - IDREFSInvalid = \u7C7B\u578B\u4E3A IDREFS \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u3002 - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u5F53\u5B9E\u4F53\u5F15\u7528\u7528\u4F5C\u5B8C\u6574\u58F0\u660E\u65F6, \u53C2\u6570\u5B9E\u4F53 \"{0}\" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002 - ImproperDeclarationNesting = \u53C2\u6570\u5B9E\u4F53 \"{0}\" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002 - ImproperGroupNesting = \u53C2\u6570\u5B9E\u4F53 \"{0}\" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u62EC\u53F7\u5BF9\u3002 - INVALID_PE_IN_CONDITIONAL = \u53C2\u6570\u5B9E\u4F53 \"{0}\" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6574\u4E2A\u6761\u4EF6\u8282, \u6216\u8005\u4EC5\u5305\u542B INCLUDE \u6216 IGNORE\u3002 - MSG_ATTRIBUTE_NOT_DECLARED = \u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B \"{0}\" \u58F0\u660E\u5C5E\u6027 \"{1}\"\u3002 - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u503C\u4E3A \"{1}\" \u7684\u5C5E\u6027 \"{0}\" \u5FC5\u987B\u5177\u6709\u5217\u8868 \"{2}\" \u4E2D\u7684\u503C\u3002 - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D, \u5C5E\u6027 \"{0}\" \u7684\u503C \"{1}\" \u4E0D\u80FD\u901A\u8FC7\u89C4\u8303\u5316\u8FDB\u884C\u66F4\u6539 (\u66F4\u6539\u4E3A \"{2}\")\u3002 - MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u7C7B\u578B\u4E3A \"{0}\" \u7684\u5185\u5BB9\u4E0D\u5B8C\u6574, \u5B83\u5FC5\u987B\u5339\u914D \"{1}\"\u3002 - MSG_CONTENT_INVALID = \u5143\u7D20\u7C7B\u578B\u4E3A \"{0}\" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D \"{1}\"\u3002 - MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A \"{0}\" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D \"{1}\"\u3002\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A \"{2}\" \u7684\u5B50\u7EA7\u3002 - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A \"{0}\" \u7684\u5C5E\u6027 \"{1}\" \u5177\u6709\u9ED8\u8BA4\u503C, \u5E76\u4E14\u5FC5\u987B\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u6307\u5B9A\u3002 - MSG_DUPLICATE_ATTDEF = \u5DF2\u7ECF\u4E3A\u5143\u7D20\u7C7B\u578B \"{0}\" \u58F0\u660E\u5C5E\u6027 \"{1}\"\u3002 - MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u7C7B\u578B \"{0}\" \u4E0D\u80FD\u58F0\u660E\u591A\u6B21\u3002 - MSG_ELEMENT_NOT_DECLARED = \u5FC5\u987B\u58F0\u660E\u5143\u7D20\u7C7B\u578B \"{0}\"\u3002 + DuplicateTypeInMixedContent = \u5728\u5143\u7D20\u58F0\u660E "{0}" \u7684\u5185\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7ECF\u6307\u5B9A\u4E86\u5143\u7D20\u7C7B\u578B "{1}"\u3002 + ENTITIESInvalid = \u7C7B\u578B\u4E3A ENTITIES \u7684\u5C5E\u6027\u503C "{1}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u672A\u89E3\u6790\u5B9E\u4F53\u7684\u540D\u79F0\u3002 + ENTITYInvalid = \u7C7B\u578B\u4E3A ENTITY \u7684\u5C5E\u6027\u503C "{1}" \u5FC5\u987B\u662F\u672A\u89E3\u6790\u5B9E\u4F53\u7684\u540D\u79F0\u3002 + IDDefaultTypeInvalid = ID \u5C5E\u6027 "{0}" \u5FC5\u987B\u5177\u6709\u5DF2\u58F0\u660E\u7684\u9ED8\u8BA4\u503C "#IMPLIED" \u6216 "#REQUIRED"\u3002 + IDInvalid = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u3002 + IDInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F NCName\u3002 + IDNotUnique = \u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027\u503C "{0}" \u5728\u6587\u6863\u5185\u5FC5\u987B\u662F\u552F\u4E00\u7684\u3002 + IDREFInvalid = \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u3002 + IDREFInvalidWithNamespaces = \u542F\u7528\u540D\u79F0\u7A7A\u95F4\u65F6, \u7C7B\u578B\u4E3A IDREF \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F NCName\u3002 + IDREFSInvalid = \u7C7B\u578B\u4E3A IDREFS \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u3002 + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u5F53\u5B9E\u4F53\u5F15\u7528\u7528\u4F5C\u5B8C\u6574\u58F0\u660E\u65F6, \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002 + ImproperDeclarationNesting = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u58F0\u660E\u3002 + ImproperGroupNesting = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6B63\u786E\u5D4C\u5957\u7684\u62EC\u53F7\u5BF9\u3002 + INVALID_PE_IN_CONDITIONAL = \u53C2\u6570\u5B9E\u4F53 "{0}" \u7684\u66FF\u6362\u6587\u672C\u5FC5\u987B\u5305\u542B\u6574\u4E2A\u6761\u4EF6\u8282, \u6216\u8005\u4EC5\u5305\u542B INCLUDE \u6216 IGNORE\u3002 + MSG_ATTRIBUTE_NOT_DECLARED = \u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u58F0\u660E\u5C5E\u6027 "{1}"\u3002 + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u503C\u4E3A "{1}" \u7684\u5C5E\u6027 "{0}" \u5FC5\u987B\u5177\u6709\u5217\u8868 "{2}" \u4E2D\u7684\u503C\u3002 + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D, \u5C5E\u6027 "{0}" \u7684\u503C "{1}" \u4E0D\u80FD\u901A\u8FC7\u89C4\u8303\u5316\u8FDB\u884C\u66F4\u6539 (\u66F4\u6539\u4E3A "{2}")\u3002 + MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u4E0D\u5B8C\u6574, \u5B83\u5FC5\u987B\u5339\u914D "{1}"\u3002 + MSG_CONTENT_INVALID = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D "{1}"\u3002 + MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5185\u5BB9\u5FC5\u987B\u5339\u914D "{1}"\u3002\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A "{2}" \u7684\u5B50\u7EA7\u3002 + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u7C7B\u578B\u4E3A "{0}" \u7684\u5C5E\u6027 "{1}" \u5177\u6709\u9ED8\u8BA4\u503C, \u5E76\u4E14\u5FC5\u987B\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u6307\u5B9A\u3002 + MSG_DUPLICATE_ATTDEF = \u5DF2\u7ECF\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u58F0\u660E\u5C5E\u6027 "{1}"\u3002 + MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u7C7B\u578B "{0}" \u4E0D\u80FD\u58F0\u660E\u591A\u6B21\u3002 + MSG_ELEMENT_NOT_DECLARED = \u5FC5\u987B\u58F0\u660E\u5143\u7D20\u7C7B\u578B "{0}"\u3002 MSG_GRAMMAR_NOT_FOUND = \u6587\u6863\u65E0\u6548: \u627E\u4E0D\u5230\u8BED\u6CD5\u3002 - MSG_ELEMENT_WITH_ID_REQUIRED = \u6587\u6863\u4E2D\u5FC5\u987B\u5305\u542B\u6807\u8BC6\u7B26\u4E3A \"{0}\" \u7684\u5143\u7D20\u3002 - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5916\u90E8\u5B9E\u4F53 \"{0}\"\u3002 - MSG_FIXED_ATTVALUE_INVALID = \u503C\u4E3A \"{2}\" \u7684\u5C5E\u6027 \"{1}\" \u5FC5\u987B\u5177\u6709 \"{3}\" \u7684\u503C\u3002 - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B \"{0}\" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027 \"{1}\", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A ID \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 \"{2}\"\u3002 - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B \"{0}\" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 \"{1}\", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A NOTATION \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 \"{2}\"\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5728\u5C5E\u6027 \"{0}\" \u7684\u8BB0\u53F7\u7C7B\u578B\u5217\u8868\u4E2D\u5F15\u7528\u8BB0\u53F7 \"{1}\" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u5728 \"{0}\" \u7684\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u58F0\u660E\u4E2D\u5F15\u7528\u8BB0\u53F7 \"{1}\" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002 - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5B9E\u4F53 \"{0}\"\u3002 - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u9700\u8981\u5C5E\u6027 \"{1}\", \u5E76\u4E14\u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B \"{0}\" \u6307\u5B9A\u8BE5\u5C5E\u6027\u3002 - MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5BF9\u4E8E\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u5177\u6709\u5143\u7D20\u5185\u5BB9\u7684\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5916\u90E8\u5B9E\u4F53, \u5728\u8BE5\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5143\u7D20\u4E4B\u95F4\u4E0D\u80FD\u51FA\u73B0\u7A7A\u683C\u3002 - NMTOKENInvalid = \u7C7B\u578B\u4E3A NMTOKEN \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F\u540D\u79F0\u6807\u8BB0\u3002 - NMTOKENSInvalid = \u7C7B\u578B\u4E3A NMTOKENS \u7684\u5C5E\u6027\u503C \"{0}\" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u6807\u8BB0\u3002 - NoNotationOnEmptyElement = \u5DF2\u58F0\u660E\u4E3A EMPTY \u7684\u5143\u7D20\u7C7B\u578B \"{0}\" \u4E0D\u80FD\u58F0\u660E\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 \"{1}\"\u3002 - RootElementTypeMustMatchDoctypedecl = \u6587\u6863\u6839\u5143\u7D20 \"{1}\" \u5FC5\u987B\u5339\u914D DOCTYPE \u6839 \"{0}\"\u3002 - UndeclaredElementInContentSpec = \u5143\u7D20 \"{0}\" \u7684\u5185\u5BB9\u6A21\u578B\u5F15\u7528\u672A\u58F0\u660E\u7684\u5143\u7D20 \"{1}\"\u3002 - UniqueNotationName = \u8BB0\u53F7 \"{0}\" \u7684\u58F0\u660E\u4E0D\u662F\u552F\u4E00\u7684\u3002\u4E0D\u80FD\u5728\u591A\u4E2A\u8BB0\u53F7\u58F0\u660E\u4E2D\u58F0\u660E\u6307\u5B9A\u7684\u540D\u79F0\u3002 + MSG_ELEMENT_WITH_ID_REQUIRED = \u6587\u6863\u4E2D\u5FC5\u987B\u5305\u542B\u6807\u8BC6\u7B26\u4E3A "{0}" \u7684\u5143\u7D20\u3002 + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5916\u90E8\u5B9E\u4F53 "{0}"\u3002 + MSG_FIXED_ATTVALUE_INVALID = \u503C\u4E3A "{2}" \u7684\u5C5E\u6027 "{1}" \u5FC5\u987B\u5177\u6709 "{3}" \u7684\u503C\u3002 + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B "{0}" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A ID \u7684\u5C5E\u6027 "{1}", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A ID \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 "{2}"\u3002 + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u7C7B\u578B "{0}" \u5DF2\u7ECF\u5177\u6709\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 "{1}", \u4E0D\u5141\u8BB8\u4F7F\u7528\u7C7B\u578B\u4E3A NOTATION \u7684\u53E6\u4E00\u4E2A\u5C5E\u6027 "{2}"\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u5728\u5C5E\u6027 "{0}" \u7684\u8BB0\u53F7\u7C7B\u578B\u5217\u8868\u4E2D\u5F15\u7528\u8BB0\u53F7 "{1}" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u5728 "{0}" \u7684\u672A\u89E3\u6790\u5B9E\u4F53\u58F0\u660E\u4E2D\u5F15\u7528\u8BB0\u53F7 "{1}" \u65F6, \u5FC5\u987B\u58F0\u660E\u8BE5\u8BB0\u53F7\u3002 + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u4E0D\u5141\u8BB8\u5F15\u7528\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5B9E\u4F53 "{0}"\u3002 + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u9700\u8981\u5C5E\u6027 "{1}", \u5E76\u4E14\u5FC5\u987B\u4E3A\u5143\u7D20\u7C7B\u578B "{0}" \u6307\u5B9A\u8BE5\u5C5E\u6027\u3002 + MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5BF9\u4E8E\u5728\u72EC\u7ACB\u6587\u6863\u4E2D\u5177\u6709\u5143\u7D20\u5185\u5BB9\u7684\u5DF2\u89E3\u6790\u7684\u5916\u90E8\u5B9E\u4F53, \u5728\u8BE5\u5B9E\u4F53\u4E2D\u58F0\u660E\u7684\u5143\u7D20\u4E4B\u95F4\u4E0D\u80FD\u51FA\u73B0\u7A7A\u683C\u3002 + NMTOKENInvalid = \u7C7B\u578B\u4E3A NMTOKEN \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u540D\u79F0\u6807\u8BB0\u3002 + NMTOKENSInvalid = \u7C7B\u578B\u4E3A NMTOKENS \u7684\u5C5E\u6027\u503C "{0}" \u5FC5\u987B\u662F\u4E00\u4E2A\u6216\u591A\u4E2A\u540D\u79F0\u6807\u8BB0\u3002 + NoNotationOnEmptyElement = \u5DF2\u58F0\u660E\u4E3A EMPTY \u7684\u5143\u7D20\u7C7B\u578B "{0}" \u4E0D\u80FD\u58F0\u660E\u7C7B\u578B\u4E3A NOTATION \u7684\u5C5E\u6027 "{1}"\u3002 + RootElementTypeMustMatchDoctypedecl = \u6587\u6863\u6839\u5143\u7D20 "{1}" \u5FC5\u987B\u5339\u914D DOCTYPE \u6839 "{0}"\u3002 + UndeclaredElementInContentSpec = \u5143\u7D20 "{0}" \u7684\u5185\u5BB9\u6A21\u578B\u5F15\u7528\u672A\u58F0\u660E\u7684\u5143\u7D20 "{1}"\u3002 + UniqueNotationName = \u8BB0\u53F7 "{0}" \u7684\u58F0\u660E\u4E0D\u662F\u552F\u4E00\u7684\u3002\u4E0D\u80FD\u5728\u591A\u4E2A\u8BB0\u53F7\u58F0\u660E\u4E2D\u58F0\u660E\u6307\u5B9A\u7684\u540D\u79F0\u3002 ENTITYFailedInitializeGrammar = ENTITYDatatype \u9A8C\u8BC1\u7A0B\u5E8F: \u672A\u80FD\u4F7F\u7528\u6709\u6548\u7684\u8BED\u6CD5\u5F15\u7528\u8C03\u7528\u521D\u59CB\u5316\u65B9\u6CD5\u3002\t - ENTITYNotUnparsed = ENTITY \"{0}\" \u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u3002 - ENTITYNotValid = ENTITY \"{0}\" \u65E0\u6548\u3002 + ENTITYNotUnparsed = ENTITY "{0}" \u4E0D\u662F\u672A\u89E3\u6790\u7684\u3002 + ENTITYNotValid = ENTITY "{0}" \u65E0\u6548\u3002 EmptyList = \u7C7B\u578B\u4E3A ENTITIES, IDREFS \u548C NMTOKENS \u7684\u503C\u4E0D\u80FD\u662F\u7A7A\u5217\u8868\u3002 # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = \u5C5E\u6027\u503C\u4E2D\u4E0D\u5141\u8BB8\u91C7\u7528\u5916\u90E8\u5B9E\u4F53\u5F15\u7528 \"&{0};\"\u3002 - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = \u5C5E\u6027\u503C\u4E2D\u4E0D\u5141\u8BB8\u91C7\u7528\u5916\u90E8\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002 + AccessExternalDTD = \u5916\u90E8 DTD: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8 DTD ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 + AccessExternalEntity = \u5916\u90E8\u5B9E\u4F53: \u65E0\u6CD5\u8BFB\u53D6\u5916\u90E8\u6587\u6863 ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 # 4.1 Character and Entity References - EntityNotDeclared = \u5F15\u7528\u4E86\u5B9E\u4F53 \"{0}\", \u4F46\u672A\u58F0\u660E\u5B83\u3002 - ReferenceToUnparsedEntity = \u4E0D\u5141\u8BB8\u4F7F\u7528\u672A\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u5F15\u7528 \"&{0};\"\u3002 - RecursiveReference = \u9012\u5F52\u5B9E\u4F53\u5F15\u7528 \"{0}\"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), - RecursiveGeneralReference = \u9012\u5F52\u4E00\u822C\u5B9E\u4F53\u5F15\u7528 \"&{0};\"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), - RecursivePEReference = \u9012\u5F52\u53C2\u6570\u5B9E\u4F53\u5F15\u7528 \"%{0};\"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), + EntityNotDeclared = \u5F15\u7528\u4E86\u5B9E\u4F53 "{0}", \u4F46\u672A\u58F0\u660E\u5B83\u3002 + ReferenceToUnparsedEntity = \u4E0D\u5141\u8BB8\u4F7F\u7528\u672A\u89E3\u6790\u7684\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002 + RecursiveReference = \u9012\u5F52\u5B9E\u4F53\u5F15\u7528 "{0}"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), + RecursiveGeneralReference = \u9012\u5F52\u4E00\u822C\u5B9E\u4F53\u5F15\u7528 "&{0};"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), + RecursivePEReference = \u9012\u5F52\u53C2\u6570\u5B9E\u4F53\u5F15\u7528 "%{0};"\u3002(\u5F15\u7528\u8DEF\u5F84: {1}), # 4.3.3 Character Encoding in Entities - EncodingNotSupported = \u4E0D\u652F\u6301\u7F16\u7801 \"{0}\"\u3002 - EncodingRequired = \u5982\u679C\u5DF2\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u7684\u5B9E\u4F53\u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u8FDB\u884C\u7F16\u7801, \u5219\u8BE5\u5B9E\u4F53\u5FC5\u987B\u5305\u542B\u7F16\u7801\u58F0\u660E\u3002 + EncodingNotSupported = \u4E0D\u652F\u6301\u7F16\u7801 "{0}"\u3002 + EncodingRequired = \u5982\u679C\u5DF2\u89E3\u6790\u7684\u5B9E\u4F53\u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u8FDB\u884C\u7F16\u7801, \u5219\u8BE5\u5B9E\u4F53\u5FC5\u987B\u5305\u542B\u7F16\u7801\u58F0\u660E\u3002 # Namespaces support # 4. Using Qualified Names IllegalQName = \u5143\u7D20\u6216\u5C5E\u6027\u4E0D\u5339\u914D QName \u751F\u4EA7: QName::=(NCName':')?NCName\u3002 - ElementXMLNSPrefix = \u5143\u7D20 \"{0}\" \u4E0D\u80FD\u4F7F\u7528 \"xmlns\" \u4F5C\u4E3A\u524D\u7F00\u3002 - ElementPrefixUnbound = \u5143\u7D20 \"{1}\" \u7684\u524D\u7F00 \"{0}\" \u672A\u7ED1\u5B9A\u3002 - AttributePrefixUnbound = \u4E0E\u5143\u7D20\u7C7B\u578B \"{0}\" \u76F8\u5173\u8054\u7684\u5C5E\u6027 \"{1}\" \u7684\u524D\u7F00 \"{2}\" \u672A\u7ED1\u5B9A\u3002 - EmptyPrefixedAttName = \u5C5E\u6027 \"{0}\" \u7684\u503C\u65E0\u6548\u3002\u5E26\u524D\u7F00\u7684\u540D\u79F0\u7A7A\u95F4\u7ED1\u5B9A\u4E0D\u80FD\u4E3A\u7A7A\u3002 - PrefixDeclared = \u672A\u58F0\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 \"{0}\"\u3002 + ElementXMLNSPrefix = \u5143\u7D20 "{0}" \u4E0D\u80FD\u4F7F\u7528 "xmlns" \u4F5C\u4E3A\u524D\u7F00\u3002 + ElementPrefixUnbound = \u5143\u7D20 "{1}" \u7684\u524D\u7F00 "{0}" \u672A\u7ED1\u5B9A\u3002 + AttributePrefixUnbound = \u4E0E\u5143\u7D20\u7C7B\u578B "{0}" \u76F8\u5173\u8054\u7684\u5C5E\u6027 "{1}" \u7684\u524D\u7F00 "{2}" \u672A\u7ED1\u5B9A\u3002 + EmptyPrefixedAttName = \u5C5E\u6027 "{0}" \u7684\u503C\u65E0\u6548\u3002\u5E26\u524D\u7F00\u7684\u540D\u79F0\u7A7A\u95F4\u7ED1\u5B9A\u4E0D\u80FD\u4E3A\u7A7A\u3002 + PrefixDeclared = \u672A\u58F0\u660E\u540D\u79F0\u7A7A\u95F4\u524D\u7F00 "{0}"\u3002 CantBindXMLNS = \u524D\u7F00 "xmlns" \u4E0D\u80FD\u663E\u5F0F\u7ED1\u5B9A\u5230\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4; "xmlns" \u7684\u540D\u79F0\u7A7A\u95F4\u4E5F\u4E0D\u80FD\u663E\u5F0F\u7ED1\u5B9A\u5230\u4EFB\u4F55\u524D\u7F00\u3002 CantBindXML = \u524D\u7F00 "xml" \u4E0D\u80FD\u7ED1\u5B9A\u5230\u9664\u5B83\u7684\u5E38\u7528\u540D\u79F0\u7A7A\u95F4\u5916\u7684\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4; "xml" \u7684\u540D\u79F0\u7A7A\u95F4\u4E5F\u4E0D\u80FD\u7ED1\u5B9A\u5230\u9664 "xml" \u5916\u7684\u4EFB\u4F55\u524D\u7F00\u3002 - MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027 \"{0}\" \u7684 defaultValue \"{1}\" \u975E\u6CD5, \u56E0\u4E3A\u6B64\u5C5E\u6027\u7C7B\u578B\u5177\u6709\u8BCD\u6C47\u7EA6\u675F\u6761\u4EF6\u3002 + MSG_ATT_DEFAULT_INVALID = \u5C5E\u6027 "{0}" \u7684 defaultValue "{1}" \u975E\u6CD5, \u56E0\u4E3A\u6B64\u5C5E\u6027\u7C7B\u578B\u5177\u6709\u8BCD\u6C47\u7EA6\u675F\u6761\u4EF6\u3002 # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=\u8BED\u6CD5\u5206\u6790\u5668\u5728\u6B64\u6587\u6863\u4E2D\u9047\u5230\u591A\u4E2A \"{0}\" \u5B9E\u4F53\u6269\u5C55; \u8FD9\u662F\u5E94\u7528\u7A0B\u5E8F\u65BD\u52A0\u7684\u9650\u5236\u3002 +EntityExpansionLimitExceeded=\u89E3\u6790\u5668\u5728\u6B64\u6587\u6863\u4E2D\u9047\u5230\u591A\u4E2A "{0}" \u5B9E\u4F53\u6269\u5C55; \u8FD9\u662F\u5E94\u7528\u7A0B\u5E8F\u65BD\u52A0\u7684\u9650\u5236\u3002 # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= \u5143\u7D20 \"{0}\" \u5177\u6709\u591A\u4E2A \"{1}\" \u5C5E\u6027, \"{1}\" \u662F\u5E94\u7528\u7A0B\u5E8F\u65BD\u52A0\u7684\u9650\u5236\u3002 +ElementAttributeLimit= \u5143\u7D20 "{0}" \u5177\u6709\u591A\u4E2A "{1}" \u5C5E\u6027, "{1}" \u662F\u5E94\u7528\u7A0B\u5E8F\u65BD\u52A0\u7684\u9650\u5236\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties index 1a953819503..0b2be0cda71 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML # The messages are arranged in key and value tuples in a ListResourceBundle. @@ -48,14 +45,14 @@ InvalidCharInProlog = \u5728\u6587\u4EF6\u5BA3\u544A\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 # 2.4 Character Data and Markup - CDEndInContent = \u5B57\u5143\u9806\u5E8F \"]]>\" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002 + CDEndInContent = \u5B57\u5143\u9806\u5E8F "]]>" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002 # 2.7 CDATA Sections - CDSectUnterminated = CDATA \u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F \"]]>\"\u3002 + CDSectUnterminated = CDATA \u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002 # 2.8 Prolog and Document Type Declaration XMLDeclMustBeFirst = XML \u5BA3\u544A\u50C5\u80FD\u51FA\u73FE\u5728\u6587\u4EF6\u7684\u958B\u982D\u3002 - EqRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 \"{0}\" \u4E4B\u5F8C\u3002 - QuoteRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\"{0}\" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002 - XMLDeclUnterminated = XML \u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F \"?>\"\u3002 + EqRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 "{0}" \u4E4B\u5F8C\u3002 + QuoteRequiredInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C"{0}" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002 + XMLDeclUnterminated = XML \u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002 VersionInfoRequired = XML \u5BA3\u544A\u4E2D\u9700\u8981\u7248\u672C\u3002 SpaceRequiredBeforeVersionInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\u7248\u672C\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002 SpaceRequiredBeforeEncodingInXMLDecl = \u5728 XML \u5BA3\u544A\u4E2D\uFF0C\u7DE8\u78BC\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002 @@ -71,90 +68,90 @@ ReferenceIllegalInTrailingMisc=\u5C3E\u7AEF\u6BB5\u843D\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u3002 # 2.9 Standalone Document Declaration - SDDeclInvalid = \u7368\u7ACB\u6587\u4EF6\u5BA3\u544A\u503C\u5FC5\u9808\u662F \"yes\" \u6216 \"no\"\uFF0C\u800C\u975E \"{0}\"\u3002 + SDDeclInvalid = \u7368\u7ACB\u6587\u4EF6\u5BA3\u544A\u503C\u5FC5\u9808\u662F "yes" \u6216 "no"\uFF0C\u800C\u975E "{0}"\u3002 # 2.12 Language Identification - XMLLangInvalid = xml:lang \u5C6C\u6027\u503C \"{0}\" \u70BA\u7121\u6548\u7684\u8A9E\u8A00 ID\u3002 + XMLLangInvalid = xml:lang \u5C6C\u6027\u503C "{0}" \u70BA\u7121\u6548\u7684\u8A9E\u8A00 ID\u3002 # 3. Logical Structures - ETagRequired = \u5143\u7D20\u985E\u578B \"{0}\" \u5FC5\u9808\u7531\u914D\u5C0D\u7684\u7D50\u675F\u6A19\u8A18 \"\" \u7D42\u6B62\u3002 + ETagRequired = \u5143\u7D20\u985E\u578B "{0}" \u5FC5\u9808\u7531\u914D\u5C0D\u7684\u7D50\u675F\u6A19\u8A18 "" \u7D42\u6B62\u3002 # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ElementUnterminated = \u5143\u7D20\u985E\u578B \"{0}\" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5\u5C6C\u6027\u8A2D\u5B9A \">\" \u6216 \"/>\"\u3002 - EqRequiredInAttribute = \u95DC\u806F\u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5C6C\u6027\u540D\u7A31 \"{1}\" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5 '' = '' \u5B57\u5143\u3002 - OpenQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5C6C\u6027 \"{1}\" \u9810\u671F\u6709\u958B\u982D\u5F15\u865F\u3002 - CloseQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5C6C\u6027 \"{1}\" \u9810\u671F\u6709\u7D50\u675F\u5F15\u865F\u3002 - AttributeNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 \"{0}\" \u6307\u5B9A\u5C6C\u6027 \"{1}\"\u3002 - AttributeNSNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 \"{0}\" \u6307\u5B9A\u9023\u7D50\u547D\u540D\u7A7A\u9593 \"{2}\" \u7684\u5C6C\u6027 \"{1}\"\u3002 - ETagUnterminated = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u7D50\u675F\u6A19\u8A18\u7D50\u5C3E\u5FC5\u9808\u662F ''>'' \u5206\u754C\u5B57\u5143\u3002 + ElementUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5\u5C6C\u6027\u8A2D\u5B9A ">" \u6216 "/>"\u3002 + EqRequiredInAttribute = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027\u540D\u7A31 "{1}" \u4E4B\u5F8C\u5FC5\u9808\u7DCA\u63A5 '' = '' \u5B57\u5143\u3002 + OpenQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u9810\u671F\u6709\u958B\u982D\u5F15\u865F\u3002 + CloseQuoteExpected = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u9810\u671F\u6709\u7D50\u675F\u5F15\u865F\u3002 + AttributeNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 "{0}" \u6307\u5B9A\u5C6C\u6027 "{1}"\u3002 + AttributeNSNotUnique = \u5DF2\u7D93\u70BA\u5143\u7D20 "{0}" \u6307\u5B9A\u9023\u7D50\u547D\u540D\u7A7A\u9593 "{2}" \u7684\u5C6C\u6027 "{1}"\u3002 + ETagUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u7684\u7D50\u675F\u6A19\u8A18\u7D50\u5C3E\u5FC5\u9808\u662F ''>'' \u5206\u754C\u5B57\u5143\u3002 MarkupNotRecognizedInContent = \u5143\u7D20\u7684\u5167\u5BB9\u5FC5\u9808\u7531\u683C\u5F0F\u6B63\u78BA\u7684\u4F4D\u63CF\u8FF0\u8CC7\u6599\u6216\u6A19\u8A18\u6240\u7D44\u6210\u3002 DoctypeIllegalInContent = \u5167\u5BB9\u4E0D\u5141\u8A31 DOCTYPE\u3002 # 4.1 Character and Entity References ReferenceUnterminated = \u53C3\u7167\u5FC5\u9808\u7531 ';' \u5206\u754C\u5B57\u5143\u7D42\u6B62\u3002 # 4.3.2 Well-Formed Parsed Entities - ReferenceNotInOneEntity = \u53C3\u7167\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u500B\u9AD4\u5167\u3002 - ElementEntityMismatch = \u5143\u7D20 \"{0}\" \u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u500B\u9AD4\u5167\u3002 - MarkupEntityMismatch=XML \u6587\u4EF6\u7D50\u69CB\u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u500B\u9AD4\u5167\u3002 + ReferenceNotInOneEntity = \u53C3\u7167\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002 + ElementEntityMismatch = \u5143\u7D20 "{0}" \u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002 + MarkupEntityMismatch=XML \u6587\u4EF6\u7D50\u69CB\u7684\u958B\u982D\u8207\u7D50\u5C3E\u5FC5\u9808\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002 # Messages common to Document and DTD # 2.2 Characters - InvalidCharInAttValue = \u5728\u5C6C\u6027 \"{1}\" \u7684\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{2}) \u4E14\u5143\u7D20\u70BA \"{0}\"\u3002 + InvalidCharInAttValue = \u5728\u5C6C\u6027 "{1}" \u7684\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{2}) \u4E14\u5143\u7D20\u70BA "{0}"\u3002 InvalidCharInComment = \u5728\u8A3B\u89E3\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInPI = \u5728\u8655\u7406\u6307\u793A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInInternalSubset = \u5728 DTD \u5167\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 # 2.3 Common Syntactic Constructs - QuoteRequiredInAttValue = \u5C6C\u6027 \"{1}\" \u7684\u503C\u958B\u982D\u5FC5\u9808\u70BA\u55AE\u5F15\u865F\u6216\u96D9\u5F15\u865F\u5B57\u5143\u3002 - LessthanInAttValue = \u95DC\u806F\u5143\u7D20\u985E\u578B \"{0}\" \u4E4B\u5C6C\u6027 \"{1}\" \u7684\u503C\u4E0D\u53EF\u5305\u542B ''<'' \u5B57\u5143\u3002 - AttributeValueUnterminated = \u5C6C\u6027 \"{1}\" \u7684\u503C\u7D50\u5C3E\u5FC5\u9808\u662F\u914D\u5C0D\u7684\u5F15\u865F\u5B57\u5143\u3002 + QuoteRequiredInAttValue = \u5C6C\u6027 "{1}" \u7684\u503C\u958B\u982D\u5FC5\u9808\u70BA\u55AE\u5F15\u865F\u6216\u96D9\u5F15\u865F\u5B57\u5143\u3002 + LessthanInAttValue = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5C6C\u6027 "{1}" \u7684\u503C\u4E0D\u53EF\u5305\u542B ''<'' \u5B57\u5143\u3002 + AttributeValueUnterminated = \u5C6C\u6027 "{1}" \u7684\u503C\u7D50\u5C3E\u5FC5\u9808\u662F\u914D\u5C0D\u7684\u5F15\u865F\u5B57\u5143\u3002 # 2.5 Comments - InvalidCommentStart = \u8A3B\u89E3\u958B\u982D\u5FC5\u9808\u70BA \"\"\u3002 - COMMENT_NOT_IN_ONE_ENTITY = \u8A3B\u89E3\u672A\u5305\u542B\u5728\u76F8\u540C\u500B\u9AD4\u5167\u3002 + InvalidCommentStart = \u8A3B\u89E3\u958B\u982D\u5FC5\u9808\u70BA ""\u3002 + COMMENT_NOT_IN_ONE_ENTITY = \u8A3B\u89E3\u672A\u5305\u542B\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002 # 2.6 Processing Instructions PITargetRequired = \u8655\u7406\u6307\u793A\u7684\u958B\u982D\u5FC5\u9808\u662F\u76EE\u6A19\u7684\u540D\u7A31\u3002 SpaceRequiredInPI = \u8655\u7406\u6307\u793A\u76EE\u6A19\u8207\u8CC7\u6599\u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 - PIUnterminated = \u8655\u7406\u6307\u793A\u7D50\u5C3E\u5FC5\u9808\u662F \"?>\"\u3002 - ReservedPITarget = \u4E0D\u5141\u8A31\u7B26\u5408 \"[xX][mM][lL]\" \u7684\u8655\u7406\u6307\u793A\u76EE\u6A19\u3002 - PI_NOT_IN_ONE_ENTITY = \u8655\u7406\u6307\u793A\u672A\u5305\u542B\u5728\u76F8\u540C\u500B\u9AD4\u5167\u3002 + PIUnterminated = \u8655\u7406\u6307\u793A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002 + ReservedPITarget = \u4E0D\u5141\u8A31\u7B26\u5408 "[xX][mM][lL]" \u7684\u8655\u7406\u6307\u793A\u76EE\u6A19\u3002 + PI_NOT_IN_ONE_ENTITY = \u8655\u7406\u6307\u793A\u672A\u5305\u542B\u5728\u76F8\u540C\u5BE6\u9AD4\u5167\u3002 # 2.8 Prolog and Document Type Declaration - VersionInfoInvalid = \u7121\u6548\u7684\u7248\u672C \"{0}\"\u3002 - VersionNotSupported = \u4E0D\u652F\u63F4 XML \u7248\u672C \"{0}\"\uFF0C\u50C5\u652F\u63F4 XML 1.0\u3002 - VersionNotSupported11 = \u4E0D\u652F\u63F4 XML \u7248\u672C \"{0}\"\uFF0C\u50C5\u652F\u63F4 XML 1.0 \u8207 XML 1.1\u3002 - VersionMismatch= \u500B\u9AD4\u4E0D\u53EF\u5305\u542B\u8F03\u65B0\u7248\u672C\u7684\u5176\u4ED6\u500B\u9AD4\u3002 + VersionInfoInvalid = \u7121\u6548\u7684\u7248\u672C "{0}"\u3002 + VersionNotSupported = \u4E0D\u652F\u63F4 XML \u7248\u672C "{0}"\uFF0C\u50C5\u652F\u63F4 XML 1.0\u3002 + VersionNotSupported11 = \u4E0D\u652F\u63F4 XML \u7248\u672C "{0}"\uFF0C\u50C5\u652F\u63F4 XML 1.0 \u8207 XML 1.1\u3002 + VersionMismatch= \u5BE6\u9AD4\u4E0D\u53EF\u5305\u542B\u8F03\u65B0\u7248\u672C\u7684\u5176\u4ED6\u5BE6\u9AD4\u3002 # 4.1 Character and Entity References - DigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 \"&#\" \u4E4B\u5F8C\u3002 - HexdigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u516D\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 \"&#x\" \u4E4B\u5F8C\u3002 + DigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 "&#" \u4E4B\u5F8C\u3002 + HexdigitRequiredInCharRef = \u5728\u5B57\u5143\u53C3\u7167\u4E2D\uFF0C\u5341\u516D\u9032\u4F4D\u8868\u793A\u6CD5\u5FC5\u9808\u7DCA\u63A5\u5728 "&#x" \u4E4B\u5F8C\u3002 SemicolonRequiredInCharRef = \u5B57\u5143\u53C3\u7167\u7684\u7D50\u5C3E\u5FC5\u9808\u662F ';' \u5206\u754C\u5B57\u5143\u3002 - InvalidCharRef = \u5B57\u5143\u53C3\u7167 \"&#{0}\" \u70BA\u7121\u6548\u7684 XML \u5B57\u5143\u3002 - NameRequiredInReference = \u5728\u500B\u9AD4\u53C3\u7167\u4E2D\uFF0C\u500B\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '&' \u4E4B\u5F8C\u3002 - SemicolonRequiredInReference = \u500B\u9AD4 \"{0}\" \u7684\u53C3\u7167\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002 + InvalidCharRef = \u5B57\u5143\u53C3\u7167 "&#{0}" \u70BA\u7121\u6548\u7684 XML \u5B57\u5143\u3002 + NameRequiredInReference = \u5728\u5BE6\u9AD4\u53C3\u7167\u4E2D\uFF0C\u5BE6\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '&' \u4E4B\u5F8C\u3002 + SemicolonRequiredInReference = \u5BE6\u9AD4 "{0}" \u7684\u53C3\u7167\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002 # 4.3.1 The Text Declaration - TextDeclMustBeFirst = \u6587\u5B57\u5BA3\u544A\u50C5\u80FD\u51FA\u73FE\u5728\u5916\u90E8\u5256\u6790\u500B\u9AD4\u7684\u958B\u982D\u3002 - EqRequiredInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 \"{0}\" \u4E4B\u5F8C\u3002 - QuoteRequiredInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D \"{0}\" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002 - CloseQuoteMissingInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u907A\u6F0F \"{0}\" \u4E4B\u5F8C\u7684\u503C\u7684\u7D50\u675F\u5F15\u865F\u3002 + TextDeclMustBeFirst = \u6587\u5B57\u5BA3\u544A\u50C5\u80FD\u51FA\u73FE\u5728\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u7684\u958B\u982D\u3002 + EqRequiredInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C'' = '' \u5B57\u5143\u5FC5\u9808\u7DCA\u63A5\u5728 "{0}" \u4E4B\u5F8C\u3002 + QuoteRequiredInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D "{0}" \u4E4B\u5F8C\u7684\u503C\u5FC5\u9808\u662F\u4EE5\u5F15\u865F\u62EC\u4F4F\u7684\u5B57\u4E32\u3002 + CloseQuoteMissingInTextDecl = \u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u907A\u6F0F "{0}" \u4E4B\u5F8C\u7684\u503C\u7684\u7D50\u675F\u5F15\u865F\u3002 SpaceRequiredBeforeVersionInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u7248\u672C\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002 SpaceRequiredBeforeEncodingInTextDecl = \u5728\u6587\u5B57\u5BA3\u544A\u4E2D\uFF0C\u7DE8\u78BC\u865B\u64EC\u5C6C\u6027\u4E4B\u524D\u9700\u8981\u6709\u7A7A\u683C\u3002 - TextDeclUnterminated = \u6587\u5B57\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F \"?>\"\u3002 + TextDeclUnterminated = \u6587\u5B57\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u662F "?>"\u3002 EncodingDeclRequired = \u6587\u5B57\u5BA3\u544A\u4E2D\u9700\u8981\u7DE8\u78BC\u5BA3\u544A\u3002 NoMorePseudoAttributes = \u4E0D\u5141\u8A31\u66F4\u591A\u7684\u865B\u64EC\u5C6C\u6027\u3002 MorePseudoAttributes = \u9810\u671F\u66F4\u591A\u7684\u865B\u64EC\u5C6C\u6027\u3002 PseudoAttrNameExpected = \u9810\u671F\u4E00\u500B\u865B\u64EC\u5C6C\u6027\u540D\u7A31\u3002 # 4.3.2 Well-Formed Parsed Entities - CommentNotInOneEntity = \u8A3B\u89E3\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u500B\u9AD4\u5167\u3002 - PINotInOneEntity = \u8655\u7406\u6307\u793A\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u500B\u9AD4\u5167\u3002 + CommentNotInOneEntity = \u8A3B\u89E3\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002 + PINotInOneEntity = \u8655\u7406\u6307\u793A\u5FC5\u9808\u6574\u500B\u5305\u542B\u5728\u76F8\u540C\u7684\u5256\u6790\u5BE6\u9AD4\u5167\u3002 # 4.3.3 Character Encoding in Entities - EncodingDeclInvalid = \u7121\u6548\u7684\u7DE8\u78BC\u540D\u7A31 \"{0}\"\u3002 - EncodingByteOrderUnsupported = \u4E0D\u652F\u63F4\u7DE8\u78BC \"{0}\" \u7684\u6307\u5B9A\u4F4D\u5143\u7D44\u9806\u5E8F\u3002 + EncodingDeclInvalid = \u7121\u6548\u7684\u7DE8\u78BC\u540D\u7A31 "{0}"\u3002 + EncodingByteOrderUnsupported = \u4E0D\u652F\u63F4\u7DE8\u78BC "{0}" \u7684\u6307\u5B9A\u4F4D\u5143\u7D44\u9806\u5E8F\u3002 InvalidByte = {1}-byte UTF-8 \u5E8F\u5217\u7684\u7121\u6548\u4F4D\u5143\u7D44 {0}\u3002 ExpectedByte = {1}-byte UTF-8 \u5E8F\u5217\u9810\u671F\u7684\u4F4D\u5143\u7D44 {0}\u3002 InvalidHighSurrogate = UTF-8 \u5E8F\u5217\u4E2D\u9AD8\u66FF\u4EE3\u4F4D\u5143\u4E0D\u53EF\u8D85\u904E 0x10\uFF0C\u4F46\u627E\u5230 0x{0}\u3002 - OperationNotSupported = {1} \u8B80\u53D6\u5668\u4E0D\u652F\u63F4\u4F5C\u696D \"{0}\"\u3002 - InvalidASCII = \u7D44\u5143\u7D44 \"{0}\" \u4E0D\u662F (7 \u4F4D\u5143) ASCII \u5B57\u5143\u96C6\u7684\u6210\u54E1\u3002 - CharConversionFailure = \u6C7A\u5B9A\u4F7F\u7528\u7279\u5B9A\u7DE8\u78BC\u7684\u500B\u9AD4\uFF0C\u5728\u8A72\u7DE8\u78BC\u4E2D\u4E0D\u53EF\u5305\u542B\u7121\u6548\u7684\u5E8F\u5217\u3002 + OperationNotSupported = {1} \u8B80\u53D6\u5668\u4E0D\u652F\u63F4\u4F5C\u696D "{0}"\u3002 + InvalidASCII = \u7D44\u5143\u7D44 "{0}" \u4E0D\u662F (7 \u4F4D\u5143) ASCII \u5B57\u5143\u96C6\u7684\u6210\u54E1\u3002 + CharConversionFailure = \u6C7A\u5B9A\u4F7F\u7528\u7279\u5B9A\u7DE8\u78BC\u7684\u5BE6\u9AD4\uFF0C\u5728\u8A72\u7DE8\u78BC\u4E2D\u4E0D\u53EF\u5305\u542B\u7121\u6548\u7684\u5E8F\u5217\u3002 # DTD Messages # 2.2 Characters - InvalidCharInEntityValue = \u5728\u6587\u5B57\u500B\u9AD4\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 + InvalidCharInEntityValue = \u5728\u6587\u5B57\u5BE6\u9AD4\u503C\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInExternalSubset = \u5728 DTD \u5916\u90E8\u5B50\u96C6\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInIgnoreSect = \u5728\u6392\u9664\u7684\u689D\u4EF6\u6027\u6BB5\u843D\u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 InvalidCharInPublicID = \u5728\u516C\u7528 ID \u4E2D\u627E\u5230\u7121\u6548\u7684 XML \u5B57\u5143 (Unicode: 0x{0})\u3002 @@ -169,150 +166,150 @@ PubidCharIllegal = \u516C\u7528 ID \u4E2D\u4E0D\u5141\u8A31\u5B57\u5143 (Unicode: 0x{0})\u3002 SpaceRequiredBetweenPublicAndSystem = publicId \u8207 systemId \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 # 2.8 Prolog and Document Type Declaration - MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u4E2D \"''\u3002 - PEReferenceWithinMarkup = DTD \u5167\u90E8\u5B57\u96C6\u7684\u6A19\u8A18\u5167\u4E0D\u80FD\u51FA\u73FE\u53C3\u6578\u500B\u9AD4\u53C3\u7167 \"%{0};\"\u3002 + MSG_SPACE_REQUIRED_BEFORE_ROOT_ELEMENT_TYPE_IN_DOCTYPEDECL = \u5728\u6587\u4EF6\u985E\u578B\u5BA3\u544A\u4E2D "''\u3002 + PEReferenceWithinMarkup = DTD \u5167\u90E8\u5B57\u96C6\u7684\u6A19\u8A18\u5167\u4E0D\u80FD\u51FA\u73FE\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};"\u3002 MSG_MARKUP_NOT_RECOGNIZED_IN_DTD = \u6587\u4EF6\u985E\u578B\u5BA3\u544A\u5305\u542B\u6216\u6307\u5411\u7684\u6A19\u8A18\u5BA3\u544A\u5FC5\u9808\u683C\u5F0F\u6B63\u78BA\u3002 # 2.10 White Space Handling - MSG_XML_SPACE_DECLARATION_ILLEGAL = \"xml:space\" \u7684\u5C6C\u6027\u5BA3\u544A\u5FC5\u9808\u6307\u5B9A\u70BA\u5217\u8209\u985E\u578B\uFF0C\u5176\u53EF\u80FD\u7684\u503C\u70BA \"default\" \u8207 \"preserve\"\u3002 + MSG_XML_SPACE_DECLARATION_ILLEGAL = "xml:space" \u7684\u5C6C\u6027\u5BA3\u544A\u5FC5\u9808\u6307\u5B9A\u70BA\u5217\u8209\u985E\u578B\uFF0C\u5176\u53EF\u80FD\u7684\u503C\u70BA "default" \u8207 "preserve"\u3002 # 3.2 Element Type Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D \"''\u3002 + MSG_SPACE_REQUIRED_BEFORE_CONTENTSPEC_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002 + MSG_CONTENTSPEC_REQUIRED_IN_ELEMENTDECL = \u5728\u5143\u7D20\u985E\u578B\u5BA3\u544A\u4E2D\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5F8C\u9700\u8981\u9650\u5236\u689D\u4EF6\u3002 + ElementDeclUnterminated = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002 # 3.2.1 Element Content - MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B ''('' \u5B57\u5143\u6216\u5143\u7D20\u985E\u578B\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002 + MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B ''('' \u5B57\u5143\u6216\u5143\u7D20\u985E\u578B\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002 # 3.2.2 Mixed Content - MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B\u5143\u7D20\u985E\u578B\u3002 - MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002 - MixedContentUnterminated = \u5B50\u9805\u5143\u7D20\u7684\u985E\u578B\u53D7\u5230\u9650\u5236\u6642\uFF0C\u6DF7\u5408\u5167\u5BB9\u6A21\u578B \"{0}\" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA \")*\"\u3002 + MSG_ELEMENT_TYPE_REQUIRED_IN_MIXED_CONTENT = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B\u5143\u7D20\u985E\u578B\u3002 + MSG_CLOSE_PAREN_REQUIRED_IN_MIXED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5BA3\u544A\u4E2D\u9700\u8981\u4E00\u500B '')''\u3002 + MixedContentUnterminated = \u5B50\u9805\u5143\u7D20\u7684\u985E\u578B\u53D7\u5230\u9650\u5236\u6642\uFF0C\u6DF7\u5408\u5167\u5BB9\u6A21\u578B "{0}" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA ")*"\u3002 # 3.3 Attribute-List Declarations - MSG_SPACE_REQUIRED_BEFORE_ELEMENT_TYPE_IN_ATTLISTDECL = \u5728 attribute-list \u5BA3\u544A\u4E2D \"\"\u3002 - IgnoreSectUnterminated = \u6392\u9664\u689D\u4EF6\u6027\u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F \"]]>\"\u3002 + IncludeSectUnterminated = \u5305\u542B\u689D\u4EF6\u6027\u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002 + IgnoreSectUnterminated = \u6392\u9664\u689D\u4EF6\u6027\u6BB5\u843D\u7D50\u5C3E\u5FC5\u9808\u662F "]]>"\u3002 # 4.1 Character and Entity References - NameRequiredInPEReference = \u5728\u53C3\u6578\u500B\u9AD4\u53C3\u7167\u4E2D\uFF0C\u500B\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '%' \u4E4B\u5F8C\u3002 - SemicolonRequiredInPEReference = \u53C3\u6578\u500B\u9AD4\u53C3\u7167 \"%{0};\" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002 + NameRequiredInPEReference = \u5728\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167\u4E2D\uFF0C\u5BE6\u9AD4\u540D\u7A31\u5FC5\u9808\u7DCA\u63A5\u5728 '%' \u4E4B\u5F8C\u3002 + SemicolonRequiredInPEReference = \u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};" \u7684\u7D50\u5C3E\u5FC5\u9808\u70BA '';'' \u5206\u754C\u5B57\u5143\u3002 # 4.2 Entity Declarations - MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u5728\u500B\u9AD4\u5BA3\u544A\u4E2D \"''\u3002 - MSG_DUPLICATE_ENTITY_DEFINITION = \u500B\u9AD4 \"{0}\" \u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002 + MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL = \u5728\u5BE6\u9AD4\u5BA3\u544A\u4E2D "''\u3002 + MSG_DUPLICATE_ENTITY_DEFINITION = \u5BE6\u9AD4 "{0}" \u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002 # 4.2.2 External Entities - ExternalIDRequired = \u5916\u90E8\u500B\u9AD4\u5BA3\u544A\u7684\u958B\u982D\u5FC5\u9808\u70BA \"SYSTEM\" \u6216 \"PUBLIC\"\u3002 - MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = \"PUBLIC\" \u8207\u516C\u7528 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 + ExternalIDRequired = \u5916\u90E8\u5BE6\u9AD4\u5BA3\u544A\u7684\u958B\u982D\u5FC5\u9808\u70BA "SYSTEM" \u6216 "PUBLIC"\u3002 + MSG_SPACE_REQUIRED_BEFORE_PUBIDLITERAL_IN_EXTERNALID = "PUBLIC" \u8207\u516C\u7528 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 MSG_SPACE_REQUIRED_AFTER_PUBIDLITERAL_IN_EXTERNALID = \u516C\u7528 ID \u8207\u7CFB\u7D71 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 - MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = \"SYSTEM\" \u8207\u7CFB\u7D71 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 - MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5 ID \u4E0D\u61C9\u6307\u5B9A\u70BA\u7CFB\u7D71 ID \"{0}\" \u7684\u4E00\u90E8\u5206\u3002 + MSG_SPACE_REQUIRED_BEFORE_SYSTEMLITERAL_IN_EXTERNALID = "SYSTEM" \u8207\u7CFB\u7D71 ID \u4E4B\u9593\u9700\u8981\u7A7A\u683C\u3002 + MSG_URI_FRAGMENT_IN_SYSTEMID = \u7247\u6BB5 ID \u4E0D\u61C9\u6307\u5B9A\u70BA\u7CFB\u7D71 ID "{0}" \u7684\u4E00\u90E8\u5206\u3002 # 4.7 Notation Declarations - MSG_SPACE_REQUIRED_BEFORE_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D \"''\u3002 + MSG_SPACE_REQUIRED_AFTER_NOTATION_NAME_IN_NOTATIONDECL = \u5728\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u8868\u793A\u6CD5\u540D\u7A31 "{0}" \u4E4B\u5F8C\u9700\u8981\u7A7A\u683C\u3002 + ExternalIDorPublicIDRequired = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u5FC5\u9808\u5305\u542B\u7CFB\u7D71\u6216\u516C\u7528 ID\u3002 + NotationDeclUnterminated = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u7D50\u5C3E\u5FC5\u9808\u70BA ''>''\u3002 # Validation messages - DuplicateTypeInMixedContent = \u5143\u7D20\u5BA3\u544A \"{0}\" \u7684\u5167\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7D93\u6307\u5B9A\u5143\u7D20\u985E\u578B \"{1}\"\u3002 - ENTITIESInvalid = \u985E\u578B ENTITIES \u7684\u5C6C\u6027\u503C \"{1}\" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u672A\u5256\u6790\u500B\u9AD4\u7684\u540D\u7A31\u3002 - ENTITYInvalid = \u985E\u578B ENTITY \u7684\u5C6C\u6027\u503C \"{1}\" \u5FC5\u9808\u662F\u4E00\u500B\u672A\u5256\u6790\u500B\u9AD4\u7684\u540D\u7A31\u3002 - IDDefaultTypeInvalid = ID \u5C6C\u6027 \"{0}\" \u5FC5\u9808\u5177\u6709 \"#IMPLIED\" \u6216 \"#REQUIRED\" \u7684\u5BA3\u544A\u9810\u8A2D\u3002 - IDInvalid = \u985E\u578B ID \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u540D\u7A31\u3002 - IDInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B ID \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F NCName\u3002 - IDNotUnique = \u985E\u578B ID \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u6587\u4EF6\u5167\u7684\u552F\u4E00\u503C\u3002 - IDREFInvalid = \u985E\u578B IDREF \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u540D\u7A31\u3002 - IDREFInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B IDREF \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F NCName\u3002 - IDREFSInvalid = \u985E\u578B IDREFS \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u3002 - ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u7576\u500B\u9AD4\u53C3\u7167\u7576\u4F5C\u5B8C\u6574\u5BA3\u544A\u6642\uFF0C\u53C3\u6578\u500B\u9AD4 \"{0}\" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002 - ImproperDeclarationNesting = \u53C3\u6578\u500B\u9AD4 \"{0}\" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002 - ImproperGroupNesting = \u53C3\u6578\u500B\u9AD4 \"{0}\" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u6210\u5C0D\u62EC\u865F\u3002 - INVALID_PE_IN_CONDITIONAL = \u53C3\u6578\u500B\u9AD4 \"{0}\" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6574\u500B\u689D\u4EF6\u6027\u6BB5\u843D\u6216\u50C5\u5305\u542B INCLUDE \u6216 IGNORE\u3002 - MSG_ATTRIBUTE_NOT_DECLARED = \u5143\u7D20\u985E\u578B \"{0}\" \u5FC5\u9808\u5BA3\u544A\u5C6C\u6027 \"{1}\"\u3002 - MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5177\u6709\u503C \"{1}\" \u7684\u5C6C\u6027 \"{0}\" \u5FC5\u9808\u5177\u6709\u4F86\u81EA\u6E05\u55AE \"{2}\" \u7684\u503C\u3002 - MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5C6C\u6027 \"{0}\" \u7684\u503C \"{1}\" \u4E0D\u53EF\u900F\u904E\u6B63\u898F\u5316\u9032\u884C\u8B8A\u66F4 (\u6210\u70BA \"{2}\")\u3002 - MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5167\u5BB9\u4E0D\u5B8C\u6574\uFF0C\u5B83\u5FC5\u9808\u914D\u5C0D \"{1}\"\u3002 - MSG_CONTENT_INVALID = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D \"{1}\"\u3002 - MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D \"{1}\"\u3002\u4E0D\u5141\u8A31\u985E\u578B \"{2}\" \u7684\u5B50\u9805\u3002 - MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B \"{0}\" \u7684\u5C6C\u6027 \"{1}\" \u5177\u6709\u9810\u8A2D\u503C\uFF0C\u4E14\u5FC5\u9808\u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\u6307\u5B9A\u3002 - MSG_DUPLICATE_ATTDEF = \u5143\u7D20\u985E\u578B \"{0}\" \u5DF2\u7D93\u5BA3\u544A\u5C6C\u6027 \"{1}\"\u3002 - MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u985E\u578B \"{0}\" \u4E0D\u53EF\u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002 - MSG_ELEMENT_NOT_DECLARED = \u5FC5\u9808\u5BA3\u544A\u5143\u7D20\u985E\u578B \"{0}\"\u3002 + DuplicateTypeInMixedContent = \u5143\u7D20\u5BA3\u544A "{0}" \u7684\u5167\u5BB9\u6A21\u578B\u4E2D\u5DF2\u7D93\u6307\u5B9A\u5143\u7D20\u985E\u578B "{1}"\u3002 + ENTITIESInvalid = \u985E\u578B ENTITIES \u7684\u5C6C\u6027\u503C "{1}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u672A\u5256\u6790\u5BE6\u9AD4\u7684\u540D\u7A31\u3002 + ENTITYInvalid = \u985E\u578B ENTITY \u7684\u5C6C\u6027\u503C "{1}" \u5FC5\u9808\u662F\u4E00\u500B\u672A\u5256\u6790\u5BE6\u9AD4\u7684\u540D\u7A31\u3002 + IDDefaultTypeInvalid = ID \u5C6C\u6027 "{0}" \u5FC5\u9808\u5177\u6709 "#IMPLIED" \u6216 "#REQUIRED" \u7684\u5BA3\u544A\u9810\u8A2D\u3002 + IDInvalid = \u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u3002 + IDInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F NCName\u3002 + IDNotUnique = \u985E\u578B ID \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u6587\u4EF6\u5167\u7684\u552F\u4E00\u503C\u3002 + IDREFInvalid = \u985E\u578B IDREF \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u3002 + IDREFInvalidWithNamespaces = \u555F\u7528\u547D\u540D\u7A7A\u9593\u6642\uFF0C\u985E\u578B IDREF \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F NCName\u3002 + IDREFSInvalid = \u985E\u578B IDREFS \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u3002 + ILL_FORMED_PARAMETER_ENTITY_WHEN_USED_IN_DECL = \u7576\u5BE6\u9AD4\u53C3\u7167\u7576\u4F5C\u5B8C\u6574\u5BA3\u544A\u6642\uFF0C\u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002 + ImproperDeclarationNesting = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u5BA3\u544A\u3002 + ImproperGroupNesting = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6B63\u78BA\u5DE2\u72C0\u7D50\u69CB\u7684\u6210\u5C0D\u62EC\u865F\u3002 + INVALID_PE_IN_CONDITIONAL = \u53C3\u6578\u5BE6\u9AD4 "{0}" \u7684\u53D6\u4EE3\u6587\u5B57\u5FC5\u9808\u5305\u542B\u6574\u500B\u689D\u4EF6\u6027\u6BB5\u843D\u6216\u50C5\u5305\u542B INCLUDE \u6216 IGNORE\u3002 + MSG_ATTRIBUTE_NOT_DECLARED = \u5143\u7D20\u985E\u578B "{0}" \u5FC5\u9808\u5BA3\u544A\u5C6C\u6027 "{1}"\u3002 + MSG_ATTRIBUTE_VALUE_NOT_IN_LIST = \u5177\u6709\u503C "{1}" \u7684\u5C6C\u6027 "{0}" \u5FC5\u9808\u5177\u6709\u4F86\u81EA\u6E05\u55AE "{2}" \u7684\u503C\u3002 + MSG_ATTVALUE_CHANGED_DURING_NORMALIZATION_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5C6C\u6027 "{0}" \u7684\u503C "{1}" \u4E0D\u53EF\u900F\u904E\u6B63\u898F\u5316\u9032\u884C\u8B8A\u66F4 (\u6210\u70BA "{2}")\u3002 + MSG_CONTENT_INCOMPLETE = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u4E0D\u5B8C\u6574\uFF0C\u5B83\u5FC5\u9808\u914D\u5C0D "{1}"\u3002 + MSG_CONTENT_INVALID = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D "{1}"\u3002 + MSG_CONTENT_INVALID_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5167\u5BB9\u5FC5\u9808\u914D\u5C0D "{1}"\u3002\u4E0D\u5141\u8A31\u985E\u578B "{2}" \u7684\u5B50\u9805\u3002 + MSG_DEFAULTED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u7684\u5C6C\u6027 "{1}" \u5177\u6709\u9810\u8A2D\u503C\uFF0C\u4E14\u5FC5\u9808\u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\u6307\u5B9A\u3002 + MSG_DUPLICATE_ATTDEF = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5BA3\u544A\u5C6C\u6027 "{1}"\u3002 + MSG_ELEMENT_ALREADY_DECLARED = \u5143\u7D20\u985E\u578B "{0}" \u4E0D\u53EF\u5BA3\u544A\u8D85\u904E\u4E00\u6B21\u4EE5\u4E0A\u3002 + MSG_ELEMENT_NOT_DECLARED = \u5FC5\u9808\u5BA3\u544A\u5143\u7D20\u985E\u578B "{0}"\u3002 MSG_GRAMMAR_NOT_FOUND = \u6587\u4EF6\u7121\u6548: \u627E\u4E0D\u5230\u6587\u6CD5\u3002 - MSG_ELEMENT_WITH_ID_REQUIRED = ID \u70BA \"{0}\" \u7684\u5143\u7D20\u5FC5\u9808\u51FA\u73FE\u5728\u6587\u4EF6\u4E2D\u3002 - MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u7368\u7ACB\u6587\u4EF6\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u500B\u9AD4 \"{0}\"\u3002 - MSG_FIXED_ATTVALUE_INVALID = \u5177\u6709\u503C \"{2}\" \u7684\u5C6C\u6027 \"{1}\" \u5FC5\u9808\u5177\u6709 \"{3}\" \u7684\u503C\u3002 - MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u985E\u578B \"{0}\" \u5DF2\u7D93\u5177\u6709\u985E\u578B ID \u7684\u5C6C\u6027 \"{1}\"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B ID \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 \"{2}\"\u3002 - MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u985E\u578B \"{0}\" \u5DF2\u7D93\u5177\u6709\u985E\u578B NOTATION \u7684\u5C6C\u6027 \"{1}\"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B NOTATION \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 \"{2}\"\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u82E5\u8981\u5728\u5C6C\u6027 \"{0}\" \u7684\u8868\u793A\u6CD5\u985E\u578B\u6E05\u55AE\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 \"{1}\"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002 - MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u82E5\u8981\u5728 \"{0}\" \u7684\u672A\u5256\u6790\u500B\u9AD4\u5BA3\u544A\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 \"{1}\"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002 - MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5256\u6790\u500B\u9AD4\u4E2D\u5BA3\u544A\u7684\u500B\u9AD4 \"{0}\"\u3002 - MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B \"{0}\" \u9700\u8981\u5C6C\u6027 \"{1}\" \u4E14\u5FC5\u9808\u4E88\u4EE5\u6307\u5B9A\u3002 - MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5177\u6709\u5143\u7D20\u5167\u5BB9\u7684\u5916\u90E8\u5256\u6790\u500B\u9AD4\u4E2D\u5BA3\u544A\u7684\u5143\u7D20\u4E4B\u9593\uFF0C\u4E0D\u53EF\u6709\u7A7A\u683C\u3002 - NMTOKENInvalid = \u985E\u578B NMTOKEN \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u540D\u7A31\u8A18\u865F\u3002 - NMTOKENSInvalid = \u985E\u578B NMTOKENS \u7684\u5C6C\u6027\u503C \"{0}\" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u8A18\u865F\u3002 - NoNotationOnEmptyElement = \u5BA3\u544A EMPTY \u7684\u5143\u7D20\u985E\u578B \"{0}\" \u4E0D\u53EF\u5BA3\u544A\u985E\u578B NOTATION \u7684\u5C6C\u6027 \"{1}\"\u3002 - RootElementTypeMustMatchDoctypedecl = \u6587\u4EF6\u6839\u5143\u7D20 \"{1}\" \u5FC5\u9808\u914D\u5C0D DOCTYPE \u6839 \"{0}\"\u3002 - UndeclaredElementInContentSpec = \u5143\u7D20 \"{0}\" \u7684\u5167\u5BB9\u6A21\u578B\u53C3\u7167\u672A\u5BA3\u544A\u7684\u5143\u7D20 \"{1}\"\u3002 - UniqueNotationName = \u8868\u793A\u6CD5 \"{0}\" \u7684\u5BA3\u544A\u4E26\u975E\u552F\u4E00\u3002\u6307\u5B9A\u7684 Name \u4E0D\u80FD\u5728\u4E00\u500B\u4EE5\u4E0A\u7684\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u5BA3\u544A\u3002 + MSG_ELEMENT_WITH_ID_REQUIRED = ID \u70BA "{0}" \u7684\u5143\u7D20\u5FC5\u9808\u51FA\u73FE\u5728\u6587\u4EF6\u4E2D\u3002 + MSG_EXTERNAL_ENTITY_NOT_PERMITTED = \u7368\u7ACB\u6587\u4EF6\u4E2D\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5BE6\u9AD4 "{0}"\u3002 + MSG_FIXED_ATTVALUE_INVALID = \u5177\u6709\u503C "{2}" \u7684\u5C6C\u6027 "{1}" \u5FC5\u9808\u5177\u6709 "{3}" \u7684\u503C\u3002 + MSG_MORE_THAN_ONE_ID_ATTRIBUTE = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5177\u6709\u985E\u578B ID \u7684\u5C6C\u6027 "{1}"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B ID \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 "{2}"\u3002 + MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE = \u5143\u7D20\u985E\u578B "{0}" \u5DF2\u7D93\u5177\u6709\u985E\u578B NOTATION \u7684\u5C6C\u6027 "{1}"\uFF0C\u4E0D\u5141\u8A31\u8A72\u985E\u578B NOTATION \u7684\u7B2C\u4E8C\u500B\u5C6C\u6027 "{2}"\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_NOTATIONTYPE_ATTRIBUTE = \u82E5\u8981\u5728\u5C6C\u6027 "{0}" \u7684\u8868\u793A\u6CD5\u985E\u578B\u6E05\u55AE\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 "{1}"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002 + MSG_NOTATION_NOT_DECLARED_FOR_UNPARSED_ENTITYDECL = \u82E5\u8981\u5728 "{0}" \u7684\u672A\u5256\u6790\u5BE6\u9AD4\u5BA3\u544A\u4E2D\u53C3\u7167\u8868\u793A\u6CD5 "{1}"\uFF0C\u5FC5\u9808\u4E88\u4EE5\u5BA3\u544A\u3002 + MSG_REFERENCE_TO_EXTERNALLY_DECLARED_ENTITY_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u4E2D\u5BA3\u544A\u7684\u5BE6\u9AD4 "{0}"\u3002 + MSG_REQUIRED_ATTRIBUTE_NOT_SPECIFIED = \u5143\u7D20\u985E\u578B "{0}" \u9700\u8981\u5C6C\u6027 "{1}" \u4E14\u5FC5\u9808\u4E88\u4EE5\u6307\u5B9A\u3002 + MSG_WHITE_SPACE_IN_ELEMENT_CONTENT_WHEN_STANDALONE = \u5728\u7368\u7ACB\u6587\u4EF6\u4E2D\uFF0C\u5177\u6709\u5143\u7D20\u5167\u5BB9\u7684\u5916\u90E8\u5256\u6790\u5BE6\u9AD4\u4E2D\u5BA3\u544A\u7684\u5143\u7D20\u4E4B\u9593\uFF0C\u4E0D\u53EF\u6709\u7A7A\u683C\u3002 + NMTOKENInvalid = \u985E\u578B NMTOKEN \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u540D\u7A31\u8A18\u865F\u3002 + NMTOKENSInvalid = \u985E\u578B NMTOKENS \u7684\u5C6C\u6027\u503C "{0}" \u5FC5\u9808\u662F\u4E00\u6216\u591A\u500B\u540D\u7A31\u8A18\u865F\u3002 + NoNotationOnEmptyElement = \u5BA3\u544A EMPTY \u7684\u5143\u7D20\u985E\u578B "{0}" \u4E0D\u53EF\u5BA3\u544A\u985E\u578B NOTATION \u7684\u5C6C\u6027 "{1}"\u3002 + RootElementTypeMustMatchDoctypedecl = \u6587\u4EF6\u6839\u5143\u7D20 "{1}" \u5FC5\u9808\u914D\u5C0D DOCTYPE \u6839 "{0}"\u3002 + UndeclaredElementInContentSpec = \u5143\u7D20 "{0}" \u7684\u5167\u5BB9\u6A21\u578B\u53C3\u7167\u672A\u5BA3\u544A\u7684\u5143\u7D20 "{1}"\u3002 + UniqueNotationName = \u8868\u793A\u6CD5 "{0}" \u7684\u5BA3\u544A\u4E26\u975E\u552F\u4E00\u3002\u6307\u5B9A\u7684 Name \u4E0D\u80FD\u5728\u4E00\u500B\u4EE5\u4E0A\u7684\u8868\u793A\u6CD5\u5BA3\u544A\u4E2D\u5BA3\u544A\u3002 ENTITYFailedInitializeGrammar = ENTITYDatatype \u9A57\u8B49\u7A0B\u5F0F: \u5931\u6557\u3002\u9700\u8981\u4F7F\u7528\u6709\u6548\u7684\u6587\u6CD5\u53C3\u7167\u4F86\u547C\u53EB\u8D77\u59CB\u65B9\u6CD5\u3002 \t - ENTITYNotUnparsed = ENTITY \"{0}\" \u4E26\u975E\u672A\u7D93\u5256\u6790\u3002 - ENTITYNotValid = ENTITY \"{0}\" \u7121\u6548\u3002 + ENTITYNotUnparsed = ENTITY "{0}" \u4E26\u975E\u672A\u7D93\u5256\u6790\u3002 + ENTITYNotValid = ENTITY "{0}" \u7121\u6548\u3002 EmptyList = \u985E\u578B ENTITIES\u3001IDREFS \u8207 NMTOKENS \u7684\u503C\u4E0D\u53EF\u70BA\u7A7A\u767D\u6E05\u55AE\u3002 # Entity related messages # 3.1 Start-Tags, End-Tags, and Empty-Element Tags - ReferenceToExternalEntity = \u5C6C\u6027\u503C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u500B\u9AD4 \"&{0};\"\u3002 - AccessExternalDTD = External DTD: Failed to read external DTD ''{0}'', because ''{1}'' access is not allowed. - AccessExternalEntity = External Entity: Failed to read external document ''{0}'', because ''{1}'' access is not allowed. + ReferenceToExternalEntity = \u5C6C\u6027\u503C\u4E0D\u5141\u8A31\u53C3\u7167\u5916\u90E8\u5BE6\u9AD4 "&{0};"\u3002 + AccessExternalDTD = \u5916\u90E8 DTD: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8 DTD ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 + AccessExternalEntity = \u5916\u90E8\u5BE6\u9AD4: \u7121\u6CD5\u8B80\u53D6\u5916\u90E8\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 # 4.1 Character and Entity References - EntityNotDeclared = \u53C3\u7167\u4E86\u500B\u9AD4 \"{0}\"\uFF0C\u4F46\u662F\u672A\u5BA3\u544A\u3002 - ReferenceToUnparsedEntity = \u4E0D\u5141\u8A31\u672A\u5256\u6790\u7684\u500B\u9AD4\u53C3\u7167 \"&{0};\"\u3002 - RecursiveReference = \u905E\u8FF4\u500B\u9AD4\u53C3\u7167 \"{0}\"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C - RecursiveGeneralReference = \u905E\u8FF4\u4E00\u822C\u500B\u9AD4\u53C3\u7167 \"&{0};\"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C - RecursivePEReference = \u905E\u8FF4\u53C3\u6578\u500B\u9AD4\u53C3\u7167 \"%{0};\"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C + EntityNotDeclared = \u53C3\u7167\u4E86\u5BE6\u9AD4 "{0}"\uFF0C\u4F46\u662F\u672A\u5BA3\u544A\u3002 + ReferenceToUnparsedEntity = \u4E0D\u5141\u8A31\u672A\u5256\u6790\u7684\u5BE6\u9AD4\u53C3\u7167 "&{0};"\u3002 + RecursiveReference = \u905E\u8FF4\u5BE6\u9AD4\u53C3\u7167 "{0}"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C + RecursiveGeneralReference = \u905E\u8FF4\u4E00\u822C\u5BE6\u9AD4\u53C3\u7167 "&{0};"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C + RecursivePEReference = \u905E\u8FF4\u53C3\u6578\u5BE6\u9AD4\u53C3\u7167 "%{0};"\u3002(\u53C3\u7167\u8DEF\u5F91: {1})\uFF0C # 4.3.3 Character Encoding in Entities - EncodingNotSupported = \u4E0D\u652F\u63F4\u7DE8\u78BC \"{0}\"\u3002 - EncodingRequired = \u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u7DE8\u78BC\u7684\u5256\u6790\u500B\u9AD4\uFF0C\u5FC5\u9808\u5305\u542B\u7DE8\u78BC\u5BA3\u544A\u3002 + EncodingNotSupported = \u4E0D\u652F\u63F4\u7DE8\u78BC "{0}"\u3002 + EncodingRequired = \u672A\u4F7F\u7528 UTF-8 \u6216 UTF-16 \u7DE8\u78BC\u7684\u5256\u6790\u5BE6\u9AD4\uFF0C\u5FC5\u9808\u5305\u542B\u7DE8\u78BC\u5BA3\u544A\u3002 # Namespaces support # 4. Using Qualified Names IllegalQName = \u5143\u7D20\u6216\u5C6C\u6027\u4E0D\u7B26\u5408 QName \u7522\u751F: QName::=(NCName':')?NCName\u3002 - ElementXMLNSPrefix = \u5143\u7D20 \"{0}\" \u4E0D\u80FD\u4F7F\u7528 \"xmlns\" \u4F5C\u70BA\u524D\u7F6E\u78BC\u3002 - ElementPrefixUnbound = \u5143\u7D20 \"{1}\" \u7684\u524D\u7F6E\u78BC \"{0}\" \u672A\u9023\u7D50\u3002 - AttributePrefixUnbound = \u95DC\u806F\u5143\u7D20\u985E\u578B \"{0}\" \u4E4B\u5C6C\u6027 \"{1}\" \u7684\u524D\u7F6E\u78BC \"{2}\" \u672A\u9023\u7D50\u3002 - EmptyPrefixedAttName = \u5C6C\u6027 \"{0}\" \u7684\u503C\u7121\u6548\u3002\u524D\u7F6E\u7684\u547D\u540D\u7A7A\u9593\u9023\u7D50\u4E0D\u53EF\u70BA\u7A7A\u767D\u3002 - PrefixDeclared = \u672A\u5BA3\u544A\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC \"{0}\"\u3002 + ElementXMLNSPrefix = \u5143\u7D20 "{0}" \u4E0D\u80FD\u4F7F\u7528 "xmlns" \u4F5C\u70BA\u524D\u7F6E\u78BC\u3002 + ElementPrefixUnbound = \u5143\u7D20 "{1}" \u7684\u524D\u7F6E\u78BC "{0}" \u672A\u9023\u7D50\u3002 + AttributePrefixUnbound = \u95DC\u806F\u5143\u7D20\u985E\u578B "{0}" \u4E4B\u5C6C\u6027 "{1}" \u7684\u524D\u7F6E\u78BC "{2}" \u672A\u9023\u7D50\u3002 + EmptyPrefixedAttName = \u5C6C\u6027 "{0}" \u7684\u503C\u7121\u6548\u3002\u524D\u7F6E\u7684\u547D\u540D\u7A7A\u9593\u9023\u7D50\u4E0D\u53EF\u70BA\u7A7A\u767D\u3002 + PrefixDeclared = \u672A\u5BA3\u544A\u547D\u540D\u7A7A\u9593\u524D\u7F6E\u78BC "{0}"\u3002 CantBindXMLNS = \u524D\u7F6E\u78BC "xmlns" \u7121\u6CD5\u660E\u78BA\u9023\u7D50\u4EFB\u4F55\u547D\u540D\u7A7A\u9593; "xmlns" \u7684\u547D\u540D\u7A7A\u9593\u4E5F\u7121\u6CD5\u660E\u78BA\u9023\u7D50\u4EFB\u4F55\u524D\u7F6E\u78BC\u3002 CantBindXML = \u524D\u7F6E\u78BC "xml" \u7121\u6CD5\u9023\u7D50\u4E00\u822C\u547D\u540D\u7A7A\u9593\u4E4B\u5916\u7684\u4EFB\u4F55\u547D\u540D\u7A7A\u9593; "xml" \u7684\u547D\u540D\u7A7A\u9593\u4E5F\u7121\u6CD5\u9023\u7D50 "xml" \u4E4B\u5916\u7684\u4EFB\u4F55\u547D\u540D\u7A7A\u9593\u3002 - MSG_ATT_DEFAULT_INVALID = \u7531\u65BC\u6B64\u5C6C\u6027\u985E\u578B\u7684\u8A9E\u5F59\u9650\u5236\u689D\u4EF6\uFF0C\u5C6C\u6027 \"{0}\" \u7684 defaultValue \"{1}\" \u7121\u6548\u3002 + MSG_ATT_DEFAULT_INVALID = \u7531\u65BC\u6B64\u5C6C\u6027\u985E\u578B\u7684\u8A9E\u5F59\u9650\u5236\u689D\u4EF6\uFF0C\u5C6C\u6027 "{0}" \u7684 defaultValue "{1}" \u7121\u6548\u3002 # REVISIT: These need messages MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID=MSG_SPACE_REQUIRED_AFTER_SYSTEMLITERAL_IN_EXTERNALID @@ -321,7 +318,7 @@ #Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=\u5256\u6790\u5668\u5728\u6B64\u6587\u4EF6\u4E2D\u906D\u9047 \"{0}\" \u500B\u4EE5\u4E0A\u7684\u500B\u9AD4\u64F4\u5145; \u6B64\u70BA\u61C9\u7528\u7A0B\u5F0F\u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 +EntityExpansionLimitExceeded=\u5256\u6790\u5668\u5728\u6B64\u6587\u4EF6\u4E2D\u906D\u9047 "{0}" \u500B\u4EE5\u4E0A\u7684\u5BE6\u9AD4\u64F4\u5145; \u6B64\u70BA\u61C9\u7528\u7A0B\u5F0F\u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 # Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= \u5143\u7D20 \"{0}\" \u5177\u6709\u8D85\u904E \"{1}\" \u500B\u4EE5\u4E0A\u7684\u5C6C\u6027\uFF0C\"{1}\" \u70BA\u61C9\u7528\u7A0B\u5F0F\u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 +ElementAttributeLimit= \u5143\u7D20 "{0}" \u5177\u6709\u8D85\u904E "{1}" \u500B\u4EE5\u4E0A\u7684\u5C6C\u6027\uFF0C"{1}" \u70BA\u61C9\u7528\u7A0B\u5F0F\u6240\u898F\u5B9A\u7684\u9650\u5236\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties index 23234a4bf61..d986140a86e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties @@ -86,7 +86,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed due to restriction set by the accessExternalSchema property. schema_reference.4 = schema_reference.4: Failed to read schema document ''{0}'', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . src-annotation = src-annotation: elements can only contain and elements, but ''{0}'' was found. src-attribute.1 = src-attribute.1: The properties ''default'' and ''fixed'' cannot both be present in attribute declaration ''{0}''. Use only one of them. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties index eed78fb7577..b591da69fdf 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element \"{0}\" hat einen Schl\u00FCssel ohne Wert. - DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld \"{0}\". - DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements \"{1}\" deklariert. - DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements \"{1}\" deklariert. - FieldMultipleMatch = Identity Constraint-Fehler: Feld \"{0}\" entspricht mehreren Werten im Geltungsbereich seines Selectors. Felder m\u00FCssen eindeutigen Werten entsprechen. - FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des \"fixed\"-Attributs in der Elementdeklaration im Schema. - KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element \"{0}\" hat einen Schl\u00FCssel, der einem Element entspricht, bei dem "nillable" auf "true" gesetzt wurde. - KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element \"{0}\". + AbsentKeyValue = Identity Constraint-Fehler (cvc-identity-constraint.4.2.1): Element "{0}" hat einen Schl\u00FCssel ohne Wert. + DuplicateField = Doppelte \u00DCbereinstimmung in Geltungsbereich f\u00FCr Feld "{0}". + DuplicateKey = Doppelter Schl\u00FCsselwert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert. + DuplicateUnique = Doppelter eindeutiger Wert [{0}] f\u00FCr Identity Constraint des Elements "{1}" deklariert. + FieldMultipleMatch = Identity Constraint-Fehler: Feld "{0}" entspricht mehreren Werten im Geltungsbereich seines Selectors. Felder m\u00FCssen eindeutigen Werten entsprechen. + FixedDiffersFromActual = Content dieses Elements entspricht nicht dem Wert des "fixed"-Attributs in der Elementdeklaration im Schema. + KeyMatchesNillable = Identity Constraint-Fehler (cvc-identity-constraint.4.2.3): Element "{0}" hat einen Schl\u00FCssel, der einem Element entspricht, bei dem "nillable" auf "true" gesetzt wurde. + KeyNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element "{0}". KeyNotFound = Schl\u00FCssel "{0}" mit Wert "{1}" nicht gefunden f\u00FCr Identity Constraint des Elements "{2}". - KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element \"{0}\". - KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint \"{0}\" hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist. - KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration \"{0}\" verweist auf einen unbekannten Schl\u00FCssel mit dem Namen \"{1}\". - UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element \"{0}\". - UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld \"{0}\". + KeyRefNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element "{0}". + KeyRefOutOfScope = Identity Constraint-Fehler: Identity Constraint "{0}" hat eine keyref, die zu einem Key- oder Unique-Constraint au\u00DFerhalb des Geltungsbereichs verweist. + KeyRefReferNotFound = Schl\u00FCsselreferenzdeklaration "{0}" verweist auf einen unbekannten Schl\u00FCssel mit dem Namen "{1}". + UniqueNotEnoughValues = Nicht gen\u00FCgend Werte angegeben f\u00FCr Identity Constraint f\u00FCr Element "{0}". + UnknownField = Interner Identity Constraint-Fehler. Unbekanntes Feld "{0}". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: Lesen von Schema-Dokument "{0}" nicht erfolgreich, da "{1}"-Zugriff nicht zul\u00E4ssig ist. schema_reference.4 = schema_reference.4: Schemadokument "{0}" konnte nicht gelesen werden, da 1) das Dokument nicht gefunden werden konnte; 2) das Dokument nicht gelesen werden konnte; 3) das Root-Element des Dokuments nicht ist. src-annotation = src-annotation: -Elemente k\u00F6nnen nur - und -Elemente enthalten, aber es wurde "{0}" gefunden. src-attribute.1 = src-attribute.1: Die Eigenschaften "default" und "fixed" k\u00F6nnen nicht beide in der Attributdeklaration "{0}" vorhanden sein. Verwenden Sie nur eine dieser Eigenschaften. @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Der Contenttyp eines abgeleiteten Typs und der seiner Basis m\u00FCssen beide "mixed" oder "element-only" sein. Typ "{0}" ist "mixed", aber sein Basistyp nicht. cos-element-consistent = cos-element-consistent: Fehler bei Typ "{0}". Mehrere Elemente mit Namen "{1}" und unterschiedlichen Typen kommen in der Modellgruppe vor. cos-list-of-atomic = cos-list-of-atomic: In der Definition von Listentyp "{0}" ist Typ "{1}" ein ung\u00FCltiger Listenelementtyp, da er nicht atomar ist ("{1}" ist entweder ein Listentyp oder ein Vereinigungsmengentyp, der eine Liste enth\u00E4lt). - cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen \"Unique Particle Attribution\". Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt. + cos-nonambig = cos-nonambig: {0} und {1} (oder Elemente aus ihrer Substitutionsgruppe) verletzen "Unique Particle Attribution". Bei der Validierung f\u00FCr dieses Schema w\u00FCrde eine Mehrdeutigkeit f\u00FCr diese beiden Partikel erstellt. cos-particle-restrict.a = cos-particle-restrict.a: Abgeleitetes Partikel ist leer, und die Basis kann nicht geleert werden. cos-particle-restrict.b = cos-particle-restrict.b: Basispartikel ist leer, aber das abgeleitete Partikel ist nicht leer. cos-particle-restrict.2 = cos-particle-restrict.2: Unzul\u00E4ssige Partikeleinschr\u00E4nkung: "{0}". diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties index b5e6560e957..dc6d6a24f21 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error correspondiente a la clave de mensaje. FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.1): el elemento \"{0}\" tiene una clave sin valor. - DuplicateField = Coincidencia duplicada en \u00E1mbito del campo \"{0}\". - DuplicateKey = Valor de clave duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento \"{1}\". - DuplicateUnique = Valor \u00FAnico duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento \"{1}\". - FieldMultipleMatch = Error de restricci\u00F3n de identidad: el campo \"{0}\" coincide con m\u00E1s de un valor en el \u00E1mbito de su selector; los campos deben coincidir con valores \u00FAnicos. - FixedDiffersFromActual = El contenido de este elemento no es equivalente al valor del atributo \"fixed\" en la declaraci\u00F3n del elemento del esquema. - KeyMatchesNillable = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.3): el elemento \"{0}\" tiene una clave que coincide con un elemento cuyo valor de Permite Nill est\u00E1 definido en true. - KeyNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento \"{0}\". + AbsentKeyValue = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.1): el elemento "{0}" tiene una clave sin valor. + DuplicateField = Coincidencia duplicada en \u00E1mbito del campo "{0}". + DuplicateKey = Valor de clave duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento "{1}". + DuplicateUnique = Valor \u00FAnico duplicado [{0}] declarado para la restricci\u00F3n de identidad del elemento "{1}". + FieldMultipleMatch = Error de restricci\u00F3n de identidad: el campo "{0}" coincide con m\u00E1s de un valor en el \u00E1mbito de su selector; los campos deben coincidir con valores \u00FAnicos. + FixedDiffersFromActual = El contenido de este elemento no es equivalente al valor del atributo "fixed" en la declaraci\u00F3n del elemento del esquema. + KeyMatchesNillable = Error de restricci\u00F3n de identidad (cvc-identity-constraint.4.2.3): el elemento "{0}" tiene una clave que coincide con un elemento cuyo valor de Permite Nill est\u00E1 definido en true. + KeyNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento "{0}". KeyNotFound = No se ha encontrado la clave ''{0}'' con el valor ''{1}'' para la restricci\u00F3n de identidad del elemento ''{2}''. - KeyRefNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento \"{0}\". - KeyRefOutOfScope = Error de restricci\u00F3n de identidad: la restricci\u00F3n de identidad \"{0}\" tiene una referencia de clave que hace referencia a una clave o elemento \u00FAnico que se encuentra fuera de \u00E1mbito. - KeyRefReferNotFound = La declaraci\u00F3n de referencia de clave \"{0}\" hace referencia a una clave desconocida con el nombre \"{1}\". - UniqueNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento \"{0}\". - UnknownField = Error de restricci\u00F3n de identidad interno; campo desconocido \"{0}\". + KeyRefNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento "{0}". + KeyRefOutOfScope = Error de restricci\u00F3n de identidad: la restricci\u00F3n de identidad "{0}" tiene una referencia de clave que hace referencia a una clave o elemento \u00FAnico que se encuentra fuera de \u00E1mbito. + KeyRefReferNotFound = La declaraci\u00F3n de referencia de clave "{0}" hace referencia a una clave desconocida con el nombre "{1}". + UniqueNotEnoughValues = No se han especificado suficientes valores para la restricci\u00F3n de identidad especificada para el elemento "{0}". + UnknownField = Error de restricci\u00F3n de identidad interno; campo desconocido "{0}". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: fallo al leer el documento de esquema ''{0}'' porque el acceso a ''{1}'' no est\u00E1 permitido. schema_reference.4 = schema_reference.4: Fallo al leer el documento de esquema ''{0}'', porque 1) no se ha encontrado el documento; 2) no se ha podido leer el documento; 3) el elemento ra\u00EDz del documento no es . src-annotation = src-annotation: Los elementos de s\u00F3lo pueden contener elementos de y , pero se ha encontrado ''{0}''. src-attribute.1 = src-attribute.1: Las propiedades ''default'' y ''fixed'' no pueden estar presentes de forma simult\u00E1nea en la declaraci\u00F3n de atributo ''{0}''. Utilice s\u00F3lo una de ellas. @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: El tipo de contenido de un tipo derivado y el de su base deben ser mixtos o ser ambos s\u00F3lo de elemento. El tipo ''{0}'' es mixto, pero su tipo base no lo es. cos-element-consistent = cos-element-consistent: Error para el tipo ''{0}''. Aparecen en el grupo de modelos varios elementos con el nombre ''{1}'' y con tipos diferentes. cos-list-of-atomic = cos-list-of-atomic: En la definici\u00F3n de tipo de lista ''{0}'', el tipo ''{1}'' es un tipo de elemento de lista no v\u00E1lido porque no es at\u00F3mico (''{1}'' es un tipo de lista o un tipo de uni\u00F3n que contiene una lista). - cos-nonambig = cos-nonambig: {0} y {1} (o los elementos de su grupo de sustituci\u00F3n) violan la \"atribuci\u00F3n de part\u00EDcula \u00FAnica\". Durante la validaci\u00F3n a partir de este esquema, se crear\u00E1 ambig\u00FCedad para estas dos part\u00EDculas. + cos-nonambig = cos-nonambig: {0} y {1} (o los elementos de su grupo de sustituci\u00F3n) violan la "atribuci\u00F3n de part\u00EDcula \u00FAnica". Durante la validaci\u00F3n a partir de este esquema, se crear\u00E1 ambig\u00FCedad para estas dos part\u00EDculas. cos-particle-restrict.a = cos-particle-restrict.a: La part\u00EDcula derivada est\u00E1 vac\u00EDa y la base no se puede vaciar. cos-particle-restrict.b = cos-particle-restrict.b: La part\u00EDcula base est\u00E1 vac\u00EDa, pero la part\u00EDcula derivada no. cos-particle-restrict.2 = cos-particle-restrict.2: Restricci\u00F3n de part\u00EDcula prohibida: ''{0}''. @@ -310,7 +307,7 @@ EmptyTargetNamespace = EmptyTargetNamespace: En el documento de esquema ''{0}'', el valor del atributo ''targetNamespace'' no puede ser una cadena vac\u00EDa. FacetValueFromBase = FacetValueFromBase: En la declaraci\u00F3n de tipo ''{0}'', el valor ''{1}'' de la faceta ''{2}'' debe proceder del espacio reservado para el valor del tipo base, ''{3}''. FixedFacetValue = FixedFacetValue: En la definici\u00F3n de {3}, el valor ''{1}'' para la faceta ''{0}'' no es v\u00E1lido porque el valor de ''{0}'' se ha definido en ''{2}'' en uno de los tipos de ascendientes y ''{''fixed''}'' = true. - InvalidRegex = InvalidRegex: El valor del patr\u00F3n ''{0}'' no es una expresi\u00F3n normal v\u00E1lida. El error registrado ha sido: ''{1}'' en la columna ''{2}''. + InvalidRegex = InvalidRegex: El valor del patr\u00F3n ''{0}'' no es una expresi\u00F3n regular v\u00E1lida. El error registrado ha sido: ''{1}'' en la columna ''{2}''. maxOccurLimit = La configuraci\u00F3n actual del analizador no permite que la definici\u00F3n del valor del atributo maxOccurs sea mayor que {0}. PublicSystemOnNotation = PublicSystemOnNotation: Al menos un valor de ''public'' y ''system'' debe aparecer en el elemento ''notation''. SchemaLocation = SchemaLocation: El valor de schemaLocation = ''{0}'' debe tener un n\u00FAmero par de URI. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties index f3c3156d7c3..46f840f4746 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. FormatFailed = Une erreur interne est survenue lors du formatage du message suivant :\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.1) : l''\u00E9l\u00E9ment \"{0}\" a une cl\u00E9 sans valeur. - DuplicateField = Correspondance en double dans la port\u00E9e du champ \"{0}\". - DuplicateKey = Valeur de cl\u00E9 en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment \"{1}\". - DuplicateUnique = Valeur unique en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment \"{1}\". - FieldMultipleMatch = Erreur de contrainte d''identit\u00E9 : le champ \"{0}\" concorde avec plusieurs valeurs dans la port\u00E9e de son s\u00E9lecteur. Les champs doivent concorder avec des valeurs uniques. - FixedDiffersFromActual = Le contenu de l'\u00E9l\u00E9ment n'\u00E9quivaut pas \u00E0 la valeur de l'attribut \"fixed\" dans la d\u00E9claration de l'\u00E9l\u00E9ment du sch\u00E9ma. - KeyMatchesNillable = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.3) : l''\u00E9l\u00E9ment \"{0}\" a une cl\u00E9 qui concorde avec un \u00E9l\u00E9ment dont l''attribut nillable a la valeur True. - KeyNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment \"{0}\" est insuffisant. + AbsentKeyValue = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.1) : l''\u00E9l\u00E9ment "{0}" a une cl\u00E9 sans valeur. + DuplicateField = Correspondance en double dans la port\u00E9e du champ "{0}". + DuplicateKey = Valeur de cl\u00E9 en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{1}". + DuplicateUnique = Valeur unique en double [{0}] d\u00E9clar\u00E9e pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{1}". + FieldMultipleMatch = Erreur de contrainte d''identit\u00E9 : le champ "{0}" concorde avec plusieurs valeurs dans la port\u00E9e de son s\u00E9lecteur ; les champs doivent concorder avec des valeurs uniques. + FixedDiffersFromActual = Le contenu de l'\u00E9l\u00E9ment n'\u00E9quivaut pas \u00E0 la valeur de l'attribut "fixed" dans la d\u00E9claration de l'\u00E9l\u00E9ment du sch\u00E9ma. + KeyMatchesNillable = Erreur de contrainte d''identit\u00E9 (cvc-identity-constraint.4.2.3) : l''\u00E9l\u00E9ment "{0}" a une cl\u00E9 qui concorde avec un \u00E9l\u00E9ment dont l''attribut nillable a la valeur True. + KeyNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{0}" est insuffisant. KeyNotFound = La cl\u00E9 ''{0}'' ayant la valeur ''{1}'' est introuvable pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment ''{2}''. - KeyRefNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment \"{0}\" est insuffisant. - KeyRefOutOfScope = Erreur de contrainte d''identit\u00E9 : la contrainte d''identit\u00E9 \"{0}\" comporte une r\u00E9f\u00E9rence keyref se rapportant \u00E0 une cl\u00E9 ou \u00E0 une valeur unique hors port\u00E9e. - KeyRefReferNotFound = La d\u00E9claration de r\u00E9f\u00E9rence de cl\u00E9 \"{0}\" se rapporte \u00E0 une cl\u00E9 inconnue portant le nom \"{1}\". - UniqueNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment \"{0}\" est insuffisant. - UnknownField = Erreur de contrainte d''identit\u00E9 interne ; champ inconnu \"{0}\". + KeyRefNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{0}" est insuffisant. + KeyRefOutOfScope = Erreur de contrainte d''identit\u00E9 : la contrainte d''identit\u00E9 "{0}" comporte une r\u00E9f\u00E9rence keyref se rapportant \u00E0 une cl\u00E9 ou \u00E0 une valeur unique hors port\u00E9e. + KeyRefReferNotFound = La d\u00E9claration de r\u00E9f\u00E9rence de cl\u00E9 "{0}" se rapporte \u00E0 une cl\u00E9 inconnue portant le nom "{1}". + UniqueNotEnoughValues = Le nombre de valeurs indiqu\u00E9es pour la contrainte d''identit\u00E9 de l''\u00E9l\u00E9ment "{0}" est insuffisant. + UnknownField = Erreur de contrainte d''identit\u00E9 interne ; champ inconnu "{0}". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -68,7 +65,7 @@ cvc-complex-type.2.2 = cvc-complex-type.2.2 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type \u00E9l\u00E9ment et la valeur doit \u00EAtre valide. cvc-complex-type.2.3 = cvc-complex-type.2.3 : L''\u00E9l\u00E9ment ''{0}'' ne doit comporter aucun enfant ([children]) de type caract\u00E8re, car le type porte le type de contenu "element-only". cvc-complex-type.2.4.a = cvc-complex-type.2.4.a : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. L''une des valeurs ''{1}'' est attendue. - cvc-complex-type.2.4.b = cvc-complex-type.2.4.b : Le contenu de l''\u00E9l\u00E9ment "{0}" n''est pas complet. L''une des valeurs "{1}" est attendue. + cvc-complex-type.2.4.b = cvc-complex-type.2.4.b : Le contenu de l''\u00E9l\u00E9ment ''{0}'' n''est pas complet. L''un des \u00E9l\u00E9ments ''{1}'' est attendu. cvc-complex-type.2.4.c = cvc-complex-type.2.4.c : Le caract\u00E8re g\u00E9n\u00E9rique concordant est strict, mais aucune d\u00E9claration ne peut \u00EAtre trouv\u00E9e pour l''\u00E9l\u00E9ment ''{0}''. cvc-complex-type.2.4.d = cvc-complex-type.2.4.d : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. Aucun \u00E9l\u00E9ment enfant n''est attendu \u00E0 cet endroit. cvc-complex-type.2.4.e = cvc-complex-type.2.4.d : Contenu non valide trouv\u00E9 \u00E0 partir de l''\u00E9l\u00E9ment ''{0}''. Aucun \u00E9l\u00E9ment enfant ''{1}'' n''est attendu \u00E0 cet endroit. @@ -79,8 +76,8 @@ cvc-complex-type.5.1 = cvc-complex-type.5.1 : Dans l''\u00E9l\u00E9ment ''{0}'', l''attribut ''{1}'' est un ID g\u00E9n\u00E9rique. Or, il existe d\u00E9j\u00E0 un ID g\u00E9n\u00E9rique ''{2}''. Il ne peut en exister qu''un seul. cvc-complex-type.5.2 = cvc-complex-type.5.2 : Dans l''\u00E9l\u00E9ment ''{0}'', l''attribut ''{1}'' est un ID g\u00E9n\u00E9rique. Or, il existe d\u00E9j\u00E0 un attribut ''{2}'' d\u00E9riv\u00E9 de l''ID dans ''{''attribute uses''}''. cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1 : ''{0}'' n''est pas une valeur valide pour ''{1}''. - cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2 : ''{0}'' n''est pas une valeur valide pour le type de liste ''{1}''. - cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3 : ''{0}'' n''est pas une valeur valide pour le type d''union ''{1}''. + cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2 : ''{0}'' n''est pas une valeur valide du type de liste ''{1}''. + cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3 : ''{0}'' n''est pas une valeur valide du type d''union ''{1}''. cvc-elt.1 = cvc-elt.1 : D\u00E9claration de l''\u00E9l\u00E9ment ''{0}'' introuvable. cvc-elt.2 = cvc-elt.2 : La valeur de l''attribut ''{''abstract''}'' dans la d\u00E9claration de l''\u00E9l\u00E9ment pour ''{0}'' doit \u00EAtre False. cvc-elt.3.1 = cvc-elt.3.1 : L''attribut ''{1}'' ne doit pas figurer dans l''\u00E9l\u00E9ment ''{0}'', car la propri\u00E9t\u00E9 ''{''nillable''}'' de ''{0}'' est False. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference : \u00E9chec de la lecture du document de sch\u00E9ma ''{0}'', car l''acc\u00E8s ''{1}'' n''est pas autoris\u00E9. schema_reference.4 = schema_reference.4 : Echec de la lecture du document de sch\u00E9ma ''{0}'' pour les raisons suivantes : 1) Le document est introuvable ; 2) Le document n''a pas pu \u00EAtre lu ; 3) L''\u00E9l\u00E9ment racine du document n''est pas . src-annotation = src-annotation : Les \u00E9l\u00E9ments ne peuvent contenir que des \u00E9l\u00E9ments et , mais ''{0}'' a \u00E9t\u00E9 trouv\u00E9. src-attribute.1 = src-attribute.1 : Les propri\u00E9t\u00E9s ''default'' et ''fixed'' ne peuvent pas figurer simultan\u00E9ment dans la d\u00E9claration d''attribut ''{0}''. Utilisez uniquement l''une d''entre elles. @@ -130,7 +127,7 @@ src-ct.4 = src-ct.4 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. L''intersection de caract\u00E8res g\u00E9n\u00E9riques ne peut pas \u00EAtre exprim\u00E9e. src-ct.5 = src-ct.5 : Erreur de repr\u00E9sentation de la d\u00E9finition de type complexe pour le type ''{0}''. L''union de caract\u00E8res g\u00E9n\u00E9riques ne peut pas \u00EAtre exprim\u00E9e. src-element.1 = src-element.1 : Les propri\u00E9t\u00E9s ''default'' et ''fixed'' ne peuvent pas figurer simultan\u00E9ment dans la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. Utilisez uniquement l''une d''entre elles. - src-element.2.1 = src-element.2.1 : 'ref' ou 'name' doit figurer dans les d\u00E9clarations d''\u00E9l\u00E9ment local. + src-element.2.1 = src-element.2.1 : 'ref' ou 'name' doit figurer dans les d\u00E9clarations d'\u00E9l\u00E9ment local. src-element.2.2 = src-element.2.2 : Puisque ''{0}'' contient l''attribut ''ref'', son contenu doit concorder avec (annotation?). Cependant, ''{1}'' a \u00E9t\u00E9 trouv\u00E9. src-element.3 = src-element.3 : L''\u00E9l\u00E9ment ''{0}'' pr\u00E9sente un attribut ''type'' et un enfant ''anonymous type''. Seul un d''entre eux est autoris\u00E9 dans un \u00E9l\u00E9ment. src-import.1.1 = src-import.1.1 : L''attribut namespace "{0}" d''un \u00E9l\u00E9ment d''information d''\u00E9l\u00E9ment ne doit pas \u00EAtre identique \u00E0 l''attribut targetNamespace du sch\u00E9ma dans lequel il figure. @@ -180,12 +177,12 @@ cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a : Le type de contenu d''un type d\u00E9riv\u00E9 et celui de sa base doivent tous les deux \u00EAtre mixtes (mixed) ou \u00E9l\u00E9ment uniquement (element-only). Le type ''{0}'' est \u00E9l\u00E9ment uniquement, mais le type de sa base ne l''est pas. cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b : Le type de contenu d''un type d\u00E9riv\u00E9 et celui de sa base doivent tous les deux \u00EAtre mixtes (mixed) ou \u00E9l\u00E9ment uniquement (element-only). Le type ''{0}'' est mixte, mais le type de sa base ne l''est pas. cos-element-consistent = cos-element-consistent : Erreur dans le type ''{0}''. Plusieurs \u00E9l\u00E9ments portant le nom ''{1}'', de divers types, figurent dans le groupe de mod\u00E8les. - cos-list-of-atomic = cos-list-of-atomic : Dans la d\u00E9finition du type de liste ''{0}'', le type ''{1}'' est un type d''\u00E9l\u00E9ment de liste non valide car il n''est pas non d\u00E9composable (''{1}'' est un type de liste ou un type d''union contenant une liste). + cos-list-of-atomic = cos-list-of-atomic : Dans la d\u00E9finition du type de liste ''{0}'', le type ''{1}'' est un type d''\u00E9l\u00E9ment de liste non valide car il n''est pas atomique (''{1}'' est un type de liste ou un type d''union contenant une liste). cos-nonambig = cos-nonambig : {0} et {1} (ou des \u00E9l\u00E9ments de leur groupe de substitution) violent la r\u00E8gle d''attribution de particule unique (Unique Particle Attribution). Au cours de la validation par rapport \u00E0 ce sch\u00E9ma, ces deux particules peuvent devenir ambigu\u00EBs. cos-particle-restrict.a = cos-particle-restrict.a : La particule d\u00E9riv\u00E9e est vide et la base ne peut pas \u00EAtre vide. cos-particle-restrict.b = cos-particle-restrict.b : La particule de base est vide, mais la particule d\u00E9riv\u00E9e ne l'est pas. cos-particle-restrict.2 = cos-particle-restrict.2 : Restriction de particule interdite : ''{0}''. - cos-st-restricts.1.1 = cos-st-restricts.1.1 : Le type ''{1}'' \u00E9tant non d\u00E9composable, sa valeur ''{''base type definition''}'', ''{0}'', doit \u00EAtre une d\u00E9finition de type simple non d\u00E9composable ou un type de donn\u00E9es primitif int\u00E9gr\u00E9. + cos-st-restricts.1.1 = cos-st-restricts.1.1 : Le type ''{1}'' \u00E9tant non d\u00E9composable, sa valeur ''{''base type definition''}'', ''{0}'', doit \u00EAtre une d\u00E9finition de type simple atomique ou un type de donn\u00E9es primitif int\u00E9gr\u00E9. cos-st-restricts.2.1 = cos-st-restricts.2.1 : Dans la d\u00E9finition du type de liste ''{0}'', le type ''{1}'' est un type d''\u00E9l\u00E9ment non valide car il s''agit d''un type de liste ou un type d''union contenant une liste. cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1 : Le composant ''{''final''}'' de la valeur ''{''item type definition''}'', ''{0}'', contient ''list''. Cela signifie que la valeur ''{0}'' ne peut pas \u00EAtre utilis\u00E9e en tant que type d''\u00E9l\u00E9ment pour le type de liste ''{1}''. cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1 : Le composant ''{''final''}'' de la valeur ''{''member type definitions''}'', ''{0}'', contient ''union''. Cela signifie que la valeur ''{0}'' ne peut pas \u00EAtre utilis\u00E9e en tant que type de membre pour le type d''union ''{1}''. @@ -268,7 +265,7 @@ rcase-NSCompat.2 = rcase-NSCompat.2 : Erreur dans la particule o\u00F9 la valeur ''{''term''}'' est la d\u00E9claration d''\u00E9l\u00E9ment ''{0}''. Sa plage d''occurrences, ({1},{2}), n''est pas une restriction valide de la plage ({3},{4}) de la particule correspondante dans le type de base. rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1 : Aucune mise en correspondance fonctionnelle compl\u00E8te entre les particules. rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage \u00E0 caract\u00E8re g\u00E9n\u00E9rique de la base, ({2},{3}). - rcase-NSSubset.1 = rcase-NSSubset.1 : Le caract\u00E8re g\u00E9n\u00E9rique n'est pas un sous-ensemble de caract\u00E8res g\u00E9n\u00E9riques correspondant dans la base. + rcase-NSSubset.1 = rcase-NSSubset.1 : Le caract\u00E8re g\u00E9n\u00E9rique n'est pas un sous-ensemble du caract\u00E8re g\u00E9n\u00E9rique correspondant dans la base. rcase-NSSubset.2 = rcase-NSSubset.2 : La plage d''occurrences du caract\u00E8re g\u00E9n\u00E9rique, ({0},{1}), n''est pas une restriction valide de celle de la base, ({2},{3}). rcase-NSSubset.3 = rcase-NSSubset.3 : Le contenu de processus de caract\u00E8re g\u00E9n\u00E9rique, ''{0}'', est plus faible que celui figurant dans la base, ''{1}''. rcase-Recurse.1 = rcase-Recurse.1 : La plage d''occurrences du groupe, ({0},{1}), n''est pas une restriction valide de la plage d''occurrences du groupe de base, ({2},{3}). diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties index 4153c6d2219..7f4caa83e71 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n @@ -43,19 +40,19 @@ # Identity constraints AbsentKeyValue = Errore del vincolo di identit\u00E0 (cvc-identity-constraint.4.2.1): l''elemento "{0}" ha una chiave senza alcun valore. - DuplicateField = Corrispondenza duplicata nell''ambito per il campo \"{0}\". + DuplicateField = Corrispondenza duplicata nell''ambito per il campo "{0}". DuplicateKey = Valore chiave duplicato [{0}] dichiarato per il vincolo di identit\u00E0 dell''elemento "{1}". DuplicateUnique = Valore univoco duplicato [{0}] dichiarato per il vincolo di identit\u00E0 dell''elemento "{1}". FieldMultipleMatch = Errore del vincolo di identit\u00E0: il campo "{0}" corrisponde a pi\u00F9 valori nell''ambito del proprio selettore; i campi devono corrispondere a valori univoci. - FixedDiffersFromActual = Il contenuto di questo elemento non equivale al valore dell'attributo \"fixed\" nella dichiarazione dell'elemento nello schema. + FixedDiffersFromActual = Il contenuto di questo elemento non equivale al valore dell'attributo "fixed" nella dichiarazione dell'elemento nello schema. KeyMatchesNillable = Errore del vincolo di identit\u00E0 (cvc-identity-constraint.4.2.3): l''elemento "{0}" ha una chiave corrispondente a un elemento con un valore annullabile impostato su true. - KeyNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento \"{0}\". + KeyNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento "{0}". KeyNotFound = Chiave "{0}"con valore "{1}" non trovata per il vincolo di identit\u00E0 dell''elemento "{2}". - KeyRefNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento \"{0}\". - KeyRefOutOfScope = Errore del vincolo di identit\u00E0: il vincolo di identit\u00E0 \"{0}\" ha un keyref che fa riferimento a una chiave o a un valore univoco fuori ambito. - KeyRefReferNotFound = La dichiarazione \"{0}\" del riferimento chiave fa riferimento a una chiave sconosciuta denominata \"{1}\". - UniqueNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento \"{0}\". - UnknownField = Errore interno del vincolo di identit\u00E0; campo \"{0}\" sconosciuto + KeyRefNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento "{0}". + KeyRefOutOfScope = Errore del vincolo di identit\u00E0: il vincolo di identit\u00E0 "{0}" ha un keyref che fa riferimento a una chiave o a un valore univoco fuori ambito. + KeyRefReferNotFound = La dichiarazione "{0}" del riferimento chiave fa riferimento a una chiave sconosciuta denominata "{1}". + UniqueNotEnoughValues = Valori insufficienti forniti per il vincolo di identit\u00E0 specificato per l''elemento "{0}". + UnknownField = Errore interno del vincolo di identit\u00E0; campo "{0}" sconosciuto # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: lettura del documento di schema ''{0}'' non riuscita. Accesso ''{1}'' non consentito. schema_reference.4 = schema_reference.4: lettura del documento di schema "{0}" non riuscita perch\u00E9 1) non \u00E8 stato possibile trovare il documento; 2) non \u00E8 stato possibile leggere il documento; 3) l''elemento radice del documento non \u00E8 . src-annotation = src-annotation: possono essere contenuti soltanto elementi e , ma \u00E8 stato trovato ''{0}''. src-attribute.1 = src-attribute.1: le propriet\u00E0 ''default'' e ''fixed'' non possono essere entrambi presenti nella dichiarazione di attributo ''{0}''. Utilizzarne solo una. @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Il tipo di contenuto di un tipo derivato e quello della rispettiva base devono essere entrambi misti o di soli elementi. Il tipo ''{0}'' \u00E8 misto, mentre la rispettiva base non lo \u00E8. cos-element-consistent = cos-element-consistent: errore per il tipo "{0}". Nel gruppo di modelli appaiono pi\u00F9 elementi con nome "{1}" e tipi diversi. cos-list-of-atomic = cos-list-of-atomic: nella definizione del tipo di lista ''{0}'', il tipo ''{1}'' non \u00E8 valido poich\u00E9 non \u00E8 indivisibile (''{1}'' \u00E8 un tipo di lista o un tipo di unione che contiene una lista). - cos-nonambig = cos-nonambig: {0} e {1} (o gli elementi derivanti dal gruppo di sostituzione) violano \"Unique Particle Attribution\". Durante la convalida su questo schema, si creerebbe un''ambiguit\u00E0 per le due parti. + cos-nonambig = cos-nonambig: {0} e {1} (o gli elementi derivanti dal gruppo di sostituzione) violano "Unique Particle Attribution". Durante la convalida su questo schema, si creerebbe un''ambiguit\u00E0 per le due parti. cos-particle-restrict.a = cos-particle-restrict.a: la parte derivata \u00E8 vuota, mente la base non \u00E8 svuotabile. cos-particle-restrict.b = cos-particle-restrict.b: la parte della base \u00E8 vuota, mente la parte derivata non lo \u00E8. cos-particle-restrict.2 = cos-particle-restrict.2: limitazione di parte vietata: ''{0}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties index 9fe30e2e67d..063f82c7597 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.1): \u8981\u7D20\"{0}\"\u306B\u5024\u306E\u306A\u3044\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002 - DuplicateField = \u30D5\u30A3\u30FC\u30EB\u30C9\"{0}\"\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u4E00\u81F4\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 - DuplicateKey = \u8981\u7D20\"{1}\"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Fkey\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 - DuplicateUnique = \u8981\u7D20\"{1}\"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Funique\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 - FieldMultipleMatch = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9\"{0}\"\u304C\u30BB\u30EC\u30AF\u30BF\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u306E\u8907\u6570\u306E\u5024\u3068\u4E00\u81F4\u3057\u3066\u3044\u307E\u3059\u3002\u30D5\u30A3\u30FC\u30EB\u30C9\u306Funique\u306E\u5024\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 - FixedDiffersFromActual = \u3053\u306E\u8981\u7D20\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u3001\u30B9\u30AD\u30FC\u30DE\u5185\u306E\u8981\u7D20\u5BA3\u8A00\u3067\u306E\"fixed\"\u5C5E\u6027\u306E\u5024\u3068\u7570\u306A\u308A\u307E\u3059\u3002 - KeyMatchesNillable = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.3): \u8981\u7D20\"{0}\"\u306B\u306F\u3001nillable\u304Ctrue\u3067\u3042\u308B\u8981\u7D20\u3068\u4E00\u81F4\u3059\u308B\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002 - KeyNotEnoughValues = \u8981\u7D20\"{0}\"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + AbsentKeyValue = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.1): \u8981\u7D20"{0}"\u306B\u5024\u306E\u306A\u3044\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002 + DuplicateField = \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u4E00\u81F4\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 + DuplicateKey = \u8981\u7D20"{1}"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Fkey\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 + DuplicateUnique = \u8981\u7D20"{1}"\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u5BA3\u8A00\u3055\u308C\u305Funique\u306E\u5024[{0}]\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002 + FieldMultipleMatch = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u304C\u30BB\u30EC\u30AF\u30BF\u306E\u30B9\u30B3\u30FC\u30D7\u5185\u306E\u8907\u6570\u306E\u5024\u3068\u4E00\u81F4\u3057\u3066\u3044\u307E\u3059\u3002\u30D5\u30A3\u30FC\u30EB\u30C9\u306Funique\u306E\u5024\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 + FixedDiffersFromActual = \u3053\u306E\u8981\u7D20\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u3001\u30B9\u30AD\u30FC\u30DE\u5185\u306E\u8981\u7D20\u5BA3\u8A00\u3067\u306E"fixed"\u5C5E\u6027\u306E\u5024\u3068\u7570\u306A\u308A\u307E\u3059\u3002 + KeyMatchesNillable = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC(cvc-identity-constraint.4.2.3): \u8981\u7D20"{0}"\u306B\u306F\u3001nillable\u304Ctrue\u3067\u3042\u308B\u8981\u7D20\u3068\u4E00\u81F4\u3059\u308B\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059\u3002 + KeyNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 KeyNotFound = \u8981\u7D20''{2}''\u306E\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u3067\u3001\u5024''{1}''\u306E\u30AD\u30FC''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 - KeyRefNotEnoughValues = \u8981\u7D20\"{0}\"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - KeyRefOutOfScope = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\"{0}\"\u306B\u3001\u30B9\u30B3\u30FC\u30D7\u5916\u306Ekey\u3084unique\u3092\u53C2\u7167\u3057\u3066\u3044\u308Bkeyref\u304C\u3042\u308A\u307E\u3059\u3002 - KeyRefReferNotFound = \u30AD\u30FC\u53C2\u7167\u306E\u5BA3\u8A00\"{0}\"\u304C\u3001\"{1}\"\u3068\u3044\u3046\u540D\u524D\u306E\u4E0D\u660E\u306A\u30AD\u30FC\u3092\u53C2\u7167\u3057\u3066\u3044\u307E\u3059\u3002 - UniqueNotEnoughValues = \u8981\u7D20\"{0}\"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 - UnknownField = \u5185\u90E8\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9\"{0}\"\u304C\u4E0D\u660E\u3067\u3059\u3002 + KeyRefNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + KeyRefOutOfScope = \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04"{0}"\u306B\u3001\u30B9\u30B3\u30FC\u30D7\u5916\u306Ekey\u3084unique\u3092\u53C2\u7167\u3057\u3066\u3044\u308Bkeyref\u304C\u3042\u308A\u307E\u3059\u3002 + KeyRefReferNotFound = \u30AD\u30FC\u53C2\u7167\u306E\u5BA3\u8A00"{0}"\u304C\u3001"{1}"\u3068\u3044\u3046\u540D\u524D\u306E\u4E0D\u660E\u306A\u30AD\u30FC\u3092\u53C2\u7167\u3057\u3066\u3044\u307E\u3059\u3002 + UniqueNotEnoughValues = \u8981\u7D20"{0}"\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u306B\u3001\u5341\u5206\u306A\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 + UnknownField = \u5185\u90E8\u30A2\u30A4\u30C7\u30F3\u30C6\u30A3\u30C6\u30A3\u5236\u7D04\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9"{0}"\u304C\u4E0D\u660E\u3067\u3059\u3002 # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: ''{1}''\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 schema_reference.4 = schema_reference.4: 1)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304C\u898B\u3064\u304B\u3089\u306A\u304B\u3063\u305F\u30012)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u53D6\u308C\u306A\u304B\u3063\u305F\u30013)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30EB\u30FC\u30C8\u8981\u7D20\u304C\u3067\u306F\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u30FB\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8''{0}''\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 src-annotation = src-annotation: \u8981\u7D20\u306B\u542B\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u308B\u306E\u306F\u8981\u7D20\u304A\u3088\u3073\u8981\u7D20\u306E\u307F\u3067\u3059\u304C\u3001''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002 src-attribute.1 = src-attribute.1: ''default''\u3068''fixed''\u306E\u4E21\u65B9\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u5C5E\u6027\u5BA3\u8A00''{0}''\u306B\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002\u3044\u305A\u308C\u304B\u4E00\u65B9\u306E\u307F\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \u5C0E\u51FA\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u3068\u305D\u306E\u30D9\u30FC\u30B9\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u30FB\u30BF\u30A4\u30D7\u306F\u4E21\u65B9\u3068\u3082\u6DF7\u5408\u578B\u306B\u3059\u308B\u304B\u3001\u8981\u7D20\u306E\u307F\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30BF\u30A4\u30D7''{0}''\u306F\u6DF7\u5408\u578B\u3067\u3059\u304C\u3001\u305D\u306E\u30D9\u30FC\u30B9\u30FB\u30BF\u30A4\u30D7\u306F\u6DF7\u5408\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 cos-element-consistent = cos-element-consistent: \u30BF\u30A4\u30D7''{0}''\u306E\u30A8\u30E9\u30FC\u3002''{1}''\u3068\u3044\u3046\u540D\u524D\u306E\u7570\u306A\u308B\u30BF\u30A4\u30D7\u306E\u8907\u6570\u306E\u8981\u7D20\u304C\u30E2\u30C7\u30EB\u30FB\u30B0\u30EB\u30FC\u30D7\u306B\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002 cos-list-of-atomic = cos-list-of-atomic: \u30BF\u30A4\u30D7''{1}''\u306F\u30A2\u30C8\u30DF\u30C3\u30AF\u3067\u306F\u306A\u3044\u305F\u3081(''{1}''\u306F\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7\u304B\u3001\u30EA\u30B9\u30C8\u3092\u542B\u3080\u5171\u7528\u4F53\u30BF\u30A4\u30D7\u3067\u3042\u308B\u305F\u3081)\u3001\u30EA\u30B9\u30C8\u30FB\u30BF\u30A4\u30D7''{0}''\u306E\u5B9A\u7FA9\u3067\u306F\u7121\u52B9\u306A\u30EA\u30B9\u30C8\u8981\u7D20\u30BF\u30A4\u30D7\u3067\u3059\u3002 - cos-nonambig = cos-nonambig: {0}\u3068{1} (\u307E\u305F\u306F\u7F6E\u63DB\u30B0\u30EB\u30FC\u30D7\u306E\u8981\u7D20)\u304C\"Unique Particle Attribution\"\u306B\u9055\u53CD\u3057\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30B9\u30AD\u30FC\u30DE\u306B\u5BFE\u3059\u308B\u691C\u8A3C\u6642\u306B\u3001\u3053\u308C\u30892\u3064\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u3042\u3044\u307E\u3044\u3055\u304C\u751F\u3058\u308B\u3068\u8003\u3048\u3089\u308C\u307E\u3059\u3002 + cos-nonambig = cos-nonambig: {0}\u3068{1} (\u307E\u305F\u306F\u7F6E\u63DB\u30B0\u30EB\u30FC\u30D7\u306E\u8981\u7D20)\u304C"Unique Particle Attribution"\u306B\u9055\u53CD\u3057\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30B9\u30AD\u30FC\u30DE\u306B\u5BFE\u3059\u308B\u691C\u8A3C\u6642\u306B\u3001\u3053\u308C\u30892\u3064\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306B\u3042\u3044\u307E\u3044\u3055\u304C\u751F\u3058\u308B\u3068\u8003\u3048\u3089\u308C\u307E\u3059\u3002 cos-particle-restrict.a = cos-particle-restrict.a: \u5C0E\u51FA\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u304C\u7A7A\u3067\u3042\u308A\u3001\u30D9\u30FC\u30B9\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002 cos-particle-restrict.b = cos-particle-restrict.b: \u30D9\u30FC\u30B9\u306E\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u7A7A\u3067\u3059\u304C\u3001\u5C0E\u51FA\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306F\u7A7A\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 cos-particle-restrict.2 = cos-particle-restrict.2: \u7981\u6B62\u3055\u308C\u305F\u30D1\u30FC\u30C6\u30A3\u30AF\u30EB\u306E\u5236\u9650: ''{0}''\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties index a6a77f32186..2a21d78161f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.1): \"{0}\" \uC694\uC18C\uC5D0 \uAC12\uC774 \uC5C6\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4. - DuplicateField = \"{0}\" \uD544\uB4DC \uBC94\uC704\uC5D0 \uC911\uBCF5 \uC0AC\uD56D\uC774 \uC788\uC2B5\uB2C8\uB2E4. - DuplicateKey = \uC911\uBCF5 \uD0A4 \uAC12 [{0}]\uC774(\uAC00) \"{1}\" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - DuplicateUnique = \uC911\uBCF5 \uACE0\uC720 \uAC12 [{0}]\uC774(\uAC00) \"{1}\" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - FieldMultipleMatch = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: \"{0}\" \uD544\uB4DC\uAC00 \uD574\uB2F9 \uC120\uD0DD\uAE30 \uBC94\uC704 \uB0B4\uC5D0 \uD3EC\uD568\uB41C \uC5EC\uB7EC \uAC12\uACFC \uC77C\uCE58\uD569\uB2C8\uB2E4. \uD544\uB4DC\uB294 \uACE0\uC720 \uAC12\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. - FixedDiffersFromActual = \uC774 \uC694\uC18C\uC758 \uCF58\uD150\uCE20\uAC00 \uC2A4\uD0A4\uB9C8\uC758 \uC694\uC18C \uC120\uC5B8\uC5D0 \uC788\uB294 \"fixed\" \uC18D\uC131\uAC12\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - KeyMatchesNillable = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.3): \"{0}\" \uC694\uC18C\uC5D0 nillable\uC774 true\uB85C \uC124\uC815\uB41C \uC694\uC18C\uC640 \uC77C\uCE58\uD558\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4. - KeyNotEnoughValues = \"{0}\" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. + AbsentKeyValue = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.1): "{0}" \uC694\uC18C\uC5D0 \uAC12\uC774 \uC5C6\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4. + DuplicateField = "{0}" \uD544\uB4DC \uBC94\uC704\uC5D0 \uC911\uBCF5 \uC0AC\uD56D\uC774 \uC788\uC2B5\uB2C8\uB2E4. + DuplicateKey = \uC911\uBCF5 \uD0A4 \uAC12 [{0}]\uC774(\uAC00) "{1}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + DuplicateUnique = \uC911\uBCF5 \uACE0\uC720 \uAC12 [{0}]\uC774(\uAC00) "{1}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC120\uC5B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. + FieldMultipleMatch = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: "{0}" \uD544\uB4DC\uAC00 \uD574\uB2F9 \uC120\uD0DD\uAE30 \uBC94\uC704 \uB0B4\uC5D0 \uD3EC\uD568\uB41C \uC5EC\uB7EC \uAC12\uACFC \uC77C\uCE58\uD569\uB2C8\uB2E4. \uD544\uB4DC\uB294 \uACE0\uC720 \uAC12\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4. + FixedDiffersFromActual = \uC774 \uC694\uC18C\uC758 \uCF58\uD150\uCE20\uAC00 \uC2A4\uD0A4\uB9C8\uC758 \uC694\uC18C \uC120\uC5B8\uC5D0 \uC788\uB294 "fixed" \uC18D\uC131\uAC12\uACFC \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. + KeyMatchesNillable = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958(cvc-identity-constraint.4.2.3): "{0}" \uC694\uC18C\uC5D0 nillable\uC774 true\uB85C \uC124\uC815\uB41C \uC694\uC18C\uC640 \uC77C\uCE58\uD558\uB294 \uD0A4\uAC00 \uC788\uC2B5\uB2C8\uB2E4. + KeyNotEnoughValues = "{0}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. KeyNotFound = ''{2}'' \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uAC12\uC774 ''{1}''\uC778 ''{0}'' \uD0A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. - KeyRefNotEnoughValues = \"{0}\" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. - KeyRefOutOfScope = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: ID \uC81C\uC57D \uC870\uAC74 \"{0}\"\uC758 keyref\uAC00 \uBC94\uC704\uC5D0\uC11C \uBC97\uC5B4\uB09C \uD0A4 \uB610\uB294 \uACE0\uC720 \uD56D\uBAA9\uC744 \uCC38\uC870\uD569\uB2C8\uB2E4. - KeyRefReferNotFound = \uD0A4 \uCC38\uC870 \uC120\uC5B8 \"{0}\"\uC740(\uB294) \uC774\uB984\uC774 \"{1}\"\uC778 \uC54C \uC218 \uC5C6\uB294 \uD0A4\uB97C \uCC38\uC870\uD569\uB2C8\uB2E4. - UniqueNotEnoughValues = \"{0}\" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. - UnknownField = \uB0B4\uBD80 ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: \"{0}\"\uC740(\uB294) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uC785\uB2C8\uB2E4. + KeyRefNotEnoughValues = "{0}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. + KeyRefOutOfScope = ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: ID \uC81C\uC57D \uC870\uAC74 "{0}"\uC758 keyref\uAC00 \uBC94\uC704\uC5D0\uC11C \uBC97\uC5B4\uB09C \uD0A4 \uB610\uB294 \uACE0\uC720 \uD56D\uBAA9\uC744 \uCC38\uC870\uD569\uB2C8\uB2E4. + KeyRefReferNotFound = \uD0A4 \uCC38\uC870 \uC120\uC5B8 "{0}"\uC740(\uB294) \uC774\uB984\uC774 "{1}"\uC778 \uC54C \uC218 \uC5C6\uB294 \uD0A4\uB97C \uCC38\uC870\uD569\uB2C8\uB2E4. + UniqueNotEnoughValues = "{0}" \uC694\uC18C\uC758 ID \uC81C\uC57D \uC870\uAC74\uC5D0 \uB300\uD574 \uC9C0\uC815\uB41C \uAC12\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. + UnknownField = \uB0B4\uBD80 ID \uC81C\uC57D \uC870\uAC74 \uC624\uB958: "{0}"\uC740(\uB294) \uC54C \uC218 \uC5C6\uB294 \uD544\uB4DC\uC785\uB2C8\uB2E4. # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: ''{1}'' \uC561\uC138\uC2A4\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC544 \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. schema_reference.4 = schema_reference.4: \uC2A4\uD0A4\uB9C8 \uBB38\uC11C ''{0}'' \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC6D0\uC778: 1) \uBB38\uC11C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 2) \uBB38\uC11C\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 3) \uBB38\uC11C\uC758 \uB8E8\uD2B8 \uC694\uC18C\uAC00 \uAC00 \uC544\uB2D9\uB2C8\uB2E4. src-annotation = src-annotation: \uC694\uC18C\uC5D0\uB294 \uBC0F \uC694\uC18C\uB9CC \uD3EC\uD568\uB420 \uC218 \uC788\uC9C0\uB9CC ''{0}''\uC774(\uAC00) \uBC1C\uACAC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. src-attribute.1 = src-attribute.1: ''default'' \uBC0F ''fixed'' \uC18D\uC131\uC740 \uC18D\uC131 \uC120\uC5B8 ''{0}''\uC5D0 \uD568\uAED8 \uC874\uC7AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD558\uB098\uB9CC \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \uD30C\uC0DD\uB41C \uC720\uD615\uACFC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC758 \uCF58\uD150\uCE20 \uC720\uD615\uC740 \uBAA8\uB450 \uD63C\uD569\uB418\uAC70\uB098 \uBAA8\uB450 \uC694\uC18C \uC804\uC6A9\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. ''{0}'' \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0\uB9CC \uD574\uB2F9 \uAE30\uBCF8 \uC720\uD615\uC740 \uD63C\uD569\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. cos-element-consistent = cos-element-consistent: ''{0}'' \uC720\uD615\uC5D0 \uB300\uD574 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. \uC774\uB984\uC774 ''{1}''\uC774\uBA70 \uC720\uD615\uC774 \uB2E4\uB978 \uC5EC\uB7EC \uC694\uC18C\uAC00 \uBAA8\uB378 \uADF8\uB8F9\uC5D0 \uB098\uD0C0\uB0A9\uB2C8\uB2E4. cos-list-of-atomic = cos-list-of-atomic: \uBAA9\uB85D \uC720\uD615 ''{0}''\uC758 \uC815\uC758\uC5D0\uC11C ''{1}'' \uC720\uD615\uC740 \uAE30\uBCF8 \uB2E8\uC704\uAC00 \uC544\uB2C8\uBBC0\uB85C \uBD80\uC801\uD569\uD55C \uBAA9\uB85D \uC694\uC18C \uC720\uD615\uC785\uB2C8\uB2E4. ''{1}''\uC774(\uAC00) \uBAA9\uB85D \uC720\uD615\uC774\uAC70\uB098 \uBAA9\uB85D\uC744 \uD3EC\uD568\uD558\uB294 \uD569\uC9D1\uD569 \uC720\uD615\uC785\uB2C8\uB2E4. - cos-nonambig = cos-nonambig: {0} \uBC0F {1}(\uB610\uB294 \uD574\uB2F9 \uB300\uCCB4 \uADF8\uB8F9\uC758 \uC694\uC18C)\uC774(\uAC00) \"Unique Particle Attribution\"\uC744 \uC704\uBC18\uD569\uB2C8\uB2E4. \uC774 \uC2A4\uD0A4\uB9C8\uC5D0 \uB300\uD55C \uAC80\uC99D \uC911 \uC774\uB7EC\uD55C \uB450 \uC870\uAC01\uC774 \uBAA8\uD638\uD574\uC9C8 \uC218 \uC788\uC2B5\uB2C8\uB2E4. + cos-nonambig = cos-nonambig: {0} \uBC0F {1}(\uB610\uB294 \uD574\uB2F9 \uB300\uCCB4 \uADF8\uB8F9\uC758 \uC694\uC18C)\uC774(\uAC00) "Unique Particle Attribution"\uC744 \uC704\uBC18\uD569\uB2C8\uB2E4. \uC774 \uC2A4\uD0A4\uB9C8\uC5D0 \uB300\uD55C \uAC80\uC99D \uC911 \uC774\uB7EC\uD55C \uB450 \uC870\uAC01\uC774 \uBAA8\uD638\uD574\uC9C8 \uC218 \uC788\uC2B5\uB2C8\uB2E4. cos-particle-restrict.a = cos-particle-restrict.a: \uD30C\uC0DD\uB41C \uC870\uAC01\uC774 \uBE44\uC5B4 \uC788\uC73C\uBBC0\uB85C \uAE30\uBCF8 \uC870\uAC01\uC744 \uBE44\uC6B8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. cos-particle-restrict.b = cos-particle-restrict.b: \uAE30\uBCF8 \uC870\uAC01\uC740 \uBE44\uC5B4 \uC788\uC9C0\uB9CC \uD30C\uC0DD\uB41C \uC870\uAC01\uC740 \uBE44\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. cos-particle-restrict.2 = cos-particle-restrict.2: \uAE08\uC9C0\uB41C \uC870\uAC01 \uC81C\uD55C \uC0AC\uD56D: ''{0}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties index 163fc6d2b4a..8e0eec53908 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = Erro de Restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.1): o elemento \"{0}\" tem uma chave sem valor. - DuplicateField = Correspond\u00EAncia duplicada no escopo do campo \"{0}\". - DuplicateKey = Valor da chave duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento \"{1}\". - DuplicateUnique = Valor exclusivo duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento \"{1}\". - FieldMultipleMatch = Erro de restri\u00E7\u00E3o de identidade: o campo \"{0}\" corresponde a mais de um valor no escopo deste seletor; os campos devem corresponder a valores exclusivos. - FixedDiffersFromActual = O conte\u00FAdo deste elemento n\u00E3o \u00E9 equivalente ao valor do atributo \"fixed\" na declara\u00E7\u00E3o do elemento do esquema. - KeyMatchesNillable = Erro de restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.3): o elemento \"{0}\" tem uma chave que corresponde a um elemento o qual tem anul\u00E1vel definido como verdadeiro. - KeyNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de especificada para o elemento \"{0}\". + AbsentKeyValue = Erro de Restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.1): o elemento "{0}" tem uma chave sem valor. + DuplicateField = Correspond\u00EAncia duplicada no escopo do campo "{0}". + DuplicateKey = Valor da chave duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento "{1}". + DuplicateUnique = Valor exclusivo duplicado [{0}] declarado para a restri\u00E7\u00E3o de identidade do elemento "{1}". + FieldMultipleMatch = Erro de restri\u00E7\u00E3o de identidade: o campo "{0}" corresponde a mais de um valor no escopo deste seletor; os campos devem corresponder a valores exclusivos. + FixedDiffersFromActual = O conte\u00FAdo deste elemento n\u00E3o \u00E9 equivalente ao valor do atributo "fixed" na declara\u00E7\u00E3o do elemento do esquema. + KeyMatchesNillable = Erro de restri\u00E7\u00E3o de identidade (cvc-identity-constraint.4.2.3): o elemento "{0}" tem uma chave que corresponde a um elemento o qual tem anul\u00E1vel definido como verdadeiro. + KeyNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de especificada para o elemento "{0}". KeyNotFound = Chave ''{0}'' com valor ''{1}'' n\u00E3o encontrada para a restri\u00E7\u00E3o de identidade do elemento ''{2}''. - KeyRefNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de especificada para o elemento \"{0}\". - KeyRefOutOfScope = Erro de restri\u00E7\u00E3o de identidade: a restri\u00E7\u00E3o de identidade \"{0}\" tem uma keyref que se refere a uma chave exclusiva a qual est\u00E1 fora do escopo. - KeyRefReferNotFound = A declara\u00E7\u00E3o de refer\u00EAncia da chave \"{0}\" refere-se a uma chave com o nome \"{1}\". - UniqueNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade especificada para o elemento \"{0}\". - UnknownField = Erro interno de restri\u00E7\u00E3o de identidade; campo desconhecido \"{0}\". + KeyRefNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade de especificada para o elemento "{0}". + KeyRefOutOfScope = Erro de restri\u00E7\u00E3o de identidade: a restri\u00E7\u00E3o de identidade "{0}" tem uma keyref que se refere a uma chave exclusiva a qual est\u00E1 fora do escopo. + KeyRefReferNotFound = A declara\u00E7\u00E3o de refer\u00EAncia da chave "{0}" refere-se a uma chave com o nome "{1}". + UniqueNotEnoughValues = N\u00E3o h\u00E1 valores suficientes especificados para a restri\u00E7\u00E3o de identidade especificada para o elemento "{0}". + UnknownField = Erro interno de restri\u00E7\u00E3o de identidade; campo desconhecido "{0}". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: falha ao ler o documento ''{0}'' do esquema porque o acesso a ''{1}'' n\u00E3o \u00E9 permitido. schema_reference.4 = schema_reference.4: Falha ao ler o documento do esquema ''{0}'' porque 1) n\u00E3o foi poss\u00EDvel encontrar o documento; 2) n\u00E3o foi poss\u00EDvel ler o documento; 3) o elemento-raiz do documento n\u00E3o \u00E9 . src-annotation = src-annotation: os elementos de podem conter somente os elementos e , mas foi encontrado ''{0}''. src-attribute.1 = src-attribute.1: As propriedades ''default'' e ''fixed'' n\u00E3o podem estar presentes na declara\u00E7\u00E3o do atributo ''{0}''. Use somente uma delas. @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: O tipo de conte\u00FAdo de um tipo derivado e sua base devem ser mistos ou ambos devem ser somente de elemento. O tipo ''{0}'' \u00E9 misto, mas seu tipo de base n\u00E3o \u00E9. cos-element-consistent = cos-element-consistent: Erro do tipo ''{0}''. V\u00E1rios elementos com o nome ''{1}'' com diferentes tipos aparecem no grupo de modelos. cos-list-of-atomic = cos-list-of-atomic: Na defini\u00E7\u00E3o do tipo de lista ''{0}'', o tipo ''{1}'' \u00E9 um tipo de elemento da lista inv\u00E1lido porque n\u00E3o \u00E9 at\u00F4mico (''{1}'' \u00E9 um tipo de lista ou um tipo de uni\u00E3o que cont\u00E9m uma lista). - cos-nonambig = cos-nonambig: {0} e {1} (ou elementos de seu grupo de substitui\u00E7\u00E3o) violam a \"Unique Particle Attribution\". Durante a valida\u00E7\u00E3o deste esquema, a ambiguidade ser\u00E1 criada para essas duas part\u00EDculas. + cos-nonambig = cos-nonambig: {0} e {1} (ou elementos de seu grupo de substitui\u00E7\u00E3o) violam a "Unique Particle Attribution". Durante a valida\u00E7\u00E3o deste esquema, a ambiguidade ser\u00E1 criada para essas duas part\u00EDculas. cos-particle-restrict.a = cos-particle-restrict.a: A part\u00EDcula obtida est\u00E1 vazia e a base n\u00E3o pode ser esvaziada. cos-particle-restrict.b = cos-particle-restrict.b: A part\u00EDcula base est\u00E1 vazia, mas a part\u00EDcula obtida n\u00E3o est\u00E1. cos-particle-restrict.2 = cos-particle-restrict.2: Restri\u00E7\u00E3o de part\u00EDcula proibida: ''{0}''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties index 4cc42ca5eb5..f29bfa177be 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.1): elementet \"{0}\" har en nyckel som saknar v\u00E4rde. - DuplicateField = Dubblettmatchning inom omfattningen av f\u00E4ltet \"{0}\". - DuplicateKey = Duplicerat nyckelv\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet \"{1}\". - DuplicateUnique = Duplicerat unikt v\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet \"{1}\". - FieldMultipleMatch = Fel vid id-begr\u00E4nsning: f\u00E4ltet \"{0}\" matchar fler \u00E4n ett v\u00E4rde inom omfattningen av v\u00E4ljaren; f\u00E4lt m\u00E5ste matcha unika v\u00E4rden. - FixedDiffersFromActual = Elementets inneh\u00E5ll motsvarar inte v\u00E4rdet av attributet som anges som \"fixed\" i elementdeklarationen i schemat. - KeyMatchesNillable = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.3): elementet \"{0}\" har en nyckel som matchar ett element med nullbart v\u00E4rde angivet som true. - KeyNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet \"{0}\". + AbsentKeyValue = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.1): elementet "{0}" har en nyckel som saknar v\u00E4rde. + DuplicateField = Dubblettmatchning inom omfattningen av f\u00E4ltet "{0}". + DuplicateKey = Duplicerat nyckelv\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet "{1}". + DuplicateUnique = Duplicerat unikt v\u00E4rde [{0}] har deklarerats f\u00F6r id-begr\u00E4nsning av elementet "{1}". + FieldMultipleMatch = Fel vid id-begr\u00E4nsning: f\u00E4ltet "{0}" matchar fler \u00E4n ett v\u00E4rde inom omfattningen av v\u00E4ljaren; f\u00E4lt m\u00E5ste matcha unika v\u00E4rden. + FixedDiffersFromActual = Elementets inneh\u00E5ll motsvarar inte v\u00E4rdet av attributet som anges som "fixed" i elementdeklarationen i schemat. + KeyMatchesNillable = Fel vid id-begr\u00E4nsning (cvc-identity-constraint.4.2.3): elementet "{0}" har en nyckel som matchar ett element med nullbart v\u00E4rde angivet som true. + KeyNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet "{0}". KeyNotFound = Nyckeln ''{0}'' med v\u00E4rdet ''{1}'' hittades inte f\u00F6r id-begr\u00E4nsning f\u00F6r element ''{2}''. - KeyRefNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet \"{0}\". - KeyRefOutOfScope = Fel vid id-begr\u00E4nsning: id-begr\u00E4nsning \"{0}\" har en nyckelreferens som refererar till nyckel eller unikt v\u00E4rde utanf\u00F6r definitionsomr\u00E5det. - KeyRefReferNotFound = Nyckelreferensdeklarationen \"{0}\" refererar till ok\u00E4nd nyckel med namnet \"{1}\". - UniqueNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet \"{0}\". - UnknownField = Fel vid intern id-begr\u00E4nsning; ok\u00E4nt f\u00E4lt \"{0}\". + KeyRefNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet "{0}". + KeyRefOutOfScope = Fel vid id-begr\u00E4nsning: id-begr\u00E4nsning "{0}" har en nyckelreferens som refererar till nyckel eller unikt v\u00E4rde utanf\u00F6r definitionsomr\u00E5det. + KeyRefReferNotFound = Nyckelreferensdeklarationen "{0}" refererar till ok\u00E4nd nyckel med namnet "{1}". + UniqueNotEnoughValues = Det finns inte tillr\u00E4ckligt m\u00E5nga v\u00E4rden angivna f\u00F6r som id-begr\u00E4nsning f\u00F6r elementet "{0}". + UnknownField = Fel vid intern id-begr\u00E4nsning; ok\u00E4nt f\u00E4lt "{0}". # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -63,7 +60,7 @@ #validation (3.X.4) cvc-attribute.3 = cvc-attribute.3: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' har ogiltig typ, ''{3}''. - cvc-attribute.4 = cvc-attribute.4: V\u00E4rdet \''{2}\'' f\u00F6r attributet \''{1}\'' i elementet \''{0}\'' har ogiltig fast \''{\''v\u00E4rdebegr\u00E4nsning\''}\''. Attributet m\u00E5ste ha v\u00E4rdet \''{3}\''. + cvc-attribute.4 = cvc-attribute.4: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' har ogiltig fast ''{''v\u00E4rdebegr\u00E4nsning''}''. Attributet m\u00E5ste ha v\u00E4rdet ''{3}''. cvc-complex-type.2.1 = cvc-complex-type.2.1: Elementet ''{0}'' f\u00E5r inte ha [underordnade] objekt med tecken- eller elementinformation, eftersom inneh\u00E5llstyp \u00E4r tomt. cvc-complex-type.2.2 = cvc-complex-type.2.2: Elementet ''{0}'' f\u00E5r inte ha [underordnade] element och v\u00E4rdet m\u00E5ste vara giltigt. cvc-complex-type.2.3 = cvc-complex-type.2.3: Elementet ''{0}'' f\u00E5r inte ha [underordnade] tecken, eftersom inneh\u00E5llstyp \u00E4r endast element. @@ -77,19 +74,19 @@ cvc-complex-type.3.2.2 = cvc-complex-type.3.2.2: Attributet ''{1}'' \u00E4r inte till\u00E5tet i elementet ''{0}''. cvc-complex-type.4 = cvc-complex-type.4: Attributet ''{1}'' m\u00E5ste anger i elementet ''{0}''. cvc-complex-type.5.1 = cvc-complex-type.5.1: I elementet ''{0}'' \u00E4r attributet ''{1}'' ett joker-id. Joker-id ''{2}'' finns redan och endast ett id kan anv\u00E4ndas. - cvc-complex-type.5.2 = cvc-complex-type.5.2: I elementet ''{0}'' \u00E4r attributet ''{1}'' ett joker-id. Det finns redan ett attribut ''{2}'' som tas fr\u00E5n id bland \''{\''attributanv\u00E4ndningar\''}\''. + cvc-complex-type.5.2 = cvc-complex-type.5.2: I elementet ''{0}'' \u00E4r attributet ''{1}'' ett joker-id. Det finns redan ett attribut ''{2}'' som tas fr\u00E5n id bland ''{''attributanv\u00E4ndningar''}''. cvc-datatype-valid.1.2.1 = cvc-datatype-valid.1.2.1: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r ''{1}''. cvc-datatype-valid.1.2.2 = cvc-datatype-valid.1.2.2: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r listtyp ''{1}''. cvc-datatype-valid.1.2.3 = cvc-datatype-valid.1.2.3: ''{0}'' \u00E4r inte n\u00E5got giltigt v\u00E4rde f\u00F6r uniontyp ''{1}''. cvc-elt.1 = cvc-elt.1: Kan inte hitta deklarationen f\u00F6r elementet ''{0}''. - cvc-elt.2 = cvc-elt.2: V\u00E4rdet f\u00F6r \''{\''abstrakt\''}\'' i elementdeklarationen f\u00F6r ''{0}'' m\u00E5ste anges som false. - cvc-elt.3.1 = cvc-elt.3.1: Attributet ''{1}'' f\u00E5r inte anges i elementet ''{0}'', eftersom \''{\''nullbar\''}\'' egenskap f\u00F6r ''{0}'' har angetts som false. + cvc-elt.2 = cvc-elt.2: V\u00E4rdet f\u00F6r ''{''abstrakt''}'' i elementdeklarationen f\u00F6r ''{0}'' m\u00E5ste anges som false. + cvc-elt.3.1 = cvc-elt.3.1: Attributet ''{1}'' f\u00E5r inte anges i elementet ''{0}'', eftersom ''{''nullbar''}'' egenskap f\u00F6r ''{0}'' har angetts som false. cvc-elt.3.2.1 = cvc-elt.3.2.1: Elementet ''{0}'' f\u00E5r inte inneh\u00E5lla [underordnade] med tecken- eller elementinformation eftersom ''{1}'' har angetts. - cvc-elt.3.2.2 = cvc-elt.3.2.2: Det f\u00E5r inte finnas n\u00E5gon fast \''{\''v\u00E4rdebegr\u00E4nsning\''}\'' f\u00F6r elementet ''{0}'' eftersom ''{1}'' har angetts. + cvc-elt.3.2.2 = cvc-elt.3.2.2: Det f\u00E5r inte finnas n\u00E5gon fast ''{''v\u00E4rdebegr\u00E4nsning''}'' f\u00F6r elementet ''{0}'' eftersom ''{1}'' har angetts. cvc-elt.4.1 = cvc-elt.4.1: V\u00E4rdet ''{2}'' f\u00F6r attributet ''{1}'' i elementet ''{0}'' \u00E4r inte n\u00E5got giltigt QName. cvc-elt.4.2 = cvc-elt.4.2: Kan inte matcha ''{1}'' med typdefinition f\u00F6r elementet ''{0}''. cvc-elt.4.3 = cvc-elt.4.3: Typ ''{1}'' \u00E4r inte giltigt att tas fr\u00E5n typdefinitionen ''{2}'' i elementet ''{0}''. - cvc-elt.5.1.1 = cvc-elt.5.1.1: \''{\''v\u00E4rdebegr\u00E4nsning\''}\'' ''{2}'' i elementet ''{0}'' \u00E4r inte n\u00E5got giltigt standardv\u00E4rde f\u00F6r typ ''{1}''. + cvc-elt.5.1.1 = cvc-elt.5.1.1: ''{''v\u00E4rdebegr\u00E4nsning''}'' ''{2}'' i elementet ''{0}'' \u00E4r inte n\u00E5got giltigt standardv\u00E4rde f\u00F6r typ ''{1}''. cvc-elt.5.2.2.1 = cvc-elt.5.2.2.1: Elementet ''{0}'' f\u00E5r inte ha [underordnade] objekt med elementinformation. cvc-elt.5.2.2.2.1 = cvc-elt.5.2.2.2.1: V\u00E4rdet ''{1}'' i elementet ''{0}'' matchar inte v\u00E4rdet med fast ''{''v\u00E4rdebegr\u00E4nsning''}'', ''{2}''. cvc-elt.5.2.2.2.2 = cvc-elt.5.2.2.2.2: V\u00E4rdet ''{1}'' i elementet ''{0}'' matchar inte v\u00E4rdet med ''{''v\u00E4rdebegr\u00E4nsning''}'', ''{2}''. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: Kunde inte l\u00E4sa schemadokument ''{0}'', eftersom ''{1}'' \u00E5tkomst inte till\u00E5ts. schema_reference.4 = schema_reference.4: L\u00E4sning av schemadokument ''{0}'' utf\u00F6rdes inte p\u00E5 grund av 1) det g\u00E5r inte att hitta dokumentet; 2) det g\u00E5r inte att l\u00E4sa dokumentet; 3) dokumentets rotelement \u00E4r inte . src-annotation = src-annotation: element f\u00F6r f\u00E5r endast inneh\u00E5lla element f\u00F6r och , men ''{0}'' hittades. src-attribute.1 = src-attribute.1: B\u00E5da egenskaperna ''default'' och ''fixed'' kan inte samtidigt ing\u00E5 i attributdeklarationen ''{0}''. Anv\u00E4nd en av dem. @@ -171,31 +168,31 @@ ag-props-correct.2 = ag-props-correct.2: Ett fel intr\u00E4ffade f\u00F6r attributgruppen ''{0}''. Duplicerad attributanv\u00E4ndning med samma namn och namnrymd. Namnet p\u00E5 dubbletten \u00E4r ''{1}''. ag-props-correct.3 = ag-props-correct.3: Ett fel intr\u00E4ffade f\u00F6r attributgruppen ''{0}''. Tv\u00E5 attributdeklarationer, ''{1}'' och ''{2}'' har angetts med typer som h\u00E4rleds fr\u00E5n ID. a-props-correct.2 = a-props-correct.2: Ogiltigt v\u00E4rde f\u00F6r begr\u00E4nsning, ''{1}'', i attributet ''{0}''. - a-props-correct.3 = a-props-correct.3: Attributet ''{0}'' f\u00E5r inte anv\u00E4nda ''fixed'' eller ''default'', eftersom attributets \''{\''typdefinition\''}\'' \u00E4r ID eller h\u00E4rleds fr\u00E5n ID. - au-props-correct.2 = au-props-correct.2: Det fasta v\u00E4rdet ''{1}'' har angetts i attributdeklarationen ''{0}''. Om attributet som refererar till ''{0}'' \u00E4ven inneh\u00E5ller en \''{\''v\u00E4rdebegr\u00E4nsning\''}\'' m\u00E5ste du l\u00F6sa detta och ange v\u00E4rdet ''{1}''. + a-props-correct.3 = a-props-correct.3: Attributet ''{0}'' f\u00E5r inte anv\u00E4nda ''fixed'' eller ''default'', eftersom attributets ''{''typdefinition''}'' \u00E4r ID eller h\u00E4rleds fr\u00E5n ID. + au-props-correct.2 = au-props-correct.2: Det fasta v\u00E4rdet ''{1}'' har angetts i attributdeklarationen ''{0}''. Om attributet som refererar till ''{0}'' \u00E4ven inneh\u00E5ller en ''{''v\u00E4rdebegr\u00E4nsning''}'' m\u00E5ste du l\u00F6sa detta och ange v\u00E4rdet ''{1}''. cos-all-limited.1.2 = cos-all-limited.1.2: En 'all'-modellgrupp m\u00E5ste anges i en partikel med '{'min f\u00F6rekomster'}' = '{'max f\u00F6rekomster'}' = 1 och partikeln m\u00E5ste vara en del i ett par som utg\u00F6r '{'inneh\u00E5llstyp'}' i en komplex typdefinition. - cos-all-limited.2 = cos-all-limited.2: V\u00E4rdet f\u00F6r \''{\''max f\u00F6rekomster\''}\'' i ett element i en ''all''-modellgrupp m\u00E5ste vara 0 eller 1. V\u00E4rdet ''{0}'' f\u00F6r elementet ''{1}'' \u00E4r ogiltigt. + cos-all-limited.2 = cos-all-limited.2: V\u00E4rdet f\u00F6r ''{''max f\u00F6rekomster''}'' i ett element i en ''all''-modellgrupp m\u00E5ste vara 0 eller 1. V\u00E4rdet ''{0}'' f\u00F6r elementet ''{1}'' \u00E4r ogiltigt. cos-applicable-facets = cos-applicable-facets: Aspekten (facet) ''{0}'' \u00E4r inte till\u00E5ten med typ {1}. cos-ct-extends.1.1 = cos-ct-extends.1.1: Typ ''{0}'' h\u00E4rleds fr\u00E5n ett till\u00E4gg fr\u00E5n typ ''{1}''. Attributet ''final'' i ''{1}'' till\u00E5ter dock inte h\u00E4rledning av till\u00E4gg. cos-ct-extends.1.4.3.2.2.1.a = cos-ct-extends.1.4.3.2.2.1.a: Inneh\u00E5llstyp f\u00F6r h\u00E4rledd typ och f\u00F6r basen m\u00E5ste b\u00E5da vara blandade eller endast element. Typ ''{0}'' \u00E4r endast element, men d\u00E4remot inte basen. cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: Inneh\u00E5llstyp f\u00F6r h\u00E4rledd typ och f\u00F6r basen m\u00E5ste b\u00E5da vara blandade eller endast element. Typ ''{0}'' \u00E4r blandat, men d\u00E4remot inte basen. cos-element-consistent = cos-element-consistent: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Flera element med namnet ''{1}'', med olika typer, har angetts i modellgruppen. cos-list-of-atomic = cos-list-of-atomic: I definitionen av listtyp ''{0}'' \u00E4r typ ''{1}'' en ogiltig typ av listelement eftersom den inte \u00E4r atomisk (''{1}'' \u00E4r antingen en listtyp eller en uniontyp som inneh\u00E5ller en lista). - cos-nonambig = cos-nonambig: {0} och {1} (eller element fr\u00E5n ers\u00E4ttningsgruppen) bryter mot \"Unique Particle Attribution\". Detta skapar tvetydighet f\u00F6r partiklarna vid validering gentemot detta schema. + cos-nonambig = cos-nonambig: {0} och {1} (eller element fr\u00E5n ers\u00E4ttningsgruppen) bryter mot "Unique Particle Attribution". Detta skapar tvetydighet f\u00F6r partiklarna vid validering gentemot detta schema. cos-particle-restrict.a = cos-particle-restrict.a: H\u00E4rledd partikel \u00E4r tom och basen \u00E4r inte t\u00F6mningsbar. cos-particle-restrict.b = cos-particle-restrict.b: Baspartikeln \u00E4r tom, men den h\u00E4rledda partikeln \u00E4r inte det. cos-particle-restrict.2 = cos-particle-restrict.2: F\u00F6rbjuden partikelbegr\u00E4nsning: ''{0}''. - cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' \u00E4r atomisk och d\u00E4rf\u00F6r m\u00E5ste \''{\''bastypdefinitionen\''}\'', ''{0}'', anges som atomisk enkel typ eller inbyggd primitiv datatyp. + cos-st-restricts.1.1 = cos-st-restricts.1.1: Typ ''{1}'' \u00E4r atomisk och d\u00E4rf\u00F6r m\u00E5ste ''{''bastypdefinitionen''}'', ''{0}'', anges som atomisk enkel typ eller inbyggd primitiv datatyp. cos-st-restricts.2.1 = cos-st-restricts.2.1: I definitionen av listtyp ''{0}'' \u00E4r typ ''{1}'' en ogiltig objekttyp eftersom det \u00E4r antingen en listtyp eller en uniontyp som inneh\u00E5ller en lista. - cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Den \''{\''sista\''}\'' komponenten i \''{\''objekttypdefinitionen\''}\'', ''{0}'', inneh\u00E5ller ''list''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som objekttyp f\u00F6r listtyp ''{1}''. - cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Den ''{''sista''}'' komponenten i \''{\''medlemtypdefinitionerna\''}\'', ''{0}'', inneh\u00E5ller ''union''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som medlemstyp f\u00F6r uniontyp ''{1}''. + cos-st-restricts.2.3.1.1 = cos-st-restricts.2.3.1.1: Den ''{''sista''}'' komponenten i ''{''objekttypdefinitionen''}'', ''{0}'', inneh\u00E5ller ''list''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som objekttyp f\u00F6r listtyp ''{1}''. + cos-st-restricts.3.3.1.1 = cos-st-restricts.3.3.1.1: Den ''{''sista''}'' komponenten i ''{''medlemtypdefinitionerna''}'', ''{0}'', inneh\u00E5ller ''union''. Detta betyder att ''{0}'' inte kan anv\u00E4ndas som medlemstyp f\u00F6r uniontyp ''{1}''. cos-valid-default.2.1 = cos-valid-default.2.1: Elementet ''{0}'' har en v\u00E4rdebegr\u00E4nsning och m\u00E5ste ha en blandad eller enkel inneh\u00E5llsmodell. - cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Eftersom elementet ''{0}'' har en \''{\''v\u00E4rdebegr\u00E4nsning\''}\'' och typdefinitionen har blandad \''{\''inneh\u00E5llstyp\''}\'' s\u00E5 m\u00E5ste partikeln av \''{\''inneh\u00E5llstyp\''}\'' vara t\u00F6mningsbar. + cos-valid-default.2.2.2 = cos-valid-default.2.2.2: Eftersom elementet ''{0}'' har en ''{''v\u00E4rdebegr\u00E4nsning''}'' och typdefinitionen har blandad ''{''inneh\u00E5llstyp''}'' s\u00E5 m\u00E5ste partikeln av ''{''inneh\u00E5llstyp''}'' vara t\u00F6mningsbar. c-props-correct.2 = c-props-correct.2: Kardinalitet av f\u00E4lt med nyckelreferens ''{0}'' och nyckel ''{1}'' m\u00E5ste matcha varandra. ct-props-correct.3 = ct-props-correct.3: Cirkul\u00E4ra definitioner har identifierats f\u00F6r komplex typ ''{0}''. Detta inneb\u00E4r att ''{0}'' ing\u00E5r i sin egen typhierarki, vilket \u00E4r fel. ct-props-correct.4 = ct-props-correct.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Duplicerad attributanv\u00E4ndning med samma namn och namnrymd. Namnet p\u00E5 dubbletten \u00E4r ''{1}''. ct-props-correct.5 = ct-props-correct.5: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Tv\u00E5 attributdeklarationer, ''{1}'' och ''{2}'', anv\u00E4nds med typer som h\u00E4rleds fr\u00E5n ID. - derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' h\u00E4rleddes genom begr\u00E4nsning fr\u00E5n typ ''{1}''. ''{1}'' har d\u00E4remot en \''{\''slutlig\''}\'' egenskap som f\u00F6rbjuder h\u00E4rledning via begr\u00E4nsning. + derivation-ok-restriction.1 = derivation-ok-restriction.1: Typ ''{0}'' h\u00E4rleddes genom begr\u00E4nsning fr\u00E5n typ ''{1}''. ''{1}'' har d\u00E4remot en ''{''slutlig''}'' egenskap som f\u00F6rbjuder h\u00E4rledning via begr\u00E4nsning. derivation-ok-restriction.2.1.1 = derivation-ok-restriction.2.1.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har ''use''-v\u00E4rdet ''{2}'' vilket inte \u00E4r konsekvent med v\u00E4rdet f\u00F6r ''required'' i matchande attributanv\u00E4ndning i bastypen. derivation-ok-restriction.2.1.2 = derivation-ok-restriction.2.1.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har typ ''{2}'', som inte f\u00E5r h\u00E4rledas fr\u00E5n ''{3}'', typ i matchande attributanv\u00E4ndning i bastypen. derivation-ok-restriction.2.1.3.a = derivation-ok-restriction.2.1.3.a: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Attributanv\u00E4ndning ''{1}'' i denna typ har en effektiv v\u00E4rdebegr\u00E4nsning som inte \u00E4r fast, medan den effektiva v\u00E4rdebegr\u00E4nsningen i matchande attributanv\u00E4ndning i bastypen \u00E4r fast. @@ -210,11 +207,11 @@ derivation-ok-restriction.5.3.2 = derivation-ok-restriction.5.3.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Inneh\u00E5llstypen f\u00F6r denna typ \u00E4r tom, men inneh\u00E5llstypen f\u00F6r basen, ''{1}'', \u00E4r inte tom eller t\u00F6mningsbar. derivation-ok-restriction.5.4.1.2 = derivation-ok-restriction.5.4.1.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Inneh\u00E5llstypen f\u00F6r denna typ \u00E4r blandad, medan inneh\u00E5llstypen f\u00F6r basen, ''{1}'', inte \u00E4r det. derivation-ok-restriction.5.4.2 = derivation-ok-restriction.5.4.2: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. Typpartikeln \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r partikeln i basen. - enumeration-required-notation = enumeration-required-notation: NOTATION-typ, ''{0}'' anv\u00E4nds av {2} ''{1}'', m\u00E5ste anges med uppr\u00E4kningsv\u00E4rde som specificerar de notationselement som anv\u00E4nds av denna typ. + enumeration-required-notation = enumeration-required-notation: NOTATION-typ, ''{0}'' anv\u00E4nds av {2} ''{1}'', m\u00E5ste anges med uppr\u00E4kningsaspektv\u00E4rde som specificerar de notationselement som anv\u00E4nds av denna typ. enumeration-valid-restriction = enumeration-valid-restriction: Uppr\u00E4kningsv\u00E4rdet ''{0}'' finns inte i bastypens, {1}, v\u00E4rdeutrymme. e-props-correct.2 = e-props-correct.2: Ogiltigt v\u00E4rde f\u00F6r begr\u00E4nsningsv\u00E4rde ''{1}'' i elementet ''{0}''. - e-props-correct.4 = e-props-correct.4: \''{\''Typdefinition\''}\'' f\u00F6r elementet ''{0}'' har en ogiltig h\u00E4rledning fr\u00E5n \''{\''typdefinitionen\''}\'' f\u00F6r substitutionHead ''{1}'' eller s\u00E5 till\u00E5ts inte denna h\u00E4rledning av egenskapen ''{1}'' f\u00F6r \''{\''ers\u00E4ttningsgruppexkluderingar\''}\''. - e-props-correct.5 = e-props-correct.5: En \''{\''v\u00E4rdebegr\u00E4nsning\''}\'' f\u00E5r inte finnas med i elementet ''{0}'' eftersom elementets \''{\''typdefinition\''}\'' eller \''{\''typdefinitionens\''}\'' \''{\''inneh\u00E5llstyp\''}\'' \u00E4r ID, eller h\u00E4rleds fr\u00E5n ID. + e-props-correct.4 = e-props-correct.4: ''{''Typdefinition''}'' f\u00F6r elementet ''{0}'' har en ogiltig h\u00E4rledning fr\u00E5n ''{''typdefinitionen''}'' f\u00F6r substitutionHead ''{1}'' eller s\u00E5 till\u00E5ts inte denna h\u00E4rledning av egenskapen ''{1}'' f\u00F6r ''{''ers\u00E4ttningsgruppexkluderingar''}''. + e-props-correct.5 = e-props-correct.5: En ''{''v\u00E4rdebegr\u00E4nsning''}'' f\u00E5r inte finnas med i elementet ''{0}'' eftersom elementets ''{''typdefinition''}'' eller ''{''typdefinitionens''}'' ''{''inneh\u00E5llstyp''}'' \u00E4r ID, eller h\u00E4rleds fr\u00E5n ID. e-props-correct.6 = e-props-correct.6: Cirkul\u00E4r ers\u00E4ttningsgrupp identifierades f\u00F6r elementet ''{0}''. fractionDigits-valid-restriction = fractionDigits-valid-restriction: I definitionen f\u00F6r {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''fractionDigits'' ogiltigt eftersom det m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''fractionDigits'' som har angetts som ''{1}'' i n\u00E5gon typ f\u00F6r \u00F6verordnad. fractionDigits-totalDigits = fractionDigits-totalDigits: I definitionen av {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''fractionDigits'' ogiltigt eftersom v\u00E4rdet m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''totalDigits'' som \u00E4r ''{1}''. @@ -235,7 +232,7 @@ maxInclusive-valid-restriction.3 = maxInclusive-valid-restriction.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minInclusive i bastyp ''{1}''. maxInclusive-valid-restriction.4 = maxInclusive-valid-restriction.4: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. maxInclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n minExclusive i bastyp ''{1}''. maxLength-valid-restriction = maxLength-valid-restriction: I definitionen f\u00F6r {2} m\u00E5ste maxLength-v\u00E4rdet ''{0}'' vara mindre \u00E4n eller lika med v\u00E4rdet i bastyp ''{1}''. - mg-props-correct.2 = mg-props-correct.2: Cirkul\u00E4ra definitioner identifierades f\u00F6r gruppen ''{0}''. Rekursivt efterf\u00F6ljande v\u00E4rdena f\u00F6r \''{\''term\''}\'' i partiklarna leder till en partikel vars \''{\''term\''}\'' \u00E4r den ursprungliga gruppen. + mg-props-correct.2 = mg-props-correct.2: Cirkul\u00E4ra definitioner identifierades f\u00F6r gruppen ''{0}''. Rekursivt efterf\u00F6ljande v\u00E4rdena f\u00F6r ''{''term''}'' i partiklarna leder till en partikel vars ''{''term''}'' \u00E4r den ursprungliga gruppen. minExclusive-less-than-equal-to-maxExclusive = minExclusive-less-than-equal-to-maxExclusive: I definitionen f\u00F6r {2} m\u00E5ste minExclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n eller lika med maxExclusive-v\u00E4rdet ''{1}''. minExclusive-less-than-maxInclusive = minExclusive-less-than-maxInclusive: I definitionen f\u00F6r {2} m\u00E5ste minExclusive-v\u00E4rdet ''{0}'' vara mindre \u00E4n maxInclusive-v\u00E4rdet ''{1}''. minExclusive-valid-restriction.1 = minExclusive-valid-restriction.1: Ett fel intr\u00E4ffade f\u00F6r typ ''{2}''. minExclusive-v\u00E4rdet ''{0}'' m\u00E5ste vara st\u00F6rre \u00E4n eller lika med minExclusive i bastyp ''{1}''. @@ -252,20 +249,20 @@ minLength-less-than-equal-to-maxLength = minLength-less-than-equal-to-maxLength: I definitionen f\u00F6r {2} m\u00E5ste minLength-v\u00E4rdet ''{0}'' vara mindre \u00E4n maxLength-v\u00E4rdet ''{1}''. minLength-valid-restriction = minLength-valid-restriction: I definitionen f\u00F6r {2} m\u00E5ste minLength-v\u00E4rdet ''{0}'' vara st\u00F6rre \u00E4n eller lika med v\u00E4rdet i bastyp ''{1}''. no-xmlns = no-xmlns: Ett {namn} p\u00E5 en attributdeklaration f\u00E5r inte matcha 'xmlns'. - no-xsi = no-xsi: En \''{\''m\u00E5lnamnrymd\''}\'' i en attributdeklaration f\u00E5r inte matcha ''{0}''. + no-xsi = no-xsi: En ''{''m\u00E5lnamnrymd''}'' i en attributdeklaration f\u00E5r inte matcha ''{0}''. p-props-correct.2.1 = p-props-correct.2.1: I deklarationen ''{0}'' \u00E4r v\u00E4rdet f\u00F6r ''minOccurs'' ''{1}'', men det f\u00E5r inte vara st\u00F6rre \u00E4n v\u00E4rdet f\u00F6r ''maxOccurs'' (som \u00E4r ''{2}''). rcase-MapAndSum.1 = rcase-MapAndSum.1: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna. rcase-MapAndSum.2 = rcase-MapAndSum.2: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basgruppens f\u00F6rekomstintervall, ({2},{3}). rcase-NameAndTypeOK.1 = rcase-NameAndTypeOK.1: Element har namn och m\u00E5lnamnrymder som inte \u00E4r desamma: Elementet ''{0}'' i namnrymd ''{1}'' och elementet ''{2}'' i namnrymd ''{3}''. - rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars \''{\''term\''}\'' \u00E4r elementdeklarationen ''{0}''. Elementdeklarationens v\u00E4rde som \u00E4r \''{\''nullbart\''}\'' har angetts som true, men motsvarande partikel i bastypen har en elementdeklaration vars v\u00E4rde som \u00E4r \''{\''nullbart\''}\'' har angetts som false. - rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Ett fel intr\u00E4ffade f\u00F6r partikeln vars \''{\''term\''}\'' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen. + rcase-NameAndTypeOK.2 = rcase-NameAndTypeOK.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars ''{''term''}'' \u00E4r elementdeklarationen ''{0}''. Elementdeklarationens v\u00E4rde som \u00E4r ''{''nullbart''}'' har angetts som true, men motsvarande partikel i bastypen har en elementdeklaration vars v\u00E4rde som \u00E4r ''{''nullbart''}'' har angetts som false. + rcase-NameAndTypeOK.3 = rcase-NameAndTypeOK.3: Ett fel intr\u00E4ffade f\u00F6r partikeln vars ''{''term''}'' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen. rcase-NameAndTypeOK.4.a = rcase-NameAndTypeOK.4.a: Elementet ''{0}'' har inte n\u00E5got fast v\u00E4rde, men motsvarande element i bastypen har angetts med det fasta v\u00E4rdet ''{1}''. rcase-NameAndTypeOK.4.b = rcase-NameAndTypeOK.4.b: Elementet ''{0}'' har det fasta v\u00E4rdet ''{1}'', men motsvarande element i bastypen har angetts med det fasta v\u00E4rdet ''{2}''. rcase-NameAndTypeOK.5 = rcase-NameAndTypeOK.5: Identitetsbegr\u00E4nsningarna f\u00F6r elementet ''{0}'' \u00E4r inte n\u00E5gon del av de som finns i basen. rcase-NameAndTypeOK.6 = rcase-NameAndTypeOK.6: De avaktiverade ers\u00E4ttningarna f\u00F6r elementet ''{0}'' \u00E4r inte inneslutna i basen. rcase-NameAndTypeOK.7 = rcase-NameAndTypeOK.7: Elementtyp ''{0}'', ''{1}'' h\u00E4rleds inte fr\u00E5n typ av baselement, ''{2}''. rcase-NSCompat.1 = rcase-NSCompat.1: Elementet ''{0}'' har namnrymden ''{1}'' som inte \u00E4r till\u00E5tet av jokertecknet i basen. - rcase-NSCompat.2 = rcase-NSCompat.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars \''{\''term\''}\'' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen. + rcase-NSCompat.2 = rcase-NSCompat.2: Ett fel intr\u00E4ffade f\u00F6r partikeln vars ''{''term''}'' \u00E4r elementdeklarationen ''{0}''. F\u00F6rekomstintervallet, ({1},{2}), \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r intervallet, ({3},{4}, i motsvarande partikel i bastypen. rcase-NSRecurseCheckCardinality.1 = rcase-NSRecurseCheckCardinality.1: Det finns ingen fullst\u00E4ndigt fungerande mappning mellan partiklarna. rcase-NSRecurseCheckCardinality.2 = rcase-NSRecurseCheckCardinality.2: Gruppens f\u00F6rekomstintervall ({0},{1}) \u00E4r inte n\u00E5gon giltig begr\u00E4nsning f\u00F6r basjokertecknets intervall, ({2},{3}). rcase-NSSubset.1 = rcase-NSSubset.1: Jokertecknet \u00E4r inte n\u00E5gon del av motsvarande jokertecken i basen. @@ -281,7 +278,7 @@ # src-redefine.1 = src-redefine.1: The component ''{0}'' is begin redefined, but its corresponding component isn't in the schema document being redefined (with namespace ''{2}''), but in a different document, with namespace ''{1}''. sch-props-correct.2 = sch-props-correct.2: Ett schema kan inte inneh\u00E5lla tv\u00E5 globala komponenter med samma namn. Detta schema har tv\u00E5 f\u00F6rekomster av ''{0}''. st-props-correct.2 = st-props-correct.2: Cirkul\u00E4ra definitioner har identifierats f\u00F6r enkel typ ''{0}''. Detta inneb\u00E4r att ''{0}'' ing\u00E5r i sin egen typhierarki, vilket \u00E4r fel. - st-props-correct.3 = st-props-correct.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. V\u00E4rdet f\u00F6r \''{\''slutgiltigt\''}\'' i \''{\''bastypdefinitionen\''}\'', ''{1}'', f\u00F6rbjuder h\u00E4rledning med begr\u00E4nsning. + st-props-correct.3 = st-props-correct.3: Ett fel intr\u00E4ffade f\u00F6r typ ''{0}''. V\u00E4rdet f\u00F6r ''{''slutgiltigt''}'' i ''{''bastypdefinitionen''}'', ''{1}'', f\u00F6rbjuder h\u00E4rledning med begr\u00E4nsning. totalDigits-valid-restriction = totalDigits-valid-restriction: I definitionen f\u00F6r {2} \u00E4r v\u00E4rdet ''{0}'' f\u00F6r ''totalDigits'' ogiltigt eftersom det m\u00E5ste vara mindre \u00E4n eller lika med v\u00E4rdet f\u00F6r ''totalDigits'' som har angetts som ''{1}'' i n\u00E5gon typ f\u00F6r \u00F6verordnad. whiteSpace-valid-restriction.1 = whiteSpace-valid-restriction.1: I definitionen f\u00F6r {0} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r ''whitespace'' ogiltigt, eftersom v\u00E4rdet f\u00F6r ''whitespace'' har angetts som ''collapse'' i n\u00E5gon typ f\u00F6r \u00F6verordnad. whiteSpace-valid-restriction.2 = whiteSpace-valid-restriction.2: I definitionen f\u00F6r {0} \u00E4r v\u00E4rdet ''preserve'' f\u00F6r ''whitespace'' ogiltigt, eftersom v\u00E4rdet f\u00F6r ''whitespace'' har angetts som ''replace'' i n\u00E5gon typ f\u00F6r \u00F6verordnad. @@ -309,7 +306,7 @@ c-selector-xpath = c-selector-xpath: V\u00E4ljarv\u00E4rdet ''{0}'' \u00E4r ogiltigt; xpath f\u00F6r v\u00E4ljare f\u00E5r inte inneh\u00E5lla attribut. EmptyTargetNamespace = EmptyTargetNamespace: I schemadokumentet ''{0}'' f\u00E5r v\u00E4rdet f\u00F6r attributet ''targetNamespace'' inte vara en tom str\u00E4ng. FacetValueFromBase = FacetValueFromBase: I deklarationen av typ ''{0}'' m\u00E5ste v\u00E4rdet ''{1}'' f\u00F6r aspekt ''{2}'' komma fr\u00E5n v\u00E4rdeutrymmet i bastypen ''{3}''. - FixedFacetValue = FixedFacetValue: I definitionen f\u00F6r {3} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r aspekten ''{0}'' ogiltigt eftersom v\u00E4rdet f\u00F6r ''{0}'' har angetts som ''{2}'' i n\u00E5gon av typerna f\u00F6r \u00F6verordnade samtidigt som \''{\''fast\''}\'' = true. + FixedFacetValue = FixedFacetValue: I definitionen f\u00F6r {3} \u00E4r v\u00E4rdet ''{1}'' f\u00F6r aspekten ''{0}'' ogiltigt eftersom v\u00E4rdet f\u00F6r ''{0}'' har angetts som ''{2}'' i n\u00E5gon av typerna f\u00F6r \u00F6verordnade samtidigt som ''{''fast''}'' = true. InvalidRegex = InvalidRegex: M\u00F6nsterv\u00E4rdet ''{0}'' \u00E4r inte n\u00E5got giltigt regulj\u00E4rt uttryck. Det rapporterade felet \u00E4r: ''{1}'' i kolumn ''{2}''. maxOccurLimit = Den aktuella konfigurationen f\u00F6r parsern till\u00E5ter inte att attributv\u00E4rdet f\u00F6r Occurs anges som st\u00F6rre \u00E4n v\u00E4rdet {0}. PublicSystemOnNotation = PublicSystemOnNotation: \u00C5tminstone ett av ''public'' och ''system'' m\u00E5ste anges i elementets ''notation''. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties index f517a72a2cd..2fdc0884edc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.1): \u5143\u7D20 \"{0}\" \u7684\u4E00\u4E2A\u5173\u952E\u5B57\u6CA1\u6709\u503C\u3002 - DuplicateField = \u5B57\u6BB5 \"{0}\" \u5728\u4F5C\u7528\u57DF\u5185\u6709\u91CD\u590D\u5339\u914D\u3002 - DuplicateKey = \u4E3A\u5143\u7D20 \"{1}\" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u5173\u952E\u5B57\u503C [{0}] \u91CD\u590D\u3002 - DuplicateUnique = \u4E3A\u5143\u7D20 \"{1}\" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u552F\u4E00\u503C [{0}] \u91CD\u590D\u3002 - FieldMultipleMatch = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u5B57\u6BB5 \"{0}\" \u4E0E\u5176\u9009\u62E9\u5668\u4F5C\u7528\u57DF\u5185\u7684\u591A\u4E2A\u503C\u5339\u914D; \u5B57\u6BB5\u5FC5\u987B\u4E0E\u552F\u4E00\u503C\u5339\u914D\u3002 - FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5185\u5BB9\u4E0E\u65B9\u6848\u4E2D\u5143\u7D20\u58F0\u660E\u7684 \"fixed\" \u5C5E\u6027\u7684\u503C\u4E0D\u76F8\u540C\u3002 - KeyMatchesNillable = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.3): \u5143\u7D20 \"{0}\" \u5177\u6709\u4E00\u4E2A\u4E0E nillable \u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u7684\u5143\u7D20\u5339\u914D\u7684\u5173\u952E\u5B57\u3002 - KeyNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 + AbsentKeyValue = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.1): \u5143\u7D20 "{0}" \u7684\u4E00\u4E2A\u5173\u952E\u5B57\u6CA1\u6709\u503C\u3002 + DuplicateField = \u5B57\u6BB5 "{0}" \u5728\u4F5C\u7528\u57DF\u5185\u6709\u91CD\u590D\u5339\u914D\u3002 + DuplicateKey = \u4E3A\u5143\u7D20 "{1}" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u5173\u952E\u5B57\u503C [{0}] \u91CD\u590D\u3002 + DuplicateUnique = \u4E3A\u5143\u7D20 "{1}" \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u58F0\u660E\u7684\u552F\u4E00\u503C [{0}] \u91CD\u590D\u3002 + FieldMultipleMatch = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u5B57\u6BB5 "{0}" \u4E0E\u5176\u9009\u62E9\u5668\u4F5C\u7528\u57DF\u5185\u7684\u591A\u4E2A\u503C\u5339\u914D; \u5B57\u6BB5\u5FC5\u987B\u4E0E\u552F\u4E00\u503C\u5339\u914D\u3002 + FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5185\u5BB9\u4E0E\u65B9\u6848\u4E2D\u5143\u7D20\u58F0\u660E\u7684 "fixed" \u5C5E\u6027\u7684\u503C\u4E0D\u76F8\u540C\u3002 + KeyMatchesNillable = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF (cvc-identity-constraint.4.2.3): \u5143\u7D20 "{0}" \u5177\u6709\u4E00\u4E2A\u4E0E nillable \u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u7684\u5143\u7D20\u5339\u914D\u7684\u5173\u952E\u5B57\u3002 + KeyNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 KeyNotFound = \u6CA1\u6709\u4E3A\u5143\u7D20 ''{2}'' \u7684\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u627E\u5230\u503C\u4E3A ''{1}'' \u7684\u5173\u952E\u5B57 ''{0}''\u3002 - KeyRefNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 - KeyRefOutOfScope = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6 \"{0}\" \u5177\u6709\u4E00\u4E2A\u5F15\u7528\u4E86\u4F5C\u7528\u57DF\u4E4B\u5916\u7684\u5173\u952E\u5B57\u6216\u552F\u4E00\u503C\u7684 keyref\u3002 - KeyRefReferNotFound = \u5173\u952E\u5B57\u5F15\u7528\u58F0\u660E \"{0}\" \u5F15\u7528\u4E86\u540D\u4E3A \"{1}\" \u7684\u672A\u77E5\u5173\u952E\u5B57\u3002 - UniqueNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 - UnknownField = \u5185\u90E8\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF; \u5B57\u6BB5 \"{0}\" \u672A\u77E5\u3002 + KeyRefNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 + KeyRefOutOfScope = \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF: \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6 "{0}" \u5177\u6709\u4E00\u4E2A\u5F15\u7528\u4E86\u4F5C\u7528\u57DF\u4E4B\u5916\u7684\u5173\u952E\u5B57\u6216\u552F\u4E00\u503C\u7684 keyref\u3002 + KeyRefReferNotFound = \u5173\u952E\u5B57\u5F15\u7528\u58F0\u660E "{0}" \u5F15\u7528\u4E86\u540D\u4E3A "{1}" \u7684\u672A\u77E5\u5173\u952E\u5B57\u3002 + UniqueNotEnoughValues = \u5BF9\u4E8E\u4E3A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6, \u6CA1\u6709\u4E3A\u5B83\u6307\u5B9A\u8DB3\u591F\u7684\u503C\u3002 + UnknownField = \u5185\u90E8\u8EAB\u4EFD\u7EA6\u675F\u6761\u4EF6\u9519\u8BEF; \u5B57\u6BB5 "{0}" \u672A\u77E5\u3002 # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: \u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}'', \u56E0\u4E3A\u4E0D\u5141\u8BB8 ''{1}'' \u8BBF\u95EE\u3002 schema_reference.4 = schema_reference.4: \u65E0\u6CD5\u8BFB\u53D6\u65B9\u6848\u6587\u6863 ''{0}'', \u539F\u56E0\u4E3A 1) \u65E0\u6CD5\u627E\u5230\u6587\u6863; 2) \u65E0\u6CD5\u8BFB\u53D6\u6587\u6863; 3) \u6587\u6863\u7684\u6839\u5143\u7D20\u4E0D\u662F \u3002 src-annotation = src-annotation: \u5143\u7D20\u53EA\u80FD\u5305\u542B \u548C \u5143\u7D20, \u4F46\u53D1\u73B0\u4E86 ''{0}''\u3002 src-attribute.1 = src-attribute.1: \u5C5E\u6027\u58F0\u660E ''{0}'' \u4E2D\u4E0D\u80FD\u540C\u65F6\u5B58\u5728\u7279\u6027 ''default'' \u548C ''fixed''\u3002\u5E94\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u4E2A\u3002 @@ -181,7 +178,7 @@ cos-ct-extends.1.4.3.2.2.1.b = cos-ct-extends.1.4.3.2.2.1.b: \u6D3E\u751F\u7C7B\u578B\u53CA\u5176\u57FA\u7C7B\u578B\u7684\u5185\u5BB9\u7C7B\u578B\u90FD\u5FC5\u987B\u4E3A\u201C\u6DF7\u5408\u201D\u6216\u201C\u4EC5\u5143\u7D20\u201D\u3002\u7C7B\u578B ''{0}'' \u4E3A\u201C\u6DF7\u5408\u201D, \u4F46\u5176\u57FA\u7C7B\u578B\u4E0D\u662F\u3002 cos-element-consistent = cos-element-consistent: \u7C7B\u578B ''{0}'' \u9519\u8BEF\u3002\u6A21\u578B\u7EC4\u4E2D\u5B58\u5728\u540D\u79F0\u4E3A ''{1}'' \u4E14\u5177\u6709\u4E0D\u540C\u7C7B\u578B\u7684\u591A\u4E2A\u5143\u7D20\u3002 cos-list-of-atomic = cos-list-of-atomic: \u5728\u5217\u8868\u7C7B\u578B ''{0}'' \u7684\u5B9A\u4E49\u4E2D, \u7C7B\u578B ''{1}'' \u662F\u65E0\u6548\u7684\u5217\u8868\u5143\u7D20\u7C7B\u578B, \u56E0\u4E3A\u5B83\u4E0D\u662F\u539F\u5B50 (''{1}'' \u65E2\u4E0D\u662F\u5217\u8868\u7C7B\u578B, \u4E5F\u4E0D\u662F\u5305\u542B\u5217\u8868\u7684\u8054\u5408\u7C7B\u578B)\u3002 - cos-nonambig = cos-nonambig: {0} \u548C {1} (\u6216\u6765\u81EA\u5176\u66FF\u4EE3\u7EC4\u7684\u5143\u7D20) \u8FDD\u53CD\u4E86 \"\u552F\u4E00\u7C92\u5B50\u5C5E\u6027\"\u3002\u6839\u636E\u6B64\u65B9\u6848\u8FDB\u884C\u9A8C\u8BC1\u671F\u95F4, \u8FD9\u4E24\u4E2A\u7C92\u5B50\u4F1A\u9020\u6210\u6B67\u4E49\u3002 + cos-nonambig = cos-nonambig: {0} \u548C {1} (\u6216\u6765\u81EA\u5176\u66FF\u4EE3\u7EC4\u7684\u5143\u7D20) \u8FDD\u53CD\u4E86 "\u552F\u4E00\u7C92\u5B50\u5C5E\u6027"\u3002\u6839\u636E\u6B64\u65B9\u6848\u8FDB\u884C\u9A8C\u8BC1\u671F\u95F4, \u8FD9\u4E24\u4E2A\u7C92\u5B50\u4F1A\u9020\u6210\u6B67\u4E49\u3002 cos-particle-restrict.a = cos-particle-restrict.a: \u6D3E\u751F\u7684\u7C92\u5B50\u4E3A\u7A7A, \u800C\u57FA\u7C92\u5B50\u4E0D\u53EF\u4E3A\u7A7A\u3002 cos-particle-restrict.b = cos-particle-restrict.b: \u57FA\u7C92\u5B50\u4E3A\u7A7A, \u4F46\u6D3E\u751F\u7C92\u5B50\u4E0D\u4E3A\u7A7A\u3002 cos-particle-restrict.2 = cos-particle-restrict.2: \u7981\u6B62\u7C92\u5B50\u9650\u5236: ''{0}''\u3002 @@ -311,7 +308,7 @@ FacetValueFromBase = FacetValueFromBase: \u5728\u7C7B\u578B ''{0}'' \u7684\u58F0\u660E\u4E2D, \u9762 ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u987B\u6765\u81EA\u57FA\u7C7B\u578B\u7684\u503C\u7A7A\u95F4 ''{3}''\u3002 FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u4E49\u4E2D, \u9762 ''{0}'' \u7684\u503C ''{1}'' \u65E0\u6548, \u56E0\u4E3A ''{0}'' \u7684\u503C\u5DF2\u5728\u539F\u7EA7\u7C7B\u578B\u4E4B\u4E00\u4E2D\u8BBE\u7F6E\u4E3A ''{2}'', \u5E76\u4E14 ''{''fixed''}'' = true\u3002 InvalidRegex = InvalidRegex: \u6A21\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u3002\u5217 ''{2}'' \u4E0A\u62A5\u544A\u7684\u9519\u8BEF\u4E3A: ''{1}''\u3002 - maxOccurLimit = \u8BED\u6CD5\u5206\u6790\u5668\u7684\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u5C06 maxOccurs \u5C5E\u6027\u503C\u8BBE\u7F6E\u4E3A\u5927\u4E8E\u503C {0}\u3002 + maxOccurLimit = \u89E3\u6790\u5668\u7684\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u5C06 maxOccurs \u5C5E\u6027\u503C\u8BBE\u7F6E\u4E3A\u5927\u4E8E\u503C {0}\u3002 PublicSystemOnNotation = PublicSystemOnNotation: \u5143\u7D20 ''notation'' \u4E2D\u5FC5\u987B\u81F3\u5C11\u51FA\u73B0 ''public'' \u548C ''system'' \u4E2D\u7684\u4E00\u4E2A\u3002 SchemaLocation = SchemaLocation: schemaLocation \u503C ''{0}'' \u5FC5\u987B\u5177\u6709\u5076\u6570\u4E2A URI\u3002 TargetNamespace.1 = TargetNamespace.1: \u5E94\u4E3A\u540D\u79F0\u7A7A\u95F4 ''{0}'', \u4F46\u65B9\u6848\u6587\u6863\u7684\u76EE\u6807\u540D\u79F0\u7A7A\u95F4\u4E3A ''{1}''\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties index 8661de47c74..8600e688583 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties @@ -1,35 +1,32 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file contains error and warning messages related to XML Schema # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XMLSchemaMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSchemaMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n @@ -42,20 +39,20 @@ # Identity constraints - AbsentKeyValue = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.1): \u5143\u7D20 \"{0}\" \u5177\u6709\u7684\u91D1\u9470\u6C92\u6709\u503C\u3002 - DuplicateField = \u7BC4\u570D\u4E2D\u7684\u6B04\u4F4D \"{0}\" \u91CD\u8907\u914D\u5C0D\u3002 - DuplicateKey = \u70BA\u5143\u7D20 \"{1}\" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u91D1\u9470\u503C [{0}]\u3002 - DuplicateUnique = \u70BA\u5143\u7D20 \"{1}\" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u552F\u4E00\u503C [{0}]\u3002 - FieldMultipleMatch = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u6B04\u4F4D \"{0}\" \u7B26\u5408\u5176\u9078\u53D6\u5668\u7BC4\u570D\u5167\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u503C; \u6B04\u4F4D\u5FC5\u9808\u7B26\u5408\u552F\u4E00\u503C\u3002 - FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5167\u5BB9\u4E0D\u7B49\u65BC\u7DB1\u8981\u5143\u7D20\u5BA3\u544A\u4E2D \"fixed\" \u5C6C\u6027\u7684\u503C\u3002 - KeyMatchesNillable = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.3): \u5143\u7D20 \"{0}\" \u5177\u6709\u7684\u91D1\u9470\uFF0C\u7B26\u5408 nillable \u8A2D\u70BA\u771F\u7684\u5143\u7D20\u3002 - KeyNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 + AbsentKeyValue = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.1): \u5143\u7D20 "{0}" \u5177\u6709\u7684\u91D1\u9470\u6C92\u6709\u503C\u3002 + DuplicateField = \u7BC4\u570D\u4E2D\u7684\u6B04\u4F4D "{0}" \u91CD\u8907\u914D\u5C0D\u3002 + DuplicateKey = \u70BA\u5143\u7D20 "{1}" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u91D1\u9470\u503C [{0}]\u3002 + DuplicateUnique = \u70BA\u5143\u7D20 "{1}" \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u5BA3\u544A\u4E86\u91CD\u8907\u7684\u552F\u4E00\u503C [{0}]\u3002 + FieldMultipleMatch = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u6B04\u4F4D "{0}" \u7B26\u5408\u5176\u9078\u53D6\u5668\u7BC4\u570D\u5167\u8D85\u904E\u4E00\u500B\u4EE5\u4E0A\u7684\u503C; \u6B04\u4F4D\u5FC5\u9808\u7B26\u5408\u552F\u4E00\u503C\u3002 + FixedDiffersFromActual = \u6B64\u5143\u7D20\u7684\u5167\u5BB9\u4E0D\u7B49\u65BC\u7DB1\u8981\u5143\u7D20\u5BA3\u544A\u4E2D "fixed" \u5C6C\u6027\u7684\u503C\u3002 + KeyMatchesNillable = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4 (cvc-identity-constraint.4.2.3): \u5143\u7D20 "{0}" \u5177\u6709\u7684\u91D1\u9470\uFF0C\u7B26\u5408 nillable \u8A2D\u70BA\u771F\u7684\u5143\u7D20\u3002 + KeyNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 KeyNotFound = \u5143\u7D20 ''{2}'' \u7684\u8B58\u5225\u9650\u5236\u689D\u4EF6\u627E\u4E0D\u5230\u503C ''{1}'' \u7684\u91D1\u9470 ''{0}''\u3002 - KeyRefNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 - KeyRefOutOfScope = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u8B58\u5225\u9650\u5236\u689D\u4EF6 \"{0}\" \u5177\u6709\u4E00\u500B keyref\uFF0C\u5B83\u53C3\u7167\u4E86\u7BC4\u570D\u4E4B\u5916\u7684\u91D1\u9470\u6216\u552F\u4E00\u503C\u3002 - KeyRefReferNotFound = \u91D1\u9470\u53C3\u7167\u5BA3\u544A \"{0}\" \u53C3\u7167\u4E86\u540D\u7A31\u70BA \"{1}\" \u7684\u4E0D\u660E\u91D1\u9470\u3002 - UniqueNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 \"{0}\" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 - UnknownField = \u5167\u90E8\u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4; \u4E0D\u660E\u7684\u6B04\u4F4D \"{0}\"\u3002 + KeyRefNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 + KeyRefOutOfScope = \u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4: \u8B58\u5225\u9650\u5236\u689D\u4EF6 "{0}" \u5177\u6709\u4E00\u500B keyref\uFF0C\u5B83\u53C3\u7167\u4E86\u7BC4\u570D\u4E4B\u5916\u7684\u91D1\u9470\u6216\u552F\u4E00\u503C\u3002 + KeyRefReferNotFound = \u91D1\u9470\u53C3\u7167\u5BA3\u544A "{0}" \u53C3\u7167\u4E86\u540D\u7A31\u70BA "{1}" \u7684\u4E0D\u660E\u91D1\u9470\u3002 + UniqueNotEnoughValues = \u6C92\u6709\u8DB3\u5920\u7684\u503C\u6307\u5B9A\u5143\u7D20 "{0}" \u6307\u5B9A\u7684 \u8B58\u5225\u9650\u5236\u689D\u4EF6\u3002 + UnknownField = \u5167\u90E8\u8B58\u5225\u9650\u5236\u689D\u4EF6\u932F\u8AA4; \u4E0D\u660E\u7684\u6B04\u4F4D "{0}"\u3002 # Ideally, we should only use the following error keys, not the ones under # "Identity constraints". And we should cover all of the following errors. @@ -114,7 +111,7 @@ #schema valid (3.X.3) - schema_reference.access = schema_reference: Failed to read schema document ''{0}'', because ''{1}'' access is not allowed. + schema_reference.access = schema_reference: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA\u4E0D\u5141\u8A31 ''{1}'' \u5B58\u53D6\u3002 schema_reference.4 = schema_reference.4: \u7121\u6CD5\u8B80\u53D6\u7DB1\u8981\u6587\u4EF6 ''{0}''\uFF0C\u56E0\u70BA 1) \u627E\u4E0D\u5230\u6587\u4EF6; 2) \u7121\u6CD5\u8B80\u53D6\u6587\u4EF6; 3) \u6587\u4EF6\u7684\u6839\u5143\u7D20\u4E0D\u662F \u3002 src-annotation = src-annotation: \u5143\u7D20\u50C5\u80FD\u5305\u542B \u8207 \u5143\u7D20\uFF0C\u4F46\u627E\u5230 ''{0}''\u3002 src-attribute.1 = src-attribute.1: \u5C6C\u6027 ''default'' \u8207 ''fixed'' \u4E0D\u53EF\u540C\u6642\u51FA\u73FE\u5728\u5C6C\u6027\u5BA3\u544A ''{0}'' \u4E2D\u3002\u8ACB\u53EA\u4F7F\u7528\u5176\u4E2D\u4E00\u500B\u3002 @@ -297,7 +294,7 @@ # the "invalid-content" messages provide less information than the "must-match" counterparts above. They're used for complex types when providing a "match" would be an information dump s4s-elt-invalid-content.1 = s4s-elt-invalid-content.1: ''{0}'' \u7684\u5167\u5BB9\u7121\u6548\u3002\u5143\u7D20 ''{1}'' \u7121\u6548\u3001\u4F4D\u7F6E\u932F\u8AA4\u6216\u592A\u5E38\u51FA\u73FE\u3002 s4s-elt-invalid-content.2 = s4s-elt-invalid-content.2: ''{0}'' \u7684\u5167\u5BB9\u7121\u6548\u3002\u5143\u7D20 ''{1}'' \u4E0D\u53EF\u7A7A\u767D\u3002 - s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: \u985E\u578B ''{0}'' \u7684\u5143\u7D20\u4E0D\u53EF\u51FA\u73FE\u5728\u5BA3\u544A\u4E4B\u5F8C\uFF0C\u505A\u70BA \u5143\u7D20\u7684\u5B50\u9805\u3002 + s4s-elt-invalid-content.3 = s4s-elt-invalid-content.3: \u985E\u578B ''{0}'' \u7684\u5143\u7D20\u4E0D\u53EF\u51FA\u73FE\u5728\u5BA3\u544A\u4E4B\u5F8C\uFF0C\u4F5C\u70BA \u5143\u7D20\u7684\u5B50\u9805\u3002 s4s-elt-schema-ns = s4s-elt-schema-ns: \u5143\u7D20 ''{0}'' \u7684\u547D\u540D\u7A7A\u9593\u5FC5\u9808\u4F86\u81EA\u7DB1\u8981\u547D\u540D\u7A7A\u9593 ''http://www.w3.org/2001/XMLSchema''\u3002 s4s-elt-character = s4s-elt-character: \u7DB1\u8981\u5143\u7D20\u4E2D\u4E0D\u5141\u8A31\u975E\u7A7A\u767D\u5B57\u5143\uFF0C\u4F46\u662F ''xs:appinfo'' \u8207 ''xs:documentation'' \u9664\u5916\u3002\u767C\u73FE ''{0}''\u3002 @@ -310,11 +307,11 @@ EmptyTargetNamespace = EmptyTargetNamespace: \u5728\u7DB1\u8981\u6587\u4EF6 ''{0}'' \u4E2D\uFF0C''targetNamespace'' \u5C6C\u6027\u7684\u503C\u4E0D\u53EF\u70BA\u7A7A\u767D\u5B57\u4E32\u3002 FacetValueFromBase = FacetValueFromBase: \u5728\u985E\u578B ''{0}'' \u7684\u5BA3\u544A\u4E2D\uFF0Cfacet ''{2}'' \u7684\u503C ''{1}'' \u5FC5\u9808\u4F86\u81EA\u57FA\u790E\u985E\u578B\u7684\u503C\u7A7A\u9593 ''{3}''\u3002 FixedFacetValue = FixedFacetValue: \u5728 {3} \u7684\u5B9A\u7FA9\u4E2D\uFF0Cfacet ''{0}'' \u7684\u503C ''{1}'' \u7121\u6548\uFF0C\u56E0\u70BA ''{0}'' \u7684\u503C\u4EE5\u5176\u4E2D\u4E00\u500B\u7956\u7CFB\u985E\u578B\u8A2D\u70BA ''{2}''\uFF0C\u4E14 ''{''fixed''}'' = true\u3002 - InvalidRegex = InvalidRegex: \u6A23\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u4E00\u822C\u8868\u793A\u5F0F\u3002\u5831\u544A\u7684\u932F\u8AA4: \u4F4D\u65BC\u8CC7\u6599\u6B04 ''{2}'' \u7684 ''{1}''\u3002 + InvalidRegex = InvalidRegex: \u6A23\u5F0F\u503C ''{0}'' \u4E0D\u662F\u6709\u6548\u7684\u6B63\u898F\u8868\u793A\u5F0F\u3002\u5831\u544A\u7684\u932F\u8AA4: \u4F4D\u65BC\u8CC7\u6599\u6B04 ''{2}'' \u7684 ''{1}''\u3002 maxOccurLimit = \u5256\u6790\u5668\u76EE\u524D\u7684\u7D44\u614B\u4E0D\u5141\u8A31 maxOccurs \u5C6C\u6027\u503C\u8A2D\u70BA\u5927\u65BC\u503C {0}\u3002 PublicSystemOnNotation = PublicSystemOnNotation: ''public'' \u8207 ''system'' \u81F3\u5C11\u5176\u4E2D\u4E4B\u4E00\u5FC5\u9808\u51FA\u73FE\u5728\u5143\u7D20 ''notation'' \u4E2D\u3002 SchemaLocation = \u7B49\u65BC ''{0}'' \u7684 SchemaLocation: schemaLocation \u503C\u5FC5\u9808\u5177\u6709\u5076\u6578\u500B URI\u3002 TargetNamespace.1 = TargetNamespace.1: \u9810\u671F\u547D\u540D\u7A7A\u9593 ''{0}''\uFF0C\u4F46\u662F\u7DB1\u8981\u6587\u4EF6\u7684\u76EE\u6A19\u547D\u540D\u7A7A\u9593\u70BA ''{1}''\u3002 TargetNamespace.2 = TargetNamespace.2: \u672A\u9810\u671F\u547D\u540D\u7A7A\u9593\uFF0C\u4F46\u662F\u7DB1\u8981\u6587\u4EF6\u5177\u6709\u76EE\u6A19\u547D\u540D\u7A7A\u9593 ''{1}''\u3002 - UndeclaredEntity = UndeclaredEntity: \u672A\u5BA3\u544A\u500B\u9AD4 ''{0}''\u3002 + UndeclaredEntity = UndeclaredEntity: \u672A\u5BA3\u544A\u5BE6\u9AD4 ''{0}''\u3002 UndeclaredPrefix = UndeclaredPrefix: \u7121\u6CD5\u89E3\u6790 ''{0}'' \u70BA QName: \u672A\u5BA3\u544A\u524D\u7F6E\u78BC ''{1}''\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties index 045395ace19..a279e879bd4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties @@ -1,30 +1,27 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML # serializer. Many DOM Load/Save error messages also @@ -33,7 +30,7 @@ # As usual with properties files, the messages are arranged in # key/value tuples. # -# @version $Id: XMLSerializerMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XMLSerializerMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. FormatFailed = Beim Formatieren der folgenden Meldung ist ein interner Fehler aufgetreten:\n @@ -49,8 +46,8 @@ AttributeQName = Attributname "{0}" ist kein QName. AttributePrefix = Attribut "{0}" geh\u00F6rt zu keinem Namespace: Pr\u00E4fix ist m\u00F6glicherweise nicht deklariert oder an einen Namespace gebunden. InvalidNSDecl = Namespace-Deklarationssyntax ist falsch: {0}. - EndingCDATA = Zeichenfolge"\"]]>\" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert. - SplittingCDATA = Teilen eines CDATA-Abschnitts mit dem CDATA-Abschnittsabschlusszeichen \"]]>\". + EndingCDATA = Zeichenfolge""]]>" darf nur im Content enthalten sein, wenn sie das Ende eines CDATA-Abschnitts markiert. + SplittingCDATA = Teilen eines CDATA-Abschnitts mit dem CDATA-Abschnittsabschlusszeichen "]]>". ResourceNotFound = Ressource "{0}" konnte nicht gefunden werden. ResourceNotLoaded = Ressource "{0}" konnte nicht geladen werden. {1} SerializationStopped = Serialisierung auf Benutzeranforderung gestoppt. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties index 181ccc6c408..a06a1613092 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ BadMessageKey = No se ha encontrado el mensaje de error que corresponde a la clave de mensaje. FormatFailed = Se ha producido un error interno al formatear el siguiente mensaje:\n @@ -49,8 +46,8 @@ AttributeQName = El nombre del atributo ''{0}'' no es un QName. AttributePrefix = El atributo ''{0}'' no pertenece a ning\u00FAn espacio de nombres: el prefijo puede ser no declarado o estar enlazado a alg\u00FAn espacio de nombres. InvalidNSDecl = La sintaxis de la declaraci\u00F3n de espacio de nombres no es correcta: {0}. - EndingCDATA = La secuencia de caracteres \"]]>\" no debe aparecer en el contenido a menos que se utilice para marcar el final de una secci\u00F3n CDATA. - SplittingCDATA = Divisi\u00F3n de una secci\u00F3n CDATA que contiene el marcador de terminaci\u00F3n de secci\u00F3n CDATA \"]]>\". + EndingCDATA = La secuencia de caracteres "]]>" no debe aparecer en el contenido a menos que se utilice para marcar el final de una secci\u00F3n CDATA. + SplittingCDATA = Divisi\u00F3n de una secci\u00F3n CDATA que contiene el marcador de terminaci\u00F3n de secci\u00F3n CDATA "]]>". ResourceNotFound = No se ha encontrado el recurso ''{0}''. ResourceNotLoaded = No se ha podido cargar el recurso ''{0}''. {1} SerializationStopped = La serializaci\u00F3n se ha parado a petici\u00F3n del usuario. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties index abb5d784f4b..a274f4be731 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. FormatFailed = Une erreur interne est survenue lors de la mise en forme du message suivant :\n @@ -49,8 +46,8 @@ AttributeQName = Le nom d''attribut ''{0}'' n''est pas un QName. AttributePrefix = L''attribut ''{0}'' n''appartient \u00E0 aucun espace de noms : le pr\u00E9fixe est peut-\u00EAtre non d\u00E9clar\u00E9 ou li\u00E9 \u00E0 un espace de noms. InvalidNSDecl = La syntaxe de la d\u00E9claration d''espace de noms est incorrecte : {0}. - EndingCDATA = La s\u00E9quence de caract\u00E8res \"]]>\" ne peut figurer dans le contenu que pour marquer la fin de la section CDATA. - SplittingCDATA = Fractionnement d'une section CDATA contenant le marqueur de fin de section CDATA \"]]>\". + EndingCDATA = La s\u00E9quence de caract\u00E8res "]]>" ne peut figurer dans le contenu que pour marquer la fin de la section CDATA. + SplittingCDATA = Fractionnement d'une section CDATA contenant le marqueur de fin de section CDATA "]]>". ResourceNotFound = La ressource ''{0}'' est introuvable. ResourceNotLoaded = La ressource ''{0}'' n''a pas pu \u00EAtre charg\u00E9e. {1} SerializationStopped = La s\u00E9rialisation a \u00E9t\u00E9 arr\u00EAt\u00E9e \u00E0 la demande de l'utilisateur. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties index f732af7f2dc..114f1f47125 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. FormatFailed = Si \u00E8 verificato un errore interno durante la formattazione del seguente messaggio:\n @@ -49,8 +46,8 @@ AttributeQName = Il nome attributo ''{0}'' non \u00E8 un QName. AttributePrefix = L''attributo ''{0}'' non appartiene ad alcuno spazio di nomi: il prefisso deve essere non dichiarato o associato a uno spazio di nomi. InvalidNSDecl = La sintassi della dichiarazione dello spazio di nomi \u00E8 errata: {0}. - EndingCDATA = La sequenza di caratteri \"]]>\" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA. - SplittingCDATA = Verr\u00E0 suddivisa una sezione CDATA che contiene l'indicatore di fine della sezione CDATA \"]]>\". + EndingCDATA = La sequenza di caratteri "]]>" non deve essere presente nel contenuto a meno che non sia utilizzata per contrassegnare la fine di una sezione CDATA. + SplittingCDATA = Verr\u00E0 suddivisa una sezione CDATA che contiene l'indicatore di fine della sezione CDATA "]]>". ResourceNotFound = Impossibile trovare la risorsa ''{0}''. ResourceNotLoaded = Impossibile caricare la risorsa ''{0}''. {1} SerializationStopped = Serializzazione arrestata su richiesta dell'utente. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties index 79ac4fca5b9..c604e087580 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 FormatFailed = \u6B21\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u66F8\u5F0F\u8A2D\u5B9A\u4E2D\u306B\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:\n @@ -49,8 +46,8 @@ AttributeQName = \u5C5E\u6027\u540D''{0}''\u306FQName\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 AttributePrefix = \u5C5E\u6027''{0}''\u304C\u3069\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u3082\u5C5E\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u63A5\u982D\u8F9E\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u306A\u3044\u304B\u3001\u306A\u3093\u3089\u304B\u306E\u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u306B\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002 InvalidNSDecl = \u30CD\u30FC\u30E0\u30B9\u30DA\u30FC\u30B9\u5BA3\u8A00\u306E\u69CB\u6587\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: {0}\u3002 - EndingCDATA = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9\"]]>\"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 - SplittingCDATA = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u7D42\u4E86\u30DE\u30FC\u30AB\u30FC\"]]>\"\u304C\u542B\u307E\u308C\u3066\u3044\u308BCDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u5206\u5272\u3057\u3066\u3044\u307E\u3059\u3002 + EndingCDATA = \u6587\u5B57\u30B7\u30FC\u30B1\u30F3\u30B9"]]>"\u306F\u3001CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u7D42\u308F\u308A\u3092\u793A\u3059\u76EE\u7684\u4EE5\u5916\u3067\u30B3\u30F3\u30C6\u30F3\u30C4\u306B\u4F7F\u7528\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002 + SplittingCDATA = CDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u7D42\u4E86\u30DE\u30FC\u30AB\u30FC"]]>"\u304C\u542B\u307E\u308C\u3066\u3044\u308BCDATA\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u5206\u5272\u3057\u3066\u3044\u307E\u3059\u3002 ResourceNotFound = \u30EA\u30BD\u30FC\u30B9''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002 ResourceNotLoaded = \u30EA\u30BD\u30FC\u30B9''{0}''\u3092\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 {1} SerializationStopped = \u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u304C\u30E6\u30FC\u30B6\u30FC\u30FB\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties index cfab02476e4..0ff73562f3d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FormatFailed = \uB2E4\uC74C \uBA54\uC2DC\uC9C0\uC758 \uD615\uC2DD\uC744 \uC9C0\uC815\uD558\uB294 \uC911 \uB0B4\uBD80 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.\n @@ -49,8 +46,8 @@ AttributeQName = \uC18D\uC131 \uC774\uB984 ''{0}''\uC740(\uB294) QName\uC774 \uC544\uB2D9\uB2C8\uB2E4. AttributePrefix = ''{0}'' \uC18D\uC131\uC774 \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uC18D\uD558\uC9C0 \uC54A\uC74C: \uC811\uB450\uC5B4\uC758 \uC120\uC5B8\uC744 \uD574\uC81C\uD558\uAC70\uB098 \uC811\uB450\uC5B4\uB97C \uB124\uC784\uC2A4\uD398\uC774\uC2A4\uC5D0 \uBC14\uC778\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. InvalidNSDecl = \uB124\uC784\uC2A4\uD398\uC774\uC2A4 \uC120\uC5B8 \uAD6C\uBB38\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC74C: {0}. - EndingCDATA = \uBB38\uC790 \uC2DC\uD000\uC2A4 \"]]>\"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. - SplittingCDATA = CDATA \uC139\uC158 \uC885\uB8CC \uD45C\uC2DC\uC790 \"]]>\"\uB97C \uD3EC\uD568\uD558\uB294 CDATA \uC139\uC158\uC744 \uBD84\uD560\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. + EndingCDATA = \uBB38\uC790 \uC2DC\uD000\uC2A4 "]]>"\uB294 CDATA \uC139\uC158 \uB05D\uC744 \uD45C\uC2DC\uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uB294 \uACBD\uC6B0 \uCF58\uD150\uCE20\uC5D0 \uB098\uD0C0\uB098\uC9C0 \uC54A\uC544\uC57C \uD569\uB2C8\uB2E4. + SplittingCDATA = CDATA \uC139\uC158 \uC885\uB8CC \uD45C\uC2DC\uC790 "]]>"\uB97C \uD3EC\uD568\uD558\uB294 CDATA \uC139\uC158\uC744 \uBD84\uD560\uD558\uB294 \uC911\uC785\uB2C8\uB2E4. ResourceNotFound = ''{0}'' \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ResourceNotLoaded = ''{0}'' \uB9AC\uC18C\uC2A4\uB97C \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. {1} SerializationStopped = \uC0AC\uC6A9\uC790 \uC694\uCCAD\uC5D0 \uB530\uB77C \uC9C1\uB82C\uD654\uAC00 \uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties index 8333b31d445..e842306d2bb 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. FormatFailed = Ocorreu um erro interno ao formatar a mensagem a seguir:\n @@ -49,8 +46,8 @@ AttributeQName = O nome do atributo ''{0}'' n\u00E3o \u00E9 QName. AttributePrefix = O atributo ''{0}'' n\u00E3o pertence a nenhum namespace: o prefixo n\u00E3o pode ser n\u00E3o declarado ou vinculado a algum namespace. InvalidNSDecl = Sintaxe de declara\u00E7\u00E3o de namespace incorreta: {0}. - EndingCDATA = A sequ\u00EAncia de caracteres \"]]>\" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA. - SplittingCDATA = Dividir uma se\u00E7\u00E3o CDATA que cont\u00E9m o marcador \"]]>\" de termina\u00E7\u00E3o de se\u00E7\u00E3o CDATA. + EndingCDATA = A sequ\u00EAncia de caracteres "]]>" n\u00E3o deve aparecer no conte\u00FAdo, a menos que seja usada para marcar o fim de uma se\u00E7\u00E3o CDATA. + SplittingCDATA = Dividir uma se\u00E7\u00E3o CDATA que cont\u00E9m o marcador "]]>" de termina\u00E7\u00E3o de se\u00E7\u00E3o CDATA. ResourceNotFound = N\u00E3o foi poss\u00EDvel encontrar o recurso ''{0}''. ResourceNotLoaded = N\u00E3o foi poss\u00EDvel carregar o recurso ''{0}''. {1} SerializationStopped = Serializa\u00E7\u00E3o interrompida na solicita\u00E7\u00E3o do usu\u00E1rio. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties index c9014cee0bc..404f048827c 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. FormatFailed = Ett internt fel intr\u00E4ffade vid formatering av f\u00F6ljande meddelande:\n @@ -49,8 +46,8 @@ AttributeQName = Attributnamnet ''{0}'' \u00E4r inte n\u00E5got QName. AttributePrefix = Attributet ''{0}'' tillh\u00F6r inte n\u00E5gon namnrymd: prefixet kanske inte har deklarerats eller \u00E4r bundet till annan namnrymd. InvalidNSDecl = Felaktig syntax i deklaration av namnrymd: {0}. - EndingCDATA = Teckensekvensen \"]]>\" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion. - SplittingCDATA = Delar en CDATA-sektion som inneh\u00E5ller CDATA-sektionens avslutningsmark\u00F6r \"]]>\". + EndingCDATA = Teckensekvensen "]]>" f\u00E5r inte f\u00F6rekomma i inneh\u00E5llet, s\u00E5vida det inte anv\u00E4nds f\u00F6r att markera slut av CDATA-sektion. + SplittingCDATA = Delar en CDATA-sektion som inneh\u00E5ller CDATA-sektionens avslutningsmark\u00F6r "]]>". ResourceNotFound = Resursen ''{0}'' hittades inte. ResourceNotLoaded = Resursen ''{0}'' kunde inte laddas. {1} SerializationStopped = Serialiseringen stoppades vid anv\u00E4ndarbeg\u00E4ran. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties index 7d26fe6ca71..c9888263168 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 FormatFailed = \u8BBE\u7F6E\u4EE5\u4E0B\u6D88\u606F\u7684\u683C\u5F0F\u65F6\u51FA\u73B0\u5185\u90E8\u9519\u8BEF:\n @@ -49,8 +46,8 @@ AttributeQName = \u5C5E\u6027\u540D ''{0}'' \u4E0D\u662F\u9650\u5B9A\u540D\u3002 AttributePrefix = \u5C5E\u6027 ''{0}'' \u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u540D\u79F0\u7A7A\u95F4: \u53EF\u80FD\u672A\u58F0\u660E\u524D\u7F00, \u6216\u8005\u5DF2\u7ECF\u5C06\u524D\u7F00\u7ED1\u5B9A\u5230\u67D0\u4E2A\u540D\u79F0\u7A7A\u95F4\u3002 InvalidNSDecl = \u540D\u79F0\u7A7A\u95F4\u58F0\u660E\u8BED\u6CD5\u4E0D\u6B63\u786E: {0}\u3002 - EndingCDATA = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 \"]]>\" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002 - SplittingCDATA = \u62C6\u5206\u5305\u542B CDATA \u6BB5\u7EC8\u6B62\u6807\u8BB0 \"]]>\" \u7684 CDATA \u6BB5\u3002 + EndingCDATA = \u9664\u975E\u4F7F\u7528\u5B57\u7B26\u5E8F\u5217 "]]>" \u6765\u6807\u8BB0 CDATA \u8282\u7684\u7ED3\u5C3E, \u5426\u5219\u8BE5\u5B57\u7B26\u5E8F\u5217\u4E0D\u80FD\u51FA\u73B0\u5728\u5185\u5BB9\u4E2D\u3002 + SplittingCDATA = \u62C6\u5206\u5305\u542B CDATA \u6BB5\u7EC8\u6B62\u6807\u8BB0 "]]>" \u7684 CDATA \u6BB5\u3002 ResourceNotFound = \u627E\u4E0D\u5230\u8D44\u6E90 ''{0}''\u3002 ResourceNotLoaded = \u65E0\u6CD5\u52A0\u8F7D\u8D44\u6E90 ''{0}''\u3002{1} SerializationStopped = \u6839\u636E\u7528\u6237\u8BF7\u6C42\u505C\u6B62\u4E86\u5E8F\u5217\u5316\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties index 14a2629eead..c6dfc1606d2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties @@ -1,39 +1,36 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores error messages for the Xerces XML -# serializer. Many DOM Load/Save error messages also +# serializer. Many DOM Load/Save error messages also # live here, since the serializer largely implements that package. # # As usual with properties files, the messages are arranged in # key/value tuples. -# -# @version $Id: XMLSerializerMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# +# @version $Id: XMLSerializerMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 FormatFailed = \u683C\u5F0F\u5316\u4E0B\u5217\u8A0A\u606F\u6642\u767C\u751F\u5167\u90E8\u932F\u8AA4:\n @@ -49,8 +46,8 @@ AttributeQName = \u5C6C\u6027\u540D\u7A31 ''{0}'' \u4E0D\u662F QName\u3002 AttributePrefix = \u5C6C\u6027 ''{0}'' \u4E0D\u5C6C\u65BC\u4EFB\u4F55\u547D\u540D\u7A7A\u9593: \u53EF\u80FD\u672A\u5BA3\u544A\u524D\u7F6E\u78BC\u6216\u524D\u7F6E\u78BC\u9023\u7D50\u5176\u4ED6\u547D\u540D\u7A7A\u9593\u3002 InvalidNSDecl = \u547D\u540D\u7A7A\u9593\u5BA3\u544A\u8A9E\u6CD5\u4E0D\u6B63\u78BA: {0}\u3002 - EndingCDATA = \u5B57\u5143\u9806\u5E8F \"]]>\" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002 - SplittingCDATA = \u5206\u5272\u5305\u542B CDATA \u6BB5\u843D\u7D42\u6B62\u6A19\u8A18 \"]]>\" \u7684 CDATA \u6BB5\u843D\u3002 + EndingCDATA = \u5B57\u5143\u9806\u5E8F "]]>" \u4E0D\u53EF\u51FA\u73FE\u5728\u5167\u5BB9\u4E2D\uFF0C\u9664\u975E\u7528\u65BC\u6A19\u793A CDATA \u6BB5\u843D\u7684\u7D50\u5C3E\u3002 + SplittingCDATA = \u5206\u5272\u5305\u542B CDATA \u6BB5\u843D\u7D42\u6B62\u6A19\u8A18 "]]>" \u7684 CDATA \u6BB5\u843D\u3002 ResourceNotFound = \u627E\u4E0D\u5230\u8CC7\u6E90 ''{0}''\u3002 ResourceNotLoaded = \u7121\u6CD5\u8F09\u5165\u8CC7\u6E90 ''{0}''\u3002{1} SerializationStopped = \u4F9D\u7167\u4F7F\u7528\u8005\u8981\u6C42\u505C\u6B62\u5E8F\u5217\u5316\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties index b559b6feae0..72d3bba7381 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_de.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_de.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:16:51 gmolloy Exp $ # Messages for message reporting BadMessageKey = Die zum Meldungsschl\u00FCssel geh\u00F6rige Fehlermeldung kann nicht gefunden werden. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties index 78cadb1bfc2..baa0b0d6fd4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_es.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_es.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 05:10:53 gmolloy Exp $ # Messages for message reporting BadMessageKey = No se ha encontrado el mensaje de error que corresponde a la clave de mensaje. @@ -38,7 +35,7 @@ FormatFailed = Se ha producido un error interno al formatear el siguiente mensaj # XPointer Framework Error Messages XPointerProcessingError = XPointerProcessingError: Se ha producido un error al procesar la expresi\u00F3n XPointer. -InvalidXPointerToken = InvalidXPointerToken: La expresi\u00F3n XPointer contiene el elemento no v\u00E1lido ''{0}'' +InvalidXPointerToken = InvalidXPointerToken: La expresi\u00F3n XPointer contiene el token no v\u00E1lido ''{0}'' InvalidXPointerExpression = InvalidXPointerExpression: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. MultipleShortHandPointers = MultipleShortHandPointers: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. Tiene m\u00E1s de un puntero abreviado. SchemeDataNotFollowedByCloseParenthesis = SchemeDataNotFollowedByCloseParenthesis: La expresi\u00F3n XPointer ''{0}'' no es v\u00E1lida. SchemeData no viene seguido de un car\u00E1cter '')''. @@ -48,7 +45,7 @@ UnbalancedParenthesisInXPointerExpression = UnbalancedParenthesisInXPointerExpre InvalidSchemeDataInXPointer = InvalidSchemeDataInXPointer: La expresi\u00F3n XPointer ''{0}'' contiene un valor de SchemeData no v\u00E1lido. # XPointer Element Scheme Error Messages -InvalidElementSchemeToken = InvalidElementSchemeToken: La expresi\u00F3n XPointer del esquema de element() contiene el elemento no v\u00E1lido ''{0}'' +InvalidElementSchemeToken = InvalidElementSchemeToken: La expresi\u00F3n XPointer del esquema de element() contiene el token no v\u00E1lido ''{0}'' InvalidElementSchemeXPointer = InvalidElementSchemeXPointer: La expresi\u00F3n XPointer del esquema de elemento ''{0}'' no es v\u00E1lida. XPointerElementSchemeProcessingError = XPointerElementSchemeProcessingError: Se ha producido un error al procesar la expresi\u00F3n de esquema XPointer element(). InvalidNCNameInElementSchemeData = InvalidNCNameInElementSchemeData: El esquema element() contiene un puntero abreviado ''{0}'' con un valor de NCName no v\u00E1lido. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties index 86bb01a522a..9eb7cf0d3fc 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_fr.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_fr.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 02:16:52 gmolloy Exp $ # Messages for message reporting BadMessageKey = Le message d'erreur correspondant \u00E0 la cl\u00E9 de message est introuvable. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties index 1fcaacbeb91..d59616ea2d6 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_it.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_it.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 08:14:02 gmolloy Exp $ # Messages for message reporting BadMessageKey = Impossibile trovare il messaggio di errore corrispondente alla chiave di messaggio. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties index 095876d10bf..26a2a3eec83 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_ja.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_ja.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 01:05:12 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u30E1\u30C3\u30BB\u30FC\u30B8\u30FB\u30AD\u30FC\u306B\u5BFE\u5FDC\u3059\u308B\u30A8\u30E9\u30FC\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties index ebe5b263389..3f43bbd67bd 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_ko.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_ko.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 02:40:33 gmolloy Exp $ # Messages for message reporting BadMessageKey = \uBA54\uC2DC\uC9C0 \uD0A4\uC5D0 \uD574\uB2F9\uD558\uB294 \uC624\uB958 \uBA54\uC2DC\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties index b6736914971..a4076986da3 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_pt_BR.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_pt_BR.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/28 07:33:06 gmolloy Exp $ # Messages for message reporting BadMessageKey = N\u00E3o foi poss\u00EDvel encontrar a mensagem de erro correspondente \u00E0 chave da mensagem. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties index ae9c25a95a5..8444e131b9b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_sv.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_sv.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 00:46:23 gmolloy Exp $ # Messages for message reporting BadMessageKey = Hittar inte felmeddelandet som motsvarar meddelandenyckeln. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties index e8f1a43c5c7..d2c2dc3220f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_zh_CN.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_zh_CN.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/29 01:19:32 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u4E0E\u6D88\u606F\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u9519\u8BEF\u6D88\u606F\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties index a000679c06c..6c9bf142532 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties @@ -1,36 +1,33 @@ -/* - * 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. - */ - -/* - * Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. - */ +# +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# # This file stores localized messages for the Xerces XPointer implementation. # # The messages are arranged in key and value tuples in a ListResourceBundle. # -# @version $Id: XPointerMessages_zh_TW.properties 3021 2011-03-01 00:12:28Z joehw $ +# @version $Id: XPointerMessages_zh_TW.properties /st_wptg_1.8.0.0.0jdk/2 2013/05/27 00:30:48 gmolloy Exp $ # Messages for message reporting BadMessageKey = \u627E\u4E0D\u5230\u5C0D\u61C9\u8A0A\u606F\u7D22\u5F15\u9375\u7684\u932F\u8AA4\u8A0A\u606F\u3002 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties new file mode 100644 index 00000000000..aa7f3abec25 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_de.properties @@ -0,0 +1,66 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +parser.parse.1=Falsches Zeichen. +parser.parse.2=Ung\u00FCltige Referenznummer. +parser.next.1=Nach \\ ist ein Zeichen erforderlich. +parser.next.2='?' wird nicht erwartet. '(?:' oder '(?=' oder '(?!' oder '(?<' oder '(?#' oder '(?>'? +parser.next.3='(?<=' oder '(?'? +parser.next.3=Se esperaba '(?<=' o '(?'? -parser.next.3='(?<=' ou '(?'? +parser.next.3='(?<=' ou '(?'? +parser.next.3='(?<=' o '(?' \u3067\u3059\u304b? -parser.next.3='(?<=' \u304b '(?'\u3067\u3059\u304B\u3002 +parser.next.3='(?<='\u307E\u305F\u306F'(?'? +parser.next.3='(?<=' \uB610\uB294 '(?'? +parser.next.3='(?<=' ou '(?'? +parser.next.3='(?<=' eller '(?'? +parser.next.3=\u5E94\u4E3A '(?<=' \u6216 '(?'? +parser.next.3=\u9810\u671F\u61C9\u70BA '(?<=' \u6216 '(? - *
    • query the system property using System.getProperty - *
    • read META-INF/services/factoryId file - *
    • use fallback classname - * - * - * @return Class object of factory, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - public static Object createObject(String factoryId, String fallbackClassName) - throws ConfigurationError { - return createObject(factoryId, null, fallbackClassName); - } // createObject(String,String):Object - - /** - * Finds the implementation Class object in the specified order. The - * specified order is the following: - *
        - *
      1. query the system property using System.getProperty - *
      2. read $java.home/lib/propertiesFilename file - *
      3. read META-INF/services/factoryId file - *
      4. use fallback classname - *
      - * - * @return Class object of factory, never null - * - * @param factoryId Name of the factory to find, same as - * a property name - * @param propertiesFilename The filename in the $java.home/lib directory - * of the properties file. If none specified, - * ${java.home}/lib/xerces.properties will be used. - * @param fallbackClassName Implementation class name, if nothing else - * is found. Use null to mean no fallback. - * - * @exception ObjectFactory.ConfigurationError - */ - public static Object createObject(String factoryId, - String propertiesFilename, - String fallbackClassName) - throws ConfigurationError - { - if (DEBUG) debugPrintln("debug is on"); - - ClassLoader cl = findClassLoader(); - - // Use the system property first - try { - String systemProp = SecuritySupport.getSystemProperty(factoryId); - if (systemProp != null && systemProp.length() > 0) { - if (DEBUG) debugPrintln("found system property, value=" + systemProp); - return newInstance(systemProp, cl, true); - } - } catch (SecurityException se) { - // Ignore and continue w/ next location - } - - // JAXP specific change - // always use fallback class to avoid the expense of constantly - // "stat"ing a non-existent "xerces.properties" and jar SPI entry - // see CR 6400863: Expensive creating of SAX parser in Mustang - if (fallbackClassName == null) { - throw new ConfigurationError( - "Provider for " + factoryId + " cannot be found", null); - } - - if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName); - return newInstance(fallbackClassName, cl, true); - - } // createObject(String,String,String):Object // // Private static methods @@ -235,7 +122,7 @@ public final class ObjectFactory { // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); - }; + } // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders @@ -343,94 +230,4 @@ public final class ObjectFactory { return providerClass; } - /* - * Try to find provider using Jar Service Provider Mechanism - * - * @return instance of provider class if found or null - */ - private static Object findJarServiceProvider(String factoryId) - throws ConfigurationError - { - String serviceId = "META-INF/services/" + factoryId; - InputStream is = null; - - // First try the Context ClassLoader - ClassLoader cl = findClassLoader(); - - is = SecuritySupport.getResourceAsStream(cl, serviceId); - - // If no provider found then try the current ClassLoader - if (is == null) { - ClassLoader current = ObjectFactory.class.getClassLoader(); - if (cl != current) { - cl = current; - is = SecuritySupport.getResourceAsStream(cl, serviceId); - } - } - - if (is == null) { - // No provider found - return null; - } - - if (DEBUG) debugPrintln("found jar resource=" + serviceId + - " using ClassLoader: " + cl); - - // Read the service provider name in UTF-8 as specified in - // the jar spec. Unfortunately this fails in Microsoft - // VJ++, which does not implement the UTF-8 - // encoding. Theoretically, we should simply let it fail in - // that case, since the JVM is obviously broken if it - // doesn't support such a basic standard. But since there - // are still some users attempting to use VJ++ for - // development, we have dropped in a fallback which makes a - // second attempt using the platform's default encoding. In - // VJ++ this is apparently ASCII, which is a subset of - // UTF-8... and since the strings we'll be reading here are - // also primarily limited to the 7-bit ASCII range (at - // least, in English versions), this should work well - // enough to keep us on the air until we're ready to - // officially decommit from VJ++. [Edited comment from - // jkesselm] - BufferedReader rd; - try { - rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH); - } catch (java.io.UnsupportedEncodingException e) { - rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH); - } - - String factoryClassName = null; - try { - // XXX Does not handle all possible input as specified by the - // Jar Service Provider specification - factoryClassName = rd.readLine(); - } catch (IOException x) { - // No provider found - return null; - } - finally { - try { - // try to close the reader. - rd.close(); - } - // Ignore the exception. - catch (IOException exc) {} - } - - if (factoryClassName != null && - ! "".equals(factoryClassName)) { - if (DEBUG) debugPrintln("found in resource, value=" - + factoryClassName); - - // Note: here we do not want to fall back to the current - // ClassLoader because we want to avoid the case where the - // resource file was found using one ClassLoader and the - // provider class was instantiated using a different one. - return newInstance(factoryClassName, cl, false); - } - - // No provider found - return null; - } - } // class ObjectFactory diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java index 711814e80e1..d629b9fd8db 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java @@ -52,14 +52,6 @@ import com.sun.org.apache.xalan.internal.utils.SecuritySupport; public abstract class DTMManager { - /** The default property name to load the manager. */ - private static final String defaultPropName = - "com.sun.org.apache.xml.internal.dtm.DTMManager"; - - /** The default class name to use as the manager. */ - private static String defaultClassName = - "com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault"; - /** * Factory for creating XMLString objects. * %TBD% Make this set by the caller. @@ -97,29 +89,7 @@ public abstract class DTMManager /** * Obtain a new instance of a DTMManager. * This static method creates a new factory instance - * This method uses the following ordered lookup procedure to determine - * the DTMManager implementation class to - * load: - *
        - *
      • - * Use the com.sun.org.apache.xml.internal.dtm.DTMManager system - * property. - *
      • - *
      • - * Use the JAVA_HOME(the parent directory where jdk is - * installed)/lib/xalan.properties for a property file that contains the - * name of the implementation class keyed on the same value as the - * system property defined above. - *
      • - *
      • - * Use the Services API (as detailed in the JAR specification), if - * available, to determine the classname. The Services API will look - * for a classname in the file - * META-INF/services/com.sun.org.apache.xml.internal.dtm.DTMManager - * in jars available to the runtime. - *
      • - *
      • - * Use the default DTMManager classname, which is + * using the default DTMManager implementation, which is * com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault. *
      • *
      @@ -136,39 +106,10 @@ public abstract class DTMManager public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException { - return newInstance(xsf, true); - } + final DTMManager factoryImpl = new com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault(); + factoryImpl.setXMLStringFactory(xsf); - public static DTMManager newInstance(XMLStringFactory xsf, boolean useServicesMechanism) - throws DTMConfigurationException - { - DTMManager factoryImpl = null; - try - { - if (useServicesMechanism) { - factoryImpl = (DTMManager) ObjectFactory - .createObject(defaultPropName, defaultClassName); - } else { - factoryImpl = new com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault(); - } - } - catch (ConfigurationError e) - { - throw new DTMConfigurationException(XMLMessages.createXMLMessage( - XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); - //"No default implementation found"); - } - - if (factoryImpl == null) - { - throw new DTMConfigurationException(XMLMessages.createXMLMessage( - XMLErrorResources.ER_NO_DEFAULT_IMPL, null)); - //"No default implementation found"); - } - - factoryImpl.setXMLStringFactory(xsf); - - return factoryImpl; + return factoryImpl; } /** diff --git a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java index 8f79f869cb2..28002037272 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java @@ -136,11 +136,16 @@ public class XMLReaderManager { try { reader.setFeature(NAMESPACES_FEATURE, true); reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false); - reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); } catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. } + try { + reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } } catch (ParserConfigurationException ex) { throw new SAXException(ex); } catch (FactoryConfigurationError ex1) { diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java index dc1063e8f3d..e71f61e6243 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java @@ -22,17 +22,6 @@ */ package com.sun.org.apache.xpath.internal; -import java.lang.reflect.Method; -import java.util.Stack; -import java.util.Vector; -import java.util.HashMap; -import java.util.Iterator; - -import javax.xml.transform.ErrorListener; -import javax.xml.transform.SourceLocator; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; - import com.sun.org.apache.xalan.internal.extensions.ExpressionContext; import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xml.internal.dtm.Axis; @@ -46,14 +35,21 @@ import com.sun.org.apache.xml.internal.utils.IntStack; import com.sun.org.apache.xml.internal.utils.NodeVector; import com.sun.org.apache.xml.internal.utils.ObjectStack; import com.sun.org.apache.xml.internal.utils.PrefixResolver; -import com.sun.org.apache.xml.internal.utils.SAXSourceLocator; import com.sun.org.apache.xml.internal.utils.XMLString; import com.sun.org.apache.xpath.internal.axes.SubContextList; -import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.objects.DTMXRTreeFrag; +import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.objects.XString; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; - +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Stack; +import java.util.Vector; +import javax.xml.transform.ErrorListener; +import javax.xml.transform.SourceLocator; +import javax.xml.transform.TransformerException; +import javax.xml.transform.URIResolver; import org.xml.sax.XMLReader; /** @@ -339,8 +335,8 @@ public class XPathContext extends DTMManager // implements ExpressionContext m_saxLocations.push(null); m_useServicesMechanism = useServicesMechanism; m_dtmManager = DTMManager.newInstance( - com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(), - m_useServicesMechanism); + com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory() + ); } /** @@ -363,8 +359,8 @@ public class XPathContext extends DTMManager // implements ExpressionContext m_dtmManager = DTMManager.newInstance( - com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(), - m_useServicesMechanism); + com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory() + ); m_saxLocations.removeAllElements(); m_axesIteratorStack.removeAllElements(); @@ -622,32 +618,6 @@ public class XPathContext extends DTMManager // implements ExpressionContext /** Misnamed string manager for XPath messages. */ // private static XSLMessages m_XSLMessages = new XSLMessages(); - /** - * Tell the user of an assertion error, and probably throw an - * exception. - * - * @param b If false, a TransformerException will be thrown. - * @param msg The assertion message, which should be informative. - * - * @throws javax.xml.transform.TransformerException if b is false. - */ - private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException - { - if (!b) - { - ErrorListener errorHandler = getErrorListener(); - - if (errorHandler != null) - { - errorHandler.fatalError( - new TransformerException( - XSLMessages.createMessage( - XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, - new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator())); - } - } - } - //========================================================== // SECTION: Execution context state tracking //========================================================== @@ -664,7 +634,7 @@ public class XPathContext extends DTMManager // implements ExpressionContext * Get the current context node list. * * @return the current node list, - * also refered to here as a context node list. + * also referred to here as a context node list. */ public final DTMIterator getContextNodeList() { @@ -679,7 +649,7 @@ public class XPathContext extends DTMManager // implements ExpressionContext * Set the current context node list. * * @param nl the current node list, - * also refered to here as a context node list. + * also referred to here as a context node list. * @xsl.usage internal */ public final void pushContextNodeList(DTMIterator nl) @@ -700,7 +670,7 @@ public class XPathContext extends DTMManager // implements ExpressionContext } /** - * The ammount to use for stacks that record information during the + * The amount to use for stacks that record information during the * recursive execution. */ public static final int RECURSIONLIMIT = (1024*4); diff --git a/jaxp/src/javax/xml/xpath/XPathException.java b/jaxp/src/javax/xml/xpath/XPathException.java index aca84e57867..6ec9d09c4b1 100644 --- a/jaxp/src/javax/xml/xpath/XPathException.java +++ b/jaxp/src/javax/xml/xpath/XPathException.java @@ -26,6 +26,11 @@ package javax.xml.xpath; import java.io.PrintWriter; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; +import java.io.InvalidClassException; /** * XPathException represents a generic XPath exception.

      @@ -36,7 +41,9 @@ import java.io.PrintWriter; */ public class XPathException extends Exception { - private final Throwable cause; + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField( "cause", Throwable.class ) + }; /** *

      Stream Unique Identifier.

      @@ -62,7 +69,6 @@ public class XPathException extends Exception { if ( message == null ) { throw new NullPointerException ( "message can't be null"); } - this.cause = null; } /** @@ -77,8 +83,7 @@ public class XPathException extends Exception { * @throws NullPointerException if cause is null. */ public XPathException(Throwable cause) { - super(); - this.cause = cause; + super(cause); if ( cause == null ) { throw new NullPointerException ( "cause can't be null"); } @@ -90,7 +95,47 @@ public class XPathException extends Exception { * @return Cause of this XPathException. */ public Throwable getCause() { - return cause; + return super.getCause(); + } + + /** + * Writes "cause" field to the stream. + * The cause is got from the parent class. + * + * @param out stream used for serialization. + * @throws IOException thrown by ObjectOutputStream + * + */ + private void writeObject(ObjectOutputStream out) + throws IOException + { + ObjectOutputStream.PutField fields = out.putFields(); + fields.put("cause", (Throwable) super.getCause()); + out.writeFields(); + } + + /** + * Reads the "cause" field from the stream. + * And initializes the "cause" if it wasn't + * done before. + * + * @param in stream used for deserialization + * @throws IOException thrown by ObjectInputStream + * @throws ClassNotFoundException thrown by ObjectInputStream + */ + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException + { + ObjectInputStream.GetField fields = in.readFields(); + Throwable scause = (Throwable) fields.get("cause", null); + + if (super.getCause() == null && scause != null) { + try { + super.initCause(scause); + } catch(IllegalStateException e) { + throw new InvalidClassException("Inconsistent state: two causes"); + } + } } /** diff --git a/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java b/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java index 81ca862b1cf..7e05b983a51 100644 --- a/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java +++ b/jaxp/src/org/xml/sax/helpers/XMLReaderFactory.java @@ -85,6 +85,7 @@ final public class XMLReaderFactory private static final String property = "org.xml.sax.driver"; private static SecuritySupport ss = new SecuritySupport(); + private static String _clsFromJar = null; private static boolean _jarread = false; /** * Attempt to create an XMLReader from system defaults. @@ -163,14 +164,14 @@ final public class XMLReaderFactory } if (in != null) { - reader = new BufferedReader ( - new InputStreamReader (in, "UTF8")); - className = reader.readLine (); + reader = new BufferedReader (new InputStreamReader (in, "UTF8")); + _clsFromJar = reader.readLine (); in.close (); } } catch (Exception e) { } } + className = _clsFromJar; } // 3. Distro-specific fallback diff --git a/jaxws/.hgtags b/jaxws/.hgtags index b72c9a9bcfe..fff5bca7aab 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -216,3 +216,6 @@ a5e7c2f093c9996ab3419db1565094a07b059e9c jdk8-b86 a0f604766ca14818e2a7b1558cc399499caabf75 jdk8-b92 7386eca865e1f7216637cdf8dcf3f5d5c255f208 jdk8-b93 254c53fd97ab24942043adcfa5c1a0a38a3b274e jdk8-b94 +1468c94135f978dd29d03bce2f7d7e952154d144 jdk8-b95 +690d34b326bc78a6f5f225522695b41c7f7f70e8 jdk8-b96 +dcde7f049111353ad23175f54985a4f6bfea720c jdk8-b97 diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java index c4cf116b0e0..5acb939ebec 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/DatabindingModeFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ import java.util.Map; import javax.xml.ws.WebServiceFeature; -public class DatabindingModeFeature extends WebServiceFeature { +public class DatabindingModeFeature extends WebServiceFeature implements com.sun.xml.internal.ws.api.ServiceSharedFeatureMarker { /** * Constant value identifying the DatabindingFeature */ diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java index d0c0d87a7fb..ff182cd86af 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/databinding/ExternalMetadataFeature.java @@ -52,6 +52,7 @@ public class ExternalMetadataFeature extends WebServiceFeature { private List resourceNames; private List files; + private MetadataReader reader; private ExternalMetadataFeature() { } @@ -88,6 +89,7 @@ public class ExternalMetadataFeature extends WebServiceFeature { } public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableSecureXmlProcessing) { + if (reader != null && enabled) return reader; return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableSecureXmlProcessing) : null; } @@ -153,5 +155,9 @@ public class ExternalMetadataFeature extends WebServiceFeature { return this; } + public Builder setReader( MetadataReader r ) { + o.reader = r; + return this; + } } } diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java index ab53f0574c1..e4ea2c19ea8 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/api/message/BaseDistributedPropertySet.java @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.oracle.webservices.internal.api.message; import com.sun.istack.internal.NotNull; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java index 28b3502cfdb..0ab6a2ea7a1 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/webservices/internal/impl/encoding/StreamDecoderImpl.java @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.oracle.webservices.internal.impl.encoding; import java.io.IOException; diff --git a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java index 457f7e76b38..e91a138d49f 100644 --- a/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java +++ b/jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal/webservices/jaxws_databinding/package-info.java @@ -23,7 +23,6 @@ * questions. */ - // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6-SNAPSHOT // See http://java.sun.com/xml/jaxb diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties index b68f941bda4..c1805f1ff17 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle.properties @@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \ Non-existent directory: {0} VERSION = \ - schemagen 2.2.7-b63 + schemagen 2.2.8-b01 FULLVERSION = \ - schemagen full version "2.2.7-b63" + schemagen full version "2.2.8-b01" USAGE = \ Usage: schemagen [-options ...] \n\ diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties index 77b472d313c..971c1709e2e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_de.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2} BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.7-b63" +FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.8-b01" USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties index 4281c08073f..030047264b7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_es.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu BASEDIR_DOESNT_EXIST = Directorio no existente: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = versi\u00F3n completa de schemagen "2.2.7-b63" +FULLVERSION = versi\u00F3n completa de schemagen "2.2.8-b01" USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties index e72bfd541b2..b3107ee4418 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0 BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = version compl\u00E8te de schemagen "2.2.7-b63" +FULLVERSION = version compl\u00E8te de schemagen "2.2.8-b01" USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties index 25a9f06a15d..0aa7cf4c807 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_it.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2} BASEDIR_DOESNT_EXIST = Directory non esistente: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = versione completa schemagen "2.2.7-b63" +FULLVERSION = versione completa schemagen "2.2.8-b01" USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties index 42dcb00216a..b8889bb6e22 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.7-b63" +FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.8-b01" USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties index 8bc7bf0b1c4..b89650bd0ff 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.7-b63" +FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.8-b01" USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties index e6339ca7ec2..fc9f8afbc11 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2} BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} -VERSION = gera\u00E7\u00E3o do esquema 2.2.7-b63 +VERSION = gera\u00E7\u00E3o do esquema 2.2.8-b01 -FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.7-b63" +FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.8-b01" USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties index c059a4fd23a..4493b23dd18 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.7-b63" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b01" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties index 1e73e423250..45748f11a28 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} -VERSION = schemagen 2.2.7-b63 +VERSION = schemagen 2.2.8-b01 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.7-b63" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.8-b01" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java index b95cf71ad2b..60968c00c56 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Classes.java @@ -78,11 +78,6 @@ public class Classes extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 0: - { - revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; case 4: { $_ngcc_current_state = 3; @@ -112,6 +107,11 @@ public class Classes extends NGCCHandler { } } break; + case 0: + { + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); + } + break; case 12: { if(($__uri.equals("") && $__local.equals("classes"))) { @@ -137,33 +137,6 @@ public class Classes extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 8: - { - if(($__uri.equals("") && $__local.equals("includes"))) { - $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 2; - } - else { - unexpectedLeaveElement($__qname); - } - } - break; - case 1: - { - if(($__uri.equals("") && $__local.equals("classes"))) { - $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 0; - } - else { - unexpectedLeaveElement($__qname); - } - } - break; - case 0: - { - revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 4: { $_ngcc_current_state = 3; @@ -181,12 +154,39 @@ public class Classes extends NGCCHandler { } } break; + case 1: + { + if(($__uri.equals("") && $__local.equals("classes"))) { + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); + $_ngcc_current_state = 0; + } + else { + unexpectedLeaveElement($__qname); + } + } + break; + case 8: + { + if(($__uri.equals("") && $__local.equals("includes"))) { + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); + $_ngcc_current_state = 2; + } + else { + unexpectedLeaveElement($__qname); + } + } + break; case 2: { $_ngcc_current_state = 1; $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); } break; + case 0: + { + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedLeaveElement($__qname); @@ -201,11 +201,6 @@ public class Classes extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 0: - { - revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 4: { $_ngcc_current_state = 3; @@ -218,6 +213,11 @@ public class Classes extends NGCCHandler { $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); } break; + case 0: + { + revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedEnterAttribute($__qname); @@ -232,11 +232,6 @@ public class Classes extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 0: - { - revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 4: { $_ngcc_current_state = 3; @@ -249,6 +244,11 @@ public class Classes extends NGCCHandler { $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); } break; + case 0: + { + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedLeaveAttribute($__qname); @@ -260,25 +260,6 @@ public class Classes extends NGCCHandler { public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { - case 9: - { - include_content = $value; - $_ngcc_current_state = 8; - action2(); - } - break; - case 8: - { - include_content = $value; - $_ngcc_current_state = 8; - action2(); - } - break; - case 0: - { - revertToParentFromText(this, super._cookie, $value); - } - break; case 4: { exclude_content = $value; @@ -293,6 +274,20 @@ public class Classes extends NGCCHandler { action0(); } break; + case 9: + { + include_content = $value; + $_ngcc_current_state = 8; + action2(); + } + break; + case 10: + { + __text = $value; + $_ngcc_current_state = 9; + action3(); + } + break; case 6: { __text = $value; @@ -300,17 +295,22 @@ public class Classes extends NGCCHandler { action1(); } break; + case 8: + { + include_content = $value; + $_ngcc_current_state = 8; + action2(); + } + break; case 2: { $_ngcc_current_state = 1; $runtime.sendText(super._cookie, $value); } break; - case 10: + case 0: { - __text = $value; - $_ngcc_current_state = 9; - action3(); + revertToParentFromText(this, super._cookie, $value); } break; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java index 7777f955275..f806a817416 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Config.java @@ -74,31 +74,16 @@ public class Config extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 1: + case 2: { if(($__uri.equals("") && $__local.equals("schema"))) { - NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir); + NGCCHandler h = new Schema(this, super._source, $runtime, 16, baseDir); spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); } else { - unexpectedEnterElement($__qname); - } - } - break; - case 0: - { - revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; - case 7: - { - if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { - $runtime.consumeAttribute($ai); + $_ngcc_current_state = 1; $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); } - else { - unexpectedEnterElement($__qname); - } } break; case 8: @@ -112,22 +97,10 @@ public class Config extends NGCCHandler { } } break; - case 2: - { - if(($__uri.equals("") && $__local.equals("schema"))) { - NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir); - spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); - } - else { - $_ngcc_current_state = 1; - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - } - break; case 4: { if(($__uri.equals("") && $__local.equals("classes"))) { - NGCCHandler h = new Classes(this, super._source, $runtime, 34); + NGCCHandler h = new Classes(this, super._source, $runtime, 18); spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); } else { @@ -135,6 +108,33 @@ public class Config extends NGCCHandler { } } break; + case 0: + { + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); + } + break; + case 1: + { + if(($__uri.equals("") && $__local.equals("schema"))) { + NGCCHandler h = new Schema(this, super._source, $runtime, 15, baseDir); + spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs); + } + else { + unexpectedEnterElement($__qname); + } + } + break; + case 7: + { + if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + } + else { + unexpectedEnterElement($__qname); + } + } + break; default: { unexpectedEnterElement($__qname); @@ -149,6 +149,17 @@ public class Config extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + break; + case 0: + { + revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); + } + break; case 1: { if(($__uri.equals("") && $__local.equals("config"))) { @@ -160,11 +171,6 @@ public class Config extends NGCCHandler { } } break; - case 0: - { - revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 7: { if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { @@ -176,12 +182,6 @@ public class Config extends NGCCHandler { } } break; - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); - } - break; default: { unexpectedLeaveElement($__qname); @@ -196,6 +196,12 @@ public class Config extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { + case 2: + { + $_ngcc_current_state = 1; + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; case 0: { revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); @@ -211,12 +217,6 @@ public class Config extends NGCCHandler { } } break; - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); - } - break; default: { unexpectedEnterAttribute($__qname); @@ -231,11 +231,6 @@ public class Config extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 0: - { - revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); - } - break; case 2: { $_ngcc_current_state = 1; @@ -252,6 +247,11 @@ public class Config extends NGCCHandler { } } break; + case 0: + { + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); + } + break; default: { unexpectedLeaveAttribute($__qname); @@ -263,9 +263,10 @@ public class Config extends NGCCHandler { public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { - case 0: + case 2: { - revertToParentFromText(this, super._cookie, $value); + $_ngcc_current_state = 1; + $runtime.sendText(super._cookie, $value); } break; case 6: @@ -275,6 +276,11 @@ public class Config extends NGCCHandler { action1(); } break; + case 0: + { + revertToParentFromText(this, super._cookie, $value); + } + break; case 7: { if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) { @@ -283,31 +289,25 @@ public class Config extends NGCCHandler { } } break; - case 2: - { - $_ngcc_current_state = 1; - $runtime.sendText(super._cookie, $value); - } - break; } } public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException { switch(cookie) { - case 31: + case 16: { this._schema = ((Schema)result); action0(); $_ngcc_current_state = 1; } break; - case 34: + case 18: { this.classes = ((Classes)result); $_ngcc_current_state = 2; } break; - case 32: + case 15: { this._schema = ((Schema)result); action0(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java index 489de1c9ffc..18de25f4a88 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/Schema.java @@ -67,6 +67,23 @@ public class Schema extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { + case 0: + { + revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); + } + break; + case 6: + { + if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + } + else { + $_ngcc_current_state = 2; + $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); + } + } + break; case 2: { if(($ai = $runtime.getAttributeIndex("","location"))>=0) { @@ -90,23 +107,6 @@ public class Schema extends NGCCHandler { } } break; - case 0: - { - revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); - } - break; - case 6: - { - if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - else { - $_ngcc_current_state = 2; - $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); - } - } - break; default: { unexpectedEnterElement($__qname); @@ -121,29 +121,6 @@ public class Schema extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 1: - { - if(($__uri.equals("") && $__local.equals("schema"))) { - $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); - $_ngcc_current_state = 0; - } - else { - unexpectedLeaveElement($__qname); - } - } - break; - case 2: - { - if(($ai = $runtime.getAttributeIndex("","location"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); - } - else { - $_ngcc_current_state = 1; - $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); - } - } - break; case 0: { revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); @@ -161,6 +138,29 @@ public class Schema extends NGCCHandler { } } break; + case 2: + { + if(($ai = $runtime.getAttributeIndex("","location"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + else { + $_ngcc_current_state = 1; + $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); + } + } + break; + case 1: + { + if(($__uri.equals("") && $__local.equals("schema"))) { + $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); + $_ngcc_current_state = 0; + } + else { + unexpectedLeaveElement($__qname); + } + } + break; default: { unexpectedLeaveElement($__qname); @@ -175,17 +175,6 @@ public class Schema extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 2: - { - if(($__uri.equals("") && $__local.equals("location"))) { - $_ngcc_current_state = 4; - } - else { - $_ngcc_current_state = 1; - $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); - } - } - break; case 0: { revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); @@ -202,6 +191,17 @@ public class Schema extends NGCCHandler { } } break; + case 2: + { + if(($__uri.equals("") && $__local.equals("location"))) { + $_ngcc_current_state = 4; + } + else { + $_ngcc_current_state = 1; + $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); + } + } + break; default: { unexpectedEnterAttribute($__qname); @@ -216,10 +216,9 @@ public class Schema extends NGCCHandler { $localName = $__local; $qname = $__qname; switch($_ngcc_current_state) { - case 2: + case 0: { - $_ngcc_current_state = 1; - $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); } break; case 7: @@ -232,6 +231,12 @@ public class Schema extends NGCCHandler { } } break; + case 6: + { + $_ngcc_current_state = 2; + $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); + } + break; case 3: { if(($__uri.equals("") && $__local.equals("location"))) { @@ -242,14 +247,9 @@ public class Schema extends NGCCHandler { } } break; - case 0: + case 2: { - revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); - } - break; - case 6: - { - $_ngcc_current_state = 2; + $_ngcc_current_state = 1; $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); } break; @@ -264,25 +264,6 @@ public class Schema extends NGCCHandler { public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { - case 2: - { - if(($ai = $runtime.getAttributeIndex("","location"))>=0) { - $runtime.consumeAttribute($ai); - $runtime.sendText(super._cookie, $value); - } - else { - $_ngcc_current_state = 1; - $runtime.sendText(super._cookie, $value); - } - } - break; - case 4: - { - loc = $value; - $_ngcc_current_state = 3; - action0(); - } - break; case 8: { namespace = $value; @@ -306,6 +287,25 @@ public class Schema extends NGCCHandler { } } break; + case 4: + { + loc = $value; + $_ngcc_current_state = 3; + action0(); + } + break; + case 2: + { + if(($ai = $runtime.getAttributeIndex("","location"))>=0) { + $runtime.consumeAttribute($ai); + $runtime.sendText(super._cookie, $value); + } + else { + $_ngcc_current_state = 1; + $runtime.sendText(super._cookie, $value); + } + } + break; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties index 0917dd67ad6..5d7ed24b883 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties @@ -23,7 +23,7 @@ # questions. # -build-id=2.2.9-b13941 -build-version=JAX-WS RI 2.2.9-b13941 +build-id=2.2.9-b14027 +build-version=JAX-WS RI 2.2.9-b14027 major-version=2.2.9 -svn-revision=unknown +svn-revision=14027 diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties index 73dc95b47ad..4e64ca0c717 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties @@ -171,23 +171,23 @@ Driver.CompilingSchema = \ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b63 \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b01 \n\ See http://java.sun.com/xml/jaxb \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\ Generated on: {0} \n Driver.Version = \ - xjc 2.2.7-b63 + xjc 2.2.8-b01 Driver.FullVersion = \ - xjc full version "2.2.7-b63-b19" + xjc full version "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties index f83aa74cd97..3fee895ed99 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_de.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ... Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b63 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b01 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = xjc vollst\u00e4ndige Version "2.2.7-b63-b19" +Driver.FullVersion = xjc vollst\u00e4ndige Version "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties index 104d93590a9..ee3e09df36a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_es.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = Compilando un esquema... Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.7-b63 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.8-b01 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = versi\u00f3n completa de xjc "2.2.7-b63-b19" +Driver.FullVersion = versi\u00f3n completa de xjc "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties index c992d94b4ea..d5a8fbbacbf 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma... Driver.FailedToGenerateCode = Echec de la production du code. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.7-b63 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.8-b01 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = version compl\u00e8te xjc "2.2.7-b63-b19" +Driver.FullVersion = version compl\u00e8te xjc "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties index 1edbcb844f5..33441891015 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_it.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = compilazione di uno schema in corso... Driver.FailedToGenerateCode = Produzione del codice non riuscita. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.7-b63 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b01 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = versione completa xjc "2.2.7-b63-b19" +Driver.FullVersion = versione completa xjc "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties index bf99b6b05f6..edd5c648e7c 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\ Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.7-b63\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.8-b01\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = xjc\u30d5\u30eb\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3"2.2.7-b63-b19" +Driver.FullVersion = xjc\u30d5\u30eb\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3"2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties index b0ed1684017..d493f5bd054 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294 Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.7-b63 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.8-b01 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n -Driver.Version = XJC 2.2.7-b63 +Driver.Version = XJC 2.2.8-b01 -Driver.FullVersion = XJC \uc815\uc2dd \ubc84\uc804 "2.2.7-b63-b19" +Driver.FullVersion = XJC \uc815\uc2dd \ubc84\uc804 "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties index 54a4a21a496..3ac7a0bf2c3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = compilando um esquema... Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.7-b63 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.8-b01 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = vers\u00e3o completa de xjc "2.2.7-b63-b19" +Driver.FullVersion = vers\u00e3o completa de xjc "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties index d9636417969..610bb1e3cc7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f... Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.7-b63 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.8-b01 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = xjc \u5b8c\u6574\u7248\u672c "2.2.7-b63-b19" +Driver.FullVersion = xjc \u5b8c\u6574\u7248\u672c "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties index e32b9cea11d..3ed7786c9ec 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties @@ -96,17 +96,17 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981... Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. -# DO NOT localize the 2.2.7-b63 string - it is a token for an ant -Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b63 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n +# DO NOT localize the 2.2.8-b01 string - it is a token for an ant +Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b01 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n -Driver.Version = xjc 2.2.7-b63 +Driver.Version = xjc 2.2.8-b01 -Driver.FullVersion = xjc \u5b8c\u6574\u7248\u672c "2.2.7-b63-b19" +Driver.FullVersion = xjc \u5b8c\u6574\u7248\u672c "2.2.8-b01-b28" -Driver.BuildID = 2.2.7-b63 +Driver.BuildID = 2.2.8-b01 # for JDK integration - include version in source zip -jaxb.jdk.version=2.2.7-b63 +jaxb.jdk.version=2.2.8-b01 # see java.text.SimpleDateFormat for format syntax # DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date. diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java index 27a60e82ccf..243bc587709 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java @@ -289,12 +289,23 @@ public class ModelBuilder implements ModelBuilderI { String pkg = nav.getPackageName(clazz); if (!registries.containsKey(pkg)) { // insert the package's object factory - C c = nav.findClass(pkg + ".ObjectFactory", clazz); + C c = loadObjectFactory(clazz, pkg); if (c != null) addRegistry(c, p); } } + private C loadObjectFactory(C clazz, String pkg) { + C c; + try { + c = nav.findClass(pkg + ".ObjectFactory", clazz); + } catch (SecurityException ignored) { + // treat SecurityException in same way as ClassNotFoundException in this case + c = null; + } + return c; + } + /** * Getting parametrized classes of {@code JAXBElement<...>} property * @param p property which parametrized types we will try to get diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java index 3b56d1d7ed5..4f518cbda16 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -894,19 +894,6 @@ public final class JAXBContextImpl extends JAXBRIContext { } } - /** - * Used for testing. - */ - public SchemaOutputResolver createTestResolver() { - return new SchemaOutputResolver() { - public Result createOutput(String namespaceUri, String suggestedFileName) { - SAXResult r = new SAXResult(new DefaultHandler()); - r.setSystemId(suggestedFileName); - return r; - } - }; - } - @Override public Binder createBinder(Class domType) { if(domType==Node.class) diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java index b20946b8681..30c80801592 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -278,6 +278,7 @@ public final class XmlSchemaGenerator { public void add( ElementInfo elem ) { assert elem!=null; + @SuppressWarnings("UnusedAssignment") boolean nillable = false; // default value QName name = elem.getElementName(); @@ -1162,9 +1163,8 @@ public final class XmlSchemaGenerator { return true; } - // there's a circular reference from an anonymous subtype to a global element - if ((ci != null) && ((targetTagName != null) && (te.getScope() == null))) { - if (targetTagName.getLocalPart().equals(tn.getLocalPart())) { + if ((ci != null) && ((targetTagName != null) && (te.getScope() == null) && (targetTagName.getNamespaceURI() == null))) { + if (targetTagName.equals(tn)) { return true; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java index 3252aa1970a..ad226f470a5 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -35,7 +35,7 @@ import java.util.ResourceBundle; public class CommonResourceBundle extends AbstractResourceBundle { public static final String BASE_NAME = "com.sun.xml.internal.fastinfoset.resources.ResourceBundle"; - private static CommonResourceBundle instance = null; + private static volatile CommonResourceBundle instance = null; private static Locale locale = null; private ResourceBundle bundle = null; @@ -56,8 +56,7 @@ public class CommonResourceBundle extends AbstractResourceBundle { //**need to know where to get the locale //String localeString = CommonProperties.getInstance() // .getProperty("omar.common.locale"); - String localeString = null; - locale = parseLocale(localeString); + locale = parseLocale(/*localeString*/null); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/Decoder.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/Decoder.java index e6602114441..23f4dd1c9f6 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/Decoder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/Decoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -431,7 +431,7 @@ public abstract class Decoder implements FastInfosetParser { final int noOfItems = decodeNumberOfItemsOfSequence(); for (int i = 0; i < noOfItems; i++) { - String URI = decodeNonEmptyOctetStringOnSecondBitAsUtf8String(); + /*String URI = */decodeNonEmptyOctetStringOnSecondBitAsUtf8String(); decodeNonEmptyOctetStringLengthOnSecondBit(); ensureOctetBufferSize(); @@ -1817,7 +1817,7 @@ public abstract class Decoder implements FastInfosetParser { second.getChars(0, l2, _charBuffer, l1 + 1); return new String(_charBuffer, 0, total); } else { - StringBuffer b = new StringBuffer(new String(first)); + StringBuilder b = new StringBuilder(new String(first)); b.append(':'); b.append(second); return b.toString(); @@ -1992,10 +1992,12 @@ public abstract class Decoder implements FastInfosetParser { static public boolean isFastInfosetDocument(InputStream s) throws IOException { // TODO // Check for 0) { - String version = decodeCharacterEncodingScheme(); + /*String version = */decodeCharacterEncodingScheme(); /* * TODO * how to report the character encoding scheme? @@ -280,7 +280,7 @@ public class DOMDocumentParser extends Decoder { } if ((_b & EncodingConstants.DOCUMENT_STANDALONE_FLAG) > 0) { - boolean standalone = (read() > 0) ? true : false ; + /*boolean standalone = (*/read()/* > 0) ? true : false*/ ; /* * TODO * how to report the standalone flag? diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties index 2f23d9147ec..bccada9ea96 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# 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 diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java index 00846c9bfbe..afca1160afb 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java index 8ca856c710a..2d44b5f319d 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -850,7 +850,7 @@ public class SAXDocumentParser extends Decoder implements FastInfosetReader { } if ((_b & EncodingConstants.DOCUMENT_CHARACTER_ENCODING_SCHEME) > 0) { - String characterEncodingScheme = decodeCharacterEncodingScheme(); + /*String characterEncodingScheme = */decodeCharacterEncodingScheme(); /* * TODO * how to report the character encoding scheme? @@ -858,7 +858,7 @@ public class SAXDocumentParser extends Decoder implements FastInfosetReader { } if ((_b & EncodingConstants.DOCUMENT_STANDALONE_FLAG) > 0) { - boolean standalone = (read() > 0) ? true : false ; + /*boolean standalone = (*/read()/* > 0) ? true : false*/ ; /* * TODO * how to report the standalone flag? diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java index 25c82f1f6b4..0475d914cee 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -499,7 +499,7 @@ public class StAXDocumentParser extends Decoder } } - private final void popStack() { + private void popStack() { // Pop information off the stack _qualifiedName = _qNameStack[_stackCount]; _currentNamespaceAIIsStart = _namespaceAIIsStartStack[_stackCount]; @@ -522,8 +522,6 @@ public class StAXDocumentParser extends Decoder throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.namespaceURINotMatch", new Object[]{namespaceURI})); if(localName != null && !localName.equals(getLocalName())) throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.localNameNotMatch", new Object[]{localName})); - - return; } /** Reads the content of a text-only element. Precondition: @@ -551,7 +549,7 @@ public class StAXDocumentParser extends Decoder CommonResourceBundle.getInstance().getString("message.mustBeOnSTARTELEMENT"), getLocation()); } int eventType = getEventType(); - StringBuffer content = new StringBuffer(); + StringBuilder content = new StringBuilder(); while(eventType != END_ELEMENT ) { if(eventType == CHARACTERS || eventType == CDATA @@ -1624,6 +1622,11 @@ public class StAXDocumentParser extends Decoder ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : ""; String public_identifier = ((b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0) ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : ""; + + if (logger.isLoggable(Level.FINEST)) { + logger.log(Level.FINEST, "processUnexpandedEntityReference: entity_reference_name={0} system_identifier={1}public_identifier={2}", + new Object[]{entity_reference_name, system_identifier, public_identifier}); + } } protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java index a86051f9a46..6235b7feecc 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -187,14 +187,16 @@ public class StartElementEvent extends EventBase implements StartElement { } public String toString() { - String s = "<" + nameAsString(); + final StringBuilder sb = new StringBuilder(64); + + sb.append('<').append(nameAsString()); if(_attributes != null){ Iterator it = this.getAttributes(); Attribute attr = null; while(it.hasNext()){ attr = (Attribute)it.next(); - s = s + " " + attr.toString(); + sb.append(' ').append(attr.toString()); } } @@ -203,11 +205,11 @@ public class StartElementEvent extends EventBase implements StartElement { Namespace attr = null; while(it.hasNext()){ attr = (Namespace)it.next(); - s = s + " " + attr.toString(); + sb.append(' ').append(attr.toString()); } } - s = s + ">"; - return s; + sb.append('>'); + return sb.toString(); } /** Return this event as String diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java index 4c9d393cb4e..5c1ff64dc0f 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -69,28 +69,53 @@ public class StAXOutputFactory extends XMLOutputFactory { } public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException { - if(result instanceof StreamResult){ - StreamResult streamResult = (StreamResult)result; - if( streamResult.getWriter() != null){ + if (result instanceof StreamResult) { + StreamResult streamResult = (StreamResult) result; + if (streamResult.getWriter() != null) { return createXMLStreamWriter(streamResult.getWriter()); - }else if(streamResult.getOutputStream() != null ){ + } else if (streamResult.getOutputStream() != null) { return createXMLStreamWriter(streamResult.getOutputStream()); - }else if(streamResult.getSystemId()!= null){ - try{ - FileWriter writer = new FileWriter(new File(streamResult.getSystemId())); - return createXMLStreamWriter(writer); - }catch(IOException ie){ + } else if (streamResult.getSystemId() != null) { + FileWriter writer = null; + boolean isError = true; + + try { + writer = new FileWriter(new File(streamResult.getSystemId())); + final XMLStreamWriter streamWriter = createXMLStreamWriter(writer); + isError = false; + + return streamWriter; + } catch (IOException ie) { throw new XMLStreamException(ie); + } finally { + if (isError && writer != null) { + try { + writer.close(); + } catch (IOException ignored) { + } + } } } - } - else { - try{ + } else { + FileWriter writer = null; + boolean isError = true; + + try { //xxx: should we be using FileOutputStream - nb. - FileWriter writer = new FileWriter(new File(result.getSystemId())); - return createXMLStreamWriter(writer); - }catch(IOException ie){ + writer = new FileWriter(new File(result.getSystemId())); + final XMLStreamWriter streamWriter = createXMLStreamWriter(writer); + isError = false; + + return streamWriter; + } catch (IOException ie) { throw new XMLStreamException(ie); + } finally { + if (isError && writer != null) { + try { + writer.close(); + } catch (IOException ignored) { + } + } } } throw new java.lang.UnsupportedOperationException(); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java index bfd3109a615..0429140a58a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -397,11 +397,27 @@ public class SAXEventSerializer extends DefaultHandler public int compareTo(Object o) { try { return qName.compareTo(((AttributeValueHolder) o).qName); - } - catch (Exception e) { + } catch (Exception e) { throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected")); } } + + @Override + public boolean equals(Object o) { + try { + return (o instanceof AttributeValueHolder) && + qName.equals(((AttributeValueHolder) o).qName); + } catch (Exception e) { + throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected")); + } + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + (this.qName != null ? this.qName.hashCode() : 0); + return hash; + } } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java index c147306786b..a8c1f306913 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -115,7 +115,7 @@ public abstract class TransformInputOutput { String[] fileSplit = fileStr.split("/"); int diff; - for(diff = 0; diff CLASS_FILES; + private static final Class CLASS_PATH; + private static final Class CLASS_FILE_ATTRIBUTE; + private static final Class CLASS_FILE_ATTRIBUTES; + private static final Method METHOD_FILE_TO_PATH; + private static final Method METHOD_FILES_CREATE_TEMP_FILE; + private static final Method METHOD_FILES_CREATE_TEMP_FILE_WITHPATH; + + private static final Method METHOD_PATH_TO_FILE; + + private static boolean useJdk6API; + + static { + useJdk6API = isJdk6(); + + CLASS_FILES = safeGetClass("java.nio.file.Files"); + CLASS_PATH = safeGetClass("java.nio.file.Path"); + CLASS_FILE_ATTRIBUTE = safeGetClass("java.nio.file.attribute.FileAttribute"); + CLASS_FILE_ATTRIBUTES = safeGetClass("[Ljava.nio.file.attribute.FileAttribute;"); + METHOD_FILE_TO_PATH = safeGetMethod(File.class, "toPath"); + METHOD_FILES_CREATE_TEMP_FILE = safeGetMethod(CLASS_FILES, "createTempFile", String.class, String.class, CLASS_FILE_ATTRIBUTES); + METHOD_FILES_CREATE_TEMP_FILE_WITHPATH = safeGetMethod(CLASS_FILES, "createTempFile", CLASS_PATH, String.class, String.class, CLASS_FILE_ATTRIBUTES); + METHOD_PATH_TO_FILE = safeGetMethod(CLASS_PATH, "toFile"); + } + + private static boolean isJdk6() { + String javaVersion = System.getProperty("java.version"); + LOGGER.log(Level.FINEST, "Detected java version = {0}", javaVersion); + return javaVersion.startsWith("1.6."); + } + + private static Class safeGetClass(String className) { + // it is jdk 6 or something failed already before + if (useJdk6API) return null; + try { + return Class.forName(className); + } catch (ClassNotFoundException e) { + LOGGER.log(Level.SEVERE, "Exception cought", e); + LOGGER.log(Level.WARNING, "Class {0} not found. Temp files will be created using old java.io API.", className); + useJdk6API = true; + return null; + } + } + + private static Method safeGetMethod(Class clazz, String methodName, Class... parameterTypes) { + // it is jdk 6 or something failed already before + if (useJdk6API) return null; + try { + return clazz.getMethod(methodName, parameterTypes); + } catch (NoSuchMethodException e) { + LOGGER.log(Level.SEVERE, "Exception cought", e); + LOGGER.log(Level.WARNING, "Method {0} not found. Temp files will be created using old java.io API.", methodName); + useJdk6API = true; + return null; + } + } + + + static Object toPath(File f) throws InvocationTargetException, IllegalAccessException { + return METHOD_FILE_TO_PATH.invoke(f); + } + + static File toFile(Object path) throws InvocationTargetException, IllegalAccessException { + return (File) METHOD_PATH_TO_FILE.invoke(path); + } + + static File createTempFile(String prefix, String suffix, File dir) throws IOException { + + if (useJdk6API) { + LOGGER.log(Level.FINEST, "Jdk6 detected, temp file (prefix:{0}, suffix:{1}) being created using old java.io API.", new Object[]{prefix, suffix}); + return File.createTempFile(prefix, suffix, dir); + + } else { + + try { + if (dir != null) { + Object path = toPath(dir); + LOGGER.log(Level.FINEST, "Temp file (path: {0}, prefix:{1}, suffix:{2}) being created using NIO API.", new Object[]{dir.getAbsolutePath(), prefix, suffix}); + return toFile(METHOD_FILES_CREATE_TEMP_FILE_WITHPATH.invoke(null, path, prefix, suffix, Array.newInstance(CLASS_FILE_ATTRIBUTE, 0))); + } else { + LOGGER.log(Level.FINEST, "Temp file (prefix:{0}, suffix:{1}) being created using NIO API.", new Object[]{prefix, suffix}); + return toFile(METHOD_FILES_CREATE_TEMP_FILE.invoke(null, prefix, suffix, Array.newInstance(CLASS_FILE_ATTRIBUTE, 0))); + } + + } catch (IllegalAccessException e) { + LOGGER.log(Level.SEVERE, "Exception caught", e); + LOGGER.log(Level.WARNING, "Error invoking java.nio API, temp file (path: {0}, prefix:{1}, suffix:{2}) being created using old java.io API.", + new Object[]{dir != null ? dir.getAbsolutePath() : null, prefix, suffix}); + return File.createTempFile(prefix, suffix, dir); + + } catch (InvocationTargetException e) { + LOGGER.log(Level.SEVERE, "Exception caught", e); + LOGGER.log(Level.WARNING, "Error invoking java.nio API, temp file (path: {0}, prefix:{1}, suffix:{2}) being created using old java.io API.", + new Object[]{dir != null ? dir.getAbsolutePath() : null, prefix, suffix}); + return File.createTempFile(prefix, suffix, dir); + } + } + + } + + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java index 39bbcdd8e5b..854d9b707e3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/databinding/DatabindingConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,18 +52,10 @@ public class DatabindingConfig { protected Class contractClass; protected Class endpointClass; protected Set additionalValueTypes = new HashSet(); -// protected Set schemaInfo; -// protected MappingInfo defaultMappingInfo = new MappingInfo(); -// protected MappingInfo overrideMappingInfo = new MappingInfo(); protected MappingInfo mappingInfo = new MappingInfo(); -// protected Definition wsdl; protected URL wsdlURL; protected ClassLoader classLoader; -// protected QName serviceName; -// protected BindingID bindingId; protected Iterable features; - //TODO WSBinding isn't it BindingID + features? - //On the EndpointFactory.createEndpoint path, WSBinding could be created from DeploymentDescriptorParser.createBinding protected WSBinding wsBinding; protected WSDLPort wsdlPort; protected MetadataReader metadataReader; @@ -71,19 +63,6 @@ public class DatabindingConfig { protected Source wsdlSource; protected EntityResolver entityResolver; -// public MappingInfo getDefaultMappingInfo() { -// return defaultMappingInfo; -// } -// public void setDefaultMappingInfo(MappingInfo defaultMappingInfo) { -// this.defaultMappingInfo = defaultMappingInfo; -// } -// public MappingInfo getOverrideMappingInfo() { -// return overrideMappingInfo; -// } -// public void setOverrideMappingInfo(MappingInfo overrideMappingInfo) { -// this.overrideMappingInfo = overrideMappingInfo; -// } - public Class getContractClass() { return contractClass; } @@ -114,19 +93,8 @@ public class DatabindingConfig { public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } -// public QName getServiceName() { -// return serviceName; -// } -// public void setServiceName(QName serviceName) { -// this.serviceName = serviceName; -// } -// public BindingID getBindingId() { -// return bindingId; -// } -// public void setBindingId(BindingID bindingId) { -// this.bindingId = bindingId; -// } public Iterable getFeatures() { + if (features == null && wsBinding != null) return wsBinding.getFeatures(); return features; } public void setFeatures(WebServiceFeature[] features) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java index 252038275e2..a1bd1da3fc9 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -173,7 +173,13 @@ public class SAAJFactory { * @throws SOAPException if SAAJ processing fails */ public static SAAJMessage read(Packet packet) throws SOAPException { - for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { + // Use the Component from the Packet if it exists. Note the logic + // in the ServiceFinder is such that find(Class) is not equivalent + // to find (Class, null), so the ternary operator is needed. + ServiceFinder factories = (packet.component != null ? + ServiceFinder.find(SAAJFactory.class, packet.component) : + ServiceFinder.find(SAAJFactory.class)); + for (SAAJFactory s : factories) { SAAJMessage msg = s.readAsSAAJ(packet); if (msg != null) return msg; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java index 3d7010c7929..516da56cbbd 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/pipe/Fiber.java @@ -1027,12 +1027,12 @@ public final class Fiber implements Runnable, Cancelable, ComponentRegistry { } try { - boolean needsToReenter = false; + boolean needsToReenter; do { // if interceptors are set, go through the interceptors. if (ints == null) { this.next = next; - if (__doRun(isRequireUnlock, ints)) { + if (__doRun(isRequireUnlock, null /*ints*/)) { return true; } } else { @@ -1357,6 +1357,7 @@ public final class Fiber implements Runnable, Cancelable, ComponentRegistry { */ public static @NotNull + @SuppressWarnings({"null", "ConstantConditions"}) Fiber current() { Fiber fiber = CURRENT_FIBER.get(); if (fiber == null) diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java index 66d29c95f8b..51f5da941b9 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,7 @@ import java.io.OutputStream; import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -53,6 +54,7 @@ import java.util.logging.Logger; * * @author Kohsuke Kawaguchi */ +@SuppressWarnings("StaticNonFinalUsedInInitialization") public abstract class XMLStreamWriterFactory { private static final Logger LOGGER = Logger.getLogger(XMLStreamWriterFactory.class.getName()); @@ -80,8 +82,19 @@ public abstract class XMLStreamWriterFactory { // this system property can be used to disable the pooling altogether, // in case someone hits an issue with pooling in the production system. - if(!Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".noPool")) - f = Zephyr.newInstance(xof); + if (!Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".noPool")) { + try { + Class clazz = xof.createXMLStreamWriter(new StringWriter()).getClass(); + if (clazz.getName().startsWith("com.sun.xml.internal.stream.")) { + f = new Zephyr(xof,clazz); + } + } catch (XMLStreamException ex) { + Logger.getLogger(XMLStreamWriterFactory.class.getName()).log(Level.INFO, null, ex); + } catch (NoSuchMethodException ex) { + Logger.getLogger(XMLStreamWriterFactory.class.getName()).log(Level.INFO, null, ex); + } + } + if(f==null) { // is this Woodstox? if(xof.getClass().getName().equals("com.ctc.wstx.stax.WstxOutputFactory")) @@ -91,7 +104,9 @@ public abstract class XMLStreamWriterFactory { f = new Default(xof); theInstance = f; - LOGGER.fine("XMLStreamWriterFactory instance is = "+theInstance); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "XMLStreamWriterFactory instance is = {0}", f); + } } /** @@ -165,6 +180,7 @@ public abstract class XMLStreamWriterFactory { * @param f * must not be null. */ + @SuppressWarnings({"null", "ConstantConditions"}) public static void set(@NotNull XMLStreamWriterFactory f) { if(f==null) throw new IllegalArgumentException(); theInstance = f; @@ -220,10 +236,12 @@ public abstract class XMLStreamWriterFactory { this.xof = xof; } + @Override public XMLStreamWriter doCreate(OutputStream out) { return doCreate(out,"UTF-8"); } + @Override public synchronized XMLStreamWriter doCreate(OutputStream out, String encoding) { try { XMLStreamWriter writer = xof.createXMLStreamWriter(out,encoding); @@ -233,6 +251,7 @@ public abstract class XMLStreamWriterFactory { } } + @Override public void doRecycle(XMLStreamWriter r) { // no recycling } @@ -284,10 +303,12 @@ public abstract class XMLStreamWriterFactory { return sr; } + @Override public XMLStreamWriter doCreate(OutputStream out) { return doCreate(out,"UTF-8"); } + @Override public XMLStreamWriter doCreate(OutputStream out, String encoding) { XMLStreamWriter xsw = fetch(); if(xsw!=null) { @@ -311,6 +332,7 @@ public abstract class XMLStreamWriterFactory { return new HasEncodingWriter(xsw, encoding); } + @Override public void doRecycle(XMLStreamWriter r) { if (r instanceof HasEncodingWriter) { r = ((HasEncodingWriter)r).getWriter(); @@ -340,10 +362,12 @@ public abstract class XMLStreamWriterFactory { this.xof = xof; } + @Override public XMLStreamWriter doCreate(OutputStream out) { return doCreate(out, SOAPBindingCodec.UTF8_ENCODING); } + @Override public XMLStreamWriter doCreate(OutputStream out, String encoding) { try { XMLStreamWriter writer = xof.createXMLStreamWriter(out,encoding); @@ -353,6 +377,7 @@ public abstract class XMLStreamWriterFactory { } } + @Override public void doRecycle(XMLStreamWriter r) { // no recycling } @@ -367,6 +392,7 @@ public abstract class XMLStreamWriterFactory { this.encoding = encoding; } + @Override public String getEncoding() { return encoding; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/MetroConfigLoader.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/MetroConfigLoader.java index e945affa2fb..1e33628b0c1 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/MetroConfigLoader.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/MetroConfigLoader.java @@ -42,10 +42,13 @@ import javax.xml.bind.Unmarshaller; import javax.xml.stream.XMLInputFactory; import javax.xml.ws.WebServiceException; import java.lang.reflect.Method; +import java.lang.reflect.ReflectPermission; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.security.*; +import java.util.PropertyPermission; import java.util.logging.Level; /** @@ -235,7 +238,7 @@ class MetroConfigLoader { private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) { MetroConfig result = null; try { - JAXBContext jaxbContext = JAXBContext.newInstance(MetroConfig.class.getPackage().getName()); + JAXBContext jaxbContext = createJAXBContext(); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); XMLInputFactory factory = XmlUtil.newXMLInputFactory(true); final JAXBElement configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class); @@ -246,6 +249,38 @@ class MetroConfigLoader { return result; } + private static JAXBContext createJAXBContext() throws Exception { + if (isJDKInternal()) { + // since jdk classes are repackaged, extra privilege is necessary to create JAXBContext + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + @Override + public JAXBContext run() throws Exception { + return JAXBContext.newInstance(MetroConfig.class.getPackage().getName()); + } + }, createSecurityContext() + ); + } else { + // usage from JAX-WS/Metro/Glassfish + return JAXBContext.newInstance(MetroConfig.class.getPackage().getName()); + } + } + + private static AccessControlContext createSecurityContext() { + PermissionCollection perms = new Permissions(); + perms.add(new RuntimePermission("accessClassInPackage.com" + ".sun.xml.internal.ws.runtime.config")); // avoid repackaging + perms.add(new ReflectPermission("suppressAccessChecks")); + return new AccessControlContext( + new ProtectionDomain[]{ + new ProtectionDomain(null, perms), + }); + } + + private static boolean isJDKInternal() { + // avoid "string repackaging" + return MetroConfigLoader.class.getName().startsWith("com." + "sun.xml.internal.ws"); + } + private static class MetroConfigUrlLoader extends ResourceLoader { Container container; // TODO remove the field together with the code path using it (see below) diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/TubeCreator.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/TubeCreator.java index ea40e34c8fd..d0e980ce937 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/TubeCreator.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/TubeCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,11 +45,17 @@ final class TubeCreator { private final String msgDumpPropertyBase; TubeCreator(TubeFactoryConfig config, ClassLoader tubeFactoryClassLoader) { + String className = config.getClassName(); try { - Class factoryClass = Class.forName(config.getClassName(), true, tubeFactoryClassLoader); + Class factoryClass; + if (isJDKInternal(className)) { + factoryClass = Class.forName(className, true, null); + } else { + factoryClass = Class.forName(className, true, tubeFactoryClassLoader); + } if (TubeFactory.class.isAssignableFrom(factoryClass)) { - @SuppressWarnings("unchecked") // We can suppress "unchecked" warning here as we are checking for the correct type in the if statement above + @SuppressWarnings("unchecked") Class typedClass = (Class) factoryClass; this.factory = typedClass.newInstance(); this.msgDumpPropertyBase = this.factory.getClass().getName() + ".dump"; @@ -57,11 +63,11 @@ final class TubeCreator { throw new RuntimeException(TubelineassemblyMessages.MASM_0015_CLASS_DOES_NOT_IMPLEMENT_INTERFACE(factoryClass.getName(), TubeFactory.class.getName())); } } catch (InstantiationException ex) { - throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(config.getClassName()), ex), true); + throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(className), ex), true); } catch (IllegalAccessException ex) { - throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(config.getClassName()), ex), true); + throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0016_UNABLE_TO_INSTANTIATE_TUBE_FACTORY(className), ex), true); } catch (ClassNotFoundException ex) { - throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0017_UNABLE_TO_LOAD_TUBE_FACTORY_CLASS(config.getClassName()), ex), true); + throw LOGGER.logSevereException(new RuntimeException(TubelineassemblyMessages.MASM_0017_UNABLE_TO_LOAD_TUBE_FACTORY_CLASS(className), ex), true); } } @@ -90,4 +96,10 @@ final class TubeCreator { String getMessageDumpPropertyBase() { return msgDumpPropertyBase; } + + private boolean isJDKInternal(String className) { + // avoid repackaging + return className.startsWith("com." + "sun.xml.internal.ws"); + } + } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java index f1580ba6f6c..fdd7c424720 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/MonitorRootClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,20 +27,12 @@ package com.sun.xml.internal.ws.client; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.model.wsdl.WSDLServiceImpl; -import java.net.URL; -import java.util.HashMap; import java.util.Map; import javax.xml.namespace.QName; -import com.sun.org.glassfish.external.amx.AMXGlassfish; import com.sun.org.glassfish.gmbal.AMXMetadata; import com.sun.org.glassfish.gmbal.Description; -import com.sun.org.glassfish.gmbal.InheritedAttribute; -import com.sun.org.glassfish.gmbal.InheritedAttributes; import com.sun.org.glassfish.gmbal.ManagedAttribute; -import com.sun.org.glassfish.gmbal.ManagedData; import com.sun.org.glassfish.gmbal.ManagedObject; -import com.sun.org.glassfish.gmbal.ManagedObjectManager; -import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; import java.net.URL; /** diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java index 90ca08e50a2..1cba1a111ab 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/SEIPortInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ import com.sun.xml.internal.ws.binding.SOAPBindingImpl; import com.sun.xml.internal.ws.binding.WebServiceFeatureList; import com.sun.xml.internal.ws.model.SOAPSEIModel; +import javax.xml.ws.WebServiceFeature; + /** * {@link PortInfo} that has {@link SEIModel}. * @@ -46,27 +48,37 @@ import com.sun.xml.internal.ws.model.SOAPSEIModel; * @author Kohsuke Kawaguchi */ public final class SEIPortInfo extends PortInfo { + public final Class sei; + /** * Model of {@link #sei}. */ public final SOAPSEIModel model; public SEIPortInfo(WSServiceDelegate owner, Class sei, SOAPSEIModel model, @NotNull WSDLPort portModel) { - super(owner,portModel); + super(owner, portModel); this.sei = sei; this.model = model; - assert sei!=null && model!=null; + assert sei != null && model != null; + } + + @Override + public BindingImpl createBinding(WebServiceFeature[] webServiceFeatures, Class portInterface) { + BindingImpl binding = super.createBinding(webServiceFeatures, portInterface); + return setKnownHeaders(binding); } public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class portInterface) { // not to pass in (BindingImpl) model.getWSBinding() - BindingImpl bindingImpl = super.createBinding(webServiceFeatures, portInterface, null); - if(bindingImpl instanceof SOAPBindingImpl) { - ((SOAPBindingImpl)bindingImpl).setPortKnownHeaders(model.getKnownHeaders()); + BindingImpl binding = super.createBinding(webServiceFeatures, portInterface, null); + return setKnownHeaders(binding); + } + + private BindingImpl setKnownHeaders(BindingImpl binding) { + if (binding instanceof SOAPBindingImpl) { + ((SOAPBindingImpl) binding).setPortKnownHeaders(model.getKnownHeaders()); } - //Not needed as set above in super.createBinding() call - //bindingImpl.setFeatures(webServiceFeatures); - return bindingImpl; + return binding; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java index a4567fbe643..8b4eaa274ff 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java @@ -91,8 +91,7 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import java.net.MalformedURLException; import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; +import java.security.*; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -187,7 +186,7 @@ public class WSServiceDelegate extends WSService { * Multiple {@link ServiceInterceptor}s are aggregated into one. */ /*package*/ final @NotNull ServiceInterceptor serviceInterceptor; - + private URL wsdlURL; public WSServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass, WebServiceFeature... features) { this(wsdlDocumentLocation, serviceName, serviceClass, new WebServiceFeatureList(features)); @@ -197,6 +196,7 @@ public class WSServiceDelegate extends WSService { this( wsdlDocumentLocation==null ? null : new StreamSource(wsdlDocumentLocation.toExternalForm()), serviceName,serviceClass, features); + wsdlURL = wsdlDocumentLocation; } /** @@ -699,6 +699,39 @@ public class WSServiceDelegate extends WSService { } + private T createProxy(final Class portInterface, final InvocationHandler pis) { + + // When creating the proxy, use a ClassLoader that can load classes + // from both the interface class and also from this classes + // classloader. This is necessary when this code is used in systems + // such as OSGi where the class loader for the interface class may + // not be able to load internal JAX-WS classes like + // "WSBindingProvider", but the class loader for this class may not + // be able to load the interface class. + final ClassLoader loader = getDelegatingLoader(portInterface.getClassLoader(), + WSServiceDelegate.class.getClassLoader()); + + // accessClassInPackage privilege needs to be granted ... + RuntimePermission perm = new RuntimePermission("accessClassInPackage.com.sun." + "xml.internal.*"); + PermissionCollection perms = perm.newPermissionCollection(); + perms.add(perm); + + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public T run() { + Object proxy = Proxy.newProxyInstance(loader, + new Class[]{portInterface, WSBindingProvider.class, Closeable.class}, pis); + return portInterface.cast(proxy); + } + }, + new AccessControlContext( + new ProtectionDomain[]{ + new ProtectionDomain(null, perms) + }) + ); + } + private WSDLServiceImpl getWSDLModelfromSEI(final Class sei) { WebService ws = AccessController.doPrivileged(new PrivilegedAction() { public WebService run() { @@ -750,7 +783,7 @@ public class WSServiceDelegate extends WSService { } } - private T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, Class portInterface, + private T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class portInterface, WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) { //fail if service doesnt have WSDL if (wsdlService == null) { @@ -762,21 +795,11 @@ public class WSServiceDelegate extends WSService { ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames())); } - BindingImpl binding = eif.createBinding(webServiceFeatures,portInterface); + BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface); InvocationHandler pis = getStubHandler(binding, eif, epr); - // When creating the proxy, use a ClassLoader that can load classes - // from both the interface class and also from this classes - // classloader. This is necessary when this code is used in systems - // such as OSGi where the class loader for the interface class may - // not be able to load internal JAX-WS classes like - // "WSBindingProvider", but the class loader for this class may not - // be able to load the interface class. - ClassLoader loader = - getDelegatingLoader(portInterface.getClassLoader(), - WSServiceDelegate.class.getClassLoader()); - T proxy = portInterface.cast(Proxy.newProxyInstance(loader, - new Class[]{portInterface, WSBindingProvider.class, Closeable.class}, pis)); + T proxy = createProxy(portInterface, pis); + if (serviceInterceptor != null) { serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface); } @@ -841,7 +864,7 @@ public class WSServiceDelegate extends WSService { config.setFeatures(features); config.setClassLoader(portInterface.getClassLoader()); config.getMappingInfo().setPortName(portName); - + config.setWsdlURL(wsdlURL); // if ExternalMetadataFeature present, ExternalMetadataReader will be created ... config.setMetadataReader(getMetadadaReader(features, portInterface.getClassLoader())); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java index 72e130a37f7..5b3f9c1bee3 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java @@ -386,8 +386,10 @@ public abstract class DispatchImpl extends Stub implements Dispatch { endpoint = (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY); } // This is existing before packetTakesPriorityOverRequestContext so leaving in place. - if (endpoint == null) + if (endpoint == null) { + if (message.endpointAddress == null) throw new WebServiceException(DispatchMessages.INVALID_NULLARG_URI()); endpoint = message.endpointAddress.toString(); + } String pathInfo = null; String queryString = null; diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java index ed4c069bd25..7a5f0e3a1a7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,7 +88,7 @@ public final class SEIStub extends Stub implements InvocationHandler { // first fill in sychronized versions for (JavaMethodImpl m : seiModel.getJavaMethods()) { if (!m.getMEP().isAsync) { - SyncMethodHandler handler = new SyncMethodHandler(this, m.getMethod()); + SyncMethodHandler handler = new SyncMethodHandler(this, m); syncs.put(m.getOperation(), m); methodHandlers.put(m.getMethod(), handler); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java index 7a763c42bb5..0f70951f35c 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,13 @@ import com.sun.xml.internal.ws.client.RequestContext; import com.sun.xml.internal.ws.client.ResponseContextReceiver; import com.sun.xml.internal.ws.encoding.soap.DeserializationException; import com.sun.xml.internal.ws.message.jaxb.JAXBMessage; +import com.sun.xml.internal.ws.model.JavaMethodImpl; +import com.sun.xml.internal.ws.resources.DispatchMessages; import javax.xml.bind.JAXBException; import javax.xml.stream.XMLStreamException; import javax.xml.ws.Holder; +import javax.xml.ws.WebServiceException; import java.lang.reflect.Method; @@ -60,18 +63,16 @@ import java.lang.reflect.Method; * @author Kohsuke Kawaguchi */ final class SyncMethodHandler extends MethodHandler { -// private ResponseBuilder responseBuilder; - - SyncMethodHandler(SEIStub owner, Method m) { - super(owner, m); -// responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC); + final boolean isVoid; + final boolean isOneway; + final JavaMethodImpl javaMethod; + SyncMethodHandler(SEIStub owner, JavaMethodImpl jm) { + super(owner, jm.getMethod()); + javaMethod = jm; + isVoid = void.class.equals(jm.getMethod().getReturnType()); + isOneway = jm.getMEP().isOneWay(); } -// SyncMethodHandler(SEIStub owner, JavaMethodImpl method) { -// super(owner, method); -// responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC); -// } - Object invoke(Object proxy, Object[] args) throws Throwable { return invoke(proxy,args,owner.requestContext,owner); } @@ -87,37 +88,32 @@ final class SyncMethodHandler extends MethodHandler { */ Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable { JavaCallInfo call = owner.databinding.createJavaCallInfo(method, args); -// Packet req = new Packet(createRequestMessage(args)); Packet req = (Packet) owner.databinding.serializeRequest(call); // process the message Packet reply = owner.doProcess(req,rc,receiver); Message msg = reply.getMessage(); - if(msg ==null) - // no reply. must have been one-way + if(msg == null) { + if (!isOneway || !isVoid) { + throw new WebServiceException(DispatchMessages.INVALID_RESPONSE()); + } return null; + } try { -// return dbHandler.readResponse(reply, call).getReturnValue(); call = owner.databinding.deserializeResponse(reply, call); if (call.getException() != null) { throw call.getException(); } else { return call.getReturnValue(); } -// if(msg.isFault()) { -// SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg); -// throw faultBuilder.createException(checkedExceptions); -// } else { -// return responseBuilder.readResponse(msg,args); -// } } catch (JAXBException e) { - throw new DeserializationException("failed.to.read.response",e); + throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(), e); } catch (XMLStreamException e) { - throw new DeserializationException("failed.to.read.response",e); + throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e); } finally { - if (reply.transportBackChannel != null) - reply.transportBackChannel.close(); + if (reply.transportBackChannel != null) + reply.transportBackChannel.close(); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java index d4658fa0b01..f2bcebb9284 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingFactoryImpl.java @@ -42,6 +42,7 @@ import org.xml.sax.EntityResolver; import com.oracle.webservices.internal.api.databinding.Databinding; import com.oracle.webservices.internal.api.databinding.Databinding.Builder; import com.oracle.webservices.internal.api.databinding.WSDLGenerator; +import com.oracle.webservices.internal.api.databinding.DatabindingModeFeature; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.databinding.DatabindingConfig; @@ -58,13 +59,10 @@ import com.sun.xml.internal.ws.util.ServiceFinder; */ public class DatabindingFactoryImpl extends DatabindingFactory { -// static final String WsRuntimeFactoryProperties = DatabindingProvider.class.getName() + ".properties"; static final String WsRuntimeFactoryDefaultImpl = "com.sun.xml.internal.ws.db.DatabindingProviderImpl"; protected Map properties = new HashMap(); protected DatabindingProvider defaultRuntimeFactory; -// protected Map runtimeFactories = new HashMap(); -// protected Properties wsRuntimeFactoryMap; protected List providers; static private List providers() { @@ -97,11 +95,6 @@ public class DatabindingFactoryImpl extends DatabindingFactory { if (p.isFor(mode)) provider = p; } if (provider == null) { - // if (defaultRuntimeFactory == null) { - // defaultRuntimeFactory = - // newRuntimeFactory(WsRuntimeFactoryDefaultImpl); - // } - // provider = defaultRuntimeFactory; provider = new DatabindingProviderImpl(); } return provider; @@ -117,33 +110,14 @@ public class DatabindingFactoryImpl extends DatabindingFactory { return provider.wsdlGen(config); } -// DatabindingProvider newRuntimeFactory(String name) { -// ClassLoader classLoader = classLoader(); -// DatabindingProvider factory = null; -// try { -// Class cls = (classLoader != null) ? classLoader.loadClass(name) : Class.forName(name); -// factory = DatabindingProvider.class.cast(cls.newInstance()); -// } catch (Exception e) { -// throw new DatabindingException("Unknown DatabindingFactory: " + name, e); -// } -// factory.init(properties); -// return factory; -// } - String databindingMode(DatabindingConfig config) { -// if ( config.getOverrideMappingInfo() != null && -// config.getOverrideMappingInfo().getDatabindingMode() != null) -// return config.getOverrideMappingInfo().getDatabindingMode(); -// if ( config.getDefaultMappingInfo() != null && -// config.getDefaultMappingInfo().getDatabindingMode() != null) -// return config.getDefaultMappingInfo().getDatabindingMode(); - if ( config.getMappingInfo() != null && config.getMappingInfo().getDatabindingMode() != null) return config.getMappingInfo().getDatabindingMode(); if ( config.getFeatures() != null) for (WebServiceFeature f : config.getFeatures()) { - if (f instanceof com.oracle.webservices.internal.api.databinding.DatabindingModeFeature) { - com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf = (com.oracle.webservices.internal.api.databinding.DatabindingModeFeature) f; + if (f instanceof DatabindingModeFeature) { + DatabindingModeFeature dmf = (DatabindingModeFeature) f; + config.properties().putAll(dmf.getProperties()); return dmf.getMode(); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java index d5d992561f7..745df5f65b9 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/db/DatabindingImpl.java @@ -66,58 +66,77 @@ import com.sun.xml.internal.ws.wsdl.OperationDispatcher; * * @author shih-chang.chen@oracle.com */ -public class DatabindingImpl implements Databinding { +public final class DatabindingImpl implements Databinding { AbstractSEIModelImpl seiModel; - Map stubHandlers; + Map stubHandlers; // QNameMap wsdlOpMap = new QNameMap(); - Map wsdlOpMap = new HashMap(); - Map tieHandlers = new HashMap(); + Map wsdlOpMap = new HashMap(); + Map tieHandlers = new HashMap(); OperationDispatcher operationDispatcher; OperationDispatcher operationDispatcherNoWsdl; boolean clientConfig = false; Codec codec; MessageContextFactory packetFactory = null; - public DatabindingImpl(DatabindingProviderImpl p, DatabindingConfig config) { - RuntimeModeler modeler = new RuntimeModeler(config); - modeler.setClassLoader(config.getClassLoader()); - seiModel = modeler.buildRuntimeModel(); - WSDLPort wsdlport = config.getWsdlPort(); - packetFactory = new MessageContextFactory(seiModel.getWSBinding().getFeatures()); - clientConfig = isClientConfig(config); - if ( clientConfig ) initStubHandlers(); - seiModel.setDatabinding(this); - if (wsdlport != null) freeze(wsdlport); - if (operationDispatcher == null) operationDispatcherNoWsdl = new OperationDispatcher(null, seiModel.getWSBinding(), seiModel); + public DatabindingImpl(DatabindingProviderImpl p, DatabindingConfig config) { + RuntimeModeler modeler = new RuntimeModeler(config); + modeler.setClassLoader(config.getClassLoader()); + seiModel = modeler.buildRuntimeModel(); + WSDLPort wsdlport = config.getWsdlPort(); + packetFactory = new MessageContextFactory(seiModel.getWSBinding().getFeatures()); + clientConfig = isClientConfig(config); + if (clientConfig) { + initStubHandlers(); + } + seiModel.setDatabinding(this); + if (wsdlport != null) { + freeze(wsdlport); + } + if (operationDispatcher == null) { + operationDispatcherNoWsdl = new OperationDispatcher(null, seiModel.getWSBinding(), seiModel); + } // if(!clientConfig) { - for(JavaMethodImpl jm: seiModel.getJavaMethods()) if (!jm.isAsync()) { - TieHandler th = new TieHandler(jm, seiModel.getWSBinding(), packetFactory); - wsdlOpMap.put(jm, th); - tieHandlers.put(th.getMethod(), th); + for (JavaMethodImpl jm : seiModel.getJavaMethods()) { + if (!jm.isAsync()) { + TieHandler th = new TieHandler(jm, seiModel.getWSBinding(), packetFactory); + wsdlOpMap.put(jm, th); + tieHandlers.put(th.getMethod(), th); + } } // } - } + } - //TODO isClientConfig - private boolean isClientConfig(DatabindingConfig config) { - if (config.getContractClass() == null) return false; - if (!config.getContractClass().isInterface()) return false; - return (config.getEndpointClass() == null || config.getEndpointClass().isInterface()); + //TODO isClientConfig + private boolean isClientConfig(DatabindingConfig config) { + if (config.getContractClass() == null) { + return false; } - //TODO fix freeze - public synchronized void freeze(WSDLPort port) { - if (clientConfig) return; - if (operationDispatcher != null) return; + if (!config.getContractClass().isInterface()) { + return false; + } + return (config.getEndpointClass() == null || config.getEndpointClass().isInterface()); + } + //TODO fix freeze + + public void freeze(WSDLPort port) { + if (clientConfig) { + return; + } + synchronized(this) { + if (operationDispatcher == null) { operationDispatcher = (port == null) ? null : new OperationDispatcher(port, seiModel.getWSBinding(), seiModel); + } } + } - public SEIModel getModel() { - return seiModel; - } + public SEIModel getModel() { + return seiModel; + } //Refactored from SEIStub + private void initStubHandlers() { - stubHandlers = new HashMap(); + stubHandlers = new HashMap(); Map syncs = new HashMap(); // fill in methodHandlers. // first fill in sychronized versions @@ -138,29 +157,33 @@ public class DatabindingImpl implements Databinding { } } - public JavaMethodImpl resolveJavaMethod(Packet req) throws DispatchException { + JavaMethodImpl resolveJavaMethod(Packet req) throws DispatchException { WSDLOperationMapping m = req.getWSDLOperationMapping(); - if (m == null) m = (operationDispatcher != null) ? - operationDispatcher.getWSDLOperationMapping(req): - operationDispatcherNoWsdl.getWSDLOperationMapping(req); + if (m == null) { + synchronized (this) { + m = (operationDispatcher != null) + ? operationDispatcher.getWSDLOperationMapping(req) + : operationDispatcherNoWsdl.getWSDLOperationMapping(req); + } + } return (JavaMethodImpl) m.getJavaMethod(); } - public JavaCallInfo deserializeRequest(Packet req) { - com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(); - try { - JavaMethodImpl wsdlOp = resolveJavaMethod(req); - TieHandler tie = wsdlOpMap.get(wsdlOp); - call.setMethod(tie.getMethod()); - Object[] args = tie.readRequest(req.getMessage()); - call.setParameters(args); - } catch (DispatchException e) { - call.setException(e); - } - return call; + public JavaCallInfo deserializeRequest(Packet req) { + com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(); + try { + JavaMethodImpl wsdlOp = resolveJavaMethod(req); + TieHandler tie = wsdlOpMap.get(wsdlOp); + call.setMethod(tie.getMethod()); + Object[] args = tie.readRequest(req.getMessage()); + call.setParameters(args); + } catch (DispatchException e) { + call.setException(e); } + return call; + } - public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) { + public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) { StubHandler stubHandler = stubHandlers.get(call.getMethod()); try { return stubHandler.readResponse(res, call); @@ -168,86 +191,97 @@ public class DatabindingImpl implements Databinding { call.setException(e); return call; } - } + } - public WebServiceFeature[] getFeatures() { - // TODO Auto-generated method stub - return null; - } + public WebServiceFeature[] getFeatures() { + // TODO Auto-generated method stub + return null; + } - public Packet serializeRequest(JavaCallInfo call) { + @Override + public Packet serializeRequest(JavaCallInfo call) { StubHandler stubHandler = stubHandlers.get(call.getMethod()); Packet p = stubHandler.createRequestPacket(call); p.setState(Packet.State.ClientRequest); return p; - } + } - public Packet serializeResponse(JavaCallInfo call) { - Method method = call.getMethod(); - Message message = null; - if (method != null) { - TieHandler th = tieHandlers.get(method); - if (th != null) { - return th.serializeResponse(call); - } - } - if (call.getException() instanceof DispatchException) { - message = ((DispatchException)call.getException()).fault; - } - Packet p = (Packet)packetFactory.createContext(message); + @Override + public Packet serializeResponse(JavaCallInfo call) { + Method method = call.getMethod(); + Message message = null; + if (method != null) { + TieHandler th = tieHandlers.get(method); + if (th != null) { + return th.serializeResponse(call); + } + } + if (call.getException() instanceof DispatchException) { + message = ((DispatchException) call.getException()).fault; + } + Packet p = (Packet) packetFactory.createContext(message); p.setState(Packet.State.ServerResponse); return p; - } + } - public ClientCallBridge getClientBridge(Method method) { - return stubHandlers.get(method); - } + @Override + public ClientCallBridge getClientBridge(Method method) { + return stubHandlers.get(method); + } - - public void generateWSDL(WSDLGenInfo info) { - com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator wsdlGen = new com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator( - seiModel, - info.getWsdlResolver(), - seiModel.getWSBinding(), - info.getContainer(), seiModel.getEndpointClass(), - info.isInlineSchemas(), - info.isSecureXmlProcessingDisabled(), - info.getExtensions()); + @Override + public void generateWSDL(WSDLGenInfo info) { + com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator wsdlGen = new com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator( + seiModel, + info.getWsdlResolver(), + seiModel.getWSBinding(), + info.getContainer(), seiModel.getEndpointClass(), + info.isInlineSchemas(), + info.isSecureXmlProcessingDisabled(), + info.getExtensions()); wsdlGen.doGeneration(); - } + } - public EndpointCallBridge getEndpointBridge(Packet req) throws DispatchException { + @Override + public EndpointCallBridge getEndpointBridge(Packet req) throws DispatchException { JavaMethodImpl wsdlOp = resolveJavaMethod(req); - return wsdlOpMap.get(wsdlOp); + return wsdlOpMap.get(wsdlOp); + } + + Codec getCodec() { + if (codec == null) { + codec = ((BindingImpl) seiModel.getWSBinding()).createCodec(); } + return codec; + } - - Codec getCodec() { - if (codec == null) codec = ((BindingImpl)seiModel.getWSBinding()).createCodec(); - return codec; - } - - public ContentType encode( Packet packet, OutputStream out ) throws IOException { + @Override + public ContentType encode(Packet packet, OutputStream out) throws IOException { return getCodec().encode(packet, out); } - public void decode( InputStream in, String ct, Packet p ) throws IOException{ + @Override + public void decode(InputStream in, String ct, Packet p) throws IOException { getCodec().decode(in, ct, p); } + @Override public com.oracle.webservices.internal.api.databinding.JavaCallInfo createJavaCallInfo(Method method, Object[] args) { return new com.sun.xml.internal.ws.api.databinding.JavaCallInfo(method, args); } + @Override public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeResponse( MessageContext message, com.oracle.webservices.internal.api.databinding.JavaCallInfo call) { - return deserializeResponse((Packet)message, (JavaCallInfo)call); + return deserializeResponse((Packet) message, (JavaCallInfo) call); } + @Override public com.oracle.webservices.internal.api.databinding.JavaCallInfo deserializeRequest(MessageContext message) { - return deserializeRequest((Packet)message); + return deserializeRequest((Packet) message); } + @Override public MessageContextFactory getMessageContextFactory() { return packetFactory; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java index af084c5ac83..e5c10497a69 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MtomCodec.java @@ -81,8 +81,8 @@ import java.util.UUID; public class MtomCodec extends MimeCodec { public static final String XOP_XML_MIME_TYPE = "application/xop+xml"; - private static final String XOP_LOCALNAME = "Include"; - private static final String XOP_NAMESPACEURI = "http://www.w3.org/2004/08/xop/include"; + public static final String XOP_LOCALNAME = "Include"; + public static final String XOP_NAMESPACEURI = "http://www.w3.org/2004/08/xop/include"; private final StreamSOAPCodec codec; private final MTOMFeature mtomFeature; @@ -171,8 +171,10 @@ public class MtomCodec extends MimeCodec { bos.write(out); } - //now write out the attachments in the message - writeAttachments(packet.getMessage().getAttachments(),out, boundary); + // now write out the attachments in the message that weren't + // previously written + writeNonMtomAttachments(packet.getMessage().getAttachments(), + out, boundary); //write out the end boundary writeAsAscii("--"+boundary, out); @@ -204,7 +206,13 @@ public class MtomCodec extends MimeCodec { ByteArrayBuffer(@NotNull DataHandler dh, String b) { this.dh = dh; - this.contentId = encodeCid(); + String cid = null; + if (dh instanceof StreamingDataHandler) { + StreamingDataHandler sdh = (StreamingDataHandler) dh; + if (sdh.getHrefCid() != null) + cid = sdh.getHrefCid(); + } + this.contentId = cid != null ? cid : encodeCid(); boundary = b; } @@ -227,13 +235,27 @@ public class MtomCodec extends MimeCodec { writeln(out); } - private void writeAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { - for(Attachment att : attachments){ - //build attachment frame - writeln("--"+boundary, out); + // Compiler warning for not calling close, but cannot call close, + // will consume attachment bytes. + @SuppressWarnings("resource") + private void writeNonMtomAttachments(AttachmentSet attachments, + OutputStream out, String boundary) throws IOException { + + for (Attachment att : attachments) { + + DataHandler dh = att.asDataHandler(); + if (dh instanceof StreamingDataHandler) { + StreamingDataHandler sdh = (StreamingDataHandler) dh; + // If DataHandler has href Content-ID, it is MTOM, so skip. + if (sdh.getHrefCid() != null) + continue; + } + + // build attachment frame + writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); - writeln(out); // write \r\n + writeln(out); // write \r\n } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java index 73f5ddee596..6821927b33a 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java @@ -104,7 +104,9 @@ public class StreamMessage extends AbstractMessageImpl { * If the creater of this object didn't care about those, * we use stock values. */ - private @NotNull TagInfoset envelopeTag,headerTag,bodyTag; + private @NotNull TagInfoset envelopeTag; + private @NotNull TagInfoset headerTag; + private @NotNull TagInfoset bodyTag; /** * Used only for debugging. This records where the message was consumed. @@ -203,8 +205,7 @@ public class StreamMessage extends AbstractMessageImpl { throw new IllegalArgumentException("BodyTag TagInfoset cannot be null"); } this.envelopeTag = envelopeTag; - this.headerTag = headerTag!=null ? headerTag : - new TagInfoset(envelopeTag.nsUri,"Header",envelopeTag.prefix,EMPTY_ATTS); + this.headerTag = headerTag; this.bodyTag = bodyTag; this.bodyPrologue = bodyPrologue; this.bodyEpilogue = bodyEpilogue; @@ -391,10 +392,13 @@ public class StreamMessage extends AbstractMessageImpl { //write headers MessageHeaders hl = getHeaders(); - if(hl.hasHeaders()){ + if (hl.hasHeaders() && headerTag == null) headerTag = new TagInfoset(envelopeTag.nsUri,"Header",envelopeTag.prefix,EMPTY_ATTS); + if (headerTag != null) { headerTag.writeStart(writer); - for(Header h : hl.asList()){ - h.writeTo(writer); + if (hl.hasHeaders()){ + for(Header h : hl.asList()){ + h.writeTo(writer); + } } writer.writeEndElement(); } @@ -527,15 +531,18 @@ public class StreamMessage extends AbstractMessageImpl { contentHandler.setDocumentLocator(NULL_LOCATOR); contentHandler.startDocument(); envelopeTag.writeStart(contentHandler); - headerTag.writeStart(contentHandler); - if(hasHeaders()) { - MessageHeaders headers = getHeaders(); - for (Header h : headers.asList()) { - // shouldn't JDK be smart enough to use array-style indexing for this foreach!? - h.writeTo(contentHandler,errorHandler); + if (hasHeaders() && headerTag == null) headerTag = new TagInfoset(envelopeTag.nsUri,"Header",envelopeTag.prefix,EMPTY_ATTS); + if (headerTag != null) { + headerTag.writeStart(contentHandler); + if (hasHeaders()) { + MessageHeaders headers = getHeaders(); + for (Header h : headers.asList()) { + // shouldn't JDK be smart enough to use array-style indexing for this foreach!? + h.writeTo(contentHandler,errorHandler); + } } + headerTag.writeEnd(contentHandler); } - headerTag.writeEnd(contentHandler); bodyTag.writeStart(contentHandler); writePayloadTo(contentHandler,errorHandler, true); bodyTag.writeEnd(contentHandler); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java index 22c9f832964..63102d46791 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/RuntimeModeler.java @@ -210,20 +210,10 @@ public class RuntimeModeler { private T getAnnotation(final Class clazz, final Class T) { return metadataReader.getAnnotation(T, clazz); -// return AccessController.doPrivileged(new PrivilegedAction() { -// public T run() { -// return clazz.getAnnotation(T); -// } -// }); } private T getAnnotation(final Method method, final Class T) { return metadataReader.getAnnotation(T, method); -// return AccessController.doPrivileged(new PrivilegedAction() { -// public T run() { -// return method.getAnnotation(T); -// } -// }); } private Annotation[] getAnnotations(final Method method) { @@ -235,11 +225,6 @@ public class RuntimeModeler { } private Annotation[][] getParamAnnotations(final Method method) { return metadataReader.getParameterAnnotations(method); -// return AccessController.doPrivileged(new PrivilegedAction() { -// public Annotation[][] run() { -// return method.getParameterAnnotations(); -// } -// }); } private static final Logger logger = @@ -258,6 +243,7 @@ public class RuntimeModeler { model.endpointClass = config.getEndpointClass(); model.classLoader = this.classLoader; model.wsBinding = wsBinding; + model.databindingInfo.setWsdlURL(config.getWsdlURL()); model.databindingInfo.properties().putAll(config.properties()); if (model.contractClass == null) model.contractClass = portClass; if (model.endpointClass == null && !portClass.isInterface()) model.endpointClass = portClass; @@ -476,11 +462,12 @@ public class RuntimeModeler { for (Method method : clazz.getMethods()) { if (!clazz.isInterface()) { // if clazz is SEI, then all methods are web methods + if (method.getDeclaringClass() == Object.class) continue; if (!getBooleanSystemProperty("com.sun.xml.internal.ws.legacyWebMethod")) { // legacy webMethod computation behaviour to be used if (!isWebMethodBySpec(method, clazz)) continue; } else { - if (method.getDeclaringClass() == Object.class || !isWebMethod(method)) + if (!isWebMethod(method)) continue; } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java index 99eb3351fe0..8f3202e001e 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,10 +69,12 @@ public class WrapperBeanGenerator { super(annReader, nav, beanMemberFactory); } + @Override protected java.lang.reflect.Type getSafeType(java.lang.reflect.Type type) { return type; } + @Override protected java.lang.reflect.Type getHolderValueType(java.lang.reflect.Type paramType) { if (paramType instanceof ParameterizedType) { ParameterizedType p = (ParameterizedType)paramType; @@ -83,6 +85,7 @@ public class WrapperBeanGenerator { return null; } + @Override protected boolean isVoidType(java.lang.reflect.Type type) { return type == Void.TYPE; } @@ -90,6 +93,7 @@ public class WrapperBeanGenerator { } private static final class FieldFactory implements BeanMemberFactory { + @Override public Field createWrapperBeanMember(java.lang.reflect.Type paramType, String paramName, List jaxb) { return new Field(paramName, paramType, getASMType(paramType), jaxb); @@ -257,7 +261,9 @@ public class WrapperBeanGenerator { static Class createRequestWrapperBean(String className, Method method, QName reqElemName, ClassLoader cl) { - LOGGER.log(Level.FINE, "Request Wrapper Class : {0}", className); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Request Wrapper Class : {0}", className); + } List requestMembers = RUNTIME_GENERATOR.collectRequestBeanMembers( method); @@ -276,7 +282,9 @@ public class WrapperBeanGenerator { static Class createResponseWrapperBean(String className, Method method, QName resElemName, ClassLoader cl) { - LOGGER.log(Level.FINE, "Response Wrapper Class : {0}", className); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Response Wrapper Class : {0}", className); + } List responseMembers = RUNTIME_GENERATOR.collectResponseBeanMembers(method); @@ -346,6 +354,9 @@ public class WrapperBeanGenerator { return Injector.inject(cl, className, image); } + /** + * Note: this class has a natural ordering that is inconsistent with equals. + */ private static class Field implements Comparable { private final java.lang.reflect.Type reflectType; private final Type asmType; @@ -370,10 +381,10 @@ public class WrapperBeanGenerator { return FieldSignature.vms(reflectType); } + @Override public int compareTo(Field o) { return fieldName.compareTo(o.fieldName); } - } static void write(byte[] b, String className) { @@ -384,8 +395,7 @@ public class WrapperBeanGenerator { fo.flush(); fo.close(); } catch (java.io.IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + LOGGER.log(Level.INFO, "Error Writing class", e); } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java index fd2cd94e114..917e5c60e1b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,6 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme private final Map inParts; private final Map outParts; - private final Map fltParts; private final List wsdlBoundFaults; private WSDLOperationImpl operation; private String soapAction; @@ -86,15 +85,16 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme faultMimeTypes = new HashMap(); inParts = new HashMap(); outParts = new HashMap(); - fltParts = new HashMap(); wsdlBoundFaults = new ArrayList(); this.owner = owner; } + @Override public QName getName(){ return name; } + @Override public String getSOAPAction() { return soapAction; } @@ -103,6 +103,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme this.soapAction = soapAction!=null?soapAction:""; } + @Override public WSDLPartImpl getPart(String partName, Mode mode) { if(mode==Mode.IN){ return inParts.get(partName); @@ -147,15 +148,18 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme } // TODO: what's the difference between this and inputParts/outputParts? + @Override public Map getInParts() { return Collections.unmodifiableMap(inParts); } + @Override public Map getOutParts() { return Collections.unmodifiableMap(outParts); } @NotNull + @Override public List getFaults() { return wsdlBoundFaults; } @@ -291,11 +295,13 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme return faultMimeTypes.get(part); } + @Override public WSDLOperationImpl getOperation() { return operation; } + @Override public WSDLBoundPortType getBoundPortType() { return owner; } @@ -317,6 +323,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme this.style = style; } + @Override public @Nullable QName getReqPayloadName() { if (emptyRequestPayload) return null; @@ -346,6 +353,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme return null; } + @Override public @Nullable QName getResPayloadName() { if (emptyResponsePayload) return null; @@ -385,6 +393,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme * @return non-null for rpclit and null for doclit * @see RuntimeModeler#processRpcMethod(JavaMethodImpl, String, String, Method) */ + @Override public String getRequestNamespace(){ return (reqNamespace != null)?reqNamespace:name.getNamespaceURI(); } @@ -400,6 +409,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme * @return non-null for rpclit and null for doclit * @see RuntimeModeler#processRpcMethod(JavaMethodImpl, String, String, Method) */ + @Override public String getResponseNamespace(){ return (respNamespace!=null)?respNamespace:name.getNamespaceURI(); } @@ -433,6 +443,7 @@ public final class WSDLBoundOperationImpl extends AbstractExtensibleImpl impleme /** * @inheritDoc */ + @Override public ANONYMOUS getAnonymous() { return anonymous; } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java index 5f5dd27811e..5f6532c6f3c 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/model/wsdl/WSDLOperationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,9 +34,7 @@ import com.sun.xml.internal.ws.util.QNameMap; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamReader; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Implementaiton of {@link WSDLOperation} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java index fae39216434..933378d8249 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/DispatchMessages.java @@ -51,6 +51,18 @@ public final class DispatchMessages { return localizer.localize(localizableINVALID_NULLARG_XMLHTTP_REQUEST_METHOD(arg0, arg1)); } + public static Localizable localizableINVALID_NULLARG_URI() { + return messageFactory.getMessage("invalid.nullarg.uri"); + } + + /** + * Endpoint address URI is not allowed with a null argument + * + */ + public static String INVALID_NULLARG_URI() { + return localizer.localize(localizableINVALID_NULLARG_URI()); + } + public static Localizable localizableINVALID_SOAPMESSAGE_DISPATCH_MSGMODE(Object arg0, Object arg1) { return messageFactory.getMessage("invalid.soapmessage.dispatch.msgmode", arg0, arg1); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties index a1f1ebac54b..e364d25338b 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/resources/dispatch.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ invalid.nullarg.soap.msgmode=SOAP/HTTP Binding in {0} is not allowed with a null invocation argument. Must be: {1} # {0}, {1} - one of: POST, GET, DELETE PUT e.g.: A XML/HTTP request using MessageContext.HTTP_REQUEST_METHOD equals POST with a Null invocation Argument is not allowed. Must be: GET invalid.nullarg.xmlhttp.request.method=A XML/HTTP request using MessageContext.HTTP_REQUEST_METHOD equals {0} with a Null invocation Argument is not allowed. Must be: {1} +invalid.nullarg.uri=Endpoint address URI is not allowed with a null argument invalid.response=No response returned. invalid.response.deserialization=Failed to deserialize the response. # {0} - "PAYLOAD", {1} - "MESSAGE" diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java index 271cf59d50c..3e3bffa2217 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/server/EndpointFactory.java @@ -265,7 +265,7 @@ public class EndpointFactory { terminal = createProviderInvokerTube(implType, binding, invoker, container); } else { // Create runtime model for non Provider endpoints - seiModel = createSEIModel(wsdlPort, implType, serviceName, portName, binding); + seiModel = createSEIModel(wsdlPort, implType, serviceName, portName, binding, primaryDoc); if(binding instanceof SOAPBindingImpl){ //set portKnownHeaders on Binding, so that they can be used for MU processing ((SOAPBindingImpl)binding).setPortKnownHeaders( @@ -436,37 +436,17 @@ public class EndpointFactory { private static AbstractSEIModelImpl createSEIModel(WSDLPort wsdlPort, - Class implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding) { -// RuntimeModeler rap; -// // Create runtime model for non Provider endpoints -// -// // wsdlPort will be null, means we will generate WSDL. Hence no need to apply -// // bindings or need to look in the WSDL -// if(wsdlPort == null){ -// rap = new RuntimeModeler(implType,serviceName, binding.getBindingId(), binding.getFeatures().toArray()); -// } else { -// /* -// This not needed anymore as wsdlFeatures are merged later anyway -// and so is the MTOMFeature. -// applyEffectiveMtomSetting(wsdlPort.getBinding(), binding); -// */ -// //now we got the Binding so lets build the model -// rap = new RuntimeModeler(implType, serviceName, (WSDLPortImpl)wsdlPort, binding.getFeatures().toArray()); -// } -// rap.setClassLoader(implType.getClassLoader()); -// rap.setPortName(portName); -// return rap.buildRuntimeModel(); + Class implType, @NotNull QName serviceName, @NotNull QName portName, WSBinding binding, + SDDocumentSource primaryWsdl) { DatabindingFactory fac = DatabindingFactory.newInstance(); DatabindingConfig config = new DatabindingConfig(); config.setEndpointClass(implType); config.getMappingInfo().setServiceName(serviceName); config.setWsdlPort(wsdlPort); config.setWSBinding(binding); -// config.setFeatures(binding.getFeatures().toArray()); -// config.getMappingInfo().setBindingID(binding.getBindingId()); config.setClassLoader(implType.getClassLoader()); config.getMappingInfo().setPortName(portName); - + if (primaryWsdl != null) config.setWsdlURL(primaryWsdl.getSystemId()); config.setMetadataReader(getExternalMetadatReader(implType, binding)); com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl)fac.createRuntime(config); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java index b30e61fd305..22712aa78de 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/BindingInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package com.sun.xml.internal.ws.spi.db; +import java.net.URL; import java.util.Collection; import java.util.Map; @@ -47,6 +48,7 @@ public class BindingInfo { protected ClassLoader classLoader; private SEIModel seiModel; + private URL wsdlURL; public String getDatabindingMode() { return databindingMode; @@ -87,5 +89,10 @@ public class BindingInfo { public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } - + public URL getWsdlURL() { + return wsdlURL; + } + public void setWsdlURL(URL wsdlURL) { + this.wsdlURL = wsdlURL; + } } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java index 4db4f12a268..248c61c8939 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/spi/db/JAXBWrapperAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,7 @@ import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.namespace.QName; /** @@ -87,12 +88,19 @@ public class JAXBWrapperAccessor extends WrapperAccessor { } HashSet elementLocalNames = new HashSet(); for (Field field : getAllFields(contentClass)) { + XmlElementWrapper xmlElemWrapper = field.getAnnotation(XmlElementWrapper.class); XmlElement xmlElem = field.getAnnotation(XmlElement.class); XmlElementRef xmlElemRef = field.getAnnotation(XmlElementRef.class); String fieldName = field.getName().toLowerCase(); String namespace = ""; String localName = field.getName(); - if (xmlElem != null) { + if (xmlElemWrapper != null) { + namespace = xmlElemWrapper.namespace(); + if (xmlElemWrapper.name() != null && !xmlElemWrapper.name().equals("") + && !xmlElemWrapper.name().equals("##default")) { + localName = xmlElemWrapper.name(); + } + }else if (xmlElem != null) { namespace = xmlElem.namespace(); if (xmlElem.name() != null && !xmlElem.name().equals("") && !xmlElem.name().equals("##default")) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java index 8ea4fb0091d..f54a0a4e9bb 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java @@ -25,14 +25,34 @@ package com.sun.xml.internal.ws.transport.http; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.HttpURLConnection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.xml.ws.Binding; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.http.HTTPBinding; + import com.oracle.webservices.internal.api.message.PropertySet; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.api.SOAPVersion; -import com.sun.xml.internal.ws.api.addressing.NonAnonymousResponseProcessor; -import com.sun.xml.internal.ws.api.addressing.AddressingVersion; -import com.sun.xml.internal.ws.api.EndpointAddress; import com.sun.xml.internal.ws.api.Component; +import com.sun.xml.internal.ws.api.EndpointAddress; +import com.sun.xml.internal.ws.api.SOAPVersion; +import com.sun.xml.internal.ws.api.addressing.AddressingVersion; +import com.sun.xml.internal.ws.api.addressing.NonAnonymousResponseProcessor; import com.sun.xml.internal.ws.api.ha.HaInfo; import com.sun.xml.internal.ws.api.message.ExceptionHasMessage; import com.sun.xml.internal.ws.api.message.Message; @@ -56,29 +76,13 @@ import com.sun.xml.internal.ws.server.UnsupportedMediaException; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import com.sun.xml.internal.ws.util.Pool; -import javax.xml.ws.Binding; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.http.HTTPBinding; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.HttpURLConnection; -import java.util.*; -import java.util.Map.Entry; -import java.util.logging.Level; -import java.util.logging.Logger; - /** - * {@link Adapter} that receives messages in HTTP. + * {@link com.sun.xml.internal.ws.api.server.Adapter} that receives messages in HTTP. * *

      * This object also assigns unique query string (such as "xsd=1") to - * each {@link SDDocument} so that they can be served by HTTP GET requests. + * each {@link com.sun.xml.internal.ws.api.server.SDDocument} so that they can be served by HTTP GET requests. * * @author Kohsuke Kawaguchi * @author Jitendra Kotamraju @@ -86,10 +90,10 @@ import java.util.logging.Logger; public class HttpAdapter extends Adapter { /** - * {@link SDDocument}s keyed by the query string like "?abc". + * {@link com.sun.xml.internal.ws.api.server.SDDocument}s keyed by the query string like "?abc". * Used for serving documents via HTTP GET. * - * Empty if the endpoint doesn't have {@link ServiceDefinition}. + * Empty if the endpoint doesn't have {@link com.sun.xml.internal.ws.api.server.ServiceDefinition}. * Read-only. */ protected Map wsdls; @@ -109,7 +113,7 @@ public class HttpAdapter extends Adapter { public final HttpAdapterList owner; /** - * Servlet URL pattern with which this {@link HttpAdapter} is associated. + * Servlet URL pattern with which this {@link com.sun.xml.internal.ws.transport.http.HttpAdapter} is associated. */ public final String urlPattern; @@ -118,10 +122,10 @@ public class HttpAdapter extends Adapter { protected boolean disableJreplicaCookie = false; /** - * Creates a lone {@link HttpAdapter} that does not know of any other - * {@link HttpAdapter}s. + * Creates a lone {@link com.sun.xml.internal.ws.transport.http.HttpAdapter} that does not know of any other + * {@link com.sun.xml.internal.ws.transport.http.HttpAdapter}s. * - * This is convenient for creating an {@link HttpAdapter} for an environment + * This is convenient for creating an {@link com.sun.xml.internal.ws.transport.http.HttpAdapter} for an environment * where they don't know each other (such as JavaSE deployment.) * * @param endpoint web service endpoint @@ -137,11 +141,14 @@ public class HttpAdapter extends Adapter { * @param endpoint web service endpoint * @param owner list of related adapters */ - protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList owner) { + protected HttpAdapter(WSEndpoint endpoint, + HttpAdapterList owner) { this(endpoint,owner,null); } - protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList owner, String urlPattern) { + protected HttpAdapter(WSEndpoint endpoint, + HttpAdapterList owner, + String urlPattern) { super(endpoint); this.owner = owner; this.urlPattern = urlPattern; @@ -184,7 +191,7 @@ public class HttpAdapter extends Adapter { int wsdlnum = 1; int xsdnum = 1; - for (Map.Entry e : systemIds.entrySet()) { + for (Entry e : systemIds.entrySet()) { SDDocument sdd = e.getValue(); if (sdd.isWSDL()) { wsdls.put("wsdl="+(wsdlnum++),sdd); @@ -231,12 +238,12 @@ public class HttpAdapter extends Adapter { * and "connection" here is an HTTP connection. * *

      - * To populate a request {@link Packet} with more info, + * To populate a request {@link com.sun.xml.internal.ws.api.message.Packet} with more info, * define {@link com.oracle.webservices.internal.api.message.PropertySet.Property properties} on * {@link WSHTTPConnection}. * * @param connection to receive/send HTTP messages for web service endpoints - * @throws IOException when I/O errors happen + * @throws java.io.IOException when I/O errors happen */ public void handle(@NotNull WSHTTPConnection connection) throws IOException { if (handleGet(connection)) { @@ -338,7 +345,7 @@ public class HttpAdapter extends Adapter { /** * Some stacks may send non WS-I BP 1.2 conforming SoapAction. - * Make sure SOAPAction is quoted as {@link Packet#soapAction} expects quoted soapAction value. + * Make sure SOAPAction is quoted as {@link com.sun.xml.internal.ws.api.message.Packet#soapAction} expects quoted soapAction value. * * @param soapAction SoapAction HTTP Header * @return quoted SOAPAction value @@ -385,7 +392,7 @@ public class HttpAdapter extends Adapter { private void encodePacket(@NotNull Packet packet, @NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException { if (isNonAnonymousUri(packet.endpointAddress) && packet.getMessage() != null) { - try { + try { // Message is targeted to non-anonymous response endpoint. // After call to non-anonymous processor, typically, packet.getMessage() will be null // however, processors could use this pattern to modify the response sent on the back-channel, @@ -413,9 +420,18 @@ public class HttpAdapter extends Adapter { if (con.getStatus() == 0) { con.setStatus(WSHTTPConnection.ONEWAY); } + OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con); + if (dump || LOGGER.isLoggable(Level.FINER)) { + ByteArrayBuffer buf = new ByteArrayBuffer(); + codec.encode(packet, buf); + dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders()); + buf.writeTo(os); + } else { + codec.encode(packet, os); + } // close the response channel now try { - con.getOutput().close(); // no payload + os.close(); // no payload } catch (IOException e) { throw new WebServiceException(e); } @@ -430,10 +446,17 @@ public class HttpAdapter extends Adapter { } if (isClientErrorStatus(con.getStatus())) { - OutputStream os = con.getOutput(); - writeClientError(con.getStatus(), os, packet); - os.close(); - return; + OutputStream os = con.getOutput(); + if (dump || LOGGER.isLoggable(Level.FINER)) { + ByteArrayBuffer buf = new ByteArrayBuffer(); + writeClientError(con.getStatus(), buf, packet); + dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders()); + buf.writeTo(os); + } else { + writeClientError(con.getStatus(), os, packet); + } + os.close(); + return; } ContentType contentType = codec.getStaticContentType(packet); @@ -634,6 +657,15 @@ public class HttpAdapter extends Adapter { // no-op } + if (dump || LOGGER.isLoggable(Level.FINER)) { + try { + ByteArrayBuffer buf = new ByteArrayBuffer(); + dump(buf, "HTTP response " + con.getStatus(), con.getResponseHeaders()); + } catch (Exception e) { + throw new WebServiceException(e.toString(), e); + } + } + if (output != null) { try { output.close(); // no payload @@ -671,7 +703,7 @@ public class HttpAdapter extends Adapter { try { packet = head.process(packet, con.getWebServiceContextDelegate(), packet.transportBackChannel); - } catch(Exception e) { + } catch(Throwable e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); if (!con.isClosed()) { writeInternalServerError(con); @@ -682,6 +714,9 @@ public class HttpAdapter extends Adapter { encodePacket(packet, con, codec); } finally { if (!con.isClosed()) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Closing HTTP Connection with status: {0}", con.getStatus()); + } con.close(); } } @@ -710,7 +745,7 @@ public class HttpAdapter extends Adapter { * @param con * The connection to which the data will be sent. * - * @throws IOException when I/O errors happen + * @throws java.io.IOException when I/O errors happen */ public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException { con.getInput().close(); @@ -800,7 +835,7 @@ public class HttpAdapter extends Adapter { } } - private void dump(ByteArrayBuffer buf, String caption, Map> headers) throws IOException { + private static void dump(ByteArrayBuffer buf, String caption, Map> headers) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(baos, true); pw.println("---["+caption +"]---"); diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties index 0917dd67ad6..5d7ed24b883 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/util/version.properties @@ -23,7 +23,7 @@ # questions. # -build-id=2.2.9-b13941 -build-version=JAX-WS RI 2.2.9-b13941 +build-id=2.2.9-b14027 +build-version=JAX-WS RI 2.2.9-b14027 major-version=2.2.9 -svn-revision=unknown +svn-revision=14027 diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/FactoryFinder.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/FactoryFinder.java index d1b240c4013..391c1eeaa2a 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/FactoryFinder.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/FactoryFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,20 +39,17 @@ class FactoryFinder { * or could not be instantiated */ private static Object newInstance(String className, - ClassLoader classLoader, - String defaultFactoryClass) - throws SOAPException + ClassLoader classLoader) + throws SOAPException { try { - Class spiClass = safeLoadClass(className, classLoader, defaultFactoryClass); + Class spiClass = safeLoadClass(className, classLoader); return spiClass.newInstance(); + } catch (ClassNotFoundException x) { - throw new SOAPException( - "Provider " + className + " not found", x); + throw new SOAPException("Provider " + className + " not found", x); } catch (Exception x) { - throw new SOAPException( - "Provider " + className + " could not be instantiated: " + x, - x); + throw new SOAPException("Provider " + className + " could not be instantiated: " + x, x); } } @@ -70,7 +67,7 @@ class FactoryFinder { * @exception SOAPException if there is a SOAP error */ static Object find(String factoryId) - throws SOAPException + throws SOAPException { return find(factoryId, null, false); } @@ -85,7 +82,7 @@ class FactoryFinder { * This method is package private so that this code can be shared. * * @return the Class object of the specified message factory; - * may not be null + * may be null * * @param factoryId the name of the factory to find, which is * a system property @@ -96,7 +93,7 @@ class FactoryFinder { * @exception SOAPException if there is a SOAP error */ static Object find(String factoryId, String fallbackClassName) - throws SOAPException + throws SOAPException { return find(factoryId, fallbackClassName, true); } @@ -108,7 +105,7 @@ class FactoryFinder { * is true. The arguments supplied must be used in order * If using the first argument is successful, the second one will not * be used. Note the default class name may be needed even if fallback - * is not to be attempted, so certain error condiitons can be handled. + * is not to be attempted, so certain error conditions can be handled. *

      * This method is package private so that this code can be shared. * @@ -126,7 +123,7 @@ class FactoryFinder { * @exception SOAPException if there is a SOAP error */ static Object find(String factoryId, String defaultClassName, - boolean tryFallback) throws SOAPException { + boolean tryFallback) throws SOAPException { ClassLoader classLoader; try { classLoader = Thread.currentThread().getContextClassLoader(); @@ -137,9 +134,9 @@ class FactoryFinder { // Use the system property first try { String systemProp = - System.getProperty( factoryId ); + System.getProperty( factoryId ); if( systemProp!=null) { - return newInstance(systemProp, classLoader, defaultClassName); + return newInstance(systemProp, classLoader); } } catch (SecurityException se) { } @@ -148,13 +145,13 @@ class FactoryFinder { try { String javah=System.getProperty( "java.home" ); String configFile = javah + File.separator + - "lib" + File.separator + "jaxm.properties"; + "lib" + File.separator + "jaxm.properties"; File f=new File( configFile ); if( f.exists()) { Properties props=new Properties(); props.load( new FileInputStream(f)); String factoryClassName = props.getProperty(factoryId); - return newInstance(factoryClassName, classLoader, defaultClassName); + return newInstance(factoryClassName, classLoader); } } catch(Exception ex ) { } @@ -171,14 +168,14 @@ class FactoryFinder { if( is!=null ) { BufferedReader rd = - new BufferedReader(new InputStreamReader(is, "UTF-8")); + new BufferedReader(new InputStreamReader(is, "UTF-8")); String factoryClassName = rd.readLine(); rd.close(); if (factoryClassName != null && - ! "".equals(factoryClassName)) { - return newInstance(factoryClassName, classLoader, defaultClassName); + ! "".equals(factoryClassName)) { + return newInstance(factoryClassName, classLoader); } } } catch( Exception ex ) { @@ -192,9 +189,9 @@ class FactoryFinder { // (built in) factory if specified. if (defaultClassName == null) { throw new SOAPException( - "Provider for " + factoryId + " cannot be found", null); + "Provider for " + factoryId + " cannot be found", null); } - return newInstance(defaultClassName, classLoader, defaultClassName); + return newInstance(defaultClassName, classLoader); } /** @@ -204,7 +201,7 @@ class FactoryFinder { * Class.forName() on it so it will be loaded by the bootstrap class loader. */ private static Class safeLoadClass(String className, - ClassLoader classLoader, String defaultFactoryClass) + ClassLoader classLoader) throws ClassNotFoundException { try { // make sure that the current thread has an access to the package of the given name. @@ -221,12 +218,19 @@ class FactoryFinder { else return classLoader.loadClass(className); } catch (SecurityException se) { - // The FactoryFinder is in the bootstrap class loader, so - // the following should work, but we only attempt it - // if it the the default class. - if (className.equals(defaultFactoryClass)) + // (only) default implementation can be loaded + // using bootstrap class loader: + if (isDefaultImplementation(className)) return Class.forName(className); + throw se; } } + + private static boolean isDefaultImplementation(String className) { + return MessageFactory.DEFAULT_MESSAGE_FACTORY.equals(className) || + SOAPFactory.DEFAULT_SOAP_FACTORY.equals(className) || + SOAPConnectionFactory.DEFAULT_SOAP_CONNECTION_FACTORY.equals(className) || + SAAJMetaFactory.DEFAULT_META_FACTORY_CLASS.equals(className); + } } diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java index 663ff51bb4b..074c7207604 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/MessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ import java.io.InputStream; */ public abstract class MessageFactory { - static private final String DEFAULT_MESSAGE_FACTORY + static final String DEFAULT_MESSAGE_FACTORY = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"; static private final String MESSAGE_FACTORY_PROPERTY @@ -96,16 +96,22 @@ public abstract class MessageFactory { * @see SAAJMetaFactory */ - public static MessageFactory newInstance() - throws SOAPException { + public static MessageFactory newInstance() throws SOAPException { + + try { - MessageFactory factory = (MessageFactory) + MessageFactory factory = (MessageFactory) FactoryFinder.find( + MESSAGE_FACTORY_PROPERTY, + DEFAULT_MESSAGE_FACTORY, + false); FactoryFinder.find(MESSAGE_FACTORY_PROPERTY, DEFAULT_MESSAGE_FACTORY, false); - if (factory != null) + if (factory != null) { return factory; + } return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); + } catch (Exception ex) { throw new SOAPException( "Unable to create message factory for SOAP: " diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java index f021c13d5bd..e7fcf813aeb 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SAAJMetaFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ package javax.xml.soap; public abstract class SAAJMetaFactory { static private final String META_FACTORY_CLASS_PROPERTY = "javax.xml.soap.MetaFactory"; - static private final String DEFAULT_META_FACTORY_CLASS = + static final String DEFAULT_META_FACTORY_CLASS = "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl"; /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java index e9335d4abae..c1e51f098c1 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public abstract class SOAPConnectionFactory { * A constant representing the default value for a SOAPConnection * object. The default is the point-to-point SOAP connection. */ - static private final String DEFAULT_SOAP_CONNECTION_FACTORY + static final String DEFAULT_SOAP_CONNECTION_FACTORY = "com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory"; /** diff --git a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java index 1d49f891000..5f8778e7e5b 100644 --- a/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java +++ b/jaxws/src/share/jaxws_classes/javax/xml/soap/SOAPFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,11 +54,9 @@ public abstract class SOAPFactory { "javax.xml.soap.SOAPFactory"; /** - * A constant representing the name of the default SOAPFactory - * factory class to be used if another cannot be found. - * a SOAPFactory implementation class. + * Class name of default SOAPFactory implementation. */ - static private final String DEFAULT_SOAP_FACTORY + static final String DEFAULT_SOAP_FACTORY = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl"; /** diff --git a/jdk/.hgtags b/jdk/.hgtags index 6e2a50acf2f..e86f63c268a 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -216,3 +216,6 @@ c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90 a2a2a91075ad85becbe10a39d7fd04ef9bea8df5 jdk8-b92 691d6c6cd332d98b0f0221445a73906776f31f72 jdk8-b93 51479fa56b7c4363c6d87c2e8b898d8185cf4b22 jdk8-b94 +42aa9f1828852bb8b77e98ec695211493ae0759d jdk8-b95 +4a5d3cf2b3af1660db0237e8da324c140e534fa4 jdk8-b96 +978a95239044f26dcc8a6d59246be07ad6ca6be2 jdk8-b97 diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index ce2dda53d1d..b584781eb50 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -252,7 +252,7 @@ images:: sanity-images post-sanity-images \ $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \ trim-image-jre trim-image-jdk \ identify-image-jre identify-image-jdk \ - process-image-jre process-image-jdk sec-files sec-files-win jgss-files + process-image-jre process-image-jdk sec-files sec-files-win jgss-files endif # Don't use these @@ -400,7 +400,8 @@ TOOLS = \ # classes that go into jfr.jar JFR_CLASSES_DIRS= \ com/oracle/jrockit/jfr \ - oracle/jrockit/jfr + oracle/jrockit/jfr \ + jdk/jfr # classes that go into jsse.jar JSSE_CLASSES_DIRS = \ @@ -612,6 +613,7 @@ ifndef JAVASE_EMBEDDED $(ECHO) "oracle/jrockit/jfr/parser/" >> $@ $(ECHO) "oracle/jrockit/jfr/settings/" >> $@ $(ECHO) "oracle/jrockit/jfr/tools/" >> $@ + $(ECHO) "jdk/jfr/" >> $@ endif endif diff --git a/jdk/make/java/java/FILES_java.gmk b/jdk/make/java/java/FILES_java.gmk index 1bdbdf03b31..b62d15d5ba5 100644 --- a/jdk/make/java/java/FILES_java.gmk +++ b/jdk/make/java/java/FILES_java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -529,7 +529,6 @@ JAVA_JAVA_java = \ sun/misc/JavaNioAccess.java \ sun/misc/Perf.java \ sun/misc/PerfCounter.java \ - sun/misc/Hashing.java \ sun/net/www/protocol/jar/Handler.java \ sun/net/www/protocol/jar/JarURLConnection.java \ sun/net/www/protocol/file/Handler.java \ diff --git a/jdk/make/java/nio/mapfile-bsd b/jdk/make/java/nio/mapfile-bsd index 4093a002329..e5a92d93f18 100644 --- a/jdk/make/java/nio/mapfile-bsd +++ b/jdk/make/java/nio/mapfile-bsd @@ -109,6 +109,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/make/java/nio/mapfile-linux b/jdk/make/java/nio/mapfile-linux index 92c7d318894..e85bafae76d 100644 --- a/jdk/make/java/nio/mapfile-linux +++ b/jdk/make/java/nio/mapfile-linux @@ -117,6 +117,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/make/java/nio/mapfile-solaris b/jdk/make/java/nio/mapfile-solaris index 98deb510dcb..3a610edd9e7 100644 --- a/jdk/make/java/nio/mapfile-solaris +++ b/jdk/make/java/nio/mapfile-solaris @@ -105,6 +105,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/make/java/zip/mapfile-vers b/jdk/make/java/zip/mapfile-vers index ba6490cc328..383fedf2d1f 100644 --- a/jdk/make/java/zip/mapfile-vers +++ b/jdk/make/java/zip/mapfile-vers @@ -65,6 +65,7 @@ SUNWprivate_1.1 { Java_java_util_zip_ZipFile_initIDs; Java_java_util_zip_ZipFile_open; Java_java_util_zip_ZipFile_read; + Java_java_util_zip_ZipFile_startsWithLOC; ZIP_Close; ZIP_CRC32; diff --git a/jdk/make/java/zip/reorder-i586 b/jdk/make/java/zip/reorder-i586 index ee717ff2f26..73ea6744605 100644 --- a/jdk/make/java/zip/reorder-i586 +++ b/jdk/make/java/zip/reorder-i586 @@ -19,6 +19,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/make/java/zip/reorder-sparc b/jdk/make/java/zip/reorder-sparc index 176c7709e49..a5cde391e6f 100644 --- a/jdk/make/java/zip/reorder-sparc +++ b/jdk/make/java/zip/reorder-sparc @@ -18,6 +18,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/make/java/zip/reorder-sparcv9 b/jdk/make/java/zip/reorder-sparcv9 index bf2d983ed19..32ebae146a2 100644 --- a/jdk/make/java/zip/reorder-sparcv9 +++ b/jdk/make/java/zip/reorder-sparcv9 @@ -18,6 +18,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/make/netbeans/common/shared.xml b/jdk/make/netbeans/common/shared.xml index 36d57de7c43..26b3a41043c 100644 --- a/jdk/make/netbeans/common/shared.xml +++ b/jdk/make/netbeans/common/shared.xml @@ -77,7 +77,7 @@ System configuration claims architecture is ${platform}-${arch} - + @@ -126,7 +126,7 @@ - @@ -146,7 +146,7 @@ - + @@ -312,7 +312,7 @@ - + diff --git a/jdk/make/netbeans/j2se/build.xml b/jdk/make/netbeans/j2se/build.xml index ea0487a00fe..aaefd4c12ec 100644 --- a/jdk/make/netbeans/j2se/build.xml +++ b/jdk/make/netbeans/j2se/build.xml @@ -37,11 +37,11 @@ - + - + diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index 5ac9d64c773..dc4c250cf74 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,10 @@ include $(BUILDDIR)/common/Defs.gmk OTHER_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES +ifneq ($(PLATFORM), windows) +CLASSES_INIT += $(TEMPDIR)/.gen_icons +endif + # # Files # @@ -208,6 +212,79 @@ ifdef ALT_COMPILEFONTCONFIG_FLAGS endif build: fontconfigs +ifneq ($(PLATFORM), windows) + +GEN_DIR=$(GENSRCDIR)/sun/awt/ + +ifdef OPENJDK + ICONS_PATH_PREFIX=$(PLATFORM_SRC) +else + ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris +endif + +ICONS = \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png + +ICONPATH=$(SHARE_SRC)/classes/sun/awt/resources + +ICONS += \ + $(ICONPATH)/security-icon-bw16.png \ + $(ICONPATH)/security-icon-interim16.png \ + $(ICONPATH)/security-icon-yellow16.png \ + $(ICONPATH)/security-icon-bw24.png \ + $(ICONPATH)/security-icon-interim24.png \ + $(ICONPATH)/security-icon-yellow24.png \ + $(ICONPATH)/security-icon-bw32.png \ + $(ICONPATH)/security-icon-interim32.png \ + $(ICONPATH)/security-icon-yellow32.png \ + $(ICONPATH)/security-icon-bw48.png \ + $(ICONPATH)/security-icon-interim48.png \ + $(ICONPATH)/security-icon-yellow48.png + +TEMPDIR_CLASSES = $(TEMPDIR)/classes + +generated.clean: + $(RM) -r $(GEN_DIR)/*.java + $(RM) -r $(TEMPDIR)/.gen_icons + +$(TEMPDIR_CLASSES)/sun/awt/ToBin.class: ToBin.java + @$(prep-target) + $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $< + +$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/ToBin.class $(ICONS) + $(prep-target) + for i in $(ICONS); do \ + filename=`basename $$i`; \ + name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \ + classname=$(GEN_DIR)/AWTIcon32_$$name.java; \ + $(RM) $$classname; \ + $(ECHO) "package sun.awt;" >> $$classname ; \ + $(ECHO) "public class AWTIcon32_$$name {" >> $$classname; \ + $(ECHO) "public final static int[] $$name = { " >> $$classname; \ + $(CAT) $$i | \ + $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ + -Djava.awt.headless=true \ + sun.awt.ToBin >> $$classname; \ + $(ECHO) "}; }" >> $$classname; \ + classname=$(GEN_DIR)/AWTIcon64_$$name.java; \ + $(RM) $$classname; \ + $(ECHO) "package sun.awt;" >> $$classname ; \ + $(ECHO) "public class AWTIcon64_$$name {" >> $$classname; \ + $(ECHO) "public final static long[] $$name = { " >> $$classname; \ + $(CAT) $$i | \ + $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ + -Djava.awt.headless=true \ + sun.awt.ToBin >> $$classname; \ + $(ECHO) "}; }" >> $$classname; \ + done + $(TOUCH) $@ + +clean clobber:: generated.clean +endif + ifeq ($(PLATFORM), windows) # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WINDOWS @@ -570,5 +647,5 @@ CLASSES.export += java.io.InputStream \ java.lang.Integer \ java.lang.ThreadGroup -.PHONY: dgalibs dgalib.clean fontconfigs fontconfigs.clean +.PHONY: dgalibs dgalib.clean fontconfigs fontconfigs.clean generated.clean diff --git a/jdk/makefiles/sun/awt/X11/ToBin.java b/jdk/make/sun/awt/ToBin.java similarity index 95% rename from jdk/makefiles/sun/awt/X11/ToBin.java rename to jdk/make/sun/awt/ToBin.java index 99f37881b62..db97240e432 100644 --- a/jdk/makefiles/sun/awt/X11/ToBin.java +++ b/jdk/make/sun/awt/ToBin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ * questions. */ -package sun.awt.X11; +package sun.awt; import java.io.*; import java.awt.image.*; diff --git a/jdk/make/sun/font/Makefile b/jdk/make/sun/font/Makefile index 1cdd11934cc..fd8c8a2c448 100644 --- a/jdk/make/sun/font/Makefile +++ b/jdk/make/sun/font/Makefile @@ -36,7 +36,11 @@ PRODUCT = sun CPLUSPLUSLIBRARY=true # Use higher optimization level +ifeq ($(PLATFORM), windows) +OPTIMIZATION_LEVEL = HIGHEST +else OPTIMIZATION_LEVEL = HIGHER +endif include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/lwawt/FILES_export_macosx.gmk b/jdk/make/sun/lwawt/FILES_export_macosx.gmk index 6a2e2f9e93b..5799b32c954 100644 --- a/jdk/make/sun/lwawt/FILES_export_macosx.gmk +++ b/jdk/make/sun/lwawt/FILES_export_macosx.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,7 @@ FILES_export = \ sun/lwawt/LWToolkit.java \ sun/lwawt/LWWindowPeer.java \ sun/lwawt/PlatformWindow.java \ + sun/lwawt/SecurityWarningWindow.java \ sun/lwawt/SelectionClearListener.java \ sun/lwawt/macosx/CPrinterDevice.java \ sun/lwawt/macosx/CPrinterDialog.java \ @@ -143,6 +144,7 @@ FILES_export = \ sun/lwawt/macosx/CMouseInfoPeer.java \ sun/lwawt/macosx/CPlatformView.java \ sun/lwawt/macosx/CPlatformWindow.java \ + sun/lwawt/macosx/CWarningWindow.java \ sun/lwawt/macosx/CPlatformComponent.java \ sun/lwawt/macosx/CEmbeddedFrame.java \ sun/lwawt/macosx/CPlatformEmbeddedFrame.java \ diff --git a/jdk/make/sun/xawt/Makefile b/jdk/make/sun/xawt/Makefile index 791bd2dc326..95f2a6fa1b1 100644 --- a/jdk/make/sun/xawt/Makefile +++ b/jdk/make/sun/xawt/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ include $(BUILDDIR)/common/Defs.gmk GEN_DIR=$(GENSRCDIR)/sun/awt/X11 -CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers +CLASSES_INIT += $(TEMPDIR)/.gen.wrappers touch.wrappers .PHONY: generated.clean @@ -317,70 +317,7 @@ generated.clean: $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR) $(RM) -r $(WRAPPER_GENERATOR_DIR) $(RM) -r $(GEN_DIR)/*.java - $(RM) -r $(TEMPDIR)/.gen_icons -ifdef OPENJDK - ICONS_PATH_PREFIX=$(PLATFORM_SRC) -else - ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris -endif - -ICONS = \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png - - -ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11 - -ICONS += \ - $(ICONPATH)/security-icon-bw16.png \ - $(ICONPATH)/security-icon-interim16.png \ - $(ICONPATH)/security-icon-yellow16.png \ - $(ICONPATH)/security-icon-bw24.png \ - $(ICONPATH)/security-icon-interim24.png \ - $(ICONPATH)/security-icon-yellow24.png \ - $(ICONPATH)/security-icon-bw32.png \ - $(ICONPATH)/security-icon-interim32.png \ - $(ICONPATH)/security-icon-yellow32.png \ - $(ICONPATH)/security-icon-bw48.png \ - $(ICONPATH)/security-icon-interim48.png \ - $(ICONPATH)/security-icon-yellow48.png - -TEMPDIR_CLASSES = $(TEMPDIR)/classes - -$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java - @$(prep-target) - $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $< - -$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS) - $(prep-target) - for i in $(ICONS); do \ - filename=`basename $$i`; \ - name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \ - classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \ - $(RM) $$classname; \ - $(ECHO) "package sun.awt.X11;" >> $$classname ; \ - $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \ - $(ECHO) "public static int[] $$name = { " >> $$classname; \ - $(CAT) $$i | \ - $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ - -Djava.awt.headless=true \ - sun.awt.X11.ToBin >> $$classname; \ - $(ECHO) "}; }" >> $$classname; \ - classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \ - $(RM) $$classname; \ - $(ECHO) "package sun.awt.X11;" >> $$classname ; \ - $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \ - $(ECHO) "public static long[] $$name = { " >> $$classname; \ - $(CAT) $$i | \ - $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ - -Djava.awt.headless=true \ - sun.awt.X11.ToBin >> $$classname; \ - $(ECHO) "}; }" >> $$classname; \ - done - $(TOUCH) $@ clean clobber:: generated.clean diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk index 4fcb6e84695..02bf3be808c 100644 --- a/jdk/makefiles/CompileNativeLibraries.gmk +++ b/jdk/makefiles/CompileNativeLibraries.gmk @@ -1332,7 +1332,7 @@ LIBFONTMANAGER_OPTIMIZATION:=HIGH ifeq ($(OPENJDK_TARGET_OS),windows) LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \ X11TextRenderer.c - LIBFONTMANAGER_OPTIMIZATION:=LOW +LIBFONTMANAGER_OPTIMIZATION:=HIGHEST else LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \ lcdglyph.c diff --git a/jdk/makefiles/CopyFiles.gmk b/jdk/makefiles/CopyFiles.gmk index 82d3d4bb40e..cb479bba1c5 100644 --- a/jdk/makefiles/CopyFiles.gmk +++ b/jdk/makefiles/CopyFiles.gmk @@ -538,21 +538,4 @@ COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties ########################################################################################## -ifndef OPENJDK -ifeq ($(ENABLE_JFR), true) - -JFR_CONFIGURATION_DIR_SRC := $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings/ -JFR_CONFIGURATION_DIR_DST := $(LIBDIR)/jfr/ - -JFR_SRC_FILES = $(wildcard $(JFR_CONFIGURATION_DIR_SRC)/*.jfc) -JFR_TARGET_FILES = $(subst $(JFR_CONFIGURATION_DIR_SRC),$(JFR_CONFIGURATION_DIR_DST),$(JFR_SRC_FILES)) - -$(JFR_CONFIGURATION_DIR_DST)/%.jfc : $(JFR_CONFIGURATION_DIR_SRC)/%.jfc - $(call install-file) - -COPY_FILES += $(JFR_TARGET_FILES) - -endif -endif - -########################################################################################## +-include $(CUSTOM_MAKE_DIR)/CopyFiles.gmk diff --git a/jdk/makefiles/CreateJars.gmk b/jdk/makefiles/CreateJars.gmk index 64c96b2c97e..54531f19ef5 100644 --- a/jdk/makefiles/CreateJars.gmk +++ b/jdk/makefiles/CreateJars.gmk @@ -132,7 +132,7 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\ ########################################################################################## # Full JRE exclude list for rt.jar and resources.jar -# This value should exclude types destined for jars other than rt.jar and resources.jar. +# This value should exclude types destined for jars other than rt.jar and resources.jar. # When building a Profile this value augments the profile specific exclusions RT_JAR_EXCLUDES += \ com/oracle/security \ @@ -246,7 +246,8 @@ RT_JAR_EXCLUDES += \ sun/util/resources/cldr \ $(LOCALEDATA_INCLUDES) \ com/oracle/jrockit/jfr \ - oracle/jrockit/jfr + oracle/jrockit/jfr \ + jdk/jfr ifeq ($(OPENJDK_TARGET_OS), macosx) RT_JAR_EXCLUDES += com/sun/nio/sctp \ @@ -337,7 +338,7 @@ $(PROFILE_VERSION_CLASS_TARGETS) : $(PROFILE_VERSION_JAVA_TARGETS) # Support for removing the addPropertyChangeListener and removePropertyChangeListener -# methods from classes that only go into the profile builds. +# methods from classes that only go into the profile builds. BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless # When there are $ characters in filenames we have some very subtle interactions between @@ -352,7 +353,7 @@ CLASSES_TO_DEBEAN = \ java/util/jar/Pack200\$$Packer.class \ java/util/jar/Pack200\$$Unpacker.class \ com/sun/java/util/jar/pack/PackerImpl.class \ - com/sun/java/util/jar/pack/UnpackerImpl.class + com/sun/java/util/jar/pack/UnpackerImpl.class ifneq ($(PROFILE),) BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN)) @@ -428,7 +429,8 @@ ifeq ($(ENABLE_JFR), true) SRCS:=$(JDK_OUTPUTDIR)/classes,\ SUFFIXES:=.class .jfc .xsd,\ INCLUDES:=com/oracle/jrockit/jfr \ - oracle/jrockit/jfr,\ + oracle/jrockit/jfr \ + jdk/jfr,\ JAR:=$(IMAGES_OUTPUTDIR)/lib/jfr.jar,\ SKIP_METAINF:=true,\ MANIFEST:=$(MAINMANIFEST), \ @@ -468,14 +470,14 @@ $(JCE_MANIFEST): $(MAINMANIFEST) $(MV) $@.tmp $@ ########################################################################################## -# For security and crypto jars, always build the jar, but for closed, install the prebuilt -# signed version instead of the newly built jar. Unsigned jars are treated as intermediate -# targets and explicitly added to the JARS list. For open, signing is not needed. See +# For security and crypto jars, always build the jar, but for closed, install the prebuilt +# signed version instead of the newly built jar. Unsigned jars are treated as intermediate +# targets and explicitly added to the JARS list. For open, signing is not needed. See # SignJars.gmk for more information. # # The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO # variable is set to no if these jars can't be built to skip that step of the build. -# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no +# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no # other way to get the jars than to build them. SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar @@ -738,7 +740,7 @@ $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC) @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..." $(install-file) -JARS += $(UCRYPTO_JAR_UNSIGNED) +JARS += $(UCRYPTO_JAR_UNSIGNED) endif endif diff --git a/jdk/makefiles/GenerateJavaSources.gmk b/jdk/makefiles/GenerateJavaSources.gmk index db70c737f7b..7bc05989ce9 100644 --- a/jdk/makefiles/GenerateJavaSources.gmk +++ b/jdk/makefiles/GenerateJavaSources.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,7 @@ GENSRC += $(GENSRC_EXCEPTIONS) ifneq ($(OPENJDK_TARGET_OS),windows) include GensrcIcons.gmk -GENSRC += $(GENSRC_X11_ICONS) +GENSRC += $(GENSRC_AWT_ICONS) ifeq ($(OPENJDK_TARGET_OS),macosx) GENSRC += $(GENSRC_OSX_ICONS) diff --git a/jdk/makefiles/GensrcIcons.gmk b/jdk/makefiles/GensrcIcons.gmk index 5f1aed7b00a..01b19c702dd 100644 --- a/jdk/makefiles/GensrcIcons.gmk +++ b/jdk/makefiles/GensrcIcons.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,10 @@ # questions. # -GENSRC_X11_ICONS := -GENSRC_X11_ICONS_SRC := -GENSRC_X11_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc -GENSRC_X11_ICONS_DST := $(GENSRC_X11_ICONS_TMP)/sun/awt/X11 +GENSRC_AWT_ICONS := +GENSRC_AWT_ICONS_SRC := +GENSRC_AWT_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc +GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/ ifdef OPENJDK X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR) @@ -34,76 +34,76 @@ else X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris endif -GENSRC_X11_ICONS_SRC += \ +GENSRC_AWT_ICONS_SRC += \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png -X11_ICONPATH := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/awt/X11 +AWT_ICONPATH := $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -GENSRC_X11_ICONS_SRC += \ - $(X11_ICONPATH)/security-icon-bw16.png \ - $(X11_ICONPATH)/security-icon-interim16.png \ - $(X11_ICONPATH)/security-icon-yellow16.png \ - $(X11_ICONPATH)/security-icon-bw24.png \ - $(X11_ICONPATH)/security-icon-interim24.png \ - $(X11_ICONPATH)/security-icon-yellow24.png \ - $(X11_ICONPATH)/security-icon-bw32.png \ - $(X11_ICONPATH)/security-icon-interim32.png \ - $(X11_ICONPATH)/security-icon-yellow32.png \ - $(X11_ICONPATH)/security-icon-bw48.png \ - $(X11_ICONPATH)/security-icon-interim48.png \ - $(X11_ICONPATH)/security-icon-yellow48.png +GENSRC_AWT_ICONS_SRC += \ + $(AWT_ICONPATH)/security-icon-bw16.png \ + $(AWT_ICONPATH)/security-icon-interim16.png \ + $(AWT_ICONPATH)/security-icon-yellow16.png \ + $(AWT_ICONPATH)/security-icon-bw24.png \ + $(AWT_ICONPATH)/security-icon-interim24.png \ + $(AWT_ICONPATH)/security-icon-yellow24.png \ + $(AWT_ICONPATH)/security-icon-bw32.png \ + $(AWT_ICONPATH)/security-icon-interim32.png \ + $(AWT_ICONPATH)/security-icon-yellow32.png \ + $(AWT_ICONPATH)/security-icon-bw48.png \ + $(AWT_ICONPATH)/security-icon-interim48.png \ + $(AWT_ICONPATH)/security-icon-yellow48.png -GENSRC_X11_ICONS_FILES := $(notdir $(GENSRC_X11_ICONS_SRC)) +GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC)) -GENSRC_X11_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) -GENSRC_X11_ICONS_DST_NAME = XAWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) +GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) +GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) ### -$(GENSRC_X11_ICONS_TMP)/_the.icons.dir : +$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir : $(ECHO) Generating icon classes - $(MKDIR) -p $(GENSRC_X11_ICONS_DST) + $(MKDIR) -p $(GENSRC_AWT_ICONS_DST) $(TOUCH) $@ ### -define SetupGensrcX11Icon +define SetupGensrcAWTIcon # param 1 is for src-file # param 2 is for src-dir - $1_SHORTNAME := $(call GENSRC_X11_ICONS_SHORT_NAME,$1) - $1_NAME32 := $(call GENSRC_X11_ICONS_DST_NAME,$1,32) - $1_TARGET32 := $(GENSRC_X11_ICONS_DST)/$$($1_NAME32).java - $1_NAME64 := $(call GENSRC_X11_ICONS_DST_NAME,$1,64) - $1_TARGET64 := $(GENSRC_X11_ICONS_DST)/$$($1_NAME64).java + $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1) + $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32) + $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java + $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64) + $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java -$$($1_TARGET32) : $2/$1 $(GENSRC_X11_ICONS_TMP)/_the.icons.dir +$$($1_TARGET32) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(RM) $$@ $$@.tmp - $(ECHO) "package sun.awt.X11;" > $$@.tmp + $(ECHO) "package sun.awt;" > $$@.tmp $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp - $(CAT) $$< | $(TOOL_X11_TOBIN) >> $$@.tmp + $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp $(ECHO) "}; }" >> $$@.tmp $(MV) $$@.tmp $$@ -GENSRC_X11_ICONS += $$($1_TARGET32) +GENSRC_AWT_ICONS += $$($1_TARGET32) -$$($1_TARGET64) : $2/$1 $(GENSRC_X11_ICONS_TMP)/_the.icons.dir +$$($1_TARGET64) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(RM) $$@ $$@.tmp - $(ECHO) "package sun.awt.X11;" > $$@.tmp + $(ECHO) "package sun.awt;" > $$@.tmp $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp - $(CAT) $$< | $(TOOL_X11_TOBIN) >> $$@.tmp + $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp $(ECHO) "}; }" >> $$@.tmp $(MV) $$@.tmp $$@ -GENSRC_X11_ICONS += $$($1_TARGET64) +GENSRC_AWT_ICONS += $$($1_TARGET64) endef -$(foreach I,$(GENSRC_X11_ICONS_SRC), $(eval $(call SetupGensrcX11Icon,$(notdir $(I)),$(dir $(I))))) +$(foreach I,$(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I))))) ### diff --git a/jdk/makefiles/Tools.gmk b/jdk/makefiles/Tools.gmk index 66d08b49be3..3b4e72c16d9 100644 --- a/jdk/makefiles/Tools.gmk +++ b/jdk/makefiles/Tools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ $(eval $(call FillCacheFind,$(JDK_TOPDIR)/make/tools \ $(JDK_TOPDIR)/makefiles/sun)) TOOLS_SRC:=$(JDK_TOPDIR)/make/tools/src \ - $(JDK_TOPDIR)/makefiles/sun/awt/X11 \ + $(JDK_TOPDIR)/makefiles/sun/awt/ \ $(JDK_TOPDIR)/makefiles/sun/osxapp \ $(JDK_TOPDIR)/make/tools/swing-beans @@ -134,8 +134,8 @@ TOOL_GENERATENIMBUS=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ TOOL_WRAPPERGENERATOR=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ WrapperGenerator -TOOL_X11_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ - sun.awt.X11.ToBin +TOOL_AWT_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ + sun.awt.ToBin TOOL_OSX_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ sun.osxapp.ToBin diff --git a/jdk/makefiles/mapfiles/libnio/mapfile-linux b/jdk/makefiles/mapfiles/libnio/mapfile-linux index 92c7d318894..e85bafae76d 100644 --- a/jdk/makefiles/mapfiles/libnio/mapfile-linux +++ b/jdk/makefiles/mapfiles/libnio/mapfile-linux @@ -117,6 +117,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/makefiles/mapfiles/libnio/mapfile-macosx b/jdk/makefiles/mapfiles/libnio/mapfile-macosx index 4093a002329..e5a92d93f18 100644 --- a/jdk/makefiles/mapfiles/libnio/mapfile-macosx +++ b/jdk/makefiles/mapfiles/libnio/mapfile-macosx @@ -109,6 +109,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/makefiles/mapfiles/libnio/mapfile-solaris b/jdk/makefiles/mapfiles/libnio/mapfile-solaris index 98deb510dcb..3a610edd9e7 100644 --- a/jdk/makefiles/mapfiles/libnio/mapfile-solaris +++ b/jdk/makefiles/mapfiles/libnio/mapfile-solaris @@ -105,6 +105,7 @@ SUNWprivate_1.1 { Java_sun_nio_ch_Net_getInterface6; Java_sun_nio_ch_Net_shutdown; Java_sun_nio_ch_Net_poll; + Java_sun_nio_ch_Net_isExclusiveBindAvailable; Java_sun_nio_ch_PollArrayWrapper_interrupt; Java_sun_nio_ch_PollArrayWrapper_poll0; Java_sun_nio_ch_ServerSocketChannelImpl_accept0; diff --git a/jdk/makefiles/mapfiles/libzip/mapfile-vers b/jdk/makefiles/mapfiles/libzip/mapfile-vers index ba6490cc328..383fedf2d1f 100644 --- a/jdk/makefiles/mapfiles/libzip/mapfile-vers +++ b/jdk/makefiles/mapfiles/libzip/mapfile-vers @@ -65,6 +65,7 @@ SUNWprivate_1.1 { Java_java_util_zip_ZipFile_initIDs; Java_java_util_zip_ZipFile_open; Java_java_util_zip_ZipFile_read; + Java_java_util_zip_ZipFile_startsWithLOC; ZIP_Close; ZIP_CRC32; diff --git a/jdk/makefiles/mapfiles/libzip/reorder-sparc b/jdk/makefiles/mapfiles/libzip/reorder-sparc index df4ea6db1f7..e32c7ce2ee5 100644 --- a/jdk/makefiles/mapfiles/libzip/reorder-sparc +++ b/jdk/makefiles/mapfiles/libzip/reorder-sparc @@ -18,6 +18,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/makefiles/mapfiles/libzip/reorder-sparcv9 b/jdk/makefiles/mapfiles/libzip/reorder-sparcv9 index f5c24f29fd2..c1e3237e8f9 100644 --- a/jdk/makefiles/mapfiles/libzip/reorder-sparcv9 +++ b/jdk/makefiles/mapfiles/libzip/reorder-sparcv9 @@ -18,6 +18,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/makefiles/mapfiles/libzip/reorder-x86 b/jdk/makefiles/mapfiles/libzip/reorder-x86 index 16bc0de9367..f3cf4ff6183 100644 --- a/jdk/makefiles/mapfiles/libzip/reorder-x86 +++ b/jdk/makefiles/mapfiles/libzip/reorder-x86 @@ -19,6 +19,7 @@ text: .text%ZIP_FreeEntry; text: .text%Java_java_util_zip_ZipFile_initIDs; text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_getTotal; +text: .text%Java_java_util_zip_ZipFile_startsWithLOC; text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_getEntryTime; diff --git a/jdk/makefiles/profile-includes.txt b/jdk/makefiles/profile-includes.txt index 8a137b8b462..f4876284b73 100644 --- a/jdk/makefiles/profile-includes.txt +++ b/jdk/makefiles/profile-includes.txt @@ -125,13 +125,11 @@ PROFILE_3_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jaas_unix$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo.diz \ - $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \ - jfr.jar \ jvm.hprof.txt \ management-agent.jar \ management/jmxremote.access \ @@ -164,6 +162,7 @@ FULL_JRE_LIB_FILES := \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) \ + $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) \ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) \ @@ -214,6 +213,7 @@ FULL_JRE_LIB_FILES := \ images/cursors/motif_MoveDrop32x32.gif \ images/cursors/motif_MoveNoDrop32x32.gif \ jexec \ + jfr.jar \ oblique-fonts/LucidaSansDemiOblique.ttf \ oblique-fonts/LucidaSansOblique.ttf \ oblique-fonts/LucidaTypewriterBoldOblique.ttf \ diff --git a/jdk/makefiles/scripts/genExceptions.sh b/jdk/makefiles/scripts/genExceptions.sh index 5a43c8741c5..698e14518e8 100644 --- a/jdk/makefiles/scripts/genExceptions.sh +++ b/jdk/makefiles/scripts/genExceptions.sh @@ -70,7 +70,7 @@ __END__ private $ARG_TYPE $ARG_ID; /** - * Constructs an instance of this class.

      + * Constructs an instance of this class. * * @param $ARG_ID * The $ARG_PHRASE @@ -81,7 +81,7 @@ __END__ } /** - * Retrieves the $ARG_PHRASE.

      + * Retrieves the $ARG_PHRASE. * * @return The $ARG_PHRASE */ diff --git a/jdk/make/sun/xawt/ToBin.java b/jdk/makefiles/sun/awt/ToBin.java similarity index 95% rename from jdk/make/sun/xawt/ToBin.java rename to jdk/makefiles/sun/awt/ToBin.java index 99f37881b62..db97240e432 100644 --- a/jdk/make/sun/xawt/ToBin.java +++ b/jdk/makefiles/sun/awt/ToBin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ * questions. */ -package sun.awt.X11; +package sun.awt; import java.io.*; import java.awt.image.*; diff --git a/jdk/src/macosx/classes/com/apple/laf/resources/aqua_pt_BR.properties b/jdk/src/macosx/classes/com/apple/laf/resources/aqua_pt_BR.properties index 3c4ca83d13e..bebcc77be82 100644 --- a/jdk/src/macosx/classes/com/apple/laf/resources/aqua_pt_BR.properties +++ b/jdk/src/macosx/classes/com/apple/laf/resources/aqua_pt_BR.properties @@ -154,7 +154,7 @@ FormView.browseFileButton.textAndMnemonic=Procurar... ############ Abstract Document Strings ############ AbstractDocument.styleChange.textAndMnemonic=altera\u00E7\u00E3o de estilo AbstractDocument.addition.textAndMnemonic=adi\u00E7\u00E3o -AbstractDocument.deletion.textAndMnemonic=dele\u00E7\u00E3o +AbstractDocument.deletion.textAndMnemonic=exclus\u00E3o AbstractDocument.undo.textAndMnemonic=Desfazer AbstractDocument.redo.textAndMnemonic=Refazer diff --git a/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java b/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java index 05977810614..32a099cea7d 100644 --- a/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java +++ b/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,8 +73,7 @@ public class CGLLayer extends CFRetainedResource { } public int getTransparency() { - return peer.isTranslucent() ? Transparency.TRANSLUCENT : - Transparency.OPAQUE; + return isOpaque() ? Transparency.OPAQUE : Transparency.TRANSLUCENT; } public Object getDestination() { @@ -82,14 +81,14 @@ public class CGLLayer extends CFRetainedResource { } public SurfaceData replaceSurfaceData() { - if (peer.getBounds().isEmpty()) { + if (getBounds().isEmpty()) { surfaceData = NullSurfaceData.theInstance; return surfaceData; } // the layer redirects all painting to the buffer's graphics // and blits the buffer to the layer surface (in drawInCGLContext callback) - CGraphicsConfig gc = (CGraphicsConfig)peer.getGraphicsConfiguration(); + CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = gc.createSurfaceData(this); setScale(gc.getDevice().getScaleFactor()); // the layer holds a reference to the buffer, which in diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index 1bdfb798f6b..05d1d5d1fad 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -899,7 +899,7 @@ public abstract class LWComponentPeer boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("lightweightChild=" + lightweightChild + ", temporary=" + temporary + ", focusedWindowChangeAllowed=" + focusedWindowChangeAllowed + ", time= " + time + ", cause=" + cause); @@ -940,7 +940,7 @@ public abstract class LWComponentPeer LWWindowPeer.getOwnerFrameDialog(parentPeer) : parentPeer; if (decoratedPeer == null || !decoratedPeer.getPlatformWindow().isActive()) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("request rejected, focusedWindowChangeAllowed==false, " + "decoratedPeer is inactive: " + decoratedPeer); } @@ -953,7 +953,7 @@ public abstract class LWComponentPeer // If parent window can be made focused and has been made focused (synchronously) // then we can proceed with children, otherwise we retreat if (!res || !parentWindow.isFocused()) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("request rejected, res= " + res + ", parentWindow.isFocused()=" + parentWindow.isFocused()); } diff --git a/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java index 421c8af57e0..5cecb6040fb 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,9 +44,26 @@ public class LWKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { @Override public void setCurrentFocusedWindow(Window win) { + LWWindowPeer from, to; + synchronized (this) { + if (focusedWindow == win) { + return; + } + + from = (LWWindowPeer)LWToolkit.targetToPeer(focusedWindow); + to = (LWWindowPeer)LWToolkit.targetToPeer(win); + focusedWindow = win; } + + if (from != null) { + from.updateSecurityWarningVisibility(); + } + + if (to != null) { + to.updateSecurityWarningVisibility(); + } } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java index 6ff3530db76..fb7032f0b74 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java @@ -513,6 +513,8 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { return clipboard; } + protected abstract SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer); + // ---- DELEGATES ---- // public abstract Clipboard createPlatformClipboard(); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 5ffaae70f21..2be41cf3b0d 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -41,7 +41,7 @@ import sun.util.logging.PlatformLogger; public class LWWindowPeer extends LWContainerPeer - implements FramePeer, DialogPeer, FullScreenCapable, DisplayChangedListener + implements FramePeer, DialogPeer, FullScreenCapable, DisplayChangedListener, PlatformEventNotifier { public static enum PeerType { SIMPLEWINDOW, @@ -112,6 +112,8 @@ public class LWWindowPeer private final PeerType peerType; + private final SecurityWarningWindow warningWindow; + /** * Current modal blocker or null. * @@ -158,11 +160,26 @@ public class LWWindowPeer } platformWindow.initialize(target, this, ownerDelegate); + + // Init warning window(for applets) + SecurityWarningWindow warn = null; + if (((Window)target).getWarningString() != null) { + // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip + // and TrayIcon balloon windows without a warning window. + if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) { + LWToolkit toolkit = (LWToolkit)Toolkit.getDefaultToolkit(); + warn = toolkit.createSecurityWarning(target, this); + } + } + + warningWindow = warn; } @Override void initializeImpl() { super.initializeImpl(); + + if (getTarget() instanceof Frame) { setTitle(((Frame) getTarget()).getTitle()); setState(((Frame) getTarget()).getExtendedState()); @@ -217,12 +234,20 @@ public class LWWindowPeer if (isGrabbing()) { ungrab(); } + if (warningWindow != null) { + warningWindow.dispose(); + } + platformWindow.dispose(); super.disposeImpl(); } @Override protected void setVisibleImpl(final boolean visible) { + if (!visible && warningWindow != null) { + warningWindow.setVisible(false, false); + } + super.setVisibleImpl(visible); // TODO: update graphicsConfig, see 4868278 platformWindow.setVisible(visible); @@ -453,7 +478,15 @@ public class LWWindowPeer @Override public void repositionSecurityWarning() { - throw new RuntimeException("not implemented"); + if (warningWindow != null) { + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + Window target = getTarget(); + int x = compAccessor.getX(target); + int y = compAccessor.getY(target); + int width = compAccessor.getWidth(target); + int height = compAccessor.getHeight(target); + warningWindow.reposition(x, y, width, height); + } } // ---- FRAME PEER METHODS ---- // @@ -513,6 +546,7 @@ public class LWWindowPeer // ---- PEER NOTIFICATIONS ---- // + @Override public void notifyIconify(boolean iconify) { //The toplevel target is Frame and states are applicable to it. //Otherwise, the target is Window and it don't have state property. @@ -537,6 +571,7 @@ public class LWWindowPeer } } + @Override public void notifyZoom(boolean isZoomed) { int newWindowState = isZoomed ? Frame.MAXIMIZED_BOTH : Frame.NORMAL; postWindowStateChangedEvent(newWindowState); @@ -546,7 +581,8 @@ public class LWWindowPeer * Called by the {@code PlatformWindow} when any part of the window should * be repainted. */ - public final void notifyExpose(final Rectangle r) { + @Override + public void notifyExpose(final Rectangle r) { repaintPeer(r); } @@ -556,7 +592,8 @@ public class LWWindowPeer * LWComponentPeer as the only components which could be resized by user are * top-level windows. */ - public final void notifyReshape(int x, int y, int w, int h) { + @Override + public void notifyReshape(int x, int y, int w, int h) { final boolean moved; final boolean resized; final boolean invalid = updateInsets(platformWindow.getInsets()); @@ -590,6 +627,8 @@ public class LWWindowPeer handleResize(w, h, true); repaintPeer(); } + + repositionSecurityWarning(); } private void clearBackground(final int w, final int h) { @@ -617,16 +656,19 @@ public class LWWindowPeer } } + @Override public void notifyUpdateCursor() { getLWToolkit().getCursorManager().updateCursorLater(this); } + @Override public void notifyActivation(boolean activation, LWWindowPeer opposite) { Window oppositeWindow = (opposite == null)? null : opposite.getTarget(); changeFocusedWindow(activation, oppositeWindow); } // MouseDown in non-client area + @Override public void notifyNCMouseDown() { // Ungrab except for a click on a Dialog with the grabbing owner if (grabbingWindow != null && @@ -643,10 +685,11 @@ public class LWWindowPeer * coordinates are relative to non-client window are, i.e. the top-left * point of the client area is (insets.top, insets.left). */ - public void dispatchMouseEvent(int id, long when, int button, - int x, int y, int screenX, int screenY, - int modifiers, int clickCount, boolean popupTrigger, - byte[] bdata) + @Override + public void notifyMouseEvent(int id, long when, int button, + int x, int y, int screenX, int screenY, + int modifiers, int clickCount, boolean popupTrigger, + byte[] bdata) { // TODO: fill "bdata" member of AWTEvent Rectangle r = getBounds(); @@ -659,11 +702,9 @@ public class LWWindowPeer if (lastMouseEventPeer.isEnabled()) { Point lp = lastMouseEventPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(lastMouseEventPeer.getTarget(), - MouseEvent.MOUSE_EXITED, when, - modifiers, lp.x, lp.y, screenX, - screenY, clickCount, popupTrigger, - button)); + Component target = lastMouseEventPeer.getTarget(); + postMouseExitedEvent(target, when, modifiers, lp, + screenX, screenY, clickCount, popupTrigger, button); } // Sometimes we may get MOUSE_EXITED after lastCommonMouseEventPeer is switched @@ -679,11 +720,9 @@ public class LWWindowPeer if (targetPeer != null) { if (targetPeer.isEnabled()) { Point lp = targetPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(targetPeer.getTarget(), - MouseEvent.MOUSE_ENTERED, when, - modifiers, lp.x, lp.y, screenX, - screenY, clickCount, popupTrigger, - button)); + Component target = targetPeer.getTarget(); + postMouseEnteredEvent(target, when, modifiers, lp, + screenX, screenY, clickCount, popupTrigger, button); } lastCommonMouseEventPeer = targetPeer; lastMouseEventPeer = targetPeer; @@ -810,11 +849,9 @@ public class LWWindowPeer // Generate Mouse Exit for components if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) { Point oldp = lastMouseEventPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(lastMouseEventPeer.getTarget(), - MouseEvent.MOUSE_EXITED, - when, modifiers, - oldp.x, oldp.y, screenX, screenY, - clickCount, popupTrigger, button)); + Component target = lastMouseEventPeer.getTarget(); + postMouseExitedEvent(target, when, modifiers, oldp, screenX, screenY, + clickCount, popupTrigger, button); } lastCommonMouseEventPeer = targetPeer; lastMouseEventPeer = targetPeer; @@ -822,18 +859,42 @@ public class LWWindowPeer // Generate Mouse Enter for components if (targetPeer != null && targetPeer.isEnabled()) { Point newp = targetPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(targetPeer.getTarget(), - MouseEvent.MOUSE_ENTERED, - when, modifiers, - newp.x, newp.y, screenX, screenY, - clickCount, popupTrigger, button)); + Component target = targetPeer.getTarget(); + postMouseEnteredEvent(target, when, modifiers, newp, screenX, screenY, clickCount, popupTrigger, button); } } - public void dispatchMouseWheelEvent(long when, int x, int y, int modifiers, - int scrollType, int scrollAmount, - int wheelRotation, double preciseWheelRotation, - byte[] bdata) + private void postMouseEnteredEvent(Component target, long when, int modifiers, + Point loc, int xAbs, int yAbs, + int clickCount, boolean popupTrigger, int button) { + + updateSecurityWarningVisibility(); + + postEvent(new MouseEvent(target, + MouseEvent.MOUSE_ENTERED, + when, modifiers, + loc.x, loc.y, xAbs, yAbs, + clickCount, popupTrigger, button)); + } + + private void postMouseExitedEvent(Component target, long when, int modifiers, + Point loc, int xAbs, int yAbs, + int clickCount, boolean popupTrigger, int button) { + + updateSecurityWarningVisibility(); + + postEvent(new MouseEvent(target, + MouseEvent.MOUSE_EXITED, + when, modifiers, + loc.x, loc.y, xAbs, yAbs, + clickCount, popupTrigger, button)); + } + + @Override + public void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata) { // TODO: could we just use the last mouse event target here? Rectangle r = getBounds(); @@ -859,8 +920,9 @@ public class LWWindowPeer /* * Called by the delegate when a key is pressed. */ - public void dispatchKeyEvent(int id, long when, int modifiers, - int keyCode, char keyChar, int keyLocation) + @Override + public void notifyKeyEvent(int id, long when, int modifiers, + int keyCode, char keyChar, int keyLocation) { LWKeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); Component focusOwner = kfmPeer.getCurrentFocusOwner(); @@ -874,7 +936,6 @@ public class LWWindowPeer postEvent(new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation)); } - // ---- UTILITY METHODS ---- // private void activateDisplayListener() { @@ -894,11 +955,14 @@ public class LWWindowPeer AWTAccessor.getFrameAccessor().setExtendedState( (Frame)getTarget(), newWindowState); } + WindowEvent stateChangedEvent = new WindowEvent(getTarget(), WindowEvent.WINDOW_STATE_CHANGED, windowState, newWindowState); postEvent(stateChangedEvent); windowState = newWindowState; + + updateSecurityWarningVisibility(); } private static int getGraphicsConfigScreen(GraphicsConfiguration gc) { @@ -1059,7 +1123,7 @@ public class LWWindowPeer * In case of a simple window, triggers appropriate java focus change. */ public boolean requestWindowFocus(CausedFocusEvent.Cause cause) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("requesting native focus to " + this); } @@ -1085,7 +1149,7 @@ public class LWWindowPeer // If owner is not natively active, request native // activation on it w/o sending events up to java. if (owner != null && !owner.platformWindow.isActive()) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("requesting native focus to the owner " + owner); } LWWindowPeer currentActivePeer = (currentActive != null ? @@ -1093,7 +1157,7 @@ public class LWWindowPeer // Ensure the opposite is natively active and suppress sending events. if (currentActivePeer != null && currentActivePeer.platformWindow.isActive()) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("the opposite is " + currentActivePeer); } currentActivePeer.skipNextFocusChange = true; @@ -1150,7 +1214,7 @@ public class LWWindowPeer * Changes focused window on java level. */ protected void changeFocusedWindow(boolean becomesFocused, Window opposite) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine((becomesFocused?"gaining":"loosing") + " focus window: " + this); } if (skipNextFocusChange) { @@ -1165,7 +1229,7 @@ public class LWWindowPeer if (becomesFocused) { synchronized (getPeerTreeLock()) { if (blocker != null) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("the window is blocked by " + blocker); } return; @@ -1179,7 +1243,7 @@ public class LWWindowPeer if (!becomesFocused && (isGrabbing() || getOwnerFrameDialog(grabbingWindow) == this)) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("ungrabbing on " + grabbingWindow); } // ungrab a simple window if its owner looses activation. @@ -1222,10 +1286,12 @@ public class LWWindowPeer public void enterFullScreenMode() { platformWindow.enterFullScreenMode(); + updateSecurityWarningVisibility(); } public void exitFullScreenMode() { platformWindow.exitFullScreenMode(); + updateSecurityWarningVisibility(); } public long getLayerPtr() { @@ -1260,6 +1326,33 @@ public class LWWindowPeer return peerType; } + public void updateSecurityWarningVisibility() { + if (warningWindow == null) { + return; + } + + if (!isVisible()) { + return; // The warning window should already be hidden. + } + + boolean show = false; + + if (!platformWindow.isFullScreenMode()) { + if (isVisible()) { + if (LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == + getTarget()) { + show = true; + } + + if (platformWindow.isUnderMouse() || warningWindow.isUnderMouse()) { + show = true; + } + } + } + + warningWindow.setVisible(show, true); + } + @Override public String toString() { return super.toString() + " [target is " + getTarget() + "]"; diff --git a/jdk/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java b/jdk/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java new file mode 100644 index 00000000000..5bb336881f2 --- /dev/null +++ b/jdk/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.lwawt; + +import java.awt.Rectangle; + +public interface PlatformEventNotifier { + void notifyIconify(boolean iconify); + + void notifyZoom(boolean isZoomed); + + void notifyExpose(Rectangle r); + + void notifyReshape(int x, int y, int w, int h); + + void notifyUpdateCursor(); + + void notifyActivation(boolean activation, LWWindowPeer opposite); + + // MouseDown in non-client area + void notifyNCMouseDown(); + + /* + * Called by the delegate to dispatch the event to Java. Event + * coordinates are relative to non-client window are, i.e. the top-left + * point of the client area is (insets.top, insets.left). + */ + void notifyMouseEvent(int id, long when, int button, + int x, int y, int screenX, int screenY, + int modifiers, int clickCount, boolean popupTrigger, + byte[] bdata); + + void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata); + /* + * Called by the delegate when a key is pressed. + */ + void notifyKeyEvent(int id, long when, int modifiers, + int keyCode, char keyChar, int keyLocation); +} diff --git a/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java index 0527281814a..3142aa0c402 100644 --- a/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,6 +146,8 @@ public interface PlatformWindow { public void exitFullScreenMode(); + public boolean isFullScreenMode(); + public void setWindowState(int windowState); public long getLayerPtr(); diff --git a/jdk/src/macosx/classes/sun/lwawt/SecurityWarningWindow.java b/jdk/src/macosx/classes/sun/lwawt/SecurityWarningWindow.java new file mode 100644 index 00000000000..b701ac8b3e6 --- /dev/null +++ b/jdk/src/macosx/classes/sun/lwawt/SecurityWarningWindow.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.lwawt; + +public interface SecurityWarningWindow extends PlatformWindow { + /** + * @param x,y,w,h coordinates of the untrusted window + */ + public void reposition(int x, int y, int w, int h); + + public void setVisible(boolean visible, boolean doSchedule); +} diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java index 9e0377cdc25..ae7d363b84e 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java @@ -38,7 +38,8 @@ import java.awt.event.*; public class CEmbeddedFrame extends EmbeddedFrame { private CPlatformResponder responder; - private boolean focused = true; + private static final Object classLock = new Object(); + private static volatile CEmbeddedFrame focusedWindow; private boolean parentWindowActive = true; public CEmbeddedFrame() { @@ -104,9 +105,16 @@ public class CEmbeddedFrame extends EmbeddedFrame { responder.handleInputEvent(text); } + // handleFocusEvent is called when the applet becames focused/unfocused. + // This method can be called from different threads. public void handleFocusEvent(boolean focused) { - this.focused = focused; - if (focused) { + synchronized (classLock) { + // In some cases an applet may not receive the focus lost event + // from the parent window (see 8012330) + focusedWindow = (focused) ? this + : ((focusedWindow == this) ? null : focusedWindow); + } + if (focusedWindow == this) { // see bug 8010925 // we can't put this to handleWindowFocusEvent because // it won't be invoced if focuse is moved to a html element @@ -119,11 +127,27 @@ public class CEmbeddedFrame extends EmbeddedFrame { } } + /** + * When the parent window is activated this method is called for all EmbeddedFrames in it. + * + * For the CEmbeddedFrame which had focus before the deactivation this method triggers + * focus events in the following order: + * 1. WINDOW_ACTIVATED for this EmbeddedFrame + * 2. WINDOW_GAINED_FOCUS for this EmbeddedFrame + * 3. FOCUS_GAINED for the most recent focus owner in this EmbeddedFrame + * + * The caller must not requestFocus on the EmbeddedFrame together with calling this method. + * + * @param parentWindowActive true if the window is activated, false otherwise + */ + // handleWindowFocusEvent is called for all applets, when the browser + // becomes active/inactive. This event should be filtered out for + // non-focused applet. This method can be called from different threads. public void handleWindowFocusEvent(boolean parentWindowActive) { this.parentWindowActive = parentWindowActive; // ignore focus "lost" native request as it may mistakenly // deactivate active window (see 8001161) - if (focused && parentWindowActive) { + if (focusedWindow == this && parentWindowActive) { responder.handleWindowFocusEvent(parentWindowActive, null); } } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java index e06cc6f49aa..9a8edddd292 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java @@ -185,6 +185,11 @@ public class CPlatformEmbeddedFrame implements PlatformWindow { @Override public void exitFullScreenMode() {} + @Override + public boolean isFullScreenMode() { + return false; + } + @Override public void setWindowState(int windowState) {} diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java index 70885a828ca..3c7620f2be6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ package sun.lwawt.macosx; import sun.awt.SunToolkit; import sun.lwawt.LWWindowPeer; +import sun.lwawt.PlatformEventNotifier; import sun.lwawt.macosx.event.NSEvent; import java.awt.Toolkit; import java.awt.event.MouseEvent; @@ -39,12 +40,13 @@ import java.awt.event.KeyEvent; */ final class CPlatformResponder { - private final LWWindowPeer peer; + private final PlatformEventNotifier eventNotifier; private final boolean isNpapiCallback; private int lastKeyPressCode = KeyEvent.VK_UNDEFINED; - CPlatformResponder(final LWWindowPeer peer, final boolean isNpapiCallback) { - this.peer = peer; + CPlatformResponder(final PlatformEventNotifier eventNotifier, + final boolean isNpapiCallback) { + this.eventNotifier = eventNotifier; this.isNpapiCallback = isNpapiCallback; } @@ -78,9 +80,9 @@ final class CPlatformResponder { modifierFlags); boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers); - peer.dispatchMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, - x, y, absoluteX, absoluteY, jmodifiers, jclickCount, - jpopupTrigger, null); + eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, + x, y, absoluteX, absoluteY, jmodifiers, jclickCount, + jpopupTrigger, null); } /** @@ -116,8 +118,8 @@ final class CPlatformResponder { wheelRotation = signum; } // invert the wheelRotation for the peer - peer.dispatchMouseWheelEvent(when, x, y, modifiers, scrollType, - scrollAmount, -wheelRotation, -delta, null); + eventNotifier.notifyMouseWheelEvent(when, x, y, modifiers, scrollType, + scrollAmount, -wheelRotation, -delta, null); } /** @@ -187,8 +189,8 @@ final class CPlatformResponder { if (jeventType == KeyEvent.KEY_PRESSED) { lastKeyPressCode = jkeyCode; } - peer.dispatchKeyEvent(jeventType, when, jmodifiers, - jkeyCode, javaChar, jkeyLocation); + eventNotifier.notifyKeyEvent(jeventType, when, jmodifiers, + jkeyCode, javaChar, jkeyLocation); // Current browser may be sending input events, so don't // post the KEY_TYPED here. @@ -206,12 +208,12 @@ final class CPlatformResponder { if (needsKeyReleased && (jkeyCode == KeyEvent.VK_ENTER || jkeyCode == KeyEvent.VK_SPACE)) { return; } - peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, when, jmodifiers, - KeyEvent.VK_UNDEFINED, javaChar, - KeyEvent.KEY_LOCATION_UNKNOWN); + eventNotifier.notifyKeyEvent(KeyEvent.KEY_TYPED, when, jmodifiers, + KeyEvent.VK_UNDEFINED, javaChar, + KeyEvent.KEY_LOCATION_UNKNOWN); //If events come from Firefox, released events should also be generated. if (needsKeyReleased) { - peer.dispatchKeyEvent(KeyEvent.KEY_RELEASED, when, jmodifiers, + eventNotifier.notifyKeyEvent(KeyEvent.KEY_RELEASED, when, jmodifiers, jkeyCode, javaChar, KeyEvent.KEY_LOCATION_UNKNOWN); } @@ -224,13 +226,13 @@ final class CPlatformResponder { char c = 0; while (index < length) { c = text.charAt(index); - peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, + eventNotifier.notifyKeyEvent(KeyEvent.KEY_TYPED, System.currentTimeMillis(), 0, KeyEvent.VK_UNDEFINED, c, KeyEvent.KEY_LOCATION_UNKNOWN); index++; } - peer.dispatchKeyEvent(KeyEvent.KEY_RELEASED, + eventNotifier.notifyKeyEvent(KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, lastKeyPressCode, c, KeyEvent.KEY_LOCATION_UNKNOWN); @@ -238,6 +240,6 @@ final class CPlatformResponder { } void handleWindowFocusEvent(boolean gained, LWWindowPeer opposite) { - peer.notifyActivation(gained, opposite); + eventNotifier.notifyActivation(gained, opposite); } } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java index e11312e7b41..b287e7745b7 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,11 +57,15 @@ public class CPlatformView extends CFRetainedResource { initializeBase(peer, responder); if (!LWCToolkit.getSunAwtDisableCALayers()) { - this.windowLayer = new CGLLayer(peer); + this.windowLayer = createCGLayer(); } setPtr(nativeCreateView(0, 0, 0, 0, getWindowLayerPtr())); } + public CGLLayer createCGLayer() { + return new CGLLayer(peer); + } + protected void initializeBase(LWWindowPeer peer, CPlatformResponder responder) { this.peer = peer; this.responder = responder; @@ -69,7 +73,7 @@ public class CPlatformView extends CFRetainedResource { public long getAWTView() { return ptr; - } + } public boolean isOpaque() { return !peer.isTranslucent(); @@ -100,6 +104,10 @@ public class CPlatformView extends CFRetainedResource { CWrapper.NSView.exitFullScreenMode(ptr); } + public void setToolTip(String msg) { + CWrapper.NSView.setToolTip(ptr, msg); + } + // ---------------------------------------------------------------------- // PAINTING METHODS // ---------------------------------------------------------------------- @@ -108,7 +116,7 @@ public class CPlatformView extends CFRetainedResource { surfaceData = windowLayer.replaceSurfaceData(); } else { if (surfaceData == null) { - CGraphicsConfig graphicsConfig = (CGraphicsConfig)peer.getGraphicsConfiguration(); + CGraphicsConfig graphicsConfig = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = graphicsConfig.createSurfaceData(this); } else { validateSurface(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 6b84f92f8aa..7230b2eeeb5 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -204,9 +204,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private Window target; private LWWindowPeer peer; - private CPlatformView contentView; - private CPlatformWindow owner; - private boolean visible = false; // visibility status from native perspective + protected CPlatformView contentView; + protected CPlatformWindow owner; + protected boolean visible = false; // visibility status from native perspective private boolean undecorated; // initialized in getInitialStyleBits() private Rectangle normalBounds = null; // not-null only for undecorated maximized windows private CPlatformResponder responder; @@ -226,19 +226,13 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo final int styleBits = getInitialStyleBits(); - // TODO: handle these misc properties - final long parentNSWindowPtr = (owner != null ? owner.getNSWindowPtr() : 0); - String warningString = target.getWarningString(); - - responder = new CPlatformResponder(peer, false); + responder = createPlatformResponder(); + contentView = createContentView(); contentView.initialize(peer, responder); final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), styleBits, 0, 0, 0, 0); setPtr(nativeWindowPtr); - // TODO: implement on top of JObjC bridged class - // NSWindow window = JObjC.getInstance().AppKit().NSWindow().getInstance(nativeWindowPtr, JObjCRuntime.getInstance()); - if (target instanceof javax.swing.RootPaneContainer) { final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane(); if (rootpane != null) rootpane.addPropertyChangeListener("ancestor", new PropertyChangeListener() { @@ -261,7 +255,15 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo this.contentView = view; } - private int getInitialStyleBits() { + protected CPlatformResponder createPlatformResponder() { + return new CPlatformResponder(peer, false); + } + + protected CPlatformView createContentView() { + return new CPlatformView(); + } + + protected int getInitialStyleBits() { // defaults style bits int styleBits = DECORATED | HAS_SHADOW | CLOSEABLE | MINIMIZABLE | ZOOMABLE | RESIZABLE; @@ -467,7 +469,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private void maximize() { - if (isMaximized()) { + if (peer == null || isMaximized()) { return; } if (!undecorated) { @@ -502,7 +504,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } } - private boolean isVisible() { + public boolean isVisible() { return this.visible; } @@ -534,7 +536,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo updateFocusabilityForAutoRequestFocus(false); // Actually show or hide the window - LWWindowPeer blocker = peer.getBlocker(); + LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null || !visible) { // If it ain't blocked, or is being hidden, go regular way if (visible) { @@ -633,7 +635,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo public long getNSWindowPtr() { final long nsWindowPtr = ptr; if (nsWindowPtr == 0L) { - if(logger.isLoggable(PlatformLogger.FINE)) { + if(logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine("NSWindow already disposed?", new Exception("Pointer to native NSWindow is invalid.")); } } @@ -726,7 +728,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override public void setOpaque(boolean isOpaque) { CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque); - if (!isOpaque && !peer.isTextured()) { + boolean isTextured = (peer == null)? false : peer.isTextured(); + if (!isOpaque && !isTextured) { long clearColor = CWrapper.NSColor.clearColor(); CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), clearColor); } @@ -765,9 +768,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo isFullScreenMode = false; } + @Override + public boolean isFullScreenMode() { + return isFullScreenMode; + } + @Override public void setWindowState(int windowState) { - if (!peer.isVisible()) { + if (peer == null || !peer.isVisible()) { // setVisible() applies the state return; } @@ -804,8 +812,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo throw new RuntimeException("Unknown window state: " + windowState); } - nativeSynthesizeMouseEnteredExitedEvents(); - // NOTE: the SWP.windowState field gets updated to the newWindowState // value when the native notification comes to us } @@ -914,7 +920,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo responder.handleWindowFocusEvent(gained, oppositePeer); } - private void deliverMoveResizeEvent(int x, int y, int width, int height, + protected void deliverMoveResizeEvent(int x, int y, int width, int height, boolean byUser) { // when the content view enters the full-screen mode, the native // move/resize notifications contain a bounds smaller than @@ -927,9 +933,13 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo final Rectangle oldB = nativeBounds; nativeBounds = new Rectangle(x, y, width, height); final GraphicsConfiguration oldGC = peer.getGraphicsConfiguration(); - peer.notifyReshape(x, y, width, height); + final GraphicsConfiguration newGC = peer.getGraphicsConfiguration(); // System-dependent appearance optimization. + if (peer != null) { + peer.notifyReshape(x, y, width, height); + } + if ((byUser && !oldB.getSize().equals(nativeBounds.getSize())) || isFullScreenAnimationOn || !Objects.equals(newGC, oldGC)) { flushBuffers(); @@ -937,21 +947,29 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private void deliverWindowClosingEvent() { - if (peer.getBlocker() == null) { - peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING)); + if (peer != null) { + if (peer.getBlocker() == null) { + peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING)); + } } } private void deliverIconify(final boolean iconify) { - peer.notifyIconify(iconify); + if (peer != null) { + peer.notifyIconify(iconify); + } } private void deliverZoom(final boolean isZoomed) { - peer.notifyZoom(isZoomed); + if (peer != null) { + peer.notifyZoom(isZoomed); + } } private void deliverNCMouseDown() { - peer.notifyNCMouseDown(); + if (peer != null) { + peer.notifyNCMouseDown(); + } } /* @@ -959,6 +977,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo * may become natively focusable window. */ private boolean isNativelyFocusableWindow() { + if (peer == null) { + return false; + } + return !peer.isSimpleWindow() && target.getFocusableWindowState(); } @@ -973,7 +995,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private boolean checkBlocking() { - LWWindowPeer blocker = peer.getBlocker(); + LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null) { return false; } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java index 4a19e5a064d..dd1661564f5 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package sun.lwawt.macosx; +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; import sun.lwawt.macosx.event.NSEvent; @@ -339,6 +340,9 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer { dialog.addWindowListener(handler); + // suppress security warning for untrusted windows + AWTAccessor.getWindowAccessor().setTrayIconWindow(dialog, true); + dialog.pack(); return dialog; diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java index adc3c034b74..6c194c75bbd 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -200,6 +200,11 @@ public class CViewPlatformEmbeddedFrame implements PlatformWindow { public void exitFullScreenMode() { } + @Override + public boolean isFullScreenMode() { + return false; + } + @Override public void setWindowState(int windowState) { } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java new file mode 100644 index 00000000000..695bf4a96aa --- /dev/null +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.lwawt.macosx; + +import sun.awt.AWTAccessor; +import sun.awt.IconInfo; +import sun.awt.SunToolkit; +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.opengl.CGLLayer; +import sun.lwawt.LWWindowPeer; +import sun.lwawt.PlatformEventNotifier; +import sun.lwawt.SecurityWarningWindow; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import java.lang.ref.WeakReference; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +public final class CWarningWindow extends CPlatformWindow + implements SecurityWarningWindow, PlatformEventNotifier { + + private static class Lock {}; + private final Lock lock = new Lock(); + + private final static int SHOWING_DELAY = 300; + private final static int HIDING_DELAY = 2000; + + private Rectangle bounds = new Rectangle(); + private final WeakReference ownerPeer; + private final Window ownerWindow; + + /** + * Animation stage. + */ + private volatile int currentIcon = 0; + + /* -1 - uninitialized. + * 0 - 16x16 + * 1 - 24x24 + * 2 - 32x32 + * 3 - 48x48 + */ + private int currentSize = -1; + private static IconInfo[][] icons; + private static IconInfo getSecurityIconInfo(int size, int num) { + synchronized (CWarningWindow.class) { + if (icons == null) { + icons = new IconInfo[4][3]; + icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); + } + } + final int sizeIndex = size % icons.length; + return icons[sizeIndex][num % icons[sizeIndex].length]; + } + + public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) { + super(); + + this.ownerPeer = new WeakReference(_ownerPeer); + this.ownerWindow = _ownerWindow; + + initialize(null, null, _ownerPeer.getPlatformWindow()); + + setOpaque(false); + + String warningString = ownerWindow.getWarningString(); + if (warningString != null) { + contentView.setToolTip(ownerWindow.getWarningString()); + } + + updateIconSize(); + } + + /** + * @param x,y,w,h coordinates of the untrusted window + */ + public void reposition(int x, int y, int w, int h) { + final Point2D point = AWTAccessor.getWindowAccessor(). + calculateSecurityWarningPosition(ownerWindow, x, y, w, h); + setBounds((int)point.getX(), (int)point.getY(), getWidth(), getHeight()); + } + + public void setVisible(boolean visible, boolean doSchedule) { + synchronized (scheduler) { + if (showingTaskHandle != null) { + showingTaskHandle.cancel(false); + showingTaskHandle = null; + } + + if (hidingTaskHandle != null) { + hidingTaskHandle.cancel(false); + hidingTaskHandle = null; + } + + if (visible) { + if (isVisible()) { + currentIcon = 0; + } else { + currentIcon = 2; + } + + showingTaskHandle = scheduler.schedule(showingTask, 50, + TimeUnit.MILLISECONDS); + + } else { + if (!isVisible()) { + return; + } + + if (doSchedule) { + hidingTaskHandle = scheduler.schedule(hidingTask, HIDING_DELAY, + TimeUnit.MILLISECONDS); + } else { + hidingTaskHandle = scheduler.schedule(hidingTask, 50, + TimeUnit.MILLISECONDS); + } + } + } + } + + @Override + public void notifyIconify(boolean iconify) { + } + + @Override + public void notifyZoom(boolean isZoomed) { + } + + @Override + public void notifyExpose(final Rectangle r) { + repaint(); + } + + @Override + public void notifyReshape(int x, int y, int w, int h) { + } + + @Override + public void notifyUpdateCursor() { + } + + @Override + public void notifyActivation(boolean activation, LWWindowPeer opposite) { + } + + @Override + public void notifyNCMouseDown() { + } + + @Override + public void notifyMouseEvent(int id, long when, int button, int x, int y, + int screenX, int screenY, int modifiers, + int clickCount, boolean popupTrigger, + byte[] bdata) { + LWWindowPeer peer = ownerPeer.get(); + if (id == MouseEvent.MOUSE_EXITED) { + if (peer != null) { + peer.updateSecurityWarningVisibility(); + } + } else if(id == MouseEvent.MOUSE_ENTERED) { + if (peer != null) { + peer.updateSecurityWarningVisibility(); + } + } + } + + public Rectangle getBounds() { + synchronized (lock) { + return bounds.getBounds(); + } + } + + @Override + public boolean isVisible() { + synchronized (lock) { + return visible; + } + } + + @Override + public void setVisible(boolean visible) { + synchronized (lock) { + final long nsWindowPtr = getNSWindowPtr(); + + // Process parent-child relationship when hiding + if (!visible) { + // Unparent myself + if (owner != null && owner.isVisible()) { + CWrapper.NSWindow.removeChildWindow( + owner.getNSWindowPtr(), nsWindowPtr); + } + } + + // Actually show or hide the window + if (visible) { + CWrapper.NSWindow.orderFront(nsWindowPtr); + } else { + CWrapper.NSWindow.orderOut(nsWindowPtr); + } + + this.visible = visible; + + // Manage parent-child relationship when showing + if (visible) { + // Add myself as a child + if (owner != null && owner.isVisible()) { + CWrapper.NSWindow.addChildWindow(owner.getNSWindowPtr(), + nsWindowPtr, CWrapper.NSWindow.NSWindowAbove); + + // do not allow security warning to be obscured by other windows + if (ownerWindow.isAlwaysOnTop()) { + CWrapper.NSWindow.setLevel(nsWindowPtr, + CWrapper.NSWindow.NSFloatingWindowLevel); + } + } + } + } + } + + @Override + public void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata) { + } + + @Override + public void notifyKeyEvent(int id, long when, int modifiers, int keyCode, + char keyChar, int keyLocation) { + } + + protected int getInitialStyleBits() { + int styleBits = 0; + CPlatformWindow.SET(styleBits, CPlatformWindow.UTILITY, true); + return styleBits; + } + + protected void deliverMoveResizeEvent(int x, int y, int width, int height, + boolean byUser) { + + boolean isResize; + synchronized (lock) { + isResize = (bounds.width != width || bounds.height != height); + bounds = new Rectangle(x, y, width, height); + } + + if (isResize) { + replaceSurface(); + } + + super.deliverMoveResizeEvent(x, y, width, height, byUser); + } + + protected CPlatformResponder createPlatformResponder() { + return new CPlatformResponder(this, false); + } + + protected CPlatformView createContentView() { + return new CPlatformView() { + public GraphicsConfiguration getGraphicsConfiguration() { + LWWindowPeer peer = ownerPeer.get(); + return peer.getGraphicsConfiguration(); + } + + public Rectangle getBounds() { + return CWarningWindow.this.getBounds(); + } + + public CGLLayer createCGLayer() { + return new CGLLayer(null) { + public Rectangle getBounds() { + return CWarningWindow.this.getBounds(); + } + + public GraphicsConfiguration getGraphicsConfiguration() { + LWWindowPeer peer = ownerPeer.get(); + return peer.getGraphicsConfiguration(); + } + + public boolean isOpaque() { + return false; + } + }; + } + }; + } + + private void updateIconSize() { + int newSize = -1; + + if (ownerWindow != null) { + Insets insets = ownerWindow.getInsets(); + int max = Math.max(insets.top, Math.max(insets.bottom, + Math.max(insets.left, insets.right))); + if (max < 24) { + newSize = 0; + } else if (max < 32) { + newSize = 1; + } else if (max < 48) { + newSize = 2; + } else { + newSize = 3; + } + } + // Make sure we have a valid size + if (newSize == -1) { + newSize = 0; + } + + synchronized (lock) { + if (newSize != currentSize) { + currentSize = newSize; + IconInfo ico = getSecurityIconInfo(currentSize, 0); + AWTAccessor.getWindowAccessor().setSecurityWarningSize( + ownerWindow, ico.getWidth(), ico.getHeight()); + } + } + } + + private final Graphics getGraphics() { + SurfaceData sd = contentView.getSurfaceData(); + if (ownerWindow == null || sd == null) { + return null; + } + + return transformGraphics(new SunGraphics2D(sd, SystemColor.windowText, + SystemColor.window, ownerWindow.getFont())); + } + + + private void repaint() { + final Graphics g = getGraphics(); + if (g != null) { + try { + ((Graphics2D) g).setComposite(AlphaComposite.Src); + g.drawImage(getSecurityIconInfo().getImage(), 0, 0, null); + } finally { + g.dispose(); + } + } + } + + private void replaceSurface() { + SurfaceData oldData = contentView.getSurfaceData(); + + replaceSurfaceData(); + + if (oldData != null && oldData != contentView.getSurfaceData()) { + oldData.flush(); + } + } + + private int getWidth() { + return getSecurityIconInfo().getWidth(); + } + + private int getHeight() { + return getSecurityIconInfo().getHeight(); + } + + private IconInfo getSecurityIconInfo() { + return getSecurityIconInfo(currentSize, currentIcon); + } + + private final Runnable hidingTask = new Runnable() { + public void run() { + synchronized (lock) { + setVisible(false); + } + + synchronized (scheduler) { + hidingTaskHandle = null; + } + } + }; + + private final Runnable showingTask = new Runnable() { + public void run() { + synchronized (lock) { + if (!isVisible()) { + setVisible(true); + } + + repaint(); + } + + synchronized (scheduler) { + if (currentIcon > 0) { + currentIcon--; + showingTaskHandle = scheduler.schedule(showingTask, SHOWING_DELAY, + TimeUnit.MILLISECONDS); + } else { + showingTaskHandle = null; + } + } + } + }; + + private final ScheduledExecutorService scheduler = + Executors.newSingleThreadScheduledExecutor(); + + private ScheduledFuture hidingTaskHandle; + private ScheduledFuture showingTaskHandle; +} + diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java index 52aa16ce829..67d3ea1cf1f 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,6 +87,8 @@ public final class CWrapper { public static native void exitFullScreenMode(long view); public static native void setHidden(long view, boolean hidden); + + public static native void setToolTip(long view, String msg); } public static final class NSObject { diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index fcbd9cb388e..943dbe2fe47 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -178,6 +178,11 @@ public final class LWCToolkit extends LWToolkit { } } + @Override + protected SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer) { + return new CWarningWindow(ownerWindow, ownerPeer); + } + @Override protected PlatformComponent createPlatformComponent() { return new CPlatformComponent(); diff --git a/jdk/src/macosx/native/com/apple/laf/AquaFileView.m b/jdk/src/macosx/native/com/apple/laf/AquaFileView.m index 8f33cc5da8c..65fcc72abd3 100644 --- a/jdk/src/macosx/native/com/apple/laf/AquaFileView.m +++ b/jdk/src/macosx/native/com/apple/laf/AquaFileView.m @@ -187,13 +187,13 @@ JNIEXPORT jstring JNICALL Java_com_apple_laf_AquaFileView_getNativePathForResolv JNF_COCOA_ENTER(env); UInt8 pathCString[MAXPATHLEN + 1]; - size_t pathSize = sizeof(pathCString); + size_t maxPathLen = sizeof(pathCString) - 1; jbyte *byteArray = (*env)->GetByteArrayElements(env, pathToAlias, NULL); jsize length = (*env)->GetArrayLength(env, pathToAlias); - if (length > pathSize) { - length = pathSize; + if (length > maxPathLen) { + length = maxPathLen; } strncpy((char *)pathCString, (char *)byteArray, length); // make sure it's null terminated diff --git a/jdk/src/macosx/native/sun/awt/AWTEvent.m b/jdk/src/macosx/native/sun/awt/AWTEvent.m index fd3caa6051f..b2d54f7e705 100644 --- a/jdk/src/macosx/native/sun/awt/AWTEvent.m +++ b/jdk/src/macosx/native/sun/awt/AWTEvent.m @@ -382,7 +382,7 @@ static unichar NsGetDeadKeyChar(unsigned short keyCode) { TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); - if (uchr == nil) { return; } + if (uchr == nil) { return 0; } const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr); // Carbon modifiers should be used instead of NSEvent modifiers UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF; diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m index 2997ff4de75..2a596bcfa75 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.m +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m @@ -447,6 +447,8 @@ AWT_ASSERT_APPKIT_THREAD; // TODO: create generic AWT assert } + [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; + NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]); static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V"); @@ -630,6 +632,7 @@ AWT_ASSERT_APPKIT_THREAD; [self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER withEnv:env]; (*env)->DeleteLocalRef(env, platformWindow); } + [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; } - (void)windowWillExitFullScreen:(NSNotification *)notification { @@ -652,6 +655,7 @@ AWT_ASSERT_APPKIT_THREAD; [self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT withEnv:env]; (*env)->DeleteLocalRef(env, platformWindow); } + [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; } - (void)sendEvent:(NSEvent *)event { @@ -891,8 +895,6 @@ JNF_COCOA_ENTER(env); // ensure we repaint the whole window after the resize operation // (this will also re-enable screen updates, which were disabled above) // TODO: send PaintEvent - - [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; }]; JNF_COCOA_EXIT(env); diff --git a/jdk/src/macosx/native/sun/awt/CRobot.m b/jdk/src/macosx/native/sun/awt/CRobot.m index 056fd19e29f..3a986eb99fd 100644 --- a/jdk/src/macosx/native/sun/awt/CRobot.m +++ b/jdk/src/macosx/native/sun/awt/CRobot.m @@ -29,6 +29,7 @@ #import "LWCToolkit.h" #import "sun_lwawt_macosx_CRobot.h" #import "java_awt_event_InputEvent.h" +#import "sizecalc.h" // Starting number for event numbers generated by Robot. @@ -115,7 +116,7 @@ Java_sun_lwawt_macosx_CRobot_initRobot gsLastClickTime = 0; gsEventNumber = ROBOT_EVENT_NUMBER_START; - gsButtonEventNumber = (int*)malloc(sizeof(int) * gNumberOfButtons); + gsButtonEventNumber = (int*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(int), gNumberOfButtons); if (gsButtonEventNumber == NULL) { JNU_ThrowOutOfMemoryError(env, NULL); return; diff --git a/jdk/src/macosx/native/sun/awt/CWrapper.m b/jdk/src/macosx/native/sun/awt/CWrapper.m index 538a0c3f1ff..bef1d47cb9f 100644 --- a/jdk/src/macosx/native/sun/awt/CWrapper.m +++ b/jdk/src/macosx/native/sun/awt/CWrapper.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -669,6 +669,27 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden JNF_COCOA_EXIT(env); } +/* + * Class: sun_lwawt_macosx_CWrapper$NSView + * Method: setToolTip + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_sun_lwawt_macosx_CWrapper_00024NSView_setToolTip +(JNIEnv *env, jclass cls, jlong viewPtr, jstring msg) +{ + +JNF_COCOA_ENTER(env); + + NSView *view = (NSView *)jlong_to_ptr(viewPtr); + NSString* s = JNFJavaToNSString(env, msg); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + [view setToolTip: s]; + }]; + +JNF_COCOA_EXIT(env); +} + /* * Class: sun_lwawt_macosx_CWrapper$NSScreen @@ -735,7 +756,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSScreen_screenByDisplayId { __block jlong screenPtr = 0L; -JNF_COCOA_ENTER(env); +JNF_COCOA_ENTER(env); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ NSArray *screens = [NSScreen screens]; diff --git a/jdk/src/macosx/native/sun/awt/LWCToolkit.m b/jdk/src/macosx/native/sun/awt/LWCToolkit.m index 6f42c0f9535..1c24279af1f 100644 --- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m +++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m @@ -37,6 +37,8 @@ #import "sun_lwawt_macosx_LWCToolkit.h" +#import "sizecalc.h" + int gNumberOfButtons; jint* gButtonDownMasks; @@ -202,7 +204,7 @@ Java_sun_lwawt_macosx_LWCToolkit_initIDs jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID); jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE); - gButtonDownMasks = (jint*)malloc(sizeof(jint) * gNumberOfButtons); + gButtonDownMasks = (jint*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), gNumberOfButtons); if (gButtonDownMasks == NULL) { gNumberOfButtons = 0; JNU_ThrowOutOfMemoryError(env, NULL); diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m index 709fbe4810a..bbe54aeb811 100644 --- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m +++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m @@ -44,6 +44,7 @@ #include #include +#include static NSScreen* SplashNSScreen() { @@ -99,9 +100,12 @@ char* SplashConvertStringAlloc(const char* in, int* size) { goto done; } inSize = strlen(in); + buf = SAFE_SIZE_ARRAY_ALLOC(malloc, inSize, 2); + if (!buf) { + return NULL; + } bufSize = inSize*2; // need 2 bytes per char for UCS-2, this is // 2 bytes per source byte max - buf = malloc(bufSize); out = buf; outSize = bufSize; /* linux iconv wants char** source and solaris wants const char**... cast to void* */ diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties index 91bfc942117..e266fff6723 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties @@ -102,7 +102,7 @@ horizontal=\u6C34\u5E73 # # accessible actions # -toggle expand=\u30C8\u30B0\u30EB\u5C55\u958B +toggle expand=\u5C55\u958B\u306E\u30C8\u30B0\u30EB # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties index bb4e95d1cc0..1a3da2e1b79 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties @@ -102,7 +102,7 @@ horizontal=\uAC00\uB85C # # accessible actions # -toggle \uD655\uC7A5=\uD1A0\uAE00 \uD655\uC7A5 +toggle expand=\uD1A0\uAE00 \uD655\uC7A5 # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties index a775f9807ad..cdae36aaaaa 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties @@ -102,7 +102,7 @@ horizontal=horizontal # # accessible actions # -toggle expandir=alternar expans\u00E3o +toggle expand=alternar expans\u00E3o # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties index 337b6720d9e..553098d8289 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties @@ -102,7 +102,7 @@ horizontal=horisontell # # accessible actions # -toggle ut\u00F6ka=v\u00E4xla ut\u00F6ka +toggle expand=v\u00E4xla ut\u00F6ka # new relations, roles and states for J2SE 1.5.0 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties index e783eee335b..c4eeded333f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties @@ -41,7 +41,7 @@ FileChooser.saveDialogTitle.textAndMnemonic=Speichern FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen FileChooser.pathLabel.textAndMnemonic=Aus&wahl: FileChooser.filterLabel.textAndMnemonic=Filter: -FileChooser.foldersLabel.textAndMnemonic=&Ordner +FileChooser.foldersLabel.textAndMnemonic=Or&dner FileChooser.filesLabel.textAndMnemonic=&Dateien FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. diff --git a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java index 1c998a08125..b1f5ab2eb65 100644 --- a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java +++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java @@ -1973,8 +1973,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { * does not add it to the list that is consulted by * ClassLoaderRepository.loadClass. */ - final ModifiableClassLoaderRepository clr = - instantiator.getClassLoaderRepository(); + final ModifiableClassLoaderRepository clr = getInstantiatorCLR(); if (clr == null) { final RuntimeException wrapped = new IllegalArgumentException( @@ -2000,8 +1999,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { * Removes the MBean from the default loader repository. */ if (loader != server.getClass().getClassLoader()) { - final ModifiableClassLoaderRepository clr = - instantiator.getClassLoaderRepository(); + final ModifiableClassLoaderRepository clr = getInstantiatorCLR(); if (clr != null) { clr.removeClassLoader(logicalName); } @@ -2060,5 +2058,12 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { return ResourceContext.NONE; } - + private ModifiableClassLoaderRepository getInstantiatorCLR() { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ModifiableClassLoaderRepository run() { + return instantiator != null ? instantiator.getClassLoaderRepository() : null; + } + }); + } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java index 9fc0e7dbe9e..3226e2e55e4 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java @@ -27,12 +27,14 @@ package com.sun.jmx.mbeanserver; import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER; +import java.security.Permission; import java.util.ArrayList; import java.util.Arrays; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.logging.Level; +import javax.management.MBeanPermission; import javax.management.ObjectName; import javax.management.loading.PrivateClassLoader; @@ -300,7 +302,19 @@ final class ClassLoaderRepositorySupport } public final ClassLoader getClassLoader(ObjectName name) { - return loadersWithNames.get(name); + ClassLoader instance = loadersWithNames.get(name); + if (instance != null) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + Permission perm = + new MBeanPermission(instance.getClass().getName(), + null, + name, + "getClassLoader"); + sm.checkPermission(perm); + } + } + return instance; } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java index 566af9e2619..c0dae31946c 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java @@ -33,6 +33,7 @@ import javax.management.Descriptor; import javax.management.MBeanException; import javax.management.openmbean.OpenDataException; import javax.management.openmbean.OpenType; +import sun.reflect.misc.MethodUtil; final class ConvertingMethod { static ConvertingMethod from(Method m) { @@ -189,7 +190,7 @@ final class ConvertingMethod { "from open values: " + e; throw new MBeanException(e, msg); } - final Object javaReturn = method.invoke(obj, javaParams); + final Object javaReturn = MethodUtil.invoke(method, obj, javaParams); try { return returnMapping.toOpenValue(javaReturn); } catch (OpenDataException e) { diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index 612e20024da..c5e00005b87 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -74,6 +74,8 @@ import javax.management.openmbean.SimpleType; import javax.management.openmbean.TabularData; import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularType; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** *

      A converter between Java types and the limited set of classes @@ -299,6 +301,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { private static > MXBeanMapping makeEnumMapping(Class enumClass, Class fake) { + ReflectUtil.checkPackageAccess(enumClass); return new EnumMapping(Util.>cast(enumClass)); } @@ -423,6 +426,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { (c.getName().equals("com.sun.management.GcInfo") && c.getClassLoader() == null); + ReflectUtil.checkPackageAccess(c); final List methods = MBeanAnalyzer.eliminateCovariantMethods(Arrays.asList(c.getMethods())); final SortedMap getterMap = newSortedMap(); @@ -828,7 +832,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { Object[] values = new Object[getters.length]; for (int i = 0; i < getters.length; i++) { try { - Object got = getters[i].invoke(value, (Object[]) null); + Object got = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + @@ -1011,7 +1015,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { MXBeanMapping[] converters) throws InvalidObjectException { try { - return fromMethod.invoke(null, cd); + return MethodUtil.invoke(fromMethod, null, new Object[] {cd}); } catch (Exception e) { final String msg = "Failed to invoke from(CompositeData)"; throw invalidObjectException(msg, e); @@ -1107,13 +1111,15 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { throws InvalidObjectException { Object o; try { - o = getTargetClass().newInstance(); + final Class targetClass = getTargetClass(); + ReflectUtil.checkPackageAccess(targetClass); + o = targetClass.newInstance(); for (int i = 0; i < itemNames.length; i++) { if (cd.containsKey(itemNames[i])) { Object openItem = cd.get(itemNames[i]); Object javaItem = converters[i].fromOpenValue(openItem); - setters[i].invoke(o, javaItem); + MethodUtil.invoke(setters[i], o, new Object[] {javaItem}); } } } catch (Exception e) { @@ -1363,6 +1369,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { } try { + ReflectUtil.checkPackageAccess(max.constructor.getDeclaringClass()); return max.constructor.newInstance(params); } catch (Exception e) { final String msg = diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java index 7011920bf13..732c280f7dd 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java @@ -228,6 +228,11 @@ public class Introspector { MXBeanIntrospector.getInstance().getAnalyzer(interfaceClass); } + public static void testComplianceMBeanInterface(Class interfaceClass) + throws NotCompliantMBeanException{ + StandardMBeanIntrospector.getInstance().getAnalyzer(interfaceClass); + } + /** * Basic method for testing if a given class is a JMX compliant * Standard MBean. This method is only called by the legacy code @@ -248,6 +253,7 @@ public class Introspector { throws NotCompliantMBeanException { if (mbeanInterface == null) mbeanInterface = getStandardMBeanInterface(baseClass); + ReflectUtil.checkPackageAccess(mbeanInterface); MBeanIntrospector introspector = StandardMBeanIntrospector.getInstance(); return getClassMBeanInfo(introspector, baseClass, mbeanInterface); } @@ -372,13 +378,19 @@ public class Introspector { for (Annotation a : annots) { Class c = a.annotationType(); Method[] elements = c.getMethods(); + boolean packageAccess = false; for (Method element : elements) { DescriptorKey key = element.getAnnotation(DescriptorKey.class); if (key != null) { String name = key.value(); Object value; try { - value = element.invoke(a); + // Avoid checking access more than once per annotation + if (!packageAccess) { + ReflectUtil.checkPackageAccess(c); + packageAccess = true; + } + value = MethodUtil.invoke(element, a, null); } catch (RuntimeException e) { // we don't expect this - except for possibly // security exceptions? diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java index 69228b766c0..6a3e770d4a5 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java @@ -32,6 +32,7 @@ import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER; import java.io.ObjectInputStream; import java.security.AccessController; import java.security.Permission; +import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import java.util.List; import java.util.Set; @@ -227,8 +228,16 @@ public final class JmxMBeanServer clr = new ClassLoaderRepositorySupport(); instantiator = new MBeanInstantiator(clr); } + + final MBeanInstantiator fInstantiator = instantiator; this.secureClr = new - SecureClassLoaderRepository(instantiator.getClassLoaderRepository()); + SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoaderRepository run() { + return fInstantiator.getClassLoaderRepository(); + } + }) + ); if (delegate == null) delegate = new MBeanServerDelegateImpl(); if (outer == null) @@ -1242,8 +1251,14 @@ public final class JmxMBeanServer class loader. The ClassLoaderRepository knows how to handle that case. */ ClassLoader myLoader = outerShell.getClass().getClassLoader(); - final ModifiableClassLoaderRepository loaders = - instantiator.getClassLoaderRepository(); + final ModifiableClassLoaderRepository loaders = AccessController.doPrivileged(new PrivilegedAction() { + + @Override + public ModifiableClassLoaderRepository run() { + return instantiator.getClassLoaderRepository(); + } + }); + if (loaders != null) { loaders.addClassLoader(myLoader); diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java index 1adb4dd9373..2fd2d52410e 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java @@ -33,7 +33,12 @@ import java.io.ObjectInputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; +import java.security.AccessControlContext; +import java.security.AccessController; import java.security.Permission; +import java.security.Permissions; +import java.security.PrivilegedAction; +import java.security.ProtectionDomain; import java.util.Map; import java.util.logging.Level; @@ -127,9 +132,8 @@ public class MBeanInstantiator { // Retrieve the class loader from the repository ClassLoader loader = null; - synchronized(this) { - if (clr!=null) - loader = clr.getClassLoader(aLoader); + synchronized (this) { + loader = getClassLoader(aLoader); } if (loader == null) { throw new InstanceNotFoundException("The loader named " + @@ -429,8 +433,7 @@ public class MBeanInstantiator { try { ClassLoader instance = null; - if (clr!=null) - instance = clr.getClassLoader(loaderName); + instance = getClassLoader(loaderName); if (instance == null) throw new ClassNotFoundException(className); theClass = Class.forName(className, false, instance); @@ -622,6 +625,7 @@ public class MBeanInstantiator { * Return the Default Loader Repository used by this instantiator object. **/ public ModifiableClassLoaderRepository getClassLoaderRepository() { + checkMBeanPermission((String)null, null, null, "getClassLoaderRepository"); return clr; } @@ -733,9 +737,19 @@ public class MBeanInstantiator { String member, ObjectName objectName, String actions) { + if (clazz != null) { + checkMBeanPermission(clazz.getName(), member, objectName, actions); + } + } + + private static void checkMBeanPermission(String classname, + String member, + ObjectName objectName, + String actions) + throws SecurityException { SecurityManager sm = System.getSecurityManager(); - if (clazz != null && sm != null) { - Permission perm = new MBeanPermission(clazz.getName(), + if (sm != null) { + Permission perm = new MBeanPermission(classname, member, objectName, actions); @@ -751,4 +765,22 @@ public class MBeanInstantiator { throw new IllegalAccessException("Class is not public and can't be instantiated"); } } + + private ClassLoader getClassLoader(final ObjectName name) { + if(clr == null){ + return null; + } + // Restrict to getClassLoader permission only + Permissions permissions = new Permissions(); + permissions.add(new MBeanPermission("*", null, name, "getClassLoader")); + ProtectionDomain protectionDomain = new ProtectionDomain(null, permissions); + ProtectionDomain[] domains = {protectionDomain}; + AccessControlContext ctx = new AccessControlContext(domains); + ClassLoader loader = AccessController.doPrivileged(new PrivilegedAction() { + public ClassLoader run() { + return clr.getClassLoader(name); + } + }, ctx); + return loader; + } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java index 491adc15fda..67073dded28 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java @@ -51,6 +51,7 @@ import javax.management.MBeanOperationInfo; import javax.management.NotCompliantMBeanException; import javax.management.NotificationBroadcaster; import javax.management.ReflectionException; +import sun.reflect.misc.ReflectUtil; /** * An introspector for MBeans of a certain type. There is one instance @@ -175,7 +176,8 @@ abstract class MBeanIntrospector { /** * Get the methods to be analyzed to build the MBean interface. */ - List getMethods(final Class mbeanType) { + final List getMethods(final Class mbeanType) { + ReflectUtil.checkPackageAccess(mbeanType); return Arrays.asList(mbeanType.getMethods()); } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java index 6330b9c28aa..3e8cb71a5a4 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java @@ -30,7 +30,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectStreamClass; -import java.io.StreamCorruptedException; +import sun.reflect.misc.ReflectUtil; /** * This class deserializes an object in the context of a specific class loader. @@ -61,6 +61,7 @@ class ObjectInputStreamWithLoader extends ObjectInputStream { return super.resolveClass(aClass); } else { String name = aClass.getName(); + ReflectUtil.checkPackageAccess(name); // Query the class loader ... return Class.forName(name, false, loader); } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java index 9b2e9c4f949..2388eae7366 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java @@ -38,6 +38,7 @@ import javax.management.MBeanOperationInfo; import javax.management.NotCompliantMBeanException; import javax.management.NotificationBroadcaster; import javax.management.NotificationBroadcasterSupport; +import sun.reflect.misc.MethodUtil; /** * @since 1.6 @@ -108,7 +109,7 @@ class StandardMBeanIntrospector extends MBeanIntrospector { Object invokeM2(Method m, Object target, Object[] args, Object cookie) throws InvocationTargetException, IllegalAccessException, MBeanException { - return m.invoke(target, args); + return MethodUtil.invoke(m, target, args); } @Override diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java index 7305c980991..dd6dfb43e51 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -397,6 +397,20 @@ public class ArrayNotificationBuffer implements NotificationBuffer { if (nextSeq < nextSequenceNumber()) { candidate = notificationAt(nextSeq); + // Skip security check if NotificationBufferFilter is not overloaded + if (!(filter instanceof ServerNotifForwarder.NotifForwarderBufferFilter)) { + try { + ServerNotifForwarder.checkMBeanPermission(this.mBeanServer, + candidate.getObjectName(),"addNotificationListener"); + } catch (InstanceNotFoundException | SecurityException e) { + if (logger.debugOn()) { + logger.debug("fetchNotifications", "candidate: " + candidate + " skipped. exception " + e); + } + ++nextSeq; + continue; + } + } + if (logger.debugOn()) { logger.debug("fetchNotifications", "candidate: " + candidate); diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java index 1ea01765a5d..bb335b0dfe6 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -226,8 +226,9 @@ public class ServerNotifForwarder { * why we add the found notifications to a supplied List rather than * just returning a boolean. */ - private final NotificationBufferFilter bufferFilter = - new NotificationBufferFilter() { + private final NotifForwarderBufferFilter bufferFilter = new NotifForwarderBufferFilter(); + + final class NotifForwarderBufferFilter implements NotificationBufferFilter { public void apply(List targetedNotifs, ObjectName source, Notification notif) { // We proceed in two stages here, to avoid holding the listenerMap @@ -366,9 +367,16 @@ public class ServerNotifForwarder { * Explicitly check the MBeanPermission for * the current access control context. */ - public void checkMBeanPermission( + public final void checkMBeanPermission( final ObjectName name, final String actions) throws InstanceNotFoundException, SecurityException { + checkMBeanPermission(mbeanServer,name,actions); + } + + static void checkMBeanPermission( + final MBeanServer mbs, final ObjectName name, final String actions) + throws InstanceNotFoundException, SecurityException { + SecurityManager sm = System.getSecurityManager(); if (sm != null) { AccessControlContext acc = AccessController.getContext(); @@ -378,7 +386,7 @@ public class ServerNotifForwarder { new PrivilegedExceptionAction() { public ObjectInstance run() throws InstanceNotFoundException { - return mbeanServer.getObjectInstance(name); + return mbs.getObjectInstance(name); } }); } catch (PrivilegedActionException e) { diff --git a/jdk/src/share/classes/com/sun/jmx/remote/util/OrderClassLoaders.java b/jdk/src/share/classes/com/sun/jmx/remote/util/OrderClassLoaders.java index f3c1c462f36..66063c1118e 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/util/OrderClassLoaders.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/util/OrderClassLoaders.java @@ -25,6 +25,8 @@ package com.sun.jmx.remote.util; +import sun.reflect.misc.ReflectUtil; + public class OrderClassLoaders extends ClassLoader { public OrderClassLoaders(ClassLoader cl1, ClassLoader cl2) { super(cl1); @@ -32,9 +34,10 @@ public class OrderClassLoaders extends ClassLoader { this.cl2 = cl2; } - protected Class findClass(String name) throws ClassNotFoundException { + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + ReflectUtil.checkPackageAccess(name); try { - return super.findClass(name); + return super.loadClass(name, resolve); } catch (ClassNotFoundException cne) { if (cl2 != null) { return cl2.loadClass(name); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java index 351e5f26c79..4ad7a622be8 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java @@ -396,7 +396,7 @@ public class SearchFilter implements AttrFilter { // do we need to begin with the first token? if(proto.charAt(0) != WILDCARD_TOKEN && - !value.toString().toLowerCase(Locale.ENGLISH).startsWith( + !value.toLowerCase(Locale.ENGLISH).startsWith( subStrs.nextToken().toLowerCase(Locale.ENGLISH))) { if(debug) { System.out.println("faild initial test"); diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractDataLine.java b/jdk/src/share/classes/com/sun/media/sound/AbstractDataLine.java index 560961cdc19..0cea4c6cc3f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractDataLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,15 +25,12 @@ package com.sun.media.sound; -import java.util.Vector; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Control; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.Mixer; /** @@ -46,13 +43,13 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { // DEFAULTS // default format - protected /*final*/ AudioFormat defaultFormat; + private final AudioFormat defaultFormat; // default buffer size in bytes - protected /*final*/ int defaultBufferSize; + private final int defaultBufferSize; // the lock for synchronization - protected Object lock = new Object(); + protected final Object lock = new Object(); // STATE @@ -103,7 +100,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { // DATA LINE METHODS - public void open(AudioFormat format, int bufferSize) throws LineUnavailableException { + public final void open(AudioFormat format, int bufferSize) throws LineUnavailableException { //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer ! synchronized (mixer) { if (Printer.trace) Printer.trace("> AbstractDataLine.open(format, bufferSize) (class: "+getClass().getName()); @@ -152,7 +149,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { } - public void open(AudioFormat format) throws LineUnavailableException { + public final void open(AudioFormat format) throws LineUnavailableException { open(format, AudioSystem.NOT_SPECIFIED); } @@ -181,7 +178,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { } - public void start() { + public final void start() { //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer ! synchronized(mixer) { if (Printer.trace) Printer.trace("> "+getClass().getName()+".start() - AbstractDataLine"); @@ -205,7 +202,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { } - public void stop() { + public final void stop() { //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer ! synchronized(mixer) { @@ -249,16 +246,16 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { // in MixerSourceLine and MixerClip, and I want to touch as little // code as possible to change isStarted() back to isRunning(). - public boolean isRunning() { + public final boolean isRunning() { return started; } - public boolean isActive() { + public final boolean isActive() { return active; } - public long getMicrosecondPosition() { + public final long getMicrosecondPosition() { long microseconds = getLongFramePosition(); if (microseconds != AudioSystem.NOT_SPECIFIED) { @@ -268,26 +265,26 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { } - public AudioFormat getFormat() { + public final AudioFormat getFormat() { return format; } - public int getBufferSize() { + public final int getBufferSize() { return bufferSize; } /** * This implementation does NOT change the buffer size */ - public int setBufferSize(int newSize) { + public final int setBufferSize(int newSize) { return getBufferSize(); } /** * This implementation returns AudioSystem.NOT_SPECIFIED. */ - public float getLevel() { + public final float getLevel() { return (float)AudioSystem.NOT_SPECIFIED; } @@ -304,7 +301,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { // it to isStartedRunning(). This is part of backing out the // change denied in RFE 4297981. - protected boolean isStartedRunning() { + final boolean isStartedRunning() { return running; } @@ -312,7 +309,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { * This method sets the active state and generates * events if it changes. */ - protected void setActive(boolean active) { + final void setActive(boolean active) { if (Printer.trace) Printer.trace("> AbstractDataLine: setActive(" + active + ")"); @@ -351,7 +348,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { * This method sets the started state and generates * events if it changes. */ - protected void setStarted(boolean started) { + final void setStarted(boolean started) { if (Printer.trace) Printer.trace("> AbstractDataLine: setStarted(" + started + ")"); @@ -388,7 +385,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { * This method generates a STOP event and sets the started state to false. * It is here for historic reasons when an EOM event existed. */ - protected void setEOM() { + final void setEOM() { if (Printer.trace) Printer.trace("> AbstractDataLine: setEOM()"); //$$fb 2002-04-21: sometimes, 2 STOP events are generated. @@ -408,7 +405,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { * line is open, this should return quietly because the values * requested will match the current ones. */ - public void open() throws LineUnavailableException { + public final void open() throws LineUnavailableException { if (Printer.trace) Printer.trace("> "+getClass().getName()+".open() - AbstractDataLine"); @@ -422,7 +419,7 @@ abstract class AbstractDataLine extends AbstractLine implements DataLine { * This should also stop the line. The closed line should not be running or active. * After we close the line, we reset the format and buffer size to the defaults. */ - public void close() { + public final void close() { //$$fb 2001-10-09: Bug #4517739: avoiding deadlock by synchronizing to mixer ! synchronized (mixer) { if (Printer.trace) Printer.trace("> "+getClass().getName()+".close() - in AbstractDataLine."); diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java b/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java index d9860c9b68a..e6a7ba2d9cb 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,12 @@ package com.sun.media.sound; +import java.util.Map; import java.util.Vector; +import java.util.WeakHashMap; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Control; -import javax.sound.sampled.Mixer; import javax.sound.sampled.Line; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; @@ -43,28 +44,17 @@ import javax.sound.sampled.LineUnavailableException; */ abstract class AbstractLine implements Line { - protected Line.Info info; + protected final Line.Info info; protected Control[] controls; - protected AbstractMixer mixer; + AbstractMixer mixer; private boolean open = false; - private Vector listeners = new Vector(); + private final Vector listeners = new Vector(); /** - * Global event thread + * Contains event dispatcher per thread group. */ - private static final EventDispatcher eventDispatcher; - - static { - // create and start the global event thread - - // $$kk: 12.21.98: - // 1) probably don't want a single global event queue - // 2) need a way to stop this thread when the engine is done - - eventDispatcher = new EventDispatcher(); - eventDispatcher.start(); - } - + private static final Map dispatchers = + new WeakHashMap<>(); /** * Constructs a new AbstractLine. @@ -85,18 +75,17 @@ abstract class AbstractLine implements Line { // LINE METHODS - public Line.Info getLineInfo() { + public final Line.Info getLineInfo() { return info; } - public boolean isOpen() { + public final boolean isOpen() { return open; } - public void addLineListener(LineListener listener) { - + public final void addLineListener(LineListener listener) { synchronized(listeners) { if ( ! (listeners.contains(listener)) ) { listeners.addElement(listener); @@ -109,7 +98,7 @@ abstract class AbstractLine implements Line { * Removes an audio listener. * @param listener listener to remove */ - public void removeLineListener(LineListener listener) { + public final void removeLineListener(LineListener listener) { listeners.removeElement(listener); } @@ -120,8 +109,7 @@ abstract class AbstractLine implements Line { * array of length 0. * @return control set */ - public Control[] getControls() { - + public final Control[] getControls() { Control[] returnedArray = new Control[controls.length]; for (int i = 0; i < controls.length; i++) { @@ -132,8 +120,7 @@ abstract class AbstractLine implements Line { } - public boolean isControlSupported(Control.Type controlType) { - + public final boolean isControlSupported(Control.Type controlType) { // protect against a NullPointerException if (controlType == null) { return false; @@ -149,8 +136,7 @@ abstract class AbstractLine implements Line { } - public Control getControl(Control.Type controlType) { - + public final Control getControl(Control.Type controlType) { // protect against a NullPointerException if (controlType != null) { @@ -172,7 +158,7 @@ abstract class AbstractLine implements Line { * This method sets the open state and generates * events if it changes. */ - protected void setOpen(boolean open) { + final void setOpen(boolean open) { if (Printer.trace) Printer.trace("> "+getClass().getName()+" (AbstractLine): setOpen(" + open + ") this.open: " + this.open); @@ -200,8 +186,8 @@ abstract class AbstractLine implements Line { /** * Send line events. */ - protected void sendEvents(LineEvent event) { - eventDispatcher.sendAudioEvents(event, listeners); + final void sendEvents(LineEvent event) { + getEventDispatcher().sendAudioEvents(event, listeners); } @@ -227,12 +213,23 @@ abstract class AbstractLine implements Line { // $$kk: 06.03.99: returns the mixer used in construction. // this is a hold-over from when there was a public method like // this on line and should be fixed!! - protected AbstractMixer getMixer() { + final AbstractMixer getMixer() { return mixer; } - protected EventDispatcher getEventDispatcher() { - return eventDispatcher; + final EventDispatcher getEventDispatcher() { + // create and start the global event thread + //TODO need a way to stop this thread when the engine is done + final ThreadGroup tg = Thread.currentThread().getThreadGroup(); + synchronized (dispatchers) { + EventDispatcher eventDispatcher = dispatchers.get(tg); + if (eventDispatcher == null) { + eventDispatcher = new EventDispatcher(); + dispatchers.put(tg, eventDispatcher); + eventDispatcher.start(); + } + return eventDispatcher; + } } // ABSTRACT METHODS diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java index dacefba8f49..104af874ea5 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,12 +60,12 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice // DEVICE ATTRIBUTES - private MidiDevice.Info info; + private final MidiDevice.Info info; // DEVICE STATE - protected /*private*/ boolean open = false; + private boolean open = false; private int openRefCount; /** List of Receivers and Transmitters that opened the device implicitely. @@ -102,7 +102,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice // MIDI DEVICE METHODS - public MidiDevice.Info getDeviceInfo() { + public final MidiDevice.Info getDeviceInfo() { return info; } @@ -111,7 +111,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice * opened the the device implicitly from closing it. The only way to close the device after * this call is a call to close(). */ - public void open() throws MidiUnavailableException { + public final void open() throws MidiUnavailableException { if (Printer.trace) Printer.trace("> AbstractMidiDevice: open()"); synchronized(this) { openRefCount = -1; @@ -159,7 +159,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } - public void close() { + public final void close() { if (Printer.trace) Printer.trace("> AbstractMidiDevice: close()"); synchronized (this) { doClose(); @@ -181,7 +181,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice * @param object The object that might have been opening the device implicitely (for now, * this may be a Transmitter or receiver). */ - public void closeInternal(Object object) { + public final void closeInternal(Object object) { if (Printer.trace) Printer.trace("> AbstractMidiDevice: closeInternal()"); synchronized(this) { if (getOpenKeepingObjects().remove(object)) { @@ -197,7 +197,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } - public void doClose() { + public final void doClose() { if (Printer.trace) Printer.trace("> AbstractMidiDevice: doClose()"); synchronized(this) { if (isOpen()) { @@ -209,7 +209,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } - public boolean isOpen() { + public final boolean isOpen() { return open; } @@ -329,7 +329,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice // HELPER METHODS - long getId() { + final long getId() { return id; } @@ -339,7 +339,8 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** Retrieve a Receiver and open the device implicitly. This method is called by MidiSystem.getReceiver(). */ - public Receiver getReceiverReferenceCounting() throws MidiUnavailableException { + public final Receiver getReceiverReferenceCounting() + throws MidiUnavailableException { /* Keep this order of commands! If getReceiver() throws an exception, openInternal() should not be called! */ @@ -355,7 +356,8 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** Retrieve a Transmitter and open the device implicitly. This method is called by MidiSystem.getTransmitter(). */ - public Transmitter getTransmitterReferenceCounting() throws MidiUnavailableException { + public final Transmitter getTransmitterReferenceCounting() + throws MidiUnavailableException { /* Keep this order of commands! If getTransmitter() throws an exception, openInternal() should not be called! */ @@ -422,7 +424,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** Return the internal list of Transmitters, possibly creating it first. */ - protected TransmitterList getTransmitterList() { + final TransmitterList getTransmitterList() { synchronized (traRecLock) { if (transmitterList == null) { transmitterList = new TransmitterList(); @@ -462,7 +464,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** * close this device if discarded by the garbage collector */ - protected void finalize() { + protected final void finalize() { close(); } @@ -534,7 +536,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice * Also, it has some optimizations regarding sending to the Receivers, * for known Receivers, and managing itself in the TransmitterList. */ - protected class BasicTransmitter implements MidiDeviceTransmitter { + class BasicTransmitter implements MidiDeviceTransmitter { private Receiver receiver = null; TransmitterList tlist = null; @@ -546,7 +548,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice this.tlist = tlist; } - public void setReceiver(Receiver receiver) { + public final void setReceiver(Receiver receiver) { if (tlist != null && this.receiver != receiver) { if (Printer.debug) Printer.debug("Transmitter "+toString()+": set receiver "+receiver); tlist.receiverChanged(this, this.receiver, receiver); @@ -554,7 +556,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } } - public Receiver getReceiver() { + public final Receiver getReceiver() { return receiver; } @@ -564,7 +566,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice * Therefore, subclasses that override this method must call * 'super.close()'. */ - public void close() { + public final void close() { AbstractMidiDevice.this.closeInternal(this); if (tlist != null) { tlist.receiverChanged(this, this.receiver, null); @@ -573,7 +575,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice } } - public MidiDevice getMidiDevice() { + public final MidiDevice getMidiDevice() { return AbstractMidiDevice.this; } @@ -583,9 +585,9 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice /** * a class to manage a list of transmitters */ - class TransmitterList { + final class TransmitterList { - private ArrayList transmitters = new ArrayList(); + private final ArrayList transmitters = new ArrayList(); private MidiOutDevice.MidiOutReceiver midiOutReceiver; // how many transmitters must be present for optimized diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java index a098eadf5c9..3d0d1af514a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDeviceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ import javax.sound.midi.spi.MidiDeviceProvider; */ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { - private static boolean enabled; + private static final boolean enabled; /** * Create objects representing all MIDI output devices on the system. @@ -52,7 +52,7 @@ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { } - synchronized void readDeviceInfos() { + final synchronized void readDeviceInfos() { Info[] infos = getInfoCache(); MidiDevice[] devices = getDeviceCache(); if (!enabled) { @@ -118,7 +118,7 @@ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { } - public MidiDevice.Info[] getDeviceInfo() { + public final MidiDevice.Info[] getDeviceInfo() { readDeviceInfos(); Info[] infos = getInfoCache(); MidiDevice.Info[] localArray = new MidiDevice.Info[infos.length]; @@ -127,7 +127,7 @@ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { } - public MidiDevice getDevice(MidiDevice.Info info) { + public final MidiDevice getDevice(MidiDevice.Info info) { if (info instanceof Info) { readDeviceInfos(); MidiDevice[] devices = getDeviceCache(); @@ -164,7 +164,7 @@ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { this.index = index; } - boolean equalStrings(Info info) { + final boolean equalStrings(Info info) { return (info != null && getName().equals(info.getName()) && getVendor().equals(info.getVendor()) @@ -172,11 +172,11 @@ public abstract class AbstractMidiDeviceProvider extends MidiDeviceProvider { && getVersion().equals(info.getVersion())); } - int getIndex() { + final int getIndex() { return index; } - void setIndex(int index) { + final void setIndex(int index) { this.index = index; } diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java index c4f2b6078d0..1055fc6859e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,14 +27,9 @@ package com.sun.media.sound; import java.util.Vector; -import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Control; -import javax.sound.sampled.DataLine; import javax.sound.sampled.Mixer; import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; import javax.sound.sampled.LineUnavailableException; /** @@ -95,13 +90,13 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Source lines (ports) currently open */ - protected Vector sourceLines = new Vector(); + private final Vector sourceLines = new Vector(); /** * Target lines currently open. */ - protected Vector targetLines = new Vector(); + private final Vector targetLines = new Vector(); /** @@ -133,19 +128,19 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { // MIXER METHODS - public Mixer.Info getMixerInfo() { + public final Mixer.Info getMixerInfo() { return mixerInfo; } - public Line.Info[] getSourceLineInfo() { + public final Line.Info[] getSourceLineInfo() { Line.Info[] localArray = new Line.Info[sourceLineInfo.length]; System.arraycopy(sourceLineInfo, 0, localArray, 0, sourceLineInfo.length); return localArray; } - public Line.Info[] getTargetLineInfo() { + public final Line.Info[] getTargetLineInfo() { Line.Info[] localArray = new Line.Info[targetLineInfo.length]; System.arraycopy(targetLineInfo, 0, localArray, 0, targetLineInfo.length); @@ -153,7 +148,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { } - public Line.Info[] getSourceLineInfo(Line.Info info) { + public final Line.Info[] getSourceLineInfo(Line.Info info) { int i; Vector vec = new Vector(); @@ -174,7 +169,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { } - public Line.Info[] getTargetLineInfo(Line.Info info) { + public final Line.Info[] getTargetLineInfo(Line.Info info) { int i; Vector vec = new Vector(); @@ -195,7 +190,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { } - public boolean isLineSupported(Line.Info info) { + public final boolean isLineSupported(Line.Info info) { int i; @@ -227,7 +222,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { protected abstract void implClose(); - public Line[] getSourceLines() { + public final Line[] getSourceLines() { Line[] localLines; @@ -244,7 +239,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { } - public Line[] getTargetLines() { + public final Line[] getTargetLines() { Line[] localLines; @@ -264,7 +259,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Default implementation always throws an exception. */ - public void synchronize(Line[] lines, boolean maintainSync) { + public final void synchronize(Line[] lines, boolean maintainSync) { throw new IllegalArgumentException("Synchronization not supported by this mixer."); } @@ -272,7 +267,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Default implementation always throws an exception. */ - public void unsynchronize(Line[] lines) { + public final void unsynchronize(Line[] lines) { throw new IllegalArgumentException("Synchronization not supported by this mixer."); } @@ -280,7 +275,8 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Default implementation always returns false. */ - public boolean isSynchronizationSupported(Line[] lines, boolean maintainSync) { + public final boolean isSynchronizationSupported(Line[] lines, + boolean maintainSync) { return false; } @@ -290,14 +286,14 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * This implementation tries to open the mixer with its current format and buffer size settings. */ - public synchronized void open() throws LineUnavailableException { + public final synchronized void open() throws LineUnavailableException { open(true); } /** * This implementation tries to open the mixer with its current format and buffer size settings. */ - protected synchronized void open(boolean manual) throws LineUnavailableException { + final synchronized void open(boolean manual) throws LineUnavailableException { if (Printer.trace) Printer.trace(">> AbstractMixer: open()"); if (!isOpen()) { implOpen(); @@ -322,7 +318,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { * The mixer may be opened at a format different than the line's * format if it is a DataLine. */ - protected synchronized void open(Line line) throws LineUnavailableException { + final synchronized void open(Line line) throws LineUnavailableException { if (Printer.trace) Printer.trace(">> AbstractMixer: open(line = " + line + ")"); @@ -367,7 +363,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { * open target lines, if it exists in either. * If the list is now empty, closes the mixer. */ - protected synchronized void close(Line line) { + final synchronized void close(Line line) { if (Printer.trace) Printer.trace(">> AbstractMixer: close(" + line + ")"); @@ -396,7 +392,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Close all lines and then close this mixer. */ - public synchronized void close() { + public final synchronized void close() { if (Printer.trace) Printer.trace(">> AbstractMixer: close()"); if (isOpen()) { // close all source lines @@ -423,7 +419,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Starts the mixer. */ - protected synchronized void start(Line line) { + final synchronized void start(Line line) { if (Printer.trace) Printer.trace(">> AbstractMixer: start(" + line + ")"); @@ -447,7 +443,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { /** * Stops the mixer if this was the last running line. */ - protected synchronized void stop(Line line) { + final synchronized void stop(Line line) { if (Printer.trace) Printer.trace(">> AbstractMixer: stop(" + line + ")"); @@ -501,7 +497,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { * Right now this just checks whether it's supported, but should * check whether it actually belongs to this mixer.... */ - boolean isSourceLine(Line.Info info) { + final boolean isSourceLine(Line.Info info) { for (int i = 0; i < sourceLineInfo.length; i++) { if (info.matches(sourceLineInfo[i])) { @@ -518,7 +514,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { * Right now this just checks whether it's supported, but should * check whether it actually belongs to this mixer.... */ - boolean isTargetLine(Line.Info info) { + final boolean isTargetLine(Line.Info info) { for (int i = 0; i < targetLineInfo.length; i++) { if (info.matches(targetLineInfo[i])) { @@ -535,7 +531,7 @@ abstract class AbstractMixer extends AbstractLine implements Mixer { * matches the one specified, or null if no matching Line.Info * object is found. */ - Line.Info getLineInfo(Line.Info info) { + final Line.Info getLineInfo(Line.Info info) { if (info == null) { return null; } diff --git a/jdk/src/share/classes/com/sun/media/sound/AiffFileFormat.java b/jdk/src/share/classes/com/sun/media/sound/AiffFileFormat.java index c632b79389e..8d5e7f07468 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AiffFileFormat.java +++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import javax.sound.sampled.AudioFormat; * @author Jan Borgersen */ -class AiffFileFormat extends AudioFileFormat { +final class AiffFileFormat extends AudioFileFormat { static final int AIFF_MAGIC = 1179603533; @@ -62,13 +62,13 @@ class AiffFileFormat extends AudioFileFormat { //$$fb 2001-07-13: added management of header size in this class /** header size in bytes */ - private int headerSize=AIFF_HEADERSIZE; + private final int headerSize=AIFF_HEADERSIZE; /** comm chunk size in bytes, inclusive magic and length field */ - private int commChunkSize=26; + private final int commChunkSize=26; /** FVER chunk size in bytes, inclusive magic and length field */ - private int fverChunkSize=0; + private final int fverChunkSize=0; AiffFileFormat( AudioFileFormat aff ) { this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() ); diff --git a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java index dd480aa8d3d..93d425e862c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,28 +25,17 @@ package com.sun.media.sound; -import java.util.Vector; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.io.EOFException; -import java.net.URL; -import java.net.MalformedURLException; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.DataInputStream; -import java.io.FileInputStream; import java.io.DataOutputStream; -import java.io.FileOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.SequenceInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; @@ -58,19 +47,10 @@ import javax.sound.sampled.UnsupportedAudioFileException; * @author Jan Borgersen * @author Florian Bomers */ -public class AiffFileReader extends SunFileReader { +public final class AiffFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 8; - - /** - * AIFF parser type - */ - public static final AudioFileFormat.Type types[] = { - AudioFileFormat.Type.AIFF - }; - - /** * Constructs a new AiffParser object. */ diff --git a/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java index 1bce488d4ed..0f79728291e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,21 +50,13 @@ import javax.sound.sampled.AudioSystem; * * @author Jan Borgersen */ -public class AiffFileWriter extends SunFileWriter { - - /** - * AIFF type - */ - private static final AudioFileFormat.Type aiffTypes[] = { - AudioFileFormat.Type.AIFF - }; - +public final class AiffFileWriter extends SunFileWriter { /** * Constructs a new AiffFileWriter object. */ public AiffFileWriter() { - super(aiffTypes); + super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AIFF}); } diff --git a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java index bece256bc41..dc868b0b2cb 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,12 @@ package com.sun.media.sound; -import java.io.InputStream; import java.io.IOException; - import java.util.Vector; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; /** @@ -40,12 +38,12 @@ import javax.sound.sampled.AudioInputStream; * * @author Kara Kytle */ -public class AlawCodec extends SunCodec { +public final class AlawCodec extends SunCodec { /* Tables used for A-law decoding */ - final static byte ALAW_TABH[] = new byte[256]; - final static byte ALAW_TABL[] = new byte[256]; + private static final byte[] ALAW_TABH = new byte[256]; + private static final byte[] ALAW_TABL = new byte[256]; private static final AudioFormat.Encoding[] alawEncodings = { AudioFormat.Encoding.ALAW, AudioFormat.Encoding.PCM_SIGNED }; @@ -256,7 +254,7 @@ public class AlawCodec extends SunCodec { } - class AlawCodecStream extends AudioInputStream { + final class AlawCodecStream extends AudioInputStream { // tempBuffer required only for encoding (when encode is true) private static final int tempBufferSize = 64; diff --git a/jdk/src/share/classes/com/sun/media/sound/AuFileFormat.java b/jdk/src/share/classes/com/sun/media/sound/AuFileFormat.java index 3beb517556a..185efb9e6b0 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AuFileFormat.java +++ b/jdk/src/share/classes/com/sun/media/sound/AuFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ import javax.sound.sampled.AudioFormat; * @author Jan Borgersen */ -class AuFileFormat extends AudioFileFormat { +final class AuFileFormat extends AudioFileFormat { // magic numbers static final int AU_SUN_MAGIC = 0x2e736e64; @@ -60,7 +60,7 @@ class AuFileFormat extends AudioFileFormat { static final int AU_HEADERSIZE = 24; - int auType; + private int auType; AuFileFormat( AudioFileFormat aff ) { diff --git a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java index 119ba6fbb0a..d755d516efd 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,28 +25,17 @@ package com.sun.media.sound; -import java.util.Vector; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.io.EOFException; -import java.net.URL; -import java.net.MalformedURLException; - import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.DataInputStream; +import java.io.File; import java.io.FileInputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.SequenceInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; @@ -58,16 +47,7 @@ import javax.sound.sampled.UnsupportedAudioFileException; * @author Jan Borgersen * @author Florian Bomers */ -public class AuFileReader extends SunFileReader { - - /** - * AU reader type - */ - - public static final AudioFileFormat.Type types[] = { - AudioFileFormat.Type.AU - }; - +public final class AuFileReader extends SunFileReader { /** * Constructs a new AuFileReader object. diff --git a/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java index 6d89d84bff0..15a7a90decf 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,28 +49,18 @@ import javax.sound.sampled.AudioSystem; * * @author Jan Borgersen */ -public class AuFileWriter extends SunFileWriter { +public final class AuFileWriter extends SunFileWriter { //$$fb value for length field if length is not known public final static int UNKNOWN_SIZE=-1; - /** - * AU type - */ - private static final AudioFileFormat.Type auTypes[] = { - AudioFileFormat.Type.AU - }; - - /** * Constructs a new AuFileWriter object. */ public AuFileWriter() { - super(auTypes); + super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AU}); } - - public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java index b3ef6d82fc7..11b0fa6ee6e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ import javax.sound.sampled.UnsupportedAudioFileException; * * @author Karl Helgason */ -public class AudioFileSoundbankReader extends SoundbankReader { +public final class AudioFileSoundbankReader extends SoundbankReader { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java b/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java index 95068ed6126..9b850e03ad3 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public abstract class AudioFloatConverter { private static class AudioFloatLSBFilter extends AudioFloatConverter { - private AudioFloatConverter converter; + private final AudioFloatConverter converter; final private int offset; @@ -61,8 +61,7 @@ public abstract class AudioFloatConverter { private byte[] mask_buffer; - public AudioFloatLSBFilter(AudioFloatConverter converter, - AudioFormat format) { + AudioFloatLSBFilter(AudioFloatConverter converter, AudioFormat format) { int bits = format.getSampleSizeInBits(); boolean bigEndian = format.isBigEndian(); this.converter = converter; @@ -740,7 +739,7 @@ public abstract class AudioFloatConverter { final int xbytes; - public AudioFloatConversion32xSL(int xbytes) { + AudioFloatConversion32xSL(int xbytes) { this.xbytes = xbytes; } @@ -781,7 +780,7 @@ public abstract class AudioFloatConverter { final int xbytes; - public AudioFloatConversion32xSB(int xbytes) { + AudioFloatConversion32xSB(int xbytes) { this.xbytes = xbytes; } @@ -823,7 +822,7 @@ public abstract class AudioFloatConverter { final int xbytes; - public AudioFloatConversion32xUL(int xbytes) { + AudioFloatConversion32xUL(int xbytes) { this.xbytes = xbytes; } @@ -866,7 +865,7 @@ public abstract class AudioFloatConverter { final int xbytes; - public AudioFloatConversion32xUB(int xbytes) { + AudioFloatConversion32xUB(int xbytes) { this.xbytes = xbytes; } @@ -1008,49 +1007,51 @@ public abstract class AudioFloatConverter { private AudioFormat format; - public AudioFormat getFormat() { + public final AudioFormat getFormat() { return format; } public abstract float[] toFloatArray(byte[] in_buff, int in_offset, float[] out_buff, int out_offset, int out_len); - public float[] toFloatArray(byte[] in_buff, float[] out_buff, + public final float[] toFloatArray(byte[] in_buff, float[] out_buff, int out_offset, int out_len) { return toFloatArray(in_buff, 0, out_buff, out_offset, out_len); } - public float[] toFloatArray(byte[] in_buff, int in_offset, + public final float[] toFloatArray(byte[] in_buff, int in_offset, float[] out_buff, int out_len) { return toFloatArray(in_buff, in_offset, out_buff, 0, out_len); } - public float[] toFloatArray(byte[] in_buff, float[] out_buff, int out_len) { + public final float[] toFloatArray(byte[] in_buff, float[] out_buff, + int out_len) { return toFloatArray(in_buff, 0, out_buff, 0, out_len); } - public float[] toFloatArray(byte[] in_buff, float[] out_buff) { + public final float[] toFloatArray(byte[] in_buff, float[] out_buff) { return toFloatArray(in_buff, 0, out_buff, 0, out_buff.length); } public abstract byte[] toByteArray(float[] in_buff, int in_offset, int in_len, byte[] out_buff, int out_offset); - public byte[] toByteArray(float[] in_buff, int in_len, byte[] out_buff, - int out_offset) { + public final byte[] toByteArray(float[] in_buff, int in_len, + byte[] out_buff, int out_offset) { return toByteArray(in_buff, 0, in_len, out_buff, out_offset); } - public byte[] toByteArray(float[] in_buff, int in_offset, int in_len, - byte[] out_buff) { + public final byte[] toByteArray(float[] in_buff, int in_offset, int in_len, + byte[] out_buff) { return toByteArray(in_buff, in_offset, in_len, out_buff, 0); } - public byte[] toByteArray(float[] in_buff, int in_len, byte[] out_buff) { + public final byte[] toByteArray(float[] in_buff, int in_len, + byte[] out_buff) { return toByteArray(in_buff, 0, in_len, out_buff, 0); } - public byte[] toByteArray(float[] in_buff, byte[] out_buff) { + public final byte[] toByteArray(float[] in_buff, byte[] out_buff) { return toByteArray(in_buff, 0, in_buff.length, out_buff, 0); } } diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java b/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java index 0b73dca0666..a161fc5db42 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,19 +42,19 @@ import javax.sound.sampled.spi.FormatConversionProvider; * * @author Karl Helgason */ -public class AudioFloatFormatConverter extends FormatConversionProvider { +public final class AudioFloatFormatConverter extends FormatConversionProvider { private static class AudioFloatFormatConverterInputStream extends InputStream { - private AudioFloatConverter converter; + private final AudioFloatConverter converter; - private AudioFloatInputStream stream; + private final AudioFloatInputStream stream; private float[] readfloatbuffer; - private int fsize = 0; + private final int fsize; - public AudioFloatFormatConverterInputStream(AudioFormat targetFormat, + AudioFloatFormatConverterInputStream(AudioFormat targetFormat, AudioFloatInputStream stream) { this.stream = stream; converter = AudioFloatConverter.getConverter(targetFormat); @@ -116,17 +116,17 @@ public class AudioFloatFormatConverter extends FormatConversionProvider { private static class AudioFloatInputStreamChannelMixer extends AudioFloatInputStream { - private int targetChannels; + private final int targetChannels; - private int sourceChannels; + private final int sourceChannels; - private AudioFloatInputStream ais; + private final AudioFloatInputStream ais; - private AudioFormat targetFormat; + private final AudioFormat targetFormat; private float[] conversion_buffer; - public AudioFloatInputStreamChannelMixer(AudioFloatInputStream ais, + AudioFloatInputStreamChannelMixer(AudioFloatInputStream ais, int targetChannels) { this.sourceChannels = ais.getFormat().getChannels(); this.targetChannels = targetChannels; @@ -226,37 +226,37 @@ public class AudioFloatFormatConverter extends FormatConversionProvider { private static class AudioFloatInputStreamResampler extends AudioFloatInputStream { - private AudioFloatInputStream ais; + private final AudioFloatInputStream ais; - private AudioFormat targetFormat; + private final AudioFormat targetFormat; private float[] skipbuffer; private SoftAbstractResampler resampler; - private float[] pitch = new float[1]; + private final float[] pitch = new float[1]; - private float[] ibuffer2; + private final float[] ibuffer2; - private float[][] ibuffer; + private final float[][] ibuffer; private float ibuffer_index = 0; private int ibuffer_len = 0; - private int nrofchannels = 0; + private final int nrofchannels; private float[][] cbuffer; - private int buffer_len = 512; + private final int buffer_len = 512; - private int pad; + private final int pad; - private int pad2; + private final int pad2; - private float[] ix = new float[1]; + private final float[] ix = new float[1]; - private int[] ox = new int[1]; + private final int[] ox = new int[1]; private float[][] mark_ibuffer = null; @@ -264,7 +264,7 @@ public class AudioFloatFormatConverter extends FormatConversionProvider { private int mark_ibuffer_len = 0; - public AudioFloatInputStreamResampler(AudioFloatInputStream ais, + AudioFloatInputStreamResampler(AudioFloatInputStream ais, AudioFormat format) { this.ais = ais; AudioFormat sourceFormat = ais.getFormat(); @@ -468,8 +468,9 @@ public class AudioFloatFormatConverter extends FormatConversionProvider { } - private Encoding[] formats = { Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED, - Encoding.PCM_FLOAT }; + private final Encoding[] formats = {Encoding.PCM_SIGNED, + Encoding.PCM_UNSIGNED, + Encoding.PCM_FLOAT}; public AudioInputStream getAudioInputStream(Encoding targetEncoding, AudioInputStream sourceStream) { diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioFloatInputStream.java b/jdk/src/share/classes/com/sun/media/sound/AudioFloatInputStream.java index 41f6d818dbc..a4fd10429c4 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioFloatInputStream.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioFloatInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,14 +48,14 @@ public abstract class AudioFloatInputStream { private int pos = 0; private int markpos = 0; - private AudioFloatConverter converter; - private AudioFormat format; - private byte[] buffer; - private int buffer_offset; - private int buffer_len; - private int framesize_pc; + private final AudioFloatConverter converter; + private final AudioFormat format; + private final byte[] buffer; + private final int buffer_offset; + private final int buffer_len; + private final int framesize_pc; - public BytaArrayAudioFloatInputStream(AudioFloatConverter converter, + BytaArrayAudioFloatInputStream(AudioFloatConverter converter, byte[] buffer, int offset, int len) { this.converter = converter; this.format = converter.getFormat(); @@ -125,12 +125,12 @@ public abstract class AudioFloatInputStream { private static class DirectAudioFloatInputStream extends AudioFloatInputStream { - private AudioInputStream stream; + private final AudioInputStream stream; private AudioFloatConverter converter; - private int framesize_pc; // framesize / channels + private final int framesize_pc; // framesize / channels private byte[] buffer; - public DirectAudioFloatInputStream(AudioInputStream stream) { + DirectAudioFloatInputStream(AudioInputStream stream) { converter = AudioFloatConverter.getConverter(stream.getFormat()); if (converter == null) { AudioFormat format = stream.getFormat(); @@ -255,11 +255,11 @@ public abstract class AudioFloatInputStream { public abstract int read(float[] b, int off, int len) throws IOException; - public int read(float[] b) throws IOException { + public final int read(float[] b) throws IOException { return read(b, 0, b.length); } - public float read() throws IOException { + public final float read() throws IOException { float[] b = new float[1]; int ret = read(b, 0, 1); if (ret == -1 || ret == 0) diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index baa04f082a4..9a3ef9970ca 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class AudioSynthesizerPropertyInfo { +public final class AudioSynthesizerPropertyInfo { /** * Constructs a AudioSynthesizerPropertyInfo object with a given diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSInfo.java b/jdk/src/share/classes/com/sun/media/sound/DLSInfo.java index 9ea567c4fdc..708bf4b04ca 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSInfo.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class DLSInfo { +public final class DLSInfo { /** * (INAM) Title or subject. diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSInstrument.java b/jdk/src/share/classes/com/sun/media/sound/DLSInstrument.java index fe9fde7fefe..c7e6188a25c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSInstrument.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,15 +40,15 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class DLSInstrument extends ModelInstrument { +public final class DLSInstrument extends ModelInstrument { - protected int preset = 0; - protected int bank = 0; - protected boolean druminstrument = false; - protected byte[] guid = null; - protected DLSInfo info = new DLSInfo(); - protected List regions = new ArrayList(); - protected List modulators = new ArrayList(); + int preset = 0; + int bank = 0; + boolean druminstrument = false; + byte[] guid = null; + DLSInfo info = new DLSInfo(); + List regions = new ArrayList(); + List modulators = new ArrayList(); public DLSInstrument() { super(null, null, null, null); diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSModulator.java b/jdk/src/share/classes/com/sun/media/sound/DLSModulator.java index 11b0da628cb..4cfa7d42a13 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSModulator.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSModulator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class DLSModulator { +public final class DLSModulator { // DLS1 Destinations public static final int CONN_DST_NONE = 0x000; // 0 @@ -102,12 +102,12 @@ public class DLSModulator { public static final int DST_FORMAT_CENT = 1; public static final int DST_FORMAT_TIMECENT = 2; public static final int DST_FORMAT_PERCENT = 3; - protected int source; - protected int control; - protected int destination; - protected int transform; - protected int scale; - protected int version = 1; + int source; + int control; + int destination; + int transform; + int scale; + int version = 1; public int getControl() { return control; diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSRegion.java b/jdk/src/share/classes/com/sun/media/sound/DLSRegion.java index 254bebef539..3ef1e845c87 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSRegion.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,21 +36,21 @@ import java.util.List; * * @author Karl Helgason */ -public class DLSRegion { +public final class DLSRegion { public final static int OPTION_SELFNONEXCLUSIVE = 0x0001; - protected List modulators = new ArrayList(); - protected int keyfrom; - protected int keyto; - protected int velfrom; - protected int velto; - protected int options; - protected int exclusiveClass; - protected int fusoptions; - protected int phasegroup; - protected long channel; - protected DLSSample sample = null; - protected DLSSampleOptions sampleoptions; + List modulators = new ArrayList(); + int keyfrom; + int keyto; + int velfrom; + int velto; + int options; + int exclusiveClass; + int fusoptions; + int phasegroup; + long channel; + DLSSample sample = null; + DLSSampleOptions sampleoptions; public List getModulators() { return modulators; diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSample.java b/jdk/src/share/classes/com/sun/media/sound/DLSSample.java index 28327e68f6c..047783dfdab 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSSample.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSSample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,13 +40,13 @@ import javax.sound.sampled.AudioInputStream; * * @author Karl Helgason */ -public class DLSSample extends SoundbankResource { +public final class DLSSample extends SoundbankResource { - protected byte[] guid = null; - protected DLSInfo info = new DLSInfo(); - protected DLSSampleOptions sampleoptions; - protected ModelByteBuffer data; - protected AudioFormat format; + byte[] guid = null; + DLSInfo info = new DLSInfo(); + DLSSampleOptions sampleoptions; + ModelByteBuffer data; + AudioFormat format; public DLSSample(Soundbank soundBank) { super(soundBank, null, AudioInputStream.class); diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSampleLoop.java b/jdk/src/share/classes/com/sun/media/sound/DLSSampleLoop.java index f78d7c14ffd..091e38385dd 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSSampleLoop.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSSampleLoop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,13 +29,13 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class DLSSampleLoop { +public final class DLSSampleLoop { public final static int LOOP_TYPE_FORWARD = 0; public final static int LOOP_TYPE_RELEASE = 1; - protected long type; - protected long start; - protected long length; + long type; + long start; + long length; public long getLength() { return length; diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSampleOptions.java b/jdk/src/share/classes/com/sun/media/sound/DLSSampleOptions.java index b2e1b9b3adc..059f318f414 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSSampleOptions.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSSampleOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,13 +34,13 @@ import java.util.List; * * @author Karl Helgason */ -public class DLSSampleOptions { +public final class DLSSampleOptions { - protected int unitynote; - protected short finetune; - protected int attenuation; - protected long options; - protected List loops = new ArrayList(); + int unitynote; + short finetune; + int attenuation; + long options; + List loops = new ArrayList(); public int getAttenuation() { return attenuation; diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java index 2b490dd6061..87247ba686a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ import javax.sound.sampled.AudioFormat.Encoding; * * @author Karl Helgason */ -public class DLSSoundbank implements Soundbank { +public final class DLSSoundbank implements Soundbank { static private class DLSID { long i1; @@ -69,7 +69,7 @@ public class DLSSoundbank implements Soundbank { private DLSID() { } - public DLSID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, + DLSID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) { this.i1 = i1; this.s1 = s1; @@ -174,10 +174,10 @@ public class DLSSoundbank implements Soundbank { private long major = -1; private long minor = -1; - private DLSInfo info = new DLSInfo(); + private final DLSInfo info = new DLSInfo(); - private List instruments = new ArrayList(); - private List samples = new ArrayList(); + private final List instruments = new ArrayList(); + private final List samples = new ArrayList(); private boolean largeFormat = false; private File sampleFile; diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java index 0f51aad0ba1..0bba5d49532 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import javax.sound.midi.spi.SoundbankReader; * * @author Karl Helgason */ -public class DLSSoundbankReader extends SoundbankReader { +public final class DLSSoundbankReader extends SoundbankReader { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { diff --git a/jdk/src/share/classes/com/sun/media/sound/DataPusher.java b/jdk/src/share/classes/com/sun/media/sound/DataPusher.java index 2d4802521af..814a0150ba7 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DataPusher.java +++ b/jdk/src/share/classes/com/sun/media/sound/DataPusher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,13 +37,13 @@ import javax.sound.sampled.*; * @author Florian Bomers */ -public class DataPusher implements Runnable { +public final class DataPusher implements Runnable { private static final int AUTO_CLOSE_TIME = 5000; private static final boolean DEBUG = false; - private SourceDataLine source = null; - private AudioFormat format = null; + private final SourceDataLine source; + private final AudioFormat format; // stream as source data private AudioInputStream ais = null; diff --git a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java index 7b5e5339e36..d6556f65f80 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import javax.sound.sampled.*; * * @author Florian Bomers */ -class DirectAudioDevice extends AbstractMixer { +final class DirectAudioDevice extends AbstractMixer { // CONSTANTS private static final int CLIP_BUFFER_TIME = 1000; // in milliseconds @@ -335,8 +335,8 @@ class DirectAudioDevice extends AbstractMixer { * but isFormatSupported() also returns true * for formats with wrong endianness. */ - private static class DirectDLI extends DataLine.Info { - AudioFormat[] hardwareFormats; + private static final class DirectDLI extends DataLine.Info { + final AudioFormat[] hardwareFormats; private DirectDLI(Class clazz, AudioFormat[] formatArray, AudioFormat[] hardwareFormatArray, @@ -370,12 +370,12 @@ class DirectAudioDevice extends AbstractMixer { * Private inner class as base class for direct lines */ private static class DirectDL extends AbstractDataLine implements EventDispatcher.LineMonitor { - protected int mixerIndex; - protected int deviceID; + protected final int mixerIndex; + protected final int deviceID; protected long id; protected int waitTime; protected volatile boolean flushing = false; - protected boolean isSource; // true for SourceDataLine, false for TargetDataLine + protected final boolean isSource; // true for SourceDataLine, false for TargetDataLine protected volatile long bytePosition; protected volatile boolean doIO = false; // true in between start() and stop() calls protected volatile boolean stoppedWritten = false; // true if a write occured in stopped state @@ -387,10 +387,10 @@ class DirectAudioDevice extends AbstractMixer { protected int softwareConversionSize = 0; protected AudioFormat hardwareFormat; - private Gain gainControl = new Gain(); - private Mute muteControl = new Mute(); - private Balance balanceControl = new Balance(); - private Pan panControl = new Pan(); + private final Gain gainControl = new Gain(); + private final Mute muteControl = new Mute(); + private final Balance balanceControl = new Balance(); + private final Pan panControl = new Pan(); private float leftGain, rightGain; protected volatile boolean noService = false; // do not run the nService method @@ -829,7 +829,7 @@ class DirectAudioDevice extends AbstractMixer { /////////////////// CONTROLS ///////////////////////////// - protected class Gain extends FloatControl { + protected final class Gain extends FloatControl { private float linearGain = 1.0f; @@ -862,7 +862,7 @@ class DirectAudioDevice extends AbstractMixer { } // class Gain - private class Mute extends BooleanControl { + private final class Mute extends BooleanControl { private Mute() { super(BooleanControl.Type.MUTE, false, "True", "False"); @@ -874,7 +874,7 @@ class DirectAudioDevice extends AbstractMixer { } } // class Mute - private class Balance extends FloatControl { + private final class Balance extends FloatControl { private Balance() { super(FloatControl.Type.BALANCE, -1.0f, 1.0f, (1.0f / 128.0f), -1, 0.0f, @@ -893,7 +893,7 @@ class DirectAudioDevice extends AbstractMixer { } // class Balance - private class Pan extends FloatControl { + private final class Pan extends FloatControl { private Pan() { super(FloatControl.Type.PAN, -1.0f, 1.0f, (1.0f / 128.0f), -1, 0.0f, @@ -918,7 +918,8 @@ class DirectAudioDevice extends AbstractMixer { /** * Private inner class representing a SourceDataLine */ - private static class DirectSDL extends DirectDL implements SourceDataLine { + private static final class DirectSDL extends DirectDL + implements SourceDataLine { // CONSTRUCTOR private DirectSDL(DataLine.Info info, @@ -934,7 +935,8 @@ class DirectAudioDevice extends AbstractMixer { /** * Private inner class representing a TargetDataLine */ - private static class DirectTDL extends DirectDL implements TargetDataLine { + private static final class DirectTDL extends DirectDL + implements TargetDataLine { // CONSTRUCTOR private DirectTDL(DataLine.Info info, @@ -1012,7 +1014,9 @@ class DirectAudioDevice extends AbstractMixer { * Private inner class representing a Clip * This clip is realized in software only */ - private static class DirectClip extends DirectDL implements Clip, Runnable, AutoClosingClip { + private static final class DirectClip extends DirectDL + implements Clip, Runnable, AutoClosingClip { + private Thread thread; private byte[] audioData = null; private int frameSize; // size of one frame in bytes @@ -1045,7 +1049,7 @@ class DirectAudioDevice extends AbstractMixer { byte[] newData = new byte[bufferSize]; System.arraycopy(data, offset, newData, 0, bufferSize); - open(format, data, bufferSize / format.getFrameSize()); + open(format, newData, bufferSize / format.getFrameSize()); } // this method does not copy the data array @@ -1443,7 +1447,7 @@ class DirectAudioDevice extends AbstractMixer { * which allows retrieval of the internal array */ private static class DirectBAOS extends ByteArrayOutputStream { - public DirectBAOS() { + DirectBAOS() { super(); } diff --git a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java index 2f51ac44c09..c306dc78c66 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDeviceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package com.sun.media.sound; -import java.util.Vector; - import javax.sound.sampled.Mixer; import javax.sound.sampled.spi.MixerProvider; @@ -36,7 +34,7 @@ import javax.sound.sampled.spi.MixerProvider; * * @author Florian Bomers */ -public class DirectAudioDeviceProvider extends MixerProvider { +public final class DirectAudioDeviceProvider extends MixerProvider { // STATIC VARIABLES @@ -66,16 +64,17 @@ public class DirectAudioDeviceProvider extends MixerProvider { * Required public no-arg constructor. */ public DirectAudioDeviceProvider() { - //if (Printer.trace) Printer.trace("DirectAudioDeviceProvider: constructor"); - if (Platform.isDirectAudioEnabled()) { - init(); - } else { - infos = new DirectAudioDeviceInfo[0]; - devices = new DirectAudioDevice[0]; + synchronized (DirectAudioDeviceProvider.class) { + if (Platform.isDirectAudioEnabled()) { + init(); + } else { + infos = new DirectAudioDeviceInfo[0]; + devices = new DirectAudioDevice[0]; + } } } - private synchronized static void init() { + private static void init() { // get the number of input devices int numDevices = nGetNumDevices(); @@ -94,36 +93,39 @@ public class DirectAudioDeviceProvider extends MixerProvider { } public Mixer.Info[] getMixerInfo() { - Mixer.Info[] localArray = new Mixer.Info[infos.length]; - System.arraycopy(infos, 0, localArray, 0, infos.length); - return localArray; + synchronized (DirectAudioDeviceProvider.class) { + Mixer.Info[] localArray = new Mixer.Info[infos.length]; + System.arraycopy(infos, 0, localArray, 0, infos.length); + return localArray; + } } public Mixer getMixer(Mixer.Info info) { - // if the default device is asked, we provide the mixer - // with SourceDataLine's - if (info == null) { + synchronized (DirectAudioDeviceProvider.class) { + // if the default device is asked, we provide the mixer + // with SourceDataLine's + if (info == null) { + for (int i = 0; i < infos.length; i++) { + Mixer mixer = getDevice(infos[i]); + if (mixer.getSourceLineInfo().length > 0) { + return mixer; + } + } + } + // otherwise get the first mixer that matches + // the requested info object for (int i = 0; i < infos.length; i++) { - Mixer mixer = getDevice(infos[i]); - if (mixer.getSourceLineInfo().length > 0) { - return mixer; + if (infos[i].equals(info)) { + return getDevice(infos[i]); } } } - // otherwise get the first mixer that matches - // the requested info object - for (int i = 0; i < infos.length; i++) { - if (infos[i].equals(info)) { - return getDevice(infos[i]); - } - } - throw new IllegalArgumentException("Mixer " + info.toString() + " not supported by this provider."); } - private Mixer getDevice(DirectAudioDeviceInfo info) { + private static Mixer getDevice(DirectAudioDeviceInfo info) { int index = info.getIndex(); if (devices[index] == null) { devices[index] = new DirectAudioDevice(info); @@ -139,12 +141,12 @@ public class DirectAudioDeviceProvider extends MixerProvider { * making native references to a particular device. * This constructor is called from native. */ - static class DirectAudioDeviceInfo extends Mixer.Info { - private int index; - private int maxSimulLines; + static final class DirectAudioDeviceInfo extends Mixer.Info { + private final int index; + private final int maxSimulLines; // For ALSA, the deviceID contains the encoded card index, device index, and sub-device-index - private int deviceID; + private final int deviceID; private DirectAudioDeviceInfo(int index, int deviceID, int maxSimulLines, String name, String vendor, diff --git a/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java b/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java index 5271782d094..587d3ff7ebe 100644 --- a/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java +++ b/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import javax.sound.sampled.AudioFormat; * * @author Karl Helgason */ -public class EmergencySoundbank { +public final class EmergencySoundbank { private final static String[] general_midi_instruments = { "Acoustic Grand Piano", diff --git a/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java b/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java index e6d1401b946..54b948af168 100644 --- a/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java +++ b/jdk/src/share/classes/com/sun/media/sound/EventDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,19 +25,15 @@ package com.sun.media.sound; -import java.util.EventObject; import java.util.ArrayList; import java.util.List; -import javax.sound.sampled.Clip; -import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; -import javax.sound.sampled.LineListener; - +import javax.sound.midi.ControllerEventListener; +import javax.sound.midi.MetaEventListener; import javax.sound.midi.MetaMessage; import javax.sound.midi.ShortMessage; -import javax.sound.midi.MetaEventListener; -import javax.sound.midi.ControllerEventListener; +import javax.sound.sampled.LineEvent; +import javax.sound.sampled.LineListener; @@ -49,7 +45,7 @@ import javax.sound.midi.ControllerEventListener; * @author Kara Kytle * @author Florian Bomers */ -class EventDispatcher implements Runnable { +final class EventDispatcher implements Runnable { /** * time of inactivity until the auto closing clips @@ -61,7 +57,7 @@ class EventDispatcher implements Runnable { /** * List of events */ - private ArrayList eventQueue = new ArrayList(); + private final ArrayList eventQueue = new ArrayList(); /** @@ -73,12 +69,12 @@ class EventDispatcher implements Runnable { /* * support for auto-closing Clips */ - private ArrayList autoClosingClips = new ArrayList(); + private final ArrayList autoClosingClips = new ArrayList(); /* * support for monitoring data lines */ - private ArrayList lineMonitors = new ArrayList(); + private final ArrayList lineMonitors = new ArrayList(); /** * Approximate interval between calls to LineMonitor.checkLine @@ -105,7 +101,7 @@ class EventDispatcher implements Runnable { * Invoked when there is at least one event in the queue. * Implement this as a callback to process one event. */ - protected void processEvent(EventInfo eventInfo) { + void processEvent(EventInfo eventInfo) { int count = eventInfo.getListenerCount(); // process an LineEvent @@ -166,7 +162,7 @@ class EventDispatcher implements Runnable { * exclusive access over the code where an event is removed from the *queue. */ - protected void dispatchEvents() { + void dispatchEvents() { EventInfo eventInfo = null; @@ -388,8 +384,8 @@ class EventDispatcher implements Runnable { */ private class EventInfo { - private Object event; - private Object[] listeners; + private final Object event; + private final Object[] listeners; /** * Create a new instance of this event Info class @@ -421,8 +417,8 @@ class EventDispatcher implements Runnable { */ private class ClipInfo { - private AutoClosingClip clip; - private long expiration; + private final AutoClosingClip clip; + private final long expiration; /** * Create a new instance of this clip Info class diff --git a/jdk/src/share/classes/com/sun/media/sound/FFT.java b/jdk/src/share/classes/com/sun/media/sound/FFT.java index f9e56b6a20f..b378c8cc65d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/FFT.java +++ b/jdk/src/share/classes/com/sun/media/sound/FFT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,11 +31,11 @@ package com.sun.media.sound; */ public final class FFT { - private double[] w; - private int fftFrameSize; - private int sign; - private int[] bitm_array; - private int fftFrameSize2; + private final double[] w; + private final int fftFrameSize; + private final int sign; + private final int[] bitm_array; + private final int fftFrameSize2; // Sign = -1 is FFT, 1 is IFFT (inverse FFT) // Data = Interlaced double array to be transformed. diff --git a/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java b/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java index 39f85da154c..54307f238a4 100644 --- a/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java +++ b/jdk/src/share/classes/com/sun/media/sound/FastShortMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,13 +35,13 @@ import javax.sound.midi.*; final class FastShortMessage extends ShortMessage { private int packedMsg; - public FastShortMessage(int packedMsg) throws InvalidMidiDataException { + FastShortMessage(int packedMsg) throws InvalidMidiDataException { this.packedMsg = packedMsg; getDataLength(packedMsg & 0xFF); // to check for validity } /** Creates a FastShortMessage from this ShortMessage */ - public FastShortMessage(ShortMessage msg) { + FastShortMessage(ShortMessage msg) { this.packedMsg = msg.getStatus() | (msg.getData1() << 8) | (msg.getData2() << 16); diff --git a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java index 9c369a62706..32fc90ffbb7 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,14 +36,16 @@ import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.Soundbank; import javax.sound.midi.spi.SoundbankReader; +import sun.reflect.misc.ReflectUtil; + /** - * JarSoundbankReader is used to read sounbank object from jar files. + * JarSoundbankReader is used to read soundbank object from jar files. * * @author Karl Helgason */ -public class JARSoundbankReader extends SoundbankReader { +public final class JARSoundbankReader extends SoundbankReader { - public boolean isZIP(URL url) { + private static boolean isZIP(URL url) { boolean ok = false; try { InputStream stream = url.openStream(); @@ -81,14 +83,14 @@ public class JARSoundbankReader extends SoundbankReader { while (line != null) { if (!line.startsWith("#")) { try { - Class c = Class.forName(line.trim(), true, ucl); - Object o = c.newInstance(); - if (o instanceof Soundbank) { + Class c = Class.forName(line.trim(), false, ucl); + if (Soundbank.class.isAssignableFrom(c)) { + Object o = ReflectUtil.newInstance(c); soundbanks.add((Soundbank) o); } - } catch (ClassNotFoundException e) { - } catch (InstantiationException e) { - } catch (IllegalAccessException e) { + } catch (ClassNotFoundException ignored) { + } catch (InstantiationException ignored) { + } catch (IllegalAccessException ignored) { } } line = r.readLine(); diff --git a/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java b/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java index f11b5e3e26f..85b1de618d6 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java +++ b/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,16 +31,6 @@ import java.util.List; import java.util.Map; import java.util.Properties; -import javax.sound.sampled.spi.AudioFileReader; -import javax.sound.sampled.spi.AudioFileWriter; -import javax.sound.sampled.spi.FormatConversionProvider; -import javax.sound.sampled.spi.MixerProvider; - -import javax.sound.midi.spi.MidiFileReader; -import javax.sound.midi.spi.MidiFileWriter; -import javax.sound.midi.spi.SoundbankReader; -import javax.sound.midi.spi.MidiDeviceProvider; - import javax.sound.midi.Receiver; import javax.sound.midi.Sequencer; import javax.sound.midi.Synthesizer; @@ -62,7 +52,7 @@ import javax.sound.sampled.TargetDataLine; * * @author Matthias Pfisterer */ -public class JDK13Services { +public final class JDK13Services { /** The default for the length of the period to hold the cache. This value is given in milliseconds. It is equivalent to @@ -80,7 +70,7 @@ public class JDK13Services { Class objects of the provider type (MixerProvider, MidiDeviceProvider ...) are used as keys. The values are instances of ProviderCache. */ - private static Map providersCacheMap = new HashMap(); + private static final Map providersCacheMap = new HashMap(); /** The length of the period to hold the cache. diff --git a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java index 8e7928dbe65..280e92aec68 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java +++ b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ import javax.sound.sampled.AudioPermission; * * @author Matthias Pfisterer */ -class JSSecurityManager { +final class JSSecurityManager { /** Prevent instantiation. */ @@ -73,30 +73,6 @@ class JSSecurityManager { } } - - static void loadLibrary(final String libName) { - try { - if (hasSecurityManager()) { - if(Printer.debug) Printer.debug("using security manager to load library"); - PrivilegedAction action = new PrivilegedAction() { - public Void run() { - System.loadLibrary(libName); - return null; - } - }; - AccessController.doPrivileged(action); - } else { - if(Printer.debug) Printer.debug("not using security manager to load library"); - System.loadLibrary(libName); - } - if (Printer.debug) Printer.debug("loaded library " + libName); - } catch (UnsatisfiedLinkError e2) { - if (Printer.err)Printer.err("UnsatisfiedLinkError loading native library " + libName); - throw(e2); - } - } - - static String getProperty(final String propertyName) { String propertyValue; if (hasSecurityManager()) { @@ -189,83 +165,13 @@ class JSSecurityManager { if(Printer.trace)Printer.trace("<< JSSecurityManager: loadPropertiesImpl() completed"); } - - private static ThreadGroup getTopmostThreadGroup() { - ThreadGroup topmostThreadGroup; - if(hasSecurityManager()) { - try { - // invoke the privileged action using 1.2 security - PrivilegedAction action = new PrivilegedAction() { - public ThreadGroup run() { - try { - return getTopmostThreadGroupImpl(); - } catch (Throwable t) { - return null; - } - } - }; - topmostThreadGroup = AccessController.doPrivileged(action); - if(Printer.debug)Printer.debug("Got topmost thread group with JDK 1.2 security"); - } catch (Exception e) { - if(Printer.debug)Printer.debug("Exception getting topmost thread group with JDK 1.2 security"); - // try without using JDK 1.2 security - topmostThreadGroup = getTopmostThreadGroupImpl(); - } - } else { - // not JDK 1.2 security, assume we already have permission - topmostThreadGroup = getTopmostThreadGroupImpl(); - } - return topmostThreadGroup; - } - - - private static ThreadGroup getTopmostThreadGroupImpl() { - if(Printer.trace)Printer.trace(">> JSSecurityManager: getTopmostThreadGroupImpl()"); - ThreadGroup g = Thread.currentThread().getThreadGroup(); - while ((g.getParent() != null) && (g.getParent().getParent() != null)) { - g = g.getParent(); - } - if(Printer.trace)Printer.trace("<< JSSecurityManager: getTopmostThreadGroupImpl() completed"); - return g; - } - - - /** Create a Thread in the topmost ThreadGroup. + /** Create a Thread in the current ThreadGroup. */ static Thread createThread(final Runnable runnable, final String threadName, final boolean isDaemon, final int priority, final boolean doStart) { - Thread thread = null; - if(hasSecurityManager()) { - PrivilegedAction action = new PrivilegedAction() { - public Thread run() { - try { - return createThreadImpl(runnable, threadName, - isDaemon, priority, - doStart); - } catch (Throwable t) { - return null; - } - } - }; - thread = AccessController.doPrivileged(action); - if(Printer.debug) Printer.debug("created thread with JDK 1.2 security"); - } else { - if(Printer.debug)Printer.debug("not using JDK 1.2 security"); - thread = createThreadImpl(runnable, threadName, isDaemon, priority, - doStart); - } - return thread; - } - - - private static Thread createThreadImpl(Runnable runnable, - String threadName, - boolean isDaemon, int priority, - boolean doStart) { - ThreadGroup threadGroup = getTopmostThreadGroupImpl(); - Thread thread = new Thread(threadGroup, runnable); + Thread thread = new Thread(runnable); if (threadName != null) { thread.setName(threadName); } @@ -279,7 +185,6 @@ class JSSecurityManager { return thread; } - static List getProviders(final Class providerClass) { List p = new ArrayList<>(); // ServiceLoader creates "lazy" iterator instance, so it doesn't, diff --git a/jdk/src/share/classes/com/sun/media/sound/JavaSoundAudioClip.java b/jdk/src/share/classes/com/sun/media/sound/JavaSoundAudioClip.java index 978fbcdae1f..0b2d9a33d52 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JavaSoundAudioClip.java +++ b/jdk/src/share/classes/com/sun/media/sound/JavaSoundAudioClip.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,25 +28,19 @@ package com.sun.media.sound; import java.io.IOException; import java.io.InputStream; import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.applet.AudioClip; -import java.lang.InterruptedException; import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.Mixer; import javax.sound.sampled.Clip; -import javax.sound.sampled.Control; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.DataLine; import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; -import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; - import javax.sound.midi.MidiSystem; import javax.sound.midi.MidiFileFormat; import javax.sound.midi.MetaMessage; @@ -63,7 +57,7 @@ import javax.sound.midi.MetaEventListener; * @author Florian Bomers */ -public class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener { +public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineListener { private static final boolean DEBUG = false; private static final int BUFFER_SIZE = 16384; // number of bytes written each time to the source data line @@ -476,7 +470,7 @@ public class JavaSoundAudioClip implements AudioClip, MetaEventListener, LineLis * which allows retrieval of the internal array */ private static class DirectBAOS extends ByteArrayOutputStream { - public DirectBAOS() { + DirectBAOS() { super(); } diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java index 9a962bbd412..fb200208c86 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiverEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import javax.sound.midi.*; * * @author Alex Menkov */ -public class MidiDeviceReceiverEnvelope implements MidiDeviceReceiver { +public final class MidiDeviceReceiverEnvelope implements MidiDeviceReceiver { private final MidiDevice device; private final Receiver receiver; diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java index e20d430a042..eca630a6c8c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceTransmitterEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import javax.sound.midi.*; * * @author Alex Menkov */ -public class MidiDeviceTransmitterEnvelope implements MidiDeviceTransmitter { +public final class MidiDeviceTransmitterEnvelope implements MidiDeviceTransmitter { private final MidiDevice device; private final Transmitter transmitter; diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiInDevice.java b/jdk/src/share/classes/com/sun/media/sound/MidiInDevice.java index 3867f2d51cc..373870f4c9e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiInDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiInDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ package com.sun.media.sound; -import java.util.ArrayList; -import java.util.List; - import javax.sound.midi.*; @@ -39,7 +36,7 @@ import javax.sound.midi.*; * @author Kara Kytle * @author Florian Bomers */ -class MidiInDevice extends AbstractMidiDevice implements Runnable { +final class MidiInDevice extends AbstractMidiDevice implements Runnable { private Thread midiInThread = null; @@ -127,7 +124,7 @@ class MidiInDevice extends AbstractMidiDevice implements Runnable { * An own class to distinguish the class name from * the transmitter of other devices */ - private class MidiInTransmitter extends BasicTransmitter { + private final class MidiInTransmitter extends BasicTransmitter { private MidiInTransmitter() { super(); } diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java index b7a391eef18..e15616f14f0 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package com.sun.media.sound; import javax.sound.midi.MidiDevice; -import javax.sound.midi.spi.MidiDeviceProvider; /** @@ -35,15 +34,15 @@ import javax.sound.midi.spi.MidiDeviceProvider; * @author Kara Kytle * @author Florian Bomers */ -public class MidiInDeviceProvider extends AbstractMidiDeviceProvider { +public final class MidiInDeviceProvider extends AbstractMidiDeviceProvider { /** Cache of info objects for all MIDI output devices on the system. */ - static Info[] infos = null; + private static Info[] infos = null; /** Cache of open MIDI input devices on the system. */ - static MidiDevice[] devices = null; + private static MidiDevice[] devices = null; - private static boolean enabled; + private static final boolean enabled; // STATIC @@ -106,8 +105,8 @@ public class MidiInDeviceProvider extends AbstractMidiDeviceProvider { * previous instance may still exist and be open / in use / etc., * the new instance will not reflect that state... */ - static class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info { - private Class providerClass; + static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info { + private final Class providerClass; private MidiInDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java b/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java index a9193005e5f..4559c9b59e9 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiOutDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ import javax.sound.midi.*; * @author Kara Kytle * @author Florian Bomers */ -class MidiOutDevice extends AbstractMidiDevice { +final class MidiOutDevice extends AbstractMidiDevice { // CONSTRUCTOR @@ -101,7 +101,7 @@ class MidiOutDevice extends AbstractMidiDevice { // INNER CLASSES - class MidiOutReceiver extends AbstractReceiver { + final class MidiOutReceiver extends AbstractReceiver { void implSend(final MidiMessage message, final long timeStamp) { final int length = message.getLength(); diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java b/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java index baaee06c92a..ebe2880f026 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package com.sun.media.sound; import javax.sound.midi.MidiDevice; -import javax.sound.midi.spi.MidiDeviceProvider; /** @@ -35,15 +34,15 @@ import javax.sound.midi.spi.MidiDeviceProvider; * @author Kara Kytle * @author Florian Bomers */ -public class MidiOutDeviceProvider extends AbstractMidiDeviceProvider { +public final class MidiOutDeviceProvider extends AbstractMidiDeviceProvider { /** Cache of info objects for all MIDI output devices on the system. */ - static Info[] infos = null; + private static Info[] infos = null; /** Cache of open MIDI output devices on the system. */ - static MidiDevice[] devices = null; + private static MidiDevice[] devices = null; - private static boolean enabled; + private final static boolean enabled; // STATIC @@ -104,8 +103,8 @@ public class MidiOutDeviceProvider extends AbstractMidiDeviceProvider { * previous instance may still exist and be open / in use / etc., * the new instance will not reflect that state... */ - static class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info { - private Class providerClass; + static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info { + private final Class providerClass; private MidiOutDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java b/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java index 281b40e20bf..a3f62efd29e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java +++ b/jdk/src/share/classes/com/sun/media/sound/MidiUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,12 +36,17 @@ import java.util.ArrayList; * * @author Florian Bomers */ -public class MidiUtils { +public final class MidiUtils { public final static int DEFAULT_TEMPO_MPQ = 500000; // 120bpm public final static int META_END_OF_TRACK_TYPE = 0x2F; public final static int META_TEMPO_TYPE = 0x51; + /** + * Suppresses default constructor, ensuring non-instantiability. + */ + private MidiUtils() { + } /** return true if the passed message is Meta End Of Track */ public static boolean isMetaEndOfTrack(MidiMessage midiMsg) { @@ -262,7 +267,7 @@ public class MidiUtils { } - public static class TempoCache { + public static final class TempoCache { long[] ticks; int[] tempos; // in MPQ // index in ticks/tempos at the snapshot diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java b/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java index 522fe66c592..9ba89f20491 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import java.util.Collection; * * @author Karl Helgason */ -public class ModelByteBuffer { +public final class ModelByteBuffer { private ModelByteBuffer root = this; private File file; @@ -49,12 +49,12 @@ public class ModelByteBuffer { private class RandomFileInputStream extends InputStream { - private RandomAccessFile raf; + private final RandomAccessFile raf; private long left; private long mark = 0; private long markleft = 0; - public RandomFileInputStream() throws IOException { + RandomFileInputStream() throws IOException { raf = new RandomAccessFile(root.file, "r"); raf.seek(root.fileoffset + arrayOffset()); left = capacity(); diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java b/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java index 3d411b4e5c1..33515f400d8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,18 +36,18 @@ import javax.sound.sampled.AudioFormat.Encoding; * * @author Karl Helgason */ -public class ModelByteBufferWavetable implements ModelWavetable { +public final class ModelByteBufferWavetable implements ModelWavetable { private class Buffer8PlusInputStream extends InputStream { - private boolean bigendian; - private int framesize_pc; + private final boolean bigendian; + private final int framesize_pc; int pos = 0; int pos2 = 0; int markpos = 0; int markpos2 = 0; - public Buffer8PlusInputStream() { + Buffer8PlusInputStream() { framesize_pc = format.getFrameSize() / format.getChannels(); bigendian = format.isBigEndian(); } @@ -127,7 +127,7 @@ public class ModelByteBufferWavetable implements ModelWavetable { private float loopStart = -1; private float loopLength = -1; - private ModelByteBuffer buffer; + private final ModelByteBuffer buffer; private ModelByteBuffer buffer8 = null; private AudioFormat format = null; private float pitchcorrection = 0; diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java b/jdk/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java index 3f21aa0b9d6..05a438fac8e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelConnectionBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ import java.util.Arrays; * * @author Karl Helgason */ -public class ModelConnectionBlock { +public final class ModelConnectionBlock { // // source1 * source2 * scale -> destination diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelDestination.java b/jdk/src/share/classes/com/sun/media/sound/ModelDestination.java index 53cd0666d6f..f1fe44e5c66 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelDestination.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelDestination.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelDestination { +public final class ModelDestination { public static final ModelIdentifier DESTINATION_NONE = null; public static final ModelIdentifier DESTINATION_KEYNUMBER diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelIdentifier.java b/jdk/src/share/classes/com/sun/media/sound/ModelIdentifier.java index 4996c4605cd..2e07fa13efc 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelIdentifier.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelIdentifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelIdentifier { +public final class ModelIdentifier { /* * Object Variable diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java b/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java index 75c5a75f5a2..27e82c9fa6e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ public abstract class ModelInstrument extends Instrument { } // Get General MIDI 2 Alias patch for this instrument. - public Patch getPatchAlias() { + public final Patch getPatchAlias() { Patch patch = getPatch(); int program = patch.getProgram(); int bank = patch.getBank(); @@ -87,7 +87,7 @@ public abstract class ModelInstrument extends Instrument { // Return name of all the keys. // This information is generated from ModelPerformer.getName() // returned from getPerformers(). - public String[] getKeys() { + public final String[] getKeys() { String[] keys = new String[128]; for (ModelPerformer performer : getPerformers()) { for (int k = performer.getKeyFrom(); k <= performer.getKeyTo(); k++) { @@ -104,7 +104,7 @@ public abstract class ModelInstrument extends Instrument { // Return what channels this instrument will probably response // on General MIDI synthesizer. - public boolean[] getChannels() { + public final boolean[] getChannels() { boolean percussion = false; if (getPatch() instanceof ModelPatch) percussion = ((ModelPatch)getPatch()).isPercussion(); diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelInstrumentComparator.java b/jdk/src/share/classes/com/sun/media/sound/ModelInstrumentComparator.java index 40ca6c4aa7f..3eb68d9ea24 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelInstrumentComparator.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelInstrumentComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class ModelInstrumentComparator implements Comparator { +public final class ModelInstrumentComparator implements Comparator { public int compare(Instrument arg0, Instrument arg1) { Patch p0 = arg0.getPatch(); diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelMappedInstrument.java b/jdk/src/share/classes/com/sun/media/sound/ModelMappedInstrument.java index d7cacd9620a..ed0e978a869 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelMappedInstrument.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelMappedInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,9 +33,9 @@ import javax.sound.sampled.AudioFormat; * * @author Karl Helgason */ -public class ModelMappedInstrument extends ModelInstrument { +public final class ModelMappedInstrument extends ModelInstrument { - private ModelInstrument ins; + private final ModelInstrument ins; public ModelMappedInstrument(ModelInstrument ins, Patch patch) { super(ins.getSoundbank(), patch, ins.getName(), ins.getDataClass()); diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelPatch.java b/jdk/src/share/classes/com/sun/media/sound/ModelPatch.java index 3cb8f087160..d8cfc611c86 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelPatch.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelPatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class ModelPatch extends Patch { +public final class ModelPatch extends Patch { private boolean percussion = false; diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelPerformer.java b/jdk/src/share/classes/com/sun/media/sound/ModelPerformer.java index 289f1e31ea8..661070c0d74 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelPerformer.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelPerformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,9 +33,9 @@ import java.util.List; * * @author Karl Helgason */ -public class ModelPerformer { +public final class ModelPerformer { - private List oscillators = new ArrayList(); + private final List oscillators = new ArrayList(); private List connectionBlocks = new ArrayList(); private int keyFrom = 0; diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelSource.java b/jdk/src/share/classes/com/sun/media/sound/ModelSource.java index b7d8cf8e9dc..f64f9c8b364 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelSource.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelSource { +public final class ModelSource { public static final ModelIdentifier SOURCE_NONE = null; public static final ModelIdentifier SOURCE_NOTEON_KEYNUMBER = diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelStandardDirector.java b/jdk/src/share/classes/com/sun/media/sound/ModelStandardDirector.java index f5a00629a5a..e64d94cd472 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelStandardDirector.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelStandardDirector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelStandardDirector implements ModelDirector { +public final class ModelStandardDirector implements ModelDirector { ModelPerformer[] performers; ModelDirectedPlayer player; diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java b/jdk/src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java index d5181e39cee..a5171eb1fce 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelStandardIndexedDirector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelStandardIndexedDirector implements ModelDirector { +public final class ModelStandardIndexedDirector implements ModelDirector { ModelPerformer[] performers; ModelDirectedPlayer player; diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelStandardTransform.java b/jdk/src/share/classes/com/sun/media/sound/ModelStandardTransform.java index e857fdab4a6..c3e7fcb9b9b 100644 --- a/jdk/src/share/classes/com/sun/media/sound/ModelStandardTransform.java +++ b/jdk/src/share/classes/com/sun/media/sound/ModelStandardTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class ModelStandardTransform implements ModelTransform { +public final class ModelStandardTransform implements ModelTransform { public static final boolean DIRECTION_MIN2MAX = false; public static final boolean DIRECTION_MAX2MIN = true; diff --git a/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java b/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java index 7fd9e7354a5..9a4f1a874b3 100644 --- a/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,12 @@ package com.sun.media.sound; -import java.io.InputStream; import java.io.IOException; - import java.util.Vector; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; /** @@ -40,7 +38,7 @@ import javax.sound.sampled.AudioInputStream; * * @author Jan Borgersen */ -public class PCMtoPCMCodec extends SunCodec { +public final class PCMtoPCMCodec extends SunCodec { private static final AudioFormat.Encoding[] inputEncodings = { @@ -356,7 +354,7 @@ public class PCMtoPCMCodec extends SunCodec { private final int PCM_UNSIGNED_BE2SIGNED_LE = 7; private final int PCM_SIGNED_BE2UNSIGNED_LE = 8; - private int sampleSizeInBytes = 0; + private final int sampleSizeInBytes; private int conversionType = 0; diff --git a/jdk/src/share/classes/com/sun/media/sound/Platform.java b/jdk/src/share/classes/com/sun/media/sound/Platform.java index b24cd388ba4..766e485f120 100644 --- a/jdk/src/share/classes/com/sun/media/sound/Platform.java +++ b/jdk/src/share/classes/com/sun/media/sound/Platform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package com.sun.media.sound; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.StringTokenizer; @@ -35,7 +37,7 @@ import java.util.StringTokenizer; * @author Kara Kytle * @author Florian Bomers */ -class Platform { +final class Platform { // STATIC FINAL CHARACTERISTICS @@ -157,7 +159,13 @@ class Platform { try { // load the main library - JSSecurityManager.loadLibrary(libNameMain); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + System.loadLibrary(libNameMain); + return null; + } + }); // just for the heck of it... loadedLibs |= LIB_MAIN; } catch (SecurityException e) { @@ -171,9 +179,16 @@ class Platform { // the string is the libraries, separated by white space StringTokenizer st = new StringTokenizer(extraLibs); while (st.hasMoreTokens()) { - String lib = st.nextToken(); + final String lib = st.nextToken(); try { - JSSecurityManager.loadLibrary(lib); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + System.loadLibrary(lib); + return null; + } + }); + if (lib.equals(libNameALSA)) { loadedLibs |= LIB_ALSA; if (Printer.debug) Printer.debug("Loaded ALSA lib successfully."); diff --git a/jdk/src/share/classes/com/sun/media/sound/PortMixer.java b/jdk/src/share/classes/com/sun/media/sound/PortMixer.java index a85d54fbcf5..2ef76cbf488 100644 --- a/jdk/src/share/classes/com/sun/media/sound/PortMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/PortMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import javax.sound.sampled.FloatControl; * * @author Florian Bomers */ -class PortMixer extends AbstractMixer { +final class PortMixer extends AbstractMixer { // CONSTANTS private static final int SRC_UNKNOWN = 0x01; @@ -228,8 +228,10 @@ class PortMixer extends AbstractMixer { /** * Private inner class representing a Port for the PortMixer. */ - private static class PortMixerPort extends AbstractLine implements Port { - private int portIndex; + private static final class PortMixerPort extends AbstractLine + implements Port { + + private final int portIndex; private long id; // CONSTRUCTOR @@ -342,9 +344,9 @@ class PortMixer extends AbstractMixer { /** * Private inner class representing a BooleanControl for PortMixerPort */ - private static class BoolCtrl extends BooleanControl { + private static final class BoolCtrl extends BooleanControl { // the handle to the native control function - private long controlID; + private final long controlID; private boolean closed = false; private static BooleanControl.Type createType(String name) { @@ -386,7 +388,7 @@ class PortMixer extends AbstractMixer { /** * inner class for custom types */ - private static class BCT extends BooleanControl.Type { + private static final class BCT extends BooleanControl.Type { private BCT(String name) { super(name); } @@ -396,7 +398,7 @@ class PortMixer extends AbstractMixer { /** * Private inner class representing a CompoundControl for PortMixerPort */ - private static class CompCtrl extends CompoundControl { + private static final class CompCtrl extends CompoundControl { private CompCtrl(String name, Control[] controls) { super(new CCT(name), controls); } @@ -404,7 +406,7 @@ class PortMixer extends AbstractMixer { /** * inner class for custom compound control types */ - private static class CCT extends CompoundControl.Type { + private static final class CCT extends CompoundControl.Type { private CCT(String name) { super(name); } @@ -414,9 +416,9 @@ class PortMixer extends AbstractMixer { /** * Private inner class representing a BooleanControl for PortMixerPort */ - private static class FloatCtrl extends FloatControl { + private static final class FloatCtrl extends FloatControl { // the handle to the native control function - private long controlID; + private final long controlID; private boolean closed = false; // predefined float control types. See also Ports.h @@ -462,7 +464,7 @@ class PortMixer extends AbstractMixer { /** * inner class for custom types */ - private static class FCT extends FloatControl.Type { + private static final class FCT extends FloatControl.Type { private FCT(String name) { super(name); } @@ -472,7 +474,7 @@ class PortMixer extends AbstractMixer { /** * Private inner class representing a port info */ - private static class PortInfo extends Port.Info { + private static final class PortInfo extends Port.Info { private PortInfo(String name, boolean isSource) { super(Port.class, name, isSource); } diff --git a/jdk/src/share/classes/com/sun/media/sound/PortMixerProvider.java b/jdk/src/share/classes/com/sun/media/sound/PortMixerProvider.java index 8f63256e596..a8ef40f8a0f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/PortMixerProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/PortMixerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package com.sun.media.sound; -import java.util.Vector; - import javax.sound.sampled.Mixer; import javax.sound.sampled.spi.MixerProvider; @@ -36,7 +34,7 @@ import javax.sound.sampled.spi.MixerProvider; * * @author Florian Bomers */ -public class PortMixerProvider extends MixerProvider { +public final class PortMixerProvider extends MixerProvider { // STATIC VARIABLES @@ -66,16 +64,17 @@ public class PortMixerProvider extends MixerProvider { * Required public no-arg constructor. */ public PortMixerProvider() { - //if (Printer.trace) Printer.trace("PortMixerProvider: constructor"); - if (Platform.isPortsEnabled()) { - init(); - } else { - infos = new PortMixerInfo[0]; - devices = new PortMixer[0]; + synchronized (PortMixerProvider.class) { + if (Platform.isPortsEnabled()) { + init(); + } else { + infos = new PortMixerInfo[0]; + devices = new PortMixer[0]; + } } } - private static synchronized void init() { + private static void init() { // get the number of input devices int numDevices = nGetNumDevices(); @@ -95,23 +94,28 @@ public class PortMixerProvider extends MixerProvider { } public Mixer.Info[] getMixerInfo() { - Mixer.Info[] localArray = new Mixer.Info[infos.length]; - System.arraycopy(infos, 0, localArray, 0, infos.length); - return localArray; + synchronized (PortMixerProvider.class) { + Mixer.Info[] localArray = new Mixer.Info[infos.length]; + System.arraycopy(infos, 0, localArray, 0, infos.length); + return localArray; + } } public Mixer getMixer(Mixer.Info info) { - for (int i = 0; i < infos.length; i++) { - if (infos[i].equals(info)) { - return getDevice(infos[i]); + synchronized (PortMixerProvider.class) { + for (int i = 0; i < infos.length; i++) { + if (infos[i].equals(info)) { + return getDevice(infos[i]); + } } } - throw new IllegalArgumentException("Mixer " + info.toString() + " not supported by this provider."); + throw new IllegalArgumentException("Mixer " + info.toString() + + " not supported by this provider."); } - private Mixer getDevice(PortMixerInfo info) { + private static Mixer getDevice(PortMixerInfo info) { int index = info.getIndex(); if (devices[index] == null) { devices[index] = new PortMixer(info); @@ -127,8 +131,8 @@ public class PortMixerProvider extends MixerProvider { * making native references to a particular device. * This constructor is called from native. */ - static class PortMixerInfo extends Mixer.Info { - private int index; + static final class PortMixerInfo extends Mixer.Info { + private final int index; private PortMixerInfo(int index, String name, String vendor, String description, String version) { super("Port " + name, vendor, description, version); diff --git a/jdk/src/share/classes/com/sun/media/sound/Printer.java b/jdk/src/share/classes/com/sun/media/sound/Printer.java index 33570e5df54..7d50b72bf7f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/Printer.java +++ b/jdk/src/share/classes/com/sun/media/sound/Printer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ package com.sun.media.sound; * @author David Rivas * @author Kara Kytle */ -class Printer { +final class Printer { static final boolean err = false; static final boolean debug = false; @@ -68,6 +68,12 @@ class Printer { release = on; }*/ + /** + * Suppresses default constructor, ensuring non-instantiability. + */ + private Printer() { + } + public static void err(String str) { if (err) diff --git a/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidDataException.java b/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidDataException.java index fd2ce1d311c..195ceedde08 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidDataException.java +++ b/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidDataException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class RIFFInvalidDataException extends InvalidDataException { +public final class RIFFInvalidDataException extends InvalidDataException { private static final long serialVersionUID = 1L; diff --git a/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java b/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java index 925c579803e..7b8d755509f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java +++ b/jdk/src/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class RIFFInvalidFormatException extends InvalidFormatException { +public final class RIFFInvalidFormatException extends InvalidFormatException { private static final long serialVersionUID = 1L; diff --git a/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java b/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java index 8e73675bf05..7969a5d4fce 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,11 +33,11 @@ import java.io.InputStream; * * @author Karl Helgason */ -public class RIFFReader extends InputStream { +public final class RIFFReader extends InputStream { - private RIFFReader root; + private final RIFFReader root; private long filepointer = 0; - private String fourcc; + private final String fourcc; private String riff_type = null; private long ckSize = 0; private InputStream stream; diff --git a/jdk/src/share/classes/com/sun/media/sound/RIFFWriter.java b/jdk/src/share/classes/com/sun/media/sound/RIFFWriter.java index 5f91ffa90f4..a417d6a16dc 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RIFFWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/RIFFWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import java.io.RandomAccessFile; * * @author Karl Helgason */ -public class RIFFWriter extends OutputStream { +public final class RIFFWriter extends OutputStream { private interface RandomAccessWriter { @@ -60,11 +60,11 @@ public class RIFFWriter extends OutputStream { RandomAccessFile raf; - public RandomAccessFileWriter(File file) throws FileNotFoundException { + RandomAccessFileWriter(File file) throws FileNotFoundException { this.raf = new RandomAccessFile(file, "rw"); } - public RandomAccessFileWriter(String name) throws FileNotFoundException { + RandomAccessFileWriter(String name) throws FileNotFoundException { this.raf = new RandomAccessFile(name, "rw"); } @@ -107,9 +107,9 @@ public class RIFFWriter extends OutputStream { int length = 0; int pos = 0; byte[] s; - OutputStream stream; + final OutputStream stream; - public RandomAccessByteWriter(OutputStream stream) { + RandomAccessByteWriter(OutputStream stream) { this.stream = stream; } @@ -163,8 +163,8 @@ public class RIFFWriter extends OutputStream { } private int chunktype = 0; // 0=RIFF, 1=LIST; 2=CHUNK private RandomAccessWriter raf; - private long chunksizepointer; - private long startpointer; + private final long chunksizepointer; + private final long startpointer; private RIFFWriter childchunk = null; private boolean open = true; private boolean writeoverride = false; diff --git a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java index 93b7b0612eb..168b1b3656d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java +++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,13 @@ package com.sun.media.sound; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.WeakHashMap; import javax.sound.midi.*; @@ -46,7 +45,8 @@ import javax.sound.midi.*; /* TODO: * - rename PlayThread to PlayEngine (because isn't a thread) */ -class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoConnectSequencer { +final class RealTimeSequencer extends AbstractMidiDevice + implements Sequencer, AutoConnectSequencer { // STATIC VARIABLES @@ -58,7 +58,8 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon * Event Dispatcher thread. Should be using a shared event * dispatcher instance with a factory in EventDispatcher */ - private static final EventDispatcher eventDispatcher; + private static final Map dispatchers = + new WeakHashMap<>(); /** * All RealTimeSequencers share this info object. @@ -66,11 +67,11 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon static final RealTimeSequencerInfo info = new RealTimeSequencerInfo(); - private static Sequencer.SyncMode[] masterSyncModes = { Sequencer.SyncMode.INTERNAL_CLOCK }; - private static Sequencer.SyncMode[] slaveSyncModes = { Sequencer.SyncMode.NO_SYNC }; + private static final Sequencer.SyncMode[] masterSyncModes = { Sequencer.SyncMode.INTERNAL_CLOCK }; + private static final Sequencer.SyncMode[] slaveSyncModes = { Sequencer.SyncMode.NO_SYNC }; - private static Sequencer.SyncMode masterSyncMode = Sequencer.SyncMode.INTERNAL_CLOCK; - private static Sequencer.SyncMode slaveSyncMode = Sequencer.SyncMode.NO_SYNC; + private static final Sequencer.SyncMode masterSyncMode = Sequencer.SyncMode.INTERNAL_CLOCK; + private static final Sequencer.SyncMode slaveSyncMode = Sequencer.SyncMode.NO_SYNC; /** @@ -100,7 +101,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon private boolean[] trackSolo = null; /** tempo cache for getMicrosecondPosition */ - private MidiUtils.TempoCache tempoCache = new MidiUtils.TempoCache(); + private final MidiUtils.TempoCache tempoCache = new MidiUtils.TempoCache(); /** * True if the sequence is running. @@ -121,7 +122,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon /** * List of tracks to which we're recording */ - private List recordingTracks = new ArrayList(); + private final List recordingTracks = new ArrayList(); private long loopStart = 0; @@ -132,13 +133,13 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon /** * Meta event listeners */ - private ArrayList metaEventListeners = new ArrayList(); + private final ArrayList metaEventListeners = new ArrayList(); /** * Control change listeners */ - private ArrayList controllerEventListeners = new ArrayList(); + private final ArrayList controllerEventListeners = new ArrayList(); /** automatic connection support */ @@ -151,16 +152,9 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon Receiver autoConnectedReceiver = null; - static { - // create and start the global event thread - eventDispatcher = new EventDispatcher(); - eventDispatcher.start(); - } - - /* ****************************** CONSTRUCTOR ****************************** */ - protected RealTimeSequencer() throws MidiUnavailableException { + RealTimeSequencer() throws MidiUnavailableException { super(info); if (Printer.trace) Printer.trace(">> RealTimeSequencer CONSTRUCTOR"); @@ -574,7 +568,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon return returnedModes; } - protected int getTrackCount() { + int getTrackCount() { Sequence seq = getSequence(); if (seq != null) { // $$fb wish there was a nicer way to get the number of tracks... @@ -872,7 +866,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon if (Printer.trace) Printer.trace("<< RealTimeSequencer: implClose() completed"); } - protected void implStart() { + void implStart() { if (Printer.trace) Printer.trace(">> RealTimeSequencer: implStart()"); if (playThread == null) { @@ -889,7 +883,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon } - protected void implStop() { + void implStop() { if (Printer.trace) Printer.trace(">> RealTimeSequencer: implStop()"); if (playThread == null) { @@ -905,22 +899,36 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon if (Printer.trace) Printer.trace("<< RealTimeSequencer: implStop() completed"); } + private static EventDispatcher getEventDispatcher() { + // create and start the global event thread + //TODO need a way to stop this thread when the engine is done + final ThreadGroup tg = Thread.currentThread().getThreadGroup(); + synchronized (dispatchers) { + EventDispatcher eventDispatcher = dispatchers.get(tg); + if (eventDispatcher == null) { + eventDispatcher = new EventDispatcher(); + dispatchers.put(tg, eventDispatcher); + eventDispatcher.start(); + } + return eventDispatcher; + } + } /** * Send midi player events. * must not be synchronized on "this" */ - protected void sendMetaEvents(MidiMessage message) { + void sendMetaEvents(MidiMessage message) { if (metaEventListeners.size() == 0) return; //if (Printer.debug) Printer.debug("sending a meta event"); - eventDispatcher.sendAudioEvents(message, metaEventListeners); + getEventDispatcher().sendAudioEvents(message, metaEventListeners); } /** * Send midi player events. */ - protected void sendControllerEvents(MidiMessage message) { + void sendControllerEvents(MidiMessage message) { int size = controllerEventListeners.size(); if (size == 0) return; @@ -942,7 +950,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon } } } - eventDispatcher.sendAudioEvents(message, sendToListeners); + getEventDispatcher().sendAudioEvents(message, sendToListeners); } @@ -1024,7 +1032,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon } - class SequencerReceiver extends AbstractReceiver { + final class SequencerReceiver extends AbstractReceiver { void implSend(MidiMessage message, long timeStamp) { if (recording) { @@ -1092,7 +1100,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon // easier to deal with than turning all the // ints into objects to use a Vector int [] controllers; - ControllerEventListener listener; + final ControllerEventListener listener; private ControllerListElement(ControllerEventListener listener, int[] controllers) { @@ -1197,7 +1205,7 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon static class RecordingTrack { - private Track track; + private final Track track; private int channel; RecordingTrack(Track track, int channel) { @@ -1237,15 +1245,15 @@ class RealTimeSequencer extends AbstractMidiDevice implements Sequencer, AutoCon } - class PlayThread implements Runnable { + final class PlayThread implements Runnable { private Thread thread; - private Object lock = new Object(); + private final Object lock = new Object(); /** true if playback is interrupted (in close) */ boolean interrupted = false; boolean isPumping = false; - private DataPump dataPump = new DataPump(); + private final DataPump dataPump = new DataPump(); PlayThread() { diff --git a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencerProvider.java b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencerProvider.java index 643ccf27215..d2724955a0c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencerProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ import javax.sound.midi.spi.MidiDeviceProvider; * * @author Florian Bomers */ -public class RealTimeSequencerProvider extends MidiDeviceProvider { +public final class RealTimeSequencerProvider extends MidiDeviceProvider { public MidiDevice.Info[] getDeviceInfo() { diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2GlobalRegion.java b/jdk/src/share/classes/com/sun/media/sound/SF2GlobalRegion.java index 365a558ea17..22ed404ddf8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2GlobalRegion.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2GlobalRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,5 +29,5 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SF2GlobalRegion extends SF2Region { +public final class SF2GlobalRegion extends SF2Region { } diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Instrument.java b/jdk/src/share/classes/com/sun/media/sound/SF2Instrument.java index e96b85c14ed..580882ba765 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2Instrument.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2Instrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,16 +36,16 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class SF2Instrument extends ModelInstrument { +public final class SF2Instrument extends ModelInstrument { - protected String name = ""; - protected int preset = 0; - protected int bank = 0; - protected long library = 0; - protected long genre = 0; - protected long morphology = 0; - protected SF2GlobalRegion globalregion = null; - protected List regions + String name = ""; + int preset = 0; + int bank = 0; + long library = 0; + long genre = 0; + long morphology = 0; + SF2GlobalRegion globalregion = null; + List regions = new ArrayList(); public SF2Instrument() { @@ -730,7 +730,7 @@ public class SF2Instrument extends ModelInstrument { return msrc; } - protected static ModelDestination convertDestination(int dst, + static ModelDestination convertDestination(int dst, double[] amountcorrection, ModelSource[] extrasrc) { ModelIdentifier id = null; switch (dst) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2InstrumentRegion.java b/jdk/src/share/classes/com/sun/media/sound/SF2InstrumentRegion.java index ae01e5177fd..87a62c42e05 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2InstrumentRegion.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2InstrumentRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,9 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SF2InstrumentRegion extends SF2Region { +public final class SF2InstrumentRegion extends SF2Region { - protected SF2Layer layer; + SF2Layer layer; public SF2Layer getLayer() { return layer; diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Layer.java b/jdk/src/share/classes/com/sun/media/sound/SF2Layer.java index 6c3f1450917..e0bc76a4f9d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2Layer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2Layer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,11 +34,11 @@ import javax.sound.midi.SoundbankResource; * * @author Karl Helgason */ -public class SF2Layer extends SoundbankResource { +public final class SF2Layer extends SoundbankResource { - protected String name = ""; - protected SF2GlobalRegion globalregion = null; - protected List regions = new ArrayList(); + String name = ""; + SF2GlobalRegion globalregion = null; + List regions = new ArrayList(); public SF2Layer(SF2Soundbank soundBank) { super(soundBank, null, null); diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2LayerRegion.java b/jdk/src/share/classes/com/sun/media/sound/SF2LayerRegion.java index 8b2caadb870..8833e384c3e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2LayerRegion.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2LayerRegion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,9 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SF2LayerRegion extends SF2Region { +public final class SF2LayerRegion extends SF2Region { - protected SF2Sample sample; + SF2Sample sample; public SF2Sample getSample() { return sample; diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Modulator.java b/jdk/src/share/classes/com/sun/media/sound/SF2Modulator.java index c412ced8d24..2d85032ce4d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2Modulator.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2Modulator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SF2Modulator { +public final class SF2Modulator { public final static int SOURCE_NONE = 0; public final static int SOURCE_NOTE_ON_VELOCITY = 2; @@ -49,11 +49,11 @@ public class SF2Modulator { public final static int SOURCE_TYPE_SWITCH = 1024 * 3; public final static int TRANSFORM_LINEAR = 0; public final static int TRANSFORM_ABSOLUTE = 2; - protected int sourceOperator; - protected int destinationOperator; - protected short amount; - protected int amountSourceOperator; - protected int transportOperator; + int sourceOperator; + int destinationOperator; + short amount; + int amountSourceOperator; + int transportOperator; public short getAmount() { return amount; diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Sample.java b/jdk/src/share/classes/com/sun/media/sound/SF2Sample.java index f3112c7fa2a..4a2f0fc58d7 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2Sample.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2Sample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,18 +36,18 @@ import javax.sound.sampled.AudioInputStream; * * @author Karl Helgason */ -public class SF2Sample extends SoundbankResource { +public final class SF2Sample extends SoundbankResource { - protected String name = ""; - protected long startLoop = 0; - protected long endLoop = 0; - protected long sampleRate = 44100; - protected int originalPitch = 60; - protected byte pitchCorrection = 0; - protected int sampleLink = 0; - protected int sampleType = 0; - protected ModelByteBuffer data; - protected ModelByteBuffer data24; + String name = ""; + long startLoop = 0; + long endLoop = 0; + long sampleRate = 44100; + int originalPitch = 60; + byte pitchCorrection = 0; + int sampleLink = 0; + int sampleType = 0; + ModelByteBuffer data; + ModelByteBuffer data24; public SF2Sample(Soundbank soundBank) { super(soundBank, null, AudioInputStream.class); diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java b/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java index 914199edfd9..688ba1dafaa 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,40 +50,40 @@ import javax.sound.midi.SoundbankResource; * * @author Karl Helgason */ -public class SF2Soundbank implements Soundbank { +public final class SF2Soundbank implements Soundbank { // version of the Sound Font RIFF file - protected int major = 2; - protected int minor = 1; + int major = 2; + int minor = 1; // target Sound Engine - protected String targetEngine = "EMU8000"; + String targetEngine = "EMU8000"; // Sound Font Bank Name - protected String name = "untitled"; + String name = "untitled"; // Sound ROM Name - protected String romName = null; + String romName = null; // Sound ROM Version - protected int romVersionMajor = -1; - protected int romVersionMinor = -1; + int romVersionMajor = -1; + int romVersionMinor = -1; // Date of Creation of the Bank - protected String creationDate = null; + String creationDate = null; // Sound Designers and Engineers for the Bank - protected String engineers = null; + String engineers = null; // Product for which the Bank was intended - protected String product = null; + String product = null; // Copyright message - protected String copyright = null; + String copyright = null; // Comments - protected String comments = null; + String comments = null; // The SoundFont tools used to create and alter the bank - protected String tools = null; + String tools = null; // The Sample Data loaded from the SoundFont private ModelByteBuffer sampleData = null; private ModelByteBuffer sampleData24 = null; private File sampleFile = null; private boolean largeFormat = false; - private List instruments = new ArrayList(); - private List layers = new ArrayList(); - private List samples = new ArrayList(); + private final List instruments = new ArrayList(); + private final List layers = new ArrayList(); + private final List samples = new ArrayList(); public SF2Soundbank() { } diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java index 120f1dbf740..a61094fb4df 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/SF2SoundbankReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import javax.sound.midi.spi.SoundbankReader; * * @author Karl Helgason */ -public class SF2SoundbankReader extends SoundbankReader { +public final class SF2SoundbankReader extends SoundbankReader { public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftAbstractResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftAbstractResampler.java index b0857fd1d02..45c83553457 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftAbstractResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftAbstractResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,7 @@ public abstract class SoftAbstractResampler implements SoftResampler { float samplerateconv = 1; float pitchcorrection = 0; - public ModelAbstractResamplerStream() { + ModelAbstractResamplerStream() { pad = getPadding(); pad2 = getPadding() * 2; ibuffer = new float[2][sector_size + pad2]; @@ -384,7 +384,7 @@ public abstract class SoftAbstractResampler implements SoftResampler { float in_end, float[] pitch, float pitchstep, float[] out, int[] out_offset, int out_end); - public SoftResamplerStreamer openStreamer() { + public final SoftResamplerStreamer openStreamer() { return new ModelAbstractResamplerStream(); } } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java b/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java index 1a3faf28e37..45b2d0f1d9c 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import javax.sound.sampled.AudioFormat; * * @author Karl Helgason */ -public class SoftAudioBuffer { +public final class SoftAudioBuffer { private int size; private float[] buffer; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java b/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java index 7f96ec4709d..1a07a23ec6f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,13 +34,13 @@ import javax.sound.sampled.SourceDataLine; * * @author Karl Helgason */ -public class SoftAudioPusher implements Runnable { +public final class SoftAudioPusher implements Runnable { private volatile boolean active = false; private SourceDataLine sourceDataLine = null; private Thread audiothread; - private AudioInputStream ais; - private byte[] buffer; + private final AudioInputStream ais; + private final byte[] buffer; public SoftAudioPusher(SourceDataLine sourceDataLine, AudioInputStream ais, int workbuffersizer) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java index 70208f78e7d..667b9cc3741 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class SoftChannel implements MidiChannel, ModelDirectedPlayer { +public final class SoftChannel implements MidiChannel, ModelDirectedPlayer { private static boolean[] dontResetControls = new boolean[128]; static { @@ -90,15 +90,15 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { private static final int RPN_NULL_VALUE = (127 << 7) + 127; private int rpn_control = RPN_NULL_VALUE; private int nrpn_control = RPN_NULL_VALUE; - protected double portamento_time = 1; // keyschanges per control buffer time - protected int[] portamento_lastnote = new int[128]; - protected int portamento_lastnote_ix = 0; + double portamento_time = 1; // keyschanges per control buffer time + int[] portamento_lastnote = new int[128]; + int portamento_lastnote_ix = 0; private boolean portamento = false; private boolean mono = false; private boolean mute = false; private boolean solo = false; private boolean solomute = false; - private Object control_mutex; + private final Object control_mutex; private int channel; private SoftVoice[] voices; private int bank; @@ -111,21 +111,21 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { private int pitchbend; private double[] co_midi_pitch = new double[1]; private double[] co_midi_channel_pressure = new double[1]; - protected SoftTuning tuning = new SoftTuning(); - protected int tuning_bank = 0; - protected int tuning_program = 0; - protected SoftInstrument current_instrument = null; - protected ModelChannelMixer current_mixer = null; - protected ModelDirector current_director = null; + SoftTuning tuning = new SoftTuning(); + int tuning_bank = 0; + int tuning_program = 0; + SoftInstrument current_instrument = null; + ModelChannelMixer current_mixer = null; + ModelDirector current_director = null; // Controller Destination Settings - protected int cds_control_number = -1; - protected ModelConnectionBlock[] cds_control_connections = null; - protected ModelConnectionBlock[] cds_channelpressure_connections = null; - protected ModelConnectionBlock[] cds_polypressure_connections = null; - protected boolean sustain = false; - protected boolean[][] keybasedcontroller_active = null; - protected double[][] keybasedcontroller_value = null; + int cds_control_number = -1; + ModelConnectionBlock[] cds_control_connections = null; + ModelConnectionBlock[] cds_channelpressure_connections = null; + ModelConnectionBlock[] cds_polypressure_connections = null; + boolean sustain = false; + boolean[][] keybasedcontroller_active = null; + double[][] keybasedcontroller_value = null; private class MidiControlObject implements SoftControl { double[] pitch = co_midi_pitch; @@ -336,7 +336,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { } - protected void initVoice(SoftVoice voice, SoftPerformer p, int voiceID, + void initVoice(SoftVoice voice, SoftPerformer p, int voiceID, int noteNumber, int velocity, int delay, ModelConnectionBlock[] connectionBlocks, ModelChannelMixer channelmixer, boolean releaseTriggered) { if (voice.active) { @@ -414,7 +414,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { /* A special noteOn with delay parameter, which is used to * start note within control buffers. */ - protected void noteOn(int noteNumber, int velocity, int delay) { + void noteOn(int noteNumber, int velocity, int delay) { noteNumber = restrict7Bit(noteNumber); velocity = restrict7Bit(velocity); noteOn_internal(noteNumber, velocity, delay); @@ -707,7 +707,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { } } - protected void applyInstrumentCustomization() { + void applyInstrumentCustomization() { if (cds_control_connections == null && cds_channelpressure_connections == null && cds_polypressure_connections == null) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChannelProxy.java b/jdk/src/share/classes/com/sun/media/sound/SoftChannelProxy.java index 045e50162c3..d5d8726fee9 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftChannelProxy.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftChannelProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import javax.sound.midi.MidiChannel; * * @author Karl Helgason */ -public class SoftChannelProxy implements MidiChannel { +public final class SoftChannelProxy implements MidiChannel { private MidiChannel channel = null; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java b/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java index bc04ca8eb2d..81b0e8209c7 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,11 +32,11 @@ import java.util.Arrays; * * @author Karl Helgason */ -public class SoftChorus implements SoftAudioProcessor { +public final class SoftChorus implements SoftAudioProcessor { private static class VariableDelay { - private float[] delaybuffer; + private final float[] delaybuffer; private int rovepos = 0; private float gain = 1; private float rgain = 0; @@ -44,7 +44,7 @@ public class SoftChorus implements SoftAudioProcessor { private float lastdelay = 0; private float feedback = 0; - public VariableDelay(int maxbuffersize) { + VariableDelay(int maxbuffersize) { delaybuffer = new float[maxbuffersize]; } @@ -119,10 +119,10 @@ public class SoftChorus implements SoftAudioProcessor { private double phase_step = 0; private double depth = 0; private VariableDelay vdelay; - private double samplerate; - private double controlrate; + private final double samplerate; + private final double controlrate; - public LFODelay(double samplerate, double controlrate) { + LFODelay(double samplerate, double controlrate) { this.samplerate = samplerate; this.controlrate = controlrate; // vdelay = new VariableDelay((int)(samplerate*4)); diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java index 60df6ba8cee..4eeb817fc3d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftCubicResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftCubicResampler extends SoftAbstractResampler { +public final class SoftCubicResampler extends SoftAbstractResampler { public int getPadding() { return 3; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java b/jdk/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java index d60c17021b2..7214ec0dd20 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftEnvelopeGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftEnvelopeGenerator implements SoftProcess { +public final class SoftEnvelopeGenerator implements SoftProcess { public final static int EG_OFF = 0; public final static int EG_DELAY = 1; @@ -42,23 +42,23 @@ public class SoftEnvelopeGenerator implements SoftProcess { public final static int EG_END = 8; int max_count = 10; int used_count = 0; - private int[] stage = new int[max_count]; - private int[] stage_ix = new int[max_count]; - private double[] stage_v = new double[max_count]; - private int[] stage_count = new int[max_count]; - private double[][] on = new double[max_count][1]; - private double[][] active = new double[max_count][1]; - private double[][] out = new double[max_count][1]; - private double[][] delay = new double[max_count][1]; - private double[][] attack = new double[max_count][1]; - private double[][] hold = new double[max_count][1]; - private double[][] decay = new double[max_count][1]; - private double[][] sustain = new double[max_count][1]; - private double[][] release = new double[max_count][1]; - private double[][] shutdown = new double[max_count][1]; - private double[][] release2 = new double[max_count][1]; - private double[][] attack2 = new double[max_count][1]; - private double[][] decay2 = new double[max_count][1]; + private final int[] stage = new int[max_count]; + private final int[] stage_ix = new int[max_count]; + private final double[] stage_v = new double[max_count]; + private final int[] stage_count = new int[max_count]; + private final double[][] on = new double[max_count][1]; + private final double[][] active = new double[max_count][1]; + private final double[][] out = new double[max_count][1]; + private final double[][] delay = new double[max_count][1]; + private final double[][] attack = new double[max_count][1]; + private final double[][] hold = new double[max_count][1]; + private final double[][] decay = new double[max_count][1]; + private final double[][] sustain = new double[max_count][1]; + private final double[][] release = new double[max_count][1]; + private final double[][] shutdown = new double[max_count][1]; + private final double[][] release2 = new double[max_count][1]; + private final double[][] attack2 = new double[max_count][1]; + private final double[][] decay2 = new double[max_count][1]; private double control_time = 0; public void reset() { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java b/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java index b194345bca4..187fa20508e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftFilter { +public final class SoftFilter { public final static int FILTERTYPE_LP6 = 0x00; public final static int FILTERTYPE_LP12 = 0x01; @@ -55,7 +55,7 @@ public class SoftFilter { // 0x30 = NP, Notch or Band Elimination Filter // private int filtertype = FILTERTYPE_LP6; - private float samplerate; + private final float samplerate; private float x1; private float x2; private float y1; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftInstrument.java b/jdk/src/share/classes/com/sun/media/sound/SoftInstrument.java index 78f8926b5c2..0423448743d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftInstrument.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftInstrument.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,12 +32,12 @@ import javax.sound.midi.MidiChannel; * * @author Karl Helgason */ -public class SoftInstrument extends Instrument { +public final class SoftInstrument extends Instrument { private SoftPerformer[] performers; private ModelPerformer[] modelperformers; - private Object data; - private ModelInstrument ins; + private final Object data; + private final ModelInstrument ins; public SoftInstrument(ModelInstrument ins) { super(ins.getSoundbank(), ins.getPatch(), ins.getName(), diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java b/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java index 3f60d2dafc2..0f5ff294574 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ import javax.sound.sampled.AudioInputStream; * * @author Karl Helgason */ -public class SoftJitterCorrector extends AudioInputStream { +public final class SoftJitterCorrector extends AudioInputStream { private static class JitterStream extends InputStream { @@ -48,7 +48,7 @@ public class SoftJitterCorrector extends AudioInputStream { int writepos = 0; int readpos = 0; byte[][] buffers; - Object buffers_mutex = new Object(); + private final Object buffers_mutex = new Object(); // Adapative Drift Statistics int w_count = 1000; @@ -112,7 +112,7 @@ public class SoftJitterCorrector extends AudioInputStream { } } - public JitterStream(AudioInputStream s, int buffersize, + JitterStream(AudioInputStream s, int buffersize, int smallbuffersize) { this.w_count = 10 * (buffersize / smallbuffersize); if (w_count < 100) diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLanczosResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftLanczosResampler.java index 0567464ce37..1d2d3619698 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLanczosResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLanczosResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftLanczosResampler extends SoftAbstractResampler { +public final class SoftLanczosResampler extends SoftAbstractResampler { float[][] sinc_table; int sinc_table_fsize = 2000; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java b/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java index f699a4db31d..7c74a18e1c0 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftLimiter implements SoftAudioProcessor { +public final class SoftLimiter implements SoftAudioProcessor { float lastmax = 0; float gain = 1; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler.java index acfb8d9b060..eb2b98d3772 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftLinearResampler extends SoftAbstractResampler { +public final class SoftLinearResampler extends SoftAbstractResampler { public int getPadding() { return 2; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler2.java b/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler2.java index 34dfd9dd89a..67f1b6b2c32 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler2.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLinearResampler2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftLinearResampler2 extends SoftAbstractResampler { +public final class SoftLinearResampler2 extends SoftAbstractResampler { public int getPadding() { return 2; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java b/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java index 87617717f6b..a0a8bbe1697 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLowFrequencyOscillator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,21 +29,21 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftLowFrequencyOscillator implements SoftProcess { +public final class SoftLowFrequencyOscillator implements SoftProcess { - private int max_count = 10; + private final int max_count = 10; private int used_count = 0; - private double[][] out = new double[max_count][1]; - private double[][] delay = new double[max_count][1]; - private double[][] delay2 = new double[max_count][1]; - private double[][] freq = new double[max_count][1]; - private int[] delay_counter = new int[max_count]; - private double[] sin_phase = new double[max_count]; - private double[] sin_stepfreq = new double[max_count]; - private double[] sin_step = new double[max_count]; + private final double[][] out = new double[max_count][1]; + private final double[][] delay = new double[max_count][1]; + private final double[][] delay2 = new double[max_count][1]; + private final double[][] freq = new double[max_count][1]; + private final int[] delay_counter = new int[max_count]; + private final double[] sin_phase = new double[max_count]; + private final double[] sin_stepfreq = new double[max_count]; + private final double[] sin_step = new double[max_count]; private double control_time = 0; private double sin_factor = 0; - private static double PI2 = 2.0 * Math.PI; + private static final double PI2 = 2.0 * Math.PI; public SoftLowFrequencyOscillator() { // If sin_step is 0 then sin_stepfreq must be -INF diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java index b4bbe656671..02ce9e02518 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ import javax.sound.sampled.AudioSystem; * * @author Karl Helgason */ -public class SoftMainMixer { +public final class SoftMainMixer { // A private class thats contains a ModelChannelMixer and it's private buffers. // This becomes necessary when we want to have separate delay buffers for each channel mixer. @@ -67,13 +67,13 @@ public class SoftMainMixer { public final static int CHANNEL_RIGHT_DRY = 11; public final static int CHANNEL_SCRATCH1 = 12; public final static int CHANNEL_SCRATCH2 = 13; - protected boolean active_sensing_on = false; + boolean active_sensing_on = false; private long msec_last_activity = -1; private boolean pusher_silent = false; private int pusher_silent_count = 0; private long sample_pos = 0; - protected boolean readfully = true; - private Object control_mutex; + boolean readfully = true; + private final Object control_mutex; private SoftSynthesizer synth; private float samplerate = 44100; private int nrofchannels = 2; @@ -84,7 +84,7 @@ public class SoftMainMixer { private SoftAudioProcessor agc; private long msec_buffer_len = 0; private int buffer_len = 0; - protected TreeMap midimessages = new TreeMap(); + TreeMap midimessages = new TreeMap(); private int delay_midievent = 0; private int max_delay_midievent = 0; double last_volume_left = 1.0; @@ -97,7 +97,7 @@ public class SoftMainMixer { private Set registeredMixers = null; private Set stoppedMixers = null; private SoftChannelMixerContainer[] cur_registeredMixers = null; - protected SoftControl co_master = new SoftControl() { + SoftControl co_master = new SoftControl() { double[] balance = co_master_balance; double[] volume = co_master_volume; @@ -438,7 +438,7 @@ public class SoftMainMixer { delay_midievent = 0; } - protected void processAudioBuffers() { + void processAudioBuffers() { if(synth.weakstream != null && synth.weakstream.silent_samples != 0) { @@ -859,16 +859,16 @@ public class SoftMainMixer { InputStream in = new InputStream() { - private SoftAudioBuffer[] buffers = SoftMainMixer.this.buffers; - private int nrofchannels + private final SoftAudioBuffer[] buffers = SoftMainMixer.this.buffers; + private final int nrofchannels = SoftMainMixer.this.synth.getFormat().getChannels(); - private int buffersize = buffers[0].getSize(); - private byte[] bbuffer = new byte[buffersize + private final int buffersize = buffers[0].getSize(); + private final byte[] bbuffer = new byte[buffersize * (SoftMainMixer.this.synth.getFormat() .getSampleSizeInBits() / 8) * nrofchannels]; private int bbuffer_pos = 0; - private byte[] single = new byte[1]; + private final byte[] single = new byte[1]; public void fillBuffer() { /* diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java b/jdk/src/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java index 999e2560c0c..48ae72fcb02 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import javax.sound.sampled.spi.AudioFileReader; * * @author Karl Helgason */ -public class SoftMidiAudioFileReader extends AudioFileReader { +public final class SoftMidiAudioFileReader extends AudioFileReader { public static final Type MIDI = new Type("MIDI", "mid"); private static AudioFormat format = new AudioFormat(44100, 16, 2, true, false); diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingClip.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingClip.java index 229cdbff6f2..bcf67f3b554 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingClip.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingClip.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import javax.sound.sampled.LineUnavailableException; * * @author Karl Helgason */ -public class SoftMixingClip extends SoftMixingDataLine implements Clip { +public final class SoftMixingClip extends SoftMixingDataLine implements Clip { private AudioFormat format; @@ -50,7 +50,7 @@ public class SoftMixingClip extends SoftMixingDataLine implements Clip { private byte[] data; - private InputStream datastream = new InputStream() { + private final InputStream datastream = new InputStream() { public int read() throws IOException { byte[] b = new byte[1]; @@ -162,7 +162,7 @@ public class SoftMixingClip extends SoftMixingDataLine implements Clip { private AudioFloatInputStream afis; - protected SoftMixingClip(SoftMixingMixer mixer, DataLine.Info info) { + SoftMixingClip(SoftMixingMixer mixer, DataLine.Info info) { super(mixer, info); } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java index baaf9e844d9..b7793062764 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,22 +50,22 @@ public abstract class SoftMixingDataLine implements DataLine { "Chorus Send") { }; - protected static class AudioFloatInputStreamResampler extends + protected static final class AudioFloatInputStreamResampler extends AudioFloatInputStream { - private AudioFloatInputStream ais; + private final AudioFloatInputStream ais; - private AudioFormat targetFormat; + private final AudioFormat targetFormat; private float[] skipbuffer; private SoftAbstractResampler resampler; - private float[] pitch = new float[1]; + private final float[] pitch = new float[1]; - private float[] ibuffer2; + private final float[] ibuffer2; - private float[][] ibuffer; + private final float[][] ibuffer; private float ibuffer_index = 0; @@ -75,15 +75,15 @@ public abstract class SoftMixingDataLine implements DataLine { private float[][] cbuffer; - private int buffer_len = 512; + private final int buffer_len = 512; - private int pad; + private final int pad; - private int pad2; + private final int pad2; - private float[] ix = new float[1]; + private final float[] ix = new float[1]; - private int[] ox = new int[1]; + private final int[] ox = new int[1]; private float[][] mark_ibuffer = null; @@ -294,7 +294,7 @@ public abstract class SoftMixingDataLine implements DataLine { } - private class Gain extends FloatControl { + private final class Gain extends FloatControl { private Gain() { @@ -308,7 +308,7 @@ public abstract class SoftMixingDataLine implements DataLine { } } - private class Mute extends BooleanControl { + private final class Mute extends BooleanControl { private Mute() { super(BooleanControl.Type.MUTE, false, "True", "False"); @@ -320,7 +320,7 @@ public abstract class SoftMixingDataLine implements DataLine { } } - private class ApplyReverb extends BooleanControl { + private final class ApplyReverb extends BooleanControl { private ApplyReverb() { super(BooleanControl.Type.APPLY_REVERB, false, "True", "False"); @@ -333,7 +333,7 @@ public abstract class SoftMixingDataLine implements DataLine { } - private class Balance extends FloatControl { + private final class Balance extends FloatControl { private Balance() { super(FloatControl.Type.BALANCE, -1.0f, 1.0f, (1.0f / 128.0f), -1, @@ -347,7 +347,7 @@ public abstract class SoftMixingDataLine implements DataLine { } - private class Pan extends FloatControl { + private final class Pan extends FloatControl { private Pan() { super(FloatControl.Type.PAN, -1.0f, 1.0f, (1.0f / 128.0f), -1, @@ -365,7 +365,7 @@ public abstract class SoftMixingDataLine implements DataLine { } - private class ReverbSend extends FloatControl { + private final class ReverbSend extends FloatControl { private ReverbSend() { super(FloatControl.Type.REVERB_SEND, -80f, 6.0206f, 80f / 128.0f, @@ -379,7 +379,7 @@ public abstract class SoftMixingDataLine implements DataLine { } - private class ChorusSend extends FloatControl { + private final class ChorusSend extends FloatControl { private ChorusSend() { super(CHORUS_SEND, -80f, 6.0206f, 80f / 128.0f, -1, -80f, "dB", @@ -393,43 +393,43 @@ public abstract class SoftMixingDataLine implements DataLine { } - private Gain gain_control = new Gain(); + private final Gain gain_control = new Gain(); - private Mute mute_control = new Mute(); + private final Mute mute_control = new Mute(); - private Balance balance_control = new Balance(); + private final Balance balance_control = new Balance(); - private Pan pan_control = new Pan(); + private final Pan pan_control = new Pan(); - private ReverbSend reverbsend_control = new ReverbSend(); + private final ReverbSend reverbsend_control = new ReverbSend(); - private ChorusSend chorussend_control = new ChorusSend(); + private final ChorusSend chorussend_control = new ChorusSend(); - private ApplyReverb apply_reverb = new ApplyReverb(); + private final ApplyReverb apply_reverb = new ApplyReverb(); - private Control[] controls; + private final Control[] controls; - protected float leftgain = 1; + float leftgain = 1; - protected float rightgain = 1; + float rightgain = 1; - protected float eff1gain = 0; + float eff1gain = 0; - protected float eff2gain = 0; + float eff2gain = 0; - protected List listeners = new ArrayList(); + List listeners = new ArrayList(); - protected Object control_mutex; + final Object control_mutex; - protected SoftMixingMixer mixer; + SoftMixingMixer mixer; - protected DataLine.Info info; + DataLine.Info info; protected abstract void processControlLogic(); protected abstract void processAudioLogic(SoftAudioBuffer[] buffers); - protected SoftMixingDataLine(SoftMixingMixer mixer, DataLine.Info info) { + SoftMixingDataLine(SoftMixingMixer mixer, DataLine.Info info) { this.mixer = mixer; this.info = info; this.control_mutex = mixer.control_mutex; @@ -440,7 +440,7 @@ public abstract class SoftMixingDataLine implements DataLine { calcVolume(); } - protected void calcVolume() { + final void calcVolume() { synchronized (control_mutex) { double gain = Math.pow(10.0, gain_control.getValue() / 20.0); if (mute_control.getValue()) @@ -466,7 +466,7 @@ public abstract class SoftMixingDataLine implements DataLine { } } - protected void sendEvent(LineEvent event) { + final void sendEvent(LineEvent event) { if (listeners.size() == 0) return; LineListener[] listener_array = listeners @@ -476,23 +476,23 @@ public abstract class SoftMixingDataLine implements DataLine { } } - public void addLineListener(LineListener listener) { + public final void addLineListener(LineListener listener) { synchronized (control_mutex) { listeners.add(listener); } } - public void removeLineListener(LineListener listener) { + public final void removeLineListener(LineListener listener) { synchronized (control_mutex) { listeners.add(listener); } } - public javax.sound.sampled.Line.Info getLineInfo() { + public final javax.sound.sampled.Line.Info getLineInfo() { return info; } - public Control getControl(Type control) { + public final Control getControl(Type control) { if (control != null) { for (int i = 0; i < controls.length; i++) { if (controls[i].getType() == control) { @@ -504,11 +504,11 @@ public abstract class SoftMixingDataLine implements DataLine { + control); } - public Control[] getControls() { + public final Control[] getControls() { return Arrays.copyOf(controls, controls.length); } - public boolean isControlSupported(Type control) { + public final boolean isControlSupported(Type control) { if (control != null) { for (int i = 0; i < controls.length; i++) { if (controls[i].getType() == control) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMainMixer.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMainMixer.java index 88a37634cb5..43e796ff14f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMainMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMainMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import javax.sound.sampled.AudioSystem; * * @author Karl Helgason */ -public class SoftMixingMainMixer { +public final class SoftMixingMainMixer { public final static int CHANNEL_LEFT = 0; @@ -63,23 +63,23 @@ public class SoftMixingMainMixer { public final static int CHANNEL_CHANNELMIXER_RIGHT = 15; - private SoftMixingMixer mixer; + private final SoftMixingMixer mixer; - private AudioInputStream ais; + private final AudioInputStream ais; - private SoftAudioBuffer[] buffers; + private final SoftAudioBuffer[] buffers; - private SoftAudioProcessor reverb; + private final SoftAudioProcessor reverb; - private SoftAudioProcessor chorus; + private final SoftAudioProcessor chorus; - private SoftAudioProcessor agc; + private final SoftAudioProcessor agc; - private int nrofchannels; + private final int nrofchannels; - private Object control_mutex; + private final Object control_mutex; - private List openLinesList = new ArrayList(); + private final List openLinesList = new ArrayList(); private SoftMixingDataLine[] openLines = new SoftMixingDataLine[0]; @@ -87,7 +87,7 @@ public class SoftMixingMainMixer { return ais; } - protected void processAudioBuffers() { + void processAudioBuffers() { for (int i = 0; i < buffers.length; i++) { buffers[i].clear(); } @@ -162,20 +162,20 @@ public class SoftMixingMainMixer { InputStream in = new InputStream() { - private SoftAudioBuffer[] buffers = SoftMixingMainMixer.this.buffers; + private final SoftAudioBuffer[] buffers = SoftMixingMainMixer.this.buffers; - private int nrofchannels = SoftMixingMainMixer.this.mixer + private final int nrofchannels = SoftMixingMainMixer.this.mixer .getFormat().getChannels(); - private int buffersize = buffers[0].getSize(); + private final int buffersize = buffers[0].getSize(); - private byte[] bbuffer = new byte[buffersize + private final byte[] bbuffer = new byte[buffersize * (SoftMixingMainMixer.this.mixer.getFormat() .getSampleSizeInBits() / 8) * nrofchannels]; private int bbuffer_pos = 0; - private byte[] single = new byte[1]; + private final byte[] single = new byte[1]; public void fillBuffer() { processAudioBuffers(); diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java index abc31cb8fa1..9df5641ab13 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,27 +48,27 @@ import javax.sound.sampled.Control.Type; * * @author Karl Helgason */ -public class SoftMixingMixer implements Mixer { +public final class SoftMixingMixer implements Mixer { private static class Info extends Mixer.Info { - public Info() { + Info() { super(INFO_NAME, INFO_VENDOR, INFO_DESCRIPTION, INFO_VERSION); } } - protected static final String INFO_NAME = "Gervill Sound Mixer"; + static final String INFO_NAME = "Gervill Sound Mixer"; - protected static final String INFO_VENDOR = "OpenJDK Proposal"; + static final String INFO_VENDOR = "OpenJDK Proposal"; - protected static final String INFO_DESCRIPTION = "Software Sound Mixer"; + static final String INFO_DESCRIPTION = "Software Sound Mixer"; - protected static final String INFO_VERSION = "1.0"; + static final String INFO_VERSION = "1.0"; - protected final static Mixer.Info info = new Info(); + static final Mixer.Info info = new Info(); - protected Object control_mutex = this; + final Object control_mutex = this; - protected boolean implicitOpen = false; + boolean implicitOpen = false; private boolean open = false; @@ -82,15 +82,15 @@ public class SoftMixingMixer implements Mixer { private AudioInputStream pusher_stream = null; - private float controlrate = 147f; + private final float controlrate = 147f; - private long latency = 100000; // 100 msec + private final long latency = 100000; // 100 msec - private boolean jitter_correction = false; + private final boolean jitter_correction = false; - private List listeners = new ArrayList(); + private final List listeners = new ArrayList(); - private javax.sound.sampled.Line.Info[] sourceLineInfo; + private final javax.sound.sampled.Line.Info[] sourceLineInfo; public SoftMixingMixer() { @@ -516,11 +516,11 @@ public class SoftMixingMixer implements Mixer { } } - protected float getControlRate() { + float getControlRate() { return controlrate; } - protected SoftMixingMainMixer getMainMixer() { + SoftMixingMainMixer getMainMixer() { if (!isOpen()) return null; return mainmixer; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixerProvider.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixerProvider.java index 862aeff97cf..7b842f50495 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixerProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,13 +33,13 @@ import javax.sound.sampled.spi.MixerProvider; * * @author Karl Helgason */ -public class SoftMixingMixerProvider extends MixerProvider { +public final class SoftMixingMixerProvider extends MixerProvider { static SoftMixingMixer globalmixer = null; static Thread lockthread = null; - protected final static Object mutex = new Object(); + static final Object mutex = new Object(); public Mixer getMixer(Info info) { if (!(info == null || info == SoftMixingMixer.info)) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java index 2f7cdbaa389..d827770a514 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,8 +41,8 @@ import javax.sound.sampled.SourceDataLine; * * @author Karl Helgason */ -public class SoftMixingSourceDataLine extends SoftMixingDataLine implements - SourceDataLine { +public final class SoftMixingSourceDataLine extends SoftMixingDataLine + implements SourceDataLine { private boolean open = false; @@ -72,7 +72,7 @@ public class SoftMixingSourceDataLine extends SoftMixingDataLine implements AudioFloatInputStream { AudioFloatInputStream ais; - public NonBlockingFloatInputStream(AudioFloatInputStream ais) { + NonBlockingFloatInputStream(AudioFloatInputStream ais) { this.ais = ais; } @@ -120,7 +120,7 @@ public class SoftMixingSourceDataLine extends SoftMixingDataLine implements } - protected SoftMixingSourceDataLine(SoftMixingMixer mixer, DataLine.Info info) { + SoftMixingSourceDataLine(SoftMixingMixer mixer, DataLine.Info info) { super(mixer, info); } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java b/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java index 274f8daf51c..905bdb3128e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftPerformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.Map; * * @author Karl Helgason */ -public class SoftPerformer { +public final class SoftPerformer { static ModelConnectionBlock[] defaultconnections = new ModelConnectionBlock[42]; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftPointResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftPointResampler.java index 5aff93ef90b..4256eaba255 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftPointResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftPointResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftPointResampler extends SoftAbstractResampler { +public final class SoftPointResampler extends SoftAbstractResampler { public int getPadding() { return 100; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftProvider.java b/jdk/src/share/classes/com/sun/media/sound/SoftProvider.java index bf3c45eb7fb..9fe8ad07390 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftProvider.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,10 +34,10 @@ import javax.sound.midi.spi.MidiDeviceProvider; * * @author Karl Helgason */ -public class SoftProvider extends MidiDeviceProvider { +public final class SoftProvider extends MidiDeviceProvider { - protected final static Info softinfo = SoftSynthesizer.info; - private static Info[] softinfos = {softinfo}; + static final Info softinfo = SoftSynthesizer.info; + private static final Info[] softinfos = {softinfo}; public MidiDevice.Info[] getDeviceInfo() { return Arrays.copyOf(softinfos, softinfos.length); diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java b/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java index 7edd02fdaad..9a0d9c0e84a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,13 +36,13 @@ import javax.sound.midi.ShortMessage; * * @author Karl Helgason */ -public class SoftReceiver implements MidiDeviceReceiver { +public final class SoftReceiver implements MidiDeviceReceiver { - protected boolean open = true; - private Object control_mutex; - private SoftSynthesizer synth; - protected TreeMap midimessages; - protected SoftMainMixer mainmixer; + boolean open = true; + private final Object control_mutex; + private final SoftSynthesizer synth; + TreeMap midimessages; + SoftMainMixer mainmixer; public SoftReceiver(SoftSynthesizer synth) { this.control_mutex = synth.control_mutex; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java b/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java index e72a8bd495a..c30aae03f6d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,14 +33,14 @@ import java.util.Arrays; * * @author Karl Helgason */ -public class SoftReverb implements SoftAudioProcessor { +public final class SoftReverb implements SoftAudioProcessor { private final static class Delay { private float[] delaybuffer; private int rovepos = 0; - public Delay() { + Delay() { delaybuffer = null; } @@ -77,7 +77,7 @@ public class SoftReverb implements SoftAudioProcessor { private int rovepos = 0; private float feedback; - public AllPass(int size) { + AllPass(int size) { delaybuffer = new float[size]; delaybuffersize = size; } @@ -127,7 +127,7 @@ public class SoftReverb implements SoftAudioProcessor { private float filtercoeff1 = 0; private float filtercoeff2 = 1; - public Comb(int size) { + Comb(int size) { delaybuffer = new float[size]; delaybuffersize = size; } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftShortMessage.java b/jdk/src/share/classes/com/sun/media/sound/SoftShortMessage.java index 3b5911c6a6c..f2122601c69 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftShortMessage.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftShortMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import javax.sound.midi.ShortMessage; * * @author Karl Helgason */ -public class SoftShortMessage extends ShortMessage { +public final class SoftShortMessage extends ShortMessage { int channel = 0; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSincResampler.java b/jdk/src/share/classes/com/sun/media/sound/SoftSincResampler.java index e3ba92742cc..051e44120e8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftSincResampler.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftSincResampler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ package com.sun.media.sound; * * @author Karl Helgason */ -public class SoftSincResampler extends SoftAbstractResampler { +public final class SoftSincResampler extends SoftAbstractResampler { float[][][] sinc_table; int sinc_scale_size = 100; diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java index a868bd441a2..01a64c2dddf 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,10 +66,10 @@ import javax.sound.sampled.SourceDataLine; * * @author Karl Helgason */ -public class SoftSynthesizer implements AudioSynthesizer, +public final class SoftSynthesizer implements AudioSynthesizer, ReferenceCountingDevice { - protected static class WeakAudioStream extends InputStream + protected static final class WeakAudioStream extends InputStream { private volatile AudioInputStream stream; public SoftAudioPusher pusher = null; @@ -166,39 +166,39 @@ public class SoftSynthesizer implements AudioSynthesizer, } private static class Info extends MidiDevice.Info { - public Info() { + Info() { super(INFO_NAME, INFO_VENDOR, INFO_DESCRIPTION, INFO_VERSION); } } - protected static final String INFO_NAME = "Gervill"; - protected static final String INFO_VENDOR = "OpenJDK"; - protected static final String INFO_DESCRIPTION = "Software MIDI Synthesizer"; - protected static final String INFO_VERSION = "1.0"; - protected final static MidiDevice.Info info = new Info(); + static final String INFO_NAME = "Gervill"; + static final String INFO_VENDOR = "OpenJDK"; + static final String INFO_DESCRIPTION = "Software MIDI Synthesizer"; + static final String INFO_VERSION = "1.0"; + final static MidiDevice.Info info = new Info(); private static SourceDataLine testline = null; private static Soundbank defaultSoundBank = null; - protected WeakAudioStream weakstream = null; + WeakAudioStream weakstream = null; - protected Object control_mutex = this; + final Object control_mutex = this; - protected int voiceIDCounter = 0; + int voiceIDCounter = 0; // 0: default // 1: DLS Voice Allocation - protected int voice_allocation_mode = 0; + int voice_allocation_mode = 0; - protected boolean load_default_soundbank = false; - protected boolean reverb_light = true; - protected boolean reverb_on = true; - protected boolean chorus_on = true; - protected boolean agc_on = true; + boolean load_default_soundbank = false; + boolean reverb_light = true; + boolean reverb_on = true; + boolean chorus_on = true; + boolean agc_on = true; - protected SoftChannel[] channels; - protected SoftChannelProxy[] external_channels = null; + SoftChannel[] channels; + SoftChannelProxy[] external_channels = null; private boolean largemode = false; @@ -371,7 +371,7 @@ public class SoftSynthesizer implements AudioSynthesizer, this.format = format; } - protected void removeReceiver(Receiver recv) { + void removeReceiver(Receiver recv) { boolean perform_close = false; synchronized (control_mutex) { if (recvslist.remove(recv)) { @@ -383,13 +383,13 @@ public class SoftSynthesizer implements AudioSynthesizer, close(); } - protected SoftMainMixer getMainMixer() { + SoftMainMixer getMainMixer() { if (!isOpen()) return null; return mainmixer; } - protected SoftInstrument findInstrument(int program, int bank, int channel) { + SoftInstrument findInstrument(int program, int bank, int channel) { // Add support for GM2 banks 0x78 and 0x79 // as specified in DLS 2.2 in Section 1.4.6 @@ -450,31 +450,31 @@ public class SoftSynthesizer implements AudioSynthesizer, return null; } - protected int getVoiceAllocationMode() { + int getVoiceAllocationMode() { return voice_allocation_mode; } - protected int getGeneralMidiMode() { + int getGeneralMidiMode() { return gmmode; } - protected void setGeneralMidiMode(int gmmode) { + void setGeneralMidiMode(int gmmode) { this.gmmode = gmmode; } - protected int getDeviceID() { + int getDeviceID() { return deviceid; } - protected float getControlRate() { + float getControlRate() { return controlrate; } - protected SoftVoice[] getVoices() { + SoftVoice[] getVoices() { return voices; } - protected SoftTuning getTuning(Patch patch) { + SoftTuning getTuning(Patch patch) { String t_id = patchToString(patch); SoftTuning tuning = tunings.get(t_id); if (tuning == null) { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftTuning.java b/jdk/src/share/classes/com/sun/media/sound/SoftTuning.java index 611db14e527..b3cb6c52e91 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftTuning.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftTuning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,10 +35,10 @@ import javax.sound.midi.Patch; * * @author Karl Helgason */ -public class SoftTuning { +public final class SoftTuning { private String name = null; - private double[] tuning = new double[128]; + private final double[] tuning = new double[128]; private Patch patch = null; public SoftTuning() { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java index b4189487877..ea2cff03531 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ import javax.sound.midi.VoiceStatus; * * @author Karl Helgason */ -public class SoftVoice extends VoiceStatus { +public final class SoftVoice extends VoiceStatus { public int exclusiveClass = 0; public boolean releaseTriggered = false; @@ -44,32 +44,32 @@ public class SoftVoice extends VoiceStatus { private int noteOn_velocity = 0; private int noteOff_velocity = 0; private int delay = 0; - protected ModelChannelMixer channelmixer = null; - protected double tunedKey = 0; - protected SoftTuning tuning = null; - protected SoftChannel stealer_channel = null; - protected ModelConnectionBlock[] stealer_extendedConnectionBlocks = null; - protected SoftPerformer stealer_performer = null; - protected ModelChannelMixer stealer_channelmixer = null; - protected int stealer_voiceID = -1; - protected int stealer_noteNumber = 0; - protected int stealer_velocity = 0; - protected boolean stealer_releaseTriggered = false; - protected int voiceID = -1; - protected boolean sustain = false; - protected boolean sostenuto = false; - protected boolean portamento = false; - private SoftFilter filter_left; - private SoftFilter filter_right; - private SoftProcess eg = new SoftEnvelopeGenerator(); - private SoftProcess lfo = new SoftLowFrequencyOscillator(); - protected Map objects = + ModelChannelMixer channelmixer = null; + double tunedKey = 0; + SoftTuning tuning = null; + SoftChannel stealer_channel = null; + ModelConnectionBlock[] stealer_extendedConnectionBlocks = null; + SoftPerformer stealer_performer = null; + ModelChannelMixer stealer_channelmixer = null; + int stealer_voiceID = -1; + int stealer_noteNumber = 0; + int stealer_velocity = 0; + boolean stealer_releaseTriggered = false; + int voiceID = -1; + boolean sustain = false; + boolean sostenuto = false; + boolean portamento = false; + private final SoftFilter filter_left; + private final SoftFilter filter_right; + private final SoftProcess eg = new SoftEnvelopeGenerator(); + private final SoftProcess lfo = new SoftLowFrequencyOscillator(); + Map objects = new HashMap(); - protected SoftSynthesizer synthesizer; - protected SoftInstrument instrument; - protected SoftPerformer performer; - protected SoftChannel softchannel = null; - protected boolean on = false; + SoftSynthesizer synthesizer; + SoftInstrument instrument; + SoftPerformer performer; + SoftChannel softchannel = null; + boolean on = false; private boolean audiostarted = false; private boolean started = false; private boolean stopping = false; @@ -87,7 +87,7 @@ public class SoftVoice extends VoiceStatus { private float last_out_mixer_right = 0; private float last_out_mixer_effect1 = 0; private float last_out_mixer_effect2 = 0; - protected ModelConnectionBlock[] extendedConnectionBlocks = null; + ModelConnectionBlock[] extendedConnectionBlocks = null; private ModelConnectionBlock[] connections; // Last value added to destination private double[] connections_last = new double[50]; @@ -100,10 +100,10 @@ public class SoftVoice extends VoiceStatus { private boolean soundoff = false; private float lastMuteValue = 0; private float lastSoloMuteValue = 0; - protected double[] co_noteon_keynumber = new double[1]; - protected double[] co_noteon_velocity = new double[1]; - protected double[] co_noteon_on = new double[1]; - private SoftControl co_noteon = new SoftControl() { + double[] co_noteon_keynumber = new double[1]; + double[] co_noteon_velocity = new double[1]; + double[] co_noteon_on = new double[1]; + private final SoftControl co_noteon = new SoftControl() { double[] keynumber = co_noteon_keynumber; double[] velocity = co_noteon_velocity; double[] on = co_noteon_on; @@ -119,13 +119,13 @@ public class SoftVoice extends VoiceStatus { return null; } }; - private double[] co_mixer_active = new double[1]; - private double[] co_mixer_gain = new double[1]; - private double[] co_mixer_pan = new double[1]; - private double[] co_mixer_balance = new double[1]; - private double[] co_mixer_reverb = new double[1]; - private double[] co_mixer_chorus = new double[1]; - private SoftControl co_mixer = new SoftControl() { + private final double[] co_mixer_active = new double[1]; + private final double[] co_mixer_gain = new double[1]; + private final double[] co_mixer_pan = new double[1]; + private final double[] co_mixer_balance = new double[1]; + private final double[] co_mixer_reverb = new double[1]; + private final double[] co_mixer_chorus = new double[1]; + private final SoftControl co_mixer = new SoftControl() { double[] active = co_mixer_active; double[] gain = co_mixer_gain; double[] pan = co_mixer_pan; @@ -150,8 +150,8 @@ public class SoftVoice extends VoiceStatus { return null; } }; - private double[] co_osc_pitch = new double[1]; - private SoftControl co_osc = new SoftControl() { + private final double[] co_osc_pitch = new double[1]; + private final SoftControl co_osc = new SoftControl() { double[] pitch = co_osc_pitch; public double[] get(int instance, String name) { if (name == null) @@ -161,10 +161,10 @@ public class SoftVoice extends VoiceStatus { return null; } }; - private double[] co_filter_freq = new double[1]; - private double[] co_filter_type = new double[1]; - private double[] co_filter_q = new double[1]; - private SoftControl co_filter = new SoftControl() { + private final double[] co_filter_freq = new double[1]; + private final double[] co_filter_type = new double[1]; + private final double[] co_filter_q = new double[1]; + private final SoftControl co_filter = new SoftControl() { double[] freq = co_filter_freq; double[] ftype = co_filter_type; double[] q = co_filter_q; @@ -180,8 +180,8 @@ public class SoftVoice extends VoiceStatus { return null; } }; - protected SoftResamplerStreamer resampler; - private int nrofchannels; + SoftResamplerStreamer resampler; + private final int nrofchannels; public SoftVoice(SoftSynthesizer synth) { synthesizer = synth; @@ -278,7 +278,7 @@ public class SoftVoice extends VoiceStatus { // co_mixer_gain[0] = 0; } - protected void updateTuning(SoftTuning newtuning) { + void updateTuning(SoftTuning newtuning) { tuning = newtuning; tunedKey = tuning.getTuning(note) / 100.0; if (!portamento) { @@ -293,12 +293,12 @@ public class SoftVoice extends VoiceStatus { } } - protected void setNote(int noteNumber) { + void setNote(int noteNumber) { note = noteNumber; tunedKey = tuning.getTuning(noteNumber) / 100.0; } - protected void noteOn(int noteNumber, int velocity, int delay) { + void noteOn(int noteNumber, int velocity, int delay) { sustain = false; sostenuto = false; @@ -435,7 +435,7 @@ public class SoftVoice extends VoiceStatus { } - protected void setPolyPressure(int pressure) { + void setPolyPressure(int pressure) { if(performer == null) return; int[] c = performer.midi_connections[2]; @@ -445,7 +445,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void setChannelPressure(int pressure) { + void setChannelPressure(int pressure) { if(performer == null) return; int[] c = performer.midi_connections[1]; @@ -455,7 +455,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void controlChange(int controller, int value) { + void controlChange(int controller, int value) { if(performer == null) return; int[] c = performer.midi_ctrl_connections[controller]; @@ -465,7 +465,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void nrpnChange(int controller, int value) { + void nrpnChange(int controller, int value) { if(performer == null) return; int[] c = performer.midi_nrpn_connections.get(controller); @@ -475,7 +475,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void rpnChange(int controller, int value) { + void rpnChange(int controller, int value) { if(performer == null) return; int[] c = performer.midi_rpn_connections.get(controller); @@ -485,7 +485,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void setPitchBend(int bend) { + void setPitchBend(int bend) { if(performer == null) return; int[] c = performer.midi_connections[0]; @@ -495,19 +495,19 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void setMute(boolean mute) { + void setMute(boolean mute) { co_mixer_gain[0] -= lastMuteValue; lastMuteValue = mute ? -960 : 0; co_mixer_gain[0] += lastMuteValue; } - protected void setSoloMute(boolean mute) { + void setSoloMute(boolean mute) { co_mixer_gain[0] -= lastSoloMuteValue; lastSoloMuteValue = mute ? -960 : 0; co_mixer_gain[0] += lastSoloMuteValue; } - protected void shutdown() { + void shutdown() { if (co_noteon_on[0] < -0.5) return; on = false; @@ -523,12 +523,12 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void soundOff() { + void soundOff() { on = false; soundoff = true; } - protected void noteOff(int velocity) { + void noteOff(int velocity) { if (!on) return; on = false; @@ -553,7 +553,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void redamp() { + void redamp() { if (co_noteon_on[0] > 0.5) return; if (co_noteon_on[0] < -0.5) @@ -571,7 +571,7 @@ public class SoftVoice extends VoiceStatus { processConnection(c[i]); } - protected void processControlLogic() { + void processControlLogic() { if (stopping) { active = false; stopping = false; @@ -760,9 +760,9 @@ public class SoftVoice extends VoiceStatus { } - protected void mixAudioStream(SoftAudioBuffer in, SoftAudioBuffer out, - SoftAudioBuffer dout, - float amp_from, float amp_to) { + void mixAudioStream(SoftAudioBuffer in, SoftAudioBuffer out, + SoftAudioBuffer dout, float amp_from, + float amp_to) { int bufferlen = in.getSize(); if (amp_from < 0.000000001 && amp_to < 0.000000001) return; @@ -815,7 +815,7 @@ public class SoftVoice extends VoiceStatus { } - protected void processAudioLogic(SoftAudioBuffer[] buffer) { + void processAudioLogic(SoftAudioBuffer[] buffer) { if (!audiostarted) return; diff --git a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java index 5dd2c23354a..1dbd72a262a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,22 +26,13 @@ package com.sun.media.sound; import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.SequenceInputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import java.io.EOFException; -import java.io.OutputStream; -import java.io.RandomAccessFile; import java.io.BufferedInputStream; import java.net.URL; -import java.net.MalformedURLException; import javax.sound.midi.MidiFileFormat; import javax.sound.midi.InvalidMidiDataException; @@ -49,7 +40,6 @@ import javax.sound.midi.MetaMessage; import javax.sound.midi.MidiEvent; import javax.sound.midi.MidiMessage; import javax.sound.midi.Sequence; -import javax.sound.midi.ShortMessage; import javax.sound.midi.SysexMessage; import javax.sound.midi.Track; import javax.sound.midi.spi.MidiFileReader; @@ -64,23 +54,12 @@ import javax.sound.midi.spi.MidiFileReader; * @author Florian Bomers */ -public class StandardMidiFileReader extends MidiFileReader { +public final class StandardMidiFileReader extends MidiFileReader { private static final int MThd_MAGIC = 0x4d546864; // 'MThd' - private static final int MIDI_TYPE_0 = 0; - private static final int MIDI_TYPE_1 = 1; - private static final int bisBufferSize = 1024; // buffer size in buffered input streams - /** - * MIDI parser types - */ - private static final int types[] = { - MIDI_TYPE_0, - MIDI_TYPE_1 - }; - public MidiFileFormat getMidiFileFormat(InputStream stream) throws InvalidMidiDataException, IOException { return getMidiFileFormatFromStream(stream, MidiFileFormat.UNKNOWN_LENGTH, null); } @@ -253,7 +232,7 @@ public class StandardMidiFileReader extends MidiFileReader { /** * State variables during parsing of a MIDI file */ -class SMFParser { +final class SMFParser { private static final int MTrk_MAGIC = 0x4d54726b; // 'MTrk' // set to true to not allow corrupt MIDI files tombe loaded @@ -268,7 +247,7 @@ class SMFParser { private byte[] trackData = null; private int pos = 0; - public SMFParser() { + SMFParser() { } private int readUnsigned() throws IOException { diff --git a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java index a779fd7e226..97e0dc2928a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ package com.sun.media.sound; -import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; @@ -34,18 +33,13 @@ import java.io.ByteArrayInputStream; import java.io.SequenceInputStream; import java.io.File; import java.io.FileOutputStream; -import java.io.BufferedOutputStream; import java.io.InputStream; import java.io.IOException; -import java.lang.IllegalArgumentException; import java.io.OutputStream; -import java.util.Vector; -import javax.sound.midi.MidiFileFormat; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiEvent; import javax.sound.midi.MetaMessage; -import javax.sound.midi.MidiMessage; import javax.sound.midi.Sequence; import javax.sound.midi.ShortMessage; import javax.sound.midi.SysexMessage; @@ -59,7 +53,7 @@ import javax.sound.midi.spi.MidiFileWriter; * @author Kara Kytle * @author Jan Borgersen */ -public class StandardMidiFileWriter extends MidiFileWriter { +public final class StandardMidiFileWriter extends MidiFileWriter { private static final int MThd_MAGIC = 0x4d546864; // 'MThd' private static final int MTrk_MAGIC = 0x4d54726b; // 'MTrk' diff --git a/jdk/src/share/classes/com/sun/media/sound/SunCodec.java b/jdk/src/share/classes/com/sun/media/sound/SunCodec.java index fa3940667ba..232789352c5 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SunCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/SunCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package com.sun.media.sound; -import java.io.InputStream; - import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -48,14 +46,14 @@ import javax.sound.sampled.spi.FormatConversionProvider; */ abstract class SunCodec extends FormatConversionProvider { - AudioFormat.Encoding[] inputEncodings; - AudioFormat.Encoding[] outputEncodings; + private final AudioFormat.Encoding[] inputEncodings; + private final AudioFormat.Encoding[] outputEncodings; /** * Constructs a new codec object. */ - protected SunCodec(AudioFormat.Encoding[] inputEncodings, AudioFormat.Encoding[] outputEncodings) { - + SunCodec(final AudioFormat.Encoding[] inputEncodings, + final AudioFormat.Encoding[] outputEncodings) { this.inputEncodings = inputEncodings; this.outputEncodings = outputEncodings; } @@ -63,16 +61,14 @@ abstract class SunCodec extends FormatConversionProvider { /** */ - public AudioFormat.Encoding[] getSourceEncodings() { - + public final AudioFormat.Encoding[] getSourceEncodings() { AudioFormat.Encoding[] encodings = new AudioFormat.Encoding[inputEncodings.length]; System.arraycopy(inputEncodings, 0, encodings, 0, inputEncodings.length); return encodings; } /** */ - public AudioFormat.Encoding[] getTargetEncodings() { - + public final AudioFormat.Encoding[] getTargetEncodings() { AudioFormat.Encoding[] encodings = new AudioFormat.Encoding[outputEncodings.length]; System.arraycopy(outputEncodings, 0, encodings, 0, outputEncodings.length); return encodings; diff --git a/jdk/src/share/classes/com/sun/media/sound/SunFileReader.java b/jdk/src/share/classes/com/sun/media/sound/SunFileReader.java index 67418fe679b..202b94fb15f 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SunFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/SunFileReader.java @@ -27,7 +27,6 @@ package com.sun.media.sound; import java.io.File; import java.io.InputStream; -import java.io.OutputStream; import java.io.IOException; import java.io.DataInputStream; import java.net.URL; @@ -52,7 +51,7 @@ abstract class SunFileReader extends AudioFileReader { /** * Constructs a new SunFileReader object. */ - public SunFileReader() { + SunFileReader() { } @@ -167,7 +166,7 @@ abstract class SunFileReader extends AudioFileReader { * @return 32 bits swapped value. * @exception IOException */ - protected int rllong(DataInputStream dis) throws IOException { + final int rllong(DataInputStream dis) throws IOException { int b1, b2, b3, b4 ; int i = 0; @@ -190,7 +189,7 @@ abstract class SunFileReader extends AudioFileReader { * @param int * @return 32 bits swapped value */ - protected int big2little(int i) { + final int big2little(int i) { int b1, b2, b3, b4 ; @@ -211,7 +210,7 @@ abstract class SunFileReader extends AudioFileReader { * @return the swapped value. * @exception IOException */ - protected short rlshort(DataInputStream dis) throws IOException { + final short rlshort(DataInputStream dis) throws IOException { short s=0; short high, low; @@ -232,7 +231,7 @@ abstract class SunFileReader extends AudioFileReader { * @param int * @return 16 bits swapped value */ - protected short big2littleShort(short i) { + final short big2littleShort(short i) { short high, low; @@ -244,16 +243,14 @@ abstract class SunFileReader extends AudioFileReader { return i; } - - /** Calculates the frame size for PCM frames. - * Note that this method is appropriate for non-packed samples. - * For instance, 12 bit, 2 channels will return 4 bytes, not 3. - * @param sampleSizeInBits the size of a single sample in bits - * @param channels the number of channels - * @return the size of a PCM frame in bytes. - */ - protected static int calculatePCMFrameSize(int sampleSizeInBits, - int channels) { - return ((sampleSizeInBits + 7) / 8) * channels; - } + /** Calculates the frame size for PCM frames. + * Note that this method is appropriate for non-packed samples. + * For instance, 12 bit, 2 channels will return 4 bytes, not 3. + * @param sampleSizeInBits the size of a single sample in bits + * @param channels the number of channels + * @return the size of a PCM frame in bytes. + */ + static final int calculatePCMFrameSize(int sampleSizeInBits, int channels) { + return ((sampleSizeInBits + 7) / 8) * channels; + } } diff --git a/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java index b5755389478..d771bad119e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,8 +69,7 @@ abstract class SunFileWriter extends AudioFileWriter { // new, 10.27.99 - public AudioFileFormat.Type[] getAudioFileTypes(){ - + public final AudioFileFormat.Type[] getAudioFileTypes(){ AudioFileFormat.Type[] localArray = new AudioFileFormat.Type[types.length]; System.arraycopy(types, 0, localArray, 0, types.length); return localArray; @@ -95,7 +94,7 @@ abstract class SunFileWriter extends AudioFileWriter { * @return 32 bits swapped value. * @exception IOException */ - protected int rllong(DataInputStream dis) throws IOException { + final int rllong(DataInputStream dis) throws IOException { int b1, b2, b3, b4 ; int i = 0; @@ -118,7 +117,7 @@ abstract class SunFileWriter extends AudioFileWriter { * @param int * @return 32 bits swapped value */ - protected int big2little(int i) { + final int big2little(int i) { int b1, b2, b3, b4 ; @@ -139,7 +138,7 @@ abstract class SunFileWriter extends AudioFileWriter { * @return the swapped value. * @exception IOException */ - protected short rlshort(DataInputStream dis) throws IOException { + final short rlshort(DataInputStream dis) throws IOException { short s=0; short high, low; @@ -160,7 +159,7 @@ abstract class SunFileWriter extends AudioFileWriter { * @param int * @return 16 bits swapped value */ - protected short big2littleShort(short i) { + final short big2littleShort(short i) { short high, low; @@ -177,10 +176,10 @@ abstract class SunFileWriter extends AudioFileWriter { * The class is usefull for use with SequenceInputStream to prevent * closing of the source input streams. */ - protected class NoCloseInputStream extends InputStream { + final class NoCloseInputStream extends InputStream { private final InputStream in; - public NoCloseInputStream(InputStream in) { + NoCloseInputStream(InputStream in) { this.in = in; } diff --git a/jdk/src/share/classes/com/sun/media/sound/Toolkit.java b/jdk/src/share/classes/com/sun/media/sound/Toolkit.java index 6a34d1a39a2..5d52b8fe791 100644 --- a/jdk/src/share/classes/com/sun/media/sound/Toolkit.java +++ b/jdk/src/share/classes/com/sun/media/sound/Toolkit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,13 @@ import javax.sound.sampled.AudioSystem; * @author Kara Kytle * @author Florian Bomers */ -public class Toolkit { +public final class Toolkit { + /** + * Suppresses default constructor, ensuring non-instantiability. + */ + private Toolkit() { + } /** * Converts bytes from signed to unsigned. diff --git a/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java b/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java index 12e1d53740f..04fa5197b14 100644 --- a/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java +++ b/jdk/src/share/classes/com/sun/media/sound/UlawCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ package com.sun.media.sound; -import java.io.InputStream; import java.io.IOException; import java.util.Vector; @@ -40,12 +39,12 @@ import javax.sound.sampled.AudioInputStream; * * @author Kara Kytle */ -public class UlawCodec extends SunCodec { +public final class UlawCodec extends SunCodec { /* Tables used for U-law decoding */ - final static byte ULAW_TABH[] = new byte[256]; - final static byte ULAW_TABL[] = new byte[256]; + private final static byte[] ULAW_TABH = new byte[256]; + private final static byte[] ULAW_TABL = new byte[256]; private static final AudioFormat.Encoding[] ulawEncodings = {AudioFormat.Encoding.ULAW, AudioFormat.Encoding.PCM_SIGNED}; diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java index 14a1848baaf..827cef6a23a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ import javax.sound.sampled.spi.AudioFileReader; * * @author Karl Helgason */ -public class WaveExtensibleFileReader extends AudioFileReader { +public final class WaveExtensibleFileReader extends AudioFileReader { static private class GUID { long i1; @@ -74,7 +74,7 @@ public class WaveExtensibleFileReader extends AudioFileReader { private GUID() { } - public GUID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, + GUID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) { this.i1 = i1; this.s1 = s1; @@ -140,13 +140,13 @@ public class WaveExtensibleFileReader extends AudioFileReader { } - private static String[] channelnames = { "FL", "FR", "FC", "LF", + private static final String[] channelnames = { "FL", "FR", "FC", "LF", "BL", "BR", // 5.1 "FLC", "FLR", "BC", "SL", "SR", "TC", "TFL", "TFC", "TFR", "TBL", "TBC", "TBR" }; - private static String[] allchannelnames = { "w1", "w2", "w3", "w4", "w5", + private static final String[] allchannelnames = { "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8", "w9", "w10", "w11", "w12", "w13", "w14", "w15", "w16", "w17", "w18", "w19", "w20", "w21", "w22", "w23", "w24", "w25", "w26", "w27", "w28", "w29", "w30", "w31", "w32", "w33", @@ -155,10 +155,10 @@ public class WaveExtensibleFileReader extends AudioFileReader { "w52", "w53", "w54", "w55", "w56", "w57", "w58", "w59", "w60", "w61", "w62", "w63", "w64" }; - private static GUID SUBTYPE_PCM = new GUID(0x00000001, 0x0000, 0x0010, + private static final GUID SUBTYPE_PCM = new GUID(0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); - private static GUID SUBTYPE_IEEE_FLOAT = new GUID(0x00000003, 0x0000, + private static final GUID SUBTYPE_IEEE_FLOAT = new GUID(0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); private String decodeChannelMask(long channelmask) { diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFileFormat.java b/jdk/src/share/classes/com/sun/media/sound/WaveFileFormat.java index 16e4b7d9f48..af9c7160e7e 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFileFormat.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,24 +25,8 @@ package com.sun.media.sound; -import java.util.Vector; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.lang.IllegalArgumentException; - -import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.SequenceInputStream; - import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; /** @@ -51,12 +35,12 @@ import javax.sound.sampled.AudioSystem; * @author Jan Borgersen */ -class WaveFileFormat extends AudioFileFormat { +final class WaveFileFormat extends AudioFileFormat { /** * Wave format type. */ - private int waveType; + private final int waveType; //$$fb 2001-07-13: added management of header size in this class //$$fb 2002-04-16: Fix for 4636355: RIFF audio headers could be _more_ spec compliant diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java index 6386aa4100e..9ba6a6b8740 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,28 +25,17 @@ package com.sun.media.sound; -import java.util.Vector; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.io.EOFException; -import java.net.URL; -import java.net.MalformedURLException; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.DataInputStream; +import java.io.EOFException; +import java.io.File; import java.io.FileInputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.SequenceInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; @@ -59,19 +48,10 @@ import javax.sound.sampled.UnsupportedAudioFileException; * @author Jan Borgersen * @author Florian Bomers */ -public class WaveFileReader extends SunFileReader { +public final class WaveFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 12; - /** - * WAVE reader type - */ - - public static final AudioFileFormat.Type types[] = { - AudioFileFormat.Type.WAVE - }; - - /** * Constructs a new WaveFileReader object. */ diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java index d4a0a6bd5bf..c5f17e1bc8d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import javax.sound.sampled.AudioSystem; * * @author Jan Borgersen */ -public class WaveFileWriter extends SunFileWriter { +public final class WaveFileWriter extends SunFileWriter { // magic numbers static final int RIFF_MAGIC = 1380533830; @@ -73,19 +73,11 @@ public class WaveFileWriter extends SunFileWriter { static final int WAVE_FORMAT_DVI_ADPCM = 0x0011; static final int WAVE_FORMAT_SX7383 = 0x1C07; - /** - * WAVE type - */ - private static final AudioFileFormat.Type waveTypes[] = { - AudioFileFormat.Type.WAVE - }; - - /** * Constructs a new WaveFileWriter object. */ public WaveFileWriter() { - super(waveTypes); + super(new AudioFileFormat.Type[]{AudioFileFormat.Type.WAVE}); } diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java index 8db4113b702..280196ef188 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ import javax.sound.sampled.spi.AudioFileReader; * * @author Karl Helgason */ -public class WaveFloatFileReader extends AudioFileReader { +public final class WaveFloatFileReader extends AudioFileReader { public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException { diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileWriter.java index a61792bacc4..2845083384a 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileWriter.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFloatFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import javax.sound.sampled.spi.AudioFileWriter; * * @author Karl Helgason */ -public class WaveFloatFileWriter extends AudioFileWriter { +public final class WaveFloatFileWriter extends AudioFileWriter { public Type[] getAudioFileTypes() { return new Type[] { Type.WAVE }; @@ -86,9 +86,9 @@ public class WaveFloatFileWriter extends AudioFileWriter { } private static class NoCloseOutputStream extends OutputStream { - OutputStream out; + final OutputStream out; - public NoCloseOutputStream(OutputStream out) { + NoCloseOutputStream(OutputStream out) { this.out = out; } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java index d1ebe5fc730..6176370878a 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/Init.java @@ -2,38 +2,43 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security; import java.io.InputStream; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper; import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer; -import com.sun.org.apache.xml.internal.security.keys.KeyInfo; import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolver; import com.sun.org.apache.xml.internal.security.transforms.Transform; +import com.sun.org.apache.xml.internal.security.utils.ElementProxy; import com.sun.org.apache.xml.internal.security.utils.I18n; -//import com.sun.org.apache.xml.internal.security.utils.PRNG; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; import org.w3c.dom.Attr; @@ -47,367 +52,317 @@ import org.w3c.dom.Node; * the mapping of Canonicalization and Transform algorithms. Initialization is * done by calling {@link Init#init} which should be done in any static block * of the files of this library. We ensure that this call is only executed once. - * - * @author $Author: mullan $ */ -public final class Init { +public class Init { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** The namespace for CONF file **/ + public static final String CONF_NS = "http://www.xmlsecurity.org/NS/#configuration"; + + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(Init.class.getName()); - /** Field _initialized */ - private static boolean _alreadyInitialized = false; + /** Field alreadyInitialized */ + private static boolean alreadyInitialized = false; - /** The namespace for CONF file **/ - public static final String CONF_NS="http://www.xmlsecurity.org/NS/#configuration"; + /** + * Method isInitialized + * @return true if the library is already initialized. + */ + public static synchronized final boolean isInitialized() { + return Init.alreadyInitialized; + } - /** - * Method isInitialized - * @return true if the librairy is already initialized. - * - */ - public static final boolean isInitialized() { - return Init._alreadyInitialized; - } + /** + * Method init + * + */ + public static synchronized void init() { + if (alreadyInitialized) { + return; + } - /** - * Method init - * - */ - public synchronized static void init() { + InputStream is = + AccessController.doPrivileged( + new PrivilegedAction() { + public InputStream run() { + String cfile = + System.getProperty("com.sun.org.apache.xml.internal.security.resource.config"); + if (cfile == null) { + return null; + } + return getClass().getResourceAsStream(cfile); + } + }); + if (is == null) { + dynamicInit(); + } else { + fileInit(is); + } - if (_alreadyInitialized) { - return; - } - long XX_configure_i18n_end=0; - long XX_configure_reg_c14n_start=0; - long XX_configure_reg_c14n_end=0; - long XX_configure_reg_jcemapper_end=0; - long XX_configure_reg_keyInfo_start=0; - long XX_configure_reg_keyResolver_end=0; - long XX_configure_reg_prefixes_start=0; - long XX_configure_reg_resourceresolver_start=0; - long XX_configure_reg_sigalgos_end=0; - long XX_configure_reg_transforms_end=0; - long XX_configure_reg_keyInfo_end=0; - long XX_configure_reg_keyResolver_start=0; - _alreadyInitialized = true; + alreadyInitialized = true; + } - try { - long XX_init_start = System.currentTimeMillis(); - long XX_prng_start = System.currentTimeMillis(); + /** + * Dynamically initialise the library by registering the default algorithms/implementations + */ + private static void dynamicInit() { + // + // Load the Resource Bundle - the default is the English resource bundle. + // To load another resource bundle, call I18n.init(...) before calling this + // method. + // + I18n.init("en", "US"); - //PRNG.init(new java.security.SecureRandom()); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Registering default algorithms"); + } + try { + // + // Bind the default prefixes + // + ElementProxy.registerDefaultPrefixes(); - long XX_prng_end = System.currentTimeMillis(); + // + // Set the default Transforms + // + Transform.registerDefaultAlgorithms(); + // + // Set the default signature algorithms + // + SignatureAlgorithm.registerDefaultAlgorithms(); + + // + // Set the default JCE algorithms + // + JCEMapper.registerDefaultAlgorithms(); + + // + // Set the default c14n algorithms + // + Canonicalizer.registerDefaultAlgorithms(); + + // + // Register the default resolvers + // + ResourceResolver.registerDefaultResolvers(); + + // + // Register the default key resolvers + // + KeyResolver.registerDefaultResolvers(); + } catch (Exception ex) { + log.log(java.util.logging.Level.SEVERE, ex.getMessage(), ex); + ex.printStackTrace(); + } + } + + /** + * Initialise the library from a configuration file + */ + private static void fileInit(InputStream is) { + try { /* read library configuration file */ - long XX_parsing_start = System.currentTimeMillis(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); dbf.setNamespaceAware(true); dbf.setValidating(false); DocumentBuilder db = dbf.newDocumentBuilder(); - // We don't allow users to override the Apache XML Security - // configuration in the JRE. Users should use the standard security - // provider mechanism instead if implementing their own - // transform or canonicalization algorithms. - // InputStream is = Class.forName("com.sun.org.apache.xml.internal.security.Init").getResourceAsStream("resource/config.xml"); - InputStream is = AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { -// String cfile = System.getProperty -// ("com.sun.org.apache.xml.internal.security.resource.config"); - return getClass().getResourceAsStream -// (cfile != null ? cfile : "resource/config.xml"); - ("resource/config.xml"); - } - }); - Document doc = db.parse(is); - long XX_parsing_end = System.currentTimeMillis(); - long XX_configure_i18n_start = 0; - - { - XX_configure_reg_keyInfo_start = System.currentTimeMillis(); - try { - KeyInfo.init(); - } catch (Exception e) { - e.printStackTrace(); - - throw e; - } - XX_configure_reg_keyInfo_end = System.currentTimeMillis(); - } - - long XX_configure_reg_transforms_start=0; - long XX_configure_reg_jcemapper_start=0; - long XX_configure_reg_sigalgos_start=0; - long XX_configure_reg_resourceresolver_end=0; - long XX_configure_reg_prefixes_end=0; - Node config=doc.getFirstChild(); - for (;config!=null;config=config.getNextSibling()) { + Node config = doc.getFirstChild(); + for (; config != null; config = config.getNextSibling()) { if ("Configuration".equals(config.getLocalName())) { - break; + break; } } - for (Node el=config.getFirstChild();el!=null;el=el.getNextSibling()) { - if (el.getNodeType() != Node.ELEMENT_NODE) { - continue; + if (config == null) { + log.log(java.util.logging.Level.SEVERE, "Error in reading configuration file - Configuration element not found"); + return; + } + for (Node el = config.getFirstChild(); el != null; el = el.getNextSibling()) { + if (Node.ELEMENT_NODE != el.getNodeType()) { + continue; + } + String tag = el.getLocalName(); + if (tag.equals("ResourceBundles")) { + Element resource = (Element)el; + /* configure internationalization */ + Attr langAttr = resource.getAttributeNode("defaultLanguageCode"); + Attr countryAttr = resource.getAttributeNode("defaultCountryCode"); + String languageCode = + (langAttr == null) ? null : langAttr.getNodeValue(); + String countryCode = + (countryAttr == null) ? null : countryAttr.getNodeValue(); + I18n.init(languageCode, countryCode); } - String tag=el.getLocalName(); -// -// Commented out: not supported in the JDK. We use the default locale. -// -// if (tag.equals("ResourceBundles")){ -// XX_configure_i18n_start = System.currentTimeMillis(); -// Element resource=(Element)el; -// /* configure internationalization */ -// Attr langAttr = resource.getAttributeNode("defaultLanguageCode"); -// Attr countryAttr = resource.getAttributeNode("defaultCountryCode"); -// String languageCode = (langAttr == null) -// ? null -// : langAttr.getNodeValue(); -// String countryCode = (countryAttr == null) -// ? null -// : countryAttr.getNodeValue(); -// -// I18n.init(languageCode, countryCode); -// XX_configure_i18n_end = System.currentTimeMillis(); -// } - if (tag.equals("CanonicalizationMethods")){ - XX_configure_reg_c14n_start = System.currentTimeMillis(); - Canonicalizer.init(); - Element[] list=XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,"CanonicalizationMethod"); + if (tag.equals("CanonicalizationMethods")) { + Element[] list = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "CanonicalizationMethod"); - for (int i = 0; i < list.length; i++) { - String URI = list[i].getAttributeNS(null, - "URI"); - String JAVACLASS = - list[i].getAttributeNS(null, - "JAVACLASS"); - try { - Class.forName(JAVACLASS); -/* Method methods[] = c.getMethods(); - - for (int j = 0; j < methods.length; j++) { - Method currMeth = methods[j]; - - if (currMeth.getDeclaringClass().getName() - .equals(JAVACLASS)) { - log.log(java.util.logging.Level.FINE, currMeth.getDe claringClass().toString()); + for (int i = 0; i < list.length; i++) { + String uri = list[i].getAttributeNS(null, "URI"); + String javaClass = + list[i].getAttributeNS(null, "JAVACLASS"); + try { + Canonicalizer.register(uri, javaClass); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Canonicalizer.register(" + uri + ", " + javaClass + ")"); + } + } catch (ClassNotFoundException e) { + Object exArgs[] = { uri, javaClass }; + log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", exArgs)); } - }*/ - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Canonicalizer.register(" + URI + ", " - + JAVACLASS + ")"); - Canonicalizer.register(URI, JAVACLASS); - } catch (ClassNotFoundException e) { - Object exArgs[] = { URI, JAVACLASS }; + } + } - log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", - exArgs)); - } - } - XX_configure_reg_c14n_end = System.currentTimeMillis(); + if (tag.equals("TransformAlgorithms")) { + Element[] tranElem = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "TransformAlgorithm"); + + for (int i = 0; i < tranElem.length; i++) { + String uri = tranElem[i].getAttributeNS(null, "URI"); + String javaClass = + tranElem[i].getAttributeNS(null, "JAVACLASS"); + try { + Transform.register(uri, javaClass); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Transform.register(" + uri + ", " + javaClass + ")"); + } + } catch (ClassNotFoundException e) { + Object exArgs[] = { uri, javaClass }; + + log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", exArgs)); + } catch (NoClassDefFoundError ex) { + log.log(java.util.logging.Level.WARNING, "Not able to found dependencies for algorithm, I'll keep working."); + } + } + } + + if ("JCEAlgorithmMappings".equals(tag)) { + Node algorithmsNode = ((Element)el).getElementsByTagName("Algorithms").item(0); + if (algorithmsNode != null) { + Element[] algorithms = + XMLUtils.selectNodes(algorithmsNode.getFirstChild(), CONF_NS, "Algorithm"); + for (int i = 0; i < algorithms.length; i++) { + Element element = algorithms[i]; + String id = element.getAttribute("URI"); + JCEMapper.register(id, new JCEMapper.Algorithm(element)); + } + } + } + + if (tag.equals("SignatureAlgorithms")) { + Element[] sigElems = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "SignatureAlgorithm"); + + for (int i = 0; i < sigElems.length; i++) { + String uri = sigElems[i].getAttributeNS(null, "URI"); + String javaClass = + sigElems[i].getAttributeNS(null, "JAVACLASS"); + + /** $todo$ handle registering */ + + try { + SignatureAlgorithm.register(uri, javaClass); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "SignatureAlgorithm.register(" + uri + ", " + + javaClass + ")"); + } + } catch (ClassNotFoundException e) { + Object exArgs[] = { uri, javaClass }; + + log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", exArgs)); + } + } + } + + if (tag.equals("ResourceResolvers")) { + Element[]resolverElem = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "Resolver"); + + for (int i = 0; i < resolverElem.length; i++) { + String javaClass = + resolverElem[i].getAttributeNS(null, "JAVACLASS"); + String description = + resolverElem[i].getAttributeNS(null, "DESCRIPTION"); + + if ((description != null) && (description.length() > 0)) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Register Resolver: " + javaClass + ": " + + description); + } + } else { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Register Resolver: " + javaClass + + ": For unknown purposes"); + } + } + try { + ResourceResolver.register(javaClass); + } catch (Throwable e) { + log.log(java.util.logging.Level.WARNING, + "Cannot register:" + javaClass + + " perhaps some needed jars are not installed", + e + ); + } + } + } + + if (tag.equals("KeyResolver")){ + Element[] resolverElem = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "Resolver"); + List classNames = new ArrayList(resolverElem.length); + for (int i = 0; i < resolverElem.length; i++) { + String javaClass = + resolverElem[i].getAttributeNS(null, "JAVACLASS"); + String description = + resolverElem[i].getAttributeNS(null, "DESCRIPTION"); + + if ((description != null) && (description.length() > 0)) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Register Resolver: " + javaClass + ": " + + description); + } + } else { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Register Resolver: " + javaClass + + ": For unknown purposes"); + } + } + classNames.add(javaClass); + } + KeyResolver.registerClassNames(classNames); + } + + + if (tag.equals("PrefixMappings")){ + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Now I try to bind prefixes:"); + } + + Element[] nl = + XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, "PrefixMapping"); + + for (int i = 0; i < nl.length; i++) { + String namespace = nl[i].getAttributeNS(null, "namespace"); + String prefix = nl[i].getAttributeNS(null, "prefix"); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Now I try to bind " + prefix + " to " + namespace); + } + ElementProxy.setDefaultPrefix(namespace, prefix); + } + } } - - if (tag.equals("TransformAlgorithms")){ - XX_configure_reg_transforms_start = System.currentTimeMillis(); - Transform.init(); - - Element[] tranElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,"TransformAlgorithm"); - - for (int i = 0; i < tranElem.length; i++) { - String URI = tranElem[i].getAttributeNS(null, - "URI"); - String JAVACLASS = - tranElem[i].getAttributeNS(null, - "JAVACLASS"); - try { - Class.forName(JAVACLASS); - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Transform.register(" + URI + ", " + JAVACLASS + ")"); - Transform.register(URI, JAVACLASS); - } catch (ClassNotFoundException e) { - Object exArgs[] = { URI, JAVACLASS }; - - log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", - exArgs)); - - } catch (NoClassDefFoundError ex) { - log.log(java.util.logging.Level.WARNING, "Not able to found dependecies for algorithm, I'm keep working."); - } - } - XX_configure_reg_transforms_end = System.currentTimeMillis(); - } - - - if ("JCEAlgorithmMappings".equals(tag)){ - XX_configure_reg_jcemapper_start = System.currentTimeMillis(); - JCEMapper.init((Element)el); - XX_configure_reg_jcemapper_end = System.currentTimeMillis(); - } - - - - if (tag.equals("SignatureAlgorithms")){ - XX_configure_reg_sigalgos_start = System.currentTimeMillis(); - SignatureAlgorithm.providerInit(); - - Element[] sigElems = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS, - "SignatureAlgorithm"); - - for (int i = 0; i < sigElems.length; i++) { - String URI = sigElems[i].getAttributeNS(null, - "URI"); - String JAVACLASS = - sigElems[i].getAttributeNS(null, - "JAVACLASS"); - - /** $todo$ handle registering */ - - try { - Class.forName(JAVACLASS); - // Method methods[] = c.getMethods(); - -// for (int j = 0; j < methods.length; j++) { -// Method currMeth = methods[j]; -// -// if (currMeth.getDeclaringClass().getName() -// .equals(JAVACLASS)) { -// log.log(java.util.logging.Level.FINE, currMeth.getDe claringClass().toString()); -// } -// } - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "SignatureAlgorithm.register(" + URI + ", " + JAVACLASS + ")"); - SignatureAlgorithm.register(URI, JAVACLASS); - } catch (ClassNotFoundException e) { - Object exArgs[] = { URI, JAVACLASS }; - - log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist", - exArgs)); - - } - } - XX_configure_reg_sigalgos_end = System.currentTimeMillis(); - } - - - - if (tag.equals("ResourceResolvers")){ - XX_configure_reg_resourceresolver_start = System.currentTimeMillis(); - ResourceResolver.init(); - - Element[]resolverElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS, - "Resolver"); - - for (int i = 0; i < resolverElem.length; i++) { - String JAVACLASS = - resolverElem[i].getAttributeNS(null, - "JAVACLASS"); - String Description = - resolverElem[i].getAttributeNS(null, - "DESCRIPTION"); - - if ((Description != null) && (Description.length() > 0)) { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": " + Description); - } else { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": For unknown purposes"); - } - try { - ResourceResolver.register(JAVACLASS); - } catch (Throwable e) { - log.log(java.util.logging.Level.WARNING, "Cannot register:"+JAVACLASS+" perhaps some needed jars are not installed",e); - } - XX_configure_reg_resourceresolver_end = - System.currentTimeMillis(); - } - - } - - - - - - - if (tag.equals("KeyResolver")){ - XX_configure_reg_keyResolver_start =System.currentTimeMillis(); - KeyResolver.init(); - - Element[] resolverElem = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"Resolver"); - - for (int i = 0; i < resolverElem.length; i++) { - String JAVACLASS = - resolverElem[i].getAttributeNS(null, - "JAVACLASS"); - String Description = - resolverElem[i].getAttributeNS(null, - "DESCRIPTION"); - - if ((Description != null) && (Description.length() > 0)) { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": " + Description); - } else { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": For unknown purposes"); - } - - KeyResolver.register(JAVACLASS); - } - XX_configure_reg_keyResolver_end = System.currentTimeMillis(); - } - - - if (tag.equals("PrefixMappings")){ - XX_configure_reg_prefixes_start = System.currentTimeMillis(); - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Now I try to bind prefixes:"); - - Element[] nl = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"PrefixMapping"); - - for (int i = 0; i < nl.length; i++) { - String namespace = nl[i].getAttributeNS(null, - "namespace"); - String prefix = nl[i].getAttributeNS(null, - "prefix"); - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Now I try to bind " + prefix + " to " + namespace); - com.sun.org.apache.xml.internal.security.utils.ElementProxy - .setDefaultPrefix(namespace, prefix); - } - XX_configure_reg_prefixes_end = System.currentTimeMillis(); - } - } - - long XX_init_end = System.currentTimeMillis(); - - //J- - if (log.isLoggable(java.util.logging.Level.FINE)) { - log.log(java.util.logging.Level.FINE, "XX_init " + ((int)(XX_init_end - XX_init_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_prng " + ((int)(XX_prng_end - XX_prng_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_parsing " + ((int)(XX_parsing_end - XX_parsing_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_i18n " + ((int)(XX_configure_i18n_end- XX_configure_i18n_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_c14n " + ((int)(XX_configure_reg_c14n_end- XX_configure_reg_c14n_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_jcemapper " + ((int)(XX_configure_reg_jcemapper_end- XX_configure_reg_jcemapper_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_keyInfo " + ((int)(XX_configure_reg_keyInfo_end- XX_configure_reg_keyInfo_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_keyResolver " + ((int)(XX_configure_reg_keyResolver_end- XX_configure_reg_keyResolver_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_prefixes " + ((int)(XX_configure_reg_prefixes_end- XX_configure_reg_prefixes_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_resourceresolver " + ((int)(XX_configure_reg_resourceresolver_end- XX_configure_reg_resourceresolver_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_sigalgos " + ((int)(XX_configure_reg_sigalgos_end- XX_configure_reg_sigalgos_start)) + " ms"); - log.log(java.util.logging.Level.FINE, " XX_configure_reg_transforms " + ((int)(XX_configure_reg_transforms_end- XX_configure_reg_transforms_start)) + " ms"); - } - } catch (Exception e) { + } catch (Exception e) { log.log(java.util.logging.Level.SEVERE, "Bad: ", e); e.printStackTrace(); - } - - } - + } + } } + diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/ClassLoaderUtils.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/ClassLoaderUtils.java new file mode 100644 index 00000000000..dc05016dec1 --- /dev/null +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/ClassLoaderUtils.java @@ -0,0 +1,280 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package com.sun.org.apache.xml.internal.security.algorithms; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +/** + * This class is extremely useful for loading resources and classes in a fault + * tolerant manner that works across different applications servers. Do not + * touch this unless you're a grizzled classloading guru veteran who is going to + * verify any change on 6 different application servers. + */ +// NOTE! This is a duplicate of utils.ClassLoaderUtils with public +// modifiers changed to package-private. Make sure to integrate any future +// changes to utils.ClassLoaderUtils to this file. +final class ClassLoaderUtils { + + /** {@link org.apache.commons.logging} logging facility */ + private static final java.util.logging.Logger log = + java.util.logging.Logger.getLogger(ClassLoaderUtils.class.getName()); + + private ClassLoaderUtils() { + } + + /** + * Load a given resource.

      This method will try to load the resource + * using the following methods (in order): + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • callingClass.getClassLoader() + *
      + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static URL getResource(String resourceName, Class callingClass) { + URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName); + if (url == null && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + url = + Thread.currentThread().getContextClassLoader().getResource( + resourceName.substring(1) + ); + } + + ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader(); + if (cluClassloader == null) { + cluClassloader = ClassLoader.getSystemClassLoader(); + } + if (url == null) { + url = cluClassloader.getResource(resourceName); + } + if (url == null && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + url = cluClassloader.getResource(resourceName.substring(1)); + } + + if (url == null) { + ClassLoader cl = callingClass.getClassLoader(); + + if (cl != null) { + url = cl.getResource(resourceName); + } + } + + if (url == null) { + url = callingClass.getResource(resourceName); + } + + if ((url == null) && (resourceName != null) && (resourceName.charAt(0) != '/')) { + return getResource('/' + resourceName, callingClass); + } + + return url; + } + + /** + * Load a given resources.

      This method will try to load the resources + * using the following methods (in order): + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • callingClass.getClassLoader() + *
      + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static List getResources(String resourceName, Class callingClass) { + List ret = new ArrayList(); + Enumeration urls = new Enumeration() { + public boolean hasMoreElements() { + return false; + } + public URL nextElement() { + return null; + } + + }; + try { + urls = Thread.currentThread().getContextClassLoader().getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + //ignore + } + if (!urls.hasMoreElements() && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + try { + urls = + Thread.currentThread().getContextClassLoader().getResources( + resourceName.substring(1) + ); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + + ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader(); + if (cluClassloader == null) { + cluClassloader = ClassLoader.getSystemClassLoader(); + } + if (!urls.hasMoreElements()) { + try { + urls = cluClassloader.getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + if (!urls.hasMoreElements() && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + try { + urls = cluClassloader.getResources(resourceName.substring(1)); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + + if (!urls.hasMoreElements()) { + ClassLoader cl = callingClass.getClassLoader(); + + if (cl != null) { + try { + urls = cl.getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + } + + if (!urls.hasMoreElements()) { + URL url = callingClass.getResource(resourceName); + if (url != null) { + ret.add(url); + } + } + while (urls.hasMoreElements()) { + ret.add(urls.nextElement()); + } + + + if (ret.isEmpty() && (resourceName != null) && (resourceName.charAt(0) != '/')) { + return getResources('/' + resourceName, callingClass); + } + return ret; + } + + + /** + * This is a convenience method to load a resource as a stream.

      The + * algorithm used to find the resource is given in getResource() + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static InputStream getResourceAsStream(String resourceName, Class callingClass) { + URL url = getResource(resourceName, callingClass); + + try { + return (url != null) ? url.openStream() : null; + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + return null; + } + } + + /** + * Load a class with a given name.

      It will try to load the class in the + * following order: + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • Using the basic Class.forName() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • From the callingClass.getClassLoader() + *
      + * + * @param className The name of the class to load + * @param callingClass The Class object of the calling object + * @throws ClassNotFoundException If the class cannot be found anywhere. + */ + static Class loadClass(String className, Class callingClass) + throws ClassNotFoundException { + try { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + + if (cl != null) { + return cl.loadClass(className); + } + } catch (ClassNotFoundException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + //ignore + } + return loadClass2(className, callingClass); + } + + private static Class loadClass2(String className, Class callingClass) + throws ClassNotFoundException { + try { + return Class.forName(className); + } catch (ClassNotFoundException ex) { + try { + if (ClassLoaderUtils.class.getClassLoader() != null) { + return ClassLoaderUtils.class.getClassLoader().loadClass(className); + } + } catch (ClassNotFoundException exc) { + if (callingClass != null && callingClass.getClassLoader() != null) { + return callingClass.getClassLoader().loadClass(className); + } + } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, ex.getMessage(), ex); + } + throw ex; + } + } +} diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java index 030795ba362..9e736518936 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java @@ -2,167 +2,316 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.algorithms; - - -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; - -import com.sun.org.apache.xml.internal.security.Init; -import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import com.sun.org.apache.xml.internal.security.encryption.XMLCipher; +import com.sun.org.apache.xml.internal.security.signature.XMLSignature; import org.w3c.dom.Element; - /** * This class maps algorithm identifier URIs to JAVA JCE class names. - * - * @author $Author: mullan $ */ public class JCEMapper { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(JCEMapper.class.getName()); + private static Map algorithmsMap = + new ConcurrentHashMap(); + private static String providerName = null; - private static Map uriToJCEName; + /** + * Method register + * + * @param id + * @param algorithm + */ + public static void register(String id, Algorithm algorithm) { + algorithmsMap.put(id, algorithm); + } - private static Map algorithmsMap; + /** + * This method registers the default algorithms. + */ + public static void registerDefaultAlgorithms() { + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5, + new Algorithm("", "MD5", "MessageDigest") + ); + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160, + new Algorithm("", "RIPEMD160", "MessageDigest") + ); + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1, + new Algorithm("", "SHA-1", "MessageDigest") + ); + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256, + new Algorithm("", "SHA-256", "MessageDigest") + ); + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384, + new Algorithm("", "SHA-384", "MessageDigest") + ); + algorithmsMap.put( + MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512, + new Algorithm("", "SHA-512", "MessageDigest") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_DSA, + new Algorithm("", "SHA1withDSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, + new Algorithm("", "MD5withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160, + new Algorithm("", "RIPEMD160withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, + new Algorithm("", "SHA1withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256, + new Algorithm("", "SHA256withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384, + new Algorithm("", "SHA384withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512, + new Algorithm("", "SHA512withRSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1, + new Algorithm("", "SHA1withECDSA", "Signature") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5, + new Algorithm("", "HmacMD5", "Mac") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160, + new Algorithm("", "HMACRIPEMD160", "Mac") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA1, + new Algorithm("", "HmacSHA1", "Mac") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA256, + new Algorithm("", "HmacSHA256", "Mac") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA384, + new Algorithm("", "HmacSHA384", "Mac") + ); + algorithmsMap.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA512, + new Algorithm("", "HmacSHA512", "Mac") + ); + algorithmsMap.put( + XMLCipher.TRIPLEDES, + new Algorithm("DESede", "DESede/CBC/ISO10126Padding", "BlockEncryption", 192) + ); + algorithmsMap.put( + XMLCipher.AES_128, + new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 128) + ); + algorithmsMap.put( + XMLCipher.AES_192, + new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 192) + ); + algorithmsMap.put( + XMLCipher.AES_256, + new Algorithm("AES", "AES/CBC/ISO10126Padding", "BlockEncryption", 256) + ); + algorithmsMap.put( + XMLCipher.RSA_v1dot5, + new Algorithm("RSA", "RSA/ECB/PKCS1Padding", "KeyTransport") + ); + algorithmsMap.put( + XMLCipher.RSA_OAEP, + new Algorithm("RSA", "RSA/ECB/OAEPPadding", "KeyTransport") + ); + algorithmsMap.put( + XMLCipher.DIFFIE_HELLMAN, + new Algorithm("", "", "KeyAgreement") + ); + algorithmsMap.put( + XMLCipher.TRIPLEDES_KeyWrap, + new Algorithm("DESede", "DESedeWrap", "SymmetricKeyWrap", 192) + ); + algorithmsMap.put( + XMLCipher.AES_128_KeyWrap, + new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 128) + ); + algorithmsMap.put( + XMLCipher.AES_192_KeyWrap, + new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 192) + ); + algorithmsMap.put( + XMLCipher.AES_256_KeyWrap, + new Algorithm("AES", "AESWrap", "SymmetricKeyWrap", 256) + ); + } - private static String providerName = null; - /** - * Method init - * - * @param mappingElement - * @throws Exception - */ - public static void init(Element mappingElement) throws Exception { + /** + * Method translateURItoJCEID + * + * @param algorithmURI + * @return the JCE standard name corresponding to the given URI + */ + public static String translateURItoJCEID(String algorithmURI) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Request for URI " + algorithmURI); + } - loadAlgorithms((Element)mappingElement.getElementsByTagName("Algorithms").item(0)); - } + Algorithm algorithm = algorithmsMap.get(algorithmURI); + if (algorithm != null) { + return algorithm.jceName; + } + return null; + } - static void loadAlgorithms( Element algorithmsEl) { - Element[] algorithms = XMLUtils.selectNodes(algorithmsEl.getFirstChild(),Init.CONF_NS,"Algorithm"); - uriToJCEName = new HashMap( algorithms.length * 2); - algorithmsMap = new HashMap( algorithms.length * 2); - for (int i = 0 ;i < algorithms.length ;i ++) { - Element el = algorithms[i]; - String id = el.getAttribute("URI"); - String jceName = el.getAttribute("JCEName"); - uriToJCEName.put(id, jceName); - algorithmsMap.put(id, new Algorithm(el)); - } + /** + * Method getAlgorithmClassFromURI + * @param algorithmURI + * @return the class name that implements this algorithm + */ + public static String getAlgorithmClassFromURI(String algorithmURI) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Request for URI " + algorithmURI); + } - } + Algorithm algorithm = algorithmsMap.get(algorithmURI); + if (algorithm != null) { + return algorithm.algorithmClass; + } + return null; + } - static Algorithm getAlgorithmMapping(String algoURI) { - return algorithmsMap.get(algoURI); - } + /** + * Returns the keylength in bits for a particular algorithm. + * + * @param algorithmURI + * @return The length of the key used in the algorithm + */ + public static int getKeyLengthFromURI(String algorithmURI) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Request for URI " + algorithmURI); + } + Algorithm algorithm = algorithmsMap.get(algorithmURI); + if (algorithm != null) { + return algorithm.keyLength; + } + return 0; + } - /** - * Method translateURItoJCEID - * - * @param AlgorithmURI - * @return the JCE standard name corresponding to the given URI - * - */ - public static String translateURItoJCEID(String AlgorithmURI) { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Request for URI " + AlgorithmURI); + /** + * Method getJCEKeyAlgorithmFromURI + * + * @param algorithmURI + * @return The KeyAlgorithm for the given URI. + */ + public static String getJCEKeyAlgorithmFromURI(String algorithmURI) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Request for URI " + algorithmURI); + } + Algorithm algorithm = algorithmsMap.get(algorithmURI); + if (algorithm != null) { + return algorithm.requiredKey; + } + return null; + } - String jceName = uriToJCEName.get(AlgorithmURI); - return jceName; - } + /** + * Gets the default Provider for obtaining the security algorithms + * @return the default providerId. + */ + public static String getProviderId() { + return providerName; + } - /** - * Method getAlgorithmClassFromURI - * NOTE(Raul Benito) It seems a buggy function the loop doesn't do - * anything?? - * @param AlgorithmURI - * @return the class name that implements this algorithm - * - */ - public static String getAlgorithmClassFromURI(String AlgorithmURI) { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Request for URI " + AlgorithmURI); + /** + * Sets the default Provider for obtaining the security algorithms + * @param provider the default providerId. + */ + public static void setProviderId(String provider) { + providerName = provider; + } - return (algorithmsMap.get(AlgorithmURI)).algorithmClass; - } + /** + * Represents the Algorithm xml element + */ + public static class Algorithm { - /** - * Returns the keylength in bit for a particular algorithm. - * - * @param AlgorithmURI - * @return The length of the key used in the alogrithm - */ - public static int getKeyLengthFromURI(String AlgorithmURI) { - return Integer.parseInt((algorithmsMap.get(AlgorithmURI)).keyLength); - } + final String requiredKey; + final String jceName; + final String algorithmClass; + final int keyLength; - /** - * Method getJCEKeyAlgorithmFromURI - * - * @param AlgorithmURI - * @return The KeyAlgorithm for the given URI. - * - */ - public static String getJCEKeyAlgorithmFromURI(String AlgorithmURI) { - - return (algorithmsMap.get(AlgorithmURI)).requiredKey; - - } - - /** - * Gets the default Provider for obtaining the security algorithms - * @return the default providerId. - */ - public static String getProviderId() { - return providerName; - } - - /** - * Sets the default Provider for obtaining the security algorithms - * @param provider the default providerId. - */ - public static void setProviderId(String provider) { - providerName=provider; - } - - /** - * Represents the Algorithm xml element - */ - public static class Algorithm { - String algorithmClass; - String keyLength; - String requiredKey; /** * Gets data from element * @param el */ public Algorithm(Element el) { - algorithmClass=el.getAttribute("AlgorithmClass"); - keyLength=el.getAttribute("KeyLength"); - requiredKey=el.getAttribute("RequiredKey"); + requiredKey = el.getAttribute("RequiredKey"); + jceName = el.getAttribute("JCEName"); + algorithmClass = el.getAttribute("AlgorithmClass"); + if (el.hasAttribute("KeyLength")) { + keyLength = Integer.parseInt(el.getAttribute("KeyLength")); + } else { + keyLength = 0; + } } - } + + public Algorithm(String requiredKey, String jceName) { + this(requiredKey, jceName, null, 0); + } + + public Algorithm(String requiredKey, String jceName, String algorithmClass) { + this(requiredKey, jceName, algorithmClass, 0); + } + + public Algorithm(String requiredKey, String jceName, int keyLength) { + this(requiredKey, jceName, null, keyLength); + } + + public Algorithm(String requiredKey, String jceName, String algorithmClass, int keyLength) { + this.requiredKey = requiredKey; + this.jceName = jceName; + this.algorithmClass = algorithmClass; + this.keyLength = keyLength; + } + } + } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java index 24fd47e0a2d..5dbcf58e33b 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java @@ -2,460 +2,445 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.algorithms; - import java.security.Key; import java.security.SecureRandom; import java.security.spec.AlgorithmParameterSpec; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.sun.org.apache.xml.internal.security.algorithms.implementations.IntegrityHmac; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureBaseRSA; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureDSA; +import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureECDSA; import com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException; import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; +import com.sun.org.apache.xml.internal.security.signature.XMLSignature; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; import com.sun.org.apache.xml.internal.security.utils.Constants; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; - /** - * Allows selection of digital signature's algorithm, private keys, other security parameters, and algorithm's ID. + * Allows selection of digital signature's algorithm, private keys, other + * security parameters, and algorithm's ID. * * @author Christian Geuer-Pollmann */ public class SignatureAlgorithm extends Algorithm { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(SignatureAlgorithm.class.getName()); - /** Field _alreadyInitialized */ - static boolean _alreadyInitialized = false; + /** All available algorithm classes are registered here */ + private static Map> algorithmHash = + new ConcurrentHashMap>(); - /** All available algorithm classes are registered here */ - static Map> _algorithmHash = null; + /** Field signatureAlgorithm */ + private final SignatureAlgorithmSpi signatureAlgorithm; - static ThreadLocal> instancesSigning=new ThreadLocal>() { - protected Map initialValue() { - return new HashMap(); - }; - }; + private final String algorithmURI; - static ThreadLocal> instancesVerify=new ThreadLocal>() { - protected Map initialValue() { - return new HashMap(); - }; - }; + /** + * Constructor SignatureAlgorithm + * + * @param doc + * @param algorithmURI + * @throws XMLSecurityException + */ + public SignatureAlgorithm(Document doc, String algorithmURI) throws XMLSecurityException { + super(doc, algorithmURI); + this.algorithmURI = algorithmURI; - static ThreadLocal> keysSigning=new ThreadLocal>() { - protected Map initialValue() { - return new HashMap(); - }; - }; - static ThreadLocal> keysVerify=new ThreadLocal>() { - protected Map initialValue() { - return new HashMap(); - }; - }; -// boolean isForSigning=false; + signatureAlgorithm = getSignatureAlgorithmSpi(algorithmURI); + signatureAlgorithm.engineGetContextFromElement(this._constructionElement); + } - /** Field _signatureAlgorithm */ - protected SignatureAlgorithmSpi _signatureAlgorithm = null; + /** + * Constructor SignatureAlgorithm + * + * @param doc + * @param algorithmURI + * @param hmacOutputLength + * @throws XMLSecurityException + */ + public SignatureAlgorithm( + Document doc, String algorithmURI, int hmacOutputLength + ) throws XMLSecurityException { + super(doc, algorithmURI); + this.algorithmURI = algorithmURI; - private String algorithmURI; + signatureAlgorithm = getSignatureAlgorithmSpi(algorithmURI); + signatureAlgorithm.engineGetContextFromElement(this._constructionElement); - /** - * Constructor SignatureAlgorithm - * - * @param doc - * @param algorithmURI - * @throws XMLSecurityException - */ - public SignatureAlgorithm(Document doc, String algorithmURI) - throws XMLSecurityException { - super(doc, algorithmURI); - this.algorithmURI = algorithmURI; - } + signatureAlgorithm.engineSetHMACOutputLength(hmacOutputLength); + ((IntegrityHmac)signatureAlgorithm).engineAddContextToElement(_constructionElement); + } + /** + * Constructor SignatureAlgorithm + * + * @param element + * @param baseURI + * @throws XMLSecurityException + */ + public SignatureAlgorithm(Element element, String baseURI) throws XMLSecurityException { + this(element, baseURI, false); + } - private void initializeAlgorithm(boolean isForSigning) throws XMLSignatureException { - if (_signatureAlgorithm!=null) { - return; - } - _signatureAlgorithm=isForSigning ? getInstanceForSigning(algorithmURI) : getInstanceForVerify(algorithmURI); - this._signatureAlgorithm - .engineGetContextFromElement(this._constructionElement); - } - private static SignatureAlgorithmSpi getInstanceForSigning(String algorithmURI) throws XMLSignatureException { - SignatureAlgorithmSpi result= instancesSigning.get().get(algorithmURI); - if (result!=null) { - result.reset(); - return result; - } - result=buildSigner(algorithmURI, result); - instancesSigning.get().put(algorithmURI,result); - return result; - } - private static SignatureAlgorithmSpi getInstanceForVerify(String algorithmURI) throws XMLSignatureException { - SignatureAlgorithmSpi result= instancesVerify.get().get(algorithmURI); - if (result!=null) { - result.reset(); - return result; - } - result=buildSigner(algorithmURI, result); - instancesVerify.get().put(algorithmURI,result); - return result; - } + /** + * Constructor SignatureAlgorithm + * + * @param element + * @param baseURI + * @param secureValidation + * @throws XMLSecurityException + */ + public SignatureAlgorithm( + Element element, String baseURI, boolean secureValidation + ) throws XMLSecurityException { + super(element, baseURI); + algorithmURI = this.getURI(); - private static SignatureAlgorithmSpi buildSigner(String algorithmURI, SignatureAlgorithmSpi result) throws XMLSignatureException { + Attr attr = element.getAttributeNodeNS(null, "Id"); + if (attr != null) { + element.setIdAttributeNode(attr, true); + } + + if (secureValidation && (XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5.equals(algorithmURI) + || XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5.equals(algorithmURI))) { + Object exArgs[] = { algorithmURI }; + + throw new XMLSecurityException("signature.signatureAlgorithm", exArgs); + } + + signatureAlgorithm = getSignatureAlgorithmSpi(algorithmURI); + signatureAlgorithm.engineGetContextFromElement(this._constructionElement); + } + + /** + * Get a SignatureAlgorithmSpi object corresponding to the algorithmURI argument + */ + private static SignatureAlgorithmSpi getSignatureAlgorithmSpi(String algorithmURI) + throws XMLSignatureException { try { - Class implementingClass = - SignatureAlgorithm.getImplementingClass(algorithmURI); - if (log.isLoggable(java.util.logging.Level.FINE)) + Class implementingClass = + algorithmHash.get(algorithmURI); + if (log.isLoggable(java.util.logging.Level.FINE)) { log.log(java.util.logging.Level.FINE, "Create URI \"" + algorithmURI + "\" class \"" + implementingClass + "\""); - result= implementingClass.newInstance(); - return result; - } catch (IllegalAccessException ex) { - Object exArgs[] = { algorithmURI, ex.getMessage() }; - - throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, - ex); - } catch (InstantiationException ex) { - Object exArgs[] = { algorithmURI, ex.getMessage() }; - - throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, - ex); - } catch (NullPointerException ex) { - Object exArgs[] = { algorithmURI, ex.getMessage() }; - - throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, - ex); - } -} - - /** - * Constructor SignatureAlgorithm - * - * @param doc - * @param algorithmURI - * @param HMACOutputLength - * @throws XMLSecurityException - */ - public SignatureAlgorithm( - Document doc, String algorithmURI, int HMACOutputLength) - throws XMLSecurityException { - - this(doc, algorithmURI); - this.algorithmURI=algorithmURI; - initializeAlgorithm(true); - this._signatureAlgorithm.engineSetHMACOutputLength(HMACOutputLength); - ((IntegrityHmac)this._signatureAlgorithm) - .engineAddContextToElement(this._constructionElement); - } - - /** - * Constructor SignatureAlgorithm - * - * @param element - * @param BaseURI - * @throws XMLSecurityException - */ - public SignatureAlgorithm(Element element, String BaseURI) - throws XMLSecurityException { - - super(element, BaseURI); - algorithmURI = this.getURI(); - } - - /** - * Proxy method for {@link java.security.Signature#sign()} - * which is executed on the internal {@link java.security.Signature} object. - * - * @return the result of the {@link java.security.Signature#sign()} method - * @throws XMLSignatureException - */ - public byte[] sign() throws XMLSignatureException { - return this._signatureAlgorithm.engineSign(); - } - - /** - * Proxy method for {@link java.security.Signature#getAlgorithm} - * which is executed on the internal {@link java.security.Signature} object. - * - * @return the result of the {@link java.security.Signature#getAlgorithm} method - */ - public String getJCEAlgorithmString() { - try { - return getInstanceForVerify(algorithmURI).engineGetJCEAlgorithmString(); - } catch (XMLSignatureException e) { - //Ignore. - return null; + } + return implementingClass.newInstance(); + } catch (IllegalAccessException ex) { + Object exArgs[] = { algorithmURI, ex.getMessage() }; + throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, ex); + } catch (InstantiationException ex) { + Object exArgs[] = { algorithmURI, ex.getMessage() }; + throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, ex); + } catch (NullPointerException ex) { + Object exArgs[] = { algorithmURI, ex.getMessage() }; + throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, ex); } - } + } - /** - * Method getJCEProviderName - * - * @return The Provider of this Signature Alogrithm - */ - public String getJCEProviderName() { - try { - return getInstanceForVerify(algorithmURI).engineGetJCEProviderName(); - } catch (XMLSignatureException e) { - return null; + + /** + * Proxy method for {@link java.security.Signature#sign()} + * which is executed on the internal {@link java.security.Signature} object. + * + * @return the result of the {@link java.security.Signature#sign()} method + * @throws XMLSignatureException + */ + public byte[] sign() throws XMLSignatureException { + return signatureAlgorithm.engineSign(); + } + + /** + * Proxy method for {@link java.security.Signature#getAlgorithm} + * which is executed on the internal {@link java.security.Signature} object. + * + * @return the result of the {@link java.security.Signature#getAlgorithm} method + */ + public String getJCEAlgorithmString() { + return signatureAlgorithm.engineGetJCEAlgorithmString(); + } + + /** + * Method getJCEProviderName + * + * @return The Provider of this Signature Algorithm + */ + public String getJCEProviderName() { + return signatureAlgorithm.engineGetJCEProviderName(); + } + + /** + * Proxy method for {@link java.security.Signature#update(byte[])} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param input + * @throws XMLSignatureException + */ + public void update(byte[] input) throws XMLSignatureException { + signatureAlgorithm.engineUpdate(input); + } + + /** + * Proxy method for {@link java.security.Signature#update(byte)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param input + * @throws XMLSignatureException + */ + public void update(byte input) throws XMLSignatureException { + signatureAlgorithm.engineUpdate(input); + } + + /** + * Proxy method for {@link java.security.Signature#update(byte[], int, int)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param buf + * @param offset + * @param len + * @throws XMLSignatureException + */ + public void update(byte buf[], int offset, int len) throws XMLSignatureException { + signatureAlgorithm.engineUpdate(buf, offset, len); + } + + /** + * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param signingKey + * @throws XMLSignatureException + */ + public void initSign(Key signingKey) throws XMLSignatureException { + signatureAlgorithm.engineInitSign(signingKey); + } + + /** + * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey, + * java.security.SecureRandom)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param signingKey + * @param secureRandom + * @throws XMLSignatureException + */ + public void initSign(Key signingKey, SecureRandom secureRandom) throws XMLSignatureException { + signatureAlgorithm.engineInitSign(signingKey, secureRandom); + } + + /** + * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param signingKey + * @param algorithmParameterSpec + * @throws XMLSignatureException + */ + public void initSign( + Key signingKey, AlgorithmParameterSpec algorithmParameterSpec + ) throws XMLSignatureException { + signatureAlgorithm.engineInitSign(signingKey, algorithmParameterSpec); + } + + /** + * Proxy method for {@link java.security.Signature#setParameter( + * java.security.spec.AlgorithmParameterSpec)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param params + * @throws XMLSignatureException + */ + public void setParameter(AlgorithmParameterSpec params) throws XMLSignatureException { + signatureAlgorithm.engineSetParameter(params); + } + + /** + * Proxy method for {@link java.security.Signature#initVerify(java.security.PublicKey)} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param verificationKey + * @throws XMLSignatureException + */ + public void initVerify(Key verificationKey) throws XMLSignatureException { + signatureAlgorithm.engineInitVerify(verificationKey); + } + + /** + * Proxy method for {@link java.security.Signature#verify(byte[])} + * which is executed on the internal {@link java.security.Signature} object. + * + * @param signature + * @return true if if the signature is valid. + * + * @throws XMLSignatureException + */ + public boolean verify(byte[] signature) throws XMLSignatureException { + return signatureAlgorithm.engineVerify(signature); + } + + /** + * Returns the URI representation of Transformation algorithm + * + * @return the URI representation of Transformation algorithm + */ + public final String getURI() { + return _constructionElement.getAttributeNS(null, Constants._ATT_ALGORITHM); + } + + /** + * Registers implementing class of the Transform algorithm with algorithmURI + * + * @param algorithmURI algorithmURI URI representation of Transform algorithm. + * @param implementingClass implementingClass the implementing class of + * {@link SignatureAlgorithmSpi} + * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered + * @throws XMLSignatureException + */ + @SuppressWarnings("unchecked") + public static void register(String algorithmURI, String implementingClass) + throws AlgorithmAlreadyRegisteredException, ClassNotFoundException, + XMLSignatureException { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass); } - } - /** - * Proxy method for {@link java.security.Signature#update(byte[])} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param input - * @throws XMLSignatureException - */ - public void update(byte[] input) throws XMLSignatureException { - this._signatureAlgorithm.engineUpdate(input); - } + // are we already registered? + Class registeredClass = algorithmHash.get(algorithmURI); + if (registeredClass != null) { + Object exArgs[] = { algorithmURI, registeredClass }; + throw new AlgorithmAlreadyRegisteredException( + "algorithm.alreadyRegistered", exArgs + ); + } + try { + Class clazz = + (Class) + ClassLoaderUtils.loadClass(implementingClass, SignatureAlgorithm.class); + algorithmHash.put(algorithmURI, clazz); + } catch (NullPointerException ex) { + Object exArgs[] = { algorithmURI, ex.getMessage() }; + throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, ex); + } + } - /** - * Proxy method for {@link java.security.Signature#update(byte)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param input - * @throws XMLSignatureException - */ - public void update(byte input) throws XMLSignatureException { - this._signatureAlgorithm.engineUpdate(input); - } + /** + * Registers implementing class of the Transform algorithm with algorithmURI + * + * @param algorithmURI algorithmURI URI representation of Transform algorithm. + * @param implementingClass implementingClass the implementing class of + * {@link SignatureAlgorithmSpi} + * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered + * @throws XMLSignatureException + */ + public static void register(String algorithmURI, Class implementingClass) + throws AlgorithmAlreadyRegisteredException, ClassNotFoundException, + XMLSignatureException { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass); + } - /** - * Proxy method for {@link java.security.Signature#update(byte[], int, int)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param buf - * @param offset - * @param len - * @throws XMLSignatureException - */ - public void update(byte buf[], int offset, int len) - throws XMLSignatureException { - this._signatureAlgorithm.engineUpdate(buf, offset, len); - } + // are we already registered? + Class registeredClass = algorithmHash.get(algorithmURI); + if (registeredClass != null) { + Object exArgs[] = { algorithmURI, registeredClass }; + throw new AlgorithmAlreadyRegisteredException( + "algorithm.alreadyRegistered", exArgs + ); + } + algorithmHash.put(algorithmURI, implementingClass); + } - /** - * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param signingKey - * @throws XMLSignatureException - */ - public void initSign(Key signingKey) throws XMLSignatureException { - initializeAlgorithm(true); - Map map=keysSigning.get(); - if (map.get(this.algorithmURI)==signingKey) { - return; - } - map.put(this.algorithmURI,signingKey); - this._signatureAlgorithm.engineInitSign(signingKey); - } + /** + * This method registers the default algorithms. + */ + public static void registerDefaultAlgorithms() { + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_DSA, SignatureDSA.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, SignatureBaseRSA.SignatureRSASHA1.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA1, IntegrityHmac.IntegrityHmacSHA1.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, + SignatureBaseRSA.SignatureRSAMD5.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160, + SignatureBaseRSA.SignatureRSARIPEMD160.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256, SignatureBaseRSA.SignatureRSASHA256.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384, SignatureBaseRSA.SignatureRSASHA384.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512, SignatureBaseRSA.SignatureRSASHA512.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1, SignatureECDSA.SignatureECDSASHA1.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5, IntegrityHmac.IntegrityHmacMD5.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160, IntegrityHmac.IntegrityHmacRIPEMD160.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA256, IntegrityHmac.IntegrityHmacSHA256.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA384, IntegrityHmac.IntegrityHmacSHA384.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_MAC_HMAC_SHA512, IntegrityHmac.IntegrityHmacSHA512.class + ); + } - /** - * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey, java.security.SecureRandom)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param signingKey - * @param secureRandom - * @throws XMLSignatureException - */ - public void initSign(Key signingKey, SecureRandom secureRandom) - throws XMLSignatureException { - initializeAlgorithm(true); - this._signatureAlgorithm.engineInitSign(signingKey, secureRandom); - } + /** + * Method getBaseNamespace + * + * @return URI of this element + */ + public String getBaseNamespace() { + return Constants.SignatureSpecNS; + } - /** - * Proxy method for {@link java.security.Signature#initSign(java.security.PrivateKey)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param signingKey - * @param algorithmParameterSpec - * @throws XMLSignatureException - */ - public void initSign( - Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) - throws XMLSignatureException { - initializeAlgorithm(true); - this._signatureAlgorithm.engineInitSign(signingKey, - algorithmParameterSpec); - } - - /** - * Proxy method for {@link java.security.Signature#setParameter(java.security.spec.AlgorithmParameterSpec)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param params - * @throws XMLSignatureException - */ - public void setParameter(AlgorithmParameterSpec params) - throws XMLSignatureException { - this._signatureAlgorithm.engineSetParameter(params); - } - - /** - * Proxy method for {@link java.security.Signature#initVerify(java.security.PublicKey)} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param verificationKey - * @throws XMLSignatureException - */ - public void initVerify(Key verificationKey) throws XMLSignatureException { - initializeAlgorithm(false); - Map map=keysVerify.get(); - if (map.get(this.algorithmURI)==verificationKey) { - return; - } - map.put(this.algorithmURI,verificationKey); - this._signatureAlgorithm.engineInitVerify(verificationKey); - } - - /** - * Proxy method for {@link java.security.Signature#verify(byte[])} - * which is executed on the internal {@link java.security.Signature} object. - * - * @param signature - * @return true if if the signature is valid. - * - * @throws XMLSignatureException - */ - public boolean verify(byte[] signature) throws XMLSignatureException { - return this._signatureAlgorithm.engineVerify(signature); - } - - /** - * Returns the URI representation of Transformation algorithm - * - * @return the URI representation of Transformation algorithm - */ - public final String getURI() { - return this._constructionElement.getAttributeNS(null, - Constants._ATT_ALGORITHM); - } - - /** - * Initalizes for this {@link com.sun.org.apache.xml.internal.security.transforms.Transform} - * - */ - public static void providerInit() { - - if (SignatureAlgorithm.log == null) { - SignatureAlgorithm.log = - java.util.logging.Logger - .getLogger(SignatureAlgorithm.class.getName()); - } - - log.log(java.util.logging.Level.FINE, "Init() called"); - - if (!SignatureAlgorithm._alreadyInitialized) { - SignatureAlgorithm._algorithmHash = new HashMap>(10); - SignatureAlgorithm._alreadyInitialized = true; - } - } - - /** - * Registers implementing class of the Transform algorithm with algorithmURI - * - * @param algorithmURI algorithmURI URI representation of Transform algorithm. - * @param implementingClass implementingClass the implementing class of {@link SignatureAlgorithmSpi} - * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered - * @throws XMLSignatureException - */ - @SuppressWarnings("unchecked") - public static void register(String algorithmURI, String implementingClass) - throws AlgorithmAlreadyRegisteredException,XMLSignatureException { - - { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass); - - // are we already registered? - Class registeredClassClass = - SignatureAlgorithm.getImplementingClass(algorithmURI); - if (registeredClassClass!=null) { - String registeredClass = registeredClassClass.getName(); - - if ((registeredClass != null) && (registeredClass.length() != 0)) { - Object exArgs[] = { algorithmURI, registeredClass }; - - throw new AlgorithmAlreadyRegisteredException( - "algorithm.alreadyRegistered", exArgs); - } - } - try { - SignatureAlgorithm._algorithmHash.put(algorithmURI, (Class )Class.forName(implementingClass)); - } catch (ClassNotFoundException ex) { - Object exArgs[] = { algorithmURI, ex.getMessage() }; - - throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, - ex); - } catch (NullPointerException ex) { - Object exArgs[] = { algorithmURI, ex.getMessage() }; - - throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs, - ex); - } - - } - } - - /** - * Method getImplementingClass - * - * @param URI - * @return the class that implements the URI - */ - private static Class getImplementingClass(String URI) { - - if (SignatureAlgorithm._algorithmHash == null) { - return null; - } - - return SignatureAlgorithm._algorithmHash.get(URI); - } - - /** - * Method getBaseNamespace - * - * @return URI of this element - */ - public String getBaseNamespace() { - return Constants.SignatureSpecNS; - } - - /** - * Method getBaseLocalName - * - * @return Local name - */ - public String getBaseLocalName() { - return Constants._TAG_SIGNATUREMETHOD; - } + /** + * Method getBaseLocalName + * + * @return Local name + */ + public String getBaseLocalName() { + return Constants._TAG_SIGNATUREMETHOD; + } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java index b435a988d51..db1d4c261b7 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/Canonicalizer.java @@ -2,34 +2,43 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2008 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.c14n; import java.io.ByteArrayInputStream; +import java.io.InputStream; import java.io.OutputStream; -import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer11_OmitComments; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer11_WithComments; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315ExclOmitComments; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315ExclWithComments; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments; +import com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315WithComments; import com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException; import org.w3c.dom.Document; import org.w3c.dom.Node; @@ -46,7 +55,7 @@ public class Canonicalizer { public static final String ENCODING = "UTF8"; /** - * XPath Expresion for selecting every node and continuous comments joined + * XPath Expression for selecting every node and continuous comments joined * in only one node */ public static final String XPATH_C14N_WITH_COMMENTS_SINGLE_NODE = @@ -83,22 +92,10 @@ public class Canonicalizer { public static final String ALGO_ID_C14N11_WITH_COMMENTS = ALGO_ID_C14N11_OMIT_COMMENTS + "#WithComments"; - static boolean _alreadyInitialized = false; - static Map> _canonicalizerHash = null; + private static Map> canonicalizerHash = + new ConcurrentHashMap>(); - protected CanonicalizerSpi canonicalizerSpi = null; - - /** - * Method init - * - */ - public static void init() { - - if (!Canonicalizer._alreadyInitialized) { - Canonicalizer._canonicalizerHash = new HashMap>(10); - Canonicalizer._alreadyInitialized = true; - } - } + private final CanonicalizerSpi canonicalizerSpi; /** * Constructor Canonicalizer @@ -106,21 +103,18 @@ public class Canonicalizer { * @param algorithmURI * @throws InvalidCanonicalizerException */ - private Canonicalizer(String algorithmURI) - throws InvalidCanonicalizerException { - + private Canonicalizer(String algorithmURI) throws InvalidCanonicalizerException { try { Class implementingClass = - getImplementingClass(algorithmURI); + canonicalizerHash.get(algorithmURI); - this.canonicalizerSpi = - implementingClass.newInstance(); - this.canonicalizerSpi.reset=true; + canonicalizerSpi = implementingClass.newInstance(); + canonicalizerSpi.reset = true; } catch (Exception e) { Object exArgs[] = { algorithmURI }; - throw new InvalidCanonicalizerException( - "signature.Canonicalizer.UnknownCanonicalizer", exArgs); + "signature.Canonicalizer.UnknownCanonicalizer", exArgs, e + ); } } @@ -128,15 +122,12 @@ public class Canonicalizer { * Method getInstance * * @param algorithmURI - * @return a Conicicalizer instance ready for the job + * @return a Canonicalizer instance ready for the job * @throws InvalidCanonicalizerException */ public static final Canonicalizer getInstance(String algorithmURI) - throws InvalidCanonicalizerException { - - Canonicalizer c14nizer = new Canonicalizer(algorithmURI); - - return c14nizer; + throws InvalidCanonicalizerException { + return new Canonicalizer(algorithmURI); } /** @@ -148,23 +139,69 @@ public class Canonicalizer { */ @SuppressWarnings("unchecked") public static void register(String algorithmURI, String implementingClass) - throws AlgorithmAlreadyRegisteredException { - + throws AlgorithmAlreadyRegisteredException, ClassNotFoundException { // check whether URI is already registered - Class registeredClass = getImplementingClass(algorithmURI); + Class registeredClass = + canonicalizerHash.get(algorithmURI); if (registeredClass != null) { Object exArgs[] = { algorithmURI, registeredClass }; - - throw new AlgorithmAlreadyRegisteredException( - "algorithm.alreadyRegistered", exArgs); + throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs); } - try { - _canonicalizerHash.put(algorithmURI, (Class) Class.forName(implementingClass)); - } catch (ClassNotFoundException e) { - throw new RuntimeException("c14n class not found"); + canonicalizerHash.put( + algorithmURI, (Class)Class.forName(implementingClass) + ); + } + + /** + * Method register + * + * @param algorithmURI + * @param implementingClass + * @throws AlgorithmAlreadyRegisteredException + */ + public static void register(String algorithmURI, Class implementingClass) + throws AlgorithmAlreadyRegisteredException, ClassNotFoundException { + // check whether URI is already registered + Class registeredClass = canonicalizerHash.get(algorithmURI); + + if (registeredClass != null) { + Object exArgs[] = { algorithmURI, registeredClass }; + throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs); } + + canonicalizerHash.put(algorithmURI, implementingClass); + } + + /** + * This method registers the default algorithms. + */ + public static void registerDefaultAlgorithms() { + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS, + Canonicalizer20010315OmitComments.class + ); + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS, + Canonicalizer20010315WithComments.class + ); + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS, + Canonicalizer20010315ExclOmitComments.class + ); + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N_EXCL_WITH_COMMENTS, + Canonicalizer20010315ExclWithComments.class + ); + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N11_OMIT_COMMENTS, + Canonicalizer11_OmitComments.class + ); + canonicalizerHash.put( + Canonicalizer.ALGO_ID_C14N11_WITH_COMMENTS, + Canonicalizer11_WithComments.class + ); } /** @@ -173,7 +210,7 @@ public class Canonicalizer { * @return the URI defined for this c14n instance. */ public final String getURI() { - return this.canonicalizerSpi.engineGetURI(); + return canonicalizerSpi.engineGetURI(); } /** @@ -182,7 +219,7 @@ public class Canonicalizer { * @return true if the c14n respect the comments. */ public boolean getIncludeComments() { - return this.canonicalizerSpi.engineGetIncludeComments(); + return canonicalizerSpi.engineGetIncludeComments(); } /** @@ -191,33 +228,32 @@ public class Canonicalizer { * wrapped with a >a<...>/a<. * * @param inputBytes - * @return the result of the conicalization. + * @return the result of the canonicalization. * @throws CanonicalizationException * @throws java.io.IOException * @throws javax.xml.parsers.ParserConfigurationException * @throws org.xml.sax.SAXException */ public byte[] canonicalize(byte[] inputBytes) - throws javax.xml.parsers.ParserConfigurationException, - java.io.IOException, org.xml.sax.SAXException, - CanonicalizationException { - - ByteArrayInputStream bais = new ByteArrayInputStream(inputBytes); + throws javax.xml.parsers.ParserConfigurationException, + java.io.IOException, org.xml.sax.SAXException, CanonicalizationException { + InputStream bais = new ByteArrayInputStream(inputBytes); InputSource in = new InputSource(bais); DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); + dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); dfactory.setNamespaceAware(true); - // needs to validate for ID attribute nomalization + // needs to validate for ID attribute normalization dfactory.setValidating(true); DocumentBuilder db = dfactory.newDocumentBuilder(); /* * for some of the test vectors from the specification, - * there has to be a validatin parser for ID attributes, default + * there has to be a validating parser for ID attributes, default * attribute values, NMTOKENS, etc. - * Unfortunaltely, the test vectors do use different DTDs or + * Unfortunately, the test vectors do use different DTDs or * even no DTD. So Xerces 1.3.1 fires many warnings about using * ErrorHandlers. * @@ -233,28 +269,23 @@ public class Canonicalizer { * declaration are used to help create the canonical form, even * though the document type declaration is not retained in the * canonical form. - * */ - db.setErrorHandler(new com.sun.org.apache.xml.internal.security.utils - .IgnoreAllErrorHandler()); + db.setErrorHandler(new com.sun.org.apache.xml.internal.security.utils.IgnoreAllErrorHandler()); Document document = db.parse(in); - byte result[] = this.canonicalizeSubtree(document); - - return result; + return this.canonicalizeSubtree(document); } /** * Canonicalizes the subtree rooted by node. * - * @param node The node to canicalize + * @param node The node to canonicalize * @return the result of the c14n. * * @throws CanonicalizationException */ - public byte[] canonicalizeSubtree(Node node) - throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeSubTree(node); + public byte[] canonicalizeSubtree(Node node) throws CanonicalizationException { + return canonicalizerSpi.engineCanonicalizeSubTree(node); } /** @@ -266,9 +297,8 @@ public class Canonicalizer { * @throws CanonicalizationException */ public byte[] canonicalizeSubtree(Node node, String inclusiveNamespaces) - throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeSubTree(node, - inclusiveNamespaces); + throws CanonicalizationException { + return canonicalizerSpi.engineCanonicalizeSubTree(node, inclusiveNamespaces); } /** @@ -280,8 +310,8 @@ public class Canonicalizer { * @throws CanonicalizationException */ public byte[] canonicalizeXPathNodeSet(NodeList xpathNodeSet) - throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet); + throws CanonicalizationException { + return canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet); } /** @@ -294,10 +324,10 @@ public class Canonicalizer { * @throws CanonicalizationException */ public byte[] canonicalizeXPathNodeSet( - NodeList xpathNodeSet, String inclusiveNamespaces) - throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet, - inclusiveNamespaces); + NodeList xpathNodeSet, String inclusiveNamespaces + ) throws CanonicalizationException { + return + canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet, inclusiveNamespaces); } /** @@ -308,8 +338,8 @@ public class Canonicalizer { * @throws CanonicalizationException */ public byte[] canonicalizeXPathNodeSet(Set xpathNodeSet) - throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet); + throws CanonicalizationException { + return canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet); } /** @@ -320,10 +350,11 @@ public class Canonicalizer { * @return the result of the c14n. * @throws CanonicalizationException */ - public byte[] canonicalizeXPathNodeSet(Set xpathNodeSet, - String inclusiveNamespaces) throws CanonicalizationException { - return this.canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet, - inclusiveNamespaces); + public byte[] canonicalizeXPathNodeSet( + Set xpathNodeSet, String inclusiveNamespaces + ) throws CanonicalizationException { + return + canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet, inclusiveNamespaces); } /** @@ -332,7 +363,7 @@ public class Canonicalizer { * @param os */ public void setWriter(OutputStream os) { - this.canonicalizerSpi.setWriter(os); + canonicalizerSpi.setWriter(os); } /** @@ -341,23 +372,14 @@ public class Canonicalizer { * @return the name of the implementing {@link CanonicalizerSpi} class */ public String getImplementingCanonicalizerClass() { - return this.canonicalizerSpi.getClass().getName(); - } - - /** - * Method getImplementingClass - * - * @param URI - * @return the name of the class that implements the given URI - */ - private static Class getImplementingClass(String URI) { - return _canonicalizerHash.get(URI); + return canonicalizerSpi.getClass().getName(); } /** * Set the canonicalizer behaviour to not reset. */ public void notReset() { - this.canonicalizerSpi.reset = false; + canonicalizerSpi.reset = false; } + } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java index 48294fe34e9..7e150e365b4 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/CanonicalizerSpi.java @@ -26,6 +26,7 @@ import java.io.ByteArrayInputStream; import java.io.OutputStream; import java.util.Set; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; @@ -67,6 +68,7 @@ public abstract class CanonicalizerSpi { java.io.ByteArrayInputStream bais = new ByteArrayInputStream(inputBytes); InputSource in = new InputSource(bais); DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); + dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); // needs to validate for ID attribute nomalization dfactory.setNamespaceAware(true); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java index b8be1a505ed..8177cf34546 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java @@ -41,6 +41,7 @@ import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.IvParameterSpec; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -1981,22 +1982,23 @@ public class XMLCipher { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE); - DocumentBuilder db = dbf.newDocumentBuilder(); - Document d = db.parse( - new InputSource(new StringReader(fragment))); + dbf.setNamespaceAware(true); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document d = db.parse( + new InputSource(new StringReader(fragment))); - Element fragElt = (Element) _contextDocument.importNode( + Element fragElt = (Element) _contextDocument.importNode( d.getDocumentElement(), true); - result = _contextDocument.createDocumentFragment(); - Node child = fragElt.getFirstChild(); - while (child != null) { - fragElt.removeChild(child); - result.appendChild(child); - child = fragElt.getFirstChild(); - } - // String outp = serialize(d); + result = _contextDocument.createDocumentFragment(); + Node child = fragElt.getFirstChild(); + while (child != null) { + fragElt.removeChild(child); + result.appendChild(child); + child = fragElt.getFirstChild(); + } + // String outp = serialize(d); } catch (SAXException se) { throw new XMLEncryptionException("empty", se); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java index 0a39b1acc17..3c273dea7ac 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java @@ -54,6 +54,7 @@ import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.IdResolver; import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -128,8 +129,11 @@ public class KeyInfo extends SignatureElementProxy { */ public KeyInfo(Element element, String BaseURI) throws XMLSecurityException { super(element, BaseURI); - // _storageResolvers.add(null); + Attr attr = element.getAttributeNodeNS(null, "Id"); + if (attr != null) { + element.setIdAttributeNode(attr, true); + } } /** @@ -139,9 +143,8 @@ public class KeyInfo extends SignatureElementProxy { */ public void setId(String Id) { - if ((Id != null)) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + if (Id != null) { + setLocalIdAttribute(Constants._ATT_ID, Id); } } @@ -719,42 +722,36 @@ public class KeyInfo extends SignatureElementProxy { return null; } - /** - * Searches the library wide keyresolvers for public keys - * - * @return The publick contained in this Node. - * @throws KeyResolverException - */ - PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException { - int length=KeyResolver.length(); - int storageLength=this._storageResolvers.size(); - Iterator it= KeyResolver.iterator(); - for (int i = 0; i < length; i++) { - KeyResolverSpi keyResolver = it.next(); - Node currentChild=this._constructionElement.getFirstChild(); - String uri= this.getBaseURI(); - while (currentChild!=null) { - if (currentChild.getNodeType() == Node.ELEMENT_NODE) { - for (int k = 0; k < storageLength; k++) { - StorageResolver storage = - this._storageResolvers.get(k); + /** + * Searches the library wide keyresolvers for public keys + * + * @return The public key contained in this Node. + * @throws KeyResolverException + */ + PublicKey getPublicKeyFromStaticResolvers() throws KeyResolverException { + Iterator it = KeyResolver.iterator(); + while (it.hasNext()) { + KeyResolverSpi keyResolver = it.next(); + Node currentChild = this._constructionElement.getFirstChild(); + String uri = this.getBaseURI(); + while (currentChild != null) { + if (currentChild.getNodeType() == Node.ELEMENT_NODE) { + for (StorageResolver storage : _storageResolvers) { + PublicKey pk = + keyResolver.engineLookupAndResolvePublicKey( + (Element) currentChild, uri, storage + ); - PublicKey pk = - keyResolver.engineLookupAndResolvePublicKey((Element) currentChild, - uri, - storage); - - if (pk != null) { - KeyResolver.hit(it); - return pk; - } - } + if (pk != null) { + return pk; + } + } + } + currentChild = currentChild.getNextSibling(); } - currentChild=currentChild.getNextSibling(); - } - } - return null; - } + } + return null; + } /** * Searches the per-KeyInfo keyresolvers for public keys @@ -829,81 +826,83 @@ public class KeyInfo extends SignatureElementProxy { return null; } - /** - * This method uses each System-wide {@link KeyResolver} to search the - * child elements. Each combination of {@link KeyResolver} and child element - * is checked against all {@link StorageResolver}s. - * - * @return The certificate contined in this KeyInfo - * @throws KeyResolverException - */ - X509Certificate getX509CertificateFromStaticResolvers() - throws KeyResolverException { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Start getX509CertificateFromStaticResolvers() with " - + KeyResolver.length() + " resolvers"); - String uri=this.getBaseURI(); - int length= KeyResolver.length(); - int storageLength=this._storageResolvers.size(); - Iterator it = KeyResolver.iterator(); - for (int i = 0; i it = KeyResolver.iterator(); + while (it.hasNext()) { + KeyResolverSpi keyResolver = it.next(); + X509Certificate cert = applyCurrentResolver(uri, keyResolver); + if (cert != null) { + return cert; } - currentChild=currentChild.getNextSibling(); - } - return null; - } + } + return null; + } - /** - * Method getX509CertificateFromInternalResolvers - * - * @return The certificate contined in this KeyInfo - * @throws KeyResolverException - */ - X509Certificate getX509CertificateFromInternalResolvers() - throws KeyResolverException { - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "Start getX509CertificateFromInternalResolvers() with " - + this.lengthInternalKeyResolver() + " resolvers"); - String uri=this.getBaseURI(); - int storageLength=this._storageResolvers.size(); - for (int i = 0; i < this.lengthInternalKeyResolver(); i++) { - KeyResolverSpi keyResolver = this.itemInternalKeyResolver(i); - if (log.isLoggable(java.util.logging.Level.FINE)) + private X509Certificate applyCurrentResolver( + String uri, KeyResolverSpi keyResolver + ) throws KeyResolverException { + Node currentChild = this._constructionElement.getFirstChild(); + while (currentChild != null) { + if (currentChild.getNodeType() == Node.ELEMENT_NODE) { + for (StorageResolver storage : _storageResolvers) { + X509Certificate cert = + keyResolver.engineLookupResolveX509Certificate( + (Element) currentChild, uri, storage + ); + + if (cert != null) { + return cert; + } + } + } + currentChild = currentChild.getNextSibling(); + } + return null; + } + + /** + * Method getX509CertificateFromInternalResolvers + * + * @return The certificate contined in this KeyInfo + * @throws KeyResolverException + */ + X509Certificate getX509CertificateFromInternalResolvers() + throws KeyResolverException { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, + "Start getX509CertificateFromInternalResolvers() with " + + this.lengthInternalKeyResolver() + " resolvers" + ); + } + String uri = this.getBaseURI(); + for (KeyResolverSpi keyResolver : _internalKeyResolvers) { + if (log.isLoggable(java.util.logging.Level.FINE)) { log.log(java.util.logging.Level.FINE, "Try " + keyResolver.getClass().getName()); - X509Certificate cert= applyCurrentResolver(uri, storageLength, keyResolver); - if (cert!=null) { - return cert; - } - } + } + X509Certificate cert = applyCurrentResolver(uri, keyResolver); + if (cert != null) { + return cert; + } + } - return null; - } + return null; + } /** * This method returns a secret (symmetric) key. This is for XML Encryption. @@ -1012,7 +1011,7 @@ public class KeyInfo extends SignatureElementProxy { /** * Stores the individual (per-KeyInfo) {@link KeyResolver}s */ - List _internalKeyResolvers = null; + List _internalKeyResolvers = new ArrayList(); /** * This method is used to add a custom {@link KeyResolverSpi} to a KeyInfo @@ -1048,7 +1047,7 @@ public class KeyInfo extends SignatureElementProxy { } /** Field _storageResolvers */ - List _storageResolvers = nullList; + private List _storageResolvers = nullList; /** * Method addStorageResolver diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java index a10cb417a8f..00c60165f8a 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java @@ -2,357 +2,402 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.keys.keyresolver; - - import java.security.PublicKey; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import javax.crypto.SecretKey; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.DSAKeyValueResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.RSAKeyValueResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.RetrievalMethodResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509CertificateResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509IssuerSerialResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509SKIResolver; +import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509SubjectNameResolver; import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver; import org.w3c.dom.Element; import org.w3c.dom.Node; - /** * KeyResolver is factory class for subclass of KeyResolverSpi that * represent child element of KeyInfo. - * - * @author $Author: mullan $ - * @version %I%, %G% */ public class KeyResolver { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(KeyResolver.class.getName()); - /** Field _alreadyInitialized */ - static boolean _alreadyInitialized = false; + /** Field resolverVector */ + private static List resolverVector = new CopyOnWriteArrayList(); - /** Field _resolverVector */ - static List _resolverVector = null; + /** Field resolverSpi */ + private final KeyResolverSpi resolverSpi; - /** Field _resolverSpi */ - protected KeyResolverSpi _resolverSpi = null; + /** + * Constructor. + * + * @param keyResolverSpi a KeyResolverSpi instance + */ + private KeyResolver(KeyResolverSpi keyResolverSpi) { + resolverSpi = keyResolverSpi; + } - /** Field _storage */ - protected StorageResolver _storage = null; + /** + * Method length + * + * @return the length of resolvers registered + */ + public static int length() { + return resolverVector.size(); + } - /** - * Constructor ResourceResolver - * - * @param className - * @throws ClassNotFoundException - * @throws IllegalAccessException - * @throws InstantiationException - */ - private KeyResolver(String className) - throws ClassNotFoundException, IllegalAccessException, - InstantiationException { - this._resolverSpi = - (KeyResolverSpi) Class.forName(className).newInstance(); - this._resolverSpi.setGlobalResolver(true); - } + /** + * Method getX509Certificate + * + * @param element + * @param baseURI + * @param storage + * @return The certificate represented by the element. + * + * @throws KeyResolverException + */ + public static final X509Certificate getX509Certificate( + Element element, String baseURI, StorageResolver storage + ) throws KeyResolverException { + for (KeyResolver resolver : resolverVector) { + if (resolver == null) { + Object exArgs[] = { + (((element != null) + && (element.getNodeType() == Node.ELEMENT_NODE)) + ? element.getTagName() : "null") + }; - /** - * Method length - * - * @return the length of resolvers registed - */ - public static int length() { - return KeyResolver._resolverVector.size(); - } - - public static void hit(Iterator hintI) { - ResolverIterator hint = (ResolverIterator) hintI; - int i = hint.i; - if (i!=1 && hint.res ==_resolverVector) { - List resolverVector=getResolverVectorClone(); - KeyResolver ob=resolverVector.remove(i-1); - resolverVector.add(0,ob); - _resolverVector=resolverVector; - } else { - //System.out.println("KeyResolver hitting"); - } - } - - /** - * Method getInstance - * - * @param element - * @param BaseURI - * @param storage - * @return The certificate represented by the element. - * - * @throws KeyResolverException - */ - public static final X509Certificate getX509Certificate( - Element element, String BaseURI, StorageResolver storage) - throws KeyResolverException { - - // use the old vector to not be hit by updates - List resolverVector = KeyResolver._resolverVector; - for (KeyResolver resolver : resolverVector) { - if (resolver==null) { - Object exArgs[] = { - (((element != null) - && (element.getNodeType() == Node.ELEMENT_NODE)) - ? element.getTagName() - : "null") }; - - throw new KeyResolverException("utils.resolver.noClass", exArgs); - } - if (log.isLoggable(java.util.logging.Level.FINE)) + throw new KeyResolverException("utils.resolver.noClass", exArgs); + } + if (log.isLoggable(java.util.logging.Level.FINE)) { log.log(java.util.logging.Level.FINE, "check resolvability by class " + resolver.getClass()); + } - X509Certificate cert=resolver.resolveX509Certificate(element, BaseURI, storage); - if (cert!=null) { - return cert; - } - } - - Object exArgs[] = { - (((element != null) && (element.getNodeType() == Node.ELEMENT_NODE)) - ? element.getTagName() - : "null") }; - - throw new KeyResolverException("utils.resolver.noClass", exArgs); - } - /** - * Method getInstance - * - * @param element - * @param BaseURI - * @param storage - * @return the public key contained in the element - * - * @throws KeyResolverException - */ - public static final PublicKey getPublicKey( - Element element, String BaseURI, StorageResolver storage) - throws KeyResolverException { - - List resolverVector = KeyResolver._resolverVector; - for (KeyResolver resolver : resolverVector) { - - if (resolver==null) { - Object exArgs[] = { - (((element != null) - && (element.getNodeType() == Node.ELEMENT_NODE)) - ? element.getTagName() - : "null") }; - - throw new KeyResolverException("utils.resolver.noClass", exArgs); - } - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "check resolvability by class " + resolver.getClass()); - - PublicKey cert=resolver.resolvePublicKey(element, BaseURI, storage); - if (cert!=null) { - if (resolverVector.indexOf(resolver)!=0 && resolverVector==_resolverVector) { - //update resolver. - resolverVector=getResolverVectorClone(); - resolverVector.remove(resolver); - resolverVector.add(0,resolver); - _resolverVector=resolverVector; - } - return cert; - } - } - - Object exArgs[] = { - (((element != null) && (element.getNodeType() == Node.ELEMENT_NODE)) - ? element.getTagName() - : "null") }; - - throw new KeyResolverException("utils.resolver.noClass", exArgs); - } - - - @SuppressWarnings("unchecked") - private static List getResolverVectorClone() { - return (List)((ArrayList)_resolverVector).clone(); - } - - /** - * The init() function is called by com.sun.org.apache.xml.internal.security.Init.init() - */ - public static void init() { - - if (!KeyResolver._alreadyInitialized) { - KeyResolver._resolverVector = new ArrayList(10); - _alreadyInitialized = true; - } - } - - /** - * This method is used for registering {@link KeyResolverSpi}s which are - * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that - * personalized {@link KeyResolverSpi}s should only be registered directly - * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using - * {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. - * - * @param className - * @throws InstantiationException - * @throws IllegalAccessException - * @throws ClassNotFoundException - */ - public static void register(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { - KeyResolver._resolverVector.add(new KeyResolver(className)); - } - - /** - * This method is used for registering {@link KeyResolverSpi}s which are - * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that - * personalized {@link KeyResolverSpi}s should only be registered directly - * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. - * - * @param className - */ - public static void registerAtStart(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { - register(className); - } - - /** - * Method resolve - * - * @param element - * @param BaseURI - * @param storage - * @return resolved public key from the registered from the elements - * - * @throws KeyResolverException - */ - public PublicKey resolvePublicKey( - Element element, String BaseURI, StorageResolver storage) - throws KeyResolverException { - return this._resolverSpi.engineLookupAndResolvePublicKey(element, BaseURI, storage); - } - - /** - * Method resolveX509Certificate - * - * @param element - * @param BaseURI - * @param storage - * @return resolved X509certificate key from the registered from the elements - * - * @throws KeyResolverException - */ - public X509Certificate resolveX509Certificate( - Element element, String BaseURI, StorageResolver storage) - throws KeyResolverException { - return this._resolverSpi.engineLookupResolveX509Certificate(element, BaseURI, - storage); - } - - /** - * @param element - * @param BaseURI - * @param storage - * @return resolved SecretKey key from the registered from the elements - * @throws KeyResolverException - */ - public SecretKey resolveSecretKey( - Element element, String BaseURI, StorageResolver storage) - throws KeyResolverException { - return this._resolverSpi.engineLookupAndResolveSecretKey(element, BaseURI, - storage); - } - - /** - * Method setProperty - * - * @param key - * @param value - */ - public void setProperty(String key, String value) { - this._resolverSpi.engineSetProperty(key, value); - } - - /** - * Method getProperty - * - * @param key - * @return the property setted for this resolver - */ - public String getProperty(String key) { - return this._resolverSpi.engineGetProperty(key); - } - - - /** - * Method understandsProperty - * - * @param propertyToTest - * @return true if the resolver understands property propertyToTest - */ - public boolean understandsProperty(String propertyToTest) { - return this._resolverSpi.understandsProperty(propertyToTest); - } - - - /** - * Method resolverClassName - * - * @return the name of the resolver. - */ - public String resolverClassName() { - return this._resolverSpi.getClass().getName(); - } - - static class ResolverIterator implements Iterator { - List res; - Iterator it; - int i; - public ResolverIterator(List list) { - res = list; - it = res.iterator(); + X509Certificate cert = resolver.resolveX509Certificate(element, baseURI, storage); + if (cert != null) { + return cert; + } } - public boolean hasNext() { - // TODO Auto-generated method stub - return it.hasNext(); - } - public KeyResolverSpi next() { - i++; - KeyResolver resolver = it.next(); - if (resolver==null) { - throw new RuntimeException("utils.resolver.noClass"); - } + Object exArgs[] = { + (((element != null) && (element.getNodeType() == Node.ELEMENT_NODE)) + ? element.getTagName() : "null") + }; - return resolver._resolverSpi; - } + throw new KeyResolverException("utils.resolver.noClass", exArgs); + } - public void remove() { - // TODO Auto-generated method stub + /** + * Method getPublicKey + * + * @param element + * @param baseURI + * @param storage + * @return the public key contained in the element + * + * @throws KeyResolverException + */ + public static final PublicKey getPublicKey( + Element element, String baseURI, StorageResolver storage + ) throws KeyResolverException { + for (KeyResolver resolver : resolverVector) { + if (resolver == null) { + Object exArgs[] = { + (((element != null) + && (element.getNodeType() == Node.ELEMENT_NODE)) + ? element.getTagName() : "null") + }; - } + throw new KeyResolverException("utils.resolver.noClass", exArgs); + } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "check resolvability by class " + resolver.getClass()); + } - }; - public static Iterator iterator() { - return new ResolverIterator(_resolverVector); - } + PublicKey cert = resolver.resolvePublicKey(element, baseURI, storage); + if (cert != null) { + return cert; + } + } + + Object exArgs[] = { + (((element != null) && (element.getNodeType() == Node.ELEMENT_NODE)) + ? element.getTagName() : "null") + }; + + throw new KeyResolverException("utils.resolver.noClass", exArgs); + } + + /** + * This method is used for registering {@link KeyResolverSpi}s which are + * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that + * personalized {@link KeyResolverSpi}s should only be registered directly + * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using + * {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. + * Please note that this method will create a new copy of the underlying array, as the + * underlying collection is a CopyOnWriteArrayList. + * + * @param className + * @param globalResolver Whether the KeyResolverSpi is a global resolver or not + * @throws InstantiationException + * @throws IllegalAccessException + * @throws ClassNotFoundException + */ + public static void register(String className, boolean globalResolver) + throws ClassNotFoundException, IllegalAccessException, InstantiationException { + KeyResolverSpi keyResolverSpi = + (KeyResolverSpi) Class.forName(className).newInstance(); + keyResolverSpi.setGlobalResolver(globalResolver); + register(keyResolverSpi, false); + } + + /** + * This method is used for registering {@link KeyResolverSpi}s which are + * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that + * personalized {@link KeyResolverSpi}s should only be registered directly + * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using + * {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. + * Please note that this method will create a new copy of the underlying array, as the + * underlying collection is a CopyOnWriteArrayList. + * + * @param className + * @param globalResolver Whether the KeyResolverSpi is a global resolver or not + */ + public static void registerAtStart(String className, boolean globalResolver) { + KeyResolverSpi keyResolverSpi = null; + Exception ex = null; + try { + keyResolverSpi = (KeyResolverSpi) Class.forName(className).newInstance(); + } catch (ClassNotFoundException e) { + ex = e; + } catch (IllegalAccessException e) { + ex = e; + } catch (InstantiationException e) { + ex = e; + } + + if (ex != null) { + throw (IllegalArgumentException) new + IllegalArgumentException("Invalid KeyResolver class name").initCause(ex); + } + keyResolverSpi.setGlobalResolver(globalResolver); + register(keyResolverSpi, true); + } + + /** + * This method is used for registering {@link KeyResolverSpi}s which are + * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that + * personalized {@link KeyResolverSpi}s should only be registered directly + * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using + * {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. + * Please note that this method will create a new copy of the underlying array, as the + * underlying collection is a CopyOnWriteArrayList. + * + * @param keyResolverSpi a KeyResolverSpi instance to register + * @param start whether to register the KeyResolverSpi at the start of the list or not + */ + public static void register( + KeyResolverSpi keyResolverSpi, + boolean start + ) { + KeyResolver resolver = new KeyResolver(keyResolverSpi); + if (start) { + resolverVector.add(0, resolver); + } else { + resolverVector.add(resolver); + } + } + + /** + * This method is used for registering {@link KeyResolverSpi}s which are + * available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that + * personalized {@link KeyResolverSpi}s should only be registered directly + * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using + * {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}. + * The KeyResolverSpi instances are not registered as a global resolver. + * + * + * @param classNames + * @throws InstantiationException + * @throws IllegalAccessException + * @throws ClassNotFoundException + */ + public static void registerClassNames(List classNames) + throws ClassNotFoundException, IllegalAccessException, InstantiationException { + List keyResolverList = new ArrayList(classNames.size()); + for (String className : classNames) { + KeyResolverSpi keyResolverSpi = + (KeyResolverSpi) Class.forName(className).newInstance(); + keyResolverSpi.setGlobalResolver(false); + keyResolverList.add(new KeyResolver(keyResolverSpi)); + } + resolverVector.addAll(keyResolverList); + } + + /** + * This method registers the default resolvers. + */ + public static void registerDefaultResolvers() { + + List keyResolverList = new ArrayList(); + keyResolverList.add(new KeyResolver(new RSAKeyValueResolver())); + keyResolverList.add(new KeyResolver(new DSAKeyValueResolver())); + keyResolverList.add(new KeyResolver(new X509CertificateResolver())); + keyResolverList.add(new KeyResolver(new X509SKIResolver())); + keyResolverList.add(new KeyResolver(new RetrievalMethodResolver())); + keyResolverList.add(new KeyResolver(new X509SubjectNameResolver())); + keyResolverList.add(new KeyResolver(new X509IssuerSerialResolver())); + + resolverVector.addAll(keyResolverList); + } + + /** + * Method resolvePublicKey + * + * @param element + * @param baseURI + * @param storage + * @return resolved public key from the registered from the elements + * + * @throws KeyResolverException + */ + public PublicKey resolvePublicKey( + Element element, String baseURI, StorageResolver storage + ) throws KeyResolverException { + return resolverSpi.engineLookupAndResolvePublicKey(element, baseURI, storage); + } + + /** + * Method resolveX509Certificate + * + * @param element + * @param baseURI + * @param storage + * @return resolved X509certificate key from the registered from the elements + * + * @throws KeyResolverException + */ + public X509Certificate resolveX509Certificate( + Element element, String baseURI, StorageResolver storage + ) throws KeyResolverException { + return resolverSpi.engineLookupResolveX509Certificate(element, baseURI, storage); + } + + /** + * @param element + * @param baseURI + * @param storage + * @return resolved SecretKey key from the registered from the elements + * @throws KeyResolverException + */ + public SecretKey resolveSecretKey( + Element element, String baseURI, StorageResolver storage + ) throws KeyResolverException { + return resolverSpi.engineLookupAndResolveSecretKey(element, baseURI, storage); + } + + /** + * Method setProperty + * + * @param key + * @param value + */ + public void setProperty(String key, String value) { + resolverSpi.engineSetProperty(key, value); + } + + /** + * Method getProperty + * + * @param key + * @return the property set for this resolver + */ + public String getProperty(String key) { + return resolverSpi.engineGetProperty(key); + } + + + /** + * Method understandsProperty + * + * @param propertyToTest + * @return true if the resolver understands property propertyToTest + */ + public boolean understandsProperty(String propertyToTest) { + return resolverSpi.understandsProperty(propertyToTest); + } + + + /** + * Method resolverClassName + * + * @return the name of the resolver. + */ + public String resolverClassName() { + return resolverSpi.getClass().getName(); + } + + /** + * Iterate over the KeyResolverSpi instances + */ + static class ResolverIterator implements Iterator { + List res; + Iterator it; + + public ResolverIterator(List list) { + res = list; + it = res.iterator(); + } + + public boolean hasNext() { + return it.hasNext(); + } + + public KeyResolverSpi next() { + KeyResolver resolver = it.next(); + if (resolver == null) { + throw new RuntimeException("utils.resolver.noClass"); + } + + return resolver.resolverSpi; + } + + public void remove() { + throw new UnsupportedOperationException("Can't remove resolvers using the iterator"); + } + }; + + public static Iterator iterator() { + return new ResolverIterator(resolverVector); + } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java index fec12b3b1bf..4ba848a681d 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/RetrievalMethodResolver.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.ListIterator; import java.util.Set; +import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException; @@ -251,6 +252,7 @@ public class RetrievalMethodResolver extends KeyResolverSpi { try { javax.xml.parsers.DocumentBuilderFactory dbf =javax.xml.parsers.DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder(); org.w3c.dom.Document doc = db.parse(new java.io.ByteArrayInputStream(bytes)); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties index 1b8e97bfd63..f15104e94b5 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/resource/xmlsecurity_en.properties @@ -1,123 +1,126 @@ -algorithm.alreadyRegistered = URI {0} already assigned to class {1} -algorithm.classDoesNotExist = Cannot register URI {0} to class {1} because this class does not exist in CLASSPATH -algorithm.ClassDoesNotExist = Class {0} does not exist -algorithm.extendsWrongClass = Cannot register URI {0} to class {1} because it does not extend {2} -algorithms.CannotUseAlgorithmParameterSpecOnDSA = Sorry, but you cannot use a AlgorithmParameterSpec object for creating DSA signatures. -algorithms.CannotUseAlgorithmParameterSpecOnRSA = Sorry, but you cannot use a AlgorithmParameterSpec object for creating RSA signatures. -algorithms.CannotUseSecureRandomOnMAC = Sorry, but you cannot use a SecureRandom object for creating MACs. -algorithms.HMACOutputLengthOnlyForHMAC = A HMACOutputLength can only be specified for HMAC integrity algorithms -algorithms.NoSuchAlgorithm = The requested algorithm {0} does not exist. Original Message was: {1} -algorithms.NoSuchMap = The algorithm URI "{0}" could not be mapped to a JCE algorithm -algorithms.NoSuchProvider = The specified Provider {0} does not exist. Original Message was: {1} -algorithms.operationOnlyVerification = A public key can only used for verification of a signature. -algorithms.WrongKeyForThisOperation = Sorry, you supplied the wrong key type for this operation! You supplied a {0} but a {1} is needed. -attributeValueIllegal = The attribute {0} has value {1} but must be {2} -c14n.Canonicalizer.Exception = Exception during Canonicalization: Original Message was {0} -c14n.Canonicalizer.IllegalNode = Illegal node type {0}, node name was {1} -c14n.Canonicalizer.NoSuchCanonicalizer = No canonicalizer found with URI {0} -c14n.Canonicalizer.ParserConfigurationException = ParserConfigurationException during Canonicalization: Original Message was {0} -c14n.Canonicalizer.RelativeNamespace = Element {0} has a relative namespace: {1}="{2}" -c14n.Canonicalizer.SAXException = SAXException during Canonicalization: Original Message was {0} -c14n.Canonicalizer.TraversalNotSupported = This DOM document does not support Traversal {0} -c14n.Canonicalizer.UnsupportedEncoding = Unsupported encoding {0} -c14n.Canonicalizer.UnsupportedOperation = This canonicalizer does not support this operation -c14n.XMLUtils.circumventBug2650forgotten = The tree has not been prepared for canonicalization using XMLUtils#circumventBug2650(Document) -certificate.noSki.lowVersion = Certificate cannot contain a SubjectKeyIdentifier because it is only X509v{0} -certificate.noSki.notOctetString = Certificates SubjectKeyIdentifier is not a OctetString -certificate.noSki.null = Certificate does not contain a SubjectKeyIdentifier -defaultNamespaceCannotBeSetHere = Default namespace cannot be set here -ElementProxy.nullElement = Cannot create an ElementProxy from a null argument -empty = {0} -encryption.algorithmCannotBeUsedForEncryptedData = encryption.algorithmCannotBeUsedForEncryptedData {0} -encryption.algorithmCannotEatInitParams = encryption.algorithmCannotEatInitParams -encryption.algorithmCannotEncryptDecrypt = encryption.algorithmCannotEncryptDecrypt -encryption.algorithmCannotWrapUnWrap = encryption.algorithmCannotWrapUnWrap -encryption.ExplicitKeySizeMismatch = The xenc:KeySize element requests a key size of {0} bit but the algorithm implements {1} bit -encryption.nonceLongerThanDecryptedPlaintext = The given nonce is longer than the available plaintext. I Cannot strip away this. -encryption.RSAOAEP.dataHashWrong = data hash wrong -encryption.RSAOAEP.dataStartWrong = data wrong start {0} -encryption.RSAOAEP.dataTooShort = data too short -encryption.RSAPKCS15.blockTruncated = block truncated -encryption.RSAPKCS15.noDataInBlock = no data in block -encryption.RSAPKCS15.unknownBlockType = unknown block type -encryption.nokey = No Key Encryption Key loaded and cannot determine using key resolvers -endorsed.jdk1.4.0 = Since it seems that nobody reads our installation notes, we must do it in the exception messages. Hope you read them. You did NOT use the endorsed mechanism from JDK 1.4 properly; look at how to solve this problem. -errorMessages.InvalidDigestValueException = INVALID signature -- check reference resolution. -errorMessages.InvalidSignatureValueException = INVALID signature -- core validation failed. -errorMessages.IOException = Other file I/O and similar exceptions. -errorMessages.MissingKeyFailureException = Cannot verify because of missing public key. Provide it via addResource and try again. -errorMessages.MissingResourceFailureException = Cannot verify because of unresolved references. Provide it via addResource and try again. -errorMessages.NoSuchAlgorithmException = Unknown Algorithm {0} -errorMessages.NotYetImplementedException = Functionality not yet there. -errorMessages.XMLSignatureException = Verification failed for some other reason. -decoding.divisible.four = It should be divisible by four -decoding.general = Error while decoding -FileKeyStorageImpl.addToDefaultFromRemoteNotImplemented = Method addToDefaultFromRemote() not yet implemented. -FileKeyStorageImpl.NoCert.Context = Not found such a X509Certificate including context {0} -FileKeyStorageImpl.NoCert.IssNameSerNo = Not found such a X509Certificate with IssuerName {0} and serial number {1} -FileKeyStorageImpl.NoCert.SubjName = Not found such a X509Certificate including SubjectName {0} -generic.dontHaveConstructionElement = I do not have a construction Element -generic.EmptyMessage = {0} -generic.NotYetImplemented = {0} Not YET implemented ;-(( -java.security.InvalidKeyException = Invalid key -java.security.NoSuchProviderException = Unknown or unsupported provider -java.security.UnknownKeyType = Unknown or unsupported key type {0} -KeyInfo.needKeyResolver = More than one keyResovler have to be registered -KeyInfo.nokey = Cannot get key from {0} -KeyInfo.noKey = Cannot get the public key -KeyInfo.wrongNumberOfObject = Need {0} keyObjects -KeyInfo.wrongUse = This object was made for getting {0} -keyResolver.alreadyRegistered = {1} class has already been registered for {0} -KeyResolver.needStorageResolver = Need a StorageResolver to retrieve a Certificate from a {0} -KeyResoverSpiImpl.cannotGetCert = Cannot get the Certificate that include or in {1} in implement class {0} -KeyResoverSpiImpl.elementGeneration = Cannot make {1} element in implement class {0} -KeyResoverSpiImpl.getPoublicKey = Cannot get the public key from implement class {0} -KeyResoverSpiImpl.InvalidElement = Cannot set (2) Element in implement class {0} -KeyResoverSpiImpl.keyStore = KeyStorage error in implement class {0} -KeyResoverSpiImpl.need.Element = {1} type of Element is needed in implement class {0} -KeyResoverSpiImpl.wrongCRLElement = Cannot make CRL from {1} in implement class {0} -KeyResoverSpiImpl.wrongKeyObject = Need {1} type of KeyObject for generation Element in implement class{0} -KeyResoverSpiImpl.wrongNumberOfObject = Need {1} keyObject in implement class {0} -KeyStore.alreadyRegistered = {0} Class has already been registered for {1} -KeyStore.register = {1} type class register error in class {0} -KeyStore.registerStore.register = Registeration error for type {0} -KeyValue.IllegalArgument = Cannot create a {0} from {1} -namespacePrefixAlreadyUsedByOtherURI = Namespace prefix {0} already used by other URI {1} -notYetInitialized = The module {0} is not yet initialized -prefix.AlreadyAssigned = You want to assign {0} as prefix for namespace {1} but it is already assigned for {2} -signature.Canonicalizer.UnknownCanonicalizer = Unknown canonicalizer. No handler installed for URI {0} -signature.DSA.invalidFormat = Invalid ASN.1 encoding of the DSA signature -signature.Generation.signBeforeGetValue = You have to XMLSignature.sign(java.security.PrivateKey) first -signature.signaturePropertyHasNoTarget = The Target attribute of the SignatureProperty must be set -signature.Transform.ErrorDuringTransform = A {1} was thrown during the {0} transform -signature.Transform.NotYetImplemented = Transform {0} not yet implemented -signature.Transform.NullPointerTransform = Null pointer as URI. Programming bug? -signature.Transform.UnknownTransform = Unknown transformation. No handler installed for URI {0} -signature.Transform.node = Current Node: {0} -signature.Transform.nodeAndType = Current Node: {0}, type: {1} -signature.Util.BignumNonPositive = bigInteger.signum() must be positive -signature.Util.NonTextNode = Not a text node -signature.Util.TooManyChilds = Too many childs of Type {0} in {1} -signature.Verification.certificateError = Certificate error -signature.Verification.IndexOutOfBounds = Index {0} illegal. We only have {1} References -signature.Verification.internalError = Internal error -signature.Verification.InvalidDigestOrReference = Invalid digest of reference {0} -signature.Verification.keyStore = KeyStore error -signature.Verification.MissingID = Cannot resolve element with ID {0} -signature.Verification.MissingResources = Cannot resolve external resource {0} -signature.Verification.NoSignatureElement = Input document contains no {0} Element in namespace {1} -signature.Verification.Reference.NoInput = The Reference for URI {0} has no XMLSignatureInput -signature.Verification.SignatureError = Signature error -signature.XMLSignatureInput.MissingConstuctor = Cannot construct a XMLSignatureInput from class {0} -signature.XMLSignatureInput.SerializeDOM = Input initialized with DOM Element. Use Canonicalization to serialize it -signature.XMLSignatureInput.nodesetReference = Unable to convert to nodeset the reference -transform.Init.IllegalContextArgument = Invalid context argument of class {0}. Must be String, org.w3c.dom.NodeList or java.io.InputStream. -transform.init.NotInitialized = -transform.init.wrongURI = Initialized with wrong URI. How could this happen? We implement {0} but {1} was used during initialization -utils.Base64.IllegalBitlength = Illegal byte length; Data to be decoded must be a multiple of 4 -Base64Decoding = Error while decoding -utils.resolver.noClass = Could not find a resolver for URI {0} and Base {1} -xml.WrongContent = Cannot find {0} in {1} -xml.WrongElement = Cannot create a {0} from a {1} element -xpath.funcHere.documentsDiffer = The XPath is not in the same document as the context node -xpath.funcHere.noXPathContext = Try to evaluate an XPath which uses the here() function but XPath is not inside an ds:XPath Element. XPath was : {0} +algorithm.alreadyRegistered = URI {0} already assigned to class {1} +algorithm.classDoesNotExist = Cannot register URI {0} to class {1} because this class does not exist in CLASSPATH +algorithm.ClassDoesNotExist = Class {0} does not exist +algorithm.extendsWrongClass = Cannot register URI {0} to class {1} because it does not extend {2} +algorithms.CannotUseAlgorithmParameterSpecOnDSA = Sorry, but you cannot use a AlgorithmParameterSpec object for creating DSA signatures. +algorithms.CannotUseAlgorithmParameterSpecOnRSA = Sorry, but you cannot use a AlgorithmParameterSpec object for creating RSA signatures. +algorithms.CannotUseSecureRandomOnMAC = Sorry, but you cannot use a SecureRandom object for creating MACs. +algorithms.HMACOutputLengthOnlyForHMAC = A HMACOutputLength can only be specified for HMAC integrity algorithms +algorithms.NoSuchAlgorithm = The requested algorithm {0} does not exist. Original Message was: {1} +algorithms.NoSuchMap = The algorithm URI "{0}" could not be mapped to a JCE algorithm +algorithms.NoSuchProvider = The specified Provider {0} does not exist. Original Message was: {1} +algorithms.operationOnlyVerification = A public key can only used for verification of a signature. +algorithms.WrongKeyForThisOperation = Sorry, you supplied the wrong key type for this operation! You supplied a {0} but a {1} is needed. +attributeValueIllegal = The attribute {0} has value {1} but must be {2} +c14n.Canonicalizer.Exception = Exception during Canonicalization: Original Message was {0} +c14n.Canonicalizer.IllegalNode = Illegal node type {0}, node name was {1} +c14n.Canonicalizer.NoSuchCanonicalizer = No canonicalizer found with URI {0} +c14n.Canonicalizer.ParserConfigurationException = ParserConfigurationException during Canonicalization: Original Message was {0} +c14n.Canonicalizer.RelativeNamespace = Element {0} has a relative namespace: {1}="{2}" +c14n.Canonicalizer.SAXException = SAXException during Canonicalization: Original Message was {0} +c14n.Canonicalizer.TraversalNotSupported = This DOM document does not support Traversal {0} +c14n.Canonicalizer.UnsupportedEncoding = Unsupported encoding {0} +c14n.Canonicalizer.UnsupportedOperation = This canonicalizer does not support this operation +c14n.XMLUtils.circumventBug2650forgotten = The tree has not been prepared for canonicalization using XMLUtils#circumventBug2650(Document) +certificate.noSki.lowVersion = Certificate cannot contain a SubjectKeyIdentifier because it is only X509v{0} +certificate.noSki.notOctetString = Certificates SubjectKeyIdentifier is not a OctetString +certificate.noSki.null = Certificate does not contain a SubjectKeyIdentifier +defaultNamespaceCannotBeSetHere = Default namespace cannot be set here +ElementProxy.nullElement = Cannot create an ElementProxy from a null argument +empty = {0} +encryption.algorithmCannotBeUsedForEncryptedData = encryption.algorithmCannotBeUsedForEncryptedData {0} +encryption.algorithmCannotEatInitParams = encryption.algorithmCannotEatInitParams +encryption.algorithmCannotEncryptDecrypt = encryption.algorithmCannotEncryptDecrypt +encryption.algorithmCannotWrapUnWrap = encryption.algorithmCannotWrapUnWrap +encryption.ExplicitKeySizeMismatch = The xenc:KeySize element requests a key size of {0} bit but the algorithm implements {1} bit +encryption.nonceLongerThanDecryptedPlaintext = The given nonce is longer than the available plaintext. I Cannot strip away this. +encryption.RSAOAEP.dataHashWrong = data hash wrong +encryption.RSAOAEP.dataStartWrong = data wrong start {0} +encryption.RSAOAEP.dataTooShort = data too short +encryption.RSAPKCS15.blockTruncated = block truncated +encryption.RSAPKCS15.noDataInBlock = no data in block +encryption.RSAPKCS15.unknownBlockType = unknown block type +encryption.nokey = No Key Encryption Key loaded and cannot determine using key resolvers +endorsed.jdk1.4.0 = Since it seems that nobody reads our installation notes, we must do it in the exception messages. Hope you read them. You did NOT use the endorsed mechanism from JDK 1.4 properly; look at how to solve this problem. +errorMessages.InvalidDigestValueException = INVALID signature -- check reference resolution. +errorMessages.InvalidSignatureValueException = INVALID signature -- core validation failed. +errorMessages.IOException = Other file I/O and similar exceptions. +errorMessages.MissingKeyFailureException = Cannot verify because of missing public key. Provide it via addResource and try again. +errorMessages.MissingResourceFailureException = Cannot verify because of unresolved references. Provide it via addResource and try again. +errorMessages.NoSuchAlgorithmException = Unknown Algorithm {0} +errorMessages.NotYetImplementedException = Functionality not yet there. +errorMessages.XMLSignatureException = Verification failed for some other reason. +decoding.divisible.four = It should be divisible by four +decoding.general = Error while decoding +FileKeyStorageImpl.addToDefaultFromRemoteNotImplemented = Method addToDefaultFromRemote() not yet implemented. +FileKeyStorageImpl.NoCert.Context = Not found such a X509Certificate including context {0} +FileKeyStorageImpl.NoCert.IssNameSerNo = Not found such a X509Certificate with IssuerName {0} and serial number {1} +FileKeyStorageImpl.NoCert.SubjName = Not found such a X509Certificate including SubjectName {0} +generic.dontHaveConstructionElement = I do not have a construction Element +generic.EmptyMessage = {0} +generic.NotYetImplemented = {0} Not YET implemented ;-(( +java.security.InvalidKeyException = Invalid key +java.security.NoSuchProviderException = Unknown or unsupported provider +java.security.UnknownKeyType = Unknown or unsupported key type {0} +KeyInfo.needKeyResolver = More than one keyResovler have to be registered +KeyInfo.nokey = Cannot get key from {0} +KeyInfo.noKey = Cannot get the public key +KeyInfo.wrongNumberOfObject = Need {0} keyObjects +KeyInfo.wrongUse = This object was made for getting {0} +keyResolver.alreadyRegistered = {1} class has already been registered for {0} +KeyResolver.needStorageResolver = Need a StorageResolver to retrieve a Certificate from a {0} +KeyResoverSpiImpl.cannotGetCert = Cannot get the Certificate that include or in {1} in implement class {0} +KeyResoverSpiImpl.elementGeneration = Cannot make {1} element in implement class {0} +KeyResoverSpiImpl.getPoublicKey = Cannot get the public key from implement class {0} +KeyResoverSpiImpl.InvalidElement = Cannot set (2) Element in implement class {0} +KeyResoverSpiImpl.keyStore = KeyStorage error in implement class {0} +KeyResoverSpiImpl.need.Element = {1} type of Element is needed in implement class {0} +KeyResoverSpiImpl.wrongCRLElement = Cannot make CRL from {1} in implement class {0} +KeyResoverSpiImpl.wrongKeyObject = Need {1} type of KeyObject for generation Element in implement class{0} +KeyResoverSpiImpl.wrongNumberOfObject = Need {1} keyObject in implement class {0} +KeyStore.alreadyRegistered = {0} Class has already been registered for {1} +KeyStore.register = {1} type class register error in class {0} +KeyStore.registerStore.register = Registeration error for type {0} +KeyValue.IllegalArgument = Cannot create a {0} from {1} +namespacePrefixAlreadyUsedByOtherURI = Namespace prefix {0} already used by other URI {1} +notYetInitialized = The module {0} is not yet initialized +prefix.AlreadyAssigned = You want to assign {0} as prefix for namespace {1} but it is already assigned for {2} +signature.Canonicalizer.UnknownCanonicalizer = Unknown canonicalizer. No handler installed for URI {0} +signature.DSA.invalidFormat = Invalid ASN.1 encoding of the DSA signature +signature.Generation.signBeforeGetValue = You have to XMLSignature.sign(java.security.PrivateKey) first +signature.Reference.ForbiddenResolver = It is forbidden to access resolver {0} when secure validation is enabled +signature.signatureAlgorithm = It is forbidden to use algorithm {0} when secure validation is enabled +signature.signaturePropertyHasNoTarget = The Target attribute of the SignatureProperty must be set +signature.Transform.ErrorDuringTransform = A {1} was thrown during the {0} transform +signature.Transform.NotYetImplemented = Transform {0} not yet implemented +signature.Transform.NullPointerTransform = Null pointer as URI. Programming bug? +signature.Transform.UnknownTransform = Unknown transformation. No handler installed for URI {0} +signature.Transform.node = Current Node: {0} +signature.Transform.nodeAndType = Current Node: {0}, type: {1} +signature.Util.BignumNonPositive = bigInteger.signum() must be positive +signature.Util.NonTextNode = Not a text node +signature.Util.TooManyChilds = Too many childs of Type {0} in {1} +signature.Verification.certificateError = Certificate error +signature.Verification.IndexOutOfBounds = Index {0} illegal. We only have {1} References +signature.Verification.internalError = Internal error +signature.Verification.InvalidDigestOrReference = Invalid digest of reference {0} +signature.Verification.keyStore = KeyStore error +signature.Verification.MissingID = Cannot resolve element with ID {0} +signature.Verification.MissingResources = Cannot resolve external resource {0} +signature.Verification.MultipleIDs = Multiple Elements with the same ID {0} were detected +signature.Verification.NoSignatureElement = Input document contains no {0} Element in namespace {1} +signature.Verification.Reference.NoInput = The Reference for URI {0} has no XMLSignatureInput +signature.Verification.SignatureError = Signature error +signature.XMLSignatureInput.MissingConstuctor = Cannot construct a XMLSignatureInput from class {0} +signature.XMLSignatureInput.SerializeDOM = Input initialized with DOM Element. Use Canonicalization to serialize it +signature.XMLSignatureInput.nodesetReference = Unable to convert to nodeset the reference +transform.Init.IllegalContextArgument = Invalid context argument of class {0}. Must be String, org.w3c.dom.NodeList or java.io.InputStream. +transform.init.NotInitialized = +transform.init.wrongURI = Initialized with wrong URI. How could this happen? We implement {0} but {1} was used during initialization +utils.Base64.IllegalBitlength = Illegal byte length; Data to be decoded must be a multiple of 4 +Base64Decoding = Error while decoding +utils.resolver.noClass = Could not find a resolver for URI {0} and Base {1} +xml.WrongContent = Cannot find {0} in {1} +xml.WrongElement = Cannot create a {0} from a {1} element +xpath.funcHere.documentsDiffer = The XPath is not in the same document as the context node +xpath.funcHere.noXPathContext = Try to evaluate an XPath which uses the here() function but XPath is not inside an ds:XPath Element. XPath was : {0} diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java index 440a0124f86..351dee5edaf 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java @@ -43,6 +43,7 @@ import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; +import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -101,6 +102,11 @@ public class Manifest extends SignatureElementProxy { super(element, BaseURI); + Attr attr = element.getAttributeNodeNS(null, "Id"); + if (attr != null) { + element.setIdAttributeNode(attr, true); + } + // check out Reference children this._referencesEl = XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(), Constants._TAG_REFERENCE); @@ -121,6 +127,11 @@ public class Manifest extends SignatureElementProxy { this._references = new ArrayList(le); for (int i = 0; i < le; i++) { + Element refElem = this._referencesEl[i]; + Attr refAttr = refElem.getAttributeNodeNS(null, "Id"); + if (refAttr != null) { + refElem.setIdAttributeNode(refAttr, true); + } this._references.add(null); } } @@ -221,8 +232,7 @@ public class Manifest extends SignatureElementProxy { public void setId(String Id) { if (Id != null) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java index f98954d12ed..8bbc4db2a62 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java @@ -68,9 +68,8 @@ public class ObjectContainer extends SignatureElementProxy { */ public void setId(String Id) { - if ((Id != null)) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + if (Id != null) { + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java index 8e29839eb98..57bb7fa0f77 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java @@ -284,8 +284,7 @@ private Element digestValueElement; public void setId(String Id) { if ( Id != null ) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java index d27c4323c27..e81875aa0ce 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java @@ -25,6 +25,7 @@ import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.IdResolver; import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -61,6 +62,21 @@ public class SignatureProperties extends SignatureElementProxy { public SignatureProperties(Element element, String BaseURI) throws XMLSecurityException { super(element, BaseURI); + + Attr attr = element.getAttributeNodeNS(null, "Id"); + if (attr != null) { + element.setIdAttributeNode(attr, true); + } + + int length = getLength(); + for (int i = 0; i < length; i++) { + Element propertyElem = + XMLUtils.selectDsNode(getElement(), Constants._TAG_SIGNATUREPROPERTY, i); + Attr propertyAttr = propertyElem.getAttributeNodeNS(null, "Id"); + if (propertyAttr != null) { + propertyElem.setIdAttributeNode(propertyAttr, true); + } + } } /** @@ -109,9 +125,8 @@ public class SignatureProperties extends SignatureElementProxy { */ public void setId(String Id) { - if ((Id != null)) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + if (Id != null) { + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java index eabd7a8eaa4..969ee922e1b 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java @@ -80,9 +80,8 @@ public class SignatureProperty extends SignatureElementProxy { */ public void setId(String Id) { - if ((Id != null)) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + if (Id != null) { + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java index 8dfea17d267..f2e04602984 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignedInfo.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.OutputStream; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; +import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm; @@ -186,8 +187,10 @@ public class SignedInfo extends Manifest { javax.xml.parsers.DocumentBuilderFactory dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + Boolean.TRUE); javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder(); - org.w3c.dom.Document newdoc = + Document newdoc = db.parse(new ByteArrayInputStream(this._c14nizedBytes)); Node imported = this._doc.importNode(newdoc.getDocumentElement(), true); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java index d4b0808c2fd..a1a69ddb1d4 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java @@ -49,9 +49,11 @@ import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import org.w3c.dom.Text; @@ -201,14 +203,13 @@ private Element signatureValueElement; super(doc); - String xmlnsDsPrefix = - getDefaultPrefixBindings(Constants.SignatureSpecNS); + String xmlnsDsPrefix = getDefaultPrefix(Constants.SignatureSpecNS); if (xmlnsDsPrefix == null) { this._constructionElement.setAttributeNS (Constants.NamespaceSpecNS, "xmlns", Constants.SignatureSpecNS); } else { this._constructionElement.setAttributeNS - (Constants.NamespaceSpecNS, xmlnsDsPrefix, Constants.SignatureSpecNS); + (Constants.NamespaceSpecNS, "xmlns:" + xmlnsDsPrefix, Constants.SignatureSpecNS); } XMLUtils.addReturnToElement(this._constructionElement); @@ -242,14 +243,13 @@ private Element signatureValueElement; super(doc); - String xmlnsDsPrefix = - getDefaultPrefixBindings(Constants.SignatureSpecNS); + String xmlnsDsPrefix = getDefaultPrefix(Constants.SignatureSpecNS); if (xmlnsDsPrefix == null) { this._constructionElement.setAttributeNS (Constants.NamespaceSpecNS, "xmlns", Constants.SignatureSpecNS); } else { this._constructionElement.setAttributeNS - (Constants.NamespaceSpecNS, xmlnsDsPrefix, Constants.SignatureSpecNS); + (Constants.NamespaceSpecNS, "xmlns:" + xmlnsDsPrefix, Constants.SignatureSpecNS); } XMLUtils.addReturnToElement(this._constructionElement); @@ -308,6 +308,10 @@ private Element signatureValueElement; throw new XMLSignatureException("xml.WrongContent", exArgs); } + Attr signatureValueAttr = signatureValueElement.getAttributeNodeNS(null, "Id"); + if (signatureValueAttr != null) { + signatureValueElement.setIdAttributeNode(signatureValueAttr, true); + } // Element keyInfoElem = XMLUtils.getNextElement(signatureValueElement.getNextSibling());//XMLUtils.selectDsNode(this._constructionElement.getFirstChild(), @@ -318,6 +322,34 @@ private Element signatureValueElement; keyInfoElem.getLocalName().equals(Constants._TAG_KEYINFO)) ) { this._keyInfo = new KeyInfo(keyInfoElem, BaseURI); } + + // + Element objectElem = + XMLUtils.getNextElement(signatureValueElement.getNextSibling()); + while (objectElem != null) { + Attr objectAttr = objectElem.getAttributeNodeNS(null, "Id"); + if (objectAttr != null) { + objectElem.setIdAttributeNode(objectAttr, true); + } + + NodeList nodes = objectElem.getChildNodes(); + int length = nodes.getLength(); + // Register Ids of the Object child elements + for (int i = 0; i < length; i++) { + Node child = nodes.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + Element childElem = (Element)child; + String tag = childElem.getLocalName(); + if (tag.equals("Manifest")) { + new Manifest(childElem, BaseURI); + } else if (tag.equals("SignatureProperties")) { + new SignatureProperties(childElem, BaseURI); + } + } + } + + objectElem = XMLUtils.getNextElement(objectElem.getNextSibling()); + } } /** @@ -327,9 +359,8 @@ private Element signatureValueElement; */ public void setId(String Id) { - if ( (Id != null)) { - this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); - IdResolver.registerElementById(this._constructionElement, Id); + if (Id != null) { + setLocalIdAttribute(Constants._ATT_ID, Id); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java index 2ba9e25c917..89990a10ac4 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java @@ -27,10 +27,11 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -244,13 +245,13 @@ public class XMLSignatureInput implements Cloneable { if (circumvent) { XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(_subNode)); } - this._inputNodeSet = new HashSet(); + this._inputNodeSet = new LinkedHashSet(); XMLUtils.getSet(_subNode,this._inputNodeSet, excludeNode, this.excludeComments); return this._inputNodeSet; } else if (this.isOctetStream()) { convertToNodes(); - HashSet result=new HashSet(); + LinkedHashSet result = new LinkedHashSet(); XMLUtils.getSet(_subNode, result,null,false); //this._inputNodeSet=result; return result; @@ -603,6 +604,8 @@ public class XMLSignatureInput implements Cloneable { DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setValidating(false); dfactory.setNamespaceAware(true); + dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + Boolean.TRUE); DocumentBuilder db = dfactory.newDocumentBuilder(); // select all nodes, also the comments. try { diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderUtils.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderUtils.java new file mode 100644 index 00000000000..173727778d9 --- /dev/null +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderUtils.java @@ -0,0 +1,280 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package com.sun.org.apache.xml.internal.security.transforms; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +/** + * This class is extremely useful for loading resources and classes in a fault + * tolerant manner that works across different applications servers. Do not + * touch this unless you're a grizzled classloading guru veteran who is going to + * verify any change on 6 different application servers. + */ +// NOTE! This is a duplicate of utils.ClassLoaderUtils with public +// modifiers changed to package-private. Make sure to integrate any future +// changes to utils.ClassLoaderUtils to this file. +final class ClassLoaderUtils { + + /** {@link org.apache.commons.logging} logging facility */ + private static final java.util.logging.Logger log = + java.util.logging.Logger.getLogger(ClassLoaderUtils.class.getName()); + + private ClassLoaderUtils() { + } + + /** + * Load a given resource.

      This method will try to load the resource + * using the following methods (in order): + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • callingClass.getClassLoader() + *
      + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static URL getResource(String resourceName, Class callingClass) { + URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName); + if (url == null && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + url = + Thread.currentThread().getContextClassLoader().getResource( + resourceName.substring(1) + ); + } + + ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader(); + if (cluClassloader == null) { + cluClassloader = ClassLoader.getSystemClassLoader(); + } + if (url == null) { + url = cluClassloader.getResource(resourceName); + } + if (url == null && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + url = cluClassloader.getResource(resourceName.substring(1)); + } + + if (url == null) { + ClassLoader cl = callingClass.getClassLoader(); + + if (cl != null) { + url = cl.getResource(resourceName); + } + } + + if (url == null) { + url = callingClass.getResource(resourceName); + } + + if ((url == null) && (resourceName != null) && (resourceName.charAt(0) != '/')) { + return getResource('/' + resourceName, callingClass); + } + + return url; + } + + /** + * Load a given resources.

      This method will try to load the resources + * using the following methods (in order): + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • callingClass.getClassLoader() + *
      + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static List getResources(String resourceName, Class callingClass) { + List ret = new ArrayList(); + Enumeration urls = new Enumeration() { + public boolean hasMoreElements() { + return false; + } + public URL nextElement() { + return null; + } + + }; + try { + urls = Thread.currentThread().getContextClassLoader().getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + //ignore + } + if (!urls.hasMoreElements() && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + try { + urls = + Thread.currentThread().getContextClassLoader().getResources( + resourceName.substring(1) + ); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + + ClassLoader cluClassloader = ClassLoaderUtils.class.getClassLoader(); + if (cluClassloader == null) { + cluClassloader = ClassLoader.getSystemClassLoader(); + } + if (!urls.hasMoreElements()) { + try { + urls = cluClassloader.getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + if (!urls.hasMoreElements() && resourceName.startsWith("/")) { + //certain classloaders need it without the leading / + try { + urls = cluClassloader.getResources(resourceName.substring(1)); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + + if (!urls.hasMoreElements()) { + ClassLoader cl = callingClass.getClassLoader(); + + if (cl != null) { + try { + urls = cl.getResources(resourceName); + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + // ignore + } + } + } + + if (!urls.hasMoreElements()) { + URL url = callingClass.getResource(resourceName); + if (url != null) { + ret.add(url); + } + } + while (urls.hasMoreElements()) { + ret.add(urls.nextElement()); + } + + + if (ret.isEmpty() && (resourceName != null) && (resourceName.charAt(0) != '/')) { + return getResources('/' + resourceName, callingClass); + } + return ret; + } + + + /** + * This is a convenience method to load a resource as a stream.

      The + * algorithm used to find the resource is given in getResource() + * + * @param resourceName The name of the resource to load + * @param callingClass The Class object of the calling object + */ + static InputStream getResourceAsStream(String resourceName, Class callingClass) { + URL url = getResource(resourceName, callingClass); + + try { + return (url != null) ? url.openStream() : null; + } catch (IOException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + return null; + } + } + + /** + * Load a class with a given name.

      It will try to load the class in the + * following order: + *

        + *
      • From Thread.currentThread().getContextClassLoader() + *
      • Using the basic Class.forName() + *
      • From ClassLoaderUtil.class.getClassLoader() + *
      • From the callingClass.getClassLoader() + *
      + * + * @param className The name of the class to load + * @param callingClass The Class object of the calling object + * @throws ClassNotFoundException If the class cannot be found anywhere. + */ + static Class loadClass(String className, Class callingClass) + throws ClassNotFoundException { + try { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + + if (cl != null) { + return cl.loadClass(className); + } + } catch (ClassNotFoundException e) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, e.getMessage(), e); + } + //ignore + } + return loadClass2(className, callingClass); + } + + private static Class loadClass2(String className, Class callingClass) + throws ClassNotFoundException { + try { + return Class.forName(className); + } catch (ClassNotFoundException ex) { + try { + if (ClassLoaderUtils.class.getClassLoader() != null) { + return ClassLoaderUtils.class.getClassLoader().loadClass(className); + } + } catch (ClassNotFoundException exc) { + if (callingClass != null && callingClass.getClassLoader() != null) { + return callingClass.getClassLoader().loadClass(className); + } + } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, ex.getMessage(), ex); + } + throw ex; + } + } +} diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java index 7e1a51913cd..3c910219bfd 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java @@ -2,29 +2,29 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.transforms; import java.io.IOException; import java.io.OutputStream; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; import java.util.Map; import javax.xml.parsers.ParserConfigurationException; @@ -33,6 +33,17 @@ import com.sun.org.apache.xml.internal.security.c14n.InvalidCanonicalizerExcepti import com.sun.org.apache.xml.internal.security.exceptions.AlgorithmAlreadyRegisteredException; import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformBase64Decode; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14N; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14N11; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14N11_WithComments; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NExclusive; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NExclusiveWithComments; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformC14NWithComments; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformEnvelopedSignature; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXPath; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXPath2Filter; +import com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.HelperNodeList; import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; @@ -54,112 +65,31 @@ import org.xml.sax.SAXException; * @author Christian Geuer-Pollmann * @see Transforms * @see TransformSpi - * */ public final class Transform extends SignatureElementProxy { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(Transform.class.getName()); - /** Field _alreadyInitialized */ - private static boolean alreadyInitialized = false; - /** All available Transform classes are registered here */ - private static Map> transformClassHash = null; + private static Map> transformSpiHash = + new ConcurrentHashMap>(); - private static Map transformSpiHash = new HashMap(); - - private TransformSpi transformSpi = null; - - /** - * Constructs {@link Transform} - * - * @param doc the {@link Document} in which Transform will be - * placed - * @param algorithmURI URI representation of - * Transform algorithm which will be specified as parameter of - * {@link #getInstance(Document, String)}, when generated.
      - * @param contextNodes the child node list of Transform element - * @throws InvalidTransformException - */ - public Transform(Document doc, String algorithmURI, NodeList contextNodes) - throws InvalidTransformException { - - super(doc); - - this._constructionElement.setAttributeNS - (null, Constants._ATT_ALGORITHM, algorithmURI); - - transformSpi = getTransformSpi(algorithmURI); - if (transformSpi == null) { - Object exArgs[] = { algorithmURI }; - throw new InvalidTransformException( - "signature.Transform.UnknownTransform", exArgs); - } - - if (log.isLoggable(java.util.logging.Level.FINE)) { - log.log(java.util.logging.Level.FINE, "Create URI \"" + algorithmURI + "\" class \"" - + transformSpi.getClass() + "\""); - log.log(java.util.logging.Level.FINE, "The NodeList is " + contextNodes); - } - - // give it to the current document - if (contextNodes != null) { - for (int i = 0; i < contextNodes.getLength(); i++) { - this._constructionElement.appendChild - (contextNodes.item(i).cloneNode(true)); - } - } - } - - /** - * This constructor can only be called from the {@link Transforms} object, - * so it's protected. - * - * @param element ds:Transform element - * @param BaseURI the URI of the resource where the XML instance was stored - * @throws InvalidTransformException - * @throws TransformationException - * @throws XMLSecurityException - */ - public Transform(Element element, String BaseURI) - throws InvalidTransformException, TransformationException, - XMLSecurityException { - - super(element, BaseURI); - - // retrieve Algorithm Attribute from ds:Transform - String algorithmURI = element.getAttributeNS(null, Constants._ATT_ALGORITHM); - - if (algorithmURI == null || algorithmURI.length() == 0) { - Object exArgs[] = { Constants._ATT_ALGORITHM, - Constants._TAG_TRANSFORM }; - throw new TransformationException("xml.WrongContent", exArgs); - } - - transformSpi = getTransformSpi(algorithmURI); - if (transformSpi == null) { - Object exArgs[] = { algorithmURI }; - throw new InvalidTransformException( - "signature.Transform.UnknownTransform", exArgs); - } - } + private final TransformSpi transformSpi; /** * Generates a Transform object that implements the specified * Transform algorithm URI. * + * @param doc the proxy {@link Document} * @param algorithmURI Transform algorithm URI representation, * such as specified in * Transform algorithm - * @param doc the proxy {@link Document} - * @return {@link Transform} object * @throws InvalidTransformException */ - public static Transform getInstance( - Document doc, String algorithmURI) throws InvalidTransformException { - return getInstance(doc, algorithmURI, (NodeList) null); + public Transform(Document doc, String algorithmURI) throws InvalidTransformException { + this(doc, algorithmURI, (NodeList)null); } /** @@ -171,82 +101,160 @@ public final class Transform extends SignatureElementProxy { * Transform algorithm * @param contextChild the child element of Transform element * @param doc the proxy {@link Document} - * @return {@link Transform} object * @throws InvalidTransformException */ - public static Transform getInstance( - Document doc, String algorithmURI, Element contextChild) + public Transform(Document doc, String algorithmURI, Element contextChild) throws InvalidTransformException { + super(doc); + HelperNodeList contextNodes = null; - HelperNodeList contextNodes = new HelperNodeList(); + if (contextChild != null) { + contextNodes = new HelperNodeList(); - XMLUtils.addReturnToElement(doc, contextNodes); - contextNodes.appendChild(contextChild); - XMLUtils.addReturnToElement(doc, contextNodes); + XMLUtils.addReturnToElement(doc, contextNodes); + contextNodes.appendChild(contextChild); + XMLUtils.addReturnToElement(doc, contextNodes); + } - return getInstance(doc, algorithmURI, contextNodes); + transformSpi = initializeTransform(algorithmURI, contextNodes); } /** - * Generates a Transform object that implements the specified - * Transform algorithm URI. + * Constructs {@link Transform} * - * @param algorithmURI Transform algorithm URI form, such as - * specified in - * Transform algorithm + * @param doc the {@link Document} in which Transform will be + * placed + * @param algorithmURI URI representation of Transform algorithm * @param contextNodes the child node list of Transform element - * @param doc the proxy {@link Document} - * @return {@link Transform} object * @throws InvalidTransformException */ - public static Transform getInstance( - Document doc, String algorithmURI, NodeList contextNodes) + public Transform(Document doc, String algorithmURI, NodeList contextNodes) throws InvalidTransformException { - return new Transform(doc, algorithmURI, contextNodes); + super(doc); + transformSpi = initializeTransform(algorithmURI, contextNodes); } /** - * Initalizes for this {@link Transform}. + * @param element ds:Transform element + * @param BaseURI the URI of the resource where the XML instance was stored + * @throws InvalidTransformException + * @throws TransformationException + * @throws XMLSecurityException */ - public static void init() { - if (!alreadyInitialized) { - transformClassHash = new HashMap>(10); - // make sure builtin algorithms are all registered first - com.sun.org.apache.xml.internal.security.Init.init(); - alreadyInitialized = true; + public Transform(Element element, String BaseURI) + throws InvalidTransformException, TransformationException, XMLSecurityException { + super(element, BaseURI); + + // retrieve Algorithm Attribute from ds:Transform + String algorithmURI = element.getAttributeNS(null, Constants._ATT_ALGORITHM); + + if (algorithmURI == null || algorithmURI.length() == 0) { + Object exArgs[] = { Constants._ATT_ALGORITHM, Constants._TAG_TRANSFORM }; + throw new TransformationException("xml.WrongContent", exArgs); + } + + Class transformSpiClass = transformSpiHash.get(algorithmURI); + if (transformSpiClass == null) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException("signature.Transform.UnknownTransform", exArgs); + } + try { + transformSpi = transformSpiClass.newInstance(); + } catch (InstantiationException ex) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException( + "signature.Transform.UnknownTransform", exArgs, ex + ); + } catch (IllegalAccessException ex) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException( + "signature.Transform.UnknownTransform", exArgs, ex + ); } } /** * Registers implementing class of the Transform algorithm with algorithmURI * - * @param algorithmURI algorithmURI URI representation of - * Transform algorithm will be specified as parameter of - * {@link #getInstance(Document, String)}, when generate.
      + * @param algorithmURI algorithmURI URI representation of Transform algorithm * @param implementingClass implementingClass the implementing * class of {@link TransformSpi} * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI * is already registered */ + @SuppressWarnings("unchecked") public static void register(String algorithmURI, String implementingClass) - throws AlgorithmAlreadyRegisteredException { - + throws AlgorithmAlreadyRegisteredException, ClassNotFoundException, + InvalidTransformException { // are we already registered? - Class registeredClass = getImplementingClass(algorithmURI); - if ((registeredClass != null) ) { - Object exArgs[] = { algorithmURI, registeredClass }; - throw new AlgorithmAlreadyRegisteredException( - "algorithm.alreadyRegistered", exArgs); + Class transformSpi = transformSpiHash.get(algorithmURI); + if (transformSpi != null) { + Object exArgs[] = { algorithmURI, transformSpi }; + throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs); } + Class transformSpiClass = + (Class) + ClassLoaderUtils.loadClass(implementingClass, Transform.class); + transformSpiHash.put(algorithmURI, transformSpiClass); + } - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - - try { - transformClassHash.put - (algorithmURI, Class.forName(implementingClass, true, cl)); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); + /** + * Registers implementing class of the Transform algorithm with algorithmURI + * + * @param algorithmURI algorithmURI URI representation of Transform algorithm + * @param implementingClass implementingClass the implementing + * class of {@link TransformSpi} + * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI + * is already registered + */ + public static void register(String algorithmURI, Class implementingClass) + throws AlgorithmAlreadyRegisteredException { + // are we already registered? + Class transformSpi = transformSpiHash.get(algorithmURI); + if (transformSpi != null) { + Object exArgs[] = { algorithmURI, transformSpi }; + throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs); } + transformSpiHash.put(algorithmURI, implementingClass); + } + + /** + * This method registers the default algorithms. + */ + public static void registerDefaultAlgorithms() { + transformSpiHash.put( + Transforms.TRANSFORM_BASE64_DECODE, TransformBase64Decode.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N_OMIT_COMMENTS, TransformC14N.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N_WITH_COMMENTS, TransformC14NWithComments.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N11_OMIT_COMMENTS, TransformC14N11.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N11_WITH_COMMENTS, TransformC14N11_WithComments.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS, TransformC14NExclusive.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_C14N_EXCL_WITH_COMMENTS, TransformC14NExclusiveWithComments.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_XPATH, TransformXPath.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_ENVELOPED_SIGNATURE, TransformEnvelopedSignature.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_XSLT, TransformXSLT.class + ); + transformSpiHash.put( + Transforms.TRANSFORM_XPATH2FILTER, TransformXPath2Filter.class + ); } /** @@ -255,8 +263,7 @@ public final class Transform extends SignatureElementProxy { * @return the URI representation of Transformation algorithm */ public String getURI() { - return this._constructionElement.getAttributeNS - (null, Constants._ATT_ALGORITHM); + return this._constructionElement.getAttributeNS(null, Constants._ATT_ALGORITHM); } /** @@ -272,30 +279,15 @@ public final class Transform extends SignatureElementProxy { * @throws TransformationException */ public XMLSignatureInput performTransform(XMLSignatureInput input) - throws IOException, CanonicalizationException, - InvalidCanonicalizerException, TransformationException { - - XMLSignatureInput result = null; - - try { - result = transformSpi.enginePerformTransform(input, this); - } catch (ParserConfigurationException ex) { - Object exArgs[] = { this.getURI(), "ParserConfigurationException" }; - throw new CanonicalizationException( - "signature.Transform.ErrorDuringTransform", exArgs, ex); - } catch (SAXException ex) { - Object exArgs[] = { this.getURI(), "SAXException" }; - throw new CanonicalizationException( - "signature.Transform.ErrorDuringTransform", exArgs, ex); - } - - return result; + throws IOException, CanonicalizationException, + InvalidCanonicalizerException, TransformationException { + return performTransform(input, null); } /** * Transforms the input, and generates {@link XMLSignatureInput} as output. * - * @param input input {@link XMLSignatureInput} which can supplied Octet + * @param input input {@link XMLSignatureInput} which can supplied Octect * Stream and NodeSet as Input of Transformation * @param os where to output the result of the last transformation * @return the {@link XMLSignatureInput} class as the result of @@ -305,10 +297,10 @@ public final class Transform extends SignatureElementProxy { * @throws InvalidCanonicalizerException * @throws TransformationException */ - public XMLSignatureInput performTransform(XMLSignatureInput input, - OutputStream os) throws IOException, CanonicalizationException, + public XMLSignatureInput performTransform( + XMLSignatureInput input, OutputStream os + ) throws IOException, CanonicalizationException, InvalidCanonicalizerException, TransformationException { - XMLSignatureInput result = null; try { @@ -326,44 +318,52 @@ public final class Transform extends SignatureElementProxy { return result; } - /** - * Method getImplementingClass - * - * @param URI - * @return The name of the class implementing the URI. - */ - @SuppressWarnings("unchecked") - private static Class getImplementingClass(String URI) { - return (Class)transformClassHash.get(URI); - } - - private static TransformSpi getTransformSpi(String URI) - throws InvalidTransformException { - try { - TransformSpi value = transformSpiHash.get(URI); - if (value != null) { - return value; - } - Class cl = getImplementingClass(URI); - if (cl != null) { - TransformSpi tr = cl.newInstance(); - transformSpiHash.put(URI, tr); - return tr; - } - } catch (InstantiationException ex) { - Object exArgs[] = { URI }; - throw new InvalidTransformException( - "signature.Transform.UnknownTransform", exArgs, ex); - } catch (IllegalAccessException ex) { - Object exArgs[] = { URI }; - throw new InvalidTransformException( - "signature.Transform.UnknownTransform", exArgs, ex); - } - return null; - } - /** @inheritDoc */ public String getBaseLocalName() { return Constants._TAG_TRANSFORM; } + + /** + * Initialize the transform object. + */ + private TransformSpi initializeTransform(String algorithmURI, NodeList contextNodes) + throws InvalidTransformException { + + this._constructionElement.setAttributeNS(null, Constants._ATT_ALGORITHM, algorithmURI); + + Class transformSpiClass = transformSpiHash.get(algorithmURI); + if (transformSpiClass == null) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException("signature.Transform.UnknownTransform", exArgs); + } + TransformSpi newTransformSpi = null; + try { + newTransformSpi = transformSpiClass.newInstance(); + } catch (InstantiationException ex) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException( + "signature.Transform.UnknownTransform", exArgs, ex + ); + } catch (IllegalAccessException ex) { + Object exArgs[] = { algorithmURI }; + throw new InvalidTransformException( + "signature.Transform.UnknownTransform", exArgs, ex + ); + } + + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Create URI \"" + algorithmURI + "\" class \"" + + newTransformSpi.getClass() + "\""); + log.log(java.util.logging.Level.FINE, "The NodeList is " + contextNodes); + } + + // give it to the current document + if (contextNodes != null) { + for (int i = 0; i < contextNodes.getLength(); i++) { + this._constructionElement.appendChild(contextNodes.item(i).cloneNode(true)); + } + } + return newTransformSpi; + } + } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java index 3958159ff9f..ce44e1713e4 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transforms.java @@ -158,8 +158,7 @@ public class Transforms extends SignatureElementProxy { if (log.isLoggable(java.util.logging.Level.FINE)) log.log(java.util.logging.Level.FINE, "Transforms.addTransform(" + transformURI + ")"); - Transform transform = - Transform.getInstance(this._doc, transformURI); + Transform transform = new Transform(this._doc, transformURI); this.addTransform(transform); } catch (InvalidTransformException ex) { @@ -184,8 +183,7 @@ public class Transforms extends SignatureElementProxy { if (log.isLoggable(java.util.logging.Level.FINE)) log.log(java.util.logging.Level.FINE, "Transforms.addTransform(" + transformURI + ")"); - Transform transform = - Transform.getInstance(this._doc, transformURI, contextElement); + Transform transform = new Transform(this._doc, transformURI, contextElement); this.addTransform(transform); } catch (InvalidTransformException ex) { @@ -207,8 +205,7 @@ public class Transforms extends SignatureElementProxy { throws TransformationException { try { - Transform transform = - Transform.getInstance(this._doc, transformURI, contextNodes); + Transform transform = new Transform(this._doc, transformURI, contextNodes); this.addTransform(transform); } catch (InvalidTransformException ex) { throw new TransformationException("empty", ex); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java index 50deb1e21dd..b1d3de8bce7 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.java @@ -26,6 +26,7 @@ import java.io.BufferedInputStream; import java.io.IOException; import java.io.OutputStream; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -145,11 +146,13 @@ public class TransformBase64Decode extends TransformSpi { } try { - //Exceptional case there is current not text case testing this(Before it was a - //a common case). + // Exceptional case there is current not text case testing this + // (before it was a a common case). + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + Boolean.TRUE); Document doc = - DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( - input.getOctetStream()); + dbf.newDocumentBuilder().parse(input.getOctetStream()); Element rootNode = doc.getDocumentElement(); StringBuffer sb = new StringBuffer(); @@ -157,13 +160,13 @@ public class TransformBase64Decode extends TransformSpi { byte[] decodedBytes = Base64.decode(sb.toString()); return new XMLSignatureInput(decodedBytes); - } catch (ParserConfigurationException e) { - throw new TransformationException("c14n.Canonicalizer.Exception",e); - } catch (SAXException e) { - throw new TransformationException("SAX exception", e); - } + } catch (ParserConfigurationException e) { + throw new TransformationException("c14n.Canonicalizer.Exception",e); + } catch (SAXException e) { + throw new TransformationException("SAX exception", e); + } } catch (Base64DecodingException e) { - throw new TransformationException("Base64Decoding", e); + throw new TransformationException("Base64Decoding", e); } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java index 8ff4b9f00d9..12c8f636ca4 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXSLT.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Method; +import javax.xml.XMLConstants; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -109,7 +110,8 @@ public class TransformXSLT extends TransformSpi { TransformerFactory tFactory = TransformerFactory.newInstance(); // Process XSLT stylesheets in a secure manner - tFactory.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", Boolean.TRUE); + tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + Boolean.TRUE); /* * This transform requires an octet stream as input. If the actual * input is an XPath node-set, then the signature application should diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java index f44c76cef7e..2d2fdeb61bb 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java @@ -2,28 +2,28 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2008 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.utils; - - import java.math.BigInteger; -import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; import java.util.Map; import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; @@ -35,466 +35,432 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Text; - /** * This is the base class to all Objects which have a direct 1:1 mapping to an * Element in a particular namespace. - * - * @author $Author: mullan $ */ public abstract class ElementProxy { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + protected static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(ElementProxy.class.getName()); - /** - * Returns the namespace of the Elements of the sub-class. - * - * @return the namespace of the Elements of the sub-class. - */ - public abstract String getBaseNamespace(); + /** Field constructionElement */ + protected Element _constructionElement = null; - /** - * Returns the localname of the Elements of the sub-class. - * - * @return the localname of the Elements of the sub-class. - */ - public abstract String getBaseLocalName(); + /** Field baseURI */ + protected String _baseURI = null; - /** Field _constructionElement */ - protected Element _constructionElement = null; + /** Field doc */ + protected Document _doc = null; - /** Field _baseURI */ - protected String _baseURI = null; + /** Field prefixMappings */ + private static Map prefixMappings = new ConcurrentHashMap(); - /** Field _doc */ - protected Document _doc = null; + /** + * Constructor ElementProxy + * + */ + public ElementProxy() { + } - /** - * Constructor ElementProxy - * - */ - public ElementProxy() { - } + /** + * Constructor ElementProxy + * + * @param doc + */ + public ElementProxy(Document doc) { + if (doc == null) { + throw new RuntimeException("Document is null"); + } - /** - * Constructor ElementProxy - * - * @param doc - */ - public ElementProxy(Document doc) { - if (doc == null) { - throw new RuntimeException("Document is null"); - } + this._doc = doc; + this._constructionElement = + createElementForFamilyLocal(this._doc, this.getBaseNamespace(), this.getBaseLocalName()); + } - this._doc = doc; - this._constructionElement = createElementForFamilyLocal(this._doc, - this.getBaseNamespace(), this.getBaseLocalName()); - } - protected Element createElementForFamilyLocal(Document doc, String namespace, - String localName) { - Element result = null; - if (namespace == null) { - result = doc.createElementNS(null, localName); - } else { - String baseName=this.getBaseNamespace(); - String prefix=ElementProxy.getDefaultPrefix(baseName); - if ((prefix == null) || (prefix.length() == 0)) { - result = doc.createElementNS(namespace, localName); + /** + * Constructor ElementProxy + * + * @param element + * @param BaseURI + * @throws XMLSecurityException + */ + public ElementProxy(Element element, String BaseURI) throws XMLSecurityException { + if (element == null) { + throw new XMLSecurityException("ElementProxy.nullElement"); + } - result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns", - namespace); - } else { - String tagName=null; - String defaultPrefixNaming=ElementProxy.getDefaultPrefixBindings(baseName); - StringBuffer sb=new StringBuffer(prefix); - sb.append(':'); - sb.append(localName); - tagName=sb.toString(); - result = doc.createElementNS(namespace, tagName ); + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "setElement(\"" + element.getTagName() + "\", \"" + BaseURI + "\")"); + } - result.setAttributeNS(Constants.NamespaceSpecNS, defaultPrefixNaming, - namespace); - } - } - return result; -} + this._doc = element.getOwnerDocument(); + this._constructionElement = element; + this._baseURI = BaseURI; + + this.guaranteeThatElementInCorrectSpace(); + } + + /** + * Returns the namespace of the Elements of the sub-class. + * + * @return the namespace of the Elements of the sub-class. + */ + public abstract String getBaseNamespace(); + + /** + * Returns the localname of the Elements of the sub-class. + * + * @return the localname of the Elements of the sub-class. + */ + public abstract String getBaseLocalName(); - /** - * This method creates an Element in a given namespace with a given localname. - * It uses the {@link ElementProxy#getDefaultPrefix} method to decide whether - * a particular prefix is bound to that namespace. - *
      - * This method was refactored out of the constructor. - * - * @param doc - * @param namespace - * @param localName - * @return The element created. - */ - public static Element createElementForFamily(Document doc, String namespace, - String localName) { - //Element nscontext = XMLUtils.createDSctx(doc, "x", namespace); - Element result = null; - String prefix = ElementProxy.getDefaultPrefix(namespace); - - if (namespace == null) { - result = doc.createElementNS(null, localName); - } else { - if ((prefix == null) || (prefix.length() == 0)) { - result = doc.createElementNS(namespace, localName); - - result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns", - namespace); - } else { - result = doc.createElementNS(namespace, prefix + ":" + localName); - - result.setAttributeNS(Constants.NamespaceSpecNS, ElementProxy.getDefaultPrefixBindings(namespace), - namespace); - } - } - - return result; - } - - /** - * Method setElement - * - * @param element - * @param BaseURI - * @throws XMLSecurityException - */ - public void setElement(Element element, String BaseURI) - throws XMLSecurityException { - - if (element == null) { - throw new XMLSecurityException("ElementProxy.nullElement"); - } - - if (log.isLoggable(java.util.logging.Level.FINE)) { - log.log(java.util.logging.Level.FINE, "setElement(" + element.getTagName() + ", \"" + BaseURI + "\""); - } - - this._doc = element.getOwnerDocument(); - this._constructionElement = element; - this._baseURI = BaseURI; - } - - /** - * Constructor ElementProxy - * - * @param element - * @param BaseURI - * @throws XMLSecurityException - */ - public ElementProxy(Element element, String BaseURI) - throws XMLSecurityException { - if (element == null) { - throw new XMLSecurityException("ElementProxy.nullElement"); - } - - if (log.isLoggable(java.util.logging.Level.FINE)) { - log.log(java.util.logging.Level.FINE, "setElement(\"" + element.getTagName() + "\", \"" + BaseURI - + "\")"); - } - - this._doc = element.getOwnerDocument(); - this._constructionElement = element; - this._baseURI = BaseURI; - - this.guaranteeThatElementInCorrectSpace(); - } - - /** - * Returns the Element which was constructed by the Object. - * - * @return the Element which was constructed by the Object. - */ - public final Element getElement() { - return this._constructionElement; - } - - /** - * Returns the Element plus a leading and a trailing CarriageReturn Text node. - * - * @return the Element which was constructed by the Object. - */ - public final NodeList getElementPlusReturns() { - - HelperNodeList nl = new HelperNodeList(); - - nl.appendChild(this._doc.createTextNode("\n")); - nl.appendChild(this.getElement()); - nl.appendChild(this._doc.createTextNode("\n")); - - return nl; - } - - /** - * Method getDocument - * - * @return the Document where this element is contained. - */ - public Document getDocument() { - return this._doc; - } - - /** - * Method getBaseURI - * - * @return the base uri of the namespace of this element - */ - public String getBaseURI() { - return this._baseURI; - } - - static ElementChecker checker = new ElementCheckerImpl.InternedNsChecker(); - - /** - * Method guaranteeThatElementInCorrectSpace - * - * @throws XMLSecurityException - */ - void guaranteeThatElementInCorrectSpace() - throws XMLSecurityException { - - checker.guaranteeThatElementInCorrectSpace(this,this._constructionElement); - - } - - /** - * Method setVal - * - * @param bi - * @param localname - */ - public void addBigIntegerElement(BigInteger bi, String localname) { - - if (bi != null) { - Element e = XMLUtils.createElementInSignatureSpace(this._doc, - localname); - - Base64.fillElementWithBigInteger(e, bi); - this._constructionElement.appendChild(e); - XMLUtils.addReturnToElement(this._constructionElement); - } - } - - /** - * Method addBase64Element - * - * @param bytes - * @param localname - */ - public void addBase64Element(byte[] bytes, String localname) { - - if (bytes != null) { - - Element e = Base64.encodeToElement(this._doc, localname, bytes); - - this._constructionElement.appendChild(e); - if (!XMLUtils.ignoreLineBreaks()) { - this._constructionElement.appendChild(this._doc.createTextNode("\n")); - } - } - } - - /** - * Method addTextElement - * - * @param text - * @param localname - */ - public void addTextElement(String text, String localname) { - - Element e = XMLUtils.createElementInSignatureSpace(this._doc, localname); - Text t = this._doc.createTextNode(text); - - e.appendChild(t); - this._constructionElement.appendChild(e); - XMLUtils.addReturnToElement(this._constructionElement); - } - - /** - * Method addBase64Text - * - * @param bytes - */ - public void addBase64Text(byte[] bytes) { - - if (bytes != null) { - Text t = XMLUtils.ignoreLineBreaks() - ? this._doc.createTextNode(Base64.encode(bytes)) - : this._doc.createTextNode("\n" + Base64.encode(bytes) + "\n"); - this._constructionElement.appendChild(t); - } - } - - /** - * Method addText - * - * @param text - */ - public void addText(String text) { - - if (text != null) { - Text t = this._doc.createTextNode(text); - - this._constructionElement.appendChild(t); - } - } - - /** - * Method getVal - * - * @param localname - * @param namespace - * @return The biginter contained in the given element - * @throws Base64DecodingException - */ - public BigInteger getBigIntegerFromChildElement( - String localname, String namespace) throws Base64DecodingException { - - return Base64.decodeBigIntegerFromText( - XMLUtils.selectNodeText(this._constructionElement.getFirstChild(), - namespace,localname,0)); - - } - - /** - * Method getBytesFromChildElement - * @deprecated - * @param localname - * @param namespace - * @return the bytes - * @throws XMLSecurityException - */ - @Deprecated - public byte[] getBytesFromChildElement(String localname, String namespace) - throws XMLSecurityException { - - Element e = - XMLUtils.selectNode( - this._constructionElement.getFirstChild(), - namespace, - localname, - 0); - - return Base64.decode(e); - } - - /** - * Method getTextFromChildElement - * - * @param localname - * @param namespace - * @return the Text of the textNode - */ - public String getTextFromChildElement(String localname, String namespace) { - - return XMLUtils.selectNode( - this._constructionElement.getFirstChild(), - namespace, - localname, - 0).getFirstChild().getNodeValue(); - - } - - /** - * Method getBytesFromTextChild - * - * @return The base64 bytes from the text children of this element - * @throws XMLSecurityException - */ - public byte[] getBytesFromTextChild() throws XMLSecurityException { - return Base64.decode - (XMLUtils.getFullTextChildrenFromElement(this._constructionElement)); - } - - /** - * Method getTextFromTextChild - * - * @return the Text obtained by concatenating all the text nodes of this - * element - */ - public String getTextFromTextChild() { - return XMLUtils.getFullTextChildrenFromElement(this._constructionElement); - } - - /** - * Method length - * - * @param namespace - * @param localname - * @return the number of elements {namespace}:localname under this element - */ - public int length(String namespace, String localname) { - int number=0; - Node sibling=this._constructionElement.getFirstChild(); - while (sibling!=null) { - if (localname.equals(sibling.getLocalName()) - && - namespace==sibling.getNamespaceURI() ) { - number++; - } - sibling=sibling.getNextSibling(); + protected Element createElementForFamilyLocal( + Document doc, String namespace, String localName + ) { + Element result = null; + if (namespace == null) { + result = doc.createElementNS(null, localName); + } else { + String baseName = this.getBaseNamespace(); + String prefix = ElementProxy.getDefaultPrefix(baseName); + if ((prefix == null) || (prefix.length() == 0)) { + result = doc.createElementNS(namespace, localName); + result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns", namespace); + } else { + result = doc.createElementNS(namespace, prefix + ":" + localName); + result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:" + prefix, namespace); } - return number; - } - - /** - * Adds an xmlns: definition to the Element. This can be called as follows: - * - *
      -    * // set namespace with ds prefix
      -    * xpathContainer.setXPathNamespaceContext("ds", "http://www.w3.org/2000/09/xmldsig#");
      -    * xpathContainer.setXPathNamespaceContext("xmlns:ds", "http://www.w3.org/2000/09/xmldsig#");
      -    * 
      - * - * @param prefix - * @param uri - * @throws XMLSecurityException - */ - public void setXPathNamespaceContext(String prefix, String uri) - throws XMLSecurityException { - - String ns; - - if ((prefix == null) || (prefix.length() == 0)) { - throw new XMLSecurityException("defaultNamespaceCannotBeSetHere"); - } else if (prefix.equals("xmlns")) { - throw new XMLSecurityException("defaultNamespaceCannotBeSetHere"); - } else if (prefix.startsWith("xmlns:")) { - ns = prefix;//"xmlns:" + prefix.substring("xmlns:".length()); - } else { - ns = "xmlns:" + prefix; - } + } + return result; + } + /** + * This method creates an Element in a given namespace with a given localname. + * It uses the {@link ElementProxy#getDefaultPrefix} method to decide whether + * a particular prefix is bound to that namespace. + *
      + * This method was refactored out of the constructor. + * + * @param doc + * @param namespace + * @param localName + * @return The element created. + */ + public static Element createElementForFamily(Document doc, String namespace, String localName) { + Element result = null; + String prefix = ElementProxy.getDefaultPrefix(namespace); - Attr a = this._constructionElement.getAttributeNodeNS(Constants.NamespaceSpecNS, ns); + if (namespace == null) { + result = doc.createElementNS(null, localName); + } else { + if ((prefix == null) || (prefix.length() == 0)) { + result = doc.createElementNS(namespace, localName); + result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns", namespace); + } else { + result = doc.createElementNS(namespace, prefix + ":" + localName); + result.setAttributeNS(Constants.NamespaceSpecNS, "xmlns:" + prefix, namespace); + } + } - if (a != null) { - if (!a.getNodeValue().equals(uri)) { - Object exArgs[] = { ns, - this._constructionElement.getAttributeNS(null, - ns) }; + return result; + } - throw new XMLSecurityException("namespacePrefixAlreadyUsedByOtherURI", - exArgs); - } - return; - } + /** + * Method setElement + * + * @param element + * @param BaseURI + * @throws XMLSecurityException + */ + public void setElement(Element element, String BaseURI) throws XMLSecurityException { + if (element == null) { + throw new XMLSecurityException("ElementProxy.nullElement"); + } - this._constructionElement.setAttributeNS(Constants.NamespaceSpecNS, ns, - uri); - } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "setElement(" + element.getTagName() + ", \"" + BaseURI + "\""); + } - /** Field _prefixMappings */ - static Map _prefixMappings = new HashMap(); - static Map _prefixMappingsBindings = new HashMap(); + this._doc = element.getOwnerDocument(); + this._constructionElement = element; + this._baseURI = BaseURI; + } + + + /** + * Returns the Element which was constructed by the Object. + * + * @return the Element which was constructed by the Object. + */ + public final Element getElement() { + return this._constructionElement; + } + + /** + * Returns the Element plus a leading and a trailing CarriageReturn Text node. + * + * @return the Element which was constructed by the Object. + */ + public final NodeList getElementPlusReturns() { + + HelperNodeList nl = new HelperNodeList(); + + nl.appendChild(this._doc.createTextNode("\n")); + nl.appendChild(this.getElement()); + nl.appendChild(this._doc.createTextNode("\n")); + + return nl; + } + + /** + * Method getDocument + * + * @return the Document where this element is contained. + */ + public Document getDocument() { + return this._doc; + } + + /** + * Method getBaseURI + * + * @return the base uri of the namespace of this element + */ + public String getBaseURI() { + return this._baseURI; + } + + /** + * Method guaranteeThatElementInCorrectSpace + * + * @throws XMLSecurityException + */ + void guaranteeThatElementInCorrectSpace() throws XMLSecurityException { + + String expectedLocalName = this.getBaseLocalName(); + String expectedNamespaceUri = this.getBaseNamespace(); + + String actualLocalName = this._constructionElement.getLocalName(); + String actualNamespaceUri = this._constructionElement.getNamespaceURI(); + + if(!expectedNamespaceUri.equals(actualNamespaceUri) + && !expectedLocalName.equals(actualLocalName)) { + Object exArgs[] = { actualNamespaceUri + ":" + actualLocalName, + expectedNamespaceUri + ":" + expectedLocalName}; + throw new XMLSecurityException("xml.WrongElement", exArgs); + } + } + + /** + * Method addBigIntegerElement + * + * @param bi + * @param localname + */ + public void addBigIntegerElement(BigInteger bi, String localname) { + if (bi != null) { + Element e = XMLUtils.createElementInSignatureSpace(this._doc, localname); + + Base64.fillElementWithBigInteger(e, bi); + this._constructionElement.appendChild(e); + XMLUtils.addReturnToElement(this._constructionElement); + } + } + + /** + * Method addBase64Element + * + * @param bytes + * @param localname + */ + public void addBase64Element(byte[] bytes, String localname) { + if (bytes != null) { + Element e = Base64.encodeToElement(this._doc, localname, bytes); + + this._constructionElement.appendChild(e); + if (!XMLUtils.ignoreLineBreaks()) { + this._constructionElement.appendChild(this._doc.createTextNode("\n")); + } + } + } + + /** + * Method addTextElement + * + * @param text + * @param localname + */ + public void addTextElement(String text, String localname) { + Element e = XMLUtils.createElementInSignatureSpace(this._doc, localname); + Text t = this._doc.createTextNode(text); + + e.appendChild(t); + this._constructionElement.appendChild(e); + XMLUtils.addReturnToElement(this._constructionElement); + } + + /** + * Method addBase64Text + * + * @param bytes + */ + public void addBase64Text(byte[] bytes) { + if (bytes != null) { + Text t = XMLUtils.ignoreLineBreaks() + ? this._doc.createTextNode(Base64.encode(bytes)) + : this._doc.createTextNode("\n" + Base64.encode(bytes) + "\n"); + this._constructionElement.appendChild(t); + } + } + + /** + * Method addText + * + * @param text + */ + public void addText(String text) { + if (text != null) { + Text t = this._doc.createTextNode(text); + + this._constructionElement.appendChild(t); + } + } + + /** + * Method getVal + * + * @param localname + * @param namespace + * @return The biginteger contained in the given element + * @throws Base64DecodingException + */ + public BigInteger getBigIntegerFromChildElement( + String localname, String namespace + ) throws Base64DecodingException { + return Base64.decodeBigIntegerFromText( + XMLUtils.selectNodeText( + this._constructionElement.getFirstChild(), namespace, localname, 0 + ) + ); + } + + /** + * Method getBytesFromChildElement + * @deprecated + * @param localname + * @param namespace + * @return the bytes + * @throws XMLSecurityException + */ + @Deprecated + public byte[] getBytesFromChildElement(String localname, String namespace) + throws XMLSecurityException { + Element e = + XMLUtils.selectNode( + this._constructionElement.getFirstChild(), namespace, localname, 0 + ); + + return Base64.decode(e); + } + + /** + * Method getTextFromChildElement + * + * @param localname + * @param namespace + * @return the Text of the textNode + */ + public String getTextFromChildElement(String localname, String namespace) { + return XMLUtils.selectNode( + this._constructionElement.getFirstChild(), + namespace, + localname, + 0).getTextContent(); + } + + /** + * Method getBytesFromTextChild + * + * @return The base64 bytes from the text children of this element + * @throws XMLSecurityException + */ + public byte[] getBytesFromTextChild() throws XMLSecurityException { + return Base64.decode(XMLUtils.getFullTextChildrenFromElement(this._constructionElement)); + } + + /** + * Method getTextFromTextChild + * + * @return the Text obtained by concatenating all the text nodes of this + * element + */ + public String getTextFromTextChild() { + return XMLUtils.getFullTextChildrenFromElement(this._constructionElement); + } + + /** + * Method length + * + * @param namespace + * @param localname + * @return the number of elements {namespace}:localname under this element + */ + public int length(String namespace, String localname) { + int number = 0; + Node sibling = this._constructionElement.getFirstChild(); + while (sibling != null) { + if (localname.equals(sibling.getLocalName()) + && namespace.equals(sibling.getNamespaceURI())) { + number++; + } + sibling = sibling.getNextSibling(); + } + return number; + } + + /** + * Adds an xmlns: definition to the Element. This can be called as follows: + * + *
      +     * // set namespace with ds prefix
      +     * xpathContainer.setXPathNamespaceContext("ds", "http://www.w3.org/2000/09/xmldsig#");
      +     * xpathContainer.setXPathNamespaceContext("xmlns:ds", "http://www.w3.org/2000/09/xmldsig#");
      +     * 
      + * + * @param prefix + * @param uri + * @throws XMLSecurityException + */ + public void setXPathNamespaceContext(String prefix, String uri) + throws XMLSecurityException { + String ns; + + if ((prefix == null) || (prefix.length() == 0)) { + throw new XMLSecurityException("defaultNamespaceCannotBeSetHere"); + } else if (prefix.equals("xmlns")) { + throw new XMLSecurityException("defaultNamespaceCannotBeSetHere"); + } else if (prefix.startsWith("xmlns:")) { + ns = prefix;//"xmlns:" + prefix.substring("xmlns:".length()); + } else { + ns = "xmlns:" + prefix; + } + + Attr a = this._constructionElement.getAttributeNodeNS(Constants.NamespaceSpecNS, ns); + + if (a != null) { + if (!a.getNodeValue().equals(uri)) { + Object exArgs[] = { ns, this._constructionElement.getAttributeNS(null, ns) }; + + throw new XMLSecurityException("namespacePrefixAlreadyUsedByOtherURI", exArgs); + } + return; + } + + this._constructionElement.setAttributeNS(Constants.NamespaceSpecNS, ns, uri); + } /** * Method setDefaultPrefix @@ -505,26 +471,39 @@ public abstract class ElementProxy { */ public static void setDefaultPrefix(String namespace, String prefix) throws XMLSecurityException { - - if (ElementProxy._prefixMappings.containsValue(prefix)) { - - Object storedNamespace=ElementProxy._prefixMappings.get(namespace); - if (!storedNamespace.equals(prefix)) { - Object exArgs[] = { prefix, namespace, storedNamespace }; + if (prefixMappings.containsValue(prefix)) { + String storedPrefix = prefixMappings.get(namespace); + if (!storedPrefix.equals(prefix)) { + Object exArgs[] = { prefix, namespace, storedPrefix }; throw new XMLSecurityException("prefix.AlreadyAssigned", exArgs); } } + if (Constants.SignatureSpecNS.equals(namespace)) { - XMLUtils.dsPrefix=prefix; + XMLUtils.setDsPrefix(prefix); } - ElementProxy._prefixMappings.put(namespace, prefix.intern()); - if (prefix.length() == 0) { - ElementProxy._prefixMappingsBindings.put(namespace, "xmlns"); - } else { - ElementProxy._prefixMappingsBindings.put(namespace, ("xmlns:"+prefix).intern()); + if (EncryptionConstants.EncryptionSpecNS.equals(namespace)) { + XMLUtils.setXencPrefix(prefix); } - } + prefixMappings.put(namespace, prefix); + } + + /** + * This method registers the default prefixes. + */ + public static void registerDefaultPrefixes() throws XMLSecurityException { + setDefaultPrefix("http://www.w3.org/2000/09/xmldsig#", "ds"); + setDefaultPrefix("http://www.w3.org/2001/04/xmlenc#", "xenc"); + setDefaultPrefix("http://www.w3.org/2009/xmlenc11#", "xenc11"); + setDefaultPrefix("http://www.xmlsecurity.org/experimental#", "experimental"); + setDefaultPrefix("http://www.w3.org/2002/04/xmldsig-filter2", "dsig-xpath-old"); + setDefaultPrefix("http://www.w3.org/2002/06/xmldsig-filter2", "dsig-xpath"); + setDefaultPrefix("http://www.w3.org/2001/10/xml-exc-c14n#", "ec"); + setDefaultPrefix( + "http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter", "xx" + ); + } /** * Method getDefaultPrefix @@ -533,10 +512,19 @@ public abstract class ElementProxy { * @return the default prefix bind to this element. */ public static String getDefaultPrefix(String namespace) { - return ElementProxy._prefixMappings.get(namespace); + return prefixMappings.get(namespace); } - public static String getDefaultPrefixBindings(String namespace) { - return ElementProxy._prefixMappingsBindings.get(namespace); + protected void setLocalIdAttribute(String attrName, String value) { + + if (value != null) { + Attr attr = getDocument().createAttributeNS(null, attrName); + attr.setValue(value); + getElement().setAttributeNodeNS(attr); + getElement().setIdAttributeNode(attr, true); + } + else { + getElement().removeAttributeNS(null, attrName); + } } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java index 17346fc004e..9a20183e5be 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java @@ -2,21 +2,23 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.utils; @@ -31,202 +33,136 @@ import java.util.ResourceBundle; */ public class I18n { - /** Field NOT_INITIALIZED_MSG */ - public static final String NOT_INITIALIZED_MSG = - "You must initialize the xml-security library correctly before you use it. " - + "Call the static method \"com.sun.org.apache.xml.internal.security.Init.init();\" to do that " - + "before you use any functionality from that library."; + /** Field NOT_INITIALIZED_MSG */ + public static final String NOT_INITIALIZED_MSG = + "You must initialize the xml-security library correctly before you use it. " + + "Call the static method \"com.sun.org.apache.xml.internal.security.Init.init();\" to do that " + + "before you use any functionality from that library."; - /** Field defaultLanguageCode */ - private static String defaultLanguageCode; // will be set in static{} block + /** Field resourceBundle */ + private static ResourceBundle resourceBundle; - /** Field defaultCountryCode */ - private static String defaultCountryCode; // will be set in static{} block + /** Field alreadyInitialized */ + private static boolean alreadyInitialized = false; - /** Field resourceBundle */ - private static ResourceBundle resourceBundle = - ResourceBundle.getBundle - (Constants.exceptionMessagesResourceBundleBase, Locale.US); + /** + * Constructor I18n + * + */ + private I18n() { + // we don't allow instantiation + } - /** Field alreadyInitialized */ - private static boolean alreadyInitialized = false; + /** + * Method translate + * + * translates a message ID into an internationalized String, see alse + * XMLSecurityException.getExceptionMEssage(). The strings are + * stored in the ResourceBundle, which is identified in + * exceptionMessagesResourceBundleBase + * + * @param message + * @param args is an Object[] array of strings which are inserted into + * the String which is retrieved from the ResouceBundle + * @return message translated + */ + public static String translate(String message, Object[] args) { + return getExceptionMessage(message, args); + } - /** Field _languageCode */ - private static String _languageCode = null; + /** + * Method translate + * + * translates a message ID into an internationalized String, see also + * XMLSecurityException.getExceptionMessage() + * + * @param message + * @return message translated + */ + public static String translate(String message) { + return getExceptionMessage(message); + } - /** Field _countryCode */ - private static String _countryCode = null; + /** + * Method getExceptionMessage + * + * @param msgID + * @return message translated + * + */ + public static String getExceptionMessage(String msgID) { + try { + return resourceBundle.getString(msgID); + } catch (Throwable t) { + if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { + return "No message with ID \"" + msgID + + "\" found in resource bundle \"" + + Constants.exceptionMessagesResourceBundleBase + "\""; + } + return I18n.NOT_INITIALIZED_MSG; + } + } - /** - * Constructor I18n - * - */ - private I18n() { + /** + * Method getExceptionMessage + * + * @param msgID + * @param originalException + * @return message translated + */ + public static String getExceptionMessage(String msgID, Exception originalException) { + try { + Object exArgs[] = { originalException.getMessage() }; + return MessageFormat.format(resourceBundle.getString(msgID), exArgs); + } catch (Throwable t) { + if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { + return "No message with ID \"" + msgID + + "\" found in resource bundle \"" + + Constants.exceptionMessagesResourceBundleBase + + "\". Original Exception was a " + + originalException.getClass().getName() + " and message " + + originalException.getMessage(); + } + return I18n.NOT_INITIALIZED_MSG; + } + } - // we don't allow instantiation - } + /** + * Method getExceptionMessage + * + * @param msgID + * @param exArgs + * @return message translated + */ + public static String getExceptionMessage(String msgID, Object exArgs[]) { + try { + return MessageFormat.format(resourceBundle.getString(msgID), exArgs); + } catch (Throwable t) { + if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { + return "No message with ID \"" + msgID + + "\" found in resource bundle \"" + + Constants.exceptionMessagesResourceBundleBase + "\""; + } + return I18n.NOT_INITIALIZED_MSG; + } + } - /** - * Method translate - * - * translates a message ID into an internationalized String, see alse - * XMLSecurityException.getExceptionMEssage(). The strings are - * stored in the ResourceBundle, which is identified in - * exceptionMessagesResourceBundleBase - * - * @param message - * @param args is an Object[] array of strings which are inserted into the String which is retrieved from the ResouceBundle - * @return message translated - */ - public static String translate(String message, Object[] args) { - return getExceptionMessage(message, args); - } + /** + * Method init + * + * @param languageCode + * @param countryCode + */ + public synchronized static void init(String languageCode, String countryCode) { + if (alreadyInitialized) { + return; + } - /** - * Method translate - * - * translates a message ID into an internationalized String, see alse - * XMLSecurityException.getExceptionMEssage() - * - * @param message - * @return message translated - */ - public static String translate(String message) { - return getExceptionMessage(message); - } - - /** - * Method getExceptionMessage - * - * @param msgID - * @return message translated - * - */ - public static String getExceptionMessage(String msgID) { - - try { - String s = resourceBundle.getString(msgID); - - return s; - } catch (Throwable t) { - if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { - return "No message with ID \"" + msgID - + "\" found in resource bundle \"" - + Constants.exceptionMessagesResourceBundleBase + "\""; - } - return I18n.NOT_INITIALIZED_MSG; - } - } - - /** - * Method getExceptionMessage - * - * @param msgID - * @param originalException - * @return message translated - */ - public static String getExceptionMessage(String msgID, - Exception originalException) { - - try { - Object exArgs[] = { originalException.getMessage() }; - String s = MessageFormat.format(resourceBundle.getString(msgID), - exArgs); - - return s; - } catch (Throwable t) { - if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { - return "No message with ID \"" + msgID - + "\" found in resource bundle \"" - + Constants.exceptionMessagesResourceBundleBase - + "\". Original Exception was a " - + originalException.getClass().getName() + " and message " - + originalException.getMessage(); - } - return I18n.NOT_INITIALIZED_MSG; - } - } - - /** - * Method getExceptionMessage - * - * @param msgID - * @param exArgs - * @return message translated - */ - public static String getExceptionMessage(String msgID, Object exArgs[]) { - - try { - String s = MessageFormat.format(resourceBundle.getString(msgID), - exArgs); - - return s; - } catch (Throwable t) { - if (com.sun.org.apache.xml.internal.security.Init.isInitialized()) { - return "No message with ID \"" + msgID - + "\" found in resource bundle \"" - + Constants.exceptionMessagesResourceBundleBase + "\""; - } - return I18n.NOT_INITIALIZED_MSG; - } - } - -// -// Commented out because it modifies shared static -// state which could be maliciously called by untrusted code -// -// /** -// * Method init -// * -// * @param _defaultLanguageCode -// * @param _defaultCountryCode -// */ -// public static void init(String _defaultLanguageCode, -// String _defaultCountryCode) { -// -// I18n.defaultLanguageCode = _defaultLanguageCode; -// -// if (I18n.defaultLanguageCode == null) { -// I18n.defaultLanguageCode = Locale.getDefault().getLanguage(); -// } -// -// I18n.defaultCountryCode = _defaultCountryCode; -// -// if (I18n.defaultCountryCode == null) { -// I18n.defaultCountryCode = Locale.getDefault().getCountry(); -// } -// -// initLocale(I18n.defaultLanguageCode, I18n.defaultCountryCode); -// } - -// -// Commented out because it modifies shared static -// state which could be maliciously called by untrusted code -// -// /** -// * Method initLocale -// * -// * @param languageCode -// * @param countryCode -// */ -// public static void initLocale(String languageCode, String countryCode) { -// -// if (alreadyInitialized && languageCode.equals(_languageCode) -// && countryCode.equals(_countryCode)) { -// return; -// } -// -// if ((languageCode != null) && (countryCode != null) -// && (languageCode.length() > 0) && (countryCode.length() > 0)) { -// _languageCode = languageCode; -// _countryCode = countryCode; -// } else { -// _countryCode = I18n.defaultCountryCode; -// _languageCode = I18n.defaultLanguageCode; -// } -// -// I18n.resourceBundle = -// ResourceBundle.getBundle(Constants.exceptionMessagesResourceBundleBase, -// new Locale(_languageCode, _countryCode)); -// } + I18n.resourceBundle = + ResourceBundle.getBundle( + Constants.exceptionMessagesResourceBundleBase, + new Locale(languageCode, countryCode) + ); + alreadyInitialized = true; + } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java index 5df2b6ed26e..dc01897cca5 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java @@ -21,14 +21,15 @@ package com.sun.org.apache.xml.internal.security.utils; - import java.io.IOException; import java.io.OutputStream; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; @@ -60,6 +61,12 @@ public class XMLUtils { } }); + private static volatile String dsPrefix = "ds"; + private static volatile String xencPrefix = "xenc"; + + private static final java.util.logging.Logger log = + java.util.logging.Logger.getLogger(XMLUtils.class.getName()); + /** * Constructor XMLUtils * @@ -68,6 +75,23 @@ public class XMLUtils { // we don't allow instantiation } + + /** + * Set the prefix for the digital signature namespace + * @param prefix the new prefix for the digital signature namespace + */ + public static void setDsPrefix(String prefix) { + dsPrefix = prefix; + } + + /** + * Set the prefix for the encryption namespace + * @param prefix the new prefix for the encryption namespace + */ + public static void setXencPrefix(String prefix) { + xencPrefix = prefix; + } + public static Element getNextElement(Node el) { while ((el!=null) && (el.getNodeType()!=Node.ELEMENT_NODE)) { el=el.getNextSibling(); @@ -230,9 +254,8 @@ public class XMLUtils { return sb.toString(); } - - static String dsPrefix=null; static Map namePrefixes=new HashMap(); + /** * Creates an Element in the XML Signature specification namespace. * @@ -261,31 +284,38 @@ public class XMLUtils { return doc.createElementNS(Constants.SignatureSpecNS, namePrefix); } - /** - * Returns true if the element is in XML Signature namespace and the local - * name equals the supplied one. - * - * @param element - * @param localName - * @return true if the element is in XML Signature namespace and the local name equals the supplied one - */ - public static boolean elementIsInSignatureSpace(Element element, - String localName) { - return ElementProxy.checker.isNamespaceElement(element, localName, Constants.SignatureSpecNS); - } + /** + * Returns true if the element is in XML Signature namespace and the local + * name equals the supplied one. + * + * @param element + * @param localName + * @return true if the element is in XML Signature namespace and the local name equals the supplied one + */ + public static boolean elementIsInSignatureSpace(Element element, String localName) { + if (element == null) { + return false; + } - /** - * Returns true if the element is in XML Encryption namespace and the local - * name equals the supplied one. - * - * @param element - * @param localName - * @return true if the element is in XML Encryption namespace and the local name equals the supplied one - */ - public static boolean elementIsInEncryptionSpace(Element element, - String localName) { - return ElementProxy.checker.isNamespaceElement(element, localName, EncryptionConstants.EncryptionSpecNS); - } + return Constants.SignatureSpecNS.equals(element.getNamespaceURI()) + && element.getLocalName().equals(localName); + } + + /** + * Returns true if the element is in XML Encryption namespace and the local + * name equals the supplied one. + * + * @param element + * @param localName + * @return true if the element is in XML Encryption namespace and the local name equals the supplied one + */ + public static boolean elementIsInEncryptionSpace(Element element, String localName) { + if (element == null) { + return false; + } + return EncryptionConstants.EncryptionSpecNS.equals(element.getNamespaceURI()) + && element.getLocalName().equals(localName); + } /** * This method returns the owner document of a particular node. @@ -504,45 +534,45 @@ public class XMLUtils { } while (true); } - /** - * @param sibling - * @param nodeName - * @param number - * @return nodes with the constrain - */ - public static Element selectDsNode(Node sibling, String nodeName, int number) { - while (sibling!=null) { - if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, Constants.SignatureSpecNS )) { - if (number==0){ - return (Element)sibling; - } - number--; + /** + * @param sibling + * @param nodeName + * @param number + * @return nodes with the constrain + */ + public static Element selectDsNode(Node sibling, String nodeName, int number) { + while (sibling != null) { + if (Constants.SignatureSpecNS.equals(sibling.getNamespaceURI()) + && sibling.getLocalName().equals(nodeName)) { + if (number == 0){ + return (Element)sibling; } - sibling=sibling.getNextSibling(); + number--; + } + sibling = sibling.getNextSibling(); } return null; - } + } - /** - * @param sibling - * @param nodeName - * @param number - * @return nodes with the constrain - */ - - public static Element selectXencNode(Node sibling, String nodeName, int number) { - while (sibling!=null) { - if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, EncryptionConstants.EncryptionSpecNS )) { - if (number==0){ - return (Element)sibling; - } - number--; + /** + * @param sibling + * @param nodeName + * @param number + * @return nodes with the constrain + */ + public static Element selectXencNode(Node sibling, String nodeName, int number) { + while (sibling != null) { + if (EncryptionConstants.EncryptionSpecNS.equals(sibling.getNamespaceURI()) + && sibling.getLocalName().equals(nodeName)) { + if (number == 0){ + return (Element)sibling; } - sibling=sibling.getNextSibling(); + number--; + } + sibling = sibling.getNextSibling(); } return null; - } - + } /** * @param sibling @@ -581,62 +611,53 @@ public class XMLUtils { return (Text)n; } - /** - * @param sibling - * @param uri - * @param nodeName - * @param number - * @return nodes with the constrain - */ - public static Element selectNode(Node sibling, String uri,String nodeName, int number) { - while (sibling!=null) { - if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, uri)) { - if (number==0){ - return (Element)sibling; - } - number--; + /** + * @param sibling + * @param uri + * @param nodeName + * @param number + * @return nodes with the constrain + */ + public static Element selectNode(Node sibling, String uri, String nodeName, int number) { + while (sibling != null) { + if (sibling.getNamespaceURI() != null && sibling.getNamespaceURI().equals(uri) + && sibling.getLocalName().equals(nodeName)) { + if (number == 0){ + return (Element)sibling; } - sibling=sibling.getNextSibling(); + number--; + } + sibling = sibling.getNextSibling(); } return null; - } + } - /** - * @param sibling - * @param nodeName - * @return nodes with the constrain - */ - public static Element[] selectDsNodes(Node sibling,String nodeName) { - return selectNodes(sibling,Constants.SignatureSpecNS,nodeName); - } - /** - * @param sibling - * @param uri - * @param nodeName - * @return nodes with the constrain - */ - public static Element[] selectNodes(Node sibling,String uri,String nodeName) { - int size=20; - Element[] a= new Element[size]; - int curr=0; - //List list=new ArrayList(); - while (sibling!=null) { - if (ElementProxy.checker.isNamespaceElement(sibling, nodeName, uri)) { - a[curr++]=(Element)sibling; - if (size<=curr) { - int cursize= size<<2; - Element []cp=new Element[cursize]; - System.arraycopy(a,0,cp,0,size); - a=cp; - size=cursize; - } - } - sibling=sibling.getNextSibling(); + /** + * @param sibling + * @param nodeName + * @return nodes with the constrain + */ + public static Element[] selectDsNodes(Node sibling, String nodeName) { + return selectNodes(sibling,Constants.SignatureSpecNS, nodeName); + } + + /** + * @param sibling + * @param uri + * @param nodeName + * @return nodes with the constrain + */ + public static Element[] selectNodes(Node sibling, String uri, String nodeName) { + List list = new ArrayList(); + while (sibling != null) { + if (sibling.getNamespaceURI() != null && sibling.getNamespaceURI().equals(uri) + && sibling.getLocalName().equals(nodeName)) { + list.add((Element)sibling); + } + sibling = sibling.getNextSibling(); } - Element []af=new Element[curr]; - System.arraycopy(a,0,af,0,curr); - return af; - } + return list.toArray(new Element[list.size()]); + } /** * @param signatureElement @@ -694,4 +715,127 @@ public class XMLUtils { public static boolean ignoreLineBreaks() { return ignoreLineBreaks; } + + /** + * This method is a tree-search to help prevent against wrapping attacks. + * It checks that no two Elements have ID Attributes that match the "value" + * argument, if this is the case then "false" is returned. Note that a + * return value of "true" does not necessarily mean that a matching Element + * has been found, just that no wrapping attack has been detected. + */ + public static boolean protectAgainstWrappingAttack(Node startNode, + String value) + { + Node startParent = startNode.getParentNode(); + Node processedNode = null; + Element foundElement = null; + + String id = value.trim(); + if (id.charAt(0) == '#') { + id = id.substring(1); + } + + while (startNode != null) { + if (startNode.getNodeType() == Node.ELEMENT_NODE) { + Element se = (Element) startNode; + + NamedNodeMap attributes = se.getAttributes(); + if (attributes != null) { + for (int i = 0; i < attributes.getLength(); i++) { + Attr attr = (Attr)attributes.item(i); + if (attr.isId() && id.equals(attr.getValue())) { + if (foundElement == null) { + // Continue searching to find duplicates + foundElement = attr.getOwnerElement(); + } else { + log.log(java.util.logging.Level.FINE, "Multiple elements with the same 'Id' attribute value!"); + return false; + } + } + } + } + } + + processedNode = startNode; + startNode = startNode.getFirstChild(); + + // no child, this node is done. + if (startNode == null) { + // close node processing, get sibling + startNode = processedNode.getNextSibling(); + } + + // no more siblings, get parent, all children + // of parent are processed. + while (startNode == null) { + processedNode = processedNode.getParentNode(); + if (processedNode == startParent) { + return true; + } + // close parent node processing (processed node now) + startNode = processedNode.getNextSibling(); + } + } + return true; + } + + /** + * This method is a tree-search to help prevent against wrapping attacks. + * It checks that no other Element than the given "knownElement" argument + * has an ID attribute that matches the "value" argument, which is the ID + * value of "knownElement". If this is the case then "false" is returned. + */ + public static boolean protectAgainstWrappingAttack(Node startNode, + Element knownElement, + String value) + { + Node startParent = startNode.getParentNode(); + Node processedNode = null; + + String id = value.trim(); + if (id.charAt(0) == '#') { + id = id.substring(1); + } + + while (startNode != null) { + if (startNode.getNodeType() == Node.ELEMENT_NODE) { + Element se = (Element) startNode; + + NamedNodeMap attributes = se.getAttributes(); + if (attributes != null) { + for (int i = 0; i < attributes.getLength(); i++) { + Attr attr = (Attr)attributes.item(i); + if (attr.isId() && id.equals(attr.getValue()) + && se != knownElement) + { + log.log(java.util.logging.Level.FINE, "Multiple elements with the same 'Id' attribute value!"); + return false; + } + } + } + } + + processedNode = startNode; + startNode = startNode.getFirstChild(); + + // no child, this node is done. + if (startNode == null) { + // close node processing, get sibling + startNode = processedNode.getNextSibling(); + } + + // no more siblings, get parent, all children + // of parent are processed. + while (startNode == null) { + processedNode = processedNode.getParentNode(); + if (processedNode == startParent) { + return true; + } + // close parent node processing (processed node now) + startNode = processedNode.getNextSibling(); + } + } + return true; + } + } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java index 5d5719b69ec..67d635cb847 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java @@ -2,21 +2,23 @@ * reserved comment block * DO NOT REMOVE OR ALTER! */ -/* - * Copyright 1999-2004 The Apache Software Foundation. +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * http://www.apache.org/licenses/LICENSE-2.0 * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package com.sun.org.apache.xml.internal.security.utils.resolver; @@ -25,311 +27,318 @@ import java.util.List; import java.util.Map; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +import com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverDirectHTTP; +import com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverFragment; +import com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverLocalFilesystem; +import com.sun.org.apache.xml.internal.security.utils.resolver.implementations.ResolverXPointer; import org.w3c.dom.Attr; /** * During reference validation, we have to retrieve resources from somewhere. * This is done by retrieving a Resolver. The resolver needs two arguments: The - * URI in which the link to the new resource is defined and the BaseURI of the - * file/entity in which the URI occurs (the BaseURI is the same as the SystemId. - * - *
        - *
      • Verschiedene Implementierungen k??nnen sich als Resolver registrieren. - *
      • Standardm????ig werden erste Implementierungen auf dem XML config file registrirt. - *
      • Der Benutzer kann bei Bedarf Implementierungen voranstellen oder anf??gen. - *
      • Implementierungen k??nnen mittels Features customized werden ?? - * (z.B. um Proxy-Passworter ??bergeben zu k??nnen). - *
      • Jede Implementierung bekommt das URI Attribut und den Base URI - * ??bergeben und muss antworten, ob sie aufl??sen kann. - *
      • Die erste Implementierung, die die Aufgabe erf??llt, f??hrt die Aufl??sung durch. - *
      - * - * @author $Author: mullan $ + * URI in which the link to the new resource is defined and the baseURI of the + * file/entity in which the URI occurs (the baseURI is the same as the SystemId). */ public class ResourceResolver { - /** {@link java.util.logging} logging facility */ - static java.util.logging.Logger log = + /** {@link org.apache.commons.logging} logging facility */ + private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(ResourceResolver.class.getName()); - /** Field _alreadyInitialized */ - static boolean _alreadyInitialized = false; + /** these are the system-wide resolvers */ + private static List resolverList = new ArrayList(); - /** these are the system-wide resolvers */ - static List _resolverVector = null; + /** Field resolverSpi */ + private final ResourceResolverSpi resolverSpi; - static boolean allThreadSafeInList=true; + /** + * Constructor ResourceResolver + * + * @param resourceResolver + */ + public ResourceResolver(ResourceResolverSpi resourceResolver) { + this.resolverSpi = resourceResolver; + } - /** Field transformSpi */ - protected ResourceResolverSpi _resolverSpi = null; + /** + * Method getInstance + * + * @param uri + * @param baseURI + * @return the instance + * + * @throws ResourceResolverException + */ + public static final ResourceResolver getInstance(Attr uri, String baseURI) + throws ResourceResolverException { + return getInstance(uri, baseURI, false); + } - /** - * Constructor ResourceResolver - * - * @param className - * @throws ClassNotFoundException - * @throws IllegalAccessException - * @throws InstantiationException - */ - private ResourceResolver(String className) - throws ClassNotFoundException, IllegalAccessException, - InstantiationException { - this._resolverSpi = - (ResourceResolverSpi) Class.forName(className).newInstance(); - } + /** + * Method getInstance + * + * @param uri + * @param baseURI + * @param secureValidation + * @return the instance + * + * @throws ResourceResolverException + */ + public static final ResourceResolver getInstance( + Attr uri, String baseURI, boolean secureValidation + ) throws ResourceResolverException { + synchronized (resolverList) { + for (ResourceResolver resolver : resolverList) { + ResourceResolver resolverTmp = resolver; + if (!resolver.resolverSpi.engineIsThreadSafe()) { + try { + resolverTmp = + new ResourceResolver(resolver.resolverSpi.getClass().newInstance()); + } catch (InstantiationException e) { + throw new ResourceResolverException("", e, uri, baseURI); + } catch (IllegalAccessException e) { + throw new ResourceResolverException("", e, uri, baseURI); + } + } - /** - * Constructor ResourceResolver - * - * @param resourceResolver - */ - public ResourceResolver(ResourceResolverSpi resourceResolver) { - this._resolverSpi = resourceResolver; - } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, + "check resolvability by class " + resolverTmp.getClass().getName() + ); + } - - /** - * Method getInstance - * - * @param uri - * @param BaseURI - * @return the instnace - * - * @throws ResourceResolverException - */ - public static final ResourceResolver getInstance(Attr uri, String BaseURI) - throws ResourceResolverException { - int length=ResourceResolver._resolverVector.size(); - for (int i = 0; i < length; i++) { - ResourceResolver resolver = - ResourceResolver._resolverVector.get(i); - ResourceResolver resolverTmp=null; - try { - resolverTmp = allThreadSafeInList || resolver._resolverSpi.engineIsThreadSafe() ? resolver : - new ResourceResolver((ResourceResolverSpi)resolver._resolverSpi.getClass().newInstance()); - } catch (InstantiationException e) { - throw new ResourceResolverException("",e,uri,BaseURI); - } catch (IllegalAccessException e) { - throw new ResourceResolverException("",e,uri,BaseURI); - } - - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "check resolvability by class " + resolver._resolverSpi.getClass().getName()); - - if ((resolver != null) && resolverTmp.canResolve(uri, BaseURI)) { - if (i!=0) { - //update resolver. - //System.out.println("Swaping"); - List resolverVector=getResolverVectorClone(); - resolverVector.remove(i); - resolverVector.add(0,resolver); - _resolverVector=resolverVector; - } else { - //System.out.println("hitting"); - } - - return resolverTmp; - } - } - - Object exArgs[] = { ((uri != null) - ? uri.getNodeValue() - : "null"), BaseURI }; - - throw new ResourceResolverException("utils.resolver.noClass", exArgs, - uri, BaseURI); - } - - /** - * Method getResolverVectorClone - * - * @return clone of _resolverVector - */ - @SuppressWarnings("unchecked") - private static List getResolverVectorClone() { - return (List)((ArrayList)_resolverVector).clone(); - } - - /** - * Method getInstance - * - * @param uri - * @param BaseURI - * @param individualResolvers - * @return the instance - * - * @throws ResourceResolverException - */ - public static final ResourceResolver getInstance( - Attr uri, String BaseURI, List individualResolvers) - throws ResourceResolverException { - if (log.isLoggable(java.util.logging.Level.FINE)) { - - log.log(java.util.logging.Level.FINE, "I was asked to create a ResourceResolver and got " + (individualResolvers==null? 0 : individualResolvers.size()) ); - log.log(java.util.logging.Level.FINE, " extra resolvers to my existing " + ResourceResolver._resolverVector.size() + " system-wide resolvers"); - } - - // first check the individual Resolvers - int size=0; - if ((individualResolvers != null) && ((size=individualResolvers.size()) > 0)) { - for (int i = 0; i < size; i++) { - ResourceResolver resolver = - individualResolvers.get(i); - - if (resolver != null) { - String currentClass = resolver._resolverSpi.getClass().getName(); - if (log.isLoggable(java.util.logging.Level.FINE)) - log.log(java.util.logging.Level.FINE, "check resolvability by class " + currentClass); - - if (resolver.canResolve(uri, BaseURI)) { - return resolver; - } + resolverTmp.resolverSpi.secureValidation = secureValidation; + if ((resolverTmp != null) && resolverTmp.canResolve(uri, baseURI)) { + // Check to see whether the Resolver is allowed + if (secureValidation + && (resolverTmp.resolverSpi instanceof ResolverLocalFilesystem + || resolverTmp.resolverSpi instanceof ResolverDirectHTTP)) { + Object exArgs[] = { resolverTmp.resolverSpi.getClass().getName() }; + throw new ResourceResolverException( + "signature.Reference.ForbiddenResolver", exArgs, uri, baseURI + ); + } + return resolverTmp; + } } - } - } + } - return getInstance(uri,BaseURI); - } + Object exArgs[] = { ((uri != null) ? uri.getNodeValue() : "null"), baseURI }; - /** - * The init() function is called by com.sun.org.apache.xml.internal.security.Init.init() - */ - public static void init() { + throw new ResourceResolverException("utils.resolver.noClass", exArgs, uri, baseURI); + } - if (!ResourceResolver._alreadyInitialized) { - ResourceResolver._resolverVector = new ArrayList(10); - _alreadyInitialized = true; - } - } + /** + * Method getInstance + * + * @param uri + * @param baseURI + * @param individualResolvers + * @return the instance + * + * @throws ResourceResolverException + */ + public static ResourceResolver getInstance( + Attr uri, String baseURI, List individualResolvers + ) throws ResourceResolverException { + return getInstance(uri, baseURI, individualResolvers, false); + } + + /** + * Method getInstance + * + * @param uri + * @param baseURI + * @param individualResolvers + * @param secureValidation + * @return the instance + * + * @throws ResourceResolverException + */ + public static ResourceResolver getInstance( + Attr uri, String baseURI, List individualResolvers, boolean secureValidation + ) throws ResourceResolverException { + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, + "I was asked to create a ResourceResolver and got " + + (individualResolvers == null ? 0 : individualResolvers.size()) + ); + } + + // first check the individual Resolvers + if (individualResolvers != null) { + for (int i = 0; i < individualResolvers.size(); i++) { + ResourceResolver resolver = individualResolvers.get(i); + + if (resolver != null) { + if (log.isLoggable(java.util.logging.Level.FINE)) { + String currentClass = resolver.resolverSpi.getClass().getName(); + log.log(java.util.logging.Level.FINE, "check resolvability by class " + currentClass); + } + + resolver.resolverSpi.secureValidation = secureValidation; + if (resolver.canResolve(uri, baseURI)) { + return resolver; + } + } + } + } + + return getInstance(uri, baseURI, secureValidation); + } /** * Registers a ResourceResolverSpi class. This method logs a warning if * the class cannot be registered. * - * @param className the name of the ResourceResolverSpi class to be - * registered + * @param className the name of the ResourceResolverSpi class to be registered */ + @SuppressWarnings("unchecked") public static void register(String className) { - register(className, false); + try { + Class resourceResolverClass = + (Class) Class.forName(className); + register(resourceResolverClass, false); + } catch (ClassNotFoundException e) { + log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); + } } /** * Registers a ResourceResolverSpi class at the beginning of the provider * list. This method logs a warning if the class cannot be registered. * - * @param className the name of the ResourceResolverSpi class to be - * registered + * @param className the name of the ResourceResolverSpi class to be registered */ + @SuppressWarnings("unchecked") public static void registerAtStart(String className) { - register(className, true); - } - - private static void register(String className, boolean start) { try { - ResourceResolver resolver = new ResourceResolver(className); - if (start) { - ResourceResolver._resolverVector.add(0, resolver); - log.log(java.util.logging.Level.FINE, "registered resolver"); - } else { - ResourceResolver._resolverVector.add(resolver); - } - if (!resolver._resolverSpi.engineIsThreadSafe()) { - allThreadSafeInList=false; - } - } catch (Exception e) { - log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className +" disabling it"); - } catch (NoClassDefFoundError e) { - log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className +" disabling it"); + Class resourceResolverClass = + (Class) Class.forName(className); + register(resourceResolverClass, true); + } catch (ClassNotFoundException e) { + log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); } } - /** - * Method resolve - * - * @param uri - * @param BaseURI - * @return the resource - * - * @throws ResourceResolverException - */ - public static XMLSignatureInput resolveStatic(Attr uri, String BaseURI) - throws ResourceResolverException { + /** + * Registers a ResourceResolverSpi class. This method logs a warning if the class + * cannot be registered. + * @param className + * @param start + */ + public static void register(Class className, boolean start) { + try { + ResourceResolverSpi resourceResolverSpi = className.newInstance(); + register(resourceResolverSpi, start); + } catch (IllegalAccessException e) { + log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); + } catch (InstantiationException e) { + log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); + } + } - ResourceResolver myResolver = ResourceResolver.getInstance(uri, BaseURI); + /** + * Registers a ResourceResolverSpi instance. This method logs a warning if the class + * cannot be registered. + * @param resourceResolverSpi + * @param start + */ + public static void register(ResourceResolverSpi resourceResolverSpi, boolean start) { + synchronized(resolverList) { + if (start) { + resolverList.add(0, new ResourceResolver(resourceResolverSpi)); + } else { + resolverList.add(new ResourceResolver(resourceResolverSpi)); + } + } + if (log.isLoggable(java.util.logging.Level.FINE)) { + log.log(java.util.logging.Level.FINE, "Registered resolver: " + resourceResolverSpi.toString()); + } + } - return myResolver.resolve(uri, BaseURI); - } + /** + * This method registers the default resolvers. + */ + public static void registerDefaultResolvers() { + synchronized(resolverList) { + resolverList.add(new ResourceResolver(new ResolverFragment())); + resolverList.add(new ResourceResolver(new ResolverLocalFilesystem())); + resolverList.add(new ResourceResolver(new ResolverXPointer())); + resolverList.add(new ResourceResolver(new ResolverDirectHTTP())); + } + } - /** - * Method resolve - * - * @param uri - * @param BaseURI - * @return the resource - * - * @throws ResourceResolverException - */ - public XMLSignatureInput resolve(Attr uri, String BaseURI) - throws ResourceResolverException { - return this._resolverSpi.engineResolve(uri, BaseURI); - } + /** + * Method resolve + * + * @param uri + * @param baseURI + * @return the resource + * + * @throws ResourceResolverException + */ + public XMLSignatureInput resolve(Attr uri, String baseURI) + throws ResourceResolverException { + return resolverSpi.engineResolve(uri, baseURI); + } - /** - * Method setProperty - * - * @param key - * @param value - */ - public void setProperty(String key, String value) { - this._resolverSpi.engineSetProperty(key, value); - } + /** + * Method setProperty + * + * @param key + * @param value + */ + public void setProperty(String key, String value) { + resolverSpi.engineSetProperty(key, value); + } - /** - * Method getProperty - * - * @param key - * @return the value of the property - */ - public String getProperty(String key) { - return this._resolverSpi.engineGetProperty(key); - } + /** + * Method getProperty + * + * @param key + * @return the value of the property + */ + public String getProperty(String key) { + return resolverSpi.engineGetProperty(key); + } - /** - * Method addProperties - * - * @param properties - */ - public void addProperties(Map properties) { - this._resolverSpi.engineAddProperies(properties); - } + /** + * Method addProperties + * + * @param properties + */ + public void addProperties(Map properties) { + resolverSpi.engineAddProperies(properties); + } - /** - * Method getPropertyKeys - * - * @return all property keys. - */ - public String[] getPropertyKeys() { - return this._resolverSpi.engineGetPropertyKeys(); - } + /** + * Method getPropertyKeys + * + * @return all property keys. + */ + public String[] getPropertyKeys() { + return resolverSpi.engineGetPropertyKeys(); + } - /** - * Method understandsProperty - * - * @param propertyToTest - * @return true if the resolver understands the property - */ - public boolean understandsProperty(String propertyToTest) { - return this._resolverSpi.understandsProperty(propertyToTest); - } + /** + * Method understandsProperty + * + * @param propertyToTest + * @return true if the resolver understands the property + */ + public boolean understandsProperty(String propertyToTest) { + return resolverSpi.understandsProperty(propertyToTest); + } - /** - * Method canResolve - * - * @param uri - * @param BaseURI - * @return true if it can resolve the uri - */ - private boolean canResolve(Attr uri, String BaseURI) { - return this._resolverSpi.engineCanResolve(uri, BaseURI); - } + /** + * Method canResolve + * + * @param uri + * @param baseURI + * @return true if it can resolve the uri + */ + private boolean canResolve(Attr uri, String baseURI) { + return resolverSpi.engineCanResolve(uri, baseURI); + } } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java index 1ff89b78c5f..e9ba6d13171 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverSpi.java @@ -43,6 +43,8 @@ public abstract class ResourceResolverSpi { /** Field _properties */ protected java.util.Map _properties = null; + protected boolean secureValidation; + /** * This is the workhorse method used to resolve resources. * diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java index f77fc6e7642..d2750c84903 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverFragment.java @@ -23,11 +23,12 @@ package com.sun.org.apache.xml.internal.security.utils.resolver.implementations; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; -import com.sun.org.apache.xml.internal.security.utils.IdResolver; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -51,63 +52,68 @@ public class ResolverFragment extends ResourceResolverSpi { /** * Method engineResolve * - * Wird das gleiche Dokument referenziert? - * Wird ein anderes Dokument referenziert? * @inheritDoc * @param uri - * @param BaseURI - * + * @param baseURI */ - public XMLSignatureInput engineResolve(Attr uri, String BaseURI) + public XMLSignatureInput engineResolve(Attr uri, String baseURI) throws ResourceResolverException { + String uriNodeValue = uri.getNodeValue(); + Document doc = uri.getOwnerElement().getOwnerDocument(); - String uriNodeValue = uri.getNodeValue(); - Document doc = uri.getOwnerElement().getOwnerDocument(); + Node selectedElem = null; + if (uriNodeValue.equals("")) { + /* + * Identifies the node-set (minus any comment nodes) of the XML + * resource containing the signature + */ - Node selectedElem = null; - if (uriNodeValue.equals("")) { + log.log(java.util.logging.Level.FINE, "ResolverFragment with empty URI (means complete document)"); + selectedElem = doc; + } else { - /* - * Identifies the node-set (minus any comment nodes) of the XML - * resource containing the signature - */ + /* + * URI="#chapter1" + * Identifies a node-set containing the element with ID attribute + * value 'chapter1' of the XML resource containing the signature. + * XML Signature (and its applications) modify this node-set to + * include the element plus all descendents including namespaces and + * attributes -- but not comments. + */ + String id = uriNodeValue.substring(1); - log.log(java.util.logging.Level.FINE, "ResolverFragment with empty URI (means complete document)"); - selectedElem = doc; - } else { - - /* - * URI="#chapter1" - * Identifies a node-set containing the element with ID attribute - * value 'chapter1' of the XML resource containing the signature. - * XML Signature (and its applications) modify this node-set to - * include the element plus all descendents including namespaces and - * attributes -- but not comments. - */ - String id = uriNodeValue.substring(1); - - // Element selectedElem = doc.getElementById(id); - selectedElem = IdResolver.getElementById(doc, id); - if (selectedElem==null) { + selectedElem = doc.getElementById(id); + if (selectedElem == null) { Object exArgs[] = { id }; - throw new ResourceResolverException( - "signature.Verification.MissingID", exArgs, uri, BaseURI); - } - if (log.isLoggable(java.util.logging.Level.FINE)) + throw new ResourceResolverException( + "signature.Verification.MissingID", exArgs, uri, baseURI); + } + if (secureValidation) { + Element start = uri.getOwnerDocument().getDocumentElement(); + if (!XMLUtils.protectAgainstWrappingAttack(start, id)) { + Object exArgs[] = { id }; + throw new ResourceResolverException( + "signature.Verification.MultipleIDs", exArgs, + uri, baseURI); + } + } + if (log.isLoggable(java.util.logging.Level.FINE)) log.log(java.util.logging.Level.FINE, "Try to catch an Element with ID " + id + " and Element was " + selectedElem); - } + } - XMLSignatureInput result = new XMLSignatureInput(selectedElem); - result.setExcludeComments(true); + XMLSignatureInput result = new XMLSignatureInput(selectedElem); + result.setExcludeComments(true); - //log.log(java.util.logging.Level.FINE, "We return a nodeset with " + resultSet.size() + " nodes"); - result.setMIMEType("text/xml"); - result.setSourceURI((BaseURI != null) ? BaseURI.concat(uri.getNodeValue()) : - uri.getNodeValue()); - return result; - } + result.setMIMEType("text/xml"); + if (baseURI != null && baseURI.length() > 0) { + result.setSourceURI(baseURI.concat(uri.getNodeValue())); + } else { + result.setSourceURI(uri.getNodeValue()); + } + return result; + } /** * Method engineCanResolve diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java index 74410c815e2..0f931f44193 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverXPointer.java @@ -23,11 +23,12 @@ package com.sun.org.apache.xml.internal.security.utils.resolver.implementations; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; -import com.sun.org.apache.xml.internal.security.utils.IdResolver; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -54,52 +55,55 @@ public class ResolverXPointer extends ResourceResolverSpi { ResolverXPointer.class.getName()); public boolean engineIsThreadSafe() { - return true; - } - /** - * @inheritDoc - */ - public XMLSignatureInput engineResolve(Attr uri, String BaseURI) + return true; + } + + /** + * @inheritDoc + */ + public XMLSignatureInput engineResolve(Attr uri, String baseURI) throws ResourceResolverException { - Node resultNode = null; - Document doc = uri.getOwnerElement().getOwnerDocument(); + Node resultNode = null; + Document doc = uri.getOwnerElement().getOwnerDocument(); - String uriStr=uri.getNodeValue(); - if (isXPointerSlash(uriStr)) { + String uriStr = uri.getNodeValue(); + if (isXPointerSlash(uriStr)) { resultNode = doc; - } else if (isXPointerId(uriStr)) { + } else if (isXPointerId(uriStr)) { String id = getXPointerId(uriStr); - resultNode =IdResolver.getElementById(doc, id); + resultNode = doc.getElementById(id); - // log.log(java.util.logging.Level.FINE, "Use #xpointer(id('" + id + "')) on element " + selectedElem); + if (secureValidation) { + Element start = uri.getOwnerDocument().getDocumentElement(); + if (!XMLUtils.protectAgainstWrappingAttack(start, id)) { + Object exArgs[] = { id }; + throw new ResourceResolverException( + "signature.Verification.MultipleIDs", exArgs, + uri, baseURI); + } + } if (resultNode == null) { Object exArgs[] = { id }; throw new ResourceResolverException( - "signature.Verification.MissingID", exArgs, uri, BaseURI); + "signature.Verification.MissingID", exArgs, uri, baseURI); } - /* - resultNodes = - cXPathAPI - .selectNodeList(selectedElem, Canonicalizer - .XPATH_C14N_WITH_COMMENTS_SINGLE_NODE);*/ - } + } + XMLSignatureInput result = new XMLSignatureInput(resultNode); - XMLSignatureInput result = new XMLSignatureInput(resultNode); + result.setMIMEType("text/xml"); + if (baseURI != null && baseURI.length() > 0) { + result.setSourceURI(baseURI.concat(uri.getNodeValue())); + } else { + result.setSourceURI(uri.getNodeValue()); + } - result.setMIMEType("text/xml"); - if (BaseURI != null && BaseURI.length() > 0) { - result.setSourceURI(BaseURI.concat(uri.getNodeValue())); - } else { - result.setSourceURI(uri.getNodeValue()); - } - - return result; - } + return result; + } /** * @inheritDoc diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties index 596d8ab7f44..29d1823149d 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties @@ -140,7 +140,7 @@ syncrsimpl.valtores = \u8981\u89E3\u6790\u7684\u503C\u53EF\u4EE5\u5728\u6570\u63 #WebRowSetXmlReader exception wrsxmlreader.invalidcp = \u5DF2\u5230\u8FBE RowSet \u7684\u7ED3\u5C3E\u3002\u5149\u6807\u4F4D\u7F6E\u65E0\u6548 wrsxmlreader.readxml = readXML: {0} -wrsxmlreader.parseerr = ** \u8BED\u6CD5\u5206\u6790\u9519\u8BEF: {0}, \u884C: {1}, URI: {2} +wrsxmlreader.parseerr = ** \u89E3\u6790\u9519\u8BEF: {0}, \u884C: {1}, URI: {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException: {0} diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties index cb71246daa9..5ed2f8c4fde 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties @@ -67,8 +67,8 @@ cachedrowsetimpl.setmatchcols = \u5728\u53D6\u5F97\u5339\u914D\u6B04\u4E4B\u524D cachedrowsetimpl.matchcols1 = \u5339\u914D\u6B04\u61C9\u5927\u65BC 0 cachedrowsetimpl.matchcols2 = \u5339\u914D\u6B04\u61C9\u70BA\u7A7A\u767D\u5B57\u4E32\u6216\u7A7A\u503C\u5B57\u4E32 cachedrowsetimpl.unsetmatch = \u53D6\u6D88\u8A2D\u5B9A\u7684\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C -cachedrowsetimpl.unsetmatch1 = \u4F7F\u7528\u6B04\u540D\u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 -cachedrowsetimpl.unsetmatch2 = \u4F7F\u7528\u6B04 ID \u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +cachedrowsetimpl.unsetmatch1 = \u4F7F\u7528\u6B04\u540D\u4F5C\u70BA unsetMatchColumn \u7684\u5F15\u6578 +cachedrowsetimpl.unsetmatch2 = \u4F7F\u7528\u6B04 ID \u4F5C\u70BA unsetMatchColumn \u7684\u5F15\u6578 cachedrowsetimpl.numrows = \u5217\u6578\u5C0F\u65BC\u96F6\u6216\u5C0F\u65BC\u64F7\u53D6\u5927\u5C0F cachedrowsetimpl.startpos = \u8D77\u59CB\u4F4D\u7F6E\u4E0D\u80FD\u70BA\u8CA0\u6578 cachedrowsetimpl.nextpage = \u5728\u547C\u53EB\u4E4B\u524D\u690D\u5165\u8CC7\u6599 @@ -108,8 +108,8 @@ jdbcrowsetimpl.setmatchcols = \u8981\u5148\u8A2D\u5B9A\u5339\u914D\u6B04\uFF0C\u jdbcrowsetimpl.matchcols1 = \u5339\u914D\u6B04\u61C9\u5927\u65BC 0 jdbcrowsetimpl.matchcols2 = \u5339\u914D\u6B04\u4E0D\u80FD\u70BA\u7A7A\u767D\u5B57\u4E32\u6216\u7A7A\u503C\u5B57\u4E32 jdbcrowsetimpl.unsetmatch = \u53D6\u6D88\u8A2D\u5B9A\u7684\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C -jdbcrowsetimpl.usecolname = \u4F7F\u7528\u6B04\u540D\u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 -jdbcrowsetimpl.usecolid = \u4F7F\u7528\u6B04 ID \u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +jdbcrowsetimpl.usecolname = \u4F7F\u7528\u6B04\u540D\u4F5C\u70BA unsetMatchColumn \u7684\u5F15\u6578 +jdbcrowsetimpl.usecolid = \u4F7F\u7528\u6B04 ID \u4F5C\u70BA unsetMatchColumn \u7684\u5F15\u6578 jdbcrowsetimpl.resnotupd = ResultSet \u4E0D\u53EF\u66F4\u65B0 jdbcrowsetimpl.opnotysupp = \u5C1A\u4E0D\u652F\u63F4\u8A72\u4F5C\u696D jdbcrowsetimpl.featnotsupp = \u4E0D\u652F\u63F4\u8A72\u529F\u80FD diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties index 06888087d7c..61b4e122c9d 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties @@ -159,7 +159,7 @@ FormView.browseFileButton.textAndMnemonic=Procurar... ############ Abstract Document Strings ############ AbstractDocument.styleChange.textAndMnemonic=altera\u00E7\u00E3o de estilo AbstractDocument.addition.textAndMnemonic=adi\u00E7\u00E3o -AbstractDocument.deletion.textAndMnemonic=dele\u00E7\u00E3o +AbstractDocument.deletion.textAndMnemonic=exclus\u00E3o AbstractDocument.undo.textAndMnemonic=Desfazer AbstractDocument.redo.textAndMnemonic=Refazer diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java index 5df09b538bc..9345a435a1d 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java @@ -240,7 +240,7 @@ public class TTYResources_zh_CN extends java.util.ListResourceBundle { {"operation not yet supported", "\u5C1A\u4E0D\u652F\u6301\u8BE5\u64CD\u4F5C"}, {"Owned by:", " \u62E5\u6709\u8005: {0}, \u6761\u76EE\u8BA1\u6570: {1,number,integer}"}, {"Owned monitor:", " \u62E5\u6709\u7684\u76D1\u89C6\u5668: {0}"}, - {"Parse exception:", "\u8BED\u6CD5\u5206\u6790\u5F02\u5E38\u9519\u8BEF: {0}"}, + {"Parse exception:", "\u89E3\u6790\u5F02\u5E38\u9519\u8BEF: {0}"}, {"printbreakpointcommandusage", "\u7528\u6CD5: {0} : \u6216\n {1} .[(argument_type,...)]"}, {"Removed:", "\u5DF2\u5220\u9664: {0}"}, {"Requested stack frame is no longer active:", "\u8BF7\u6C42\u7684\u5806\u6808\u5E27\u4E0D\u518D\u6709\u6548: {0,number,integer}"}, diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SDE.java b/jdk/src/share/classes/com/sun/tools/jdi/SDE.java index b2389f7a1d7..833519d03be 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SDE.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SDE.java @@ -171,7 +171,7 @@ class SDE { } public boolean equals(Object obj) { - if ((obj != null) && (obj instanceof LineStratum)) { + if (obj instanceof LineStratum) { LineStratum other = (LineStratum)obj; return (lti == other.lti) && (sti == other.sti) && @@ -182,6 +182,11 @@ class SDE { } } + @Override + public int hashCode() { + return (lineNumber() * 17) ^ refType.hashCode(); + } + int lineNumber() { return stiLineNumber(sti, lti, jplsLine); } diff --git a/jdk/src/share/classes/java/awt/AWTEvent.java b/jdk/src/share/classes/java/awt/AWTEvent.java index 65ebcd3aad2..e541d4f9684 100644 --- a/jdk/src/share/classes/java/awt/AWTEvent.java +++ b/jdk/src/share/classes/java/awt/AWTEvent.java @@ -297,11 +297,11 @@ public abstract class AWTEvent extends EventObject { field.setAccessible(true); return field; } catch (SecurityException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e); } } catch (NoSuchFieldException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e); } } @@ -594,7 +594,7 @@ public abstract class AWTEvent extends EventObject { boolean b = field.getBoolean(this); field.setBoolean(that, b); } catch(IllegalAccessException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e); } } @@ -610,7 +610,7 @@ public abstract class AWTEvent extends EventObject { try { field.setBoolean(this, false); } catch(IllegalAccessException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("AWTEvent.dispatched() got IllegalAccessException ", e); } } diff --git a/jdk/src/share/classes/java/awt/AttributeValue.java b/jdk/src/share/classes/java/awt/AttributeValue.java index 19a8d95de43..7007ce0f3db 100644 --- a/jdk/src/share/classes/java/awt/AttributeValue.java +++ b/jdk/src/share/classes/java/awt/AttributeValue.java @@ -33,11 +33,11 @@ abstract class AttributeValue { private final String[] names; protected AttributeValue(int value, String[] names) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("value = " + value + ", names = " + names); } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { if ((value < 0) || (names == null) || (value >= names.length)) { log.finer("Assertion failed"); } diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index 846ea976450..c3307538f27 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -4707,12 +4707,12 @@ public abstract class Component implements ImageObserver, MenuContainer, // Check that this component belongs to this app-context AppContext compContext = appContext; if (compContext != null && !compContext.equals(AppContext.getAppContext())) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("Event " + e + " is being dispatched on the wrong AppContext"); } } - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("{0}", e); } @@ -4751,7 +4751,7 @@ public abstract class Component implements ImageObserver, MenuContainer, return; } } - if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) { + if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("" + e); } // MouseWheel may need to be retargeted here so that @@ -4809,7 +4809,7 @@ public abstract class Component implements ImageObserver, MenuContainer, if (inputContext != null) { inputContext.dispatchEvent(e); if (e.isConsumed()) { - if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) { + if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("3579: Skipping " + e); } return; @@ -4844,7 +4844,7 @@ public abstract class Component implements ImageObserver, MenuContainer, if (p != null) { p.preProcessKeyEvent((KeyEvent)e); if (e.isConsumed()) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Pre-process consumed event"); } return; @@ -4977,7 +4977,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // position relative to its parent. MouseWheelEvent newMWE; - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("dispatchMouseWheelToAncestor"); eventLog.finest("orig event src is of " + e.getSource().getClass()); } @@ -5000,7 +5000,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } } - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("new event src is " + anc.getClass()); } @@ -5500,7 +5500,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // Should only be called while holding the tree lock int numListening(long mask) { // One mask or the other, but not neither or both. - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if ((mask != AWTEvent.HIERARCHY_EVENT_MASK) && (mask != AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK)) { @@ -5541,7 +5541,7 @@ public abstract class Component implements ImageObserver, MenuContainer, break; case HierarchyEvent.ANCESTOR_MOVED: case HierarchyEvent.ANCESTOR_RESIZED: - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (changeFlags != 0) { eventLog.fine("Assertion (changeFlags == 0) failed"); } @@ -5557,7 +5557,7 @@ public abstract class Component implements ImageObserver, MenuContainer, break; default: // assert false - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("This code must never be reached"); } break; @@ -7643,7 +7643,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } } if (!isRequestFocusAccepted(temporary, focusedWindowChangeAllowed, cause)) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("requestFocus is not accepted"); } return false; @@ -7654,7 +7654,7 @@ public abstract class Component implements ImageObserver, MenuContainer, Component window = this; while ( (window != null) && !(window instanceof Window)) { if (!window.isVisible()) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("component is recurively invisible"); } return false; @@ -7666,14 +7666,14 @@ public abstract class Component implements ImageObserver, MenuContainer, Component heavyweight = (peer instanceof LightweightPeer) ? getNativeContainer() : this; if (heavyweight == null || !heavyweight.isVisible()) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Component is not a part of visible hierarchy"); } return false; } peer = heavyweight.peer; if (peer == null) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Peer is null"); } return false; @@ -7694,11 +7694,11 @@ public abstract class Component implements ImageObserver, MenuContainer, if (!success) { KeyboardFocusManager.getCurrentKeyboardFocusManager (appContext).dequeueKeyEvents(time, this); - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Peer request failed"); } } else { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Pass for " + this); } } @@ -7710,7 +7710,7 @@ public abstract class Component implements ImageObserver, MenuContainer, CausedFocusEvent.Cause cause) { if (!isFocusable() || !isVisible()) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Not focusable or not visible"); } return false; @@ -7718,7 +7718,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ComponentPeer peer = this.peer; if (peer == null) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("peer is null"); } return false; @@ -7726,7 +7726,7 @@ public abstract class Component implements ImageObserver, MenuContainer, Window window = getContainingWindow(); if (window == null || !window.isFocusableWindow()) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Component doesn't have toplevel"); } return false; @@ -7748,7 +7748,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // Controller is supposed to verify focus transfers and for this it // should know both from and to components. And it shouldn't verify // transfers from when these components are equal. - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("focus owner is null or this"); } return true; @@ -7761,7 +7761,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // most recent focus owner. But most recent focus owner can be // changed by requestFocsuXXX() call only, so this transfer has // been already approved. - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("cause is activation"); } return true; @@ -7772,7 +7772,7 @@ public abstract class Component implements ImageObserver, MenuContainer, temporary, focusedWindowChangeAllowed, cause); - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("RequestFocusController returns {0}", ret); } @@ -7864,7 +7864,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } boolean transferFocus(boolean clearOnFailure) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("clearOnFailure = " + clearOnFailure); } Component toFocus = getNextFocusCandidate(); @@ -7873,12 +7873,12 @@ public abstract class Component implements ImageObserver, MenuContainer, res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD); } if (clearOnFailure && !res) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("clear global focus owner"); } KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv(); } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("returning result: " + res); } return res; @@ -7893,19 +7893,19 @@ public abstract class Component implements ImageObserver, MenuContainer, comp = rootAncestor; rootAncestor = comp.getFocusCycleRootAncestor(); } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("comp = " + comp + ", root = " + rootAncestor); } Component candidate = null; if (rootAncestor != null) { FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy(); Component toFocus = policy.getComponentAfter(rootAncestor, comp); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("component after is " + toFocus); } if (toFocus == null) { toFocus = policy.getDefaultComponent(rootAncestor); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("default component is " + toFocus); } } @@ -7917,7 +7917,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } candidate = toFocus; } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Focus transfer candidate: " + candidate); } return candidate; @@ -7954,12 +7954,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } } if (clearOnFailure && !res) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("clear global focus owner"); } KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwnerPriv(); } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("returning result: " + res); } return res; @@ -9740,7 +9740,7 @@ public abstract class Component implements ImageObserver, MenuContainer, checkTreeLock(); if (!areBoundsValid()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid()); } return; @@ -9776,7 +9776,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } this.compoundShape = shape; Point compAbsolute = getLocationOnWindow(); - if (mixingLog.isLoggable(PlatformLogger.FINER)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINER)) { mixingLog.fine("this = " + this + "; compAbsolute=" + compAbsolute + "; shape=" + shape); } @@ -9910,7 +9910,7 @@ public abstract class Component implements ImageObserver, MenuContainer, checkTreeLock(); Region s = getNormalShape(); - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; normalShape=" + s); } @@ -9944,7 +9944,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } } - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("currentShape=" + s); } @@ -9954,12 +9954,12 @@ public abstract class Component implements ImageObserver, MenuContainer, void applyCurrentShape() { checkTreeLock(); if (!areBoundsValid()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid()); } return; // Because applyCompoundShape() ignores such components anyway } - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } applyCompoundShape(calculateCurrentShape()); @@ -9968,7 +9968,7 @@ public abstract class Component implements ImageObserver, MenuContainer, final void subtractAndApplyShape(Region s) { checkTreeLock(); - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; s=" + s); } @@ -10015,7 +10015,7 @@ public abstract class Component implements ImageObserver, MenuContainer, void mixOnShowing() { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } if (!isMixingNeeded()) { @@ -10033,7 +10033,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // We cannot be sure that the peer exists at this point, so we need the argument // to find out whether the hiding component is (well, actually was) a LW or a HW. synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; isLightweight = " + isLightweight); } if (!isMixingNeeded()) { @@ -10047,7 +10047,7 @@ public abstract class Component implements ImageObserver, MenuContainer, void mixOnReshaping() { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } if (!isMixingNeeded()) { @@ -10066,7 +10066,7 @@ public abstract class Component implements ImageObserver, MenuContainer, boolean becameHigher = newZorder < oldZorder; Container parent = getContainer(); - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; oldZorder=" + oldZorder + "; newZorder=" + newZorder + "; parent=" + parent); } @@ -10110,13 +10110,13 @@ public abstract class Component implements ImageObserver, MenuContainer, final boolean isMixingNeeded() { if (SunToolkit.getSunAwtDisableMixing()) { - if (mixingLog.isLoggable(PlatformLogger.FINEST)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINEST)) { mixingLog.finest("this = " + this + "; Mixing disabled via sun.awt.disableMixing"); } return false; } if (!areBoundsValid()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid()); } return false; @@ -10124,7 +10124,7 @@ public abstract class Component implements ImageObserver, MenuContainer, Window window = getContainingWindow(); if (window != null) { if (!window.hasHeavyweightDescendants() || !window.hasLightweightDescendants() || window.isDisposing()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("containing window = " + window + "; has h/w descendants = " + window.hasHeavyweightDescendants() + "; has l/w descendants = " + window.hasLightweightDescendants() + @@ -10133,7 +10133,7 @@ public abstract class Component implements ImageObserver, MenuContainer, return false; } } else { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; containing window is null"); } return false; diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java index 1525a7497c2..9029417b2ce 100644 --- a/jdk/src/share/classes/java/awt/Container.java +++ b/jdk/src/share/classes/java/awt/Container.java @@ -1320,7 +1320,7 @@ public class Container extends Component { int superListening = super.numListening(mask); if (mask == AWTEvent.HIERARCHY_EVENT_MASK) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { // Verify listeningChildren is correct int sum = 0; for (Component comp : component) { @@ -1332,7 +1332,7 @@ public class Container extends Component { } return listeningChildren + superListening; } else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { // Verify listeningBoundsChildren is correct int sum = 0; for (Component comp : component) { @@ -1345,7 +1345,7 @@ public class Container extends Component { return listeningBoundsChildren + superListening; } else { // assert false; - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("This code must never be reached"); } return superListening; @@ -1354,7 +1354,7 @@ public class Container extends Component { // Should only be called while holding tree lock void adjustListeningChildren(long mask, int num) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK || mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK || mask == (AWTEvent.HIERARCHY_EVENT_MASK | @@ -1395,7 +1395,7 @@ public class Container extends Component { // Should only be called while holding tree lock int countHierarchyMembers() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { // Verify descendantsCount is correct int sum = 0; for (Component comp : component) { @@ -4110,7 +4110,7 @@ public class Container extends Component { final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) { checkTreeLock(); - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder); } @@ -4147,7 +4147,7 @@ public class Container extends Component { final void recursiveApplyCurrentShape(int fromZorder, int toZorder) { checkTreeLock(); - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; fromZ=" + fromZorder + "; toZ=" + toZorder); } @@ -4264,7 +4264,7 @@ public class Container extends Component { @Override void mixOnShowing() { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } @@ -4289,7 +4289,7 @@ public class Container extends Component { @Override void mixOnHiding(boolean isLightweight) { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; isLightweight=" + isLightweight); } @@ -4303,7 +4303,7 @@ public class Container extends Component { @Override void mixOnReshaping() { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } @@ -4338,7 +4338,7 @@ public class Container extends Component { @Override void mixOnZOrderChanging(int oldZorder, int newZorder) { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this + "; oldZ=" + oldZorder + "; newZ=" + newZorder); } @@ -4359,7 +4359,7 @@ public class Container extends Component { @Override void mixOnValidating() { synchronized (getTreeLock()) { - if (mixingLog.isLoggable(PlatformLogger.FINE)) { + if (mixingLog.isLoggable(PlatformLogger.Level.FINE)) { mixingLog.fine("this = " + this); } @@ -4549,7 +4549,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener { // This may send it somewhere that doesn't have MouseWheelEvents // enabled. In this case, Component.dispatchEventImpl() will // retarget the event to a parent that DOES have the events enabled. - if (eventLog.isLoggable(PlatformLogger.FINEST) && (mouseOver != null)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) { eventLog.finest("retargeting mouse wheel to " + mouseOver.getName() + ", " + mouseOver.getClass()); diff --git a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index 4991b470fd9..7d36530ce2b 100644 --- a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -165,7 +165,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy if (getImplicitDownCycleTraversal()) { retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont); - if (retComp != null && log.isLoggable(PlatformLogger.FINE)) { + if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Transfered focus down-cycle to " + retComp + " in the focus cycle root " + cont); } @@ -177,7 +177,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy cont.getFocusTraversalPolicy().getDefaultComponent(cont) : cont.getFocusTraversalPolicy().getLastComponent(cont)); - if (retComp != null && log.isLoggable(PlatformLogger.FINE)) { + if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont); } } @@ -208,7 +208,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * aComponent is null */ public Component getComponentAfter(Container aContainer, Component aComponent) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Searching in " + aContainer + " for component after " + aComponent); } @@ -238,7 +238,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // See if the component is inside of policy provider. Container provider = getTopmostProvider(aContainer, aComponent); if (provider != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Asking FTP " + provider + " for component after " + aComponent); } @@ -249,7 +249,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (afterComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### FTP returned " + afterComp); } return afterComp; @@ -259,14 +259,14 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle + ", component is " + aComponent); } int index = getComponentIndex(cycle, aComponent); if (index < 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer); } return getFirstComponent(aContainer); @@ -331,7 +331,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // See if the component is inside of policy provider. Container provider = getTopmostProvider(aContainer, aComponent); if (provider != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Asking FTP " + provider + " for component after " + aComponent); } @@ -342,7 +342,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (beforeComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### FTP returned " + beforeComp); } return beforeComp; @@ -357,14 +357,14 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle + ", component is " + aComponent); } int index = getComponentIndex(cycle, aComponent); if (index < 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer); } return getLastComponent(aContainer); @@ -411,7 +411,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy public Component getFirstComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Getting first component in " + aContainer); } if (aContainer == null) { @@ -432,12 +432,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is empty"); } return null; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle); } @@ -467,7 +467,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy */ public Component getLastComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Getting last component in " + aContainer); } @@ -488,12 +488,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is empty"); } return null; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle); } diff --git a/jdk/src/share/classes/java/awt/Cursor.java b/jdk/src/share/classes/java/awt/Cursor.java index d022a647869..793fb3e1adf 100644 --- a/jdk/src/share/classes/java/awt/Cursor.java +++ b/jdk/src/share/classes/java/awt/Cursor.java @@ -310,7 +310,7 @@ public class Cursor implements java.io.Serializable { String key = prefix + DotFileSuffix; if (!systemCustomCursorProperties.containsKey(key)) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null"); } return null; @@ -365,7 +365,7 @@ public class Cursor implements java.io.Serializable { } if (cursor == null) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null"); } } else { diff --git a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java index f4199881989..7c0c39d8ffa 100644 --- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -285,10 +285,17 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { TimedWindowEvent we = (TimedWindowEvent)e; long time = we.getWhen(); synchronized (this) { - for (KeyEvent ke: enqueuedKeyEvents) { - if (time >= ke.getWhen()) { - SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e)); - return true; + KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst(); + if (ke != null && time >= ke.getWhen()) { + TypeAheadMarker marker = typeAheadMarkers.getFirst(); + if (marker != null) { + Window toplevel = marker.untilFocused.getContainingWindow(); + // Check that the component awaiting focus belongs to + // the current focused window. See 8015454. + if (toplevel != null && toplevel.isFocused()) { + SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e)); + return true; + } } } } @@ -310,7 +317,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * false otherwise */ public boolean dispatchEvent(AWTEvent e) { - if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) { focusLog.fine("" + e); } switch (e.getID()) { @@ -419,7 +426,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { // The component which last has the focus when this window was focused // should receive focus first - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("tempLost {0}, toFocus {1}", tempLost, toFocus); } @@ -488,7 +495,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { Component oldFocusOwner = getGlobalFocusOwner(); Component newFocusOwner = fe.getComponent(); if (oldFocusOwner == newFocusOwner) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Skipping {0} because focus owner is the same", e); } // We can't just drop the event - there could be @@ -607,7 +614,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { FocusEvent fe = (FocusEvent)e; Component currentFocusOwner = getGlobalFocusOwner(); if (currentFocusOwner == null) { - if (focusLog.isLoggable(PlatformLogger.FINE)) + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) focusLog.fine("Skipping {0} because focus owner is null", e); break; } @@ -615,7 +622,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { // If we make a mistake because of retargeting, then the // FOCUS_GAINED handler will correct it. if (currentFocusOwner == fe.getOppositeComponent()) { - if (focusLog.isLoggable(PlatformLogger.FINE)) + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) focusLog.fine("Skipping {0} because current focus owner is equal to opposite", e); break; } @@ -688,7 +695,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { Window losingFocusWindow = we.getWindow(); Window activeWindow = getGlobalActiveWindow(); Window oppositeWindow = we.getOppositeWindow(); - if (focusLog.isLoggable(PlatformLogger.FINE)) + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) focusLog.fine("Active {0}, Current focused {1}, losing focus {2} opposite {3}", activeWindow, currentFocusedWindow, losingFocusWindow, oppositeWindow); @@ -874,7 +881,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } } if (ke != null) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Pumping approved event {0}", ke); } enqueuedKeyEvents.removeFirst(); @@ -891,7 +898,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * Dumps the list of type-ahead queue markers to stderr */ void dumpMarkers() { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest(">>> Markers dump, time: {0}", System.currentTimeMillis()); synchronized (this) { if (typeAheadMarkers.size() != 0) { @@ -925,7 +932,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { // The fix is rolled out. if (ke.getWhen() > marker.after) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Storing event {0} because of marker {1}", ke, marker); } enqueuedKeyEvents.addLast(ke); @@ -939,7 +946,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } case FocusEvent.FOCUS_GAINED: - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Markers before FOCUS_GAINED on {0}", target); } dumpMarkers(); @@ -968,7 +975,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } } else { // Exception condition - event without marker - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Event without marker {0}", e); } } @@ -1209,7 +1216,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { return; } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Enqueue at {0} for {1}", after, untilFocused); } @@ -1251,7 +1258,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { return; } - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Dequeue at {0} for {1}", after, untilFocused); } diff --git a/jdk/src/share/classes/java/awt/EventDispatchThread.java b/jdk/src/share/classes/java/awt/EventDispatchThread.java index 3260e37859e..ab1d3e6f70a 100644 --- a/jdk/src/share/classes/java/awt/EventDispatchThread.java +++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java @@ -138,7 +138,7 @@ class EventDispatchThread extends Thread { } void addEventFilter(EventFilter filter) { - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("adding the event filter: " + filter); } synchronized (eventFilters) { @@ -164,7 +164,7 @@ class EventDispatchThread extends Thread { } void removeEventFilter(EventFilter filter) { - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("removing the event filter: " + filter); } synchronized (eventFilters) { @@ -209,7 +209,7 @@ class EventDispatchThread extends Thread { } while (eventOK == false); - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("Dispatching: " + event); } @@ -236,7 +236,7 @@ class EventDispatchThread extends Thread { } private void processException(Throwable e) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("Processing exception: " + e); } getUncaughtExceptionHandler().uncaughtException(this, e); diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index bf7c426a426..76795eb5ed6 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -173,6 +173,11 @@ public class EventQueue { */ private volatile int waitForID; + /* + * AppContext corresponding to the queue. + */ + private final AppContext appContext; + private final String name = "AWT-EventQueue-" + threadInitNumber.getAndIncrement(); private FwDispatcher fwDispatcher; @@ -225,8 +230,9 @@ public class EventQueue { * completes thus causing mess in thread group to appcontext mapping. */ - pushPopLock = (Lock)AppContext.getAppContext().get(AppContext.EVENT_QUEUE_LOCK_KEY); - pushPopCond = (Condition)AppContext.getAppContext().get(AppContext.EVENT_QUEUE_COND_KEY); + appContext = AppContext.getAppContext(); + pushPopLock = (Lock)appContext.get(AppContext.EVENT_QUEUE_LOCK_KEY); + pushPopCond = (Condition)appContext.get(AppContext.EVENT_QUEUE_COND_KEY); } /** @@ -240,7 +246,7 @@ public class EventQueue { * @throws NullPointerException if theEvent is null */ public void postEvent(AWTEvent theEvent) { - SunToolkit.flushPendingEvents(); + SunToolkit.flushPendingEvents(appContext); postEventPrivate(theEvent); } @@ -525,7 +531,7 @@ public class EventQueue { * of the synchronized block to avoid deadlock when * event queues are nested with push()/pop(). */ - SunToolkit.flushPendingEvents(); + SunToolkit.flushPendingEvents(appContext); pushPopLock.lock(); try { AWTEvent event = getNextEventPrivate(); @@ -565,7 +571,7 @@ public class EventQueue { * of the synchronized block to avoid deadlock when * event queues are nested with push()/pop(). */ - SunToolkit.flushPendingEvents(); + SunToolkit.flushPendingEvents(appContext); pushPopLock.lock(); try { for (int i = 0; i < NUM_PRIORITIES; i++) { @@ -745,7 +751,7 @@ public class EventQueue { dispatchThread.stopDispatching(); } } else { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("Unable to dispatch event: " + event); } } @@ -843,7 +849,7 @@ public class EventQueue { * @since 1.2 */ public void push(EventQueue newEventQueue) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("EventQueue.push(" + newEventQueue + ")"); } @@ -869,7 +875,7 @@ public class EventQueue { // Use getNextEventPrivate() as it doesn't call flushPendingEvents() newEventQueue.postEventPrivate(topQueue.getNextEventPrivate()); } catch (InterruptedException ie) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("Interrupted push", ie); } } @@ -884,7 +890,6 @@ public class EventQueue { newEventQueue.previousQueue = topQueue; topQueue.nextQueue = newEventQueue; - AppContext appContext = AppContext.getAppContext(); if (appContext.get(AppContext.EVENT_QUEUE_KEY) == topQueue) { appContext.put(AppContext.EVENT_QUEUE_KEY, newEventQueue); } @@ -909,7 +914,7 @@ public class EventQueue { * @since 1.2 */ protected void pop() throws EmptyStackException { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("EventQueue.pop(" + this + ")"); } @@ -932,7 +937,7 @@ public class EventQueue { try { prevQueue.postEventPrivate(topQueue.getNextEventPrivate()); } catch (InterruptedException ie) { - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine("Interrupted pop", ie); } } @@ -945,7 +950,6 @@ public class EventQueue { topQueue.dispatchThread.setEventQueue(prevQueue); } - AppContext appContext = AppContext.getAppContext(); if (appContext.get(AppContext.EVENT_QUEUE_KEY) == this) { appContext.put(AppContext.EVENT_QUEUE_KEY, prevQueue); } @@ -1044,7 +1048,6 @@ public class EventQueue { final void initDispatchThread() { pushPopLock.lock(); try { - AppContext appContext = AppContext.getAppContext(); if (dispatchThread == null && !threadGroup.isDestroyed() && !appContext.isDisposed()) { dispatchThread = AccessController.doPrivileged( new PrivilegedAction() { @@ -1072,7 +1075,7 @@ public class EventQueue { /* * Minimize discard possibility for non-posted events */ - SunToolkit.flushPendingEvents(); + SunToolkit.flushPendingEvents(appContext); /* * This synchronized block is to secure that the event dispatch * thread won't die in the middle of posting a new event to the @@ -1131,7 +1134,7 @@ public class EventQueue { * removeNotify method. */ final void removeSourceEvents(Object source, boolean removeAllEvents) { - SunToolkit.flushPendingEvents(); + SunToolkit.flushPendingEvents(appContext); pushPopLock.lock(); try { for (int i = 0; i < NUM_PRIORITIES; i++) { diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 4898c8aadc6..67b09fa2868 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -873,6 +873,33 @@ public class Font implements java.io.Serializable public static Font createFont(int fontFormat, InputStream fontStream) throws java.awt.FontFormatException, java.io.IOException { + if (hasTempPermission()) { + return createFont0(fontFormat, fontStream, null); + } + + // Otherwise, be extra conscious of pending temp file creation and + // resourcefully handle the temp file resources, among other things. + CreatedFontTracker tracker = CreatedFontTracker.getTracker(); + boolean acquired = false; + try { + acquired = tracker.acquirePermit(); + if (!acquired) { + throw new IOException("Timed out waiting for resources."); + } + return createFont0(fontFormat, fontStream, tracker); + } catch (InterruptedException e) { + throw new IOException("Problem reading font data."); + } finally { + if (acquired) { + tracker.releasePermit(); + } + } + } + + private static Font createFont0(int fontFormat, InputStream fontStream, + CreatedFontTracker tracker) + throws java.awt.FontFormatException, java.io.IOException { + if (fontFormat != Font.TRUETYPE_FONT && fontFormat != Font.TYPE1_FONT) { throw new IllegalArgumentException ("font format not recognized"); @@ -886,9 +913,11 @@ public class Font implements java.io.Serializable } } ); + if (tracker != null) { + tracker.add(tFile); + } int totalSize = 0; - CreatedFontTracker tracker = null; try { final OutputStream outStream = AccessController.doPrivileged( @@ -898,8 +927,8 @@ public class Font implements java.io.Serializable } } ); - if (!hasTempPermission()) { - tracker = CreatedFontTracker.getTracker(); + if (tracker != null) { + tracker.set(tFile, outStream); } try { byte[] buf = new byte[8192]; @@ -940,6 +969,9 @@ public class Font implements java.io.Serializable Font font = new Font(tFile, fontFormat, true, tracker); return font; } finally { + if (tracker != null) { + tracker.remove(tFile); + } if (!copiedFontData) { if (tracker != null) { tracker.subBytes(totalSize); diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index 1d1b78c6e10..21a8bd84805 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -652,7 +652,7 @@ public abstract class KeyboardFocusManager } void setNativeFocusOwner(Component comp) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}", String.valueOf(peer), String.valueOf(comp)); } @@ -961,7 +961,7 @@ public abstract class KeyboardFocusManager checkKFMSecurity(); oldActiveWindow = getActiveWindow(); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow); } @@ -2196,7 +2196,7 @@ public abstract class KeyboardFocusManager HeavyweightFocusRequest(Component heavyweight, Component descendant, boolean temporary, CausedFocusEvent.Cause cause) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (heavyweight == null) { log.fine("Assertion (heavyweight != null) failed"); } @@ -2208,7 +2208,7 @@ public abstract class KeyboardFocusManager } boolean addLightweightRequest(Component descendant, boolean temporary, CausedFocusEvent.Cause cause) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) { log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed"); } @@ -2386,7 +2386,7 @@ public abstract class KeyboardFocusManager (Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (heavyweight == null) { log.fine("Assertion (heavyweight != null) failed"); } @@ -2408,11 +2408,11 @@ public abstract class KeyboardFocusManager Component currentFocusOwner = thisManager.getGlobalFocusOwner(); Component nativeFocusOwner = thisManager.getNativeFocusOwner(); Window nativeFocusedWindow = thisManager.getNativeFocusedWindow(); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("SNFH for {0} in {1}", String.valueOf(descendant), String.valueOf(heavyweight)); } - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("0. Current focus owner {0}", String.valueOf(currentFocusOwner)); focusLog.finest("0. Native focus owner {0}", @@ -2422,7 +2422,7 @@ public abstract class KeyboardFocusManager } synchronized (heavyweightRequests) { HeavyweightFocusRequest hwFocusRequest = getLastHWRequest(); - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Request {0}", String.valueOf(hwFocusRequest)); } if (hwFocusRequest == null && @@ -2430,7 +2430,7 @@ public abstract class KeyboardFocusManager { if (descendant == currentFocusOwner) { // Redundant request. - if (focusLog.isLoggable(PlatformLogger.FINEST)) + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) focusLog.finest("1. SNFH_FAILURE for {0}", String.valueOf(descendant)); return SNFH_FAILURE; @@ -2464,7 +2464,7 @@ public abstract class KeyboardFocusManager // SunToolkit.postPriorityEvent(newFocusOwnerEvent); SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent); - if (focusLog.isLoggable(PlatformLogger.FINEST)) + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) focusLog.finest("2. SNFH_HANDLED for {0}", String.valueOf(descendant)); return SNFH_SUCCESS_HANDLED; } else if (hwFocusRequest != null && @@ -2478,7 +2478,7 @@ public abstract class KeyboardFocusManager manager.enqueueKeyEvents(time, descendant); } - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("3. SNFH_HANDLED for lightweight" + descendant + " in " + heavyweight); } @@ -2502,7 +2502,7 @@ public abstract class KeyboardFocusManager (hwFocusRequest != null) ? hwFocusRequest.heavyweight : nativeFocusedWindow)) { - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("4. SNFH_FAILURE for " + descendant); } return SNFH_FAILURE; @@ -2513,7 +2513,7 @@ public abstract class KeyboardFocusManager heavyweightRequests.add (new HeavyweightFocusRequest(heavyweight, descendant, temporary, cause)); - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("5. SNFH_PROCEED for " + descendant); } return SNFH_SUCCESS_PROCEED; @@ -2905,11 +2905,11 @@ public abstract class KeyboardFocusManager } KeyboardFocusManager manager = getCurrentKeyboardFocusManager(); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { if (event instanceof FocusEvent || event instanceof WindowEvent) { focusLog.finer(">>> {0}", String.valueOf(event)); } - if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER) && event instanceof KeyEvent) { focusLog.finer(" focus owner is {0}", String.valueOf(manager.getGlobalFocusOwner())); focusLog.finer(">>> {0}", String.valueOf(event)); @@ -2996,7 +2996,7 @@ public abstract class KeyboardFocusManager } } static void removeLastFocusRequest(Component heavyweight) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (heavyweight == null) { log.fine("Assertion (heavyweight != null) failed"); } diff --git a/jdk/src/share/classes/java/awt/SplashScreen.java b/jdk/src/share/classes/java/awt/SplashScreen.java index f9d3af15e13..18414981a8e 100644 --- a/jdk/src/share/classes/java/awt/SplashScreen.java +++ b/jdk/src/share/classes/java/awt/SplashScreen.java @@ -219,7 +219,7 @@ public final class SplashScreen { } } catch(java.net.MalformedURLException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("MalformedURLException caught in the getImageURL() method", e); } } diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index 783706a72b4..92bedb7580b 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -48,8 +48,6 @@ import java.io.File; import java.io.FileInputStream; import java.util.*; -import sun.util.logging.PlatformLogger; - import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import sun.awt.AppContext; @@ -1983,7 +1981,7 @@ public abstract class Toolkit { */ public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType); - private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Toolkit"); + // 8014718: logging has been removed from SunToolkit private static final int LONG_BITS = 64; private int[] calls = new int[LONG_BITS]; @@ -2150,12 +2148,6 @@ public abstract class Toolkit { } synchronized int countAWTEventListeners(long eventMask) { - if (log.isLoggable(PlatformLogger.FINE)) { - if (eventMask == 0) { - log.fine("Assertion (eventMask != 0) failed"); - } - } - int ci = 0; for (; eventMask != 0; eventMask >>>= 1, ci++) { } diff --git a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java index a93c50a19e2..1cfd24a1416 100644 --- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java +++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java @@ -108,7 +108,7 @@ class WaitDispatchSupport implements SecondaryLoop { this.condition = new Conditional() { @Override public boolean evaluate() { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("evaluate(): blockingEDT=" + keepBlockingEDT.get() + ", blockingCT=" + keepBlockingCT.get()); } @@ -165,7 +165,7 @@ class WaitDispatchSupport implements SecondaryLoop { */ @Override public boolean enter() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("enter(): blockingEDT=" + keepBlockingEDT.get() + ", blockingCT=" + keepBlockingCT.get()); } @@ -192,11 +192,11 @@ class WaitDispatchSupport implements SecondaryLoop { Thread currentThread = Thread.currentThread(); if (currentThread == dispatchThread) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("On dispatch thread: " + dispatchThread); } if (interval != 0) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("scheduling the timer for " + interval + " ms"); } timer.schedule(timerTask = new TimerTask() { @@ -213,7 +213,7 @@ class WaitDispatchSupport implements SecondaryLoop { SequencedEvent currentSE = KeyboardFocusManager. getCurrentKeyboardFocusManager().getCurrentSequencedEvent(); if (currentSE != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Dispose current SequencedEvent: " + currentSE); } currentSE.dispose(); @@ -231,7 +231,7 @@ class WaitDispatchSupport implements SecondaryLoop { } }); } else { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("On non-dispatch thread: " + currentThread); } synchronized (getTreeLock()) { @@ -257,11 +257,11 @@ class WaitDispatchSupport implements SecondaryLoop { getTreeLock().wait(); } } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("waitDone " + keepBlockingEDT.get() + " " + keepBlockingCT.get()); } } catch (InterruptedException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Exception caught while waiting: " + e); } } finally { @@ -284,7 +284,7 @@ class WaitDispatchSupport implements SecondaryLoop { * @inheritDoc */ public boolean exit() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("exit(): blockingEDT=" + keepBlockingEDT.get() + ", blockingCT=" + keepBlockingCT.get()); } @@ -311,7 +311,7 @@ class WaitDispatchSupport implements SecondaryLoop { }; private void wakeupEDT() { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("wakeupEDT(): EDT == " + dispatchThread); } EventQueue eq = dispatchThread.getEventQueue(); diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 657092b68ef..0e02d8b0a6f 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -3149,7 +3149,7 @@ public class Window extends Container implements Accessible { } synchronized (getTreeLock()) { super.setGraphicsConfiguration(gc); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("+ Window.setGraphicsConfiguration(): new GC is \n+ " + getGraphicsConfiguration_NoClientCode() + "\n+ this is " + this); } } diff --git a/jdk/src/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/share/classes/java/awt/color/ICC_Profile.java index b459f63b16d..c1534249f39 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java @@ -37,6 +37,7 @@ package java.awt.color; import sun.java2d.cmm.PCMM; import sun.java2d.cmm.CMSManager; +import sun.java2d.cmm.ProfileDataVerifier; import sun.java2d.cmm.ProfileDeferralMgr; import sun.java2d.cmm.ProfileDeferralInfo; import sun.java2d.cmm.ProfileActivator; @@ -775,6 +776,8 @@ public class ICC_Profile implements Serializable { ProfileDeferralMgr.activateProfiles(); } + ProfileDataVerifier.verify(data); + try { theID = CMSManager.getModule().loadProfile(data); } catch (CMMException c) { diff --git a/jdk/src/share/classes/java/awt/event/InputEvent.java b/jdk/src/share/classes/java/awt/event/InputEvent.java index f645c3a10a6..078b1a16d6a 100644 --- a/jdk/src/share/classes/java/awt/event/InputEvent.java +++ b/jdk/src/share/classes/java/awt/event/InputEvent.java @@ -353,7 +353,7 @@ public abstract class InputEvent extends ComponentEvent { sm.checkSystemClipboardAccess(); b = true; } catch (SecurityException se) { - if (logger.isLoggable(PlatformLogger.FINE)) { + if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine("InputEvent.canAccessSystemClipboard() got SecurityException ", se); } } diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java index 6d7217106aa..d510dcc1ba4 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java @@ -35,6 +35,8 @@ import java.awt.geom.Rectangle2D; import java.awt.geom.Point2D; import java.awt.Point; import java.awt.Rectangle; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Hashtable; import java.util.Vector; @@ -643,6 +645,7 @@ public class BufferedImage extends java.awt.Image this.properties = properties; int numBands = raster.getNumBands(); boolean isAlphaPre = cm.isAlphaPremultiplied(); + final boolean isStandard = isStandard(cm, raster); ColorSpace cs; // Force the raster data alpha state to match the premultiplied @@ -653,8 +656,9 @@ public class BufferedImage extends java.awt.Image cs = cm.getColorSpace(); int csType = cs.getType(); if (csType != ColorSpace.TYPE_RGB) { - if (csType == ColorSpace.TYPE_GRAY - && cm instanceof ComponentColorModel) { + if (csType == ColorSpace.TYPE_GRAY && + isStandard && + cm instanceof ComponentColorModel) { // Check if this might be a child raster (fix for bug 4240596) if (sm instanceof ComponentSampleModel && ((ComponentSampleModel)sm).getPixelStride() != numBands) { @@ -684,6 +688,7 @@ public class BufferedImage extends java.awt.Image // are correct int pixSize = cm.getPixelSize(); if (iraster.getPixelStride() == 1 && + isStandard && cm instanceof DirectColorModel && (pixSize == 32 || pixSize == 24)) { @@ -716,6 +721,7 @@ public class BufferedImage extends java.awt.Image } // if (iraster.getPixelStride() == 1 } // ((raster instanceof IntegerComponentRaster) && else if ((cm instanceof IndexColorModel) && (numBands == 1) && + isStandard && (!cm.hasAlpha() || !isAlphaPre)) { IndexColorModel icm = (IndexColorModel) cm; @@ -733,6 +739,7 @@ public class BufferedImage extends java.awt.Image } // else if (cm instanceof IndexColorModel) && (numBands == 1)) else if ((raster instanceof ShortComponentRaster) && (cm instanceof DirectColorModel) + && isStandard && (numBands == 3) && !cm.hasAlpha()) { @@ -752,6 +759,7 @@ public class BufferedImage extends java.awt.Image } // else if ((cm instanceof IndexColorModel) && (numBands == 1)) else if ((raster instanceof ByteComponentRaster) && (cm instanceof ComponentColorModel) + && isStandard && (raster.getSampleModel() instanceof PixelInterleavedSampleModel) && (numBands == 3 || numBands == 4)) { @@ -776,14 +784,15 @@ public class BufferedImage extends java.awt.Image } } if (is8bit && + braster.getPixelStride() == numBands && offs[0] == numBands-1 && offs[1] == numBands-2 && offs[2] == numBands-3) { - if (numBands == 3) { + if (numBands == 3 && !ccm.hasAlpha()) { imageType = TYPE_3BYTE_BGR; } - else if (offs[3] == 0) { + else if (offs[3] == 0 && ccm.hasAlpha()) { imageType = (isAlphaPre ? TYPE_4BYTE_ABGR_PRE : TYPE_4BYTE_ABGR); @@ -792,6 +801,27 @@ public class BufferedImage extends java.awt.Image } // else if ((raster instanceof ByteComponentRaster) && } + private static boolean isStandard(ColorModel cm, WritableRaster wr) { + final Class cmClass = cm.getClass(); + final Class wrClass = wr.getClass(); + final Class smClass = wr.getSampleModel().getClass(); + + final PrivilegedAction checkClassLoadersAction = + new PrivilegedAction() + { + + @Override + public Boolean run() { + final ClassLoader std = System.class.getClassLoader(); + + return (cmClass.getClassLoader() == std) && + (smClass.getClassLoader() == std) && + (wrClass.getClassLoader() == std); + } + }; + return AccessController.doPrivileged(checkClassLoadersAction); + } + /** * Returns the image type. If it is not one of the known types, * TYPE_CUSTOM is returned. diff --git a/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java index 627c9291074..d5f86f35287 100644 --- a/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java +++ b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java @@ -148,7 +148,7 @@ public class ComponentSampleModel extends SampleModel this.pixelStride = pixelStride; this.scanlineStride = scanlineStride; this.bandOffsets = (int[])bandOffsets.clone(); - numBands = bandOffsets.length; + numBands = this.bandOffsets.length; if (pixelStride < 0) { throw new IllegalArgumentException("Pixel stride must be >= 0"); } @@ -223,24 +223,24 @@ public class ComponentSampleModel extends SampleModel (dataType > DataBuffer.TYPE_DOUBLE)) { throw new IllegalArgumentException("Unsupported dataType."); } - int maxBank = bankIndices[0]; + int maxBank = this.bankIndices[0]; if (maxBank < 0) { throw new IllegalArgumentException("Index of bank 0 is less than "+ "0 ("+maxBank+")"); } - for (int i=1; i < bankIndices.length; i++) { - if (bankIndices[i] > maxBank) { - maxBank = bankIndices[i]; + for (int i=1; i < this.bankIndices.length; i++) { + if (this.bankIndices[i] > maxBank) { + maxBank = this.bankIndices[i]; } - else if (bankIndices[i] < 0) { + else if (this.bankIndices[i] < 0) { throw new IllegalArgumentException("Index of bank "+i+ " is less than 0 ("+ maxBank+")"); } } numBanks = maxBank+1; - numBands = bandOffsets.length; - if (bandOffsets.length != bankIndices.length) { + numBands = this.bandOffsets.length; + if (this.bandOffsets.length != this.bankIndices.length) { throw new IllegalArgumentException("Length of bandOffsets must "+ "equal length of bankIndices."); } diff --git a/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java index 5db0f7ffcb1..1c5475d09bc 100644 --- a/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java +++ b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java @@ -85,11 +85,11 @@ public class PixelInterleavedSampleModel extends ComponentSampleModel int scanlineStride, int bandOffsets[]) { super(dataType, w, h, pixelStride, scanlineStride, bandOffsets); - int minBandOff=bandOffsets[0]; - int maxBandOff=bandOffsets[0]; - for (int i=1; i scanlineStride) { diff --git a/jdk/src/share/classes/java/awt/image/Raster.java b/jdk/src/share/classes/java/awt/image/Raster.java index b90edf3a5c5..4fd0f6148ef 100644 --- a/jdk/src/share/classes/java/awt/image/Raster.java +++ b/jdk/src/share/classes/java/awt/image/Raster.java @@ -257,15 +257,10 @@ public class Raster { int bandOffsets[], Point location) { DataBuffer d; - int bands = bandOffsets.length; - int maxBandOff = bandOffsets[0]; - for (int i=1; i < bands; i++) { - if (bandOffsets[i] > maxBandOff) { - maxBandOff = bandOffsets[i]; - } - } - int size = maxBandOff + scanlineStride*(h-1) + pixelStride*(w-1) + 1; + int size = scanlineStride * (h - 1) + // fisrt (h - 1) scans + pixelStride * w; // last scan + switch(dataType) { case DataBuffer.TYPE_BYTE: d = new DataBufferByte(size); @@ -397,7 +392,9 @@ public class Raster { } } int banks = maxBank + 1; - int size = maxBandOff + scanlineStride*(h-1) + (w-1) + 1; + int size = maxBandOff + + scanlineStride * (h - 1) + // fisrt (h - 1) scans + w; // last scan switch(dataType) { case DataBuffer.TYPE_BYTE: diff --git a/jdk/src/share/classes/java/beans/XMLEncoder.java b/jdk/src/share/classes/java/beans/XMLEncoder.java index 2ac3cdc30b2..b7cc21de312 100644 --- a/jdk/src/share/classes/java/beans/XMLEncoder.java +++ b/jdk/src/share/classes/java/beans/XMLEncoder.java @@ -377,7 +377,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { Object arg = args[i]; mark(arg, true); } - mark(stm.getTarget(), false); + mark(stm.getTarget(), stm instanceof Expression); } diff --git a/jdk/src/share/classes/java/io/BufferedInputStream.java b/jdk/src/share/classes/java/io/BufferedInputStream.java index fcc7e702db6..a161a988109 100644 --- a/jdk/src/share/classes/java/io/BufferedInputStream.java +++ b/jdk/src/share/classes/java/io/BufferedInputStream.java @@ -185,7 +185,7 @@ class BufferedInputStream extends FilterInputStream { * * @param in the underlying input stream. * @param size the buffer size. - * @exception IllegalArgumentException if size <= 0. + * @exception IllegalArgumentException if {@code size <= 0}. */ public BufferedInputStream(InputStream in, int size) { super(in); diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java index d742233a0fd..ebf398078bf 100644 --- a/jdk/src/share/classes/java/io/BufferedReader.java +++ b/jdk/src/share/classes/java/io/BufferedReader.java @@ -95,7 +95,7 @@ public class BufferedReader extends Reader { * @param in A Reader * @param sz Input-buffer size * - * @exception IllegalArgumentException If sz is <= 0 + * @exception IllegalArgumentException If {@code sz <= 0} */ public BufferedReader(Reader in, int sz) { super(in); @@ -484,7 +484,7 @@ public class BufferedReader extends Reader { * whose size is no smaller than limit. * Therefore large values should be used with care. * - * @exception IllegalArgumentException If readAheadLimit is < 0 + * @exception IllegalArgumentException If {@code readAheadLimit < 0} * @exception IOException If an I/O error occurs */ public void mark(int readAheadLimit) throws IOException { diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java index 83a467e7266..01dfb175e82 100644 --- a/jdk/src/share/classes/java/io/BufferedWriter.java +++ b/jdk/src/share/classes/java/io/BufferedWriter.java @@ -95,7 +95,7 @@ public class BufferedWriter extends Writer { * @param out A Writer * @param sz Output-buffer size, a positive integer * - * @exception IllegalArgumentException If sz is <= 0 + * @exception IllegalArgumentException If {@code sz <= 0} */ public BufferedWriter(Writer out, int sz) { super(out); diff --git a/jdk/src/share/classes/java/io/Console.java b/jdk/src/share/classes/java/io/Console.java index c4987dc0934..c100f8a0ccd 100644 --- a/jdk/src/share/classes/java/io/Console.java +++ b/jdk/src/share/classes/java/io/Console.java @@ -75,7 +75,7 @@ import sun.nio.cs.StreamEncoder; * manually zero the returned character array after processing to minimize the * lifetime of sensitive data in memory. * - *
      + * 
      {@code
        * Console cons;
        * char[] passwd;
        * if ((cons = System.console()) != null &&
      @@ -83,7 +83,7 @@ import sun.nio.cs.StreamEncoder;
        *     ...
        *     java.util.Arrays.fill(passwd, ' ');
        * }
      - * 
      + * }
      * * @author Xueming Shen * @since 1.6 diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java index 1f1d044b1ab..4bc75fe5099 100644 --- a/jdk/src/share/classes/java/io/File.java +++ b/jdk/src/share/classes/java/io/File.java @@ -1899,14 +1899,20 @@ public class File // file name generation private static final SecureRandom random = new SecureRandom(); - static File generateFile(String prefix, String suffix, File dir) { + static File generateFile(String prefix, String suffix, File dir) + throws IOException + { long n = random.nextLong(); if (n == Long.MIN_VALUE) { n = 0; // corner case } else { n = Math.abs(n); } - return new File(dir, prefix + Long.toString(n) + suffix); + String name = prefix + Long.toString(n) + suffix; + File f = new File(dir, name); + if (!name.equals(f.getName())) + throw new IOException("Unable to create temporary file"); + return f; } } @@ -1988,25 +1994,21 @@ public class File if (suffix == null) suffix = ".tmp"; - File tmpdir = (directory != null) ? directory : TempDirectory.location(); - SecurityManager sm = System.getSecurityManager(); + File tmpdir = (directory != null) ? directory + : TempDirectory.location(); File f; - do { - f = TempDirectory.generateFile(prefix, suffix, tmpdir); - if (sm != null) { - try { - sm.checkWrite(f.getPath()); - } catch (SecurityException se) { - // don't reveal temporary directory location - if (directory == null) - throw new SecurityException("Unable to create temporary file"); - throw se; - } - } - if (f.isInvalid()) { + try { + do { + f = TempDirectory.generateFile(prefix, suffix, tmpdir); + } while (f.exists()); + if (!f.createNewFile()) throw new IOException("Unable to create temporary file"); - } - } while (!fs.createFileExclusively(f.getPath())); + } catch (SecurityException se) { + // don't reveal temporary directory location + if (directory == null) + throw new SecurityException("Unable to create temporary file"); + throw se; + } return f; } diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java index c49dcdad483..f7a94bb0342 100644 --- a/jdk/src/share/classes/java/io/ObjectOutputStream.java +++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java @@ -36,6 +36,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import static java.io.ObjectStreamClass.processQueue; import java.io.SerialCallbackContext; +import sun.reflect.misc.ReflectUtil; /** * An ObjectOutputStream writes primitive data types and graphs of Java objects @@ -1228,6 +1229,12 @@ public class ObjectOutputStream } } + private boolean isCustomSubclass() { + // Return true if this class is a custom subclass of ObjectOutputStream + return getClass().getClassLoader() + != ObjectOutputStream.class.getClassLoader(); + } + /** * Writes class descriptor representing a dynamic proxy class to stream. */ @@ -1245,6 +1252,9 @@ public class ObjectOutputStream } bout.setBlockDataMode(true); + if (isCustomSubclass()) { + ReflectUtil.checkPackageAccess(cl); + } annotateProxyClass(cl); bout.setBlockDataMode(false); bout.writeByte(TC_ENDBLOCKDATA); @@ -1271,6 +1281,9 @@ public class ObjectOutputStream Class cl = desc.forClass(); bout.setBlockDataMode(true); + if (isCustomSubclass()) { + ReflectUtil.checkPackageAccess(cl); + } annotateClass(cl); bout.setBlockDataMode(false); bout.writeByte(TC_ENDBLOCKDATA); diff --git a/jdk/src/share/classes/java/io/ObjectStreamClass.java b/jdk/src/share/classes/java/io/ObjectStreamClass.java index 41b116d41bc..04873c8a85d 100644 --- a/jdk/src/share/classes/java/io/ObjectStreamClass.java +++ b/jdk/src/share/classes/java/io/ObjectStreamClass.java @@ -49,7 +49,10 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import sun.misc.Unsafe; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; import sun.reflect.ReflectionFactory; +import sun.reflect.misc.ReflectUtil; /** * Serialization's descriptor for classes. It contains the name and @@ -258,7 +261,17 @@ public class ObjectStreamClass implements Serializable { * * @return the Class instance that this descriptor represents */ + @CallerSensitive public Class forClass() { + if (cl == null) { + return null; + } + if (System.getSecurityManager() != null) { + Class caller = Reflection.getCallerClass(); + if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), cl.getClassLoader())) { + ReflectUtil.checkPackageAccess(cl); + } + } return cl; } @@ -1151,7 +1164,14 @@ public class ObjectStreamClass implements Serializable { end = end.getSuperclass(); } + HashSet oscNames = new HashSet<>(3); + for (ObjectStreamClass d = this; d != null; d = d.superDesc) { + if (oscNames.contains(d.name)) { + throw new InvalidClassException("Circular reference."); + } else { + oscNames.add(d.name); + } // search up inheritance hierarchy for class with matching name String searchName = (d.cl != null) ? d.cl.getName() : d.name; diff --git a/jdk/src/share/classes/java/io/ObjectStreamField.java b/jdk/src/share/classes/java/io/ObjectStreamField.java index 55d6d6161d0..ceae3fd188e 100644 --- a/jdk/src/share/classes/java/io/ObjectStreamField.java +++ b/jdk/src/share/classes/java/io/ObjectStreamField.java @@ -26,6 +26,9 @@ package java.io; import java.lang.reflect.Field; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; +import sun.reflect.misc.ReflectUtil; /** * A description of a Serializable field from a Serializable class. An array @@ -157,7 +160,14 @@ public class ObjectStreamField * @return a Class object representing the type of the * serializable field */ + @CallerSensitive public Class getType() { + if (System.getSecurityManager() != null) { + Class caller = Reflection.getCallerClass(); + if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), type.getClassLoader())) { + ReflectUtil.checkPackageAccess(type); + } + } return type; } diff --git a/jdk/src/share/classes/java/io/PipedInputStream.java b/jdk/src/share/classes/java/io/PipedInputStream.java index ca2115430d7..4ad8fbd81d8 100644 --- a/jdk/src/share/classes/java/io/PipedInputStream.java +++ b/jdk/src/share/classes/java/io/PipedInputStream.java @@ -117,7 +117,7 @@ public class PipedInputStream extends InputStream { * @param src the stream to connect to. * @param pipeSize the size of the pipe's buffer. * @exception IOException if an I/O error occurs. - * @exception IllegalArgumentException if pipeSize <= 0. + * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedInputStream(PipedOutputStream src, int pipeSize) @@ -147,7 +147,7 @@ public class PipedInputStream extends InputStream { * connected} to a PipedOutputStream before being used. * * @param pipeSize the size of the pipe's buffer. - * @exception IllegalArgumentException if pipeSize <= 0. + * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedInputStream(int pipeSize) { diff --git a/jdk/src/share/classes/java/io/PipedReader.java b/jdk/src/share/classes/java/io/PipedReader.java index 95cfe1d7bd0..bb86022af6f 100644 --- a/jdk/src/share/classes/java/io/PipedReader.java +++ b/jdk/src/share/classes/java/io/PipedReader.java @@ -91,7 +91,7 @@ public class PipedReader extends Reader { * @param src the stream to connect to. * @param pipeSize the size of the pipe's buffer. * @exception IOException if an I/O error occurs. - * @exception IllegalArgumentException if pipeSize <= 0. + * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(PipedWriter src, int pipeSize) throws IOException { @@ -120,7 +120,7 @@ public class PipedReader extends Reader { * before being used. * * @param pipeSize the size of the pipe's buffer. - * @exception IllegalArgumentException if pipeSize <= 0. + * @exception IllegalArgumentException if {@code pipeSize <= 0}. * @since 1.6 */ public PipedReader(int pipeSize) { diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java index c4cd01f470f..b803c6a657f 100644 --- a/jdk/src/share/classes/java/io/PrintStream.java +++ b/jdk/src/share/classes/java/io/PrintStream.java @@ -851,7 +851,7 @@ public class PrintStream extends FilterOutputStream * null argument depends on the conversion. * - * @throws IllegalFormatException + * @throws java.util.IllegalFormatException * If a format string contains an illegal syntax, a format * specifier that is incompatible with the given arguments, * insufficient arguments given the format string, or other @@ -901,7 +901,7 @@ public class PrintStream extends FilterOutputStream * null argument depends on the conversion. * - * @throws IllegalFormatException + * @throws java.util.IllegalFormatException * If a format string contains an illegal syntax, a format * specifier that is incompatible with the given arguments, * insufficient arguments given the format string, or other @@ -944,7 +944,7 @@ public class PrintStream extends FilterOutputStream * null argument depends on the conversion. * - * @throws IllegalFormatException + * @throws java.util.IllegalFormatException * If a format string contains an illegal syntax, a format * specifier that is incompatible with the given arguments, * insufficient arguments given the format string, or other @@ -1001,7 +1001,7 @@ public class PrintStream extends FilterOutputStream * null argument depends on the conversion. * - * @throws IllegalFormatException + * @throws java.util.IllegalFormatException * If a format string contains an illegal syntax, a format * specifier that is incompatible with the given arguments, * insufficient arguments given the format string, or other diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java index af0b525a6f2..b81bec424bc 100644 --- a/jdk/src/share/classes/java/io/PushbackInputStream.java +++ b/jdk/src/share/classes/java/io/PushbackInputStream.java @@ -85,7 +85,7 @@ class PushbackInputStream extends FilterInputStream { * * @param in the input stream from which bytes will be read. * @param size the size of the pushback buffer. - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} * @since JDK1.1 */ public PushbackInputStream(InputStream in, int size) { diff --git a/jdk/src/share/classes/java/io/PushbackReader.java b/jdk/src/share/classes/java/io/PushbackReader.java index 2f5b18cfefc..98ebd5dab9c 100644 --- a/jdk/src/share/classes/java/io/PushbackReader.java +++ b/jdk/src/share/classes/java/io/PushbackReader.java @@ -47,7 +47,7 @@ public class PushbackReader extends FilterReader { * * @param in The reader from which characters will be read * @param size The size of the pushback buffer - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public PushbackReader(Reader in, int size) { super(in); diff --git a/jdk/src/share/classes/java/io/StringReader.java b/jdk/src/share/classes/java/io/StringReader.java index 3778408e5f4..0cdf8fd2197 100644 --- a/jdk/src/share/classes/java/io/StringReader.java +++ b/jdk/src/share/classes/java/io/StringReader.java @@ -163,7 +163,7 @@ public class StringReader extends Reader { * is no actual limit, so this argument must not * be negative, but is otherwise ignored. * - * @exception IllegalArgumentException If readAheadLimit is < 0 + * @exception IllegalArgumentException If {@code readAheadLimit < 0} * @exception IOException If an I/O error occurs */ public void mark(int readAheadLimit) throws IOException { diff --git a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java index c319fa4da6e..a5bde616f8a 100644 --- a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -689,7 +689,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @return a reference to this object. */ public AbstractStringBuilder append(float f) { - new FloatingDecimal(f).appendTo(this); + FloatingDecimal.appendTo(f,this); return this; } @@ -706,7 +706,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @return a reference to this object. */ public AbstractStringBuilder append(double d) { - new FloatingDecimal(d).appendTo(this); + FloatingDecimal.appendTo(d,this); return this; } diff --git a/jdk/src/share/classes/java/lang/Boolean.java b/jdk/src/share/classes/java/lang/Boolean.java index fbbeba72ce0..a9293ba1459 100644 --- a/jdk/src/share/classes/java/lang/Boolean.java +++ b/jdk/src/share/classes/java/lang/Boolean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -205,9 +205,9 @@ public final class Boolean implements java.io.Serializable, * Returns a hash code for a {@code boolean} value; compatible with * {@code Boolean.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code boolean} value. + * @since 1.8 */ public static int hashCode(boolean value) { return value ? 1231 : 1237; diff --git a/jdk/src/share/classes/java/lang/Byte.java b/jdk/src/share/classes/java/lang/Byte.java index 43a558ade43..275e33de5a7 100644 --- a/jdk/src/share/classes/java/lang/Byte.java +++ b/jdk/src/share/classes/java/lang/Byte.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -398,9 +398,9 @@ public final class Byte extends Number implements Comparable { * Returns a hash code for a {@code byte} value; compatible with * {@code Byte.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code byte} value. + * @since 1.8 */ public static int hashCode(byte value) { return (int)value; diff --git a/jdk/src/share/classes/java/lang/CharSequence.java b/jdk/src/share/classes/java/lang/CharSequence.java index d34c1e02e27..30a23590875 100644 --- a/jdk/src/share/classes/java/lang/CharSequence.java +++ b/jdk/src/share/classes/java/lang/CharSequence.java @@ -179,10 +179,25 @@ public interface CharSequence { @Override public void forEachRemaining(IntConsumer block) { - while (cur < length()) { - int cp = Character.codePointAt(CharSequence.this, cur); - cur += Character.charCount(cp); - block.accept(cp); + final int length = length(); + int i = cur; + try { + while (i < length) { + char c1 = charAt(i++); + if (!Character.isHighSurrogate(c1) || i >= length) { + block.accept(c1); + } else { + char c2 = charAt(i); + if (Character.isLowSurrogate(c2)) { + i++; + block.accept(Character.toCodePoint(c1, c2)); + } else { + block.accept(c1); + } + } + } + } finally { + cur = i; } } @@ -191,12 +206,20 @@ public interface CharSequence { } public int nextInt() { - if (!hasNext()) { + final int length = length(); + + if (cur >= length) { throw new NoSuchElementException(); } - int cp = Character.codePointAt(CharSequence.this, cur); - cur += Character.charCount(cp); - return cp; + char c1 = charAt(cur++); + if (Character.isHighSurrogate(c1) && cur < length) { + char c2 = charAt(cur); + if (Character.isLowSurrogate(c2)) { + cur++; + return Character.toCodePoint(c1, c2); + } + } + return c1; } } diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java index 531263d3894..e512e582612 100644 --- a/jdk/src/share/classes/java/lang/Character.java +++ b/jdk/src/share/classes/java/lang/Character.java @@ -4782,9 +4782,9 @@ class Character implements java.io.Serializable, Comparable { * Unicode surrogate pair. *

      This method is equivalent to the expression: - *

      +     * 
      {@code
            * isHighSurrogate(high) && isLowSurrogate(low)
      -     * 
      + * }
      * * @param high the high-surrogate code value to be tested * @param low the low-surrogate code value to be tested diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index c131a9c3071..df4d457367d 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -708,8 +708,9 @@ public final class Class implements java.io.Serializable, */ @SuppressWarnings("unchecked") public TypeVariable>[] getTypeParameters() { - if (getGenericSignature() != null) - return (TypeVariable>[])getGenericInfo().getTypeParameters(); + ClassRepository info = getGenericInfo(); + if (info != null) + return (TypeVariable>[])info.getTypeParameters(); else return (TypeVariable>[])new TypeVariable[0]; } @@ -759,15 +760,19 @@ public final class Class implements java.io.Serializable, * @since 1.5 */ public Type getGenericSuperclass() { - if (getGenericSignature() != null) { - // Historical irregularity: - // Generic signature marks interfaces with superclass = Object - // but this API returns null for interfaces - if (isInterface()) - return null; - return getGenericInfo().getSuperclass(); - } else + ClassRepository info = getGenericInfo(); + if (info == null) { return getSuperclass(); + } + + // Historical irregularity: + // Generic signature marks interfaces with superclass = Object + // but this API returns null for interfaces + if (isInterface()) { + return null; + } + + return info.getSuperclass(); } /** @@ -830,7 +835,23 @@ public final class Class implements java.io.Serializable, * * @return an array of interfaces implemented by this class. */ - public native Class[] getInterfaces(); + public Class[] getInterfaces() { + ReflectionData rd = reflectionData(); + if (rd == null) { + // no cloning required + return getInterfaces0(); + } else { + Class[] interfaces = rd.interfaces; + if (interfaces == null) { + interfaces = getInterfaces0(); + rd.interfaces = interfaces; + } + // defensively copy before handing over to user code + return interfaces.clone(); + } + } + + private native Class[] getInterfaces0(); /** * Returns the {@code Type}s representing the interfaces @@ -882,10 +903,8 @@ public final class Class implements java.io.Serializable, * @since 1.5 */ public Type[] getGenericInterfaces() { - if (getGenericSignature() != null) - return getGenericInfo().getSuperInterfaces(); - else - return getInterfaces(); + ClassRepository info = getGenericInfo(); + return (info == null) ? getInterfaces() : info.getSuperInterfaces(); } @@ -962,9 +981,28 @@ public final class Class implements java.io.Serializable, * * @return the immediately enclosing method of the underlying class, if * that class is a local or anonymous class; otherwise {@code null}. + * @exception SecurityException + * If a security manager, s, is present and any of the + * following conditions is met: + * + *
        + * + *
      • invocation of + * {@link SecurityManager#checkMemberAccess + * s.checkMemberAccess(enclosingClass, Member.DECLARED)} denies + * access to the methods within the enclosing class + * + *
      • the caller's class loader is not the same as or an + * ancestor of the class loader for the enclosing class and + * invocation of {@link SecurityManager#checkPackageAccess + * s.checkPackageAccess()} denies access to the package + * of the enclosing class + * + *
      * @since 1.5 */ - public Method getEnclosingMethod() { + @CallerSensitive + public Method getEnclosingMethod() throws SecurityException { EnclosingMethodInfo enclosingInfo = getEnclosingMethodInfo(); if (enclosingInfo == null) @@ -985,13 +1023,22 @@ public final class Class implements java.io.Serializable, for(int i = 0; i < parameterClasses.length; i++) parameterClasses[i] = toClass(parameterTypes[i]); + // Perform access check + Class enclosingCandidate = enclosingInfo.getEnclosingClass(); + // be very careful not to change the stack depth of this + // checkMemberAccess call for security reasons + // see java.lang.SecurityManager.checkMemberAccess + // + // Note that we need to do this on the enclosing class + enclosingCandidate.checkMemberAccess(Member.DECLARED, + Reflection.getCallerClass(), true); /* * Loop over all declared methods; match method name, * number of and type of parameters, *and* return * type. Matching return type is also necessary * because of covariant returns, etc. */ - for(Method m: enclosingInfo.getEnclosingClass().getDeclaredMethods()) { + for(Method m: enclosingCandidate.getDeclaredMethods()) { if (m.getName().equals(enclosingInfo.getName()) ) { Class[] candidateParamClasses = m.getParameterTypes(); if (candidateParamClasses.length == parameterClasses.length) { @@ -1090,9 +1137,28 @@ public final class Class implements java.io.Serializable, * * @return the immediately enclosing constructor of the underlying class, if * that class is a local or anonymous class; otherwise {@code null}. + * @exception SecurityException + * If a security manager, s, is present and any of the + * following conditions is met: + * + *
        + * + *
      • invocation of + * {@link SecurityManager#checkMemberAccess + * s.checkMemberAccess(enclosingClass, Member.DECLARED)} denies + * access to the constructors within the enclosing class + * + *
      • the caller's class loader is not the same as or an + * ancestor of the class loader for the enclosing class and + * invocation of {@link SecurityManager#checkPackageAccess + * s.checkPackageAccess()} denies access to the package + * of the enclosing class + * + *
      * @since 1.5 */ - public Constructor getEnclosingConstructor() { + @CallerSensitive + public Constructor getEnclosingConstructor() throws SecurityException { EnclosingMethodInfo enclosingInfo = getEnclosingMethodInfo(); if (enclosingInfo == null) @@ -1112,11 +1178,20 @@ public final class Class implements java.io.Serializable, for(int i = 0; i < parameterClasses.length; i++) parameterClasses[i] = toClass(parameterTypes[i]); + // Perform access check + Class enclosingCandidate = enclosingInfo.getEnclosingClass(); + // be very careful not to change the stack depth of this + // checkMemberAccess call for security reasons + // see java.lang.SecurityManager.checkMemberAccess + // + // Note that we need to do this on the enclosing class + enclosingCandidate.checkMemberAccess(Member.DECLARED, + Reflection.getCallerClass(), true); /* * Loop over all declared constructors; match number * of and type of parameters. */ - for(Constructor c: enclosingInfo.getEnclosingClass().getDeclaredConstructors()) { + for(Constructor c: enclosingCandidate.getDeclaredConstructors()) { Class[] candidateParamClasses = c.getParameterTypes(); if (candidateParamClasses.length == parameterClasses.length) { boolean matches = true; @@ -1156,9 +1231,16 @@ public final class Class implements java.io.Serializable, * class. If the underlying class is a top level class this * method returns {@code null}. * @return the immediately enclosing class of the underlying class + * @exception SecurityException + * If a security manager, s, is present and the caller's + * class loader is not the same as or an ancestor of the class + * loader for the enclosing class and invocation of {@link + * SecurityManager#checkPackageAccess s.checkPackageAccess()} + * denies access to the package of the enclosing class * @since 1.5 */ - public Class getEnclosingClass() { + @CallerSensitive + public Class getEnclosingClass() throws SecurityException { // There are five kinds of classes (or interfaces): // a) Top level classes // b) Nested classes (static member classes) @@ -1171,18 +1253,24 @@ public final class Class implements java.io.Serializable, // attribute if and only if it is a local class or an // anonymous class. EnclosingMethodInfo enclosingInfo = getEnclosingMethodInfo(); + Class enclosingCandidate; if (enclosingInfo == null) { // This is a top level or a nested class or an inner class (a, b, or c) - return getDeclaringClass(); + enclosingCandidate = getDeclaringClass(); } else { Class enclosingClass = enclosingInfo.getEnclosingClass(); // This is a local class or an anonymous class (d or e) if (enclosingClass == this || enclosingClass == null) throw new InternalError("Malformed enclosing method information"); else - return enclosingClass; + enclosingCandidate = enclosingClass; } + + if (enclosingCandidate != null) + enclosingCandidate.checkPackageAccess( + ClassLoader.getClassLoader(Reflection.getCallerClass()), true); + return enclosingCandidate; } /** @@ -2212,14 +2300,6 @@ public final class Class implements java.io.Serializable, */ private native java.security.ProtectionDomain getProtectionDomain0(); - - /** - * Set the ProtectionDomain for this class. Called by - * ClassLoader.defineClass. - */ - native void setProtectionDomain0(java.security.ProtectionDomain pd); - - /* * Return the Virtual Machine's Class object for the named * primitive type. @@ -2238,6 +2318,8 @@ public final class Class implements java.io.Serializable, * Check if client is allowed to access members. If access is denied, * throw a SecurityException. * + * This method also enforces package access. + * *

      Default policy: allow all clients access with normal Java access * control. */ @@ -2258,7 +2340,19 @@ public final class Class implements java.io.Serializable, // checkMemberAccess of subclasses of SecurityManager as specified. s.checkMemberAccess(this, which); } + this.checkPackageAccess(ccl, checkProxyInterfaces); + } + } + /* + * Checks if a client loaded in ClassLoader ccl is allowed to access this + * class under the current package access policy. If access is denied, + * throw a SecurityException. + */ + private void checkPackageAccess(final ClassLoader ccl, boolean checkProxyInterfaces) { + final SecurityManager s = System.getSecurityManager(); + if (s != null) { + final ClassLoader cl = getClassLoader0(); if (ReflectUtil.needsPackageAccessCheck(ccl, cl)) { String name = this.getName(); @@ -2266,7 +2360,7 @@ public final class Class implements java.io.Serializable, if (i != -1) { // skip the package access check on a proxy class in default proxy package String pkg = name.substring(0, i); - if (!Proxy.isProxyClass(this) || !pkg.equals(ReflectUtil.PROXY_PACKAGE)) { + if (!Proxy.isProxyClass(this) || ReflectUtil.isNonPublicProxyClass(this)) { s.checkPackageAccess(pkg); } } @@ -2321,6 +2415,8 @@ public final class Class implements java.io.Serializable, // Intermediate results for getFields and getMethods volatile Field[] declaredPublicFields; volatile Method[] declaredPublicMethods; + volatile Class[] interfaces; + // Value of classRedefinedCount when we created this ReflectionData instance final int redefinedCount; @@ -2396,10 +2492,10 @@ public final class Class implements java.io.Serializable, } // Generic signature handling - private native String getGenericSignature(); + private native String getGenericSignature0(); // Generic info repository; lazily initialized - private transient ClassRepository genericInfo; + private volatile transient ClassRepository genericInfo; // accessor for factory private GenericsFactory getFactory() { @@ -2407,15 +2503,20 @@ public final class Class implements java.io.Serializable, return CoreReflectionFactory.make(this, ClassScope.make(this)); } - // accessor for generic info repository + // accessor for generic info repository; + // generic info is lazily initialized private ClassRepository getGenericInfo() { - // lazily initialize repository if necessary + ClassRepository genericInfo = this.genericInfo; if (genericInfo == null) { - // create and cache generic info repository - genericInfo = ClassRepository.make(getGenericSignature(), - getFactory()); + String signature = getGenericSignature0(); + if (signature == null) { + genericInfo = ClassRepository.NONE; + } else { + genericInfo = ClassRepository.make(signature, getFactory()); + } + this.genericInfo = genericInfo; } - return genericInfo; //return cached repository + return (genericInfo != ClassRepository.NONE) ? genericInfo : null; } // Annotations handling @@ -3149,6 +3250,8 @@ public final class Class implements java.io.Serializable, * could not be checked at runtime (because generic types are implemented * by erasure). * + * @param the type to cast this class object to + * @param clazz the class of the type to cast this class object to * @return this {@code Class} object, cast to represent a subclass of * the specified class object. * @throws ClassCastException if this {@code Class} object does not @@ -3304,6 +3407,7 @@ public final class Class implements java.io.Serializable, * If this Class represents either the Object class, an interface type, an * array type, a primitive type, or void, the return value is null. * + * @return an object representing the superclass * @since 1.8 */ public AnnotatedType getAnnotatedSuperclass() { @@ -3335,6 +3439,7 @@ public final class Class implements java.io.Serializable, * If this Class represents either the Object class, an array type, a * primitive type, or void, the return value is an array of length 0. * + * @return an array representing the superinterfaces * @since 1.8 */ public AnnotatedType[] getAnnotatedInterfaces() { diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index 8d0205f54f1..f26eafd980a 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -702,7 +702,7 @@ public abstract class ClassLoader { * bootstrap class loader. If name is not null, it * must be equal to the binary name of the class * specified by the byte array "b", otherwise a {@link - * NoClassDefFoundError} will be thrown.

      + * NoClassDefFoundError NoClassDefFoundError} will be thrown.

      * * @param name * The expected binary name of the class, or diff --git a/jdk/src/share/classes/java/lang/Comparable.java b/jdk/src/share/classes/java/lang/Comparable.java index 123e10aa4da..9d607679a61 100644 --- a/jdk/src/share/classes/java/lang/Comparable.java +++ b/jdk/src/share/classes/java/lang/Comparable.java @@ -56,7 +56,7 @@ import java.util.*; * method.

      * * For example, if one adds two keys a and b such that - * (!a.equals(b) && a.compareTo(b) == 0) to a sorted + * {@code (!a.equals(b) && a.compareTo(b) == 0)} to a sorted * set that does not use an explicit comparator, the second add * operation returns false (and the size of the sorted set does not increase) * because a and b are equivalent from the sorted set's diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java index 9bdb0ca4679..113cdf81a4c 100644 --- a/jdk/src/share/classes/java/lang/Double.java +++ b/jdk/src/share/classes/java/lang/Double.java @@ -201,7 +201,7 @@ public final class Double extends Number implements Comparable { * @return a string representation of the argument. */ public static String toString(double d) { - return new FloatingDecimal(d).toJavaFormatString(); + return FloatingDecimal.toJavaFormatString(d); } /** @@ -453,8 +453,7 @@ public final class Double extends Number implements Comparable { * a {@code NumberFormatException} be thrown, the regular * expression below can be used to screen the input string: * - * - *

      +     * 
      {@code
            *  final String Digits     = "(\\p{Digit}+)";
            *  final String HexDigits  = "(\\p{XDigit}+)";
            *  // an exponent is 'e' or 'E' followed by an optionally
      @@ -474,7 +473,7 @@ public final class Double extends Number implements Comparable {
            *       // in addition to strings of floating-point literals, the
            *       // two sub-patterns below are simplifications of the grammar
            *       // productions from section 3.10.2 of
      -     *       // The Java™ Language Specification.
      +     *       // The Java Language Specification.
            *
            *       // Digits ._opt Digits_opt ExponentPart_opt FloatTypeSuffix_opt
            *       "((("+Digits+"(\\.)?("+Digits+"?)("+Exp+")?)|"+
      @@ -499,8 +498,7 @@ public final class Double extends Number implements Comparable {
            *  else {
            *      // Perform suitable alternative action
            *  }
      -     * 
      - *
      + * }
      * * @param s the string to be parsed. * @return a {@code Double} object holding the value @@ -509,7 +507,7 @@ public final class Double extends Number implements Comparable { * parsable number. */ public static Double valueOf(String s) throws NumberFormatException { - return new Double(FloatingDecimal.readJavaFormatString(s).doubleValue()); + return new Double(parseDouble(s)); } /** @@ -545,7 +543,7 @@ public final class Double extends Number implements Comparable { * @since 1.2 */ public static double parseDouble(String s) throws NumberFormatException { - return FloatingDecimal.readJavaFormatString(s).doubleValue(); + return FloatingDecimal.parseDouble(s); } /** @@ -756,9 +754,9 @@ public final class Double extends Number implements Comparable { * Returns a hash code for a {@code double} value; compatible with * {@code Double.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code double} value. + * @since 1.8 */ public static int hashCode(double value) { long bits = doubleToLongBits(value); @@ -917,13 +915,13 @@ public final class Double extends Number implements Comparable { *

      In all other cases, let s, e, and m be three * values that can be computed from the argument: * - *

      -     * int s = ((bits >> 63) == 0) ? 1 : -1;
      -     * int e = (int)((bits >> 52) & 0x7ffL);
      +     * 
      {@code
      +     * int s = ((bits >> 63) == 0) ? 1 : -1;
      +     * int e = (int)((bits >> 52) & 0x7ffL);
            * long m = (e == 0) ?
      -     *                 (bits & 0xfffffffffffffL) << 1 :
      +     *                 (bits & 0xfffffffffffffL) << 1 :
            *                 (bits & 0xfffffffffffffL) | 0x10000000000000L;
      -     * 
      + * }
      * * Then the floating-point result equals the value of the mathematical * expression s·m·2e-1075. diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java index bdb8f63fbf1..2f2b6b22444 100644 --- a/jdk/src/share/classes/java/lang/Float.java +++ b/jdk/src/share/classes/java/lang/Float.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,7 +203,7 @@ public final class Float extends Number implements Comparable { * @return a string representation of the argument. */ public static String toString(float f) { - return new FloatingDecimal(f).toJavaFormatString(); + return FloatingDecimal.toJavaFormatString(f); } /** @@ -421,7 +421,7 @@ public final class Float extends Number implements Comparable { * parsable number. */ public static Float valueOf(String s) throws NumberFormatException { - return new Float(FloatingDecimal.readJavaFormatString(s).floatValue()); + return new Float(parseFloat(s)); } /** @@ -456,7 +456,7 @@ public final class Float extends Number implements Comparable { * @since 1.2 */ public static float parseFloat(String s) throws NumberFormatException { - return FloatingDecimal.readJavaFormatString(s).floatValue(); + return FloatingDecimal.parseFloat(s); } /** @@ -664,9 +664,9 @@ public final class Float extends Number implements Comparable { * Returns a hash code for a {@code float} value; compatible with * {@code Float.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code float} value. + * @since 1.8 */ public static int hashCode(float value) { return floatToIntBits(value); @@ -821,13 +821,13 @@ public final class Float extends Number implements Comparable { *

      In all other cases, let s, e, and m be three * values that can be computed from the argument: * - *

      -     * int s = ((bits >> 31) == 0) ? 1 : -1;
      -     * int e = ((bits >> 23) & 0xff);
      +     * 
      {@code
      +     * int s = ((bits >> 31) == 0) ? 1 : -1;
      +     * int e = ((bits >> 23) & 0xff);
            * int m = (e == 0) ?
      -     *                 (bits & 0x7fffff) << 1 :
      +     *                 (bits & 0x7fffff) << 1 :
            *                 (bits & 0x7fffff) | 0x800000;
      -     * 
      + * }
      * * Then the floating-point result equals the value of the mathematical * expression s·m·2e-150. diff --git a/jdk/src/share/classes/java/lang/Integer.java b/jdk/src/share/classes/java/lang/Integer.java index e5de967a069..7ee4b48855e 100644 --- a/jdk/src/share/classes/java/lang/Integer.java +++ b/jdk/src/share/classes/java/lang/Integer.java @@ -788,10 +788,14 @@ public final class Integer extends Number implements Comparable { String integerCacheHighPropValue = sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high"); if (integerCacheHighPropValue != null) { - int i = parseInt(integerCacheHighPropValue); - i = Math.max(i, 127); - // Maximum array size is Integer.MAX_VALUE - h = Math.min(i, Integer.MAX_VALUE - (-low) -1); + try { + int i = parseInt(integerCacheHighPropValue); + i = Math.max(i, 127); + // Maximum array size is Integer.MAX_VALUE + h = Math.min(i, Integer.MAX_VALUE - (-low) -1); + } catch( NumberFormatException nfe) { + // If the property cannot be parsed into an int, ignore it. + } } high = h; @@ -947,6 +951,7 @@ public final class Integer extends Number implements Comparable { * Returns a hash code for a {@code int} value; compatible with * {@code Integer.hashCode()}. * + * @param value the value to hash * @since 1.8 * * @return a hash code value for a {@code int} value. @@ -1332,6 +1337,7 @@ public final class Integer extends Number implements Comparable { * one-bits in its two's complement binary representation, that is, if it * is equal to zero. * + * @param i the value whose highest one bit is to be computed * @return an {@code int} value with a single one-bit, in the position * of the highest-order one-bit in the specified value, or zero if * the specified value is itself equal to zero. @@ -1354,6 +1360,7 @@ public final class Integer extends Number implements Comparable { * one-bits in its two's complement binary representation, that is, if it * is equal to zero. * + * @param i the value whose lowest one bit is to be computed * @return an {@code int} value with a single one-bit, in the position * of the lowest-order one-bit in the specified value, or zero if * the specified value is itself equal to zero. @@ -1378,6 +1385,7 @@ public final class Integer extends Number implements Comparable { *
    • ceil(log2(x)) = {@code 32 - numberOfLeadingZeros(x - 1)} *
    * + * @param i the value whose number of leading zeros is to be computed * @return the number of zero bits preceding the highest-order * ("leftmost") one-bit in the two's complement binary representation * of the specified {@code int} value, or 32 if the value @@ -1404,6 +1412,7 @@ public final class Integer extends Number implements Comparable { * one-bits in its two's complement representation, in other words if it is * equal to zero. * + * @param i the value whose number of trailing zeros is to be computed * @return the number of zero bits following the lowest-order ("rightmost") * one-bit in the two's complement binary representation of the * specified {@code int} value, or 32 if the value is equal @@ -1427,6 +1436,7 @@ public final class Integer extends Number implements Comparable { * representation of the specified {@code int} value. This function is * sometimes referred to as the population count. * + * @param i the value whose bits are to be counted * @return the number of one-bits in the two's complement binary * representation of the specified {@code int} value. * @since 1.5 @@ -1454,6 +1464,8 @@ public final class Integer extends Number implements Comparable { * ignored, even if the distance is negative: {@code rotateLeft(val, * distance) == rotateLeft(val, distance & 0x1F)}. * + * @param i the value whose bits are to be rotated left + * @param distance the number of bit positions to rotate left * @return the value obtained by rotating the two's complement binary * representation of the specified {@code int} value left by the * specified number of bits. @@ -1476,6 +1488,8 @@ public final class Integer extends Number implements Comparable { * ignored, even if the distance is negative: {@code rotateRight(val, * distance) == rotateRight(val, distance & 0x1F)}. * + * @param i the value whose bits are to be rotated right + * @param distance the number of bit positions to rotate right * @return the value obtained by rotating the two's complement binary * representation of the specified {@code int} value right by the * specified number of bits. @@ -1490,6 +1504,7 @@ public final class Integer extends Number implements Comparable { * two's complement binary representation of the specified {@code int} * value. * + * @param i the value to be reversed * @return the value obtained by reversing order of the bits in the * specified {@code int} value. * @since 1.5 @@ -1509,6 +1524,7 @@ public final class Integer extends Number implements Comparable { * return value is -1 if the specified value is negative; 0 if the * specified value is zero; and 1 if the specified value is positive.) * + * @param i the value whose signum is to be computed * @return the signum function of the specified {@code int} value. * @since 1.5 */ @@ -1521,6 +1537,7 @@ public final class Integer extends Number implements Comparable { * Returns the value obtained by reversing the order of the bytes in the * two's complement representation of the specified {@code int} value. * + * @param i the value whose bytes are to be reversed * @return the value obtained by reversing the bytes in the specified * {@code int} value. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java index 80967aca5de..bfaf0c4412f 100644 --- a/jdk/src/share/classes/java/lang/Long.java +++ b/jdk/src/share/classes/java/lang/Long.java @@ -1053,9 +1053,9 @@ public final class Long extends Number implements Comparable { * Returns a hash code for a {@code long} value; compatible with * {@code Long.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code long} value. + * @since 1.8 */ public static int hashCode(long value) { return (int)(value ^ (value >>> 32)); @@ -1357,6 +1357,7 @@ public final class Long extends Number implements Comparable { * one-bits in its two's complement binary representation, that is, if it * is equal to zero. * + * @param i the value whose highest one bit is to be computed * @return a {@code long} value with a single one-bit, in the position * of the highest-order one-bit in the specified value, or zero if * the specified value is itself equal to zero. @@ -1380,6 +1381,7 @@ public final class Long extends Number implements Comparable { * one-bits in its two's complement binary representation, that is, if it * is equal to zero. * + * @param i the value whose lowest one bit is to be computed * @return a {@code long} value with a single one-bit, in the position * of the lowest-order one-bit in the specified value, or zero if * the specified value is itself equal to zero. @@ -1404,6 +1406,7 @@ public final class Long extends Number implements Comparable { *
  • ceil(log2(x)) = {@code 64 - numberOfLeadingZeros(x - 1)} * * + * @param i the value whose number of leading zeros is to be computed * @return the number of zero bits preceding the highest-order * ("leftmost") one-bit in the two's complement binary representation * of the specified {@code long} value, or 64 if the value @@ -1432,6 +1435,7 @@ public final class Long extends Number implements Comparable { * one-bits in its two's complement representation, in other words if it is * equal to zero. * + * @param i the value whose number of trailing zeros is to be computed * @return the number of zero bits following the lowest-order ("rightmost") * one-bit in the two's complement binary representation of the * specified {@code long} value, or 64 if the value is equal @@ -1456,6 +1460,7 @@ public final class Long extends Number implements Comparable { * representation of the specified {@code long} value. This function is * sometimes referred to as the population count. * + * @param i the value whose bits are to be counted * @return the number of one-bits in the two's complement binary * representation of the specified {@code long} value. * @since 1.5 @@ -1484,6 +1489,8 @@ public final class Long extends Number implements Comparable { * ignored, even if the distance is negative: {@code rotateLeft(val, * distance) == rotateLeft(val, distance & 0x3F)}. * + * @param i the value whose bits are to be rotated left + * @param distance the number of bit positions to rotate left * @return the value obtained by rotating the two's complement binary * representation of the specified {@code long} value left by the * specified number of bits. @@ -1506,6 +1513,8 @@ public final class Long extends Number implements Comparable { * ignored, even if the distance is negative: {@code rotateRight(val, * distance) == rotateRight(val, distance & 0x3F)}. * + * @param i the value whose bits are to be rotated right + * @param distance the number of bit positions to rotate right * @return the value obtained by rotating the two's complement binary * representation of the specified {@code long} value right by the * specified number of bits. @@ -1520,6 +1529,7 @@ public final class Long extends Number implements Comparable { * two's complement binary representation of the specified {@code long} * value. * + * @param i the value to be reversed * @return the value obtained by reversing order of the bits in the * specified {@code long} value. * @since 1.5 @@ -1540,6 +1550,7 @@ public final class Long extends Number implements Comparable { * return value is -1 if the specified value is negative; 0 if the * specified value is zero; and 1 if the specified value is positive.) * + * @param i the value whose signum is to be computed * @return the signum function of the specified {@code long} value. * @since 1.5 */ @@ -1552,6 +1563,7 @@ public final class Long extends Number implements Comparable { * Returns the value obtained by reversing the order of the bytes in the * two's complement representation of the specified {@code long} value. * + * @param i the value whose bytes are to be reversed * @return the value obtained by reversing the bytes in the specified * {@code long} value. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/Package.java b/jdk/src/share/classes/java/lang/Package.java index d22e3ece462..e55d72bc038 100644 --- a/jdk/src/share/classes/java/lang/Package.java +++ b/jdk/src/share/classes/java/lang/Package.java @@ -77,18 +77,18 @@ import java.lang.annotation.Annotation; * by the following formal grammar: *
    *
    - *
    SpecificationVersion: - *
    Digits RefinedVersionopt + *
    SpecificationVersion: + *
    Digits RefinedVersionopt - *

    RefinedVersion: + *
    RefinedVersion: *
    {@code .} Digits *
    {@code .} Digits RefinedVersion * - *

    Digits: - *
    Digit - *
    Digits + *
    Digits: + *
    Digit + *
    Digits * - *

    Digit: + *
    Digit: *
    any character for which {@link Character#isDigit} returns {@code true}, * e.g. 0, 1, 2, ... *
    diff --git a/jdk/src/share/classes/java/lang/Runtime.java b/jdk/src/share/classes/java/lang/Runtime.java index 6275e2859d0..5ff1aac0bce 100644 --- a/jdk/src/share/classes/java/lang/Runtime.java +++ b/jdk/src/share/classes/java/lang/Runtime.java @@ -117,11 +117,11 @@ public class Runtime { * *
      * - *

    • The program exits normally, when the last non-daemon + *
    • The program exits normally, when the last non-daemon * thread exits or when the {@link #exit exit} (equivalently, - * {@link System#exit(int) System.exit}) method is invoked, or + * {@link System#exit(int) System.exit}) method is invoked, or * - *

    • The virtual machine is terminated in response to a + *
    • The virtual machine is terminated in response to a * user interrupt, such as typing ^C, or a system-wide event, * such as user logoff or system shutdown. * diff --git a/jdk/src/share/classes/java/lang/Short.java b/jdk/src/share/classes/java/lang/Short.java index 6042b13f905..c7641807c56 100644 --- a/jdk/src/share/classes/java/lang/Short.java +++ b/jdk/src/share/classes/java/lang/Short.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -403,9 +403,9 @@ public final class Short extends Number implements Comparable { * Returns a hash code for a {@code short} value; compatible with * {@code Short.hashCode()}. * - * @since 1.8 - * + * @param value the value to hash * @return a hash code value for a {@code short} value. + * @since 1.8 */ public static int hashCode(short value) { return (int)value; @@ -482,6 +482,7 @@ public final class Short extends Number implements Comparable { * Returns the value obtained by reversing the order of the bytes in the * two's complement representation of the specified {@code short} value. * + * @param i the value whose bytes are to be reversed * @return the value obtained by reversing (or, equivalently, swapping) * the bytes in the specified {@code short} value. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/StackTraceElement.java b/jdk/src/share/classes/java/lang/StackTraceElement.java index b973d0f4293..4543749bb00 100644 --- a/jdk/src/share/classes/java/lang/StackTraceElement.java +++ b/jdk/src/share/classes/java/lang/StackTraceElement.java @@ -181,12 +181,12 @@ public final class StackTraceElement implements java.io.Serializable { * {@code StackTraceElement} instance representing the same execution * point as this instance. Two stack trace elements {@code a} and * {@code b} are equal if and only if: - *
      +     * 
      {@code
            *     equals(a.getFileName(), b.getFileName()) &&
            *     a.getLineNumber() == b.getLineNumber()) &&
            *     equals(a.getClassName(), b.getClassName()) &&
            *     equals(a.getMethodName(), b.getMethodName())
      -     * 
      + * }
      * where {@code equals} has the semantics of {@link * java.util.Objects#equals(Object, Object) Objects.equals}. * diff --git a/jdk/src/share/classes/java/lang/StrictMath.java b/jdk/src/share/classes/java/lang/StrictMath.java index e59c8d07781..eb202d53202 100644 --- a/jdk/src/share/classes/java/lang/StrictMath.java +++ b/jdk/src/share/classes/java/lang/StrictMath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1419,6 +1419,7 @@ public final class StrictMath { * {@link Float#MIN_EXPONENT} -1. *
    * @param f a {@code float} value + * @return the unbiased exponent of the argument * @since 1.6 */ public static int getExponent(float f) { @@ -1436,6 +1437,7 @@ public final class StrictMath { * {@link Double#MIN_EXPONENT} -1. * * @param d a {@code double} value + * @return the unbiased exponent of the argument * @since 1.6 */ public static int getExponent(double d) { diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java index 748c8a4bbef..651a85017ed 100644 --- a/jdk/src/share/classes/java/lang/String.java +++ b/jdk/src/share/classes/java/lang/String.java @@ -3156,101 +3156,4 @@ public final class String * guaranteed to be from a pool of unique strings. */ public native String intern(); - - /** - * Seed value used for each alternative hash calculated. - */ - private static final int HASHING_SEED; - - static { - long nanos = System.nanoTime(); - long now = System.currentTimeMillis(); - int SEED_MATERIAL[] = { - System.identityHashCode(String.class), - System.identityHashCode(System.class), - (int) (nanos >>> 32), - (int) nanos, - (int) (now >>> 32), - (int) now, - (int) (System.nanoTime() >>> 2) - }; - - // Use murmur3 to scramble the seeding material. - // Inline implementation to avoid loading classes - int h1 = 0; - - // body - for(int k1 : SEED_MATERIAL) { - k1 *= 0xcc9e2d51; - k1 = (k1 << 15) | (k1 >>> 17); - k1 *= 0x1b873593; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); - h1 = h1 * 5 + 0xe6546b64; - } - - // tail (always empty, as body is always 32-bit chunks) - - // finalization - - h1 ^= SEED_MATERIAL.length * 4; - - // finalization mix force all bits of a hash block to avalanche - h1 ^= h1 >>> 16; - h1 *= 0x85ebca6b; - h1 ^= h1 >>> 13; - h1 *= 0xc2b2ae35; - h1 ^= h1 >>> 16; - - HASHING_SEED = h1; - } - - /** - * Cached value of the hashing algorithm result - */ - private transient int hash32 = 0; - - /** - * Return a 32-bit hash code value for this object. - *

    - * The general contract of {@code hash32} is: - *

      - *
    • Whenever it is invoked on the same object more than once during - * an execution of a Java application, the {@code hash32} method - * must consistently return the same integer, provided no information - * used in {@code equals} comparisons on the object is modified. - * This integer need not remain consistent from one execution of an - * application to another execution of the same application. - *
    • If two objects are equal according to the {@code equals(Object)} - * method, then calling the {@code hash32} method on each of - * the two objects must produce the same integer result. - *
    • It is not required that if two objects are unequal - * according to the {@link java.lang.Object#equals(java.lang.Object)} - * method, then calling the {@code hash32} method on each of the - * two objects must produce distinct integer results. However, the - * programmer should be aware that producing distinct integer results - * for unequal objects may improve the performance of hash tables. - *
    - * - * The hash value will never be zero. - * - * @return a hash code value for this object. - * @see java.lang.Object#equals(java.lang.Object) - */ - public int hash32() { - int h = hash32; - if (0 == h) { - // harmless data race on hash32 here. - h = sun.misc.Hashing.murmur3_32(HASHING_SEED, value, 0, value.length); - - // ensure result is not zero to avoid recalcing - h = (0 != h) ? h : 1; - - hash32 = h; - } - - return h; - } - } diff --git a/jdk/src/share/classes/java/lang/SuppressWarnings.java b/jdk/src/share/classes/java/lang/SuppressWarnings.java index 22895dc7b2c..d315ddb7881 100644 --- a/jdk/src/share/classes/java/lang/SuppressWarnings.java +++ b/jdk/src/share/classes/java/lang/SuppressWarnings.java @@ -66,6 +66,7 @@ public @interface SuppressWarnings { * additional warning names they support in conjunction with this * annotation type. They are encouraged to cooperate to ensure * that the same names work across multiple compilers. + * @return the set of warnings to be suppressed */ String[] value(); } diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index bd72188c6b0..52a5e0de823 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -634,6 +634,8 @@ public final class System { * *

    On UNIX systems, it returns {@code "\n"}; on Microsoft * Windows systems it returns {@code "\r\n"}. + * + * @return the system-dependent line separator string * @since 1.7 */ public static String lineSeparator() { diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index 81bebc58b21..eb89670d149 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -812,68 +812,10 @@ class Thread implements Runnable { */ @Deprecated public final void stop() { - stop(new ThreadDeath()); - } - - /** - * Forces the thread to stop executing. - *

    - * If there is a security manager installed, the checkAccess - * method of this thread is called, which may result in a - * SecurityException being raised (in the current thread). - *

    - * If this thread is different from the current thread (that is, the current - * thread is trying to stop a thread other than itself) or - * obj is not an instance of ThreadDeath, the - * security manager's checkPermission method (with the - * RuntimePermission("stopThread") argument) is called in - * addition. - * Again, this may result in throwing a - * SecurityException (in the current thread). - *

    - * If the argument obj is null, a - * NullPointerException is thrown (in the current thread). - *

    - * The thread represented by this thread is forced to stop - * whatever it is doing abnormally and to throw the - * Throwable object obj as an exception. This - * is an unusual action to take; normally, the stop method - * that takes no arguments should be used. - *

    - * It is permitted to stop a thread that has not yet been started. - * If the thread is eventually started, it immediately terminates. - * - * @param obj the Throwable object to be thrown. - * @exception SecurityException if the current thread cannot modify - * this thread. - * @throws NullPointerException if obj is null. - * @see #interrupt() - * @see #checkAccess() - * @see #run() - * @see #start() - * @see #stop() - * @see SecurityManager#checkAccess(Thread) - * @see SecurityManager#checkPermission - * @deprecated This method is inherently unsafe. See {@link #stop()} - * for details. An additional danger of this - * method is that it may be used to generate exceptions that the - * target thread is unprepared to handle (including checked - * exceptions that the thread could not possibly throw, were it - * not for this method). - * For more information, see - * Why - * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. - */ - @Deprecated - public final synchronized void stop(Throwable obj) { - if (obj == null) - throw new NullPointerException(); - SecurityManager security = System.getSecurityManager(); if (security != null) { checkAccess(); - if ((this != Thread.currentThread()) || - (!(obj instanceof ThreadDeath))) { + if (this != Thread.currentThread()) { security.checkPermission(SecurityConstants.STOP_THREAD_PERMISSION); } } @@ -884,7 +826,26 @@ class Thread implements Runnable { } // The VM can handle all thread states - stop0(obj); + stop0(new ThreadDeath()); + } + + /** + * Throws {@code UnsupportedOperationException}. + * + * @param obj ignored + * + * @deprecated This method was originally designed to force a thread to stop + * and throw a given {@code Throwable} as an exception. It was + * inherently unsafe (see {@link #stop()} for details), and furthermore + * could be used to generate exceptions that the target thread was + * not prepared to handle. + * For more information, see + * Why + * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. + */ + @Deprecated + public final synchronized void stop(Throwable obj) { + throw new UnsupportedOperationException(); } /** @@ -2032,12 +1993,21 @@ class Thread implements Runnable { // The following three initially uninitialized fields are exclusively - // managed by class java.util.concurrent.ThreadLocalRandom. + // managed by class java.util.concurrent.ThreadLocalRandom. These + // fields are used to build the high-performance PRNGs in the + // concurrent code, and we can not risk accidental false sharing. + // Hence, the fields are isolated with @Contended. + /** The current seed for a ThreadLocalRandom */ + @sun.misc.Contended("tlr") long threadLocalRandomSeed; + /** Probe hash value; nonzero if threadLocalRandomSeed initialized */ + @sun.misc.Contended("tlr") int threadLocalRandomProbe; + /** Secondary seed isolated from public ThreadLocalRandom sequence */ + @sun.misc.Contended("tlr") int threadLocalRandomSecondarySeed; /* Some private helper methods */ diff --git a/jdk/src/share/classes/java/lang/annotation/Annotation.java b/jdk/src/share/classes/java/lang/annotation/Annotation.java index 538d45a2265..bea407be8eb 100644 --- a/jdk/src/share/classes/java/lang/annotation/Annotation.java +++ b/jdk/src/share/classes/java/lang/annotation/Annotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,6 +126,7 @@ public interface Annotation { /** * Returns the annotation type of this annotation. + * @return the annotation type of this annotation */ Class annotationType(); } diff --git a/jdk/src/share/classes/java/lang/annotation/IncompleteAnnotationException.java b/jdk/src/share/classes/java/lang/annotation/IncompleteAnnotationException.java index dcd4f2a34c5..1f11b72bc15 100644 --- a/jdk/src/share/classes/java/lang/annotation/IncompleteAnnotationException.java +++ b/jdk/src/share/classes/java/lang/annotation/IncompleteAnnotationException.java @@ -55,8 +55,7 @@ public class IncompleteAnnotationException extends RuntimeException { public IncompleteAnnotationException( Class annotationType, String elementName) { - super(annotationType.getName().toString() + - " missing element " + + super(annotationType.getName() + " missing element " + elementName.toString()); this.annotationType = annotationType; diff --git a/jdk/src/share/classes/java/lang/annotation/Repeatable.java b/jdk/src/share/classes/java/lang/annotation/Repeatable.java index 570ed0fa5da..7a2daa82278 100644 --- a/jdk/src/share/classes/java/lang/annotation/Repeatable.java +++ b/jdk/src/share/classes/java/lang/annotation/Repeatable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,7 @@ public @interface Repeatable { /** * Indicates the containing annotation type for the * repeatable annotation type. + * @return the containing annotation type */ Class value(); } diff --git a/jdk/src/share/classes/java/lang/annotation/Retention.java b/jdk/src/share/classes/java/lang/annotation/Retention.java index 1c27ca0871e..5efa43ff05c 100644 --- a/jdk/src/share/classes/java/lang/annotation/Retention.java +++ b/jdk/src/share/classes/java/lang/annotation/Retention.java @@ -44,5 +44,9 @@ package java.lang.annotation; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Retention { + /** + * Returns the retention policy. + * @return the retention policy + */ RetentionPolicy value(); } diff --git a/jdk/src/share/classes/java/lang/annotation/Target.java b/jdk/src/share/classes/java/lang/annotation/Target.java index cdf4a748ae5..1ceec380680 100644 --- a/jdk/src/share/classes/java/lang/annotation/Target.java +++ b/jdk/src/share/classes/java/lang/annotation/Target.java @@ -67,5 +67,11 @@ package java.lang.annotation; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Target { + /** + * Returns an array of the kinds of elements an annotation type + * can be applied to. + * @return an array of the kinds of elements an annotation type + * can be applied to + */ ElementType[] value(); } diff --git a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java index 3d2083d6c61..4cdb2de9c9a 100644 --- a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java +++ b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -363,6 +363,8 @@ public interface Instrumentation { * Primitive classes (for example, java.lang.Integer.TYPE) * and array classes are never modifiable. * + * @param theClass the class to check for being modifiable + * @return whether or not the argument class is modifiable * @throws java.lang.NullPointerException if the specified class is null. * * @see #retransformClasses @@ -549,14 +551,14 @@ public interface Instrumentation { * {@link java.lang.instrument.ClassFileTransformer ClassFileTransformer}, * it enables native methods to be * instrumented. - *

    + *

    * Since native methods cannot be directly instrumented * (they have no bytecodes), they must be wrapped with * a non-native method which can be instrumented. * For example, if we had: *

          *   native boolean foo(int x);
    - *

    + *

    * We could transform the class file (with the * ClassFileTransformer during the initial definition * of the class) so that this becomes: @@ -567,14 +569,14 @@ public interface Instrumentation { * } * * native boolean wrapped_foo(int x); - *

    + *

    * Where foo becomes a wrapper for the actual native * method with the appended prefix "wrapped_". Note that * "wrapped_" would be a poor choice of prefix since it * might conceivably form the name of an existing method * thus something like "$$$MyAgentWrapped$$$_" would be * better but would make these examples less readable. - *

    + *

    * The wrapper will allow data to be collected on the native * method call, but now the problem becomes linking up the * wrapped method with the native implementation. @@ -583,7 +585,7 @@ public interface Instrumentation { * which might be: *

          *   Java_somePackage_someClass_foo(JNIEnv* env, jint x)
    - *

    + *

    * This function allows the prefix to be specified and the * proper resolution to occur. * Specifically, when the standard resolution fails, the @@ -593,28 +595,32 @@ public interface Instrumentation { * and the normal automatic resolution. For * RegisterNatives, the JVM will attempt this * association: - *

    -     *   method(foo) -> nativeImplementation(foo)
    - *

    + *

    {@code
    +     *   method(foo) -> nativeImplementation(foo)
    +     * }
    + *

    * When this fails, the resolution will be retried with * the specified prefix prepended to the method name, * yielding the correct resolution: - *

    -     *   method(wrapped_foo) -> nativeImplementation(foo)
    - *

    + *

    {@code
    +     *   method(wrapped_foo) -> nativeImplementation(foo)
    +     * }
    + *

    * For automatic resolution, the JVM will attempt: - *

    -     *   method(wrapped_foo) -> nativeImplementation(wrapped_foo)
    - *

    + *

    {@code
    +     *   method(wrapped_foo) -> nativeImplementation(wrapped_foo)
    +     * }
    + *

    * When this fails, the resolution will be retried with * the specified prefix deleted from the implementation name, * yielding the correct resolution: - *

    -     *   method(wrapped_foo) -> nativeImplementation(foo)
    - *

    + *

    {@code
    +     *   method(wrapped_foo) -> nativeImplementation(foo)
    +     * }
    + *

    * Note that since the prefix is only used when standard * resolution fails, native methods can be wrapped selectively. - *

    + *

    * Since each ClassFileTransformer * can do its own transformation of the bytecodes, more * than one layer of wrappers may be applied. Thus each diff --git a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 16703fc0917..0b6f4016b1d 100644 --- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -112,7 +112,9 @@ import java.security.PrivilegedAction; implMethodDesc = implMethodType.toMethodDescriptorString(); Type implMethodAsmType = Type.getMethodType(implMethodDesc); implMethodArgumentTypes = implMethodAsmType.getArgumentTypes(); - implMethodReturnType = implMethodAsmType.getReturnType(); + implMethodReturnType = (implKind == MethodHandleInfo.REF_newInvokeSpecial) + ? Type.getObjectType(implMethodClassName) + : implMethodAsmType.getReturnType(); constructorType = invokedType.changeReturnType(Void.TYPE); constructorDesc = constructorType.toMethodDescriptorString(); lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet(); diff --git a/jdk/src/share/classes/java/lang/invoke/LambdaConversionException.java b/jdk/src/share/classes/java/lang/invoke/LambdaConversionException.java index 11ffb580ea9..5cc3c626e36 100644 --- a/jdk/src/share/classes/java/lang/invoke/LambdaConversionException.java +++ b/jdk/src/share/classes/java/lang/invoke/LambdaConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,21 +29,45 @@ package java.lang.invoke; * LambdaConversionException */ public class LambdaConversionException extends Exception { + /** + * Constructs a {@code LambdaConversionException}. + */ public LambdaConversionException() { } + /** + * Constructs a {@code LambdaConversionException} with a message. + * @param message the detail message + */ public LambdaConversionException(String message) { super(message); } + /** + * Constructs a {@code LambdaConversionException} with a message and cause. + * @param message the detail message + * @param cause the cause + */ public LambdaConversionException(String message, Throwable cause) { super(message, cause); } + /** + * Constructs a {@code LambdaConversionException} with a cause. + * @param cause the cause + */ public LambdaConversionException(Throwable cause) { super(cause); } + /** + * Constructs a {@code LambdaConversionException} with a message, + * cause, and other settings. + * @param message the detail message + * @param cause the cause + * @param enableSuppression whether or not suppressed exceptions are enabled + * @param writableStackTrace whether or not the stack trace is writable + */ public LambdaConversionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } diff --git a/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java index d179d438e8a..e03dda002d1 100644 --- a/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java @@ -111,7 +111,7 @@ package java.lang.invoke; * done on return type, while a strict version is applied to arguments. * *

    A type Q is considered adaptable to S as follows: - * + *
    * * * @@ -155,7 +155,7 @@ public class LambdaMetafactory { private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; -/** + /** * Standard meta-factory for conversion of lambda expressions or method references to functional interfaces. * * @param caller Stacked automatically by VM; represents a lookup context with the accessibility privileges @@ -174,7 +174,7 @@ public class LambdaMetafactory { * @param instantiatedMethodType The signature of the primary functional interface method after type variables * are substituted with their instantiation from the capture site * @return a CallSite, which, when invoked, will return an instance of the functional interface - * @throws ReflectiveOperationException + * @throws ReflectiveOperationException if the caller is not able to reconstruct one of the method handles * @throws LambdaConversionException If any of the meta-factory protocol invariants are violated */ public static CallSite metaFactory(MethodHandles.Lookup caller, @@ -226,7 +226,7 @@ public class LambdaMetafactory { * the first argument in the invocation signature will correspond to the receiver. * @param args argument to pass, flags, marker interface count, and marker interfaces as described above * @return a CallSite, which, when invoked, will return an instance of the functional interface - * @throws ReflectiveOperationException + * @throws ReflectiveOperationException if the caller is not able to reconstruct one of the method handles * @throws LambdaConversionException If any of the meta-factory protocol invariants are violated */ public static CallSite altMetaFactory(MethodHandles.Lookup caller, diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java index 774faff5afb..df784d35e5b 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java @@ -44,7 +44,7 @@ import java.util.logging.Logger; * {@linkplain java.lang.invoke.MethodHandles#dropArguments deletion}, * and {@linkplain java.lang.invoke.MethodHandles#filterArguments substitution}. * - *

    Method handle contents

    + *

    Method handle contents

    * Method handles are dynamically and strongly typed according to their parameter and return types. * They are not distinguished by the name or the defining class of their underlying methods. * A method handle must be invoked using a symbolic type descriptor which matches @@ -81,7 +81,7 @@ import java.util.logging.Logger; * from its specific class, as the method handle class hierarchy (if any) * may change from time to time or across implementations from different vendors. * - *

    Method handle compilation

    + *

    Method handle compilation

    * A Java method call expression naming {@code invokeExact} or {@code invoke} * can invoke a method handle from Java source code. * From the viewpoint of source code, these methods can take any arguments @@ -111,7 +111,7 @@ import java.util.logging.Logger; * The ambiguity with the type {@code Void} is harmless, since there are no references of type * {@code Void} except the null reference. * - *

    Method handle invocation

    + *

    Method handle invocation

    * The first time a {@code invokevirtual} instruction is executed * it is linked, by symbolically resolving the names in the instruction * and verifying that the method call is statically legal. @@ -154,7 +154,7 @@ import java.util.logging.Logger; * (Note: The adjusted method handle {@code M2} is not directly observable, * and implementations are therefore not required to materialize it.) * - *

    Invocation checking

    + *

    Invocation checking

    * In typical programs, method handle type matching will usually succeed. * But if a match fails, the JVM will throw a {@link WrongMethodTypeException}, * either directly (in the case of {@code invokeExact}) or indirectly as if @@ -195,7 +195,7 @@ import java.util.logging.Logger; * They should not be passed to untrusted code unless their use from * the untrusted code would be harmless. * - *

    Method handle creation

    + *

    Method handle creation

    * Java code can create a method handle that directly accesses * any method, constructor, or field that is accessible to that code. * This is done via a reflective, capability-based API called @@ -249,9 +249,9 @@ import java.util.logging.Logger; * receiver type. Such a method handle simulates the effect of * an {@code invokespecial} instruction to the same method. * - *

    Usage examples

    + *

    Usage examples

    * Here are some examples of usage: - *

    + * 

    {@code
     Object x, y; String s; int i;
     MethodType mt; MethodHandle mh;
     MethodHandles.Lookup lookup = MethodHandles.lookup();
    @@ -287,7 +287,7 @@ mt = MethodType.methodType(void.class, String.class);
     mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
     mh.invokeExact(System.out, "Hello, world.");
     // invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
    - * 
    + * }
    * Each of the above calls to {@code invokeExact} or plain {@code invoke} * generates a single invokevirtual instruction with * the symbolic type descriptor indicated in the following comment. @@ -295,7 +295,7 @@ mh.invokeExact(System.out, "Hello, world."); * be a method which calls {@link java.util.Objects#equals(Object,Object) Objects.equals } * on its arguments, and asserts that the result is true. * - *

    Exceptions

    + *

    Exceptions

    * The methods {@code invokeExact} and {@code invoke} are declared * to throw {@link java.lang.Throwable Throwable}, * which is to say that there is no static restriction on what a method handle @@ -308,7 +308,7 @@ mh.invokeExact(System.out, "Hello, world."); * throwables locally, rethrowing only those which are legal in the context, * and wrapping ones which are illegal. * - *

    Signature polymorphism

    + *

    Signature polymorphism

    * The unusual compilation and linkage behavior of * {@code invokeExact} and plain {@code invoke} * is referenced by the term signature polymorphism. @@ -333,7 +333,7 @@ mh.invokeExact(System.out, "Hello, world."); * Tools which determine symbolic linkage are required to accept such * untransformed descriptors, without reporting linkage errors. * - *

    Interoperation between method handles and the Core Reflection API

    + *

    Interoperation between method handles and the Core Reflection API

    * Using factory methods in the {@link java.lang.invoke.MethodHandles.Lookup Lookup} API, * any class member represented by a Core Reflection API object * can be converted to a behaviorally equivalent method handle. @@ -375,7 +375,7 @@ mh.invokeExact(System.out, "Hello, world."); * to call {@code invokeExact} or plain {@code invoke}, * for any specified type descriptor . * - *

    Interoperation between method handles and Java generics

    + *

    Interoperation between method handles and Java generics

    * A method handle can be obtained on a method, constructor, or field * which is declared with Java generic types. * As with the Core Reflection API, the type of the method handle @@ -457,6 +457,8 @@ public abstract class MethodHandle { * {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI, * or indirectly via {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}, * it will throw an {@code UnsupportedOperationException}. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} * @throws WrongMethodTypeException if the target's type is not identical with the caller's symbolic type descriptor * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call */ @@ -491,6 +493,8 @@ public abstract class MethodHandle { * {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI, * or indirectly via {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}, * it will throw an {@code UnsupportedOperationException}. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} * @throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's symbolic type descriptor * @throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call @@ -511,15 +515,26 @@ public abstract class MethodHandle { * operations on outgoing argument values.) * The caller can assume that the incoming result value is part of the range * of the callee's return type. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} */ /*non-public*/ final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable; + /** + * Private method for trusted invocation of a MemberName of kind {@code REF_invokeVirtual}. + * The caller signature is restricted to basic types as with {@code invokeBasic}. + * The trailing (not leading) argument must be a MemberName. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} + */ /*non-public*/ static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable; /** * Private method for trusted invocation of a MemberName of kind {@code REF_invokeStatic}. * The caller signature is restricted to basic types as with {@code invokeBasic}. * The trailing (not leading) argument must be a MemberName. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} */ /*non-public*/ static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable; @@ -527,6 +542,8 @@ public abstract class MethodHandle { * Private method for trusted invocation of a MemberName of kind {@code REF_invokeSpecial}. * The caller signature is restricted to basic types as with {@code invokeBasic}. * The trailing (not leading) argument must be a MemberName. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} */ /*non-public*/ static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable; @@ -534,6 +551,8 @@ public abstract class MethodHandle { * Private method for trusted invocation of a MemberName of kind {@code REF_invokeInterface}. * The caller signature is restricted to basic types as with {@code invokeBasic}. * The trailing (not leading) argument must be a MemberName. + * @param args the signature-polymorphic parameter list, statically represented using varargs + * @return the signature-polymorphic result, statically represented using {@code Object} */ /*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable; @@ -754,7 +773,7 @@ public abstract class MethodHandle { * (The array may also be null when zero elements are required.) *

    * Here are some simple examples of array-spreading method handles: - *

    +     * 
    {@code
     MethodHandle equals = publicLookup()
       .findVirtual(String.class, "equals", methodType(boolean.class, Object.class));
     assert( (boolean) equals.invokeExact("me", (Object)"me"));
    @@ -790,7 +809,7 @@ MethodHandle caString3 = caToString.asCollector(char[].class, 3);
     assertEquals("[A, B, C]", (String) caString3.invokeExact('A', 'B', 'C'));
     MethodHandle caToString2 = caString3.asSpreader(char[].class, 2);
     assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray()));
    -     * 
    + * }
    * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments * @param arrayLength the number of arguments to spread from an incoming array argument * @return a new method handle which spreads its final array argument, @@ -878,7 +897,7 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray * number of collected arguments, use {@link #asVarargsCollector asVarargsCollector} instead. *

    * Here are some examples of array-collecting method handles: - *

    +     * 
    {@code
     MethodHandle deepToString = publicLookup()
       .findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
     assertEquals("[won]",   (String) deepToString.invokeExact(new Object[]{"won"}));
    @@ -904,7 +923,7 @@ MethodHandle longsToString = publicLookup()
       .findStatic(Arrays.class, "toString", methodType(String.class, long[].class))
       .asCollector(long[].class, 1);
     assertEquals("[123]", (String) longsToString.invokeExact((long)123));
    -     * 
    + * }
    * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments * @param arrayLength the number of arguments to collect into a new array argument * @return a new method handle which collects some trailing argument @@ -1041,7 +1060,7 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123)); * It may (or may not) return the original variable arity method handle. *

    * Here is an example, of a list-making variable arity method handle: - *

    +     * 
    {@code
     MethodHandle deepToString = publicLookup()
       .findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
     MethodHandle ts1 = deepToString.asVarargsCollector(Object[].class);
    @@ -1063,7 +1082,7 @@ assertEquals("[three, thee, tee]", asList.invoke((Object[])argv).toString());
     List ls = (List) asList.invoke((Object)argv);
     assertEquals(1, ls.size());
     assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
    -     * 
    + * }
    *

    * Discussion: * These rules are designed as a dynamically-typed variation @@ -1134,7 +1153,7 @@ assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0))); * a previous argument to {@code asVarargsCollector}. *

    * Here is an example, of a list-making variable arity method handle: - *

    +     * 
    {@code
     MethodHandle asListVar = publicLookup()
       .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
       .asVarargsCollector(Object[].class);
    @@ -1153,7 +1172,7 @@ assertEquals("[three, thee, tee]", asListVar.invoke(argv).toString());
     assertEquals("[three, thee, tee]", asListFix.invoke(argv).toString());
     assertEquals(1, ((List) asListVar.invoke((Object)argv)).size());
     assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
    -     * 
    + * }
    * * @return a new method handle which accepts only a fixed number of arguments * @see #asVarargsCollector diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java b/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java index 641f2eeea51..246160cabaf 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleProxies.java @@ -108,8 +108,9 @@ public class MethodHandleProxies { * Future versions of this API may also equip wrapper instances * with one or more additional public "marker" interfaces. * + * @param the desired type of the wrapper, a single-method interface + * @param intfc a class object representing {@code T} * @param target the method handle to invoke from the wrapper - * @param intfc the desired type of the wrapper, a single-method interface * @return a correctly-typed wrapper for the given target * @throws NullPointerException if either argument is null * @throws IllegalArgumentException if the {@code intfc} is not a diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index fa3cb607855..3bf24bc8503 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -31,11 +31,13 @@ import java.security.PrivilegedAction; import java.util.List; import java.util.ArrayList; import java.util.Arrays; + import sun.invoke.util.ValueConversions; import sun.invoke.util.VerifyAccess; import sun.invoke.util.Wrapper; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; +import sun.reflect.misc.ReflectUtil; import sun.security.util.SecurityConstants; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandleNatives.Constants.*; @@ -68,6 +70,7 @@ public class MethodHandles { * including direct method handles to private fields and methods. * This lookup object is a capability which may be delegated to trusted agents. * Do not store it in place where untrusted code can access it. + * @return a lookup object for the caller of this method */ @CallerSensitive public static Lookup lookup() { @@ -86,6 +89,7 @@ public class MethodHandles { * {@linkplain Lookup#in publicLookup().in(C.class)}. * Since all classes have equal access to public names, * such a change would confer no new access rights. + * @return a lookup object which is trusted minimally */ public static Lookup publicLookup() { return Lookup.PUBLIC_LOOKUP; @@ -109,72 +113,74 @@ public class MethodHandles { * on the {@code Lookup} object to create method handles for access-checked members. * This includes all methods, constructors, and fields which are allowed to the lookup class, * even private ones. - *

    + * + *

    Lookup Factory Methods

    * The factory methods on a {@code Lookup} object correspond to all major * use cases for methods, constructors, and fields. * Here is a summary of the correspondence between these factory methods and * the behavior the resulting method handles: - * *
    QSLink-time checksCapture-time checks
    PrimitivePrimitive
    * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * * - * - * + * + * * *
    lookup expressionmemberbehavior
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}FT f;(T) this.f;{@link java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}{@code FT f;}{@code (T) this.f;}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}static
    FT f;
    (T) C.f;{@link java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}{@code static}
    {@code FT f;}
    {@code (T) C.f;}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}FT f;this.f = x;{@link java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}{@code FT f;}{@code this.f = x;}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}static
    FT f;
    C.f = arg;{@link java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}{@code static}
    {@code FT f;}
    {@code C.f = arg;}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}T m(A*);(T) this.m(arg*);{@link java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}{@code T m(A*);}{@code (T) this.m(arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}static
    T m(A*);
    (T) C.m(arg*);{@link java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}{@code static}
    {@code T m(A*);}
    {@code (T) C.m(arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}T m(A*);(T) super.m(arg*);{@link java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}{@code T m(A*);}{@code (T) super.m(arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}C(A*);(T) new C(arg*);{@link java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}{@code C(A*);}{@code new C(arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}(static)?
    FT f;
    (FT) aField.get(thisOrNull);{@link java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}({@code static})?
    {@code FT f;}
    {@code (FT) aField.get(thisOrNull);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}(static)?
    FT f;
    aField.set(thisOrNull, arg);{@link java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}({@code static})?
    {@code FT f;}
    {@code aField.set(thisOrNull, arg);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}(static)?
    T m(A*);
    (T) aMethod.invoke(thisOrNull, arg*);{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
    {@code T m(A*);}
    {@code (T) aMethod.invoke(thisOrNull, arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}C(A*);(C) aConstructor.newInstance(arg*);{@link java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}{@code C(A*);}{@code (C) aConstructor.newInstance(arg*);}
    {@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}(static)?
    T m(A*);
    (T) aMethod.invoke(thisOrNull, arg*);{@link java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}({@code static})?
    {@code T m(A*);}
    {@code (T) aMethod.invoke(thisOrNull, arg*);}
    - * + * * Here, the type {@code C} is the class or interface being searched for a member, * documented as a parameter named {@code refc} in the lookup methods. - * The method or constructor type {@code MT} is composed from the return type {@code T} + * The method type {@code MT} is composed from the return type {@code T} * and the sequence of argument types {@code A*}. + * The constructor also has a sequence of argument types {@code A*} and + * is deemed to return the newly-created object of type {@code C}. * Both {@code MT} and the field type {@code FT} are documented as a parameter named {@code type}. * The formal parameter {@code this} stands for the self-reference of type {@code C}; * if it is present, it is always the leading argument to the method handle invocation. @@ -208,7 +214,7 @@ public class MethodHandles { * security manager checks. * * - *

    Access checking

    + *

    Access checking

    * Access checks are applied in the factory methods of {@code Lookup}, * when a method handle is created. * This is a key difference from the Core Reflection API, since @@ -295,7 +301,7 @@ public class MethodHandles { * with static methods of {@link MethodHandles}, * independently of any {@code Lookup} object. * - *

    Security manager interactions

    + *

    Security manager interactions

    * * If a security manager is present, member lookups are subject to * additional checks. @@ -386,6 +392,7 @@ public class MethodHandles { * but the permissions may be additionally limited by the bitmask * {@link #lookupModes lookupModes}, which controls whether non-public members * can be accessed. + * @return the lookup class, on behalf of which this lookup object finds members */ public Class lookupClass() { return lookupClass; @@ -412,6 +419,7 @@ public class MethodHandles { * The purpose of this is to restrict access via the new lookup object, * so that it can access only names which can be reached by the original * lookup object, and also by the new lookup class. + * @return the lookup modes, which limit the kinds of access performed by this lookup object */ public int lookupModes() { return allowedModes & ALL_MODES; @@ -578,14 +586,11 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findStatic(Class refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { MemberName method = resolveOrFail(REF_invokeStatic, refc, name, type); - Class callerClass = Reflection.getCallerClass(); - checkSecurityManager(refc, method, callerClass); - return getDirectMethod(REF_invokeStatic, refc, method, - findBoundCallerClass(method, callerClass)); + checkSecurityManager(refc, method); + return getDirectMethod(REF_invokeStatic, refc, method, findBoundCallerClass(method)); } /** @@ -631,7 +636,6 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findVirtual(Class refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { if (refc == MethodHandle.class) { MethodHandle mh = findVirtualForMH(name, type); @@ -639,10 +643,8 @@ public class MethodHandles { } byte refKind = (refc.isInterface() ? REF_invokeInterface : REF_invokeVirtual); MemberName method = resolveOrFail(refKind, refc, name, type); - Class callerClass = Reflection.getCallerClass(); - checkSecurityManager(refc, method, callerClass); - return getDirectMethod(refKind, refc, method, - findBoundCallerClass(method, callerClass)); + checkSecurityManager(refc, method); + return getDirectMethod(refKind, refc, method, findBoundCallerClass(method)); } private MethodHandle findVirtualForMH(String name, MethodType type) { // these names require special lookups because of the implicit MethodType argument @@ -679,11 +681,10 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findConstructor(Class refc, MethodType type) throws NoSuchMethodException, IllegalAccessException { String name = ""; MemberName ctor = resolveOrFail(REF_newInvokeSpecial, refc, name, type); - checkSecurityManager(refc, ctor, Reflection.getCallerClass()); + checkSecurityManager(refc, ctor); return getDirectConstructor(refc, ctor); } @@ -721,16 +722,13 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findSpecial(Class refc, String name, MethodType type, Class specialCaller) throws NoSuchMethodException, IllegalAccessException { checkSpecialCaller(specialCaller); Lookup specialLookup = this.in(specialCaller); MemberName method = specialLookup.resolveOrFail(REF_invokeSpecial, refc, name, type); - Class callerClass = Reflection.getCallerClass(); - checkSecurityManager(refc, method, callerClass); - return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, - findBoundCallerClass(method, callerClass)); + checkSecurityManager(refc, method); + return specialLookup.getDirectMethod(REF_invokeSpecial, refc, method, findBoundCallerClass(method)); } /** @@ -750,10 +748,9 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findGetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_getField, refc, name, type); - checkSecurityManager(refc, field, Reflection.getCallerClass()); + checkSecurityManager(refc, field); return getDirectField(REF_getField, refc, field); } @@ -774,10 +771,9 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findSetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_putField, refc, name, type); - checkSecurityManager(refc, field, Reflection.getCallerClass()); + checkSecurityManager(refc, field); return getDirectField(REF_putField, refc, field); } @@ -797,10 +793,9 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findStaticGetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_getStatic, refc, name, type); - checkSecurityManager(refc, field, Reflection.getCallerClass()); + checkSecurityManager(refc, field); return getDirectField(REF_getStatic, refc, field); } @@ -820,10 +815,9 @@ public class MethodHandles { * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle findStaticSetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { MemberName field = resolveOrFail(REF_putStatic, refc, name, type); - checkSecurityManager(refc, field, Reflection.getCallerClass()); + checkSecurityManager(refc, field); return getDirectField(REF_putStatic, refc, field); } @@ -873,14 +867,11 @@ return mh1; * refuses access * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { Class refc = receiver.getClass(); // may get NPE MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type); - Class callerClass = Reflection.getCallerClass(); - checkSecurityManager(refc, method, callerClass); - MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, - findBoundCallerClass(method, callerClass)); + checkSecurityManager(refc, method); + MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, findBoundCallerClass(method)); return mh.bindReceiver(receiver).setVarargs(method); } @@ -905,16 +896,14 @@ return mh1; * is set and {@code asVarargsCollector} fails * @throws NullPointerException if the argument is null */ - @CallerSensitive public MethodHandle unreflect(Method m) throws IllegalAccessException { MemberName method = new MemberName(m); byte refKind = method.getReferenceKind(); if (refKind == REF_invokeSpecial) refKind = REF_invokeVirtual; assert(method.isMethod()); - Class callerClass = findBoundCallerClass(method, Reflection.getCallerClass()); Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this; - return lookup.getDirectMethod(refKind, method.getDeclaringClass(), method, callerClass); + return lookup.getDirectMethod(refKind, method.getDeclaringClass(), method, findBoundCallerClass(method)); } /** @@ -938,15 +927,13 @@ return mh1; * is set and {@code asVarargsCollector} fails * @throws NullPointerException if any argument is null */ - @CallerSensitive public MethodHandle unreflectSpecial(Method m, Class specialCaller) throws IllegalAccessException { checkSpecialCaller(specialCaller); Lookup specialLookup = this.in(specialCaller); MemberName method = new MemberName(m, true); assert(method.isMethod()); - Class callerClass = findBoundCallerClass(method, Reflection.getCallerClass()); // ignore m.isAccessible: this is a new kind of access - return specialLookup.getDirectMethod(REF_invokeSpecial, method.getDeclaringClass(), method, callerClass); + return specialLookup.getDirectMethod(REF_invokeSpecial, method.getDeclaringClass(), method, findBoundCallerClass(method)); } /** @@ -1047,21 +1034,25 @@ return mh1; /** * Find my trustable caller class if m is a caller sensitive method. * If this lookup object has private access, then the caller class is the lookupClass. - * Otherwise, it is the caller of the currently executing public API method (e.g., findVirtual). - * This is the same caller class as is used by checkSecurityManager. + * Otherwise, if m is caller-sensitive, throw IllegalAccessException. */ - Class findBoundCallerClass(MemberName m, Class callerAtEntryPoint) { + Class findBoundCallerClass(MemberName m) throws IllegalAccessException { Class callerClass = null; if (MethodHandleNatives.isCallerSensitive(m)) { - // Do not refactor this to a more "logical" place, since it is stack walk magic. - // Note that this is the same expression as in Step 2 below in checkSecurityManager. - callerClass = ((allowedModes & PRIVATE) != 0 - ? lookupClass // for strong access modes, no extra check - : callerAtEntryPoint); + // Only full-power lookup is allowed to resolve caller-sensitive methods + if (isFullPowerLookup()) { + callerClass = lookupClass; + } else { + throw new IllegalAccessException("Attempt to lookup caller-sensitive method using restricted lookup object"); + } } return callerClass; } + private boolean isFullPowerLookup() { + return (allowedModes & PRIVATE) != 0; + } + /** * Determine whether a security manager has an overridden * SecurityManager.checkMemberAccess method. @@ -1082,10 +1073,8 @@ return mh1; * Perform necessary access checks. * Determines a trustable caller class to compare with refc, the symbolic reference class. * If this lookup object has private access, then the caller class is the lookupClass. - * Otherwise, it is the caller of the currently executing public API method (e.g., findVirtual). - * This function performs stack walk magic: do not refactor it. */ - void checkSecurityManager(Class refc, MemberName m, Class caller) { + void checkSecurityManager(Class refc, MemberName m) { SecurityManager smgr = System.getSecurityManager(); if (smgr == null) return; if (allowedModes == TRUSTED) return; @@ -1105,13 +1094,10 @@ return mh1; } // Step 2: - Class callerClass = ((allowedModes & PRIVATE) != 0 - ? lookupClass // for strong access modes, no extra check - : caller); - if (!VerifyAccess.classLoaderIsAncestor(lookupClass, refc) || - (callerClass != lookupClass && - !VerifyAccess.classLoaderIsAncestor(callerClass, refc))) - smgr.checkPackageAccess(VerifyAccess.getPackageName(refc)); + if (!isFullPowerLookup() || + !VerifyAccess.classLoaderIsAncestor(lookupClass, refc)) { + ReflectUtil.checkPackageAccess(refc); + } // Step 3: if (m.isPublic()) return; @@ -1121,7 +1107,7 @@ return mh1; final int which = Member.DECLARED; final Class clazz = defc; if (!overridden) { - if (caller.getClassLoader() != clazz.getClassLoader()) { + if (!isFullPowerLookup()) { smgr.checkPermission(SecurityConstants.CHECK_MEMBER_ACCESS_PERMISSION); } } else { @@ -1132,8 +1118,9 @@ return mh1; } // Step 4: - if (defc != refc) - smgr.checkPackageAccess(VerifyAccess.getPackageName(defc)); + if (defc != refc) { + ReflectUtil.checkPackageAccess(defc); + } } void checkMethod(byte refKind, Class refc, MemberName m) throws IllegalAccessException { @@ -1371,6 +1358,7 @@ return mh1; * The type of the method handle will have a void return type. * Its last argument will be the array's element type. * The first and second arguments will be the array type and int. + * @param arrayClass the class of an array * @return a method handle which can store values into the array type * @throws NullPointerException if the argument is null * @throws IllegalArgumentException if arrayClass is not an array type @@ -1593,23 +1581,23 @@ publicLookup().findVirtual(MethodHandle.class, "invoke", type) * As in the case of {@link #dropArguments(MethodHandle,int,List) dropArguments}, * incoming arguments which are not mentioned in the reordering array * are may be any type, as determined only by {@code newType}. - *
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
     MethodType intfn1 = methodType(int.class, int.class);
     MethodType intfn2 = methodType(int.class, int.class, int.class);
    -MethodHandle sub = ... {int x, int y => x-y} ...;
    +MethodHandle sub = ... (int x, int y) -> (x-y) ...;
     assert(sub.type().equals(intfn2));
     MethodHandle sub1 = permuteArguments(sub, intfn2, 0, 1);
     MethodHandle rsub = permuteArguments(sub, intfn2, 1, 0);
     assert((int)rsub.invokeExact(1, 100) == 99);
    -MethodHandle add = ... {int x, int y => x+y} ...;
    +MethodHandle add = ... (int x, int y) -> (x+y) ...;
     assert(add.type().equals(intfn2));
     MethodHandle twice = permuteArguments(add, intfn1, 0, 0);
     assert(twice.type().equals(intfn1));
     assert((int)twice.invokeExact(21) == 42);
    -     * 
    + * }
    * @param target the method handle to invoke after arguments are reordered * @param newType the expected type of the new method handle * @param reorder an index array which controls the reordering @@ -2280,6 +2268,8 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum")); * The method type will nominally specify a return of {@code returnType}. * The return type may be anything convenient: It doesn't matter to the * method handle's behavior, since it will never return normally. + * @param returnType the return type of the desired method handle + * @param exType the parameter type of the desired method handle * @return method handle which can throw the given exceptions * @throws NullPointerException if either argument is null */ diff --git a/jdk/src/share/classes/java/lang/invoke/MethodType.java b/jdk/src/share/classes/java/lang/invoke/MethodType.java index c690dad3d8a..f55479f1345 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodType.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java @@ -27,10 +27,13 @@ package java.lang.invoke; import sun.invoke.util.Wrapper; import java.lang.ref.WeakReference; +import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; import sun.invoke.util.BytecodeDescriptor; import static java.lang.invoke.MethodHandleStatics.*; import sun.invoke.util.VerifyType; @@ -171,7 +174,7 @@ class MethodType implements java.io.Serializable { return new IndexOutOfBoundsException(num.toString()); } - static final WeakInternSet internTable = new WeakInternSet(); + static final ConcurrentWeakInternSet internTable = new ConcurrentWeakInternSet<>(); static final Class[] NO_PTYPES = {}; @@ -191,6 +194,8 @@ class MethodType implements java.io.Serializable { /** * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. + * @param rtype the return type + * @param ptypes the parameter types * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class} @@ -211,6 +216,9 @@ class MethodType implements java.io.Serializable { * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The leading parameter type is prepended to the remaining array. + * @param rtype the return type + * @param ptype0 the first parameter type + * @param ptypes the remaining parameter types * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null * @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class} @@ -227,6 +235,7 @@ class MethodType implements java.io.Serializable { * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has no parameter types. + * @param rtype the return type * @return a method type with the given return value * @throws NullPointerException if {@code rtype} is null */ @@ -239,6 +248,8 @@ class MethodType implements java.io.Serializable { * Finds or creates a method type with the given components. * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has the single given parameter type. + * @param rtype the return type + * @param ptype0 the parameter type * @return a method type with the given return value and parameter type * @throws NullPointerException if {@code rtype} or {@code ptype0} is null * @throws IllegalArgumentException if {@code ptype0} is {@code void.class} @@ -253,6 +264,9 @@ class MethodType implements java.io.Serializable { * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}. * The resulting method has the same parameter types as {@code ptypes}, * and the specified return type. + * @param rtype the return type + * @param ptypes the method type which supplies the parameter types + * @return a method type with the given components * @throws NullPointerException if {@code rtype} or {@code ptypes} is null */ public static @@ -935,7 +949,8 @@ s.writeObject(this.parameterArray()); * provided to the factory method {@link #methodType(Class,Class[]) methodType}. * For example, null values, or {@code void} parameter types, * will lead to exceptions during deserialization. - * @param the stream to write the object to + * @param s the stream to write the object to + * @throws java.io.IOException if there is a problem writing the object */ private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); // requires serialPersistentFields to be an empty array @@ -950,7 +965,9 @@ s.writeObject(this.parameterArray()); * It provides the parameters to the factory method called by * {@link #readResolve readResolve}. * After that call it is discarded. - * @param the stream to read the object from + * @param s the stream to read the object from + * @throws java.io.IOException if there is a problem reading the object + * @throws ClassNotFoundException if one of the component classes cannot be resolved * @see #MethodType() * @see #readResolve * @see #writeObject @@ -1013,267 +1030,104 @@ s.writeObject(this.parameterArray()); } /** - * Weak intern set based on implementation of the HashSet and - * WeakHashMap, with weak values. Note: null - * values will yield NullPointerException - * Refer to implementation of WeakInternSet for details. + * Simple implementation of weak concurrent intern set. * - * @see java.util.HashMap - * @see java.util.HashSet - * @see java.util.WeakHashMap - * @see java.lang.ref.WeakReference + * @param interned type */ - private static class WeakInternSet { - // The default initial capacity -- MUST be a power of two. - private static final int DEFAULT_INITIAL_CAPACITY = 16; + private static class ConcurrentWeakInternSet { - // The maximum capacity, used if a higher value is implicitly specified - // by either of the constructors with arguments. - // MUST be a power of two <= 1<<30. - private static final int MAXIMUM_CAPACITY = 1 << 30; + private final ConcurrentMap, WeakEntry> map; + private final ReferenceQueue stale; - // The load factor used when none specified in constructor. - private static final float DEFAULT_LOAD_FACTOR = 0.75f; - - // The table, resized as necessary. Length MUST Always be a power of two. - private Entry[] table; - - // The number of entries contained in this set. - private int size; - - // The next size value at which to resize (capacity * load factor). - private int threshold; - - // The load factor for the hash table. - private final float loadFactor; - - // Reference queue for cleared WeakEntries - private final ReferenceQueue queue = new ReferenceQueue<>(); - - private Entry[] newTable(int n) { - return new Entry[n]; + public ConcurrentWeakInternSet() { + this.map = new ConcurrentHashMap<>(); + this.stale = new ReferenceQueue<>(); } /** - * Constructs a new, empty WeakInternSet with the default initial - * capacity (16) and load factor (0.75). + * Get the existing interned element. + * This method returns null if no element is interned. + * + * @param elem element to look up + * @return the interned element */ - WeakInternSet() { - this.loadFactor = DEFAULT_LOAD_FACTOR; - threshold = DEFAULT_INITIAL_CAPACITY; - table = newTable(DEFAULT_INITIAL_CAPACITY); - } + public T get(T elem) { + if (elem == null) throw new NullPointerException(); + expungeStaleElements(); - /** - * Applies a supplemental hash function to a given hashCode, which - * defends against poor quality hash functions. This is critical - * because hashing uses power-of-two length hash tables, that - * otherwise encounter collisions for hashCodes that do not differ - * in lower bits. - * @param h preliminary hash code value - * @return supplemental hash code value - */ - private static int hash(int h) { - // This function ensures that hashCodes that differ only by - // constant multiples at each bit position have a bounded - // number of collisions (approximately 8 at default load factor). - h ^= (h >>> 20) ^ (h >>> 12); - return h ^ (h >>> 7) ^ (h >>> 4); - } - - /** - * Checks for equality of non-null reference x and possibly-null y. By - * default uses Object.equals. - * @param x first object to compare - * @param y second object to compare - * @return true if objects are equal - */ - private static boolean eq(Object x, Object y) { - return x == y || x.equals(y); - } - - /** - * Returns index for hash code h. - * @param h raw hash code - * @param length length of table (power of 2) - * @return index in table - */ - private static int indexFor(int h, int length) { - return h & (length-1); - } - - /** - * Expunges stale entries from the table. - */ - private void expungeStaleEntries() { - for (Object x; (x = queue.poll()) != null; ) { - synchronized (queue) { - Entry entry = (Entry) x; - int i = indexFor(entry.hash, table.length); - Entry prev = table[i]; - Entry p = prev; - while (p != null) { - Entry next = p.next; - if (p == entry) { - if (prev == entry) - table[i] = next; - else - prev.next = next; - entry.next = null; - size--; - break; - } - prev = p; - p = next; - } + WeakEntry value = map.get(new WeakEntry<>(elem)); + if (value != null) { + T res = value.get(); + if (res != null) { + return res; } } - } - - /** - * Returns the table after first expunging stale entries. - * @return an expunged hash table - */ - private Entry[] getTable() { - expungeStaleEntries(); - return table; - } - - /** - * Returns the entry to which the specified value is mapped, - * or {@code null} if this set contains no entry for the value. - * - *

    More formally, if this set contains an entry for value - * {@code entry} to a value {@code value} such that - * {@code entry.equals(value)}, then this method returns {@code entry}; - * otherwise it returns {@code null}. - * - * @param value value to search for in set - * @return interned value if in set, otherwise null - */ - synchronized MethodType get(MethodType value) { - int h = hash(value.hashCode()); - Entry[] tab = getTable(); - int index = indexFor(h, tab.length); - Entry e = tab[index]; - MethodType g; - while (e != null) { - if (e.hash == h && eq(value, g = e.get())) - return g; - e = e.next; - } return null; } /** - * Attempts to add the specified value to the set and returns same value. - * If the set previously contained an entry for this value, the old - * value is left untouched and returned as the result. + * Interns the element. + * Always returns non-null element, matching the one in the intern set. + * Under the race against another add(), it can return different + * element, if another thread beats us to interning it. * - * @param value value to be added - * @return the previous entry associated with value, or - * value if there was no previous entry found + * @param elem element to add + * @return element that was actually added */ - synchronized MethodType add(MethodType value) { - int h = hash(value.hashCode()); - Entry[] tab = getTable(); - int i = indexFor(h, tab.length); - MethodType g; - for (Entry e = tab[i]; e != null; e = e.next) { - if (h == e.hash && eq(value, g = e.get())) { - return g; - } - } - Entry e = tab[i]; - tab[i] = new Entry(value, queue, h, e); - if (++size >= threshold) - resize(tab.length * 2); - return value; + public T add(T elem) { + if (elem == null) throw new NullPointerException(); + + // Playing double race here, and so spinloop is required. + // First race is with two concurrent updaters. + // Second race is with GC purging weak ref under our feet. + // Hopefully, we almost always end up with a single pass. + T interned; + WeakEntry e = new WeakEntry<>(elem, stale); + do { + expungeStaleElements(); + WeakEntry exist = map.putIfAbsent(e, e); + interned = (exist == null) ? elem : exist.get(); + } while (interned == null); + return interned; } - /** - * Rehashes the contents of this set into a new array with a - * larger capacity. This method is called automatically when the - * number of keys in this set reaches its threshold. - * - * If current capacity is MAXIMUM_CAPACITY, this method does not - * resize the set, but sets threshold to Integer.MAX_VALUE. - * This has the effect of preventing future calls. - * - * @param newCapacity the new capacity, MUST be a power of two; - * must be greater than current capacity unless current - * capacity is MAXIMUM_CAPACITY (in which case value - * is irrelevant) - */ - private void resize(int newCapacity) { - Entry[] oldTable = getTable(); - int oldCapacity = oldTable.length; - if (oldCapacity == MAXIMUM_CAPACITY) { - threshold = Integer.MAX_VALUE; - return; - } - - Entry[] newTable = newTable(newCapacity); - transfer(oldTable, newTable); - table = newTable; - - /* - * If ignoring null elements and processing ref queue caused massive - * shrinkage, then restore old table. This should be rare, but avoids - * unbounded expansion of garbage-filled tables. - */ - if (size >= threshold / 2) { - threshold = (int)(newCapacity * loadFactor); - } else { - expungeStaleEntries(); - transfer(newTable, oldTable); - table = oldTable; + private void expungeStaleElements() { + Reference reference; + while ((reference = stale.poll()) != null) { + map.remove(reference); } } - /** - * Transfers all entries from src to dest tables - * @param src original table - * @param dest new table - */ - private void transfer(Entry[] src, Entry[] dest) { - for (int j = 0; j < src.length; ++j) { - Entry e = src[j]; - src[j] = null; - while (e != null) { - Entry next = e.next; - MethodType key = e.get(); - if (key == null) { - e.next = null; // Help GC - size--; - } else { - int i = indexFor(e.hash, dest.length); - e.next = dest[i]; - dest[i] = e; - } - e = next; - } - } - } + private static class WeakEntry extends WeakReference { - /** - * The entries in this hash table extend WeakReference, using its main ref - * field as the key. - */ - private static class Entry extends WeakReference { - final int hash; - Entry next; + public final int hashcode; - /** - * Creates new entry. - */ - Entry(MethodType key, - ReferenceQueue queue, - int hash, Entry next) { + public WeakEntry(T key, ReferenceQueue queue) { super(key, queue); - this.hash = hash; - this.next = next; + hashcode = key.hashCode(); } + + public WeakEntry(T key) { + super(key); + hashcode = key.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof WeakEntry) { + Object that = ((WeakEntry) obj).get(); + Object mine = get(); + return (that == null || mine == null) ? (this == obj) : mine.equals(that); + } + return false; + } + + @Override + public int hashCode() { + return hashcode; + } + } } + } diff --git a/jdk/src/share/classes/java/lang/invoke/MutableCallSite.java b/jdk/src/share/classes/java/lang/invoke/MutableCallSite.java index d48f99afefb..37bd4641484 100644 --- a/jdk/src/share/classes/java/lang/invoke/MutableCallSite.java +++ b/jdk/src/share/classes/java/lang/invoke/MutableCallSite.java @@ -195,7 +195,7 @@ public class MutableCallSite extends CallSite { * processed before the method returns abnormally. * Which elements these are (if any) is implementation-dependent. * - *

    Java Memory Model details

    + *

    Java Memory Model details

    * In terms of the Java Memory Model, this operation performs a synchronization * action which is comparable in effect to the writing of a volatile variable * by the current thread, and an eventual volatile read by every other thread diff --git a/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java b/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java index 3679e3f726d..558fa5ab6ee 100644 --- a/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java +++ b/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,66 +97,113 @@ public final class SerializedLambda implements Serializable { this.capturedArgs = Objects.requireNonNull(capturedArgs).clone(); } - /** Get the name of the class that captured this lambda */ + /** + * Get the name of the class that captured this lambda. + * @return the name of the class that captured this lambda + */ public String getCapturingClass() { return capturingClass.getName().replace('.', '/'); } - /** Get the name of the functional interface class to which this lambda has been converted */ + /** + * Get the name of the functional interface class to which this + * lambda has been converted + * @return the name of the functional interface this lambda has + * been converted to + */ public String getFunctionalInterfaceClass() { return functionalInterfaceClass; } - /** Get the name of the primary method for the functional interface to which this lambda has been converted */ + /** + * Get the name of the primary method for the functional interface + * to which this lambda has been converted. + * @return the name of the primary methods of the functional interface + */ public String getFunctionalInterfaceMethodName() { return functionalInterfaceMethodName; } - /** Get the signature of the primary method for the functional interface to which this lambda has been converted */ + /** + * Get the signature of the primary method for the functional + * interface to which this lambda has been converted. + * @return the signature of the primary method of the functional + * interface + */ public String getFunctionalInterfaceMethodSignature() { return functionalInterfaceMethodSignature; } - /** Get the method handle kind (see {@link MethodHandleInfo}) of the primary method for the functional interface - * to which this lambda has been converted */ + /** + * Get the method handle kind (see {@link MethodHandleInfo}) of + * the primary method for the functional interface to which this + * lambda has been converted + * @return the method handle kind of the primary method of + * functional interface + */ public int getFunctionalInterfaceMethodKind() { return functionalInterfaceMethodKind; } - /** Get the name of the class containing the implementation method */ + /** + * Get the name of the class containing the implementation + * method. + * @return the name of the class containing the implementation + * method + */ public String getImplClass() { return implClass; } - /** Get the name of the implementation method */ + /** + * Get the name of the implementation method. + * @return the name of the implementation method + */ public String getImplMethodName() { return implMethodName; } - /** Get the signature of the implementation method */ + /** + * Get the signature of the implementation method. + * @return the signature of the implementation method + */ public String getImplMethodSignature() { return implMethodSignature; } - /** Get the method handle kind (see {@link MethodHandleInfo}) of the implementation method */ + /** + * Get the method handle kind (see {@link MethodHandleInfo}) of + * the implementation method. + * @return the method handle kind of the implementation method + */ public int getImplMethodKind() { return implMethodKind; } /** - * Get the signature of the primary functional interface method after type variables are substituted with - * their instantiation from the capture site + * Get the signature of the primary functional interface method + * after type variables are substituted with their instantiation + * from the capture site. + * @return the signature of the primary functional interface method + * after type variable processing */ public final String getInstantiatedMethodType() { return instantiatedMethodType; } - /** Get the count of dynamic arguments to the lambda capture site */ + /** + * Get the count of dynamic arguments to the lambda capture site. + * @return the count of dynamic arguments to the lambda capture site + */ public int getCapturedArgCount() { return capturedArgs.length; } - /** Get a dynamic argument to the lambda capture site */ + /** + * Get a dynamic argument to the lambda capture site. + * @param i the argument to capture + * @return a dynamic argument to the lambda capture site + */ public Object getCapturedArg(int i) { return capturedArgs[i]; } diff --git a/jdk/src/share/classes/java/lang/invoke/package-info.java b/jdk/src/share/classes/java/lang/invoke/package-info.java index 880bf54021f..51fc21c3f77 100644 --- a/jdk/src/share/classes/java/lang/invoke/package-info.java +++ b/jdk/src/share/classes/java/lang/invoke/package-info.java @@ -43,13 +43,13 @@ * * * - *

    Summary of relevant Java Virtual Machine changes

    + *

    Summary of relevant Java Virtual Machine changes

    * The following low-level information summarizes relevant parts of the * Java Virtual Machine specification. For full details, please see the * current version of that specification. * * Each occurrence of an {@code invokedynamic} instruction is called a dynamic call site. - *

    {@code invokedynamic} instructions

    + *

    {@code invokedynamic} instructions

    * A dynamic call site is originally in an unlinked state. In this state, there is * no target method for the call site to invoke. *

    @@ -97,7 +97,7 @@ * If this happens, the same error will the thrown for all subsequent * attempts to execute the dynamic call site. * - *

    timing of linkage

    + *

    timing of linkage

    * A dynamic call site is linked just before its first execution. * The bootstrap method call implementing the linkage occurs within * a thread that is attempting a first execution. @@ -131,7 +131,7 @@ * just before its first invocation. * There is no way to undo the effect of a completed bootstrap method call. * - *

    types of bootstrap methods

    + *

    types of bootstrap methods

    * As long as each bootstrap method can be correctly invoked * by {@code MethodHandle.invoke}, its detailed type is arbitrary. * For example, the first argument could be {@code Object} diff --git a/jdk/src/share/classes/java/lang/management/MemoryUsage.java b/jdk/src/share/classes/java/lang/management/MemoryUsage.java index c223c710728..4dc23c0fe46 100644 --- a/jdk/src/share/classes/java/lang/management/MemoryUsage.java +++ b/jdk/src/share/classes/java/lang/management/MemoryUsage.java @@ -72,8 +72,8 @@ import sun.management.MemoryUsageCompositeData; * The amount of used and committed memory will always be less than * or equal to max if max is defined. * A memory allocation may fail if it attempts to increase the - * used memory such that used > committed even - * if used <= max would still be true (for example, + * used memory such that used > committed even + * if used <= max would still be true (for example, * when the system is low on virtual memory). * * diff --git a/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java b/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java index 62463af44e4..e4142d3e439 100644 --- a/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java +++ b/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java @@ -308,7 +308,7 @@ public interface RuntimeMXBean extends PlatformManagedObject { * *

    * MBeanServer access:
    - * The mapped type of Map is + * The mapped type of {@code Map} is * {@link javax.management.openmbean.TabularData TabularData} * with two items in each row as follows: *

    diff --git a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java index f804af1942f..30251d51f60 100644 --- a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java +++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java @@ -198,7 +198,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * null if the thread of the given ID is not alive or * it does not exist. * - * @throws IllegalArgumentException if id <= 0. + * @throws IllegalArgumentException if {@code id <= 0}. * @throws java.lang.SecurityException if a security manager * exists and the caller does not have * ManagementPermission("monitor"). @@ -236,7 +236,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * with no stack trace, no locked monitor and no synchronizer info. * * @throws IllegalArgumentException if any element in the input array - * ids is <= 0. + * ids is {@code <= 0}. * @throws java.lang.SecurityException if a security manager * exists and the caller does not have * ManagementPermission("monitor"). @@ -282,7 +282,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * null if the thread of the given ID is not alive or * it does not exist. * - * @throws IllegalArgumentException if id <= 0. + * @throws IllegalArgumentException if {@code id <= 0}. * @throws IllegalArgumentException if maxDepth is negative. * @throws java.lang.SecurityException if a security manager * exists and the caller does not have @@ -336,7 +336,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * * @throws IllegalArgumentException if maxDepth is negative. * @throws IllegalArgumentException if any element in the input array - * ids is <= 0. + * ids is {@code <= 0}. * @throws java.lang.SecurityException if a security manager * exists and the caller does not have * ManagementPermission("monitor"). @@ -466,7 +466,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * and CPU time measurement is enabled; * -1 otherwise. * - * @throws IllegalArgumentException if id <= 0 . + * @throws IllegalArgumentException if {@code id <= 0}. * @throws java.lang.UnsupportedOperationException if the Java * virtual machine does not support CPU time measurement for * other threads. @@ -501,7 +501,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * and CPU time measurement is enabled; * -1 otherwise. * - * @throws IllegalArgumentException if id <= 0 . + * @throws IllegalArgumentException if {@code id <= 0}. * @throws java.lang.UnsupportedOperationException if the Java * virtual machine does not support CPU time measurement for * other threads. diff --git a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java index b2c43de3d7b..6bc894efaba 100644 --- a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java +++ b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java @@ -130,6 +130,7 @@ public interface AnnotatedElement { * Returns this element's annotation for the specified type if * such an annotation is present, else null. * + * @param the type of the annotation to query for and return if present * @param annotationClass the Class object corresponding to the * annotation type * @return this element's annotation for the specified annotation type if @@ -154,6 +155,7 @@ public interface AnnotatedElement { * The caller of this method is free to modify the returned array; it will * have no effect on the arrays returned to other callers. * + * @param the type of the annotation to query for and return if present * @param annotationClass the Class object corresponding to the * annotation type * @return all this element's annotations for the specified annotation type if @@ -184,6 +186,7 @@ public interface AnnotatedElement { * This method ignores inherited annotations. (Returns null if no * annotations are directly present on this element.) * + * @param the type of the annotation to query for and return if present * @param annotationClass the Class object corresponding to the * annotation type * @return this element's annotation for the specified annotation type if @@ -209,6 +212,8 @@ public interface AnnotatedElement { * The caller of this method is free to modify the returned array; it will * have no effect on the arrays returned to other callers. * + * @param the type of the annotation to query for and return + * if directly present * @param annotationClass the Class object corresponding to the * annotation type * @return all this element's annotations for the specified annotation type if diff --git a/jdk/src/share/classes/java/lang/reflect/Executable.java b/jdk/src/share/classes/java/lang/reflect/Executable.java index 00e08a64375..2501fd68d5d 100644 --- a/jdk/src/share/classes/java/lang/reflect/Executable.java +++ b/jdk/src/share/classes/java/lang/reflect/Executable.java @@ -384,6 +384,8 @@ public abstract class Executable extends AccessibleObject /** * Returns a string describing this {@code Executable}, including * any type parameters. + * @return a string describing this {@code Executable}, including + * any type parameters */ public abstract String toGenericString(); @@ -496,6 +498,8 @@ public abstract class Executable extends AccessibleObject * If this Executable represents a method, the AnnotatedType object * represents the use of a type to specify the return type of the method. * + * @return an object representing the return type of this method + * or constructor * @since 1.8 */ public abstract AnnotatedType getAnnotatedReturnType(); @@ -531,6 +535,9 @@ public abstract class Executable extends AccessibleObject * * Returns null if this Executable represents a static method. * + * @return an object representing the receiver type of the + * method or constructor represented by this Executable + * * @since 1.8 */ public AnnotatedType getAnnotatedReceiverType() { @@ -553,6 +560,9 @@ public abstract class Executable extends AccessibleObject * Returns an array of length 0 if the method/constructor declares no * parameters. * + * @return an array of objects representing the types of the + * formal parameters of this method or constructor + * * @since 1.8 */ public AnnotatedType[] getAnnotatedParameterTypes() { @@ -575,6 +585,9 @@ public abstract class Executable extends AccessibleObject * Returns an array of length 0 if the method/constructor declares no * exceptions. * + * @return an array of objects representing the declared + * exceptions of this method or constructor + * * @since 1.8 */ public AnnotatedType[] getAnnotatedExceptionTypes() { diff --git a/jdk/src/share/classes/java/lang/reflect/Field.java b/jdk/src/share/classes/java/lang/reflect/Field.java index 8b2603a663e..4052e06e804 100644 --- a/jdk/src/share/classes/java/lang/reflect/Field.java +++ b/jdk/src/share/classes/java/lang/reflect/Field.java @@ -1151,6 +1151,8 @@ class Field extends AccessibleObject implements Member { /** * Returns an AnnotatedType object that represents the use of a type to specify * the declared type of the field represented by this Field. + * @return an object representing the declared type of the field + * represented by this Field * * @since 1.8 */ diff --git a/jdk/src/share/classes/java/lang/reflect/Parameter.java b/jdk/src/share/classes/java/lang/reflect/Parameter.java index c50e0febe41..20969347255 100644 --- a/jdk/src/share/classes/java/lang/reflect/Parameter.java +++ b/jdk/src/share/classes/java/lang/reflect/Parameter.java @@ -152,6 +152,8 @@ public final class Parameter implements AnnotatedElement { * defined in a class file, then that name will be returned by * this method. Otherwise, this method will synthesize a name of * the form argN, where N is the index of the parameter. + * + * @return the name of the parameter */ public String getName() { // Note: empty strings as paramete names are now outlawed. diff --git a/jdk/src/share/classes/java/lang/reflect/Proxy.java b/jdk/src/share/classes/java/lang/reflect/Proxy.java index 7b3d90f9273..dd5c2ad4336 100644 --- a/jdk/src/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java @@ -751,25 +751,21 @@ public class Proxy implements java.io.Serializable { private static void checkNewProxyPermission(Class caller, Class proxyClass) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { - String pcn = proxyClass.getName(); - if (pcn.startsWith(ReflectUtil.PROXY_PACKAGE + ".")) { - // all proxy interfaces are public - return; - } + if (ReflectUtil.isNonPublicProxyClass(proxyClass)) { + ClassLoader ccl = caller.getClassLoader(); + ClassLoader pcl = proxyClass.getClassLoader(); - ClassLoader ccl = caller.getClassLoader(); - ClassLoader pcl = proxyClass.getClassLoader(); + // do permission check if the caller is in a different runtime package + // of the proxy class + int n = proxyClass.getName().lastIndexOf('.'); + String pkg = (n == -1) ? "" : proxyClass.getName().substring(0, n); - // do permission check if the caller is in a different runtime package - // of the proxy class - int n = pcn.lastIndexOf('.'); - String pkg = (n == -1) ? "" : pcn.substring(0, n); + n = caller.getName().lastIndexOf('.'); + String callerPkg = (n == -1) ? "" : caller.getName().substring(0, n); - n = caller.getName().lastIndexOf('.'); - String callerPkg = (n == -1) ? "" : caller.getName().substring(0, n); - - if (pcl != ccl || !pkg.equals(callerPkg)) { - sm.checkPermission(new ReflectPermission("newProxyInPackage." + pkg)); + if (pcl != ccl || !pkg.equals(callerPkg)) { + sm.checkPermission(new ReflectPermission("newProxyInPackage." + pkg)); + } } } } diff --git a/jdk/src/share/classes/java/lang/reflect/TypeVariable.java b/jdk/src/share/classes/java/lang/reflect/TypeVariable.java index 42027e0041c..39ffe4bf3c0 100644 --- a/jdk/src/share/classes/java/lang/reflect/TypeVariable.java +++ b/jdk/src/share/classes/java/lang/reflect/TypeVariable.java @@ -95,6 +95,7 @@ public interface TypeVariable extends Type, Annota * * Returns an array of length 0 if the type parameter declares no bounds. * + * @return an array of objects representing the upper bounds of the type variable * @since 1.8 */ AnnotatedType[] getAnnotatedBounds(); diff --git a/jdk/src/share/classes/java/math/BigDecimal.java b/jdk/src/share/classes/java/math/BigDecimal.java index b7f6380948e..944f8a79fbe 100644 --- a/jdk/src/share/classes/java/math/BigDecimal.java +++ b/jdk/src/share/classes/java/math/BigDecimal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2572,6 +2572,9 @@ public class BigDecimal extends Number implements Comparable { * ({@code this} * 10n). The scale of * the result is {@code (this.scale() - n)}. * + * @param n the exponent power of ten to scale by + * @return a BigDecimal whose numerical value is equal to + * ({@code this} * 10n) * @throws ArithmeticException if the scale would be * outside the range of a 32-bit integer. * @@ -3538,24 +3541,7 @@ public class BigDecimal extends Number implements Comparable { return expandBigIntegerTenPowers(n); } - if (n < 1024*524288) { - // BigInteger.pow is slow, so make 10**n by constructing a - // BigInteger from a character string (still not very fast) - // which occupies no more than 1GB (!) of memory. - char tenpow[] = new char[n + 1]; - tenpow[0] = '1'; - for (int i = 1; i <= n; i++) { - tenpow[i] = '0'; - } - return new BigInteger(tenpow, 1, tenpow.length); - } - - if ((n & 0x1) == 0x1) { - return BigInteger.TEN.multiply(bigTenToThe(n - 1)); - } else { - BigInteger tmp = bigTenToThe(n/2); - return tmp.multiply(tmp); - } + return BigInteger.TEN.pow(n); } /** diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index a4988deaa40..6569fcb1796 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,15 @@ package java.math; -import java.util.Random; -import java.io.*; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Random; +import sun.misc.DoubleConsts; +import sun.misc.FloatConsts; /** * Immutable arbitrary-precision integers. All operations behave as if @@ -94,6 +100,7 @@ import java.util.Arrays; * @see BigDecimal * @author Josh Bloch * @author Michael McCloskey + * @author Alan Eliasen * @since JDK1.1 */ @@ -174,6 +181,49 @@ public class BigInteger extends Number implements Comparable { */ final static long LONG_MASK = 0xffffffffL; + /** + * The threshold value for using Karatsuba multiplication. If the number + * of ints in both mag arrays are greater than this number, then + * Karatsuba multiplication will be used. This value is found + * experimentally to work well. + */ + private static final int KARATSUBA_THRESHOLD = 50; + + /** + * The threshold value for using 3-way Toom-Cook multiplication. + * If the number of ints in each mag array is greater than the + * Karatsuba threshold, and the number of ints in at least one of + * the mag arrays is greater than this threshold, then Toom-Cook + * multiplication will be used. + */ + private static final int TOOM_COOK_THRESHOLD = 75; + + /** + * The threshold value for using Karatsuba squaring. If the number + * of ints in the number are larger than this value, + * Karatsuba squaring will be used. This value is found + * experimentally to work well. + */ + private static final int KARATSUBA_SQUARE_THRESHOLD = 90; + + /** + * The threshold value for using Toom-Cook squaring. If the number + * of ints in the number are larger than this value, + * Toom-Cook squaring will be used. This value is found + * experimentally to work well. + */ + private static final int TOOM_COOK_SQUARE_THRESHOLD = 140; + + /** + * The threshold value for using Schoenhage recursive base conversion. If + * the number of ints in the number are larger than this value, + * the Schoenhage algorithm will be used. In practice, it appears that the + * Schoenhage routine is faster for any threshold down to 2, and is + * relatively flat for thresholds between 2-25, so this choice may be + * varied within this range for very small effect. + */ + private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8; + //Constructors /** @@ -522,15 +572,16 @@ public class BigInteger extends Number implements Comparable { if (bitLength < 2) throw new ArithmeticException("bitLength < 2"); - // The cutoff of 95 was chosen empirically for best performance - prime = (bitLength < 95 ? smallPrime(bitLength, certainty, rnd) + prime = (bitLength < SMALL_PRIME_THRESHOLD + ? smallPrime(bitLength, certainty, rnd) : largePrime(bitLength, certainty, rnd)); signum = 1; mag = prime.mag; } // Minimum size in bits that the requested prime number has - // before we use the large prime number generating algorithms + // before we use the large prime number generating algorithms. + // The cutoff of 95 was chosen empirically for best performance. private static final int SMALL_PRIME_THRESHOLD = 95; // Certainty required to meet the spec of probablePrime @@ -553,7 +604,6 @@ public class BigInteger extends Number implements Comparable { if (bitLength < 2) throw new ArithmeticException("bitLength < 2"); - // The cutoff of 95 was chosen empirically for best performance return (bitLength < SMALL_PRIME_THRESHOLD ? smallPrime(bitLength, DEFAULT_PRIME_CERTAINTY, rnd) : largePrime(bitLength, DEFAULT_PRIME_CERTAINTY, rnd)); @@ -986,6 +1036,20 @@ public class BigInteger extends Number implements Comparable { private final static int MAX_CONSTANT = 16; private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1]; private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1]; + + /** + * The cache of powers of each radix. This allows us to not have to + * recalculate powers of radix^(2^n) more than once. This speeds + * Schoenhage recursive base conversion significantly. + */ + private static volatile BigInteger[][] powerCache; + + /** The cache of logarithms of radices for base conversion. */ + private static final double[] logCache; + + /** The natural log of 2. This is used in computing cache indices. */ + private static final double LOG_TWO = Math.log(2.0); + static { for (int i = 1; i <= MAX_CONSTANT; i++) { int[] magnitude = new int[1]; @@ -993,6 +1057,20 @@ public class BigInteger extends Number implements Comparable { posConst[i] = new BigInteger(magnitude, 1); negConst[i] = new BigInteger(magnitude, -1); } + + /* + * Initialize the cache of radix^(2^x) values used for base conversion + * with just the very first value. Additional values will be created + * on demand. + */ + powerCache = new BigInteger[Character.MAX_RADIX+1][]; + logCache = new double[Character.MAX_RADIX+1]; + + for (int i=Character.MIN_RADIX; i<=Character.MAX_RADIX; i++) + { + powerCache[i] = new BigInteger[] { BigInteger.valueOf(i) }; + logCache[i] = Math.log(i); + } } /** @@ -1014,6 +1092,11 @@ public class BigInteger extends Number implements Comparable { */ private static final BigInteger TWO = valueOf(2); + /** + * The BigInteger constant -1. (Not exported.) + */ + private static final BigInteger NEGATIVE_ONE = valueOf(-1); + /** * The BigInteger constant ten. * @@ -1290,17 +1373,29 @@ public class BigInteger extends Number implements Comparable { public BigInteger multiply(BigInteger val) { if (val.signum == 0 || signum == 0) return ZERO; - int resultSign = signum == val.signum ? 1 : -1; - if (val.mag.length == 1) { - return multiplyByInt(mag,val.mag[0], resultSign); + + int xlen = mag.length; + int ylen = val.mag.length; + + if ((xlen < KARATSUBA_THRESHOLD) || (ylen < KARATSUBA_THRESHOLD)) + { + int resultSign = signum == val.signum ? 1 : -1; + if (val.mag.length == 1) { + return multiplyByInt(mag,val.mag[0], resultSign); + } + if(mag.length == 1) { + return multiplyByInt(val.mag,mag[0], resultSign); + } + int[] result = multiplyToLen(mag, xlen, + val.mag, ylen, null); + result = trustedStripLeadingZeroInts(result); + return new BigInteger(result, resultSign); } - if(mag.length == 1) { - return multiplyByInt(val.mag,mag[0], resultSign); - } - int[] result = multiplyToLen(mag, mag.length, - val.mag, val.mag.length, null); - result = trustedStripLeadingZeroInts(result); - return new BigInteger(result, resultSign); + else + if ((xlen < TOOM_COOK_THRESHOLD) && (ylen < TOOM_COOK_THRESHOLD)) + return multiplyKaratsuba(this, val); + else + return multiplyToomCook3(this, val); } private static BigInteger multiplyByInt(int[] x, int y, int sign) { @@ -1401,6 +1496,272 @@ public class BigInteger extends Number implements Comparable { return z; } + /** + * Multiplies two BigIntegers using the Karatsuba multiplication + * algorithm. This is a recursive divide-and-conquer algorithm which is + * more efficient for large numbers than what is commonly called the + * "grade-school" algorithm used in multiplyToLen. If the numbers to be + * multiplied have length n, the "grade-school" algorithm has an + * asymptotic complexity of O(n^2). In contrast, the Karatsuba algorithm + * has complexity of O(n^(log2(3))), or O(n^1.585). It achieves this + * increased performance by doing 3 multiplies instead of 4 when + * evaluating the product. As it has some overhead, should be used when + * both numbers are larger than a certain threshold (found + * experimentally). + * + * See: http://en.wikipedia.org/wiki/Karatsuba_algorithm + */ + private static BigInteger multiplyKaratsuba(BigInteger x, BigInteger y) + { + int xlen = x.mag.length; + int ylen = y.mag.length; + + // The number of ints in each half of the number. + int half = (Math.max(xlen, ylen)+1) / 2; + + // xl and yl are the lower halves of x and y respectively, + // xh and yh are the upper halves. + BigInteger xl = x.getLower(half); + BigInteger xh = x.getUpper(half); + BigInteger yl = y.getLower(half); + BigInteger yh = y.getUpper(half); + + BigInteger p1 = xh.multiply(yh); // p1 = xh*yh + BigInteger p2 = xl.multiply(yl); // p2 = xl*yl + + // p3=(xh+xl)*(yh+yl) + BigInteger p3 = xh.add(xl).multiply(yh.add(yl)); + + // result = p1 * 2^(32*2*half) + (p3 - p1 - p2) * 2^(32*half) + p2 + BigInteger result = p1.shiftLeft(32*half).add(p3.subtract(p1).subtract(p2)).shiftLeft(32*half).add(p2); + + if (x.signum != y.signum) + return result.negate(); + else + return result; + } + + /** + * Multiplies two BigIntegers using a 3-way Toom-Cook multiplication + * algorithm. This is a recursive divide-and-conquer algorithm which is + * more efficient for large numbers than what is commonly called the + * "grade-school" algorithm used in multiplyToLen. If the numbers to be + * multiplied have length n, the "grade-school" algorithm has an + * asymptotic complexity of O(n^2). In contrast, 3-way Toom-Cook has a + * complexity of about O(n^1.465). It achieves this increased asymptotic + * performance by breaking each number into three parts and by doing 5 + * multiplies instead of 9 when evaluating the product. Due to overhead + * (additions, shifts, and one division) in the Toom-Cook algorithm, it + * should only be used when both numbers are larger than a certain + * threshold (found experimentally). This threshold is generally larger + * than that for Karatsuba multiplication, so this algorithm is generally + * only used when numbers become significantly larger. + * + * The algorithm used is the "optimal" 3-way Toom-Cook algorithm outlined + * by Marco Bodrato. + * + * See: http://bodrato.it/toom-cook/ + * http://bodrato.it/papers/#WAIFI2007 + * + * "Towards Optimal Toom-Cook Multiplication for Univariate and + * Multivariate Polynomials in Characteristic 2 and 0." by Marco BODRATO; + * In C.Carlet and B.Sunar, Eds., "WAIFI'07 proceedings", p. 116-133, + * LNCS #4547. Springer, Madrid, Spain, June 21-22, 2007. + * + */ + private static BigInteger multiplyToomCook3(BigInteger a, BigInteger b) + { + int alen = a.mag.length; + int blen = b.mag.length; + + int largest = Math.max(alen, blen); + + // k is the size (in ints) of the lower-order slices. + int k = (largest+2)/3; // Equal to ceil(largest/3) + + // r is the size (in ints) of the highest-order slice. + int r = largest - 2*k; + + // Obtain slices of the numbers. a2 and b2 are the most significant + // bits of the numbers a and b, and a0 and b0 the least significant. + BigInteger a0, a1, a2, b0, b1, b2; + a2 = a.getToomSlice(k, r, 0, largest); + a1 = a.getToomSlice(k, r, 1, largest); + a0 = a.getToomSlice(k, r, 2, largest); + b2 = b.getToomSlice(k, r, 0, largest); + b1 = b.getToomSlice(k, r, 1, largest); + b0 = b.getToomSlice(k, r, 2, largest); + + BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1, db1; + + v0 = a0.multiply(b0); + da1 = a2.add(a0); + db1 = b2.add(b0); + vm1 = da1.subtract(a1).multiply(db1.subtract(b1)); + da1 = da1.add(a1); + db1 = db1.add(b1); + v1 = da1.multiply(db1); + v2 = da1.add(a2).shiftLeft(1).subtract(a0).multiply( + db1.add(b2).shiftLeft(1).subtract(b0)); + vinf = a2.multiply(b2); + + /* The algorithm requires two divisions by 2 and one by 3. + All divisions are known to be exact, that is, they do not produce + remainders, and all results are positive. The divisions by 2 are + implemented as right shifts which are relatively efficient, leaving + only an exact division by 3, which is done by a specialized + linear-time algorithm. */ + t2 = v2.subtract(vm1).exactDivideBy3(); + tm1 = v1.subtract(vm1).shiftRight(1); + t1 = v1.subtract(v0); + t2 = t2.subtract(t1).shiftRight(1); + t1 = t1.subtract(tm1).subtract(vinf); + t2 = t2.subtract(vinf.shiftLeft(1)); + tm1 = tm1.subtract(t2); + + // Number of bits to shift left. + int ss = k*32; + + BigInteger result = vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0); + + if (a.signum != b.signum) + return result.negate(); + else + return result; + } + + + /** + * Returns a slice of a BigInteger for use in Toom-Cook multiplication. + * + * @param lowerSize The size of the lower-order bit slices. + * @param upperSize The size of the higher-order bit slices. + * @param slice The index of which slice is requested, which must be a + * number from 0 to size-1. Slice 0 is the highest-order bits, and slice + * size-1 are the lowest-order bits. Slice 0 may be of different size than + * the other slices. + * @param fullsize The size of the larger integer array, used to align + * slices to the appropriate position when multiplying different-sized + * numbers. + */ + private BigInteger getToomSlice(int lowerSize, int upperSize, int slice, + int fullsize) + { + int start, end, sliceSize, len, offset; + + len = mag.length; + offset = fullsize - len; + + if (slice == 0) + { + start = 0 - offset; + end = upperSize - 1 - offset; + } + else + { + start = upperSize + (slice-1)*lowerSize - offset; + end = start + lowerSize - 1; + } + + if (start < 0) + start = 0; + if (end < 0) + return ZERO; + + sliceSize = (end-start) + 1; + + if (sliceSize <= 0) + return ZERO; + + // While performing Toom-Cook, all slices are positive and + // the sign is adjusted when the final number is composed. + if (start==0 && sliceSize >= len) + return this.abs(); + + int intSlice[] = new int[sliceSize]; + System.arraycopy(mag, start, intSlice, 0, sliceSize); + + return new BigInteger(trustedStripLeadingZeroInts(intSlice), 1); + } + + /** + * Does an exact division (that is, the remainder is known to be zero) + * of the specified number by 3. This is used in Toom-Cook + * multiplication. This is an efficient algorithm that runs in linear + * time. If the argument is not exactly divisible by 3, results are + * undefined. Note that this is expected to be called with positive + * arguments only. + */ + private BigInteger exactDivideBy3() + { + int len = mag.length; + int[] result = new int[len]; + long x, w, q, borrow; + borrow = 0L; + for (int i=len-1; i>=0; i--) + { + x = (mag[i] & LONG_MASK); + w = x - borrow; + if (borrow > x) // Did we make the number go negative? + borrow = 1L; + else + borrow = 0L; + + // 0xAAAAAAAB is the modular inverse of 3 (mod 2^32). Thus, + // the effect of this is to divide by 3 (mod 2^32). + // This is much faster than division on most architectures. + q = (w * 0xAAAAAAABL) & LONG_MASK; + result[i] = (int) q; + + // Now check the borrow. The second check can of course be + // eliminated if the first fails. + if (q >= 0x55555556L) + { + borrow++; + if (q >= 0xAAAAAAABL) + borrow++; + } + } + result = trustedStripLeadingZeroInts(result); + return new BigInteger(result, signum); + } + + /** + * Returns a new BigInteger representing n lower ints of the number. + * This is used by Karatsuba multiplication and Karatsuba squaring. + */ + private BigInteger getLower(int n) { + int len = mag.length; + + if (len <= n) + return this; + + int lowerInts[] = new int[n]; + System.arraycopy(mag, len-n, lowerInts, 0, n); + + return new BigInteger(trustedStripLeadingZeroInts(lowerInts), 1); + } + + /** + * Returns a new BigInteger representing mag.length-n upper + * ints of the number. This is used by Karatsuba multiplication and + * Karatsuba squaring. + */ + private BigInteger getUpper(int n) { + int len = mag.length; + + if (len <= n) + return ZERO; + + int upperLen = len - n; + int upperInts[] = new int[upperLen]; + System.arraycopy(mag, 0, upperInts, 0, upperLen); + + return new BigInteger(trustedStripLeadingZeroInts(upperInts), 1); + } + + // Squaring + /** * Returns a BigInteger whose value is {@code (this2)}. * @@ -1409,8 +1770,18 @@ public class BigInteger extends Number implements Comparable { private BigInteger square() { if (signum == 0) return ZERO; - int[] z = squareToLen(mag, mag.length, null); - return new BigInteger(trustedStripLeadingZeroInts(z), 1); + int len = mag.length; + + if (len < KARATSUBA_SQUARE_THRESHOLD) + { + int[] z = squareToLen(mag, len, null); + return new BigInteger(trustedStripLeadingZeroInts(z), 1); + } + else + if (len < TOOM_COOK_SQUARE_THRESHOLD) + return squareKaratsuba(); + else + return squareToomCook3(); } /** @@ -1480,6 +1851,83 @@ public class BigInteger extends Number implements Comparable { return z; } + /** + * Squares a BigInteger using the Karatsuba squaring algorithm. It should + * be used when both numbers are larger than a certain threshold (found + * experimentally). It is a recursive divide-and-conquer algorithm that + * has better asymptotic performance than the algorithm used in + * squareToLen. + */ + private BigInteger squareKaratsuba() + { + int half = (mag.length+1) / 2; + + BigInteger xl = getLower(half); + BigInteger xh = getUpper(half); + + BigInteger xhs = xh.square(); // xhs = xh^2 + BigInteger xls = xl.square(); // xls = xl^2 + + // xh^2 << 64 + (((xl+xh)^2 - (xh^2 + xl^2)) << 32) + xl^2 + return xhs.shiftLeft(half*32).add(xl.add(xh).square().subtract(xhs.add(xls))).shiftLeft(half*32).add(xls); + } + + /** + * Squares a BigInteger using the 3-way Toom-Cook squaring algorithm. It + * should be used when both numbers are larger than a certain threshold + * (found experimentally). It is a recursive divide-and-conquer algorithm + * that has better asymptotic performance than the algorithm used in + * squareToLen or squareKaratsuba. + */ + private BigInteger squareToomCook3() + { + int len = mag.length; + + // k is the size (in ints) of the lower-order slices. + int k = (len+2)/3; // Equal to ceil(largest/3) + + // r is the size (in ints) of the highest-order slice. + int r = len - 2*k; + + // Obtain slices of the numbers. a2 is the most significant + // bits of the number, and a0 the least significant. + BigInteger a0, a1, a2; + a2 = getToomSlice(k, r, 0, len); + a1 = getToomSlice(k, r, 1, len); + a0 = getToomSlice(k, r, 2, len); + BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1; + + v0 = a0.square(); + da1 = a2.add(a0); + vm1 = da1.subtract(a1).square(); + da1 = da1.add(a1); + v1 = da1.square(); + vinf = a2.square(); + v2 = da1.add(a2).shiftLeft(1).subtract(a0).square(); + + /* The algorithm requires two divisions by 2 and one by 3. + All divisions are known to be exact, that is, they do not produce + remainders, and all results are positive. The divisions by 2 are + implemented as right shifts which are relatively efficient, leaving + only a division by 3. + The division by 3 is done by an optimized algorithm for this case. + */ + t2 = v2.subtract(vm1).exactDivideBy3(); + tm1 = v1.subtract(vm1).shiftRight(1); + t1 = v1.subtract(v0); + t2 = t2.subtract(t1).shiftRight(1); + t1 = t1.subtract(tm1).subtract(vinf); + t2 = t2.subtract(vinf.shiftLeft(1)); + tm1 = tm1.subtract(t2); + + // Number of bits to shift left. + int ss = k*32; + + return vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0); + } + + // Division + /** * Returns a BigInteger whose value is {@code (this / val)}. * @@ -1549,23 +1997,100 @@ public class BigInteger extends Number implements Comparable { if (signum==0) return (exponent==0 ? ONE : this); - // Perform exponentiation using repeated squaring trick - int newSign = (signum<0 && (exponent&1)==1 ? -1 : 1); - int[] baseToPow2 = this.mag; - int[] result = {1}; + BigInteger partToSquare = this.abs(); - while (exponent != 0) { - if ((exponent & 1)==1) { - result = multiplyToLen(result, result.length, - baseToPow2, baseToPow2.length, null); - result = trustedStripLeadingZeroInts(result); - } - if ((exponent >>>= 1) != 0) { - baseToPow2 = squareToLen(baseToPow2, baseToPow2.length, null); - baseToPow2 = trustedStripLeadingZeroInts(baseToPow2); - } + // Factor out powers of two from the base, as the exponentiation of + // these can be done by left shifts only. + // The remaining part can then be exponentiated faster. The + // powers of two will be multiplied back at the end. + int powersOfTwo = partToSquare.getLowestSetBit(); + + int remainingBits; + + // Factor the powers of two out quickly by shifting right, if needed. + if (powersOfTwo > 0) + { + partToSquare = partToSquare.shiftRight(powersOfTwo); + remainingBits = partToSquare.bitLength(); + if (remainingBits == 1) // Nothing left but +/- 1? + if (signum<0 && (exponent&1)==1) + return NEGATIVE_ONE.shiftLeft(powersOfTwo*exponent); + else + return ONE.shiftLeft(powersOfTwo*exponent); + } + else + { + remainingBits = partToSquare.bitLength(); + if (remainingBits == 1) // Nothing left but +/- 1? + if (signum<0 && (exponent&1)==1) + return NEGATIVE_ONE; + else + return ONE; + } + + // This is a quick way to approximate the size of the result, + // similar to doing log2[n] * exponent. This will give an upper bound + // of how big the result can be, and which algorithm to use. + int scaleFactor = remainingBits * exponent; + + // Use slightly different algorithms for small and large operands. + // See if the result will safely fit into a long. (Largest 2^63-1) + if (partToSquare.mag.length==1 && scaleFactor <= 62) + { + // Small number algorithm. Everything fits into a long. + int newSign = (signum<0 && (exponent&1)==1 ? -1 : 1); + long result = 1; + long baseToPow2 = partToSquare.mag[0] & LONG_MASK; + + int workingExponent = exponent; + + // Perform exponentiation using repeated squaring trick + while (workingExponent != 0) { + if ((workingExponent & 1)==1) + result = result * baseToPow2; + + if ((workingExponent >>>= 1) != 0) + baseToPow2 = baseToPow2 * baseToPow2; + } + + // Multiply back the powers of two (quickly, by shifting left) + if (powersOfTwo > 0) + { + int bitsToShift = powersOfTwo*exponent; + if (bitsToShift + scaleFactor <= 62) // Fits in long? + return valueOf((result << bitsToShift) * newSign); + else + return valueOf(result*newSign).shiftLeft(bitsToShift); + } + else + return valueOf(result*newSign); + } + else + { + // Large number algorithm. This is basically identical to + // the algorithm above, but calls multiply() and square() + // which may use more efficient algorithms for large numbers. + BigInteger answer = ONE; + + int workingExponent = exponent; + // Perform exponentiation using repeated squaring trick + while (workingExponent != 0) { + if ((workingExponent & 1)==1) + answer = answer.multiply(partToSquare); + + if ((workingExponent >>>= 1) != 0) + partToSquare = partToSquare.square(); + } + // Multiply back the (exponentiated) powers of two (quickly, + // by shifting left) + if (powersOfTwo > 0) + answer = answer.shiftLeft(powersOfTwo*exponent); + + if (signum<0 && (exponent&1)==1) + return answer.negate(); + else + return answer; } - return new BigInteger(result, newSign); } /** @@ -2117,7 +2642,7 @@ public class BigInteger extends Number implements Comparable { * Perform exponentiation using repeated squaring trick, chopping off * high order bits as indicated by modulus. */ - BigInteger result = valueOf(1); + BigInteger result = ONE; BigInteger baseToPow2 = this.mod2(p); int expOffset = 0; @@ -2812,6 +3337,28 @@ public class BigInteger extends Number implements Comparable { if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) radix = 10; + // If it's small enough, use smallToString. + if (mag.length <= SCHOENHAGE_BASE_CONVERSION_THRESHOLD) + return smallToString(radix); + + // Otherwise use recursive toString, which requires positive arguments. + // The results will be concatenated into this StringBuilder + StringBuilder sb = new StringBuilder(); + if (signum < 0) { + toString(this.negate(), sb, radix, 0); + sb.insert(0, '-'); + } + else + toString(this, sb, radix, 0); + + return sb.toString(); + } + + /** This method is used to perform toString when arguments are small. */ + private String smallToString(int radix) { + if (signum == 0) + return "0"; + // Compute upper bound on number of digit groups and allocate space int maxNumDigitGroups = (4*mag.length + 6)/7; String digitGroup[] = new String[maxNumDigitGroups]; @@ -2850,6 +3397,82 @@ public class BigInteger extends Number implements Comparable { return buf.toString(); } + /** + * Converts the specified BigInteger to a string and appends to + * sb. This implements the recursive Schoenhage algorithm + * for base conversions. + *

    + * See Knuth, Donald, _The Art of Computer Programming_, Vol. 2, + * Answers to Exercises (4.4) Question 14. + * + * @param u The number to convert to a string. + * @param sb The StringBuilder that will be appended to in place. + * @param radix The base to convert to. + * @param digits The minimum number of digits to pad to. + */ + private static void toString(BigInteger u, StringBuilder sb, int radix, + int digits) { + /* If we're smaller than a certain threshold, use the smallToString + method, padding with leading zeroes when necessary. */ + if (u.mag.length <= SCHOENHAGE_BASE_CONVERSION_THRESHOLD) { + String s = u.smallToString(radix); + + // Pad with internal zeros if necessary. + // Don't pad if we're at the beginning of the string. + if ((s.length() < digits) && (sb.length() > 0)) + for (int i=s.length(); i + * This could be changed to a more complicated caching method using + * Future. + */ + private static BigInteger getRadixConversionCache(int radix, int exponent) { + BigInteger[] cacheLine = powerCache[radix]; // volatile read + if (exponent < cacheLine.length) { + return cacheLine[exponent]; + } + + int oldLength = cacheLine.length; + cacheLine = Arrays.copyOf(cacheLine, exponent + 1); + for (int i = oldLength; i <= exponent; i++) { + cacheLine[i] = cacheLine[i - 1].pow(2); + } + + BigInteger[][] pc = powerCache; // volatile read again + if (exponent >= pc[radix].length) { + pc = pc.clone(); + pc[radix] = cacheLine; + powerCache = pc; // volatile write, publish + } + return cacheLine[exponent]; + } + /* zero[i] is a string of i consecutive zeros. */ private static String zeros[] = new String[64]; static { @@ -2966,8 +3589,72 @@ public class BigInteger extends Number implements Comparable { * @return this BigInteger converted to a {@code float}. */ public float floatValue() { - // Somewhat inefficient, but guaranteed to work. - return Float.parseFloat(this.toString()); + if (signum == 0) { + return 0.0f; + } + + int exponent = ((mag.length - 1) << 5) + bitLengthForInt(mag[0]) - 1; + + // exponent == floor(log2(abs(this))) + if (exponent < Long.SIZE - 1) { + return longValue(); + } else if (exponent > Float.MAX_EXPONENT) { + return signum > 0 ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY; + } + + /* + * We need the top SIGNIFICAND_WIDTH bits, including the "implicit" + * one bit. To make rounding easier, we pick out the top + * SIGNIFICAND_WIDTH + 1 bits, so we have one to help us round up or + * down. twiceSignifFloor will contain the top SIGNIFICAND_WIDTH + 1 + * bits, and signifFloor the top SIGNIFICAND_WIDTH. + * + * It helps to consider the real number signif = abs(this) * + * 2^(SIGNIFICAND_WIDTH - 1 - exponent). + */ + int shift = exponent - FloatConsts.SIGNIFICAND_WIDTH; + + int twiceSignifFloor; + // twiceSignifFloor will be == abs().shiftRight(shift).intValue() + // We do the shift into an int directly to improve performance. + + int nBits = shift & 0x1f; + int nBits2 = 32 - nBits; + + if (nBits == 0) { + twiceSignifFloor = mag[0]; + } else { + twiceSignifFloor = mag[0] >>> nBits; + if (twiceSignifFloor == 0) { + twiceSignifFloor = (mag[0] << nBits2) | (mag[1] >>> nBits); + } + } + + int signifFloor = twiceSignifFloor >> 1; + signifFloor &= FloatConsts.SIGNIF_BIT_MASK; // remove the implied bit + + /* + * We round up if either the fractional part of signif is strictly + * greater than 0.5 (which is true if the 0.5 bit is set and any lower + * bit is set), or if the fractional part of signif is >= 0.5 and + * signifFloor is odd (which is true if both the 0.5 bit and the 1 bit + * are set). This is equivalent to the desired HALF_EVEN rounding. + */ + boolean increment = (twiceSignifFloor & 1) != 0 + && ((signifFloor & 1) != 0 || abs().getLowestSetBit() < shift); + int signifRounded = increment ? signifFloor + 1 : signifFloor; + int bits = ((exponent + FloatConsts.EXP_BIAS)) + << (FloatConsts.SIGNIFICAND_WIDTH - 1); + bits += signifRounded; + /* + * If signifRounded == 2^24, we'd need to set all of the significand + * bits to zero and add 1 to the exponent. This is exactly the behavior + * we get from just adding signifRounded to bits directly. If the + * exponent is Float.MAX_EXPONENT, we round up (correctly) to + * Float.POSITIVE_INFINITY. + */ + bits |= signum & FloatConsts.SIGN_BIT_MASK; + return Float.intBitsToFloat(bits); } /** @@ -2986,8 +3673,80 @@ public class BigInteger extends Number implements Comparable { * @return this BigInteger converted to a {@code double}. */ public double doubleValue() { - // Somewhat inefficient, but guaranteed to work. - return Double.parseDouble(this.toString()); + if (signum == 0) { + return 0.0; + } + + int exponent = ((mag.length - 1) << 5) + bitLengthForInt(mag[0]) - 1; + + // exponent == floor(log2(abs(this))Double) + if (exponent < Long.SIZE - 1) { + return longValue(); + } else if (exponent > Double.MAX_EXPONENT) { + return signum > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY; + } + + /* + * We need the top SIGNIFICAND_WIDTH bits, including the "implicit" + * one bit. To make rounding easier, we pick out the top + * SIGNIFICAND_WIDTH + 1 bits, so we have one to help us round up or + * down. twiceSignifFloor will contain the top SIGNIFICAND_WIDTH + 1 + * bits, and signifFloor the top SIGNIFICAND_WIDTH. + * + * It helps to consider the real number signif = abs(this) * + * 2^(SIGNIFICAND_WIDTH - 1 - exponent). + */ + int shift = exponent - DoubleConsts.SIGNIFICAND_WIDTH; + + long twiceSignifFloor; + // twiceSignifFloor will be == abs().shiftRight(shift).longValue() + // We do the shift into a long directly to improve performance. + + int nBits = shift & 0x1f; + int nBits2 = 32 - nBits; + + int highBits; + int lowBits; + if (nBits == 0) { + highBits = mag[0]; + lowBits = mag[1]; + } else { + highBits = mag[0] >>> nBits; + lowBits = (mag[0] << nBits2) | (mag[1] >>> nBits); + if (highBits == 0) { + highBits = lowBits; + lowBits = (mag[1] << nBits2) | (mag[2] >>> nBits); + } + } + + twiceSignifFloor = ((highBits & LONG_MASK) << 32) + | (lowBits & LONG_MASK); + + long signifFloor = twiceSignifFloor >> 1; + signifFloor &= DoubleConsts.SIGNIF_BIT_MASK; // remove the implied bit + + /* + * We round up if either the fractional part of signif is strictly + * greater than 0.5 (which is true if the 0.5 bit is set and any lower + * bit is set), or if the fractional part of signif is >= 0.5 and + * signifFloor is odd (which is true if both the 0.5 bit and the 1 bit + * are set). This is equivalent to the desired HALF_EVEN rounding. + */ + boolean increment = (twiceSignifFloor & 1) != 0 + && ((signifFloor & 1) != 0 || abs().getLowestSetBit() < shift); + long signifRounded = increment ? signifFloor + 1 : signifFloor; + long bits = (long) ((exponent + DoubleConsts.EXP_BIAS)) + << (DoubleConsts.SIGNIFICAND_WIDTH - 1); + bits += signifRounded; + /* + * If signifRounded == 2^53, we'd need to set all of the significand + * bits to zero and add 1 to the exponent. This is exactly the behavior + * we get from just adding signifRounded to bits directly. If the + * exponent is Double.MAX_EXPONENT, we round up (correctly) to + * Double.POSITIVE_INFINITY. + */ + bits |= signum & DoubleConsts.SIGN_BIT_MASK; + return Double.longBitsToDouble(bits); } /** @@ -3218,21 +3977,21 @@ public class BigInteger extends Number implements Comparable { * little-endian binary representation of the magnitude (int 0 is the * least significant). If the magnitude is zero, return value is undefined. */ - private int firstNonzeroIntNum() { - int fn = firstNonzeroIntNum - 2; - if (fn == -2) { // firstNonzeroIntNum not initialized yet - fn = 0; + private int firstNonzeroIntNum() { + int fn = firstNonzeroIntNum - 2; + if (fn == -2) { // firstNonzeroIntNum not initialized yet + fn = 0; - // Search for the first nonzero int - int i; - int mlen = mag.length; - for (i = mlen - 1; i >= 0 && mag[i] == 0; i--) - ; - fn = mlen - i - 1; - firstNonzeroIntNum = fn + 2; // offset by two to initialize - } - return fn; - } + // Search for the first nonzero int + int i; + int mlen = mag.length; + for (i = mlen - 1; i >= 0 && mag[i] == 0; i--) + ; + fn = mlen - i - 1; + firstNonzeroIntNum = fn + 2; // offset by two to initialize + } + return fn; + } /** use serialVersionUID from JDK 1.1. for interoperability */ private static final long serialVersionUID = -8287574255936472291L; diff --git a/jdk/src/share/classes/java/math/RoundingMode.java b/jdk/src/share/classes/java/math/RoundingMode.java index 69994a4c316..41493a200e2 100644 --- a/jdk/src/share/classes/java/math/RoundingMode.java +++ b/jdk/src/share/classes/java/math/RoundingMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,6 +101,7 @@ public enum RoundingMode { * *

    Example: * + * * * @@ -124,6 +125,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode UP Examples
    Input NumberInput rounded to one digit
    with {@code UP} rounding *
    5.5 6
    + * * * @@ -148,6 +150,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode DOWN Examples
    Input NumberInput rounded to one digit
    with {@code DOWN} rounding *
    5.5 5
    + * * * @@ -172,6 +175,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode CEILING Examples
    Input NumberInput rounded to one digit
    with {@code CEILING} rounding *
    5.5 6
    + * * * @@ -198,6 +202,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode FLOOR Examples
    Input NumberInput rounded to one digit
    with {@code FLOOR} rounding *
    5.5 5
    + * * * @@ -223,6 +228,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode HALF_UP Examples
    Input NumberInput rounded to one digit
    with {@code HALF_UP} rounding *
    5.5 6
    + * * * @@ -255,6 +261,7 @@ public enum RoundingMode { * *

    Example: *

    Rounding mode HALF_DOWN Examples
    Input NumberInput rounded to one digit
    with {@code HALF_DOWN} rounding *
    5.5 5
    + * * * @@ -278,6 +285,7 @@ public enum RoundingMode { * {@code ArithmeticException} is thrown. *

    Example: *

    Rounding mode HALF_EVEN Examples
    Input NumberInput rounded to one digit
    with {@code HALF_EVEN} rounding *
    5.5 6
    + * * * diff --git a/jdk/src/share/classes/java/net/CookieManager.java b/jdk/src/share/classes/java/net/CookieManager.java index 90c7262b478..b8cae55342b 100644 --- a/jdk/src/share/classes/java/net/CookieManager.java +++ b/jdk/src/share/classes/java/net/CookieManager.java @@ -41,7 +41,7 @@ import sun.util.logging.PlatformLogger; * *

    The HTTP cookie management in java.net package looks like: *

    - *
    + * 
    {@code
      *                  use
      * CookieHandler <------- HttpURLConnection
      *       ^
    @@ -58,7 +58,7 @@ import sun.util.logging.PlatformLogger;
      *                            | impl
      *                            |
      *                  Internal in-memory implementation
    - * 
    + * }
    *
      *
    • * CookieHandler is at the core of cookie management. User can call @@ -284,7 +284,7 @@ public class CookieManager extends CookieHandler } catch (IllegalArgumentException e) { // Bogus header, make an empty list and log the error cookies = java.util.Collections.emptyList(); - if (logger.isLoggable(PlatformLogger.SEVERE)) { + if (logger.isLoggable(PlatformLogger.Level.SEVERE)) { logger.severe("Invalid cookie for " + uri + ": " + headerValue); } } @@ -309,7 +309,10 @@ public class CookieManager extends CookieHandler // there is no dot at the beginning of effective request-host, // the default Domain can only domain-match itself.) if (cookie.getDomain() == null) { - cookie.setDomain(uri.getHost()); + String host = uri.getHost(); + if (host != null && !host.contains(".")) + host += ".local"; + cookie.setDomain(host); } String ports = cookie.getPortlist(); if (ports != null) { diff --git a/jdk/src/share/classes/java/net/CookiePolicy.java b/jdk/src/share/classes/java/net/CookiePolicy.java index 63f07157bf7..3de98f904da 100644 --- a/jdk/src/share/classes/java/net/CookiePolicy.java +++ b/jdk/src/share/classes/java/net/CookiePolicy.java @@ -30,7 +30,7 @@ package java.net; * and which should be rejected. Three pre-defined policy implementations * are provided, namely ACCEPT_ALL, ACCEPT_NONE and ACCEPT_ORIGINAL_SERVER. * - *

      See RFC 2965 sec. 3.3 & 7 for more detail. + *

      See RFC 2965 sec. 3.3 and 7 for more detail. * * @author Edward Wang * @since 1.6 @@ -59,6 +59,8 @@ public interface CookiePolicy { */ public static final CookiePolicy ACCEPT_ORIGINAL_SERVER = new CookiePolicy(){ public boolean shouldAccept(URI uri, HttpCookie cookie) { + if (uri == null || cookie == null) + return false; return HttpCookie.domainMatches(cookie.getDomain(), uri.getHost()); } }; diff --git a/jdk/src/share/classes/java/net/DatagramSocket.java b/jdk/src/share/classes/java/net/DatagramSocket.java index ad0af4850d5..d6ffca23755 100644 --- a/jdk/src/share/classes/java/net/DatagramSocket.java +++ b/jdk/src/share/classes/java/net/DatagramSocket.java @@ -334,12 +334,12 @@ class DatagramSocket implements java.io.Closeable { } /** - * Binds this DatagramSocket to a specific address & port. + * Binds this DatagramSocket to a specific address and port. *

      * If the address is null, then the system will pick up * an ephemeral port and a valid local address to bind the socket. *

      - * @param addr The address & port to bind to. + * @param addr The address and port to bind to. * @throws SocketException if any error happens during the bind, or if the * socket is already bound. * @throws SecurityException if a security manager exists and its @@ -844,7 +844,7 @@ class DatagramSocket implements java.io.Closeable { * a java.net.SocketTimeoutException is raised, though the * DatagramSocket is still valid. The option must be enabled * prior to entering the blocking operation to have effect. The - * timeout must be > 0. + * timeout must be {@code > 0}. * A timeout of zero is interpreted as an infinite timeout. * * @param timeout the specified timeout in milliseconds. @@ -1101,8 +1101,8 @@ class DatagramSocket implements java.io.Closeable { * As the underlying network implementation may ignore this * value applications should consider it a hint. * - *

      The tc must be in the range 0 <= tc <= - * 255 or an IllegalArgumentException will be thrown. + *

      The tc must be in the range {@code 0 <= tc <= + * 255} or an IllegalArgumentException will be thrown. *

      Notes: *

      For Internet Protocol v4 the value consists of an * integer, the least significant 8 bits of which diff --git a/jdk/src/share/classes/java/net/HttpURLConnection.java b/jdk/src/share/classes/java/net/HttpURLConnection.java index 193b9cef1c1..b93f1e731bd 100644 --- a/jdk/src/share/classes/java/net/HttpURLConnection.java +++ b/jdk/src/share/classes/java/net/HttpURLConnection.java @@ -109,7 +109,7 @@ abstract public class HttpURLConnection extends URLConnection { * server. In this case, {@link #getHeaderField(int) getHeaderField(0)} returns the status * line, but getHeaderFieldKey(0) returns null. * - * @param n an index, where n >=0. + * @param n an index, where {@code n >=0}. * @return the key for the nth header field, * or null if the key does not exist. */ @@ -260,7 +260,7 @@ abstract public class HttpURLConnection extends URLConnection { * {@link #getHeaderFieldKey getHeaderFieldKey} method to iterate through all * the headers in the message. * - * @param n an index, where n>=0. + * @param n an index, where {@code n>=0}. * @return the value of the nth header field, * or null if the value does not exist. * @see java.net.HttpURLConnection#getHeaderFieldKey(int) diff --git a/jdk/src/share/classes/java/net/InetSocketAddress.java b/jdk/src/share/classes/java/net/InetSocketAddress.java index 4ad95043470..44604c664aa 100644 --- a/jdk/src/share/classes/java/net/InetSocketAddress.java +++ b/jdk/src/share/classes/java/net/InetSocketAddress.java @@ -389,7 +389,7 @@ public class InetSocketAddress * Two instances of InetSocketAddress represent the same * address if both the InetAddresses (or hostnames if it is unresolved) and port * numbers are equal. - * If both addresses are unresolved, then the hostname & the port number + * If both addresses are unresolved, then the hostname and the port number * are compared. * * Note: Hostnames are case insensitive. e.g. "FooBar" and "foobar" are diff --git a/jdk/src/share/classes/java/net/MulticastSocket.java b/jdk/src/share/classes/java/net/MulticastSocket.java index ad4c7566aa1..0a4d7c1023d 100644 --- a/jdk/src/share/classes/java/net/MulticastSocket.java +++ b/jdk/src/share/classes/java/net/MulticastSocket.java @@ -201,7 +201,7 @@ class MulticastSocket extends DatagramSocket { * scope of the multicasts. * *

      The ttl is an unsigned 8-bit quantity, and so must be - * in the range 0 <= ttl <= 0xFF . + * in the range {@code 0 <= ttl <= 0xFF }. * * @param ttl the time-to-live * @exception IOException if an I/O exception occurs diff --git a/jdk/src/share/classes/java/net/ServerSocket.java b/jdk/src/share/classes/java/net/ServerSocket.java index b47e4420e44..0b69ad6a266 100644 --- a/jdk/src/share/classes/java/net/ServerSocket.java +++ b/jdk/src/share/classes/java/net/ServerSocket.java @@ -316,7 +316,7 @@ class ServerSocket implements java.io.Closeable { * If the address is null, then the system will pick up * an ephemeral port and a valid local address to bind the socket. *

      - * @param endpoint The IP address & port number to bind to. + * @param endpoint The IP address and port number to bind to. * @throws IOException if the bind operation fails, or if the socket * is already bound. * @throws SecurityException if a SecurityManager is present and @@ -343,7 +343,7 @@ class ServerSocket implements java.io.Closeable { * or may choose to ignore the parameter altogther. The value provided * should be greater than 0. If it is less than or equal to * 0, then an implementation specific default will be used. - * @param endpoint The IP address & port number to bind to. + * @param endpoint The IP address and port number to bind to. * @param backlog requested maximum length of the queue of * incoming connections. * @throws IOException if the bind operation fails, or if the socket @@ -390,15 +390,29 @@ class ServerSocket implements java.io.Closeable { * If the socket was bound prior to being {@link #close closed}, * then this method will continue to return the local address * after the socket is closed. + *

      + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * the {@link InetAddress#getLoopbackAddress loopback} address is returned. * * @return the address to which this socket is bound, - * or null if the socket is unbound. + * or the loopback address if denied by the security manager, + * or {@code null} if the socket is unbound. + * + * @see SecurityManager#checkConnect */ public InetAddress getInetAddress() { if (!isBound()) return null; try { - return getImpl().getInetAddress(); + InetAddress in = getImpl().getInetAddress(); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkConnect(in.getHostAddress(), -1); + return in; + } catch (SecurityException e) { + return InetAddress.getLoopbackAddress(); } catch (SocketException e) { // nothing // If we're bound, the impl has been created @@ -431,18 +445,28 @@ class ServerSocket implements java.io.Closeable { } /** - * Returns the address of the endpoint this socket is bound to, or - * null if it is not bound yet. + * Returns the address of the endpoint this socket is bound to. *

      * If the socket was bound prior to being {@link #close closed}, * then this method will continue to return the address of the endpoint * after the socket is closed. + *

      + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link InetAddress#getLoopbackAddress loopback} address and the local + * port to which the socket is bound is returned. + * + * @return a {@code SocketAddress} representing the local endpoint of + * this socket, or a {@code SocketAddress} representing the + * loopback address if denied by the security manager, + * or {@code null} if the socket is not bound yet. * - * @return a SocketAddress representing the local endpoint of this - * socket, or null if it is not bound yet. * @see #getInetAddress() * @see #getLocalPort() * @see #bind(SocketAddress) + * @see SecurityManager#checkConnect * @since 1.4 */ @@ -614,7 +638,7 @@ class ServerSocket implements java.io.Closeable { * a java.net.SocketTimeoutException is raised, though the * ServerSocket is still valid. The option must be enabled * prior to entering the blocking operation to have effect. The - * timeout must be > 0. + * timeout must be {@code > 0}. * A timeout of zero is interpreted as an infinite timeout. * @param timeout the specified timeout, in milliseconds * @exception SocketException if there is an error in @@ -709,13 +733,25 @@ class ServerSocket implements java.io.Closeable { /** * Returns the implementation address and implementation port of * this socket as a String. + *

      + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * an {@code InetAddress} representing the + * {@link InetAddress#getLoopbackAddress loopback} address is returned as + * the implementation address. * * @return a string representation of this socket. */ public String toString() { if (!isBound()) return "ServerSocket[unbound]"; - return "ServerSocket[addr=" + impl.getInetAddress() + + InetAddress in; + if (System.getSecurityManager() != null) + in = InetAddress.getLoopbackAddress(); + else + in = impl.getInetAddress(); + return "ServerSocket[addr=" + in + ",localport=" + impl.getLocalPort() + "]"; } diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java index e0635c1bf9f..8ab5e866ee2 100644 --- a/jdk/src/share/classes/java/net/Socket.java +++ b/jdk/src/share/classes/java/net/Socket.java @@ -682,11 +682,18 @@ class Socket implements java.io.Closeable { /** * Gets the local address to which the socket is bound. + *

      + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * the {@link InetAddress#getLoopbackAddress loopback} address is returned. * - * @return the local address to which the socket is bound, or - * the {@link InetAddress#isAnyLocalAddress wildcard} address - * if the socket is closed or not bound yet. + * @return the local address to which the socket is bound, + * the loopback address if denied by the security manager, or + * the wildcard address if the socket is closed or not bound yet. * @since JDK1.1 + * + * @see SecurityManager#checkConnect */ public InetAddress getLocalAddress() { // This is for backward compatibility @@ -695,9 +702,14 @@ class Socket implements java.io.Closeable { InetAddress in = null; try { in = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkConnect(in.getHostAddress(), -1); if (in.isAnyLocalAddress()) { in = InetAddress.anyLocalAddress(); } + } catch (SecurityException e) { + in = InetAddress.getLoopbackAddress(); } catch (Exception e) { in = InetAddress.anyLocalAddress(); // "0.0.0.0" } @@ -770,8 +782,7 @@ class Socket implements java.io.Closeable { } /** - * Returns the address of the endpoint this socket is bound to, or - * null if it is not bound yet. + * Returns the address of the endpoint this socket is bound to. *

      * If a socket bound to an endpoint represented by an * InetSocketAddress is {@link #close closed}, @@ -780,12 +791,23 @@ class Socket implements java.io.Closeable { * InetSocketAddress's address is the * {@link InetAddress#isAnyLocalAddress wildcard} address * and its port is the local port that it was bound to. + *

      + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link InetAddress#getLoopbackAddress loopback} address and the local + * port to which this socket is bound is returned. + * + * @return a {@code SocketAddress} representing the local endpoint of + * this socket, or a {@code SocketAddress} representing the + * loopback address if denied by the security manager, or + * {@code null} if the socket is not bound yet. * - * @return a SocketAddress representing the local endpoint of this - * socket, or null if it is not bound yet. * @see #getLocalAddress() * @see #getLocalPort() * @see #bind(SocketAddress) + * @see SecurityManager#checkConnect * @since 1.4 */ @@ -1086,7 +1108,7 @@ class Socket implements java.io.Closeable { * expires, a java.net.SocketTimeoutException is raised, though the * Socket is still valid. The option must be enabled * prior to entering the blocking operation to have effect. The - * timeout must be > 0. + * timeout must be {@code > 0}. * A timeout of zero is interpreted as an infinite timeout. * * @param timeout the specified timeout, in milliseconds. @@ -1295,8 +1317,8 @@ class Socket implements java.io.Closeable { * As the underlying network implementation may ignore this * value applications should consider it a hint. * - *

      The tc must be in the range 0 <= tc <= - * 255 or an IllegalArgumentException will be thrown. + *

      The tc must be in the range {@code 0 <= tc <= + * 255} or an IllegalArgumentException will be thrown. *

      Notes: *

      For Internet Protocol v4 the value consists of an * integer, the least significant 8 bits of which diff --git a/jdk/src/share/classes/java/net/SocksSocketImpl.java b/jdk/src/share/classes/java/net/SocksSocketImpl.java index dec3eb38777..16155d2f115 100644 --- a/jdk/src/share/classes/java/net/SocksSocketImpl.java +++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java @@ -28,6 +28,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.BufferedOutputStream; import java.security.AccessController; +import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import sun.net.SocksProxy; import sun.net.www.ParseUtil; @@ -590,7 +591,13 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { /* Test for AnyLocal */ InetAddress naddr = baddr; if (naddr.isAnyLocalAddress()) { - naddr = cmdsock.getLocalAddress(); + naddr = AccessController.doPrivileged( + new PrivilegedAction() { + public InetAddress run() { + return cmdsock.getLocalAddress(); + + } + }); addr1 = naddr.getAddress(); } out.write(PROTO_VERS4); diff --git a/jdk/src/share/classes/java/net/StandardSocketOptions.java b/jdk/src/share/classes/java/net/StandardSocketOptions.java index 9aeed2b5a28..84fedd804f1 100644 --- a/jdk/src/share/classes/java/net/StandardSocketOptions.java +++ b/jdk/src/share/classes/java/net/StandardSocketOptions.java @@ -277,8 +277,8 @@ public final class StandardSocketOptions { * The time-to-live for Internet Protocol (IP) multicast datagrams. * *

      The value of this socket option is an {@code Integer} in the range - * 0 <= value <= 255. It is used to control - * the scope of multicast datagrams sent by the datagram-oriented socket. + * {@code 0 <= value <= 255}. It is used to control the scope of multicast + * datagrams sent by the datagram-oriented socket. * In the case of an {@link StandardProtocolFamily#INET IPv4} socket * the option is the time-to-live (TTL) on multicast datagrams sent by the * socket. Datagrams with a TTL of zero are not transmitted on the network diff --git a/jdk/src/share/classes/java/net/URI.java b/jdk/src/share/classes/java/net/URI.java index b4b22ded16b..ed90f090c29 100644 --- a/jdk/src/share/classes/java/net/URI.java +++ b/jdk/src/share/classes/java/net/URI.java @@ -258,7 +258,7 @@ import java.lang.NullPointerException; // for javadoc *

    * - * + * * * diff --git a/jdk/src/share/classes/java/net/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java index f1c51880734..b69c00f94a3 100644 --- a/jdk/src/share/classes/java/net/URLConnection.java +++ b/jdk/src/share/classes/java/net/URLConnection.java @@ -662,7 +662,7 @@ public abstract class URLConnection { * Returns the key for the nth header field. * It returns null if there are fewer than n+1 fields. * - * @param n an index, where n>=0 + * @param n an index, where {@code n>=0} * @return the key for the nth header field, * or null if there are fewer than n+1 * fields. @@ -680,7 +680,7 @@ public abstract class URLConnection { * {@link #getHeaderFieldKey(int) getHeaderFieldKey} method to iterate through all * the headers in the message. * - * @param n an index, where n>=0 + * @param n an index, where {@code n>=0} * @return the value of the nth header field * or null if there are fewer than n+1 fields * @see java.net.URLConnection#getHeaderFieldKey(int) diff --git a/jdk/src/share/classes/java/nio/Buffer.java b/jdk/src/share/classes/java/nio/Buffer.java index 24d3cf8c56a..f5a9cd4f675 100644 --- a/jdk/src/share/classes/java/nio/Buffer.java +++ b/jdk/src/share/classes/java/nio/Buffer.java @@ -52,7 +52,7 @@ import java.util.Spliterator; *

    There is one subclass of this class for each non-boolean primitive type. * * - *

    Transferring data

    + *

    Transferring data

    * *

    Each subclass of this class defines two categories of get and * put operations:

    @@ -78,7 +78,7 @@ import java.util.Spliterator; * current position. * * - *

    Marking and resetting

    + *

    Marking and resetting

    * *

    A buffer's mark is the index to which its position will be reset * when the {@link #reset reset} method is invoked. The mark is not always @@ -89,7 +89,7 @@ import java.util.Spliterator; * {@link InvalidMarkException} to be thrown. * * - *

    Invariants

    + *

    Invariants

    * *

    The following invariant holds for the mark, position, limit, and * capacity values: @@ -109,7 +109,7 @@ import java.util.Spliterator; * to zero. * * - *

    Clearing, flipping, and rewinding

    + *

    Clearing, flipping, and rewinding

    * *

    In addition to methods for accessing the position, limit, and capacity * values and for marking and resetting, this class also defines the following @@ -132,7 +132,7 @@ import java.util.Spliterator; * * * - *

    Read-only buffers

    + *

    Read-only buffers

    * *

    Every buffer is readable, but not every buffer is writable. The * mutation methods of each buffer class are specified as optional @@ -143,14 +143,14 @@ import java.util.Spliterator; * {@link #isReadOnly isReadOnly} method. * * - *

    Thread safety

    + *

    Thread safety

    * *

    Buffers are not safe for use by multiple concurrent threads. If a * buffer is to be used by more than one thread then access to the buffer * should be controlled by appropriate synchronization. * * - *

    Invocation chaining

    + *

    Invocation chaining

    * *

    Methods in this class that do not otherwise have a value to return are * specified to return the buffer upon which they are invoked. This allows @@ -209,7 +209,7 @@ public abstract class Buffer { } /** - * Returns this buffer's capacity.

    + * Returns this buffer's capacity. * * @return The capacity of this buffer */ @@ -218,7 +218,7 @@ public abstract class Buffer { } /** - * Returns this buffer's position.

    + * Returns this buffer's position. * * @return The position of this buffer */ @@ -228,7 +228,7 @@ public abstract class Buffer { /** * Sets this buffer's position. If the mark is defined and larger than the - * new position then it is discarded.

    + * new position then it is discarded. * * @param newPosition * The new position value; must be non-negative @@ -248,7 +248,7 @@ public abstract class Buffer { } /** - * Returns this buffer's limit.

    + * Returns this buffer's limit. * * @return The limit of this buffer */ @@ -259,7 +259,7 @@ public abstract class Buffer { /** * Sets this buffer's limit. If the position is larger than the new limit * then it is set to the new limit. If the mark is defined and larger than - * the new limit then it is discarded.

    + * the new limit then it is discarded. * * @param newLimit * The new limit value; must be non-negative @@ -280,7 +280,7 @@ public abstract class Buffer { } /** - * Sets this buffer's mark at its position.

    + * Sets this buffer's mark at its position. * * @return This buffer */ @@ -383,7 +383,7 @@ public abstract class Buffer { /** * Returns the number of elements between the current position and the - * limit.

    + * limit. * * @return The number of elements remaining in this buffer */ @@ -393,7 +393,7 @@ public abstract class Buffer { /** * Tells whether there are any elements between the current position and - * the limit.

    + * the limit. * * @return true if, and only if, there is at least one element * remaining in this buffer @@ -403,7 +403,7 @@ public abstract class Buffer { } /** - * Tells whether or not this buffer is read-only.

    + * Tells whether or not this buffer is read-only. * * @return true if, and only if, this buffer is read-only */ @@ -477,7 +477,7 @@ public abstract class Buffer { /** * Tells whether or not this buffer is - * direct.

    + * direct. * * @return true if, and only if, this buffer is direct * @@ -491,7 +491,7 @@ public abstract class Buffer { /** * Checks the current position against the limit, throwing a {@link * BufferUnderflowException} if it is not smaller than the limit, and then - * increments the position.

    + * increments the position. * * @return The current position value, before it is incremented */ @@ -512,7 +512,7 @@ public abstract class Buffer { /** * Checks the current position against the limit, throwing a {@link * BufferOverflowException} if it is not smaller than the limit, and then - * increments the position.

    + * increments the position. * * @return The current position value, before it is incremented */ diff --git a/jdk/src/share/classes/java/nio/ByteOrder.java b/jdk/src/share/classes/java/nio/ByteOrder.java index aed6c0095bc..50c7f158b0a 100644 --- a/jdk/src/share/classes/java/nio/ByteOrder.java +++ b/jdk/src/share/classes/java/nio/ByteOrder.java @@ -45,7 +45,6 @@ public final class ByteOrder { /** * Constant denoting big-endian byte order. In this order, the bytes of a * multibyte value are ordered from most significant to least significant. - *

    */ public static final ByteOrder BIG_ENDIAN = new ByteOrder("BIG_ENDIAN"); @@ -53,7 +52,7 @@ public final class ByteOrder { /** * Constant denoting little-endian byte order. In this order, the bytes of * a multibyte value are ordered from least significant to most - * significant.

    + * significant. */ public static final ByteOrder LITTLE_ENDIAN = new ByteOrder("LITTLE_ENDIAN"); diff --git a/jdk/src/share/classes/java/nio/CharBufferSpliterator.java b/jdk/src/share/classes/java/nio/CharBufferSpliterator.java index 19fd8a8f0ba..5b3977ae764 100644 --- a/jdk/src/share/classes/java/nio/CharBufferSpliterator.java +++ b/jdk/src/share/classes/java/nio/CharBufferSpliterator.java @@ -5,7 +5,7 @@ * 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 + * 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 diff --git a/jdk/src/share/classes/java/nio/MappedByteBuffer.java b/jdk/src/share/classes/java/nio/MappedByteBuffer.java index 1d26276f10c..25aa60e0b10 100644 --- a/jdk/src/share/classes/java/nio/MappedByteBuffer.java +++ b/jdk/src/share/classes/java/nio/MappedByteBuffer.java @@ -45,7 +45,7 @@ import sun.misc.Unsafe; * this program or another. Whether or not such changes occur, and when they * occur, is operating-system dependent and therefore unspecified. * - *

    All or part of a mapped byte buffer may become + *

    All or part of a mapped byte buffer may become * inaccessible at any time, for example if the mapped file is truncated. An * attempt to access an inaccessible region of a mapped byte buffer will not * change the buffer's content and will cause an unspecified exception to be diff --git a/jdk/src/share/classes/java/nio/X-Buffer.java.template b/jdk/src/share/classes/java/nio/X-Buffer.java.template index 475818d300d..03a7255c16a 100644 --- a/jdk/src/share/classes/java/nio/X-Buffer.java.template +++ b/jdk/src/share/classes/java/nio/X-Buffer.java.template @@ -44,23 +44,23 @@ import java.util.stream.$Streamtype$Stream; * *

      * - *
    • Absolute and relative {@link #get() get} and - * {@link #put($type$) put} methods that read and write + *

    • Absolute and relative {@link #get() get} and + * {@link #put($type$) put} methods that read and write * single $type$s;

    • * - *
    • Relative {@link #get($type$[]) bulk get} + *

    • Relative {@link #get($type$[]) bulk get} * methods that transfer contiguous sequences of $type$s from this buffer * into an array; {#if[!byte]?and}

    • * - *
    • Relative {@link #put($type$[]) bulk put} + *

    • Relative {@link #put($type$[]) bulk put} * methods that transfer contiguous sequences of $type$s from $a$ * $type$ array{#if[char]?, a string,} or some other $type$ * buffer into this buffer;{#if[!byte]? and}

    • * #if[byte] * - *
    • Absolute and relative {@link #getChar() get} - * and {@link #putChar(char) put} methods that read and + *

    • Absolute and relative {@link #getChar() get} + * and {@link #putChar(char) put} methods that read and * write values of other primitive types, translating them to and from * sequences of bytes in a particular byte order;

    • * @@ -70,23 +70,23 @@ import java.util.stream.$Streamtype$Stream; * #end[byte] * - *
    • Methods for {@link #compact compacting}, {@link - * #duplicate duplicating}, and {@link #slice - * slicing} $a$ $type$ buffer.

    • + *
    • Methods for {@link #compact compacting}, {@link + * #duplicate duplicating}, and {@link #slice slicing} + * $a$ $type$ buffer.

    • * *
    * *

    $Type$ buffers can be created either by {@link #allocate - * allocation}, which allocates space for the buffer's + * allocation}, which allocates space for the buffer's * #if[byte] * - * content, or by {@link #wrap($type$[]) wrapping} an + * content, or by {@link #wrap($type$[]) wrapping} an * existing $type$ array {#if[char]?or string} into a buffer. * #else[byte] * - * content, by {@link #wrap($type$[]) wrapping} an existing + * content, by {@link #wrap($type$[]) wrapping} an existing * $type$ array {#if[char]?or string} into a buffer, or by creating a * view of an existing byte buffer. * @@ -94,8 +94,8 @@ import java.util.stream.$Streamtype$Stream; * #if[byte] * - * - *

    Direct vs. non-direct buffers

    + * + *

    Direct vs. non-direct buffers

    * *

    A byte buffer is either direct or non-direct. Given a * direct byte buffer, the Java virtual machine will make a best effort to @@ -116,7 +116,7 @@ import java.util.stream.$Streamtype$Stream; * buffers only when they yield a measureable gain in program performance. * *

    A direct byte buffer may also be created by {@link - * java.nio.channels.FileChannel#map mapping} a region of a file + * java.nio.channels.FileChannel#map mapping} a region of a file * directly into memory. An implementation of the Java platform may optionally * support the creation of direct byte buffers from native code via JNI. If an * instance of one of these kinds of buffers refers to an inaccessible region @@ -129,8 +129,8 @@ import java.util.stream.$Streamtype$Stream; * that explicit buffer management can be done in performance-critical code. * * - * - *

    Access to binary data

    + * + *

    Access to binary data

    * *

    This class defines methods for reading and writing values of all other * primitive types, except boolean. Primitive values are translated @@ -156,7 +156,7 @@ import java.util.stream.$Streamtype$Stream; * parameters of the absolute get and put methods are in terms of * bytes rather than of the type being read or written. * - * + * * *

    For access to homogeneous binary data, that is, sequences of values of * the same type, this class defines methods that can create views of a @@ -214,7 +214,7 @@ import java.util.stream.$Streamtype$Stream; #end[char] * #if[byte] - *

    Invocation chaining

    + *

    Invocation chaining

    #end[byte] * *

    Methods in this class that do not otherwise have a value to return are @@ -297,7 +297,7 @@ public abstract class $Type$Buffer *

    The new buffer's position will be zero, its limit will be its * capacity, its mark will be undefined, and each of its elements will be * initialized to zero. Whether or not it has a - * {@link #hasArray backing array} is unspecified. + * {@link #hasArray backing array} is unspecified. * * @param capacity * The new buffer's capacity, in $type$s @@ -318,9 +318,8 @@ public abstract class $Type$Buffer * *

    The new buffer's position will be zero, its limit will be its * capacity, its mark will be undefined, and each of its elements will be - * initialized to zero. It will have a {@link #array - * backing array}, and its {@link #arrayOffset array - * offset} will be zero. + * initialized to zero. It will have a {@link #array backing array}, + * and its {@link #arrayOffset array offset} will be zero. * * @param capacity * The new buffer's capacity, in $type$s @@ -344,8 +343,8 @@ public abstract class $Type$Buffer * and vice versa. The new buffer's capacity will be * array.length, its position will be offset, its limit * will be offset + length, and its mark will be undefined. Its - * {@link #array backing array} will be the given array, and - * its {@link #arrayOffset array offset} will be zero.

    + * {@link #array backing array} will be the given array, and + * its {@link #arrayOffset array offset} will be zero.

    * * @param array * The array that will back the new buffer @@ -384,8 +383,8 @@ public abstract class $Type$Buffer * that is, modifications to the buffer will cause the array to be modified * and vice versa. The new buffer's capacity and limit will be * array.length, its position will be zero, and its mark will be - * undefined. Its {@link #array
    backing array} will be the - * given array, and its {@link #arrayOffset array offset} will + * undefined. Its {@link #array backing array} will be the + * given array, and its {@link #arrayOffset array offset>} will * be zero.

    * * @param array @@ -551,7 +550,7 @@ public abstract class $Type$Buffer /** * Relative get method. Reads the $type$ at this buffer's - * current position, and then increments the position.

    + * current position, and then increments the position. * * @return The $type$ at the buffer's current position * @@ -581,7 +580,7 @@ public abstract class $Type$Buffer /** * Absolute get method. Reads the $type$ at the given - * index.

    + * index. * * @param index * The index from which the $type$ will be read @@ -652,12 +651,13 @@ public abstract class $Type$Buffer * src.get(dst, off, len) has exactly the same effect as * the loop * - *
    +     * 
    {@code
          *     for (int i = off; i < off + len; i++)
    -     *         dst[i] = src.get(); 
    + * dst[i] = src.get(): + * }
    * * except that it first checks that there are sufficient $type$s in - * this buffer and it is potentially much more efficient.

    + * this buffer and it is potentially much more efficient. * * @param dst * The array into which $type$s are to be written @@ -702,6 +702,9 @@ public abstract class $Type$Buffer *
          *     src.get(a, 0, a.length) 
    * + * @param dst + * The destination array + * * @return This buffer * * @throws BufferUnderflowException @@ -738,7 +741,7 @@ public abstract class $Type$Buffer * dst.put(src.get()); * * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient.

    + * buffer and it is potentially much more efficient. * * @param src * The source buffer from which $type$s are to be read; @@ -788,12 +791,13 @@ public abstract class $Type$Buffer * dst.put(src, off, len) has exactly the same effect as * the loop * - *
    +     * 
    {@code
          *     for (int i = off; i < off + len; i++)
    -     *         dst.put(a[i]); 
    + * dst.put(a[i]); + * }
    * * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient.

    + * buffer and it is potentially much more efficient. * * @param src * The array from which $type$s are to be read @@ -840,6 +844,9 @@ public abstract class $Type$Buffer *
          *     dst.put(a, 0, a.length) 
    * + * @param src + * The source array + * * @return This buffer * * @throws BufferOverflowException @@ -874,12 +881,13 @@ public abstract class $Type$Buffer * dst.put(src, start, end) has exactly the same effect * as the loop * - *
    +     * 
    {@code
          *     for (int i = start; i < end; i++)
    -     *         dst.put(src.charAt(i)); 
    + * dst.put(src.charAt(i)); + * }
    * * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient.

    + * buffer and it is potentially much more efficient. * * @param src * The string from which $type$s are to be read @@ -927,6 +935,9 @@ public abstract class $Type$Buffer *
          *     dst.put(s, 0, s.length()) 
    * + * @param src + * The source string + * * @return This buffer * * @throws BufferOverflowException @@ -1038,12 +1049,13 @@ public abstract class $Type$Buffer * write was incomplete. The following loop, for example, copies bytes * from one channel to another via the buffer buf: * - *
    -     * buf.clear();          // Prepare buffer for use
    -     * while (in.read(buf) >= 0 || buf.position != 0) {
    -     *     buf.flip();
    -     *     out.write(buf);
    -     *     buf.compact();    // In case of partial write
    +     * 
    {@code
    +     *   buf.clear();          // Prepare buffer for use
    +     *   while (in.read(buf) >= 0 || buf.position != 0) {
    +     *       buf.flip();
    +     *       out.write(buf);
    +     *       buf.compact();    // In case of partial write
    +     *   }
          * }
    * #end[byte] @@ -1056,7 +1068,7 @@ public abstract class $Type$Buffer public abstract $Type$Buffer compact(); /** - * Tells whether or not this $type$ buffer is direct.

    + * Tells whether or not this $type$ buffer is direct. * * @return true if, and only if, this buffer is direct */ @@ -1065,7 +1077,7 @@ public abstract class $Type$Buffer #if[!char] /** - * Returns a string summarizing the state of this buffer.

    + * Returns a string summarizing the state of this buffer. * * @return A summary string */ @@ -1250,7 +1262,7 @@ public abstract class $Type$Buffer /** * Reads the character at the given index relative to the current - * position.

    + * position. * * @param index * The index of the character to be read, relative to the position; @@ -1415,7 +1427,7 @@ public abstract class $Type$Buffer * *

    The byte order of $a$ $type$ buffer created by allocation or by * wrapping an existing $type$ array is the {@link - * ByteOrder#nativeOrder native order} of the underlying + * ByteOrder#nativeOrder native order} of the underlying * hardware. The byte order of $a$ $type$ buffer created as a view of a byte buffer is that of the * byte buffer at the moment that the view is created.

    @@ -1448,7 +1460,7 @@ public abstract class $Type$Buffer } /** - * Modifies this buffer's byte order.

    + * Modifies this buffer's byte order. * * @param bo * The new byte order, diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousByteChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousByteChannel.java index 9fdf7530d16..47ffc87a80b 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousByteChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousByteChannel.java @@ -87,6 +87,8 @@ public interface AsynchronousByteChannel * initiates a read operation before a previous read operation has * completed then a {@link ReadPendingException} will be thrown. * + * @param + * The type of the attachment * @param dst * The buffer into which bytes are to be transferred * @param attachment @@ -166,6 +168,8 @@ public interface AsynchronousByteChannel * initiates a write operation before a previous write operation has * completed then a {@link WritePendingException} will be thrown. * + * @param + * The type of the attachment * @param src * The buffer from which bytes are to be retrieved * @param attachment diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousChannel.java index 5aa9fe23b38..98e30d05e79 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousChannel.java @@ -61,7 +61,7 @@ import java.util.concurrent.Future; // javadoc * may not allow more than one read and one write operation to be outstanding at * any given time. * - *

    Cancellation

    + *

    Cancellation

    * *

    The {@code Future} interface defines the {@link Future#cancel cancel} * method to cancel execution. This causes all threads waiting on the result of diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java index 2eb4b5219d2..ace607323cb 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java @@ -60,7 +60,7 @@ import java.util.concurrent.TimeUnit; * default group is not configured then the pooled threads of the default group * are {@link Thread#isDaemon daemon} threads. * - *

    Rounding mode UNNECESSARY Examples
    Input NumberInput rounded to one digit
    with {@code UNNECESSARY} rounding *
    5.5 throw {@code ArithmeticException}All alphanum characters together with those in the string * "_-!.~'()*"
    punctThe characters in the string ",;:$&+="
    The characters in the string ",;:$&+="
    reservedAll punct characters together with those in the string * "?/[]@"
    + *
    * * * @@ -89,7 +89,7 @@ import java.util.concurrent.TimeUnit; * *
    System propertyDescription
    * - *

    Threading

    + *

    Threading

    * *

    The completion handler for an I/O operation initiated on a channel bound * to a group is guaranteed to be invoked by one of the pooled threads in the @@ -104,7 +104,7 @@ import java.util.concurrent.TimeUnit; * handler directly by the initiating thread (see {@link * AsynchronousServerSocketChannel#accept(Object,CompletionHandler) accept}). * - *

    Shutdown and Termination

    + *

    Shutdown and Termination

    * *

    The {@link #shutdown() shutdown} method is used to initiate an orderly * shutdown of a group. An orderly shutdown marks the group as shutdown; diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java index b1c6e788c50..c40fb376287 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousFileChannel.java @@ -425,6 +425,8 @@ public abstract class AsynchronousFileChannel * They are not suitable for controlling access to a file by multiple * threads within the same virtual machine. * + * @param + * The type of the attachment * @param position * The position at which the locked region is to start; must be * non-negative @@ -473,6 +475,8 @@ public abstract class AsynchronousFileChannel * ch.{@link #lock(long,long,boolean,Object,CompletionHandler) lock}(0L, Long.MAX_VALUE, false, att, handler) * * + * @param + * The type of the attachment * @param attachment * The object to attach to the I/O operation; can be {@code null} * @param handler @@ -652,6 +656,8 @@ public abstract class AsynchronousFileChannel * If the given file position is greater than the file's size at the time * that the read is attempted then no bytes are read. * + * @param + * The type of the attachment * @param dst * The buffer into which bytes are to be transferred * @param position @@ -716,6 +722,8 @@ public abstract class AsynchronousFileChannel * bytes; the values of any bytes between the previous end-of-file and the * newly-written bytes are unspecified. * + * @param + * The type of the attachment * @param src * The buffer from which bytes are to be transferred * @param position diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java index 471b53571cb..75882008bd1 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java @@ -52,7 +52,7 @@ import java.io.IOException; *

    Socket options are configured using the {@link #setOption(SocketOption,Object) * setOption} method. Channels of this type support the following options: *

    - * + *
    * * * @@ -98,6 +98,9 @@ public abstract class AsynchronousServerSocketChannel /** * Initializes a new instance of this class. + * + * @param provider + * The provider that created this channel */ protected AsynchronousServerSocketChannel(AsynchronousChannelProvider provider) { this.provider = provider; @@ -105,6 +108,8 @@ public abstract class AsynchronousServerSocketChannel /** * Returns the provider that created this channel. + * + * @return The provider that created this channel */ public final AsynchronousChannelProvider provider() { return provider; @@ -253,7 +258,7 @@ public abstract class AsynchronousServerSocketChannel *

    To allow for concurrent handling of new connections, the completion * handler is not invoked directly by the initiating thread when a new * connection is accepted immediately (see Threading). + * href="AsynchronousChannelGroup.html#threading">Threading). * *

    If a security manager has been installed then it verifies that the * address and port number of the connection's remote endpoint are permitted @@ -263,6 +268,8 @@ public abstract class AsynchronousServerSocketChannel * the connection is closed and the operation completes with a {@link * SecurityException}. * + * @param + * The type of the attachment * @param attachment * The object to attach to the I/O operation; can be {@code null} * @param handler @@ -297,4 +304,25 @@ public abstract class AsynchronousServerSocketChannel * If this channel's socket has not yet been bound */ public abstract Future accept(); + + /** + * {@inheritDoc} + *

    + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link java.net.InetAddress#getLoopbackAddress loopback} address and the + * local port of the channel's socket is returned. + * + * @return The {@code SocketAddress} that the socket is bound to, or the + * {@code SocketAddress} representing the loopback address if + * denied by the security manager, or {@code null} if the + * channel's socket is not bound + * + * @throws ClosedChannelException {@inheritDoc} + * @throws IOException {@inheritDoc} + */ + @Override + public abstract SocketAddress getLocalAddress() throws IOException; } diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java index 8cde54dd7ac..2c2a1a306d5 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java @@ -62,7 +62,7 @@ import java.nio.ByteBuffer; *

    Socket options are configured using the {@link #setOption(SocketOption,Object) * setOption} method. Asynchronous socket channels support the following options: *

    - *
    Option NameDescription
    + *
    * * * @@ -91,7 +91,7 @@ import java.nio.ByteBuffer; * * Additional (implementation specific) options may also be supported. * - *

    Timeouts

    + *

    Timeouts

    * *

    The {@link #read(ByteBuffer,long,TimeUnit,Object,CompletionHandler) read} * and {@link #write(ByteBuffer,long,TimeUnit,Object,CompletionHandler) write} @@ -123,6 +123,9 @@ public abstract class AsynchronousSocketChannel /** * Initializes a new instance of this class. + * + * @param provider + * The provider that created this channel */ protected AsynchronousSocketChannel(AsynchronousChannelProvider provider) { this.provider = provider; @@ -130,6 +133,8 @@ public abstract class AsynchronousSocketChannel /** * Returns the provider that created this channel. + * + * @return The provider that created this channel */ public final AsynchronousChannelProvider provider() { return provider; @@ -287,6 +292,8 @@ public abstract class AsynchronousSocketChannel * java.lang.SecurityManager#checkConnect checkConnect} method permits * connecting to the address and port number of the given remote endpoint. * + * @param + * The type of the attachment * @param remote * The remote address to which this channel is to be connected * @param attachment @@ -365,6 +372,8 @@ public abstract class AsynchronousSocketChannel * AsynchronousByteChannel#read(ByteBuffer,Object,CompletionHandler)} * method. * + * @param + * The type of the attachment * @param dst * The buffer into which bytes are to be transferred * @param timeout @@ -461,6 +470,8 @@ public abstract class AsynchronousSocketChannel * read from the channel will cause an unspecific runtime exception to be * thrown. * + * @param + * The type of the attachment * @param dsts * The buffers into which bytes are to be transferred * @param offset @@ -520,6 +531,8 @@ public abstract class AsynchronousSocketChannel * AsynchronousByteChannel#write(ByteBuffer,Object,CompletionHandler)} * method. * + * @param + * The type of the attachment * @param src * The buffer from which bytes are to be retrieved * @param timeout @@ -610,6 +623,8 @@ public abstract class AsynchronousSocketChannel * to write to the channel will cause an unspecific runtime exception to be * thrown. * + * @param + * The type of the attachment * @param srcs * The buffers from which bytes are to be retrieved * @param offset @@ -645,4 +660,24 @@ public abstract class AsynchronousSocketChannel TimeUnit unit, A attachment, CompletionHandler handler); + + /** + * {@inheritDoc} + *

    + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link java.net.InetAddress#getLoopbackAddress loopback} address and the + * local port of the channel's socket is returned. + * + * @return The {@code SocketAddress} that the socket is bound to, or the + * {@code SocketAddress} representing the loopback address if + * denied by the security manager, or {@code null} if the + * channel's socket is not bound + * + * @throws ClosedChannelException {@inheritDoc} + * @throws IOException {@inheritDoc} + */ + public abstract SocketAddress getLocalAddress() throws IOException; } diff --git a/jdk/src/share/classes/java/nio/channels/Channel.java b/jdk/src/share/classes/java/nio/channels/Channel.java index a20de123dfa..88d15ace67f 100644 --- a/jdk/src/share/classes/java/nio/channels/Channel.java +++ b/jdk/src/share/classes/java/nio/channels/Channel.java @@ -56,7 +56,7 @@ import java.io.Closeable; public interface Channel extends Closeable { /** - * Tells whether or not this channel is open.

    + * Tells whether or not this channel is open. * * @return true if, and only if, this channel is open */ diff --git a/jdk/src/share/classes/java/nio/channels/DatagramChannel.java b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java index 74505d8ce63..3626317a982 100644 --- a/jdk/src/share/classes/java/nio/channels/DatagramChannel.java +++ b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java @@ -57,7 +57,7 @@ import java.nio.channels.spi.SelectorProvider; * setOption} method. A datagram channel to an Internet Protocol socket supports * the following options: *
    - *
    Option NameDescription
    + *
    * * * @@ -117,6 +117,9 @@ public abstract class DatagramChannel /** * Initializes a new instance of this class. + * + * @param provider + * The provider that created this channel */ protected DatagramChannel(SelectorProvider provider) { super(provider); @@ -565,4 +568,25 @@ public abstract class DatagramChannel return write(srcs, 0, srcs.length); } + /** + * {@inheritDoc} + *

    + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link java.net.InetAddress#getLoopbackAddress loopback} address and the + * local port of the channel's socket is returned. + * + * @return The {@code SocketAddress} that the socket is bound to, or the + * {@code SocketAddress} representing the loopback address if + * denied by the security manager, or {@code null} if the + * channel's socket is not bound + * + * @throws ClosedChannelException {@inheritDoc} + * @throws IOException {@inheritDoc} + */ + @Override + public abstract SocketAddress getLocalAddress() throws IOException; + } diff --git a/jdk/src/share/classes/java/nio/channels/FileChannel.java b/jdk/src/share/classes/java/nio/channels/FileChannel.java index b9fe83db08b..57ce3e10d9e 100644 --- a/jdk/src/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/FileChannel.java @@ -46,7 +46,7 @@ import java.util.Collections; * of bytes that can be read and written and whose current {@link #size * size} can be queried. The size of the file increases * when bytes are written beyond its current size; the size of the file - * decreases when it is {@link #truncate truncated}. The + * decreases when it is {@link #truncate truncated}. The * file may also have some associated metadata such as access * permissions, content type, and last-modification time; this class does not * define methods for metadata access. @@ -418,7 +418,7 @@ public abstract class FileChannel // -- Other operations -- /** - * Returns this channel's file position.

    + * Returns this channel's file position. * * @return This channel's file position, * a non-negative integer counting the number of bytes @@ -461,7 +461,7 @@ public abstract class FileChannel public abstract FileChannel position(long newPosition) throws IOException; /** - * Returns the current size of this channel's file.

    + * Returns the current size of this channel's file. * * @return The current size of this channel's file, * measured in bytes @@ -830,7 +830,7 @@ public abstract class FileChannel *

    A region of a file may be mapped into memory in one of three modes: *

    * - *
    Option NameDescription
    + *
    * * * @@ -78,6 +78,9 @@ public abstract class ServerSocketChannel /** * Initializes a new instance of this class. + * + * @param provider + * The provider that created this channel */ protected ServerSocketChannel(SelectorProvider provider) { super(provider); @@ -265,4 +268,25 @@ public abstract class ServerSocketChannel */ public abstract SocketChannel accept() throws IOException; + /** + * {@inheritDoc} + *

    + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link java.net.InetAddress#getLoopbackAddress loopback} address and the + * local port of the channel's socket is returned. + * + * @return The {@code SocketAddress} that the socket is bound to, or the + * {@code SocketAddress} representing the loopback address if + * denied by the security manager, or {@code null} if the + * channel's socket is not bound + * + * @throws ClosedChannelException {@inheritDoc} + * @throws IOException {@inheritDoc} + */ + @Override + public abstract SocketAddress getLocalAddress() throws IOException; + } diff --git a/jdk/src/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/share/classes/java/nio/channels/SocketChannel.java index d5f43ba7750..091570cbf64 100644 --- a/jdk/src/share/classes/java/nio/channels/SocketChannel.java +++ b/jdk/src/share/classes/java/nio/channels/SocketChannel.java @@ -66,7 +66,7 @@ import java.nio.channels.spi.SelectorProvider; *

    Socket options are configured using the {@link #setOption(SocketOption,Object) * setOption} method. Socket channels support the following options: *

    - *
    Option NameDescription
    + *
    * * * @@ -120,6 +120,9 @@ public abstract class SocketChannel /** * Initializes a new instance of this class. + * + * @param provider + * The provider that created this channel */ protected SocketChannel(SelectorProvider provider) { super(provider); @@ -153,6 +156,8 @@ public abstract class SocketChannel * @param remote * The remote address to which the new channel is to be connected * + * @return A new, and connected, socket channel + * * @throws AsynchronousCloseException * If another thread closes this channel * while the connect operation is in progress @@ -302,7 +307,7 @@ public abstract class SocketChannel /** * Tells whether or not a connection operation is in progress on this - * channel.

    + * channel. * * @return true if, and only if, a connection operation has been * initiated on this channel but not yet completed by invoking the @@ -493,4 +498,25 @@ public abstract class SocketChannel return write(srcs, 0, srcs.length); } + /** + * {@inheritDoc} + *

    + * If there is a security manager set, its {@code checkConnect} method is + * called with the local address and {@code -1} as its arguments to see + * if the operation is allowed. If the operation is not allowed, + * a {@code SocketAddress} representing the + * {@link java.net.InetAddress#getLoopbackAddress loopback} address and the + * local port of the channel's socket is returned. + * + * @return The {@code SocketAddress} that the socket is bound to, or the + * {@code SocketAddress} representing the loopback address if + * denied by the security manager, or {@code null} if the + * channel's socket is not bound + * + * @throws ClosedChannelException {@inheritDoc} + * @throws IOException {@inheritDoc} + */ + @Override + public abstract SocketAddress getLocalAddress() throws IOException; + } diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java index a5936832b7a..c8400692ee9 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java @@ -46,7 +46,7 @@ import sun.nio.ch.Interruptible; * before and after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block: + * try ... finally block: * *

      * boolean completed = false;
    diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java
    index e674d501718..5d1b1ee99a1 100644
    --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java
    +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectableChannel.java
    @@ -72,6 +72,9 @@ public abstract class AbstractSelectableChannel
     
         /**
          * Initializes a new instance of this class.
    +     *
    +     * @param  provider
    +     *         The provider that created this channel
          */
         protected AbstractSelectableChannel(SelectorProvider provider) {
             this.provider = provider;
    @@ -251,6 +254,9 @@ public abstract class AbstractSelectableChannel
          * that is blocked in an I/O operation upon this channel to return
          * immediately, either by throwing an exception or by returning normally.
          * 

    + * + * @throws IOException + * If an I/O error occurs */ protected abstract void implCloseSelectableChannel() throws IOException; @@ -299,6 +305,10 @@ public abstract class AbstractSelectableChannel * changing the blocking mode. This method is only invoked if the new mode * is different from the current mode.

    * + * @param block If true then this channel will be placed in + * blocking mode; if false then it will be placed + * non-blocking mode + * * @throws IOException * If an I/O error occurs */ diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java index 70a0693f962..bf5a4d7c2bf 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java @@ -43,7 +43,7 @@ public abstract class AbstractSelectionKey { /** - * Initializes a new instance of this class.

    + * Initializes a new instance of this class. */ protected AbstractSelectionKey() { } diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java index daa10ad201d..f4f4a2a74de 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * after, respectively, invoking an I/O operation that might block * indefinitely. In order to ensure that the {@link #end end} method is always * invoked, these methods should be used within a - * try ... finally block:
    + * try ... finally block: * *
      * try {
    @@ -76,7 +76,10 @@ public abstract class AbstractSelector
         private final SelectorProvider provider;
     
         /**
    -     * Initializes a new instance of this class.  

    + * Initializes a new instance of this class. + * + * @param provider + * The provider that created this selector */ protected AbstractSelector(SelectorProvider provider) { this.provider = provider; diff --git a/jdk/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java b/jdk/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java index 827a2c5b981..e768e475c35 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AsynchronousChannelProvider.java @@ -174,6 +174,8 @@ public abstract class AsynchronousChannelProvider { * @param threadFactory * The factory to use when creating new threads * + * @return A new asynchronous channel group + * * @throws IllegalArgumentException * If {@code nThreads <= 0} * @throws IOException @@ -193,6 +195,8 @@ public abstract class AsynchronousChannelProvider { * A value {@code >=0} or a negative value for implementation * specific default * + * @return A new asynchronous channel group + * * @throws IOException * If an I/O error occurs * diff --git a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java index 460e39ecbdc..8d74b43cf64 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -72,7 +72,7 @@ public abstract class SelectorProvider { private static SelectorProvider provider = null; /** - * Initializes a new instance of this class.

    + * Initializes a new instance of this class. * * @throws SecurityException * If a security manager has been installed and it denies @@ -180,9 +180,12 @@ public abstract class SelectorProvider { } /** - * Opens a datagram channel.

    + * Opens a datagram channel. * * @return The new channel + * + * @throws IOException + * If an I/O error occurs */ public abstract DatagramChannel openDatagramChannel() throws IOException; @@ -206,33 +209,45 @@ public abstract class SelectorProvider { throws IOException; /** - * Opens a pipe.

    + * Opens a pipe. * * @return The new pipe + * + * @throws IOException + * If an I/O error occurs */ public abstract Pipe openPipe() throws IOException; /** - * Opens a selector.

    + * Opens a selector. * * @return The new selector + * + * @throws IOException + * If an I/O error occurs */ public abstract AbstractSelector openSelector() throws IOException; /** - * Opens a server-socket channel.

    + * Opens a server-socket channel. * * @return The new channel + * + * @throws IOException + * If an I/O error occurs */ public abstract ServerSocketChannel openServerSocketChannel() throws IOException; /** - * Opens a socket channel.

    + * Opens a socket channel. * * @return The new channel + * + * @throws IOException + * If an I/O error occurs */ public abstract SocketChannel openSocketChannel() throws IOException; diff --git a/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template b/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template index 2449d56cf44..335194eef52 100644 --- a/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -161,7 +161,10 @@ public abstract class Charset$Coder$ { /** * Initializes a new $coder$. The new $coder$ will have the given - * $otypes-per-itype$ and replacement values.

    + * $otypes-per-itype$ and replacement values. + * + * @param cs + * The charset that created this $coder$ * * @param average$ItypesPerOtype$ * A positive float value indicating the expected number of @@ -207,7 +210,10 @@ public abstract class Charset$Coder$ { /** * Initializes a new $coder$. The new $coder$ will have the given * $otypes-per-itype$ values and its replacement will be the - * $replTypeName$ $defaultReplName$.

    + * $replTypeName$ $defaultReplName$. + * + * @param cs + * The charset that created this $coder$ * * @param average$ItypesPerOtype$ * A positive float value indicating the expected number of @@ -230,7 +236,7 @@ public abstract class Charset$Coder$ { } /** - * Returns the charset that created this $coder$.

    + * Returns the charset that created this $coder$. * * @return This $coder$'s charset */ @@ -239,7 +245,7 @@ public abstract class Charset$Coder$ { } /** - * Returns this $coder$'s replacement value.

    + * Returns this $coder$'s replacement value. * * @return This $coder$'s current replacement, * which is never null and is never empty @@ -260,7 +266,7 @@ public abstract class Charset$Coder$ { * method, passing the new replacement, after checking that the new * replacement is acceptable.

    * - * @param newReplacement + * @param newReplacement The replacement value * #if[decoder] * The new replacement; must not be null @@ -305,7 +311,7 @@ public abstract class Charset$Coder$ { * should be overridden by $coder$s that require notification of changes to * the replacement.

    * - * @param newReplacement + * @param newReplacement The replacement value */ protected void implReplaceWith($replType$ newReplacement) { } @@ -351,7 +357,7 @@ public abstract class Charset$Coder$ { #end[encoder] /** - * Returns this $coder$'s current action for malformed-input errors.

    + * Returns this $coder$'s current action for malformed-input errors. * * @return The current malformed-input action, which is never null */ @@ -360,7 +366,7 @@ public abstract class Charset$Coder$ { } /** - * Changes this $coder$'s action for malformed-input errors.

    + * Changes this $coder$'s action for malformed-input errors. * *

    This method invokes the {@link #implOnMalformedInput * implOnMalformedInput} method, passing the new action.

    @@ -386,12 +392,13 @@ public abstract class Charset$Coder$ { *

    The default implementation of this method does nothing. This method * should be overridden by $coder$s that require notification of changes to * the malformed-input action.

    + * + * @param newAction The new action */ protected void implOnMalformedInput(CodingErrorAction newAction) { } /** * Returns this $coder$'s current action for unmappable-character errors. - *

    * * @return The current unmappable-character action, which is never * null @@ -429,13 +436,15 @@ public abstract class Charset$Coder$ { *

    The default implementation of this method does nothing. This method * should be overridden by $coder$s that require notification of changes to * the unmappable-character action.

    + * + * @param newAction The new action */ protected void implOnUnmappableCharacter(CodingErrorAction newAction) { } /** * Returns the average number of $otype$s that will be produced for each * $itype$ of input. This heuristic value may be used to estimate the size - * of the output buffer required for a given input sequence.

    + * of the output buffer required for a given input sequence. * * @return The average number of $otype$s produced * per $itype$ of input @@ -447,7 +456,7 @@ public abstract class Charset$Coder$ { /** * Returns the maximum number of $otype$s that will be produced for each * $itype$ of input. This value may be used to compute the worst-case size - * of the output buffer required for a given input sequence.

    + * of the output buffer required for a given input sequence. * * @return The maximum number of $otype$s that will be produced per * $itype$ of input @@ -926,6 +935,9 @@ public abstract class Charset$Coder$ { *

    The default implementation of this method is not very efficient; it * should generally be overridden to improve performance.

    * + * @param c + * The given character + * * @return true if, and only if, this encoder can encode * the given character * @@ -954,6 +966,9 @@ public abstract class Charset$Coder$ { *

    The default implementation of this method is not very efficient; it * should generally be overridden to improve performance.

    * + * @param cs + * The given character sequence + * * @return true if, and only if, this encoder can encode * the given character without throwing any exceptions and without * performing any replacements diff --git a/jdk/src/share/classes/java/nio/charset/Charset.java b/jdk/src/share/classes/java/nio/charset/Charset.java index 9451c537a36..278bacb17c5 100644 --- a/jdk/src/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/share/classes/java/nio/charset/Charset.java @@ -66,7 +66,7 @@ import sun.security.action.GetPropertyAction; * * *
    - *

    Charset names

    + *

    Charset names

    * *

    Charsets are named by strings composed of the following characters: * @@ -140,7 +140,7 @@ import sun.security.action.GetPropertyAction; * previous canonical name be made into an alias. * * - *

    Standard charsets

    + *

    Standard charsets

    * *
    * @@ -217,7 +217,7 @@ import sun.security.action.GetPropertyAction; *

    The {@link StandardCharsets} class defines constants for each of the * standard charsets. * - *

    Terminology

    + *

    Terminology

    * *

    The name of this class is taken from the terms used in * RFC 2278. @@ -490,7 +490,7 @@ public abstract class Charset } /** - * Tells whether the named charset is supported.

    + * Tells whether the named charset is supported. * * @param charsetName * The name of the requested charset; may be either @@ -510,7 +510,7 @@ public abstract class Charset } /** - * Returns a charset object for the named charset.

    + * Returns a charset object for the named charset. * * @param charsetName * The name of the requested charset; may be either @@ -629,7 +629,7 @@ public abstract class Charset /** * Initializes a new charset with the given canonical name and alias - * set.

    + * set. * * @param canonicalName * The canonical name of this charset @@ -650,7 +650,7 @@ public abstract class Charset } /** - * Returns this charset's canonical name.

    + * Returns this charset's canonical name. * * @return The canonical name of this charset */ @@ -659,7 +659,7 @@ public abstract class Charset } /** - * Returns a set containing this charset's aliases.

    + * Returns a set containing this charset's aliases. * * @return An immutable set of this charset's aliases */ @@ -690,7 +690,7 @@ public abstract class Charset /** * Tells whether or not this charset is registered in the IANA Charset - * Registry.

    + * Registry. * * @return true if, and only if, this charset is known by its * implementor to be registered with the IANA @@ -737,19 +737,22 @@ public abstract class Charset * it is not necessarily the case that the given charset is not contained * in this charset. * + * @param cs + * The given charset + * * @return true if the given charset is contained in this charset */ public abstract boolean contains(Charset cs); /** - * Constructs a new decoder for this charset.

    + * Constructs a new decoder for this charset. * * @return A new decoder for this charset */ public abstract CharsetDecoder newDecoder(); /** - * Constructs a new encoder for this charset.

    + * Constructs a new encoder for this charset. * * @return A new encoder for this charset * @@ -881,7 +884,7 @@ public abstract class Charset } /** - * Computes a hashcode for this charset.

    + * Computes a hashcode for this charset. * * @return An integer hashcode */ @@ -907,7 +910,7 @@ public abstract class Charset } /** - * Returns a string describing this charset.

    + * Returns a string describing this charset. * * @return A string describing this charset */ diff --git a/jdk/src/share/classes/java/nio/charset/CoderResult.java b/jdk/src/share/classes/java/nio/charset/CoderResult.java index 00f29db07ef..15aad362c06 100644 --- a/jdk/src/share/classes/java/nio/charset/CoderResult.java +++ b/jdk/src/share/classes/java/nio/charset/CoderResult.java @@ -71,7 +71,7 @@ import java.util.HashMap; * * * - * For convenience, the {@link #isError() isError} method returns true + *

    For convenience, the {@link #isError() isError} method returns true * for result objects that describe malformed-input and unmappable-character * errors but false for those that describe underflow or overflow * conditions.

    @@ -112,7 +112,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an underflow condition.

    + * Tells whether or not this object describes an underflow condition. * * @return true if, and only if, this object denotes underflow */ @@ -121,7 +121,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an overflow condition.

    + * Tells whether or not this object describes an overflow condition. * * @return true if, and only if, this object denotes overflow */ @@ -130,7 +130,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an error condition.

    + * Tells whether or not this object describes an error condition. * * @return true if, and only if, this object denotes either a * malformed-input error or an unmappable-character error @@ -141,7 +141,6 @@ public class CoderResult { /** * Tells whether or not this object describes a malformed-input error. - *

    * * @return true if, and only if, this object denotes a * malformed-input error @@ -152,7 +151,7 @@ public class CoderResult { /** * Tells whether or not this object describes an unmappable-character - * error.

    + * error. * * @return true if, and only if, this object denotes an * unmappable-character error @@ -163,7 +162,7 @@ public class CoderResult { /** * Returns the length of the erroneous input described by this - * object  (optional operation).

    + * object  (optional operation). * * @return The length of the erroneous input, a positive integer * @@ -180,14 +179,14 @@ public class CoderResult { /** * Result object indicating underflow, meaning that either the input buffer * has been completely consumed or, if the input buffer is not yet empty, - * that additional input is required.

    + * that additional input is required. */ public static final CoderResult UNDERFLOW = new CoderResult(CR_UNDERFLOW, 0); /** * Result object indicating overflow, meaning that there is insufficient - * room in the output buffer.

    + * room in the output buffer. */ public static final CoderResult OVERFLOW = new CoderResult(CR_OVERFLOW, 0); @@ -226,7 +225,10 @@ public class CoderResult { /** * Static factory method that returns the unique object describing a - * malformed-input error of the given length.

    + * malformed-input error of the given length. + * + * @param length + * The given length * * @return The requested coder-result object */ @@ -242,7 +244,10 @@ public class CoderResult { /** * Static factory method that returns the unique result object describing - * an unmappable-character error of the given length.

    + * an unmappable-character error of the given length. + * + * @param length + * The given length * * @return The requested coder-result object */ @@ -252,7 +257,6 @@ public class CoderResult { /** * Throws an exception appropriate to the result described by this object. - *

    * * @throws BufferUnderflowException * If this object is {@link #UNDERFLOW} diff --git a/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java b/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java index 8c9cb2193b2..8ca30e4900b 100644 --- a/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java +++ b/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java @@ -50,7 +50,7 @@ public class CodingErrorAction { /** * Action indicating that a coding error is to be handled by dropping the - * erroneous input and resuming the coding operation.

    + * erroneous input and resuming the coding operation. */ public static final CodingErrorAction IGNORE = new CodingErrorAction("IGNORE"); @@ -58,7 +58,7 @@ public class CodingErrorAction { /** * Action indicating that a coding error is to be handled by dropping the * erroneous input, appending the coder's replacement value to the output - * buffer, and resuming the coding operation.

    + * buffer, and resuming the coding operation. */ public static final CodingErrorAction REPLACE = new CodingErrorAction("REPLACE"); @@ -73,7 +73,7 @@ public class CodingErrorAction { = new CodingErrorAction("REPORT"); /** - * Returns a string describing this action.

    + * Returns a string describing this action. * * @return A descriptive string */ diff --git a/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java b/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java index 4af924fd1fc..5fa12476d68 100644 --- a/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java +++ b/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java @@ -29,7 +29,7 @@ package java.nio.charset; /** * Checked exception thrown when an input character (or byte) sequence * is valid but cannot be mapped to an output byte (or character) - * sequence.

    + * sequence. * * @since 1.4 */ diff --git a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java index a4d646a86e2..1e31d75fe31 100644 --- a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -39,8 +39,8 @@ import java.util.Iterator; * the usual extension directories. Providers may also be made available by * adding them to the applet or application class path or by some other * platform-specific means. Charset providers are looked up via the current - * thread's {@link java.lang.Thread#getContextClassLoader()
    context - * class loader}. + * thread's {@link java.lang.Thread#getContextClassLoader() context class + * loader}. * *

    A charset provider identifies itself with a provider-configuration file * named java.nio.charset.spi.CharsetProvider in the resource @@ -72,7 +72,7 @@ import java.util.Iterator; public abstract class CharsetProvider { /** - * Initializes a new charset provider.

    + * Initializes a new charset provider. * * @throws SecurityException * If a security manager has been installed and it denies @@ -88,14 +88,14 @@ public abstract class CharsetProvider { * Creates an iterator that iterates over the charsets supported by this * provider. This method is used in the implementation of the {@link * java.nio.charset.Charset#availableCharsets Charset.availableCharsets} - * method.

    + * method. * * @return The new iterator */ public abstract Iterator charsets(); /** - * Retrieves a charset for the given charset name.

    + * Retrieves a charset for the given charset name. * * @param charsetName * The name of the requested charset; may be either diff --git a/jdk/src/share/classes/java/nio/file/FileStore.java b/jdk/src/share/classes/java/nio/file/FileStore.java index 831dba8a5e9..d0bdc013992 100644 --- a/jdk/src/share/classes/java/nio/file/FileStore.java +++ b/jdk/src/share/classes/java/nio/file/FileStore.java @@ -173,6 +173,8 @@ public abstract class FileStore { * The {@code type} parameter is the type of the attribute view required and * the method returns an instance of that type if supported. * + * @param + * The {@code FileStoreAttributeView} type * @param type * the {@code Class} object corresponding to the attribute view * diff --git a/jdk/src/share/classes/java/nio/file/FileSystem.java b/jdk/src/share/classes/java/nio/file/FileSystem.java index e2166079831..2296cada829 100644 --- a/jdk/src/share/classes/java/nio/file/FileSystem.java +++ b/jdk/src/share/classes/java/nio/file/FileSystem.java @@ -315,7 +315,7 @@ public abstract class FileSystem * that resembles regular expressions but with a simpler syntax. For example: * *
    - *
    Option NameDescription
    + *
    * * * diff --git a/jdk/src/share/classes/java/nio/file/FileSystems.java b/jdk/src/share/classes/java/nio/file/FileSystems.java index ef443640af0..d6b4496dda7 100644 --- a/jdk/src/share/classes/java/nio/file/FileSystems.java +++ b/jdk/src/share/classes/java/nio/file/FileSystems.java @@ -200,6 +200,10 @@ public final class FileSystems { * existing file system. In the case of the {@link FileSystems#getDefault * default} file system, no permission check is required. * + * @param uri the URI to locate the file system + * + * @return the reference to the file system + * * @throws IllegalArgumentException * if the pre-conditions for the {@code uri} parameter are not met * @throws FileSystemNotFoundException diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index 244d7bca8dd..ca0263d0660 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -194,7 +194,7 @@ public final class Files { *

    In the addition to {@code READ} and {@code WRITE}, the following * options may be present: * - *

    {@code *.java}Matches a path that represents a file name ending in {@code .java}
    + *
    * * * @@ -1494,10 +1494,19 @@ public final class Files { // lazy loading of default and installed file type detectors private static class FileTypeDetectors{ static final FileTypeDetector defaultFileTypeDetector = - sun.nio.fs.DefaultFileTypeDetector.create(); + createDefaultFileTypeDetector(); static final List installeDetectors = loadInstalledDetectors(); + // creates the default file type detector + private static FileTypeDetector createDefaultFileTypeDetector() { + return AccessController + .doPrivileged(new PrivilegedAction() { + @Override public FileTypeDetector run() { + return sun.nio.fs.DefaultFileTypeDetector.create(); + }}); + } + // loads all installed file type detectors private static List loadInstalledDetectors() { return AccessController @@ -1607,7 +1616,8 @@ public final class Files { * } * * - * + * @param + * The {@code FileAttributeView} type * @param path * the path to the file * @param type @@ -1656,6 +1666,8 @@ public final class Files { * PosixFileAttributes attrs = Files.readAttributes(path, PosixFileAttributes.class, NOFOLLOW_LINKS); * * + * @param + * The {@code BasicFileAttributes} type * @param path * the path to the file * @param type @@ -1854,7 +1866,7 @@ public final class Files { * attributes} parameter: * *
    - *
    Option Description
    {@link StandardOpenOption#APPEND APPEND}
    + *
    * * * @@ -1962,10 +1974,12 @@ public final class Files { * System Interface (POSIX) family of standards. * * @param path - * A file reference that locates the file + * The path to the file * @param perms * The new set of permissions * + * @return The path + * * @throws UnsupportedOperationException * if the associated file system does not support the {@code * PosixFileAttributeView} @@ -2000,7 +2014,7 @@ public final class Files { * access to a file attribute that is the owner of the file. * * @param path - * A file reference that locates the file + * The path to the file * @param options * options indicating how symbolic links are handled * @@ -2043,10 +2057,12 @@ public final class Files { * * * @param path - * A file reference that locates the file + * The path to the file * @param owner * The new file owner * + * @return The path + * * @throws UnsupportedOperationException * if the associated file system does not support the {@code * FileOwnerAttributeView} @@ -2081,6 +2097,8 @@ public final class Files { * readAttributes} method and the file type tested with the {@link * BasicFileAttributes#isSymbolicLink} method. * + * @param path The path to the file + * * @return {@code true} if the file is a symbolic link; {@code false} if * the file does not exist, is not a symbolic link, or it cannot * be determined if the file is a symbolic link or not. @@ -2230,7 +2248,7 @@ public final class Files { * @param time * the new last modified time * - * @return the file + * @return the path * * @throws IOException * if an I/O error occurs diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java index a7933a34815..39afd4d4255 100644 --- a/jdk/src/share/classes/java/nio/file/Path.java +++ b/jdk/src/share/classes/java/nio/file/Path.java @@ -64,7 +64,7 @@ import java.util.Iterator; * those developing custom file system implementations. Methods may be added to * this interface in future releases.

    * - *

    Accessing Files

    + *

    Accessing Files

    *

    Paths may be used with the {@link Files} class to operate on files, * directories, and other types of files. For example, suppose we want a {@link * java.io.BufferedReader} to read text from a file "{@code access.log}". The @@ -75,7 +75,7 @@ import java.util.Iterator; * BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8); * * - *

    Interoperability

    + *

    Interoperability

    *

    Paths associated with the default {@link * java.nio.file.spi.FileSystemProvider provider} are generally interoperable * with the {@link java.io.File java.io.File} class. Paths created by other @@ -87,7 +87,7 @@ import java.util.Iterator; * addition, the {@link #toFile toFile} method is useful to construct a {@code * File} from the {@code String} representation of a {@code Path}. * - *

    Concurrency

    + *

    Concurrency

    *

    Implementations of this interface are immutable and safe for use by * multiple concurrent threads. * diff --git a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java index 6ef4882eae8..2bfa2056b82 100644 --- a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java +++ b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java @@ -122,6 +122,8 @@ public interface SecureDirectoryStream * an optional list of attributes to set atomically when creating * the file * + * @return the seekable byte channel + * * @throws ClosedDirectoryStreamException * if the directory stream is closed * @throws IllegalArgumentException @@ -260,6 +262,8 @@ public interface SecureDirectoryStream * then all methods to read or update attributes will throw {@link * ClosedDirectoryStreamException ClosedDirectoryStreamException}. * + * @param + * The {@code FileAttributeView} type * @param type * the {@code Class} object corresponding to the file attribute view * @@ -288,6 +292,8 @@ public interface SecureDirectoryStream * is created but methods to read or update attributes of the file will * fail when invoked and the file does not exist. * + * @param + * The {@code FileAttributeView} type * @param path * the path of the file * @param type diff --git a/jdk/src/share/classes/java/nio/file/WatchEvent.java b/jdk/src/share/classes/java/nio/file/WatchEvent.java index cab199f0b57..50848685150 100644 --- a/jdk/src/share/classes/java/nio/file/WatchEvent.java +++ b/jdk/src/share/classes/java/nio/file/WatchEvent.java @@ -55,11 +55,16 @@ public interface WatchEvent { public static interface Kind { /** * Returns the name of the event kind. + * + * @return the name of the event kind */ String name(); /** * Returns the type of the {@link WatchEvent#context context} value. + * + * + * @return the type of the context value */ Class type(); } @@ -76,6 +81,8 @@ public interface WatchEvent { public static interface Modifier { /** * Returns the name of the modifier. + * + * @return the name of the modifier */ String name(); } diff --git a/jdk/src/share/classes/java/nio/file/WatchService.java b/jdk/src/share/classes/java/nio/file/WatchService.java index 5a63fcd8722..c6440b208e4 100644 --- a/jdk/src/share/classes/java/nio/file/WatchService.java +++ b/jdk/src/share/classes/java/nio/file/WatchService.java @@ -78,7 +78,7 @@ import java.util.concurrent.TimeUnit; * The {@link java.nio.channels.FileChannel FileChannel} class defines methods * to lock regions of a file against access by other programs. * - *

    Platform dependencies

    + *

    Platform dependencies

    * *

    The implementation that observes events from the file system is intended * to map directly on to the native file event notification facility where diff --git a/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java b/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java index 9b4ef8a34c3..49bf5292471 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java +++ b/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java @@ -134,6 +134,7 @@ public final class AclEntry { /** * Sets the type component of this builder. * + * @param type the component type * @return this builder */ public Builder setType(AclEntryType type) { @@ -146,6 +147,7 @@ public final class AclEntry { /** * Sets the principal component of this builder. * + * @param who the principal component * @return this builder */ public Builder setPrincipal(UserPrincipal who) { @@ -168,6 +170,7 @@ public final class AclEntry { * Sets the permissions component of this builder. On return, the * permissions component of this builder is a copy of the given set. * + * @param perms the permissions component * @return this builder * * @throws ClassCastException @@ -193,6 +196,7 @@ public final class AclEntry { * permissions component of this builder is a copy of the permissions in * the given array. * + * @param perms the permissions component * @return this builder */ public Builder setPermissions(AclEntryPermission... perms) { @@ -211,6 +215,7 @@ public final class AclEntry { * Sets the flags component of this builder. On return, the flags * component of this builder is a copy of the given set. * + * @param flags the flags component * @return this builder * * @throws ClassCastException @@ -236,6 +241,7 @@ public final class AclEntry { * component of this builder is a copy of the flags in the given * array. * + * @param flags the flags component * @return this builder */ public Builder setFlags(AclEntryFlag... flags) { @@ -267,9 +273,7 @@ public final class AclEntry { /** * Constructs a new builder with the components of an existing ACL entry. * - * @param entry - * an ACL entry - * + * @param entry an ACL entry * @return a new builder */ public static Builder newBuilder(AclEntry entry) { @@ -278,6 +282,8 @@ public final class AclEntry { /** * Returns the ACL entry type. + * + * @return the ACL entry type */ public AclEntryType type() { return type; @@ -285,6 +291,8 @@ public final class AclEntry { /** * Returns the principal component. + * + * @return the principal component */ public UserPrincipal principal() { return who; @@ -294,6 +302,8 @@ public final class AclEntry { * Returns a copy of the permissions component. * *

    The returned set is a modifiable copy of the permissions. + * + * @return the permissions component */ public Set permissions() { return new HashSet(perms); @@ -303,6 +313,8 @@ public final class AclEntry { * Returns a copy of the flags component. * *

    The returned set is a modifiable copy of the flags. + * + * @return the flags component */ public Set flags() { return new HashSet(flags); diff --git a/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java index 2f94937b6c1..f5d58d41f4a 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java @@ -54,7 +54,7 @@ import java.io.IOException; * supportsFileAttributeView} method can be used to test if a file system * supports ACLs. * - *

    Interoperability

    + *

    Interoperability

    * * RFC 3530 allows for special user identities to be used on platforms that * support the POSIX defined access permissions. The special user identities @@ -65,7 +65,7 @@ import java.io.IOException; * UserPrincipalLookupService} may be used to obtain a {@link UserPrincipal} * to represent these special identities by invoking the {@link * UserPrincipalLookupService#lookupPrincipalByName lookupPrincipalByName} - * method.

    + * method. * *

    Usage Example: * Suppose we wish to add an entry to an existing ACL to grant "joe" access: @@ -90,11 +90,11 @@ import java.io.IOException; * view.setAcl(acl); * * - *

    Dynamic Access

    + *

    Dynamic Access

    *

    Where dynamic access to file attributes is required, the attributes * supported by this attribute view are as follows: *

    - *
    {@code "*"} Read all {@link BasicFileAttributes basic-file-attributes}.
    + *
    * * * @@ -118,7 +118,7 @@ import java.io.IOException; * update the ACL or owner attributes as if by invoking the {@link #setAcl setAcl} * or {@link #setOwner setOwner} methods. * - *

    Setting the ACL when creating a file

    + *

    Setting the ACL when creating a file

    * *

    Implementations supporting this attribute view may also support setting * the initial ACL when creating a file or directory. The initial ACL diff --git a/jdk/src/share/classes/java/nio/file/attribute/AttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/AttributeView.java index 0b2951b960e..d33f9764a79 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/AttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/AttributeView.java @@ -38,6 +38,8 @@ package java.nio.file.attribute; public interface AttributeView { /** * Returns the name of the attribute view. + * + * @return the name of the attribute view */ String name(); } diff --git a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java index 2a8e2c9585b..3a9c7916969 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java @@ -41,7 +41,7 @@ import java.io.IOException; *

    Where dynamic access to file attributes is required, the attributes * supported by this attribute view have the following names and types: *

    - *
    Name Type
    + *
    * * * diff --git a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java index d1f715dcea2..df2d10bb27c 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java @@ -87,22 +87,31 @@ public interface BasicFileAttributes { /** * Tells whether the file is a regular file with opaque content. + * + * @return {@code true} if the file is a regular file with opaque content */ boolean isRegularFile(); /** * Tells whether the file is a directory. + * + * @return {@code true} if the file is a directory */ boolean isDirectory(); /** * Tells whether the file is a symbolic link. + * + * @return {@code true} if the file is a symbolic link */ boolean isSymbolicLink(); /** * Tells whether the file is something other than a regular file, directory, * or symbolic link. + * + * @return {@code true} if the file something other than a regular file, + * directory or symbolic link */ boolean isOther(); @@ -138,6 +147,8 @@ public interface BasicFileAttributes { * and two files are the {@link java.nio.file.Files#isSameFile same} with * non-{@code null} file keys, then their file keys are equal. * + * @return an object that uniquely identifies the given file, or {@code null} + * * @see java.nio.file.Files#walkFileTree */ Object fileKey(); diff --git a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java index aa99d23322e..1fb53853a61 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java @@ -41,7 +41,7 @@ import java.io.IOException; * BasicFileAttributeView}, and in addition, the following attributes are * supported: *
    - *
    Name Type
    + *
    * * * diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java b/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java index d3704cbf821..46168763487 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java +++ b/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java @@ -40,11 +40,15 @@ package java.nio.file.attribute; public interface FileAttribute { /** * Returns the attribute name. + * + * @return The attribute name */ String name(); /** * Returns the attribute value. + * + * @return The attribute value */ T value(); } diff --git a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java index ea5f1e2eaa6..81a6a4156e7 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java @@ -68,13 +68,13 @@ import java.io.IOException; * PosixFilePermissions.toString(attrs.permissions())); * * - *

    Dynamic Access

    + *

    Dynamic Access

    *

    Where dynamic access to file attributes is required, the attributes * supported by this attribute view are as defined by {@link * BasicFileAttributeView} and {@link FileOwnerAttributeView}, and in addition, * the following attributes are supported: *

    - *
    Name Type
    + *
    * * * @@ -102,7 +102,7 @@ import java.io.IOException; * #setPermissions setPermissions}, {@link #setOwner setOwner}, and {@link * #setGroup setGroup} methods respectively. * - *

    Setting Initial Permissions

    + *

    Setting Initial Permissions

    *

    Implementations supporting this attribute view may also support setting * the initial permissions when creating a file or directory. The * initial permissions are provided to the {@link Files#createFile createFile} diff --git a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java index 84e92d9cb92..5b95dcc390d 100644 --- a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java +++ b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java @@ -287,6 +287,8 @@ public abstract class FileSystemProvider { * @param uri * The URI to convert * + * @return The resulting {@code Path} + * * @throws IllegalArgumentException * If the URI scheme does not identify this provider or other * preconditions on the uri parameter do not hold @@ -751,6 +753,8 @@ public abstract class FileSystemProvider { * @param link * the path to the symbolic link * + * @return The target of the symbolic link + * * @throws UnsupportedOperationException * if the implementation does not support symbolic links * @throws NotLinkException @@ -984,6 +988,8 @@ public abstract class FileSystemProvider { * exactly the manner specified by the {@link Files#getFileAttributeView} * method. * + * @param + * The {@code FileAttributeView} type * @param path * the path to the file * @param type @@ -1002,6 +1008,8 @@ public abstract class FileSystemProvider { * exactly the manner specified by the {@link * Files#readAttributes(Path,Class,LinkOption[])} method. * + * @param + * The {@code BasicFileAttributes} type * @param path * the path to the file * @param type diff --git a/jdk/src/share/classes/java/rmi/dgc/VMID.java b/jdk/src/share/classes/java/rmi/dgc/VMID.java index 41a19e6d205..45e58599d66 100644 --- a/jdk/src/share/classes/java/rmi/dgc/VMID.java +++ b/jdk/src/share/classes/java/rmi/dgc/VMID.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,8 @@ package java.rmi.dgc; -import java.io.*; -import java.net.*; import java.rmi.server.UID; -import java.security.*; +import java.security.SecureRandom; /** * A VMID is a identifier that is unique across all Java virtual @@ -39,9 +37,8 @@ import java.security.*; * @author Peter Jones */ public final class VMID implements java.io.Serializable { - - /** array of bytes uniquely identifying this host */ - private static byte[] localAddr = computeAddressHash(); + /** Array of bytes uniquely identifying this host */ + private static final byte[] randomBytes; /** * @serial array of bytes uniquely identifying host created on @@ -56,6 +53,14 @@ public final class VMID implements java.io.Serializable { /** indicate compatibility with JDK 1.1.x version of class */ private static final long serialVersionUID = -538642295484486218L; + static { + // Generate 8 bytes of random data. + SecureRandom secureRandom = new SecureRandom(); + byte bytes[] = new byte[8]; + secureRandom.nextBytes(bytes); + randomBytes = bytes; + } + /** * Create a new VMID. Each new VMID returned from this constructor * is unique for all Java virtual machines under the following @@ -65,7 +70,7 @@ public final class VMID implements java.io.Serializable { * for the lifetime of this object.

    */ public VMID() { - addr = localAddr; + addr = randomBytes; uid = new UID(); } @@ -126,52 +131,4 @@ public final class VMID implements java.io.Serializable { result.append(uid.toString()); return result.toString(); } - - /** - * Compute the hash an IP address. The hash is the first 8 bytes - * of the SHA digest of the IP address. - */ - private static byte[] computeAddressHash() { - - /* - * Get the local host's IP address. - */ - byte[] addr = java.security.AccessController.doPrivileged( - new PrivilegedAction() { - public byte[] run() { - try { - return InetAddress.getLocalHost().getAddress(); - } catch (Exception e) { - } - return new byte[] { 0, 0, 0, 0 }; - } - }); - - byte[] addrHash; - final int ADDR_HASH_LENGTH = 8; - - try { - /* - * Calculate message digest of IP address using SHA. - */ - MessageDigest md = MessageDigest.getInstance("SHA"); - ByteArrayOutputStream sink = new ByteArrayOutputStream(64); - DataOutputStream out = new DataOutputStream( - new DigestOutputStream(sink, md)); - out.write(addr, 0, addr.length); - out.flush(); - - byte digest[] = md.digest(); - int hashlength = Math.min(ADDR_HASH_LENGTH, digest.length); - addrHash = new byte[hashlength]; - System.arraycopy(digest, 0, addrHash, 0, hashlength); - - } catch (IOException ignore) { - /* can't happen, but be deterministic anyway. */ - addrHash = new byte[0]; - } catch (NoSuchAlgorithmException complain) { - throw new InternalError(complain.toString(), complain); - } - return addrHash; - } } diff --git a/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java b/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java index f064d617fcd..f9f23ddd019 100644 --- a/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java +++ b/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -424,7 +424,7 @@ public class RMIClassLoader { * *

    * *

    In case the client does not explicitly initialize the KeyPairGenerator - * (via a call to an initialize method), each provider must + * (via a call to an {@code initialize} method), each provider must * supply (and document) a default initialization. * For example, the Sun provider uses a default modulus size (keysize) * of 1024 bits. * *

    Note that this class is abstract and extends from - * KeyPairGeneratorSpi for historical reasons. + * {@code KeyPairGeneratorSpi} for historical reasons. * Application developers should only take notice of the methods defined in - * this KeyPairGenerator class; all the methods in + * this {@code KeyPairGenerator} class; all the methods in * the superclass are intended for cryptographic service providers who wish to * supply their own implementations of key pair generators. * *

    Every implementation of the Java platform is required to support the - * following standard KeyPairGenerator algorithms and keysizes in + * following standard {@code KeyPairGenerator} algorithms and keysizes in * parentheses: *

      - *
    • DiffieHellman (1024)
    • - *
    • DSA (1024)
    • - *
    • RSA (1024, 2048)
    • + *
    • {@code DiffieHellman} (1024)
    • + *
    • {@code DSA} (1024)
    • + *
    • {@code RSA} (1024, 2048)
    • *
    * These algorithms are described in the
    @@ -322,18 +322,18 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { /** * Initializes the key pair generator for a certain keysize using - * a default parameter set and the SecureRandom + * a default parameter set and the {@code SecureRandom} * implementation of the highest-priority installed provider as the source * of randomness. * (If none of the installed providers supply an implementation of - * SecureRandom, a system-provided source of randomness is + * {@code SecureRandom}, a system-provided source of randomness is * used.) * * @param keysize the keysize. This is an * algorithm-specific metric, such as modulus length, specified in * number of bits. * - * @exception InvalidParameterException if the keysize is not + * @exception InvalidParameterException if the {@code keysize} is not * supported by this KeyPairGenerator object. */ public void initialize(int keysize) { @@ -349,7 +349,7 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * number of bits. * @param random the source of randomness. * - * @exception InvalidParameterException if the keysize is not + * @exception InvalidParameterException if the {@code keysize} is not * supported by this KeyPairGenerator object. * * @since 1.2 @@ -369,11 +369,11 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { /** * Initializes the key pair generator using the specified parameter - * set and the SecureRandom + * set and the {@code SecureRandom} * implementation of the highest-priority installed provider as the source * of randomness. * (If none of the installed providers supply an implementation of - * SecureRandom, a system-provided source of randomness is + * {@code SecureRandom}, a system-provided source of randomness is * used.). * *

    This concrete method has been added to this previously-defined @@ -382,10 +382,10 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * {@link KeyPairGeneratorSpi#initialize( * java.security.spec.AlgorithmParameterSpec, * java.security.SecureRandom) initialize} method, - * passing it params and a source of randomness (obtained + * passing it {@code params} and a source of randomness (obtained * from the highest-priority installed provider or system-provided if none * of the installed providers supply one). - * That initialize method always throws an + * That {@code initialize} method always throws an * UnsupportedOperationException if it is not overridden by the provider. * * @param params the parameter set used to generate the keys. @@ -410,8 +410,8 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * KeyPairGeneratorSpi#initialize( * java.security.spec.AlgorithmParameterSpec, * java.security.SecureRandom) initialize} method, - * passing it params and random. - * That initialize + * passing it {@code params} and {@code random}. + * That {@code initialize} * method always throws an * UnsupportedOperationException if it is not overridden by the provider. * diff --git a/jdk/src/share/classes/java/security/KeyPairGeneratorSpi.java b/jdk/src/share/classes/java/security/KeyPairGeneratorSpi.java index 28139adcf68..dfe8c04218d 100644 --- a/jdk/src/share/classes/java/security/KeyPairGeneratorSpi.java +++ b/jdk/src/share/classes/java/security/KeyPairGeneratorSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ import java.security.spec.AlgorithmParameterSpec; /** *

    This class defines the Service Provider Interface (SPI) - * for the KeyPairGenerator class, which is used to generate + * for the {@code KeyPairGenerator} class, which is used to generate * pairs of public and private keys. * *

    All the abstract methods in this class must be implemented by each @@ -37,7 +37,7 @@ import java.security.spec.AlgorithmParameterSpec; * of a key pair generator for a particular algorithm. * *

    In case the client does not explicitly initialize the KeyPairGenerator - * (via a call to an initialize method), each provider must + * (via a call to an {@code initialize} method), each provider must * supply (and document) a default initialization. * For example, the Sun provider uses a default modulus size (keysize) * of 1024 bits. @@ -61,7 +61,7 @@ public abstract class KeyPairGeneratorSpi { * * @param random the source of randomness for this generator. * - * @exception InvalidParameterException if the keysize is not + * @exception InvalidParameterException if the {@code keysize} is not * supported by this KeyPairGeneratorSpi object. */ public abstract void initialize(int keysize, SecureRandom random); @@ -100,7 +100,7 @@ public abstract class KeyPairGeneratorSpi { * will be used. This will generate a new key pair every time it * is called. * - * @return the newly generated KeyPair + * @return the newly generated {@code KeyPair} */ public abstract KeyPair generateKeyPair(); } diff --git a/jdk/src/share/classes/java/security/KeyRep.java b/jdk/src/share/classes/java/security/KeyRep.java index 6c0231c5497..0b1412c1563 100644 --- a/jdk/src/share/classes/java/security/KeyRep.java +++ b/jdk/src/share/classes/java/security/KeyRep.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,17 +116,17 @@ public class KeyRep implements Serializable { * * @param type either one of Type.SECRET, Type.PUBLIC, or Type.PRIVATE * @param algorithm the algorithm returned from - * Key.getAlgorithm() + * {@code Key.getAlgorithm()} * @param format the encoding format returned from - * Key.getFormat() + * {@code Key.getFormat()} * @param encoded the encoded bytes returned from - * Key.getEncoded() + * {@code Key.getEncoded()} * * @exception NullPointerException - * if type is null, - * if algorithm is null, - * if format is null, - * or if encoded is null + * if type is {@code null}, + * if algorithm is {@code null}, + * if format is {@code null}, + * or if encoded is {@code null} */ public KeyRep(Type type, String algorithm, String format, byte[] encoded) { diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index 75d405771a7..c363d0719f7 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -41,13 +41,13 @@ import javax.security.auth.callback.*; * This class represents a storage facility for cryptographic * keys and certificates. * - *

    A KeyStore manages different types of entries. - * Each type of entry implements the KeyStore.Entry interface. - * Three basic KeyStore.Entry implementations are provided: + *

    A {@code KeyStore} manages different types of entries. + * Each type of entry implements the {@code KeyStore.Entry} interface. + * Three basic {@code KeyStore.Entry} implementations are provided: * *

    Name Type
    + * * - * - * - * - * - * - - * - * + * + * + * + * + * + + * + * *
    Attributes Automatically Placed in a Provider Object
    NameValue
    Provider.id nameString.valueOf(provider.getName())
    Provider.id versionString.valueOf(provider.getVersion())
    Provider.id infoString.valueOf(provider.getInfo())
    Provider.id classNameprovider.getClass().getName()
    {@code Provider.id name}{@code String.valueOf(provider.getName())}
    {@code Provider.id version}{@code String.valueOf(provider.getVersion())}
    {@code Provider.id info}{@code String.valueOf(provider.getInfo())}
    {@code Provider.id className}{@code provider.getClass().getName()}
    * * @author Benjamin Renaud @@ -185,18 +186,18 @@ public abstract class Provider extends Properties { * used to look up facilities implemented by the provider. * *

    First, if there is a security manager, its - * checkSecurityAccess method is called with the string - * "clearProviderProperties."+name (where name + * {@code checkSecurityAccess} method is called with the string + * {@code "clearProviderProperties."+name} (where {@code name} * is the provider name) to see if it's ok to clear this provider. - * If the default implementation of checkSecurityAccess + * If the default implementation of {@code checkSecurityAccess} * is used (that is, that method is not overriden), then this results in - * a call to the security manager's checkPermission method - * with a SecurityPermission("clearProviderProperties."+name) + * a call to the security manager's {@code checkPermission} method + * with a {@code SecurityPermission("clearProviderProperties."+name)} * permission. * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies access to clear this provider * * @since 1.2 @@ -292,17 +293,17 @@ public abstract class Provider extends Properties { } /** - * Sets the key property to have the specified - * value. + * Sets the {@code key} property to have the specified + * {@code value}. * *

    First, if there is a security manager, its - * checkSecurityAccess method is called with the string - * "putProviderProperty."+name, where name is the + * {@code checkSecurityAccess} method is called with the string + * {@code "putProviderProperty."+name}, where {@code name} is the * provider name, to see if it's ok to set this provider's property values. - * If the default implementation of checkSecurityAccess + * If the default implementation of {@code checkSecurityAccess} * is used (that is, that method is not overriden), then this results in - * a call to the security manager's checkPermission method - * with a SecurityPermission("putProviderProperty."+name) + * a call to the security manager's {@code checkPermission} method + * with a {@code SecurityPermission("putProviderProperty."+name)} * permission. * * @param key the property key. @@ -310,11 +311,11 @@ public abstract class Provider extends Properties { * @param value the property value. * * @return the previous value of the specified property - * (key), or null if it did not have one. + * ({@code key}), or null if it did not have one. * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values. * * @since 1.2 @@ -329,18 +330,18 @@ public abstract class Provider extends Properties { } /** - * Removes the key property (and its corresponding - * value). + * Removes the {@code key} property (and its corresponding + * {@code value}). * *

    First, if there is a security manager, its - * checkSecurityAccess method is called with the string - * "removeProviderProperty."+name, where name is + * {@code checkSecurityAccess} method is called with the string + * {@code "removeProviderProperty."+name}, where {@code name} is * the provider name, to see if it's ok to remove this provider's * properties. If the default implementation of - * checkSecurityAccess is used (that is, that method is not + * {@code checkSecurityAccess} is used (that is, that method is not * overriden), then this results in a call to the security manager's - * checkPermission method with a - * SecurityPermission("removeProviderProperty."+name) + * {@code checkPermission} method with a + * {@code SecurityPermission("removeProviderProperty."+name)} * permission. * * @param key the key for the property to be removed. @@ -349,8 +350,8 @@ public abstract class Provider extends Properties { * or null if the key did not have a mapping. * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies access to remove this provider's properties. * * @since 1.2 @@ -662,9 +663,9 @@ public abstract class Provider extends Properties { * the service added via {@link #putService putService()} is returned. * * @param type the type of {@link Service service} requested - * (for example, MessageDigest) + * (for example, {@code MessageDigest}) * @param algorithm the case insensitive algorithm name (or alternate - * alias) of the service requested (for example, SHA-1) + * alias) of the service requested (for example, {@code SHA-1}) * * @return the service describing this Provider's matching service * or null if no such service exists @@ -739,20 +740,20 @@ public abstract class Provider extends Properties { * Java Cryptography Architecture API Specification & Reference . * *

    Also, if there is a security manager, its - * checkSecurityAccess method is called with the string - * "putProviderProperty."+name, where name is + * {@code checkSecurityAccess} method is called with the string + * {@code "putProviderProperty."+name}, where {@code name} is * the provider name, to see if it's ok to set this provider's property - * values. If the default implementation of checkSecurityAccess + * values. If the default implementation of {@code checkSecurityAccess} * is used (that is, that method is not overriden), then this results in - * a call to the security manager's checkPermission method with - * a SecurityPermission("putProviderProperty."+name) + * a call to the security manager's {@code checkPermission} method with + * a {@code SecurityPermission("putProviderProperty."+name)} * permission. * * @param s the Service to add * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method denies + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method denies * access to set property values. * @throws NullPointerException if s is null * @@ -830,21 +831,21 @@ public abstract class Provider extends Properties { * from this provider's Hashtable. * *

    Also, if there is a security manager, its - * checkSecurityAccess method is called with the string - * "removeProviderProperty."+name, where name is + * {@code checkSecurityAccess} method is called with the string + * {@code "removeProviderProperty."+name}, where {@code name} is * the provider name, to see if it's ok to remove this provider's * properties. If the default implementation of - * checkSecurityAccess is used (that is, that method is not + * {@code checkSecurityAccess} is used (that is, that method is not * overriden), then this results in a call to the security manager's - * checkPermission method with a - * SecurityPermission("removeProviderProperty."+name) + * {@code checkPermission} method with a + * {@code SecurityPermission("removeProviderProperty."+name)} * permission. * * @param s the Service to be removed * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method denies + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method denies * access to remove this provider's properties. * @throws NullPointerException if s is null * @@ -1122,7 +1123,7 @@ public abstract class Provider extends Properties { } /** - * Get the type of this service. For example, MessageDigest. + * Get the type of this service. For example, {@code MessageDigest}. * * @return the type of this service */ @@ -1132,7 +1133,7 @@ public abstract class Provider extends Properties { /** * Return the name of the algorithm of this service. For example, - * SHA-1. + * {@code SHA-1}. * * @return the algorithm of this service */ diff --git a/jdk/src/share/classes/java/security/ProviderException.java b/jdk/src/share/classes/java/security/ProviderException.java index 449c8c36168..b372ee75752 100644 --- a/jdk/src/share/classes/java/security/ProviderException.java +++ b/jdk/src/share/classes/java/security/ProviderException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,13 +58,13 @@ public class ProviderException extends RuntimeException { } /** - * Creates a ProviderException with the specified + * Creates a {@code ProviderException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -73,13 +73,13 @@ public class ProviderException extends RuntimeException { } /** - * Creates a ProviderException with the specified cause - * and a detail message of (cause==null ? null : cause.toString()) + * Creates a {@code ProviderException} with the specified cause + * and a detail message of {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/PublicKey.java b/jdk/src/share/classes/java/security/PublicKey.java index c983ff611d9..df49807eea4 100644 --- a/jdk/src/share/classes/java/security/PublicKey.java +++ b/jdk/src/share/classes/java/security/PublicKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ package java.security; * * Note: The specialized public key interfaces extend this interface. * See, for example, the DSAPublicKey interface in - * java.security.interfaces. + * {@code java.security.interfaces}. * * @see Key * @see PrivateKey diff --git a/jdk/src/share/classes/java/security/SecureClassLoader.java b/jdk/src/share/classes/java/security/SecureClassLoader.java index ffcd1a7160f..145f4fc482b 100644 --- a/jdk/src/share/classes/java/security/SecureClassLoader.java +++ b/jdk/src/share/classes/java/security/SecureClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,12 +63,12 @@ public class SecureClassLoader extends ClassLoader { * class loader for delegation. * *

    If there is a security manager, this method first - * calls the security manager's checkCreateClassLoader + * calls the security manager's {@code checkCreateClassLoader} * method to ensure creation of a class loader is allowed. *

    * @param parent the parent ClassLoader * @exception SecurityException if a security manager exists and its - * checkCreateClassLoader method doesn't allow + * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. * @see SecurityManager#checkCreateClassLoader */ @@ -87,11 +87,11 @@ public class SecureClassLoader extends ClassLoader { * loader for delegation. * *

    If there is a security manager, this method first - * calls the security manager's checkCreateClassLoader + * calls the security manager's {@code checkCreateClassLoader} * method to ensure creation of a class loader is allowed. * * @exception SecurityException if a security manager exists and its - * checkCreateClassLoader method doesn't allow + * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. * @see SecurityManager#checkCreateClassLoader */ @@ -113,22 +113,22 @@ public class SecureClassLoader extends ClassLoader { * If a non-null CodeSource is supplied a ProtectionDomain is * constructed and associated with the class being defined. *

    - * @param name the expected name of the class, or null + * @param name the expected name of the class, or {@code null} * if not known, using '.' and not '/' as the separator * and without a trailing ".class" suffix. * @param b the bytes that make up the class data. The bytes in - * positions off through off+len-1 + * positions {@code off} through {@code off+len-1} * should have the format of a valid class file as defined by * The Java™ Virtual Machine Specification. - * @param off the start offset in b of the class data + * @param off the start offset in {@code b} of the class data * @param len the length of the class data - * @param cs the associated CodeSource, or null if none - * @return the Class object created from the data, + * @param cs the associated CodeSource, or {@code null} if none + * @return the {@code Class} object created from the data, * and optional CodeSource. * @exception ClassFormatError if the data did not contain a valid class - * @exception IndexOutOfBoundsException if either off or - * len is negative, or if - * off+len is greater than b.length. + * @exception IndexOutOfBoundsException if either {@code off} or + * {@code len} is negative, or if + * {@code off+len} is greater than {@code b.length}. * * @exception SecurityException if an attempt is made to add this class * to a package that contains classes that were signed by @@ -143,22 +143,22 @@ public class SecureClassLoader extends ClassLoader { } /** - * Converts a {@link java.nio.ByteBuffer ByteBuffer} - * into an instance of class Class, with an optional CodeSource. + * Converts a {@link java.nio.ByteBuffer ByteBuffer} + * into an instance of class {@code Class}, with an optional CodeSource. * Before the class can be used it must be resolved. *

    * If a non-null CodeSource is supplied a ProtectionDomain is * constructed and associated with the class being defined. *

    - * @param name the expected name of the class, or null + * @param name the expected name of the class, or {@code null} * if not known, using '.' and not '/' as the separator * and without a trailing ".class" suffix. * @param b the bytes that make up the class data. The bytes from positions - * b.position() through b.position() + b.limit() -1 + * {@code b.position()} through {@code b.position() + b.limit() -1} * should have the format of a valid class file as defined by * The Java™ Virtual Machine Specification. - * @param cs the associated CodeSource, or null if none - * @return the Class object created from the data, + * @param cs the associated CodeSource, or {@code null} if none + * @return the {@code Class} object created from the data, * and optional CodeSource. * @exception ClassFormatError if the data did not contain a valid class * @exception SecurityException if an attempt is made to add this class diff --git a/jdk/src/share/classes/java/security/SecureRandom.java b/jdk/src/share/classes/java/security/SecureRandom.java index 1b4872fa6eb..5afec7b0797 100644 --- a/jdk/src/share/classes/java/security/SecureRandom.java +++ b/jdk/src/share/classes/java/security/SecureRandom.java @@ -50,7 +50,7 @@ import sun.security.jca.GetInstance.Instance; * RFC 1750: Randomness Recommendations for Security. * *

    A caller obtains a SecureRandom instance via the - * no-argument constructor or one of the getInstance methods: + * no-argument constructor or one of the {@code getInstance} methods: * *

      *      SecureRandom random = new SecureRandom();
    @@ -71,15 +71,15 @@ import sun.security.jca.GetInstance.Instance;
      *      random.nextBytes(bytes);
      * 
    * - *

    Callers may also invoke the generateSeed method + *

    Callers may also invoke the {@code generateSeed} method * to generate a given number of seed bytes (to seed other random number * generators, for example): *

      *      byte seed[] = random.generateSeed(20);
      * 
    * - * Note: Depending on the implementation, the generateSeed and - * nextBytes methods may block as entropy is being gathered, + * Note: Depending on the implementation, the {@code generateSeed} and + * {@code nextBytes} methods may block as entropy is being gathered, * for example, if they need to read from /dev/random on various Unix-like * operating systems. * @@ -140,16 +140,16 @@ public class SecureRandom extends java.util.Random { * for information about standard RNG algorithm names. * *

    The returned SecureRandom object has not been seeded. To seed the - * returned object, call the setSeed method. - * If setSeed is not called, the first call to - * nextBytes will force the SecureRandom object to seed itself. - * This self-seeding will not occur if setSeed was + * returned object, call the {@code setSeed} method. + * If {@code setSeed} is not called, the first call to + * {@code nextBytes} will force the SecureRandom object to seed itself. + * This self-seeding will not occur if {@code setSeed} was * previously called. */ public SecureRandom() { /* * This call to our superclass constructor will result in a call - * to our own setSeed method, which will return + * to our own {@code setSeed} method, which will return * immediately when it is passed zero. */ super(0); @@ -250,10 +250,10 @@ public class SecureRandom extends java.util.Random { * the {@link Security#getProviders() Security.getProviders()} method. * *

    The returned SecureRandom object has not been seeded. To seed the - * returned object, call the setSeed method. - * If setSeed is not called, the first call to - * nextBytes will force the SecureRandom object to seed itself. - * This self-seeding will not occur if setSeed was + * returned object, call the {@code setSeed} method. + * If {@code setSeed} is not called, the first call to + * {@code nextBytes} will force the SecureRandom object to seed itself. + * This self-seeding will not occur if {@code setSeed} was * previously called. * * @param algorithm the name of the RNG algorithm. @@ -293,10 +293,10 @@ public class SecureRandom extends java.util.Random { * the {@link Security#getProviders() Security.getProviders()} method. * *

    The returned SecureRandom object has not been seeded. To seed the - * returned object, call the setSeed method. - * If setSeed is not called, the first call to - * nextBytes will force the SecureRandom object to seed itself. - * This self-seeding will not occur if setSeed was + * returned object, call the {@code setSeed} method. + * If {@code setSeed} is not called, the first call to + * {@code nextBytes} will force the SecureRandom object to seed itself. + * This self-seeding will not occur if {@code setSeed} was * previously called. * * @param algorithm the name of the RNG algorithm. @@ -341,10 +341,10 @@ public class SecureRandom extends java.util.Random { * does not have to be registered in the provider list. * *

    The returned SecureRandom object has not been seeded. To seed the - * returned object, call the setSeed method. - * If setSeed is not called, the first call to - * nextBytes will force the SecureRandom object to seed itself. - * This self-seeding will not occur if setSeed was + * returned object, call the {@code setSeed} method. + * If {@code setSeed} is not called, the first call to + * {@code nextBytes} will force the SecureRandom object to seed itself. + * This self-seeding will not occur if {@code setSeed} was * previously called. * * @param algorithm the name of the RNG algorithm. @@ -395,7 +395,7 @@ public class SecureRandom extends java.util.Random { * Returns the name of the algorithm implemented by this SecureRandom * object. * - * @return the name of the algorithm or unknown + * @return the name of the algorithm or {@code unknown} * if the algorithm name cannot be determined. * @since 1.5 */ @@ -418,12 +418,12 @@ public class SecureRandom extends java.util.Random { /** * Reseeds this random object, using the eight bytes contained - * in the given long seed. The given seed supplements, + * in the given {@code long seed}. The given seed supplements, * rather than replaces, the existing seed. Thus, repeated calls * are guaranteed never to reduce randomness. * *

    This method is defined for compatibility with - * java.util.Random. + * {@code java.util.Random}. * * @param seed the seed. * @@ -445,10 +445,10 @@ public class SecureRandom extends java.util.Random { /** * Generates a user-specified number of random bytes. * - *

    If a call to setSeed had not occurred previously, + *

    If a call to {@code setSeed} had not occurred previously, * the first call to this method forces this SecureRandom object * to seed itself. This self-seeding will not occur if - * setSeed was previously called. + * {@code setSeed} was previously called. * * @param bytes the array to be filled in with random bytes. */ @@ -460,15 +460,15 @@ public class SecureRandom extends java.util.Random { /** * Generates an integer containing the user-specified number of * pseudo-random bits (right justified, with leading zeros). This - * method overrides a java.util.Random method, and serves + * method overrides a {@code java.util.Random} method, and serves * to provide a source of random bits to all of the methods inherited - * from that class (for example, nextInt, - * nextLong, and nextFloat). + * from that class (for example, {@code nextInt}, + * {@code nextLong}, and {@code nextFloat}). * * @param numBits number of pseudo-random bits to be generated, where - * 0 <= numBits <= 32. + * {@code 0 <= numBits <= 32}. * - * @return an int containing the user-specified number + * @return an {@code int} containing the user-specified number * of pseudo-random bits (right justified, with leading zeros). */ @Override @@ -492,8 +492,8 @@ public class SecureRandom extends java.util.Random { * *

    This method is only included for backwards compatibility. * The caller is encouraged to use one of the alternative - * getInstance methods to obtain a SecureRandom object, and - * then call the generateSeed method to obtain seed bytes + * {@code getInstance} methods to obtain a SecureRandom object, and + * then call the {@code generateSeed} method to obtain seed bytes * from that object. * * @param numBytes the number of seed bytes to generate. diff --git a/jdk/src/share/classes/java/security/SecureRandomSpi.java b/jdk/src/share/classes/java/security/SecureRandomSpi.java index 12652e98a65..ef6c2433630 100644 --- a/jdk/src/share/classes/java/security/SecureRandomSpi.java +++ b/jdk/src/share/classes/java/security/SecureRandomSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ package java.security; /** * This class defines the Service Provider Interface (SPI) - * for the SecureRandom class. + * for the {@code SecureRandom} class. * All the abstract methods in this class must be implemented by each * service provider who wishes to supply the implementation * of a cryptographically strong pseudo-random number generator. @@ -53,10 +53,10 @@ public abstract class SecureRandomSpi implements java.io.Serializable { /** * Generates a user-specified number of random bytes. * - *

    If a call to engineSetSeed had not occurred previously, + *

    If a call to {@code engineSetSeed} had not occurred previously, * the first call to this method forces this SecureRandom implementation * to seed itself. This self-seeding will not occur if - * engineSetSeed was previously called. + * {@code engineSetSeed} was previously called. * * @param bytes the array to be filled in with random bytes. */ diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java index eccede10b20..98699da8149 100644 --- a/jdk/src/share/classes/java/security/Security.java +++ b/jdk/src/share/classes/java/security/Security.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -298,7 +298,7 @@ public final class Security { * property in the master file of the "SUN" Cryptographic Service * Provider in order to determine how to parse algorithm-specific * parameters. Use the new provider-based and algorithm-independent - * AlgorithmParameters and KeyFactory engine + * {@code AlgorithmParameters} and {@code KeyFactory} engine * classes (introduced in the J2SE version 1.2 platform) instead. */ @Deprecated @@ -321,21 +321,21 @@ public final class Security { * *

    If the given provider is installed at the requested position, * the provider that used to be at that position, and all providers - * with a position greater than position, are shifted up + * with a position greater than {@code position}, are shifted up * one position (towards the end of the list of installed providers). * *

    A provider cannot be added if it is already installed. * *

    First, if there is a security manager, its - * checkSecurityAccess + * {@code checkSecurityAccess} * method is called with the string - * "insertProvider."+provider.getName() + * {@code "insertProvider."+provider.getName()} * to see if it's ok to add a new provider. - * If the default implementation of checkSecurityAccess + * If the default implementation of {@code checkSecurityAccess} * is used (i.e., that method is not overriden), then this will result in - * a call to the security manager's checkPermission method + * a call to the security manager's {@code checkPermission} method * with a - * SecurityPermission("insertProvider."+provider.getName()) + * {@code SecurityPermission("insertProvider."+provider.getName())} * permission. * * @param provider the provider to be added. @@ -349,8 +349,8 @@ public final class Security { * * @throws NullPointerException if provider is null * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies access to add a new provider * * @see #getProvider @@ -374,15 +374,15 @@ public final class Security { * Adds a provider to the next position available. * *

    First, if there is a security manager, its - * checkSecurityAccess + * {@code checkSecurityAccess} * method is called with the string - * "insertProvider."+provider.getName() + * {@code "insertProvider."+provider.getName()} * to see if it's ok to add a new provider. - * If the default implementation of checkSecurityAccess + * If the default implementation of {@code checkSecurityAccess} * is used (i.e., that method is not overriden), then this will result in - * a call to the security manager's checkPermission method + * a call to the security manager's {@code checkPermission} method * with a - * SecurityPermission("insertProvider."+provider.getName()) + * {@code SecurityPermission("insertProvider."+provider.getName())} * permission. * * @param provider the provider to be added. @@ -393,8 +393,8 @@ public final class Security { * * @throws NullPointerException if provider is null * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies access to add a new provider * * @see #getProvider @@ -423,20 +423,20 @@ public final class Security { * if name is null. * *

    First, if there is a security manager, its - * checkSecurityAccess - * method is called with the string "removeProvider."+name + * {@code checkSecurityAccess} + * method is called with the string {@code "removeProvider."+name} * to see if it's ok to remove the provider. - * If the default implementation of checkSecurityAccess + * If the default implementation of {@code checkSecurityAccess} * is used (i.e., that method is not overriden), then this will result in - * a call to the security manager's checkPermission method - * with a SecurityPermission("removeProvider."+name) + * a call to the security manager's {@code checkPermission} method + * with a {@code SecurityPermission("removeProvider."+name)} * permission. * * @param name the name of the provider to remove. * * @throws SecurityException - * if a security manager exists and its {@link - * java.lang.SecurityManager#checkSecurityAccess} method + * if a security manager exists and its {@link + * java.lang.SecurityManager#checkSecurityAccess} method * denies * access to remove the provider * @@ -480,8 +480,8 @@ public final class Security { * Returns an array containing all installed providers that satisfy the * specified selection criterion, or null if no such providers have been * installed. The returned providers are ordered - * according to their preference order. + * according to their + * {@linkplain #insertProviderAt(java.security.Provider, int) preference order}. * *

    A cryptographic service is always associated with a particular * algorithm or type. For example, a digital signature service is @@ -492,8 +492,8 @@ public final class Security { *

    The selection criterion must be specified in one of the following two * formats: *

      - *
    • <crypto_service>.<algorithm_or_type>

      The - * cryptographic service name must not contain any dots. + *

    • {@literal .} + *

      The cryptographic service name must not contain any dots. *

      A * provider satisfies the specified selection criterion iff the provider * implements the @@ -501,11 +501,12 @@ public final class Security { *

      For example, "CertificateFactory.X.509" * would be satisfied by any provider that supplied * a CertificateFactory implementation for X.509 certificates. - *

    • <crypto_service>.<algorithm_or_type> - * <attribute_name>:< attribute_value> + *
    • {@literal . + * :} *

      The cryptographic service name must not contain any dots. There * must be one or more space charaters between the - * <algorithm_or_type> and the <attribute_name>. + * {@literal } and the + * {@literal }. *

      A provider satisfies this selection criterion iff the * provider implements the specified algorithm or type for the specified * cryptographic service and its implementation meets the @@ -558,8 +559,9 @@ public final class Security { * Returns an array containing all installed providers that satisfy the * specified* selection criteria, or null if no such providers have been * installed. The returned providers are ordered - * according to their preference order. + * according to their + * {@linkplain #insertProviderAt(java.security.Provider, int) + * preference order}. * *

      The selection criteria are represented by a map. * Each map entry represents a selection criterion. @@ -567,16 +569,18 @@ public final class Security { * criteria. The key for any entry in such a map must be in one of the * following two formats: *

      * - * The java.security.acl package provides the + * The {@code java.security.acl } package provides the * interfaces to the ACL and related data structures (ACL entries, - * groups, permissions, etc.), and the sun.security.acl + * groups, permissions, etc.), and the {@code sun.security.acl } * classes provide a default implementation of the interfaces. For - * example, java.security.acl.Acl provides the - * interface to an ACL and the sun.security.acl.AclImpl + * example, {@code java.security.acl.Acl } provides the + * interface to an ACL and the {@code sun.security.acl.AclImpl } * class provides the default implementation of the interface.

      * - * The java.security.acl.Acl interface extends the - * java.security.acl.Owner interface. The Owner + * The {@code java.security.acl.Acl } interface extends the + * {@code java.security.acl.Owner } interface. The Owner * interface is used to maintain a list of owners for each ACL. Only * owners are allowed to modify an ACL. For example, only an owner can - * call the ACL's addEntry method to add a new ACL entry + * call the ACL's {@code addEntry} method to add a new ACL entry * to the ACL. * * @see java.security.acl.AclEntry @@ -217,7 +217,7 @@ public interface Acl extends Owner { * More specifically, this method checks whether the passed permission * is a member of the allowed permission set of the specified principal. * The allowed permission set is determined by the same algorithm as is - * used by the getPermissions method. + * used by the {@code getPermissions} method. * * @param principal the principal, assumed to be a valid authenticated * Principal. diff --git a/jdk/src/share/classes/java/security/acl/AclEntry.java b/jdk/src/share/classes/java/security/acl/AclEntry.java index f8dd3a752e0..cd9675f34a1 100644 --- a/jdk/src/share/classes/java/security/acl/AclEntry.java +++ b/jdk/src/share/classes/java/security/acl/AclEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,7 @@ public interface AclEntry extends Cloneable { * specified in the entry. * * Note: ACL entries are by default positive. An entry becomes a - * negative entry only if this setNegativePermissions + * negative entry only if this {@code setNegativePermissions} * method is called on it. */ public void setNegativePermissions(); diff --git a/jdk/src/share/classes/java/security/acl/Group.java b/jdk/src/share/classes/java/security/acl/Group.java index be3578b3c33..ebd9c445282 100644 --- a/jdk/src/share/classes/java/security/acl/Group.java +++ b/jdk/src/share/classes/java/security/acl/Group.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import java.security.Principal; * Note that Group extends Principal. Thus, either a Principal or a Group can * be passed as an argument to methods containing a Principal parameter. For * example, you can add either a Principal or a Group to a Group object by - * calling the object's addMember method, passing it the + * calling the object's {@code addMember} method, passing it the * Principal or Group. * * @author Satish Dharmaraj diff --git a/jdk/src/share/classes/java/security/acl/Owner.java b/jdk/src/share/classes/java/security/acl/Owner.java index 313889528d6..2f649d40b33 100644 --- a/jdk/src/share/classes/java/security/acl/Owner.java +++ b/jdk/src/share/classes/java/security/acl/Owner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ import java.security.Principal; /** * Interface for managing owners of Access Control Lists (ACLs) or ACL * configurations. (Note that the Acl interface in the - * java.security.acl package extends this Owner + * {@code java.security.acl} package extends this Owner * interface.) The initial owner Principal should be specified as an * argument to the constructor of the class implementing this interface. * diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBClassLoader.java b/jdk/src/share/classes/java/security/acl/package-info.java similarity index 59% rename from corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBClassLoader.java rename to jdk/src/share/classes/java/security/acl/package-info.java index 3e3ba8dcf11..356c102e323 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBClassLoader.java +++ b/jdk/src/share/classes/java/security/acl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,26 +22,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package com.sun.corba.se.impl.orbutil; /** - * Based on feedback from bug report 4452016, all class loading - * in the ORB is isolated here. It is acceptable to use - * Class.forName only when one is certain that the desired class - * should come from the core JDK. + * The classes and interfaces in this package have been + * superseded by classes in the java.security package. + * See that package and, for example, java.security.Permission for details. + * + * @since JDK1.1 */ -public class ORBClassLoader -{ - public static Class loadClass(String className) - throws ClassNotFoundException - { - return ORBClassLoader.getClassLoader().loadClass(className); - } - - public static ClassLoader getClassLoader() { - if (Thread.currentThread().getContextClassLoader() != null) - return Thread.currentThread().getContextClassLoader(); - else - return ClassLoader.getSystemClassLoader(); - } -} +package java.security.acl; diff --git a/jdk/src/share/classes/java/security/acl/package.html b/jdk/src/share/classes/java/security/acl/package.html deleted file mode 100644 index 497dfe8323e..00000000000 --- a/jdk/src/share/classes/java/security/acl/package.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -The classes and interfaces in this package have been -superseded by classes in the java.security package. -See that package and, for example, java.security.Permission for details. - - - -@since JDK1.1 - - diff --git a/jdk/src/share/classes/java/security/cert/CRLException.java b/jdk/src/share/classes/java/security/cert/CRLException.java index ca5b689d07c..7a854316bbd 100644 --- a/jdk/src/share/classes/java/security/cert/CRLException.java +++ b/jdk/src/share/classes/java/security/cert/CRLException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,13 @@ public class CRLException extends GeneralSecurityException { } /** - * Creates a CRLException with the specified + * Creates a {@code CRLException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -72,13 +72,13 @@ public class CRLException extends GeneralSecurityException { } /** - * Creates a CRLException with the specified cause - * and a detail message of (cause==null ? null : cause.toString()) + * Creates a {@code CRLException} with the specified cause + * and a detail message of {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/cert/CRLSelector.java b/jdk/src/share/classes/java/security/cert/CRLSelector.java index 2c00f10bca7..7ab181d48c5 100644 --- a/jdk/src/share/classes/java/security/cert/CRLSelector.java +++ b/jdk/src/share/classes/java/security/cert/CRLSelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,9 @@ package java.security.cert; /** - * A selector that defines a set of criteria for selecting CRLs. + * A selector that defines a set of criteria for selecting {@code CRL}s. * Classes that implement this interface are often used to specify - * which CRLs should be retrieved from a CertStore. + * which {@code CRL}s should be retrieved from a {@code CertStore}. *

      * Concurrent Access *

      @@ -48,19 +48,19 @@ package java.security.cert; public interface CRLSelector extends Cloneable { /** - * Decides whether a CRL should be selected. + * Decides whether a {@code CRL} should be selected. * - * @param crl the CRL to be checked - * @return true if the CRL should be selected, - * false otherwise + * @param crl the {@code CRL} to be checked + * @return {@code true} if the {@code CRL} should be selected, + * {@code false} otherwise */ boolean match(CRL crl); /** - * Makes a copy of this CRLSelector. Changes to the + * Makes a copy of this {@code CRLSelector}. Changes to the * copy will not affect the original and vice versa. * - * @return a copy of this CRLSelector + * @return a copy of this {@code CRLSelector} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertPath.java b/jdk/src/share/classes/java/security/cert/CertPath.java index 052be2043c9..8717f948203 100644 --- a/jdk/src/share/classes/java/security/cert/CertPath.java +++ b/jdk/src/share/classes/java/security/cert/CertPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,59 +36,59 @@ import java.util.List; * An immutable sequence of certificates (a certification path). *

      * This is an abstract class that defines the methods common to all - * CertPaths. Subclasses can handle different kinds of + * {@code CertPath}s. Subclasses can handle different kinds of * certificates (X.509, PGP, etc.). *

      - * All CertPath objects have a type, a list of - * Certificates, and one or more supported encodings. Because the - * CertPath class is immutable, a CertPath cannot + * All {@code CertPath} objects have a type, a list of + * {@code Certificate}s, and one or more supported encodings. Because the + * {@code CertPath} class is immutable, a {@code CertPath} cannot * change in any externally visible way after being constructed. This * stipulation applies to all public fields and methods of this class and any * added or overridden by subclasses. *

      - * The type is a String that identifies the type of - * Certificates in the certification path. For each - * certificate cert in a certification path certPath, - * cert.getType().equals(certPath.getType()) must be - * true. + * The type is a {@code String} that identifies the type of + * {@code Certificate}s in the certification path. For each + * certificate {@code cert} in a certification path {@code certPath}, + * {@code cert.getType().equals(certPath.getType())} must be + * {@code true}. *

      - * The list of Certificates is an ordered List of - * zero or more Certificates. This List and all - * of the Certificates contained in it must be immutable. + * The list of {@code Certificate}s is an ordered {@code List} of + * zero or more {@code Certificate}s. This {@code List} and all + * of the {@code Certificate}s contained in it must be immutable. *

      - * Each CertPath object must support one or more encodings + * Each {@code CertPath} object must support one or more encodings * so that the object can be translated into a byte array for storage or * transmission to other parties. Preferably, these encodings should be * well-documented standards (such as PKCS#7). One of the encodings supported - * by a CertPath is considered the default encoding. This + * by a {@code CertPath} is considered the default encoding. This * encoding is used if no encoding is explicitly requested (for the * {@link #getEncoded() getEncoded()} method, for instance). *

      - * All CertPath objects are also Serializable. - * CertPath objects are resolved into an alternate + * All {@code CertPath} objects are also {@code Serializable}. + * {@code CertPath} objects are resolved into an alternate * {@link CertPathRep CertPathRep} object during serialization. This allows - * a CertPath object to be serialized into an equivalent + * a {@code CertPath} object to be serialized into an equivalent * representation regardless of its underlying implementation. *

      - * CertPath objects can be created with a - * CertificateFactory or they can be returned by other classes, - * such as a CertPathBuilder. + * {@code CertPath} objects can be created with a + * {@code CertificateFactory} or they can be returned by other classes, + * such as a {@code CertPathBuilder}. *

      - * By convention, X.509 CertPaths (consisting of - * X509Certificates), are ordered starting with the target + * By convention, X.509 {@code CertPath}s (consisting of + * {@code X509Certificate}s), are ordered starting with the target * certificate and ending with a certificate issued by the trust anchor. That * is, the issuer of one certificate is the subject of the following one. The * certificate representing the {@link TrustAnchor TrustAnchor} should not be - * included in the certification path. Unvalidated X.509 CertPaths - * may not follow these conventions. PKIX CertPathValidators will + * included in the certification path. Unvalidated X.509 {@code CertPath}s + * may not follow these conventions. PKIX {@code CertPathValidator}s will * detect any departure from these conventions that cause the certification - * path to be invalid and throw a CertPathValidatorException. + * path to be invalid and throw a {@code CertPathValidatorException}. * *

      Every implementation of the Java platform is required to support the - * following standard CertPath encodings: + * following standard {@code CertPath} encodings: *

        - *
      • PKCS7
      • - *
      • PkiPath
      • + *
      • {@code PKCS7}
      • + *
      • {@code PkiPath}
      • *
      * These encodings are described in the
      @@ -99,17 +99,17 @@ import java.util.List; *

      * Concurrent Access *

      - * All CertPath objects must be thread-safe. That is, multiple + * All {@code CertPath} objects must be thread-safe. That is, multiple * threads may concurrently invoke the methods defined in this class on a - * single CertPath object (or more than one) with no - * ill effects. This is also true for the List returned by - * CertPath.getCertificates. + * single {@code CertPath} object (or more than one) with no + * ill effects. This is also true for the {@code List} returned by + * {@code CertPath.getCertificates}. *

      - * Requiring CertPath objects to be immutable and thread-safe + * Requiring {@code CertPath} objects to be immutable and thread-safe * allows them to be passed around to various pieces of code without worrying * about coordinating access. Providing this thread-safety is - * generally not difficult, since the CertPath and - * List objects in question are immutable. + * generally not difficult, since the {@code CertPath} and + * {@code List} objects in question are immutable. * * @see CertificateFactory * @see CertPathBuilder @@ -124,25 +124,25 @@ public abstract class CertPath implements Serializable { private String type; // the type of certificates in this chain /** - * Creates a CertPath of the specified type. + * Creates a {@code CertPath} of the specified type. *

      * This constructor is protected because most users should use a - * CertificateFactory to create CertPaths. + * {@code CertificateFactory} to create {@code CertPath}s. * * @param type the standard name of the type of - * Certificates in this path + * {@code Certificate}s in this path */ protected CertPath(String type) { this.type = type; } /** - * Returns the type of Certificates in this certification + * Returns the type of {@code Certificate}s in this certification * path. This is the same string that would be returned by * {@link java.security.cert.Certificate#getType() cert.getType()} - * for all Certificates in the certification path. + * for all {@code Certificate}s in the certification path. * - * @return the type of Certificates in this certification + * @return the type of {@code Certificate}s in this certification * path (never null) */ public String getType() { @@ -152,21 +152,21 @@ public abstract class CertPath implements Serializable { /** * Returns an iteration of the encodings supported by this certification * path, with the default encoding first. Attempts to modify the returned - * Iterator via its remove method result in an - * UnsupportedOperationException. + * {@code Iterator} via its {@code remove} method result in an + * {@code UnsupportedOperationException}. * - * @return an Iterator over the names of the supported + * @return an {@code Iterator} over the names of the supported * encodings (as Strings) */ public abstract Iterator getEncodings(); /** * Compares this certification path for equality with the specified - * object. Two CertPaths are equal if and only if their - * types are equal and their certificate Lists (and by - * implication the Certificates in those Lists) - * are equal. A CertPath is never equal to an object that is - * not a CertPath. + * object. Two {@code CertPath}s are equal if and only if their + * types are equal and their certificate {@code List}s (and by + * implication the {@code Certificate}s in those {@code List}s) + * are equal. A {@code CertPath} is never equal to an object that is + * not a {@code CertPath}. *

      * This algorithm is implemented by this method. If it is overridden, * the behavior specified here must be maintained. @@ -195,14 +195,14 @@ public abstract class CertPath implements Serializable { * Returns the hashcode for this certification path. The hash code of * a certification path is defined to be the result of the following * calculation: - *

      
      +     * 
      {@code
            *  hashCode = path.getType().hashCode();
            *  hashCode = 31*hashCode + path.getCertificates().hashCode();
      -     * 
      - * This ensures that path1.equals(path2) implies that - * path1.hashCode()==path2.hashCode() for any two certification - * paths, path1 and path2, as required by the - * general contract of Object.hashCode. + * }
      + * This ensures that {@code path1.equals(path2)} implies that + * {@code path1.hashCode()==path2.hashCode()} for any two certification + * paths, {@code path1} and {@code path2}, as required by the + * general contract of {@code Object.hashCode}. * * @return the hashcode value for this certification path */ @@ -214,8 +214,8 @@ public abstract class CertPath implements Serializable { /** * Returns a string representation of this certification path. - * This calls the toString method on each of the - * Certificates in the path. + * This calls the {@code toString} method on each of the + * {@code Certificate}s in the path. * * @return a string representation of this certification path */ @@ -266,20 +266,20 @@ public abstract class CertPath implements Serializable { /** * Returns the list of certificates in this certification path. - * The List returned must be immutable and thread-safe. + * The {@code List} returned must be immutable and thread-safe. * - * @return an immutable List of Certificates + * @return an immutable {@code List} of {@code Certificate}s * (may be empty, but not null) */ public abstract List getCertificates(); /** - * Replaces the CertPath to be serialized with a - * CertPathRep object. + * Replaces the {@code CertPath} to be serialized with a + * {@code CertPathRep} object. * - * @return the CertPathRep to be serialized + * @return the {@code CertPathRep} to be serialized * - * @throws ObjectStreamException if a CertPathRep object + * @throws ObjectStreamException if a {@code CertPathRep} object * representing this certification path could not be created */ protected Object writeReplace() throws ObjectStreamException { @@ -295,7 +295,7 @@ public abstract class CertPath implements Serializable { } /** - * Alternate CertPath class for serialization. + * Alternate {@code CertPath} class for serialization. * @since 1.4 */ protected static class CertPathRep implements Serializable { @@ -308,10 +308,10 @@ public abstract class CertPath implements Serializable { private byte[] data; /** - * Creates a CertPathRep with the specified + * Creates a {@code CertPathRep} with the specified * type and encoded form of a certification path. * - * @param type the standard name of a CertPath type + * @param type the standard name of a {@code CertPath} type * @param data the encoded form of the certification path */ protected CertPathRep(String type, byte[] data) { @@ -320,11 +320,11 @@ public abstract class CertPath implements Serializable { } /** - * Returns a CertPath constructed from the type and data. + * Returns a {@code CertPath} constructed from the type and data. * - * @return the resolved CertPath object + * @return the resolved {@code CertPath} object * - * @throws ObjectStreamException if a CertPath could not + * @throws ObjectStreamException if a {@code CertPath} could not * be constructed */ protected Object readResolve() throws ObjectStreamException { diff --git a/jdk/src/share/classes/java/security/cert/CertPathBuilder.java b/jdk/src/share/classes/java/security/cert/CertPathBuilder.java index 998477b4814..6008e9ec180 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathBuilder.java +++ b/jdk/src/share/classes/java/security/cert/CertPathBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,16 +41,16 @@ import sun.security.jca.GetInstance.Instance; * A class for building certification paths (also known as certificate chains). *

      * This class uses a provider-based architecture. - * To create a CertPathBuilder, call - * one of the static getInstance methods, passing in the - * algorithm name of the CertPathBuilder desired and optionally + * To create a {@code CertPathBuilder}, call + * one of the static {@code getInstance} methods, passing in the + * algorithm name of the {@code CertPathBuilder} desired and optionally * the name of the provider desired. * - *

      Once a CertPathBuilder object has been created, certification + *

      Once a {@code CertPathBuilder} object has been created, certification * paths can be constructed by calling the {@link #build build} method and * passing it an algorithm-specific set of parameters. If successful, the - * result (including the CertPath that was built) is returned - * in an object that implements the CertPathBuilderResult + * result (including the {@code CertPath} that was built) is returned + * in an object that implements the {@code CertPathBuilderResult} * interface. * *

      The {@link #getRevocationChecker} method allows an application to specify @@ -67,9 +67,9 @@ import sun.security.jca.GetInstance.Instance; * * *

      Every implementation of the Java platform is required to support the - * following standard CertPathBuilder algorithm: + * following standard {@code CertPathBuilder} algorithm: *

        - *
      • PKIX
      • + *
      • {@code PKIX}
      • *
      * This algorithm is described in the
      @@ -87,9 +87,9 @@ import sun.security.jca.GetInstance.Instance; *

      * However, this is not true for the non-static methods defined by this class. * Unless otherwise documented by a specific provider, threads that need to - * access a single CertPathBuilder instance concurrently should + * access a single {@code CertPathBuilder} instance concurrently should * synchronize amongst themselves and provide the necessary locking. Multiple - * threads each manipulating a different CertPathBuilder instance + * threads each manipulating a different {@code CertPathBuilder} instance * need not synchronize. * * @see CertPath @@ -114,7 +114,7 @@ public class CertPathBuilder { private final String algorithm; /** - * Creates a CertPathBuilder object of the given algorithm, + * Creates a {@code CertPathBuilder} object of the given algorithm, * and encapsulates the given provider implementation (SPI object) in it. * * @param builderSpi the provider implementation @@ -130,7 +130,7 @@ public class CertPathBuilder { } /** - * Returns a CertPathBuilder object that implements the + * Returns a {@code CertPathBuilder} object that implements the * specified algorithm. * *

      This method traverses the list of registered security Providers, @@ -142,13 +142,13 @@ public class CertPathBuilder { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param algorithm the name of the requested CertPathBuilder + * @param algorithm the name of the requested {@code CertPathBuilder} * algorithm. See the CertPathBuilder section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * - * @return a CertPathBuilder object that implements the + * @return a {@code CertPathBuilder} object that implements the * specified algorithm. * * @throws NoSuchAlgorithmException if no Provider supports a @@ -166,7 +166,7 @@ public class CertPathBuilder { } /** - * Returns a CertPathBuilder object that implements the + * Returns a {@code CertPathBuilder} object that implements the * specified algorithm. * *

      A new CertPathBuilder object encapsulating the @@ -177,7 +177,7 @@ public class CertPathBuilder { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param algorithm the name of the requested CertPathBuilder + * @param algorithm the name of the requested {@code CertPathBuilder} * algorithm. See the CertPathBuilder section in the * Java Cryptography Architecture Standard Algorithm Name Documentation @@ -185,7 +185,7 @@ public class CertPathBuilder { * * @param provider the name of the provider. * - * @return a CertPathBuilder object that implements the + * @return a {@code CertPathBuilder} object that implements the * specified algorithm. * * @throws NoSuchAlgorithmException if a CertPathBuilderSpi @@ -195,7 +195,7 @@ public class CertPathBuilder { * @throws NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null or empty. * * @see java.security.Provider @@ -209,7 +209,7 @@ public class CertPathBuilder { } /** - * Returns a CertPathBuilder object that implements the + * Returns a {@code CertPathBuilder} object that implements the * specified algorithm. * *

      A new CertPathBuilder object encapsulating the @@ -217,7 +217,7 @@ public class CertPathBuilder { * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * - * @param algorithm the name of the requested CertPathBuilder + * @param algorithm the name of the requested {@code CertPathBuilder} * algorithm. See the CertPathBuilder section in the * Java Cryptography Architecture Standard Algorithm Name Documentation @@ -225,14 +225,14 @@ public class CertPathBuilder { * * @param provider the provider. * - * @return a CertPathBuilder object that implements the + * @return a {@code CertPathBuilder} object that implements the * specified algorithm. * * @exception NoSuchAlgorithmException if a CertPathBuilderSpi * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null. * * @see java.security.Provider @@ -246,18 +246,18 @@ public class CertPathBuilder { } /** - * Returns the provider of this CertPathBuilder. + * Returns the provider of this {@code CertPathBuilder}. * - * @return the provider of this CertPathBuilder + * @return the provider of this {@code CertPathBuilder} */ public final Provider getProvider() { return this.provider; } /** - * Returns the name of the algorithm of this CertPathBuilder. + * Returns the name of the algorithm of this {@code CertPathBuilder}. * - * @return the name of the algorithm of this CertPathBuilder + * @return the name of the algorithm of this {@code CertPathBuilder} */ public final String getAlgorithm() { return this.algorithm; @@ -272,7 +272,7 @@ public class CertPathBuilder { * @throws CertPathBuilderException if the builder is unable to construct * a certification path that satisfies the specified parameters * @throws InvalidAlgorithmParameterException if the specified parameters - * are inappropriate for this CertPathBuilder + * are inappropriate for this {@code CertPathBuilder} */ public final CertPathBuilderResult build(CertPathParameters params) throws CertPathBuilderException, InvalidAlgorithmParameterException diff --git a/jdk/src/share/classes/java/security/cert/CertPathBuilderException.java b/jdk/src/share/classes/java/security/cert/CertPathBuilderException.java index 4d460c66db9..cf95847922b 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathBuilderException.java +++ b/jdk/src/share/classes/java/security/cert/CertPathBuilderException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,9 @@ import java.security.GeneralSecurityException; /** * An exception indicating one of a variety of problems encountered when - * building a certification path with a CertPathBuilder. + * building a certification path with a {@code CertPathBuilder}. *

      - * A CertPathBuilderException provides support for wrapping + * A {@code CertPathBuilderException} provides support for wrapping * exceptions. The {@link #getCause getCause} method returns the throwable, * if any, that caused this exception to be thrown. *

      @@ -53,7 +53,7 @@ public class CertPathBuilderException extends GeneralSecurityException { private static final long serialVersionUID = 5316471420178794402L; /** - * Creates a CertPathBuilderException with null + * Creates a {@code CertPathBuilderException} with {@code null} * as its detail message. */ public CertPathBuilderException() { @@ -61,8 +61,8 @@ public class CertPathBuilderException extends GeneralSecurityException { } /** - * Creates a CertPathBuilderException with the given - * detail message. The detail message is a String that + * Creates a {@code CertPathBuilderException} with the given + * detail message. The detail message is a {@code String} that * describes this particular exception in more detail. * * @param msg the detail message @@ -72,16 +72,16 @@ public class CertPathBuilderException extends GeneralSecurityException { } /** - * Creates a CertPathBuilderException that wraps the specified + * Creates a {@code CertPathBuilderException} that wraps the specified * throwable. This allows any exception to be converted into a - * CertPathBuilderException, while retaining information + * {@code CertPathBuilderException}, while retaining information * about the wrapped exception, which may be useful for debugging. The - * detail message is set to (cause==null ? null : cause.toString() - * ) (which typically contains the class and detail message of + * detail message is set to ({@code cause==null ? null : cause.toString()}) + * (which typically contains the class and detail message of * cause). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertPathBuilderException(Throwable cause) { @@ -89,12 +89,12 @@ public class CertPathBuilderException extends GeneralSecurityException { } /** - * Creates a CertPathBuilderException with the specified + * Creates a {@code CertPathBuilderException} with the specified * detail message and cause. * * @param msg the detail message * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertPathBuilderException(String msg, Throwable cause) { diff --git a/jdk/src/share/classes/java/security/cert/CertPathBuilderResult.java b/jdk/src/share/classes/java/security/cert/CertPathBuilderResult.java index 71eed201ac4..ecf53bbe750 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathBuilderResult.java +++ b/jdk/src/share/classes/java/security/cert/CertPathBuilderResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ package java.security.cert; * All results returned by the {@link CertPathBuilder#build * CertPathBuilder.build} method must implement this interface. *

      - * At a minimum, a CertPathBuilderResult contains the - * CertPath built by the CertPathBuilder instance. + * At a minimum, a {@code CertPathBuilderResult} contains the + * {@code CertPath} built by the {@code CertPathBuilder} instance. * Implementations of this interface may add methods to return implementation * or algorithm specific information, such as debugging information or * certification path validation results. @@ -54,15 +54,15 @@ public interface CertPathBuilderResult extends Cloneable { /** * Returns the built certification path. * - * @return the certification path (never null) + * @return the certification path (never {@code null}) */ CertPath getCertPath(); /** - * Makes a copy of this CertPathBuilderResult. Changes to the + * Makes a copy of this {@code CertPathBuilderResult}. Changes to the * copy will not affect the original and vice versa. * - * @return a copy of this CertPathBuilderResult + * @return a copy of this {@code CertPathBuilderResult} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java b/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java index 49a35b36e90..87908c03bd9 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java +++ b/jdk/src/share/classes/java/security/cert/CertPathBuilderSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,23 +30,23 @@ import java.security.InvalidAlgorithmParameterException; /** * The Service Provider Interface (SPI) * for the {@link CertPathBuilder CertPathBuilder} class. All - * CertPathBuilder implementations must include a class (the - * SPI class) that extends this class (CertPathBuilderSpi) and + * {@code CertPathBuilder} implementations must include a class (the + * SPI class) that extends this class ({@code CertPathBuilderSpi}) and * implements all of its methods. In general, instances of this class should - * only be accessed through the CertPathBuilder class. For + * only be accessed through the {@code CertPathBuilder} class. For * details, see the Java Cryptography Architecture. *

      * Concurrent Access *

      * Instances of this class need not be protected against concurrent * access from multiple threads. Threads that need to access a single - * CertPathBuilderSpi instance concurrently should synchronize + * {@code CertPathBuilderSpi} instance concurrently should synchronize * amongst themselves and provide the necessary locking before calling the - * wrapping CertPathBuilder object. + * wrapping {@code CertPathBuilder} object. *

      - * However, implementations of CertPathBuilderSpi may still + * However, implementations of {@code CertPathBuilderSpi} may still * encounter concurrency issues, since multiple threads each - * manipulating a different CertPathBuilderSpi instance need not + * manipulating a different {@code CertPathBuilderSpi} instance need not * synchronize. * * @since 1.4 @@ -68,7 +68,7 @@ public abstract class CertPathBuilderSpi { * @throws CertPathBuilderException if the builder is unable to construct * a certification path that satisfies the specified parameters * @throws InvalidAlgorithmParameterException if the specified parameters - * are inappropriate for this CertPathBuilder + * are inappropriate for this {@code CertPathBuilder} */ public abstract CertPathBuilderResult engineBuild(CertPathParameters params) throws CertPathBuilderException, InvalidAlgorithmParameterException; diff --git a/jdk/src/share/classes/java/security/cert/CertPathParameters.java b/jdk/src/share/classes/java/security/cert/CertPathParameters.java index 46f9d8841bc..ace1b21f63f 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathParameters.java +++ b/jdk/src/share/classes/java/security/cert/CertPathParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,8 @@ package java.security.cert; /** * A specification of certification path algorithm parameters. * The purpose of this interface is to group (and provide type safety for) - * all CertPath parameter specifications. All - * CertPath parameter specifications must implement this + * all {@code CertPath} parameter specifications. All + * {@code CertPath} parameter specifications must implement this * interface. * * @author Yassir Elley @@ -40,10 +40,10 @@ package java.security.cert; public interface CertPathParameters extends Cloneable { /** - * Makes a copy of this CertPathParameters. Changes to the + * Makes a copy of this {@code CertPathParameters}. Changes to the * copy will not affect the original and vice versa. * - * @return a copy of this CertPathParameters + * @return a copy of this {@code CertPathParameters} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidator.java b/jdk/src/share/classes/java/security/cert/CertPathValidator.java index 99ecb1e1603..bd2ff56dd0c 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidator.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,17 +42,17 @@ import sun.security.jca.GetInstance.Instance; * chains). *

      * This class uses a provider-based architecture. - * To create a CertPathValidator, - * call one of the static getInstance methods, passing in the - * algorithm name of the CertPathValidator desired and + * To create a {@code CertPathValidator}, + * call one of the static {@code getInstance} methods, passing in the + * algorithm name of the {@code CertPathValidator} desired and * optionally the name of the provider desired. * - *

      Once a CertPathValidator object has been created, it can + *

      Once a {@code CertPathValidator} object has been created, it can * be used to validate certification paths by calling the {@link #validate - * validate} method and passing it the CertPath to be validated + * validate} method and passing it the {@code CertPath} to be validated * and an algorithm-specific set of parameters. If successful, the result is * returned in an object that implements the - * CertPathValidatorResult interface. + * {@code CertPathValidatorResult} interface. * *

      The {@link #getRevocationChecker} method allows an application to specify * additional algorithm-specific parameters and options used by the @@ -69,9 +69,9 @@ import sun.security.jca.GetInstance.Instance; * * *

      Every implementation of the Java platform is required to support the - * following standard CertPathValidator algorithm: + * following standard {@code CertPathValidator} algorithm: *

        - *
      • PKIX
      • + *
      • {@code PKIX}
      • *
      * This algorithm is described in the @@ -89,9 +89,9 @@ import sun.security.jca.GetInstance.Instance; *

      * However, this is not true for the non-static methods defined by this class. * Unless otherwise documented by a specific provider, threads that need to - * access a single CertPathValidator instance concurrently should + * access a single {@code CertPathValidator} instance concurrently should * synchronize amongst themselves and provide the necessary locking. Multiple - * threads each manipulating a different CertPathValidator + * threads each manipulating a different {@code CertPathValidator} * instance need not synchronize. * * @see CertPath @@ -115,7 +115,7 @@ public class CertPathValidator { private final String algorithm; /** - * Creates a CertPathValidator object of the given algorithm, + * Creates a {@code CertPathValidator} object of the given algorithm, * and encapsulates the given provider implementation (SPI object) in it. * * @param validatorSpi the provider implementation @@ -131,7 +131,7 @@ public class CertPathValidator { } /** - * Returns a CertPathValidator object that implements the + * Returns a {@code CertPathValidator} object that implements the * specified algorithm. * *

      This method traverses the list of registered security Providers, @@ -143,13 +143,13 @@ public class CertPathValidator { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param algorithm the name of the requested CertPathValidator + * @param algorithm the name of the requested {@code CertPathValidator} * algorithm. See the CertPathValidator section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * - * @return a CertPathValidator object that implements the + * @return a {@code CertPathValidator} object that implements the * specified algorithm. * * @exception NoSuchAlgorithmException if no Provider supports a @@ -167,7 +167,7 @@ public class CertPathValidator { } /** - * Returns a CertPathValidator object that implements the + * Returns a {@code CertPathValidator} object that implements the * specified algorithm. * *

      A new CertPathValidator object encapsulating the @@ -178,7 +178,7 @@ public class CertPathValidator { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param algorithm the name of the requested CertPathValidator + * @param algorithm the name of the requested {@code CertPathValidator} * algorithm. See the CertPathValidator section in the * Java Cryptography Architecture Standard Algorithm Name Documentation @@ -186,7 +186,7 @@ public class CertPathValidator { * * @param provider the name of the provider. * - * @return a CertPathValidator object that implements the + * @return a {@code CertPathValidator} object that implements the * specified algorithm. * * @exception NoSuchAlgorithmException if a CertPathValidatorSpi @@ -196,7 +196,7 @@ public class CertPathValidator { * @exception NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null or empty. * * @see java.security.Provider @@ -211,7 +211,7 @@ public class CertPathValidator { } /** - * Returns a CertPathValidator object that implements the + * Returns a {@code CertPathValidator} object that implements the * specified algorithm. * *

      A new CertPathValidator object encapsulating the @@ -219,7 +219,7 @@ public class CertPathValidator { * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * - * @param algorithm the name of the requested CertPathValidator + * @param algorithm the name of the requested {@code CertPathValidator} * algorithm. See the CertPathValidator section in the * Java Cryptography Architecture Standard Algorithm Name Documentation @@ -227,14 +227,14 @@ public class CertPathValidator { * * @param provider the provider. * - * @return a CertPathValidator object that implements the + * @return a {@code CertPathValidator} object that implements the * specified algorithm. * * @exception NoSuchAlgorithmException if a CertPathValidatorSpi * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null. * * @see java.security.Provider @@ -248,19 +248,19 @@ public class CertPathValidator { } /** - * Returns the Provider of this - * CertPathValidator. + * Returns the {@code Provider} of this + * {@code CertPathValidator}. * - * @return the Provider of this CertPathValidator + * @return the {@code Provider} of this {@code CertPathValidator} */ public final Provider getProvider() { return this.provider; } /** - * Returns the algorithm name of this CertPathValidator. + * Returns the algorithm name of this {@code CertPathValidator}. * - * @return the algorithm name of this CertPathValidator + * @return the algorithm name of this {@code CertPathValidator} */ public final String getAlgorithm() { return this.algorithm; @@ -270,20 +270,20 @@ public class CertPathValidator { * Validates the specified certification path using the specified * algorithm parameter set. *

      - * The CertPath specified must be of a type that is + * The {@code CertPath} specified must be of a type that is * supported by the validation algorithm, otherwise an - * InvalidAlgorithmParameterException will be thrown. For - * example, a CertPathValidator that implements the PKIX - * algorithm validates CertPath objects of type X.509. + * {@code InvalidAlgorithmParameterException} will be thrown. For + * example, a {@code CertPathValidator} that implements the PKIX + * algorithm validates {@code CertPath} objects of type X.509. * - * @param certPath the CertPath to be validated + * @param certPath the {@code CertPath} to be validated * @param params the algorithm parameters * @return the result of the validation algorithm - * @exception CertPathValidatorException if the CertPath + * @exception CertPathValidatorException if the {@code CertPath} * does not validate * @exception InvalidAlgorithmParameterException if the specified - * parameters or the type of the specified CertPath are - * inappropriate for this CertPathValidator + * parameters or the type of the specified {@code CertPath} are + * inappropriate for this {@code CertPathValidator} */ public final CertPathValidatorResult validate(CertPath certPath, CertPathParameters params) diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java index 9eedb620d9a..7e6b9165fae 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,11 +34,11 @@ import java.security.GeneralSecurityException; * An exception indicating one of a variety of problems encountered when * validating a certification path. *

      - * A CertPathValidatorException provides support for wrapping + * A {@code CertPathValidatorException} provides support for wrapping * exceptions. The {@link #getCause getCause} method returns the throwable, * if any, that caused this exception to be thrown. *

      - * A CertPathValidatorException may also include the + * A {@code CertPathValidatorException} may also include the * certification path that was being validated when the exception was thrown, * the index of the certificate in the certification path that caused the * exception to be thrown, and the reason that caused the failure. Use the @@ -70,7 +70,7 @@ public class CertPathValidatorException extends GeneralSecurityException { private int index = -1; /** - * @serial the CertPath that was being validated when + * @serial the {@code CertPath} that was being validated when * the exception was thrown */ private CertPath certPath; @@ -81,7 +81,7 @@ public class CertPathValidatorException extends GeneralSecurityException { private Reason reason = BasicReason.UNSPECIFIED; /** - * Creates a CertPathValidatorException with + * Creates a {@code CertPathValidatorException} with * no detail message. */ public CertPathValidatorException() { @@ -89,8 +89,8 @@ public class CertPathValidatorException extends GeneralSecurityException { } /** - * Creates a CertPathValidatorException with the given - * detail message. A detail message is a String that + * Creates a {@code CertPathValidatorException} with the given + * detail message. A detail message is a {@code String} that * describes this particular exception. * * @param msg the detail message @@ -100,16 +100,16 @@ public class CertPathValidatorException extends GeneralSecurityException { } /** - * Creates a CertPathValidatorException that wraps the + * Creates a {@code CertPathValidatorException} that wraps the * specified throwable. This allows any exception to be converted into a - * CertPathValidatorException, while retaining information + * {@code CertPathValidatorException}, while retaining information * about the wrapped exception, which may be useful for debugging. The - * detail message is set to (cause==null ? null : cause.toString() - * ) (which typically contains the class and detail message of + * detail message is set to ({@code cause==null ? null : cause.toString()}) + * (which typically contains the class and detail message of * cause). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertPathValidatorException(Throwable cause) { @@ -117,12 +117,12 @@ public class CertPathValidatorException extends GeneralSecurityException { } /** - * Creates a CertPathValidatorException with the specified + * Creates a {@code CertPathValidatorException} with the specified * detail message and cause. * * @param msg the detail message * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertPathValidatorException(String msg, Throwable cause) { @@ -130,21 +130,21 @@ public class CertPathValidatorException extends GeneralSecurityException { } /** - * Creates a CertPathValidatorException with the specified + * Creates a {@code CertPathValidatorException} with the specified * detail message, cause, certification path, and index. * - * @param msg the detail message (or null if none) - * @param cause the cause (or null if none) + * @param msg the detail message (or {@code null} if none) + * @param cause the cause (or {@code null} if none) * @param certPath the certification path that was in the process of * being validated when the error was encountered * @param index the index of the certificate in the certification path * that caused the error (or -1 if not applicable). Note that - * the list of certificates in a CertPath is zero based. + * the list of certificates in a {@code CertPath} is zero based. * @throws IndexOutOfBoundsException if the index is out of range - * (index < -1 || (certPath != null && index >= - * certPath.getCertificates().size()) - * @throws IllegalArgumentException if certPath is - * null and index is not -1 + * {@code (index < -1 || (certPath != null && index >= + * certPath.getCertificates().size()) } + * @throws IllegalArgumentException if {@code certPath} is + * {@code null} and {@code index} is not -1 */ public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index) { @@ -152,23 +152,23 @@ public class CertPathValidatorException extends GeneralSecurityException { } /** - * Creates a CertPathValidatorException with the specified + * Creates a {@code CertPathValidatorException} with the specified * detail message, cause, certification path, index, and reason. * - * @param msg the detail message (or null if none) - * @param cause the cause (or null if none) + * @param msg the detail message (or {@code null} if none) + * @param cause the cause (or {@code null} if none) * @param certPath the certification path that was in the process of * being validated when the error was encountered * @param index the index of the certificate in the certification path * that caused the error (or -1 if not applicable). Note that - * the list of certificates in a CertPath is zero based. + * the list of certificates in a {@code CertPath} is zero based. * @param reason the reason the validation failed * @throws IndexOutOfBoundsException if the index is out of range - * (index < -1 || (certPath != null && index >= - * certPath.getCertificates().size()) - * @throws IllegalArgumentException if certPath is - * null and index is not -1 - * @throws NullPointerException if reason is null + * {@code (index < -1 || (certPath != null && index >= + * certPath.getCertificates().size()) } + * @throws IllegalArgumentException if {@code certPath} is + * {@code null} and {@code index} is not -1 + * @throws NullPointerException if {@code reason} is {@code null} * * @since 1.7 */ @@ -194,8 +194,8 @@ public class CertPathValidatorException extends GeneralSecurityException { * Returns the certification path that was being validated when * the exception was thrown. * - * @return the CertPath that was being validated when - * the exception was thrown (or null if not specified) + * @return the {@code CertPath} that was being validated when + * the exception was thrown (or {@code null} if not specified) */ public CertPath getCertPath() { return this.certPath; @@ -204,7 +204,7 @@ public class CertPathValidatorException extends GeneralSecurityException { /** * Returns the index of the certificate in the certification path * that caused the exception to be thrown. Note that the list of - * certificates in a CertPath is zero based. If no + * certificates in a {@code CertPath} is zero based. If no * index has been set, -1 is returned. * * @return the index that has been set, or -1 if none has been set @@ -219,7 +219,7 @@ public class CertPathValidatorException extends GeneralSecurityException { * {@link #getIndex}. * * @return the reason that the validation failed, or - * BasicReason.UNSPECIFIED if a reason has not been + * {@code BasicReason.UNSPECIFIED} if a reason has not been * specified * * @since 1.7 diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorResult.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorResult.java index 1756db6329f..ae07dc497a9 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorResult.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,10 +41,10 @@ package java.security.cert; public interface CertPathValidatorResult extends Cloneable { /** - * Makes a copy of this CertPathValidatorResult. Changes to the + * Makes a copy of this {@code CertPathValidatorResult}. Changes to the * copy will not affect the original and vice versa. * - * @return a copy of this CertPathValidatorResult + * @return a copy of this {@code CertPathValidatorResult} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java index 6d3bd8c9968..50ad9c85c9b 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,23 +31,23 @@ import java.security.InvalidAlgorithmParameterException; * * The Service Provider Interface (SPI) * for the {@link CertPathValidator CertPathValidator} class. All - * CertPathValidator implementations must include a class (the - * SPI class) that extends this class (CertPathValidatorSpi) + * {@code CertPathValidator} implementations must include a class (the + * SPI class) that extends this class ({@code CertPathValidatorSpi}) * and implements all of its methods. In general, instances of this class - * should only be accessed through the CertPathValidator class. + * should only be accessed through the {@code CertPathValidator} class. * For details, see the Java Cryptography Architecture. *

      * Concurrent Access *

      * Instances of this class need not be protected against concurrent * access from multiple threads. Threads that need to access a single - * CertPathValidatorSpi instance concurrently should synchronize + * {@code CertPathValidatorSpi} instance concurrently should synchronize * amongst themselves and provide the necessary locking before calling the - * wrapping CertPathValidator object. + * wrapping {@code CertPathValidator} object. *

      - * However, implementations of CertPathValidatorSpi may still + * However, implementations of {@code CertPathValidatorSpi} may still * encounter concurrency issues, since multiple threads each - * manipulating a different CertPathValidatorSpi instance need not + * manipulating a different {@code CertPathValidatorSpi} instance need not * synchronize. * * @since 1.4 @@ -64,20 +64,20 @@ public abstract class CertPathValidatorSpi { * Validates the specified certification path using the specified * algorithm parameter set. *

      - * The CertPath specified must be of a type that is + * The {@code CertPath} specified must be of a type that is * supported by the validation algorithm, otherwise an - * InvalidAlgorithmParameterException will be thrown. For - * example, a CertPathValidator that implements the PKIX - * algorithm validates CertPath objects of type X.509. + * {@code InvalidAlgorithmParameterException} will be thrown. For + * example, a {@code CertPathValidator} that implements the PKIX + * algorithm validates {@code CertPath} objects of type X.509. * - * @param certPath the CertPath to be validated + * @param certPath the {@code CertPath} to be validated * @param params the algorithm parameters * @return the result of the validation algorithm - * @exception CertPathValidatorException if the CertPath + * @exception CertPathValidatorException if the {@code CertPath} * does not validate * @exception InvalidAlgorithmParameterException if the specified - * parameters or the type of the specified CertPath are - * inappropriate for this CertPathValidator + * parameters or the type of the specified {@code CertPath} are + * inappropriate for this {@code CertPathValidator} */ public abstract CertPathValidatorResult engineValidate(CertPath certPath, CertPathParameters params) diff --git a/jdk/src/share/classes/java/security/cert/CertSelector.java b/jdk/src/share/classes/java/security/cert/CertSelector.java index 5ee1f7156cd..a06cc848019 100644 --- a/jdk/src/share/classes/java/security/cert/CertSelector.java +++ b/jdk/src/share/classes/java/security/cert/CertSelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,9 @@ package java.security.cert; /** * A selector that defines a set of criteria for selecting - * Certificates. Classes that implement this interface - * are often used to specify which Certificates should - * be retrieved from a CertStore. + * {@code Certificate}s. Classes that implement this interface + * are often used to specify which {@code Certificate}s should + * be retrieved from a {@code CertStore}. *

      * Concurrent Access *

      @@ -49,19 +49,19 @@ package java.security.cert; public interface CertSelector extends Cloneable { /** - * Decides whether a Certificate should be selected. + * Decides whether a {@code Certificate} should be selected. * - * @param cert the Certificate to be checked - * @return true if the Certificate - * should be selected, false otherwise + * @param cert the {@code Certificate} to be checked + * @return {@code true} if the {@code Certificate} + * should be selected, {@code false} otherwise */ boolean match(Certificate cert); /** - * Makes a copy of this CertSelector. Changes to the + * Makes a copy of this {@code CertSelector}. Changes to the * copy will not affect the original and vice versa. * - * @return a copy of this CertSelector + * @return a copy of this {@code CertSelector} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertStore.java b/jdk/src/share/classes/java/security/cert/CertStore.java index 1c6dedbf53c..1a8ed628c13 100644 --- a/jdk/src/share/classes/java/security/cert/CertStore.java +++ b/jdk/src/share/classes/java/security/cert/CertStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,32 +38,32 @@ import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; /** - * A class for retrieving Certificates and CRLs + * A class for retrieving {@code Certificate}s and {@code CRL}s * from a repository. *

      * This class uses a provider-based architecture. - * To create a CertStore, call one of the static - * getInstance methods, passing in the type of - * CertStore desired, any applicable initialization parameters + * To create a {@code CertStore}, call one of the static + * {@code getInstance} methods, passing in the type of + * {@code CertStore} desired, any applicable initialization parameters * and optionally the name of the provider desired. *

      - * Once the CertStore has been created, it can be used to - * retrieve Certificates and CRLs by calling its + * Once the {@code CertStore} has been created, it can be used to + * retrieve {@code Certificate}s and {@code CRL}s by calling its * {@link #getCertificates(CertSelector selector) getCertificates} and * {@link #getCRLs(CRLSelector selector) getCRLs} methods. *

      * Unlike a {@link java.security.KeyStore KeyStore}, which provides access * to a cache of private keys and trusted certificates, a - * CertStore is designed to provide access to a potentially + * {@code CertStore} is designed to provide access to a potentially * vast repository of untrusted certificates and CRLs. For example, an LDAP - * implementation of CertStore provides access to certificates + * implementation of {@code CertStore} provides access to certificates * and CRLs stored in one or more directories using the LDAP protocol and the * schema as defined in the RFC service attribute. * *

      Every implementation of the Java platform is required to support the - * following standard CertStore type: + * following standard {@code CertStore} type: *

        - *
      • Collection
      • + *
      • {@code Collection}
      • *
      * This type is described in the @@ -75,10 +75,10 @@ import sun.security.jca.GetInstance.Instance; *

      * Concurrent Access *

      - * All public methods of CertStore objects must be thread-safe. + * All public methods of {@code CertStore} objects must be thread-safe. * That is, multiple threads may concurrently invoke these methods on a - * single CertStore object (or more than one) with no - * ill effects. This allows a CertPathBuilder to search for a + * single {@code CertStore} object (or more than one) with no + * ill effects. This allows a {@code CertPathBuilder} to search for a * CRL while simultaneously searching for further certificates, for instance. *

      * The static methods of this class are also guaranteed to be thread-safe. @@ -104,13 +104,13 @@ public class CertStore { private CertStoreParameters params; /** - * Creates a CertStore object of the given type, and + * Creates a {@code CertStore} object of the given type, and * encapsulates the given provider implementation (SPI object) in it. * * @param storeSpi the provider implementation * @param provider the provider * @param type the type - * @param params the initialization parameters (may be null) + * @param params the initialization parameters (may be {@code null}) */ protected CertStore(CertStoreSpi storeSpi, Provider provider, String type, CertStoreParameters params) { @@ -122,28 +122,28 @@ public class CertStore { } /** - * Returns a Collection of Certificates that - * match the specified selector. If no Certificates - * match the selector, an empty Collection will be returned. + * Returns a {@code Collection} of {@code Certificate}s that + * match the specified selector. If no {@code Certificate}s + * match the selector, an empty {@code Collection} will be returned. *

      - * For some CertStore types, the resulting - * Collection may not contain all of the - * Certificates that match the selector. For instance, - * an LDAP CertStore may not search all entries in the + * For some {@code CertStore} types, the resulting + * {@code Collection} may not contain all of the + * {@code Certificate}s that match the selector. For instance, + * an LDAP {@code CertStore} may not search all entries in the * directory. Instead, it may just search entries that are likely to - * contain the Certificates it is looking for. + * contain the {@code Certificate}s it is looking for. *

      - * Some CertStore implementations (especially LDAP - * CertStores) may throw a CertStoreException - * unless a non-null CertSelector is provided that + * Some {@code CertStore} implementations (especially LDAP + * {@code CertStore}s) may throw a {@code CertStoreException} + * unless a non-null {@code CertSelector} is provided that * includes specific criteria that can be used to find the certificates. * Issuer and/or subject names are especially useful criteria. * - * @param selector A CertSelector used to select which - * Certificates should be returned. Specify null - * to return all Certificates (if supported). - * @return A Collection of Certificates that - * match the specified selector (never null) + * @param selector A {@code CertSelector} used to select which + * {@code Certificate}s should be returned. Specify {@code null} + * to return all {@code Certificate}s (if supported). + * @return A {@code Collection} of {@code Certificate}s that + * match the specified selector (never {@code null}) * @throws CertStoreException if an exception occurs */ public final Collection getCertificates @@ -152,28 +152,28 @@ public class CertStore { } /** - * Returns a Collection of CRLs that - * match the specified selector. If no CRLs - * match the selector, an empty Collection will be returned. + * Returns a {@code Collection} of {@code CRL}s that + * match the specified selector. If no {@code CRL}s + * match the selector, an empty {@code Collection} will be returned. *

      - * For some CertStore types, the resulting - * Collection may not contain all of the - * CRLs that match the selector. For instance, - * an LDAP CertStore may not search all entries in the + * For some {@code CertStore} types, the resulting + * {@code Collection} may not contain all of the + * {@code CRL}s that match the selector. For instance, + * an LDAP {@code CertStore} may not search all entries in the * directory. Instead, it may just search entries that are likely to - * contain the CRLs it is looking for. + * contain the {@code CRL}s it is looking for. *

      - * Some CertStore implementations (especially LDAP - * CertStores) may throw a CertStoreException - * unless a non-null CRLSelector is provided that + * Some {@code CertStore} implementations (especially LDAP + * {@code CertStore}s) may throw a {@code CertStoreException} + * unless a non-null {@code CRLSelector} is provided that * includes specific criteria that can be used to find the CRLs. * Issuer names and/or the certificate to be checked are especially useful. * - * @param selector A CRLSelector used to select which - * CRLs should be returned. Specify null - * to return all CRLs (if supported). - * @return A Collection of CRLs that - * match the specified selector (never null) + * @param selector A {@code CRLSelector} used to select which + * {@code CRL}s should be returned. Specify {@code null} + * to return all {@code CRL}s (if supported). + * @return A {@code Collection} of {@code CRL}s that + * match the specified selector (never {@code null}) * @throws CertStoreException if an exception occurs */ public final Collection getCRLs(CRLSelector selector) @@ -182,8 +182,8 @@ public class CertStore { } /** - * Returns a CertStore object that implements the specified - * CertStore type and is initialized with the specified + * Returns a {@code CertStore} object that implements the specified + * {@code CertStore} type and is initialized with the specified * parameters. * *

      This method traverses the list of registered security Providers, @@ -195,29 +195,29 @@ public class CertStore { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

      The CertStore that is returned is initialized with the - * specified CertStoreParameters. The type of parameters - * needed may vary between different types of CertStores. - * Note that the specified CertStoreParameters object is + *

      The {@code CertStore} that is returned is initialized with the + * specified {@code CertStoreParameters}. The type of parameters + * needed may vary between different types of {@code CertStore}s. + * Note that the specified {@code CertStoreParameters} object is * cloned. * - * @param type the name of the requested CertStore type. + * @param type the name of the requested {@code CertStore} type. * See the CertStore section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard types. * - * @param params the initialization parameters (may be null). + * @param params the initialization parameters (may be {@code null}). * - * @return a CertStore object that implements the specified - * CertStore type. + * @return a {@code CertStore} object that implements the specified + * {@code CertStore} type. * * @throws NoSuchAlgorithmException if no Provider supports a * CertStoreSpi implementation for the specified type. * * @throws InvalidAlgorithmParameterException if the specified * initialization parameters are inappropriate for this - * CertStore. + * {@code CertStore}. * * @see java.security.Provider */ @@ -244,8 +244,8 @@ public class CertStore { } /** - * Returns a CertStore object that implements the specified - * CertStore type. + * Returns a {@code CertStore} object that implements the specified + * {@code CertStore} type. * *

      A new CertStore object encapsulating the * CertStoreSpi implementation from the specified provider @@ -255,23 +255,23 @@ public class CertStore { *

      Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

      The CertStore that is returned is initialized with the - * specified CertStoreParameters. The type of parameters - * needed may vary between different types of CertStores. - * Note that the specified CertStoreParameters object is + *

      The {@code CertStore} that is returned is initialized with the + * specified {@code CertStoreParameters}. The type of parameters + * needed may vary between different types of {@code CertStore}s. + * Note that the specified {@code CertStoreParameters} object is * cloned. * - * @param type the requested CertStore type. + * @param type the requested {@code CertStore} type. * See the CertStore section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard types. * - * @param params the initialization parameters (may be null). + * @param params the initialization parameters (may be {@code null}). * * @param provider the name of the provider. * - * @return a CertStore object that implements the + * @return a {@code CertStore} object that implements the * specified type. * * @throws NoSuchAlgorithmException if a CertStoreSpi @@ -280,12 +280,12 @@ public class CertStore { * * @throws InvalidAlgorithmParameterException if the specified * initialization parameters are inappropriate for this - * CertStore. + * {@code CertStore}. * * @throws NoSuchProviderException if the specified provider is not * registered in the security provider list. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null or empty. * * @see java.security.Provider @@ -305,31 +305,31 @@ public class CertStore { } /** - * Returns a CertStore object that implements the specified - * CertStore type. + * Returns a {@code CertStore} object that implements the specified + * {@code CertStore} type. * *

      A new CertStore object encapsulating the * CertStoreSpi implementation from the specified Provider * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * - *

      The CertStore that is returned is initialized with the - * specified CertStoreParameters. The type of parameters - * needed may vary between different types of CertStores. - * Note that the specified CertStoreParameters object is + *

      The {@code CertStore} that is returned is initialized with the + * specified {@code CertStoreParameters}. The type of parameters + * needed may vary between different types of {@code CertStore}s. + * Note that the specified {@code CertStoreParameters} object is * cloned. * - * @param type the requested CertStore type. + * @param type the requested {@code CertStore} type. * See the CertStore section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard types. * - * @param params the initialization parameters (may be null). + * @param params the initialization parameters (may be {@code null}). * * @param provider the provider. * - * @return a CertStore object that implements the + * @return a {@code CertStore} object that implements the * specified type. * * @exception NoSuchAlgorithmException if a CertStoreSpi @@ -338,9 +338,9 @@ public class CertStore { * * @throws InvalidAlgorithmParameterException if the specified * initialization parameters are inappropriate for this - * CertStore + * {@code CertStore} * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null. * * @see java.security.Provider @@ -359,30 +359,30 @@ public class CertStore { } /** - * Returns the parameters used to initialize this CertStore. - * Note that the CertStoreParameters object is cloned before + * Returns the parameters used to initialize this {@code CertStore}. + * Note that the {@code CertStoreParameters} object is cloned before * it is returned. * - * @return the parameters used to initialize this CertStore - * (may be null) + * @return the parameters used to initialize this {@code CertStore} + * (may be {@code null}) */ public final CertStoreParameters getCertStoreParameters() { return (params == null ? null : (CertStoreParameters) params.clone()); } /** - * Returns the type of this CertStore. + * Returns the type of this {@code CertStore}. * - * @return the type of this CertStore + * @return the type of this {@code CertStore} */ public final String getType() { return this.type; } /** - * Returns the provider of this CertStore. + * Returns the provider of this {@code CertStore}. * - * @return the provider of this CertStore + * @return the provider of this {@code CertStore} */ public final Provider getProvider() { return this.provider; diff --git a/jdk/src/share/classes/java/security/cert/CertStoreException.java b/jdk/src/share/classes/java/security/cert/CertStoreException.java index 31baf644e30..77b1c234664 100644 --- a/jdk/src/share/classes/java/security/cert/CertStoreException.java +++ b/jdk/src/share/classes/java/security/cert/CertStoreException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,9 +29,9 @@ import java.security.GeneralSecurityException; /** * An exception indicating one of a variety of problems retrieving - * certificates and CRLs from a CertStore. + * certificates and CRLs from a {@code CertStore}. *

      - * A CertStoreException provides support for wrapping + * A {@code CertStoreException} provides support for wrapping * exceptions. The {@link #getCause getCause} method returns the throwable, * if any, that caused this exception to be thrown. *

      @@ -53,7 +53,7 @@ public class CertStoreException extends GeneralSecurityException { private static final long serialVersionUID = 2395296107471573245L; /** - * Creates a CertStoreException with null as + * Creates a {@code CertStoreException} with {@code null} as * its detail message. */ public CertStoreException() { @@ -61,8 +61,8 @@ public class CertStoreException extends GeneralSecurityException { } /** - * Creates a CertStoreException with the given detail - * message. A detail message is a String that describes this + * Creates a {@code CertStoreException} with the given detail + * message. A detail message is a {@code String} that describes this * particular exception. * * @param msg the detail message @@ -72,15 +72,15 @@ public class CertStoreException extends GeneralSecurityException { } /** - * Creates a CertStoreException that wraps the specified + * Creates a {@code CertStoreException} that wraps the specified * throwable. This allows any exception to be converted into a - * CertStoreException, while retaining information about the + * {@code CertStoreException}, while retaining information about the * cause, which may be useful for debugging. The detail message is - * set to (cause==null ? null : cause.toString()) (which + * set to ({@code cause==null ? null : cause.toString()}) (which * typically contains the class and detail message of cause). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertStoreException(Throwable cause) { @@ -88,12 +88,12 @@ public class CertStoreException extends GeneralSecurityException { } /** - * Creates a CertStoreException with the specified detail + * Creates a {@code CertStoreException} with the specified detail * message and cause. * * @param msg the detail message * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause getCause()} method). (A null value is + * {@link #getCause getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public CertStoreException(String msg, Throwable cause) { diff --git a/jdk/src/share/classes/java/security/cert/CertStoreParameters.java b/jdk/src/share/classes/java/security/cert/CertStoreParameters.java index d410dc7f332..9938ba25438 100644 --- a/jdk/src/share/classes/java/security/cert/CertStoreParameters.java +++ b/jdk/src/share/classes/java/security/cert/CertStoreParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,20 +26,20 @@ package java.security.cert; /** - * A specification of CertStore parameters. + * A specification of {@code CertStore} parameters. *

      * The purpose of this interface is to group (and provide type safety for) - * all CertStore parameter specifications. All - * CertStore parameter specifications must implement this + * all {@code CertStore} parameter specifications. All + * {@code CertStore} parameter specifications must implement this * interface. *

      - * Typically, a CertStoreParameters object is passed as a parameter + * Typically, a {@code CertStoreParameters} object is passed as a parameter * to one of the {@link CertStore#getInstance CertStore.getInstance} methods. - * The getInstance method returns a CertStore that - * is used for retrieving Certificates and CRLs. The - * CertStore that is returned is initialized with the specified + * The {@code getInstance} method returns a {@code CertStore} that + * is used for retrieving {@code Certificate}s and {@code CRL}s. The + * {@code CertStore} that is returned is initialized with the specified * parameters. The type of parameters needed may vary between different types - * of CertStores. + * of {@code CertStore}s. * * @see CertStore#getInstance * @@ -49,32 +49,32 @@ package java.security.cert; public interface CertStoreParameters extends Cloneable { /** - * Makes a copy of this CertStoreParameters. + * Makes a copy of this {@code CertStoreParameters}. *

      * The precise meaning of "copy" may depend on the class of - * the CertStoreParameters object. A typical implementation + * the {@code CertStoreParameters} object. A typical implementation * performs a "deep copy" of this object, but this is not an absolute * requirement. Some implementations may perform a "shallow copy" of some * or all of the fields of this object. *

      - * Note that the CertStore.getInstance methods make a copy - * of the specified CertStoreParameters. A deep copy - * implementation of clone is safer and more robust, as it - * prevents the caller from corrupting a shared CertStore by + * Note that the {@code CertStore.getInstance} methods make a copy + * of the specified {@code CertStoreParameters}. A deep copy + * implementation of {@code clone} is safer and more robust, as it + * prevents the caller from corrupting a shared {@code CertStore} by * subsequently modifying the contents of its initialization parameters. - * However, a shallow copy implementation of clone is more + * However, a shallow copy implementation of {@code clone} is more * appropriate for applications that need to hold a reference to a - * parameter contained in the CertStoreParameters. For example, + * parameter contained in the {@code CertStoreParameters}. For example, * a shallow copy clone allows an application to release the resources of - * a particular CertStore initialization parameter immediately, + * a particular {@code CertStore} initialization parameter immediately, * rather than waiting for the garbage collection mechanism. This should - * be done with the utmost care, since the CertStore may still + * be done with the utmost care, since the {@code CertStore} may still * be in use by other threads. *

      * Each subclass should state the precise behavior of this method so * that users and developers know what to expect. * - * @return a copy of this CertStoreParameters + * @return a copy of this {@code CertStoreParameters} */ Object clone(); } diff --git a/jdk/src/share/classes/java/security/cert/CertStoreSpi.java b/jdk/src/share/classes/java/security/cert/CertStoreSpi.java index ddcf2bc3f37..fc98e9ebcf0 100644 --- a/jdk/src/share/classes/java/security/cert/CertStoreSpi.java +++ b/jdk/src/share/classes/java/security/cert/CertStoreSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,26 +30,26 @@ import java.util.Collection; /** * The Service Provider Interface (SPI) - * for the {@link CertStore CertStore} class. All CertStore + * for the {@link CertStore CertStore} class. All {@code CertStore} * implementations must include a class (the SPI class) that extends - * this class (CertStoreSpi), provides a constructor with - * a single argument of type CertStoreParameters, and implements + * this class ({@code CertStoreSpi}), provides a constructor with + * a single argument of type {@code CertStoreParameters}, and implements * all of its methods. In general, instances of this class should only be - * accessed through the CertStore class. + * accessed through the {@code CertStore} class. * For details, see the Java Cryptography Architecture. *

      * Concurrent Access *

      - * The public methods of all CertStoreSpi objects must be + * The public methods of all {@code CertStoreSpi} objects must be * thread-safe. That is, multiple threads may concurrently invoke these - * methods on a single CertStoreSpi object (or more than one) - * with no ill effects. This allows a CertPathBuilder to search + * methods on a single {@code CertStoreSpi} object (or more than one) + * with no ill effects. This allows a {@code CertPathBuilder} to search * for a CRL while simultaneously searching for further certificates, for * instance. *

      - * Simple CertStoreSpi implementations will probably ensure - * thread safety by adding a synchronized keyword to their - * engineGetCertificates and engineGetCRLs methods. + * Simple {@code CertStoreSpi} implementations will probably ensure + * thread safety by adding a {@code synchronized} keyword to their + * {@code engineGetCertificates} and {@code engineGetCRLs} methods. * More sophisticated ones may allow truly concurrent access. * * @since 1.4 @@ -60,64 +60,64 @@ public abstract class CertStoreSpi { /** * The sole constructor. * - * @param params the initialization parameters (may be null) + * @param params the initialization parameters (may be {@code null}) * @throws InvalidAlgorithmParameterException if the initialization - * parameters are inappropriate for this CertStoreSpi + * parameters are inappropriate for this {@code CertStoreSpi} */ public CertStoreSpi(CertStoreParameters params) throws InvalidAlgorithmParameterException { } /** - * Returns a Collection of Certificates that - * match the specified selector. If no Certificates - * match the selector, an empty Collection will be returned. + * Returns a {@code Collection} of {@code Certificate}s that + * match the specified selector. If no {@code Certificate}s + * match the selector, an empty {@code Collection} will be returned. *

      - * For some CertStore types, the resulting - * Collection may not contain all of the - * Certificates that match the selector. For instance, - * an LDAP CertStore may not search all entries in the + * For some {@code CertStore} types, the resulting + * {@code Collection} may not contain all of the + * {@code Certificate}s that match the selector. For instance, + * an LDAP {@code CertStore} may not search all entries in the * directory. Instead, it may just search entries that are likely to - * contain the Certificates it is looking for. + * contain the {@code Certificate}s it is looking for. *

      - * Some CertStore implementations (especially LDAP - * CertStores) may throw a CertStoreException - * unless a non-null CertSelector is provided that includes + * Some {@code CertStore} implementations (especially LDAP + * {@code CertStore}s) may throw a {@code CertStoreException} + * unless a non-null {@code CertSelector} is provided that includes * specific criteria that can be used to find the certificates. Issuer * and/or subject names are especially useful criteria. * - * @param selector A CertSelector used to select which - * Certificates should be returned. Specify null - * to return all Certificates (if supported). - * @return A Collection of Certificates that - * match the specified selector (never null) + * @param selector A {@code CertSelector} used to select which + * {@code Certificate}s should be returned. Specify {@code null} + * to return all {@code Certificate}s (if supported). + * @return A {@code Collection} of {@code Certificate}s that + * match the specified selector (never {@code null}) * @throws CertStoreException if an exception occurs */ public abstract Collection engineGetCertificates (CertSelector selector) throws CertStoreException; /** - * Returns a Collection of CRLs that - * match the specified selector. If no CRLs - * match the selector, an empty Collection will be returned. + * Returns a {@code Collection} of {@code CRL}s that + * match the specified selector. If no {@code CRL}s + * match the selector, an empty {@code Collection} will be returned. *

      - * For some CertStore types, the resulting - * Collection may not contain all of the - * CRLs that match the selector. For instance, - * an LDAP CertStore may not search all entries in the + * For some {@code CertStore} types, the resulting + * {@code Collection} may not contain all of the + * {@code CRL}s that match the selector. For instance, + * an LDAP {@code CertStore} may not search all entries in the * directory. Instead, it may just search entries that are likely to - * contain the CRLs it is looking for. + * contain the {@code CRL}s it is looking for. *

      - * Some CertStore implementations (especially LDAP - * CertStores) may throw a CertStoreException - * unless a non-null CRLSelector is provided that includes + * Some {@code CertStore} implementations (especially LDAP + * {@code CertStore}s) may throw a {@code CertStoreException} + * unless a non-null {@code CRLSelector} is provided that includes * specific criteria that can be used to find the CRLs. Issuer names * and/or the certificate to be checked are especially useful. * - * @param selector A CRLSelector used to select which - * CRLs should be returned. Specify null - * to return all CRLs (if supported). - * @return A Collection of CRLs that - * match the specified selector (never null) + * @param selector A {@code CRLSelector} used to select which + * {@code CRL}s should be returned. Specify {@code null} + * to return all {@code CRL}s (if supported). + * @return A {@code Collection} of {@code CRL}s that + * match the specified selector (never {@code null}) * @throws CertStoreException if an exception occurs */ public abstract Collection engineGetCRLs diff --git a/jdk/src/share/classes/java/security/cert/Certificate.java b/jdk/src/share/classes/java/security/cert/Certificate.java index 80390ac129c..638a02e6f80 100644 --- a/jdk/src/share/classes/java/security/cert/Certificate.java +++ b/jdk/src/share/classes/java/security/cert/Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,8 +90,8 @@ public abstract class Certificate implements java.io.Serializable { /** * Compares this certificate for equality with the specified - * object. If the other object is an - * instanceof Certificate, then + * object. If the {@code other} object is an + * {@code instanceof} {@code Certificate}, then * its encoded form is retrieved and compared with the * encoded form of this certificate. * @@ -196,8 +196,8 @@ public abstract class Certificate implements java.io.Serializable { * *

      This method was added to version 1.8 of the Java Platform * Standard Edition. In order to maintain backwards compatibility with - * existing service providers, this method cannot be abstract - * and by default throws an UnsupportedOperationException. + * existing service providers, this method cannot be {@code abstract} + * and by default throws an {@code UnsupportedOperationException}. * * @param key the PublicKey used to carry out the verification. * @param sigProvider the signature provider. diff --git a/jdk/src/share/classes/java/security/cert/CertificateEncodingException.java b/jdk/src/share/classes/java/security/cert/CertificateEncodingException.java index dbfc22ca8ce..618ee0a55b9 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateEncodingException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateEncodingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,13 +56,13 @@ public class CertificateEncodingException extends CertificateException { } /** - * Creates a CertificateEncodingException with the specified + * Creates a {@code CertificateEncodingException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -71,14 +71,14 @@ public class CertificateEncodingException extends CertificateException { } /** - * Creates a CertificateEncodingException + * Creates a {@code CertificateEncodingException} * with the specified cause and a detail message of - * (cause==null ? null : cause.toString()) + * {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/cert/CertificateException.java b/jdk/src/share/classes/java/security/cert/CertificateException.java index 1c91f9f0ebb..f663054000b 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,13 @@ public class CertificateException extends GeneralSecurityException { } /** - * Creates a CertificateException with the specified + * Creates a {@code CertificateException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -72,13 +72,13 @@ public class CertificateException extends GeneralSecurityException { } /** - * Creates a CertificateException with the specified cause - * and a detail message of (cause==null ? null : cause.toString()) + * Creates a {@code CertificateException} with the specified cause + * and a detail message of {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/cert/CertificateExpiredException.java b/jdk/src/share/classes/java/security/cert/CertificateExpiredException.java index e5644fa7ff0..9de0c236c13 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateExpiredException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateExpiredException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ package java.security.cert; /** * Certificate Expired Exception. This is thrown whenever the current - * Date or the specified Date is after the - * notAfter date/time specified in the validity period + * {@code Date} or the specified {@code Date} is after the + * {@code notAfter} date/time specified in the validity period * of the certificate. * * @author Hemma Prafullchandra diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactory.java b/jdk/src/share/classes/java/security/cert/CertificateFactory.java index 57a3fe15f45..83ff9fbee92 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateFactory.java +++ b/jdk/src/share/classes/java/security/cert/CertificateFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,31 +41,31 @@ import sun.security.jca.GetInstance.Instance; /** * This class defines the functionality of a certificate factory, which is - * used to generate certificate, certification path (CertPath) + * used to generate certificate, certification path ({@code CertPath}) * and certificate revocation list (CRL) objects from their encodings. * *

      For encodings consisting of multiple certificates, use - * generateCertificates when you want to + * {@code generateCertificates} when you want to * parse a collection of possibly unrelated certificates. Otherwise, - * use generateCertPath when you want to generate - * a CertPath (a certificate chain) and subsequently - * validate it with a CertPathValidator. + * use {@code generateCertPath} when you want to generate + * a {@code CertPath} (a certificate chain) and subsequently + * validate it with a {@code CertPathValidator}. * *

      A certificate factory for X.509 must return certificates that are an - * instance of java.security.cert.X509Certificate, and CRLs - * that are an instance of java.security.cert.X509CRL. + * instance of {@code java.security.cert.X509Certificate}, and CRLs + * that are an instance of {@code java.security.cert.X509CRL}. * *

      The following example reads a file with Base64 encoded certificates, * which are each bounded at the beginning by -----BEGIN CERTIFICATE-----, and * bounded at the end by -----END CERTIFICATE-----. We convert the - * FileInputStream (which does not support mark - * and reset) to a BufferedInputStream (which + * {@code FileInputStream} (which does not support {@code mark} + * and {@code reset}) to a {@code BufferedInputStream} (which * supports those methods), so that each call to - * generateCertificate consumes only one certificate, and the + * {@code generateCertificate} consumes only one certificate, and the * read position of the input stream is positioned to the next certificate in * the file:

      * - *

      + * 
      {@code
        * FileInputStream fis = new FileInputStream(filename);
        * BufferedInputStream bis = new BufferedInputStream(fis);
        *
      @@ -75,7 +75,7 @@ import sun.security.jca.GetInstance.Instance;
        *    Certificate cert = cf.generateCertificate(bis);
        *    System.out.println(cert.toString());
        * }
      - * 
      + * }
      * *

      The following example parses a PKCS#7-formatted certificate reply stored * in a file and extracts all the certificates from it:

      @@ -92,14 +92,14 @@ import sun.security.jca.GetInstance.Instance; * * *

      Every implementation of the Java platform is required to support the - * following standard CertificateFactory type: + * following standard {@code CertificateFactory} type: *

        - *
      • X.509
      • + *
      • {@code X.509}
      • *
      - * and the following standard CertPath encodings: + * and the following standard {@code CertPath} encodings: *
        - *
      • PKCS7
      • - *
      • PkiPath
      • + *
      • {@code PKCS7}
      • + *
      • {@code PkiPath}
      • *
      * The type and encodings are described in the @@ -258,7 +258,7 @@ public class CertificateFactory { * implementation for the specified algorithm is not available * from the specified Provider object. * - * @exception IllegalArgumentException if the provider is + * @exception IllegalArgumentException if the {@code provider} is * null. * * @see java.security.Provider @@ -299,17 +299,17 @@ public class CertificateFactory { /** * Generates a certificate object and initializes it with - * the data read from the input stream inStream. + * the data read from the input stream {@code inStream}. * *

      In order to take advantage of the specialized certificate format * supported by this certificate factory, * the returned certificate object can be typecast to the corresponding * certificate class. For example, if this certificate * factory implements X.509 certificates, the returned certificate object - * can be typecast to the X509Certificate class. + * can be typecast to the {@code X509Certificate} class. * *

      In the case of a certificate factory for X.509 certificates, the - * certificate provided in inStream must be DER-encoded and + * certificate provided in {@code inStream} must be DER-encoded and * may be supplied in binary or printable (Base64) encoding. If the * certificate is provided in Base64 encoding, it must be bounded at * the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at @@ -324,7 +324,7 @@ public class CertificateFactory { * the inherent end-of-certificate marker. If the data in the input stream * does not contain an inherent end-of-certificate marker (other * than EOF) and there is trailing data after the certificate is parsed, a - * CertificateException is thrown. + * {@code CertificateException} is thrown. * * @param inStream an input stream with the certificate data. * @@ -340,19 +340,19 @@ public class CertificateFactory { } /** - * Returns an iteration of the CertPath encodings supported + * Returns an iteration of the {@code CertPath} encodings supported * by this certificate factory, with the default encoding first. See * the CertPath Encodings section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard encoding names and their formats. *

      - * Attempts to modify the returned Iterator via its - * remove method result in an - * UnsupportedOperationException. + * Attempts to modify the returned {@code Iterator} via its + * {@code remove} method result in an + * {@code UnsupportedOperationException}. * - * @return an Iterator over the names of the supported - * CertPath encodings (as Strings) + * @return an {@code Iterator} over the names of the supported + * {@code CertPath} encodings (as {@code String}s) * @since 1.4 */ public final Iterator getCertPathEncodings() { @@ -360,15 +360,15 @@ public class CertificateFactory { } /** - * Generates a CertPath object and initializes it with - * the data read from the InputStream inStream. The data + * Generates a {@code CertPath} object and initializes it with + * the data read from the {@code InputStream} inStream. The data * is assumed to be in the default encoding. The name of the default - * encoding is the first element of the Iterator returned by + * encoding is the first element of the {@code Iterator} returned by * the {@link #getCertPathEncodings getCertPathEncodings} method. * - * @param inStream an InputStream containing the data - * @return a CertPath initialized with the data from the - * InputStream + * @param inStream an {@code InputStream} containing the data + * @return a {@code CertPath} initialized with the data from the + * {@code InputStream} * @exception CertificateException if an exception occurs while decoding * @since 1.4 */ @@ -379,18 +379,18 @@ public class CertificateFactory { } /** - * Generates a CertPath object and initializes it with - * the data read from the InputStream inStream. The data + * Generates a {@code CertPath} object and initializes it with + * the data read from the {@code InputStream} inStream. The data * is assumed to be in the specified encoding. See * the CertPath Encodings section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard encoding names and their formats. * - * @param inStream an InputStream containing the data + * @param inStream an {@code InputStream} containing the data * @param encoding the encoding used for the data - * @return a CertPath initialized with the data from the - * InputStream + * @return a {@code CertPath} initialized with the data from the + * {@code InputStream} * @exception CertificateException if an exception occurs while decoding or * the encoding requested is not supported * @since 1.4 @@ -402,15 +402,15 @@ public class CertificateFactory { } /** - * Generates a CertPath object and initializes it with - * a List of Certificates. + * Generates a {@code CertPath} object and initializes it with + * a {@code List} of {@code Certificate}s. *

      * The certificates supplied must be of a type supported by the - * CertificateFactory. They will be copied out of the supplied - * List object. + * {@code CertificateFactory}. They will be copied out of the supplied + * {@code List} object. * - * @param certificates a List of Certificates - * @return a CertPath initialized with the supplied list of + * @param certificates a {@code List} of {@code Certificate}s + * @return a {@code CertPath} initialized with the supplied list of * certificates * @exception CertificateException if an exception occurs * @since 1.4 @@ -424,20 +424,20 @@ public class CertificateFactory { /** * Returns a (possibly empty) collection view of the certificates read - * from the given input stream inStream. + * from the given input stream {@code inStream}. * *

      In order to take advantage of the specialized certificate format * supported by this certificate factory, each element in * the returned collection view can be typecast to the corresponding * certificate class. For example, if this certificate * factory implements X.509 certificates, the elements in the returned - * collection can be typecast to the X509Certificate class. + * collection can be typecast to the {@code X509Certificate} class. * *

      In the case of a certificate factory for X.509 certificates, - * inStream may contain a sequence of DER-encoded certificates + * {@code inStream} may contain a sequence of DER-encoded certificates * in the formats described for * {@link #generateCertificate(java.io.InputStream) generateCertificate}. - * In addition, inStream may contain a PKCS#7 certificate + * In addition, {@code inStream} may contain a PKCS#7 certificate * chain. This is a PKCS#7 SignedData object, with the only * significant field being certificates. In particular, the * signature and the contents are ignored. This format allows multiple @@ -464,14 +464,14 @@ public class CertificateFactory { /** * Generates a certificate revocation list (CRL) object and initializes it - * with the data read from the input stream inStream. + * with the data read from the input stream {@code inStream}. * *

      In order to take advantage of the specialized CRL format * supported by this certificate factory, * the returned CRL object can be typecast to the corresponding * CRL class. For example, if this certificate * factory implements X.509 CRLs, the returned CRL object - * can be typecast to the X509CRL class. + * can be typecast to the {@code X509CRL} class. * *

      Note that if the given input stream does not support * {@link java.io.InputStream#mark(int) mark} and @@ -482,7 +482,7 @@ public class CertificateFactory { * end-of-CRL marker. If the data in the * input stream does not contain an inherent end-of-CRL marker (other * than EOF) and there is trailing data after the CRL is parsed, a - * CRLException is thrown. + * {@code CRLException} is thrown. * * @param inStream an input stream with the CRL data. * @@ -499,18 +499,18 @@ public class CertificateFactory { /** * Returns a (possibly empty) collection view of the CRLs read - * from the given input stream inStream. + * from the given input stream {@code inStream}. * *

      In order to take advantage of the specialized CRL format * supported by this certificate factory, each element in * the returned collection view can be typecast to the corresponding * CRL class. For example, if this certificate * factory implements X.509 CRLs, the elements in the returned - * collection can be typecast to the X509CRL class. + * collection can be typecast to the {@code X509CRL} class. * *

      In the case of a certificate factory for X.509 CRLs, - * inStream may contain a sequence of DER-encoded CRLs. - * In addition, inStream may contain a PKCS#7 CRL + * {@code inStream} may contain a sequence of DER-encoded CRLs. + * In addition, {@code inStream} may contain a PKCS#7 CRL * set. This is a PKCS#7 SignedData object, with the only * significant field being crls. In particular, the * signature and the contents are ignored. This format allows multiple diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java index 0912ba2a9f9..35aee847bb8 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java +++ b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,18 +35,18 @@ import java.security.NoSuchProviderException; /** * This class defines the Service Provider Interface (SPI) - * for the CertificateFactory class. + * for the {@code CertificateFactory} class. * All the abstract methods in this class must be implemented by each * cryptographic service provider who wishes to supply the implementation * of a certificate factory for a particular certificate type, e.g., X.509. * *

      Certificate factories are used to generate certificate, certification path - * (CertPath) and certificate revocation list (CRL) objects from + * ({@code CertPath}) and certificate revocation list (CRL) objects from * their encodings. * *

      A certificate factory for X.509 must return certificates that are an - * instance of java.security.cert.X509Certificate, and CRLs - * that are an instance of java.security.cert.X509CRL. + * instance of {@code java.security.cert.X509Certificate}, and CRLs + * that are an instance of {@code java.security.cert.X509CRL}. * * @author Hemma Prafullchandra * @author Jan Luehe @@ -67,17 +67,17 @@ public abstract class CertificateFactorySpi { /** * Generates a certificate object and initializes it with - * the data read from the input stream inStream. + * the data read from the input stream {@code inStream}. * *

      In order to take advantage of the specialized certificate format * supported by this certificate factory, * the returned certificate object can be typecast to the corresponding * certificate class. For example, if this certificate * factory implements X.509 certificates, the returned certificate object - * can be typecast to the X509Certificate class. + * can be typecast to the {@code X509Certificate} class. * *

      In the case of a certificate factory for X.509 certificates, the - * certificate provided in inStream must be DER-encoded and + * certificate provided in {@code inStream} must be DER-encoded and * may be supplied in binary or printable (Base64) encoding. If the * certificate is provided in Base64 encoding, it must be bounded at * the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at @@ -92,7 +92,7 @@ public abstract class CertificateFactorySpi { * end-of-certificate marker. If the data in the * input stream does not contain an inherent end-of-certificate marker (other * than EOF) and there is trailing data after the certificate is parsed, a - * CertificateException is thrown. + * {@code CertificateException} is thrown. * * @param inStream an input stream with the certificate data. * @@ -105,18 +105,18 @@ public abstract class CertificateFactorySpi { throws CertificateException; /** - * Generates a CertPath object and initializes it with - * the data read from the InputStream inStream. The data + * Generates a {@code CertPath} object and initializes it with + * the data read from the {@code InputStream} inStream. The data * is assumed to be in the default encoding. * *

      This method was added to version 1.4 of the Java 2 Platform * Standard Edition. In order to maintain backwards compatibility with - * existing service providers, this method cannot be abstract - * and by default throws an UnsupportedOperationException. + * existing service providers, this method cannot be {@code abstract} + * and by default throws an {@code UnsupportedOperationException}. * - * @param inStream an InputStream containing the data - * @return a CertPath initialized with the data from the - * InputStream + * @param inStream an {@code InputStream} containing the data + * @return a {@code CertPath} initialized with the data from the + * {@code InputStream} * @exception CertificateException if an exception occurs while decoding * @exception UnsupportedOperationException if the method is not supported * @since 1.4 @@ -128,19 +128,19 @@ public abstract class CertificateFactorySpi { } /** - * Generates a CertPath object and initializes it with - * the data read from the InputStream inStream. The data + * Generates a {@code CertPath} object and initializes it with + * the data read from the {@code InputStream} inStream. The data * is assumed to be in the specified encoding. * *

      This method was added to version 1.4 of the Java 2 Platform * Standard Edition. In order to maintain backwards compatibility with - * existing service providers, this method cannot be abstract - * and by default throws an UnsupportedOperationException. + * existing service providers, this method cannot be {@code abstract} + * and by default throws an {@code UnsupportedOperationException}. * - * @param inStream an InputStream containing the data + * @param inStream an {@code InputStream} containing the data * @param encoding the encoding used for the data - * @return a CertPath initialized with the data from the - * InputStream + * @return a {@code CertPath} initialized with the data from the + * {@code InputStream} * @exception CertificateException if an exception occurs while decoding or * the encoding requested is not supported * @exception UnsupportedOperationException if the method is not supported @@ -153,20 +153,20 @@ public abstract class CertificateFactorySpi { } /** - * Generates a CertPath object and initializes it with - * a List of Certificates. + * Generates a {@code CertPath} object and initializes it with + * a {@code List} of {@code Certificate}s. *

      * The certificates supplied must be of a type supported by the - * CertificateFactory. They will be copied out of the supplied - * List object. + * {@code CertificateFactory}. They will be copied out of the supplied + * {@code List} object. * *

      This method was added to version 1.4 of the Java 2 Platform * Standard Edition. In order to maintain backwards compatibility with - * existing service providers, this method cannot be abstract - * and by default throws an UnsupportedOperationException. + * existing service providers, this method cannot be {@code abstract} + * and by default throws an {@code UnsupportedOperationException}. * - * @param certificates a List of Certificates - * @return a CertPath initialized with the supplied list of + * @param certificates a {@code List} of {@code Certificate}s + * @return a {@code CertPath} initialized with the supplied list of * certificates * @exception CertificateException if an exception occurs * @exception UnsupportedOperationException if the method is not supported @@ -180,24 +180,24 @@ public abstract class CertificateFactorySpi { } /** - * Returns an iteration of the CertPath encodings supported + * Returns an iteration of the {@code CertPath} encodings supported * by this certificate factory, with the default encoding first. See * the CertPath Encodings section in the * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard encoding names. *

      - * Attempts to modify the returned Iterator via its - * remove method result in an - * UnsupportedOperationException. + * Attempts to modify the returned {@code Iterator} via its + * {@code remove} method result in an + * {@code UnsupportedOperationException}. * *

      This method was added to version 1.4 of the Java 2 Platform * Standard Edition. In order to maintain backwards compatibility with - * existing service providers, this method cannot be abstract - * and by default throws an UnsupportedOperationException. + * existing service providers, this method cannot be {@code abstract} + * and by default throws an {@code UnsupportedOperationException}. * - * @return an Iterator over the names of the supported - * CertPath encodings (as Strings) + * @return an {@code Iterator} over the names of the supported + * {@code CertPath} encodings (as {@code String}s) * @exception UnsupportedOperationException if the method is not supported * @since 1.4 */ @@ -207,21 +207,21 @@ public abstract class CertificateFactorySpi { /** * Returns a (possibly empty) collection view of the certificates read - * from the given input stream inStream. + * from the given input stream {@code inStream}. * *

      In order to take advantage of the specialized certificate format * supported by this certificate factory, each element in * the returned collection view can be typecast to the corresponding * certificate class. For example, if this certificate * factory implements X.509 certificates, the elements in the returned - * collection can be typecast to the X509Certificate class. + * collection can be typecast to the {@code X509Certificate} class. * *

      In the case of a certificate factory for X.509 certificates, - * inStream may contain a single DER-encoded certificate + * {@code inStream} may contain a single DER-encoded certificate * in the formats described for * {@link CertificateFactory#generateCertificate(java.io.InputStream) * generateCertificate}. - * In addition, inStream may contain a PKCS#7 certificate + * In addition, {@code inStream} may contain a PKCS#7 certificate * chain. This is a PKCS#7 SignedData object, with the only * significant field being certificates. In particular, the * signature and the contents are ignored. This format allows multiple @@ -247,14 +247,14 @@ public abstract class CertificateFactorySpi { /** * Generates a certificate revocation list (CRL) object and initializes it - * with the data read from the input stream inStream. + * with the data read from the input stream {@code inStream}. * *

      In order to take advantage of the specialized CRL format * supported by this certificate factory, * the returned CRL object can be typecast to the corresponding * CRL class. For example, if this certificate * factory implements X.509 CRLs, the returned CRL object - * can be typecast to the X509CRL class. + * can be typecast to the {@code X509CRL} class. * *

      Note that if the given input stream does not support * {@link java.io.InputStream#mark(int) mark} and @@ -265,7 +265,7 @@ public abstract class CertificateFactorySpi { * end-of-CRL marker. If the data in the * input stream does not contain an inherent end-of-CRL marker (other * than EOF) and there is trailing data after the CRL is parsed, a - * CRLException is thrown. + * {@code CRLException} is thrown. * * @param inStream an input stream with the CRL data. * @@ -279,18 +279,18 @@ public abstract class CertificateFactorySpi { /** * Returns a (possibly empty) collection view of the CRLs read - * from the given input stream inStream. + * from the given input stream {@code inStream}. * *

      In order to take advantage of the specialized CRL format * supported by this certificate factory, each element in * the returned collection view can be typecast to the corresponding * CRL class. For example, if this certificate * factory implements X.509 CRLs, the elements in the returned - * collection can be typecast to the X509CRL class. + * collection can be typecast to the {@code X509CRL} class. * *

      In the case of a certificate factory for X.509 CRLs, - * inStream may contain a single DER-encoded CRL. - * In addition, inStream may contain a PKCS#7 CRL + * {@code inStream} may contain a single DER-encoded CRL. + * In addition, {@code inStream} may contain a PKCS#7 CRL * set. This is a PKCS#7 SignedData object, with the only * significant field being crls. In particular, the * signature and the contents are ignored. This format allows multiple diff --git a/jdk/src/share/classes/java/security/cert/CertificateNotYetValidException.java b/jdk/src/share/classes/java/security/cert/CertificateNotYetValidException.java index 13da51d06f3..e8722bd339d 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateNotYetValidException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateNotYetValidException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ package java.security.cert; /** * Certificate is not yet valid exception. This is thrown whenever - * the current Date or the specified Date - * is before the notBefore date/time in the Certificate + * the current {@code Date} or the specified {@code Date} + * is before the {@code notBefore} date/time in the Certificate * validity period. * * @author Hemma Prafullchandra diff --git a/jdk/src/share/classes/java/security/cert/CertificateParsingException.java b/jdk/src/share/classes/java/security/cert/CertificateParsingException.java index 3432fb09af6..06a7d603f29 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateParsingException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateParsingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,13 @@ public class CertificateParsingException extends CertificateException { } /** - * Creates a CertificateParsingException with the specified + * Creates a {@code CertificateParsingException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -72,14 +72,14 @@ public class CertificateParsingException extends CertificateException { } /** - * Creates a CertificateParsingException with the + * Creates a {@code CertificateParsingException} with the * specified cause and a detail message of - * (cause==null ? null : cause.toString()) + * {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java index b812689ee6e..c50a224861a 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import sun.security.x509.InvalidityDateExtension; /** * An exception that indicates an X.509 certificate is revoked. A - * CertificateRevokedException contains additional information + * {@code CertificateRevokedException} contains additional information * about the revoked certificate, such as the date on which the * certificate was revoked and the reason it was revoked. * @@ -60,7 +60,7 @@ public class CertificateRevokedException extends CertificateException { */ private final CRLReason reason; /** - * @serial the X500Principal that represents the name of the + * @serial the {@code X500Principal} that represents the name of the * authority that signed the certificate's revocation status information */ private final X500Principal authority; @@ -68,7 +68,7 @@ public class CertificateRevokedException extends CertificateException { private transient Map extensions; /** - * Constructs a CertificateRevokedException with + * Constructs a {@code CertificateRevokedException} with * the specified revocation date, reason code, authority name, and map * of extensions. * @@ -78,12 +78,12 @@ public class CertificateRevokedException extends CertificateException { * @param extensions a map of X.509 Extensions. Each key is an OID String * that maps to the corresponding Extension. The map is copied to * prevent subsequent modification. - * @param authority the X500Principal that represents the name + * @param authority the {@code X500Principal} that represents the name * of the authority that signed the certificate's revocation status * information - * @throws NullPointerException if revocationDate, - * reason, authority, or - * extensions is null + * @throws NullPointerException if {@code revocationDate}, + * {@code reason}, {@code authority}, or + * {@code extensions} is {@code null} */ public CertificateRevokedException(Date revocationDate, CRLReason reason, X500Principal authority, Map extensions) { @@ -121,7 +121,7 @@ public class CertificateRevokedException extends CertificateException { * Returns the name of the authority that signed the certificate's * revocation status information. * - * @return the X500Principal that represents the name of the + * @return the {@code X500Principal} that represents the name of the * authority that signed the certificate's revocation status information */ public X500Principal getAuthorityName() { @@ -130,16 +130,16 @@ public class CertificateRevokedException extends CertificateException { /** * Returns the invalidity date, as specifed in the Invalidity Date - * extension of this CertificateRevokedException. The + * extension of this {@code CertificateRevokedException}. The * invalidity date is the date on which it is known or suspected that the * private key was compromised or that the certificate otherwise became - * invalid. This implementation calls getExtensions() and + * invalid. This implementation calls {@code getExtensions()} and * checks the returned map for an entry for the Invalidity Date extension * OID ("2.5.29.24"). If found, it returns the invalidity date in the * extension; otherwise null. A new Date object is returned each time the * method is invoked to protect against subsequent modification. * - * @return the invalidity date, or null if not specified + * @return the invalidity date, or {@code null} if not specified */ public Date getInvalidityDate() { Extension ext = getExtensions().get("2.5.29.24"); @@ -176,7 +176,7 @@ public class CertificateRevokedException extends CertificateException { } /** - * Serialize this CertificateRevokedException instance. + * Serialize this {@code CertificateRevokedException} instance. * * @serialData the size of the extensions map (int), followed by all of * the extensions in the map, in no particular order. For each extension, @@ -208,7 +208,7 @@ public class CertificateRevokedException extends CertificateException { } /** - * Deserialize the CertificateRevokedException instance. + * Deserialize the {@code CertificateRevokedException} instance. */ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { diff --git a/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java b/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java index 56e25c94778..12bd358cfff 100644 --- a/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java +++ b/jdk/src/share/classes/java/security/cert/CollectionCertStoreParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,13 +30,13 @@ import java.util.Collection; import java.util.Collections; /** - * Parameters used as input for the Collection CertStore + * Parameters used as input for the Collection {@code CertStore} * algorithm. *

      * This class is used to provide necessary configuration parameters - * to implementations of the Collection CertStore + * to implementations of the Collection {@code CertStore} * algorithm. The only parameter included in this class is the - * Collection from which the CertStore will + * {@code Collection} from which the {@code CertStore} will * retrieve certificates and CRLs. *

      * Concurrent Access @@ -58,30 +58,30 @@ public class CollectionCertStoreParameters private Collection coll; /** - * Creates an instance of CollectionCertStoreParameters + * Creates an instance of {@code CollectionCertStoreParameters} * which will allow certificates and CRLs to be retrieved from the - * specified Collection. If the specified - * Collection contains an object that is not a - * Certificate or CRL, that object will be - * ignored by the Collection CertStore. + * specified {@code Collection}. If the specified + * {@code Collection} contains an object that is not a + * {@code Certificate} or {@code CRL}, that object will be + * ignored by the Collection {@code CertStore}. *

      - * The Collection is not copied. Instead, a + * The {@code Collection} is not copied. Instead, a * reference is used. This allows the caller to subsequently add or - * remove Certificates or CRLs from the - * Collection, thus changing the set of - * Certificates or CRLs available to the - * Collection CertStore. The Collection CertStore - * will not modify the contents of the Collection. + * remove {@code Certificates} or {@code CRL}s from the + * {@code Collection}, thus changing the set of + * {@code Certificates} or {@code CRL}s available to the + * Collection {@code CertStore}. The Collection {@code CertStore} + * will not modify the contents of the {@code Collection}. *

      - * If the Collection will be modified by one thread while - * another thread is calling a method of a Collection CertStore - * that has been initialized with this Collection, the - * Collection must have fail-fast iterators. + * If the {@code Collection} will be modified by one thread while + * another thread is calling a method of a Collection {@code CertStore} + * that has been initialized with this {@code Collection}, the + * {@code Collection} must have fail-fast iterators. * - * @param collection a Collection of - * Certificates and CRLs - * @exception NullPointerException if collection is - * null + * @param collection a {@code Collection} of + * {@code Certificate}s and {@code CRL}s + * @exception NullPointerException if {@code collection} is + * {@code null} */ public CollectionCertStoreParameters(Collection collection) { if (collection == null) @@ -90,22 +90,22 @@ public class CollectionCertStoreParameters } /** - * Creates an instance of CollectionCertStoreParameters with + * Creates an instance of {@code CollectionCertStoreParameters} with * the default parameter values (an empty and immutable - * Collection). + * {@code Collection}). */ public CollectionCertStoreParameters() { coll = Collections.EMPTY_SET; } /** - * Returns the Collection from which Certificates - * and CRLs are retrieved. This is not a copy of the - * Collection, it is a reference. This allows the caller to - * subsequently add or remove Certificates or - * CRLs from the Collection. + * Returns the {@code Collection} from which {@code Certificate}s + * and {@code CRL}s are retrieved. This is not a copy of the + * {@code Collection}, it is a reference. This allows the caller to + * subsequently add or remove {@code Certificates} or + * {@code CRL}s from the {@code Collection}. * - * @return the Collection (never null) + * @return the {@code Collection} (never null) */ public Collection getCollection() { return coll; @@ -113,7 +113,7 @@ public class CollectionCertStoreParameters /** * Returns a copy of this object. Note that only a reference to the - * Collection is copied, and not the contents. + * {@code Collection} is copied, and not the contents. * * @return the copy */ diff --git a/jdk/src/share/classes/java/security/cert/Extension.java b/jdk/src/share/classes/java/security/cert/Extension.java index cbf89d5cdba..98e827c5919 100644 --- a/jdk/src/share/classes/java/security/cert/Extension.java +++ b/jdk/src/share/classes/java/security/cert/Extension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,7 @@ public interface Extension { * that are encoded as an OCTET STRING. It does not include the OCTET * STRING tag and length. * - * @return a copy of the extension's value, or null if no + * @return a copy of the extension's value, or {@code null} if no * extension value is present. */ byte[] getValue(); @@ -95,7 +95,7 @@ public interface Extension { * * @param out the output stream * @exception IOException on encoding or output error. - * @exception NullPointerException if out is null. + * @exception NullPointerException if {@code out} is {@code null}. */ void encode(OutputStream out) throws IOException; } diff --git a/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java b/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java index 5d8b4d59927..96fe9cd0939 100644 --- a/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java +++ b/jdk/src/share/classes/java/security/cert/LDAPCertStoreParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,10 @@ package java.security.cert; /** - * Parameters used as input for the LDAP CertStore algorithm. + * Parameters used as input for the LDAP {@code CertStore} algorithm. *

      * This class is used to provide necessary configuration parameters (server - * name and port number) to implementations of the LDAP CertStore + * name and port number) to implementations of the LDAP {@code CertStore} * algorithm. *

      * Concurrent Access @@ -59,13 +59,13 @@ public class LDAPCertStoreParameters implements CertStoreParameters { private String serverName; /** - * Creates an instance of LDAPCertStoreParameters with the + * Creates an instance of {@code LDAPCertStoreParameters} with the * specified parameter values. * * @param serverName the DNS name of the LDAP server * @param port the port number of the LDAP server - * @exception NullPointerException if serverName is - * null + * @exception NullPointerException if {@code serverName} is + * {@code null} */ public LDAPCertStoreParameters(String serverName, int port) { if (serverName == null) @@ -75,19 +75,19 @@ public class LDAPCertStoreParameters implements CertStoreParameters { } /** - * Creates an instance of LDAPCertStoreParameters with the + * Creates an instance of {@code LDAPCertStoreParameters} with the * specified server name and a default port of 389. * * @param serverName the DNS name of the LDAP server - * @exception NullPointerException if serverName is - * null + * @exception NullPointerException if {@code serverName} is + * {@code null} */ public LDAPCertStoreParameters(String serverName) { this(serverName, LDAP_DEFAULT_PORT); } /** - * Creates an instance of LDAPCertStoreParameters with the + * Creates an instance of {@code LDAPCertStoreParameters} with the * default parameter values (server name "localhost", port 389). */ public LDAPCertStoreParameters() { @@ -97,7 +97,7 @@ public class LDAPCertStoreParameters implements CertStoreParameters { /** * Returns the DNS name of the LDAP server. * - * @return the name (not null) + * @return the name (not {@code null}) */ public String getServerName() { return serverName; @@ -117,7 +117,7 @@ public class LDAPCertStoreParameters implements CertStoreParameters { * the original and vice versa. *

      * Note: this method currently performs a shallow copy of the object - * (simply calls Object.clone()). This may be changed in a + * (simply calls {@code Object.clone()}). This may be changed in a * future revision to perform a deep copy if new parameters are added * that should not be shared. * diff --git a/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java b/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java index d1b27c6ffba..b33e1f8c1e2 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java +++ b/jdk/src/share/classes/java/security/cert/PKIXBuilderParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,35 +32,35 @@ import java.security.InvalidParameterException; import java.util.Set; /** - * Parameters used as input for the PKIX CertPathBuilder + * Parameters used as input for the PKIX {@code CertPathBuilder} * algorithm. *

      - * A PKIX CertPathBuilder uses these parameters to {@link - * CertPathBuilder#build build} a CertPath which has been + * A PKIX {@code CertPathBuilder} uses these parameters to {@link + * CertPathBuilder#build build} a {@code CertPath} which has been * validated according to the PKIX certification path validation algorithm. * - *

      To instantiate a PKIXBuilderParameters object, an + *

      To instantiate a {@code PKIXBuilderParameters} object, an * application must specify one or more most-trusted CAs as defined by * the PKIX certification path validation algorithm. The most-trusted CA * can be specified using one of two constructors. An application * can call {@link #PKIXBuilderParameters(Set, CertSelector) * PKIXBuilderParameters(Set, CertSelector)}, specifying a - * Set of TrustAnchor objects, each of which + * {@code Set} of {@code TrustAnchor} objects, each of which * identifies a most-trusted CA. Alternatively, an application can call * {@link #PKIXBuilderParameters(KeyStore, CertSelector) * PKIXBuilderParameters(KeyStore, CertSelector)}, specifying a - * KeyStore instance containing trusted certificate entries, each + * {@code KeyStore} instance containing trusted certificate entries, each * of which will be considered as a most-trusted CA. * *

      In addition, an application must specify constraints on the target - * certificate that the CertPathBuilder will attempt + * certificate that the {@code CertPathBuilder} will attempt * to build a path to. The constraints are specified as a - * CertSelector object. These constraints should provide the - * CertPathBuilder with enough search criteria to find the target - * certificate. Minimal criteria for an X509Certificate usually + * {@code CertSelector} object. These constraints should provide the + * {@code CertPathBuilder} with enough search criteria to find the target + * certificate. Minimal criteria for an {@code X509Certificate} usually * include the subject name and/or one or more subject alternative names. - * If enough criteria is not specified, the CertPathBuilder - * may throw a CertPathBuilderException. + * If enough criteria is not specified, the {@code CertPathBuilder} + * may throw a {@code CertPathBuilderException}. *

      * Concurrent Access *

      @@ -80,23 +80,23 @@ public class PKIXBuilderParameters extends PKIXParameters { private int maxPathLength = 5; /** - * Creates an instance of PKIXBuilderParameters with - * the specified Set of most-trusted CAs. + * Creates an instance of {@code PKIXBuilderParameters} with + * the specified {@code Set} of most-trusted CAs. * Each element of the set is a {@link TrustAnchor TrustAnchor}. * - *

      Note that the Set is copied to protect against + *

      Note that the {@code Set} is copied to protect against * subsequent modifications. * - * @param trustAnchors a Set of TrustAnchors - * @param targetConstraints a CertSelector specifying the + * @param trustAnchors a {@code Set} of {@code TrustAnchor}s + * @param targetConstraints a {@code CertSelector} specifying the * constraints on the target certificate - * @throws InvalidAlgorithmParameterException if trustAnchors - * is empty (trustAnchors.isEmpty() == true) - * @throws NullPointerException if trustAnchors is - * null + * @throws InvalidAlgorithmParameterException if {@code trustAnchors} + * is empty {@code (trustAnchors.isEmpty() == true)} + * @throws NullPointerException if {@code trustAnchors} is + * {@code null} * @throws ClassCastException if any of the elements of - * trustAnchors are not of type - * java.security.cert.TrustAnchor + * {@code trustAnchors} are not of type + * {@code java.security.cert.TrustAnchor} */ public PKIXBuilderParameters(Set trustAnchors, CertSelector targetConstraints) throws InvalidAlgorithmParameterException @@ -106,22 +106,22 @@ public class PKIXBuilderParameters extends PKIXParameters { } /** - * Creates an instance of PKIXBuilderParameters that + * Creates an instance of {@code PKIXBuilderParameters} that * populates the set of most-trusted CAs from the trusted - * certificate entries contained in the specified KeyStore. - * Only keystore entries that contain trusted X509Certificates + * certificate entries contained in the specified {@code KeyStore}. + * Only keystore entries that contain trusted {@code X509Certificate}s * are considered; all other certificate types are ignored. * - * @param keystore a KeyStore from which the set of + * @param keystore a {@code KeyStore} from which the set of * most-trusted CAs will be populated - * @param targetConstraints a CertSelector specifying the + * @param targetConstraints a {@code CertSelector} specifying the * constraints on the target certificate - * @throws KeyStoreException if keystore has not been + * @throws KeyStoreException if {@code keystore} has not been * initialized - * @throws InvalidAlgorithmParameterException if keystore does + * @throws InvalidAlgorithmParameterException if {@code keystore} does * not contain at least one trusted certificate entry - * @throws NullPointerException if keystore is - * null + * @throws NullPointerException if {@code keystore} is + * {@code null} */ public PKIXBuilderParameters(KeyStore keystore, CertSelector targetConstraints) @@ -139,7 +139,7 @@ public class PKIXBuilderParameters extends PKIXParameters { * in a certification path is not an intermediate certificate, and is not * included in this limit. Usually the last certificate is an end entity * certificate, but it can be a CA certificate. A PKIX - * CertPathBuilder instance must not build + * {@code CertPathBuilder} instance must not build * paths longer than the length specified. * *

      A value of 0 implies that the path can only contain @@ -149,14 +149,14 @@ public class PKIXBuilderParameters extends PKIXParameters { * Setting a value less than -1 will cause an exception to be thrown. * *

      If any of the CA certificates contain the - * BasicConstraintsExtension, the value of the - * pathLenConstraint field of the extension overrides + * {@code BasicConstraintsExtension}, the value of the + * {@code pathLenConstraint} field of the extension overrides * the maximum path length parameter whenever the result is a * certification path of smaller length. * * @param maxPathLength the maximum number of non-self-issued intermediate * certificates that may exist in a certification path - * @throws InvalidParameterException if maxPathLength is set + * @throws InvalidParameterException if {@code maxPathLength} is set * to a value less than -1 * * @see #getMaxPathLength diff --git a/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java b/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java index d5efbb35ad2..3255a3bbda6 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java +++ b/jdk/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,14 +33,14 @@ import java.security.PublicKey; * returned using this algorithm are also validated according to the PKIX * certification path validation algorithm. * - *

      Instances of PKIXCertPathBuilderResult are returned by - * the build method of CertPathBuilder + *

      Instances of {@code PKIXCertPathBuilderResult} are returned by + * the {@code build} method of {@code CertPathBuilder} * objects implementing the PKIX algorithm. * - *

      All PKIXCertPathBuilderResult objects contain the + *

      All {@code PKIXCertPathBuilderResult} objects contain the * certification path constructed by the build algorithm, the * valid policy tree and subject public key resulting from the build - * algorithm, and a TrustAnchor describing the certification + * algorithm, and a {@code TrustAnchor} describing the certification * authority (CA) that served as a trust anchor for the certification path. *

      * Concurrent Access @@ -62,18 +62,18 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult private CertPath certPath; /** - * Creates an instance of PKIXCertPathBuilderResult + * Creates an instance of {@code PKIXCertPathBuilderResult} * containing the specified parameters. * - * @param certPath the validated CertPath - * @param trustAnchor a TrustAnchor describing the CA that + * @param certPath the validated {@code CertPath} + * @param trustAnchor a {@code TrustAnchor} describing the CA that * served as a trust anchor for the certification path - * @param policyTree the immutable valid policy tree, or null + * @param policyTree the immutable valid policy tree, or {@code null} * if there are no valid policies * @param subjectPublicKey the public key of the subject - * @throws NullPointerException if the certPath, - * trustAnchor or subjectPublicKey parameters - * are null + * @throws NullPointerException if the {@code certPath}, + * {@code trustAnchor} or {@code subjectPublicKey} parameters + * are {@code null} */ public PKIXCertPathBuilderResult(CertPath certPath, TrustAnchor trustAnchor, PolicyNode policyTree, @@ -87,13 +87,13 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult /** * Returns the built and validated certification path. The - * CertPath object does not include the trust anchor. + * {@code CertPath} object does not include the trust anchor. * Instead, use the {@link #getTrustAnchor() getTrustAnchor()} method to - * obtain the TrustAnchor that served as the trust anchor + * obtain the {@code TrustAnchor} that served as the trust anchor * for the certification path. * - * @return the built and validated CertPath (never - * null) + * @return the built and validated {@code CertPath} (never + * {@code null}) */ public CertPath getCertPath() { return certPath; @@ -101,10 +101,10 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult /** * Return a printable representation of this - * PKIXCertPathBuilderResult. + * {@code PKIXCertPathBuilderResult}. * - * @return a String describing the contents of this - * PKIXCertPathBuilderResult + * @return a {@code String} describing the contents of this + * {@code PKIXCertPathBuilderResult} */ public String toString() { StringBuffer sb = new StringBuffer(); diff --git a/jdk/src/share/classes/java/security/cert/PKIXCertPathChecker.java b/jdk/src/share/classes/java/security/cert/PKIXCertPathChecker.java index 30b44c37f74..21e01bf5166 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXCertPathChecker.java +++ b/jdk/src/share/classes/java/security/cert/PKIXCertPathChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,38 +30,38 @@ import java.util.Set; /** * An abstract class that performs one or more checks on an - * X509Certificate. + * {@code X509Certificate}. * - *

      A concrete implementation of the PKIXCertPathChecker class + *

      A concrete implementation of the {@code PKIXCertPathChecker} class * can be created to extend the PKIX certification path validation algorithm. * For example, an implementation may check for and process a critical private * extension of each certificate in a certification path. * - *

      Instances of PKIXCertPathChecker are passed as parameters + *

      Instances of {@code PKIXCertPathChecker} are passed as parameters * using the {@link PKIXParameters#setCertPathCheckers setCertPathCheckers} * or {@link PKIXParameters#addCertPathChecker addCertPathChecker} methods - * of the PKIXParameters and PKIXBuilderParameters - * class. Each of the PKIXCertPathCheckers {@link #check check} + * of the {@code PKIXParameters} and {@code PKIXBuilderParameters} + * class. Each of the {@code PKIXCertPathChecker}s {@link #check check} * methods will be called, in turn, for each certificate processed by a PKIX - * CertPathValidator or CertPathBuilder + * {@code CertPathValidator} or {@code CertPathBuilder} * implementation. * - *

      A PKIXCertPathChecker may be called multiple times on + *

      A {@code PKIXCertPathChecker} may be called multiple times on * successive certificates in a certification path. Concrete subclasses * are expected to maintain any internal state that may be necessary to * check successive certificates. The {@link #init init} method is used * to initialize the internal state of the checker so that the certificates * of a new certification path may be checked. A stateful implementation * must override the {@link #clone clone} method if necessary in - * order to allow a PKIX CertPathBuilder to efficiently + * order to allow a PKIX {@code CertPathBuilder} to efficiently * backtrack and try other paths. In these situations, the - * CertPathBuilder is able to restore prior path validation - * states by restoring the cloned PKIXCertPathCheckers. + * {@code CertPathBuilder} is able to restore prior path validation + * states by restoring the cloned {@code PKIXCertPathChecker}s. * *

      The order in which the certificates are presented to the - * PKIXCertPathChecker may be either in the forward direction + * {@code PKIXCertPathChecker} may be either in the forward direction * (from target to most-trusted CA) or in the reverse direction (from - * most-trusted CA to target). A PKIXCertPathChecker implementation + * most-trusted CA to target). A {@code PKIXCertPathChecker} implementation * must support reverse checking (the ability to perform its checks when * it is presented with certificates in the reverse direction) and may * support forward checking (the ability to perform its checks when it is @@ -96,19 +96,19 @@ public abstract class PKIXCertPathChecker protected PKIXCertPathChecker() {} /** - * Initializes the internal state of this PKIXCertPathChecker. + * Initializes the internal state of this {@code PKIXCertPathChecker}. *

      - * The forward flag specifies the order that + * The {@code forward} flag specifies the order that * certificates will be passed to the {@link #check check} method - * (forward or reverse). A PKIXCertPathChecker must + * (forward or reverse). A {@code PKIXCertPathChecker} must * support reverse checking and may support forward checking. * * @param forward the order that certificates are presented to - * the check method. If true, certificates + * the {@code check} method. If {@code true}, certificates * are presented from target to most-trusted CA (forward); if - * false, from most-trusted CA to target (reverse). + * {@code false}, from most-trusted CA to target (reverse). * @throws CertPathValidatorException if this - * PKIXCertPathChecker is unable to check certificates in + * {@code PKIXCertPathChecker} is unable to check certificates in * the specified order; it should never be thrown if the forward flag * is false since reverse checking must be supported */ @@ -118,32 +118,32 @@ public abstract class PKIXCertPathChecker /** * Indicates if forward checking is supported. Forward checking refers - * to the ability of the PKIXCertPathChecker to perform - * its checks when certificates are presented to the check + * to the ability of the {@code PKIXCertPathChecker} to perform + * its checks when certificates are presented to the {@code check} * method in the forward direction (from target to most-trusted CA). * - * @return true if forward checking is supported, - * false otherwise + * @return {@code true} if forward checking is supported, + * {@code false} otherwise */ @Override public abstract boolean isForwardCheckingSupported(); /** - * Returns an immutable Set of X.509 certificate extensions - * that this PKIXCertPathChecker supports (i.e. recognizes, is - * able to process), or null if no extensions are supported. + * Returns an immutable {@code Set} of X.509 certificate extensions + * that this {@code PKIXCertPathChecker} supports (i.e. recognizes, is + * able to process), or {@code null} if no extensions are supported. *

      - * Each element of the set is a String representing the + * Each element of the set is a {@code String} representing the * Object Identifier (OID) of the X.509 extension that is supported. * The OID is represented by a set of nonnegative integers separated by * periods. *

      - * All X.509 certificate extensions that a PKIXCertPathChecker + * All X.509 certificate extensions that a {@code PKIXCertPathChecker} * might possibly be able to process should be included in the set. * - * @return an immutable Set of X.509 extension OIDs (in - * String format) supported by this - * PKIXCertPathChecker, or null if no + * @return an immutable {@code Set} of X.509 extension OIDs (in + * {@code String} format) supported by this + * {@code PKIXCertPathChecker}, or {@code null} if no * extensions are supported */ public abstract Set getSupportedExtensions(); @@ -153,10 +153,10 @@ public abstract class PKIXCertPathChecker * state and removes any critical extensions that it processes from the * specified collection of OID strings that represent the unresolved * critical extensions. The certificates are presented in the order - * specified by the init method. + * specified by the {@code init} method. * - * @param cert the Certificate to be checked - * @param unresolvedCritExts a Collection of OID strings + * @param cert the {@code Certificate} to be checked + * @param unresolvedCritExts a {@code Collection} of OID strings * representing the current set of unresolved critical extensions * @exception CertPathValidatorException if the specified certificate does * not pass the check @@ -177,12 +177,12 @@ public abstract class PKIXCertPathChecker } /** - * Returns a clone of this object. Calls the Object.clone() + * Returns a clone of this object. Calls the {@code Object.clone()} * method. * All subclasses which maintain state must support and * override this method, if necessary. * - * @return a copy of this PKIXCertPathChecker + * @return a copy of this {@code PKIXCertPathChecker} */ @Override public Object clone() { diff --git a/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java b/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java index 39f22726818..b40cd393c7d 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java +++ b/jdk/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,13 +31,13 @@ import java.security.PublicKey; * This class represents the successful result of the PKIX certification * path validation algorithm. * - *

      Instances of PKIXCertPathValidatorResult are returned by the + *

      Instances of {@code PKIXCertPathValidatorResult} are returned by the * {@link CertPathValidator#validate validate} method of - * CertPathValidator objects implementing the PKIX algorithm. + * {@code CertPathValidator} objects implementing the PKIX algorithm. * - *

      All PKIXCertPathValidatorResult objects contain the + *

      All {@code PKIXCertPathValidatorResult} objects contain the * valid policy tree and subject public key resulting from the - * validation algorithm, as well as a TrustAnchor describing + * validation algorithm, as well as a {@code TrustAnchor} describing * the certification authority (CA) that served as a trust anchor for the * certification path. *

      @@ -62,16 +62,16 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult { private PublicKey subjectPublicKey; /** - * Creates an instance of PKIXCertPathValidatorResult + * Creates an instance of {@code PKIXCertPathValidatorResult} * containing the specified parameters. * - * @param trustAnchor a TrustAnchor describing the CA that + * @param trustAnchor a {@code TrustAnchor} describing the CA that * served as a trust anchor for the certification path - * @param policyTree the immutable valid policy tree, or null + * @param policyTree the immutable valid policy tree, or {@code null} * if there are no valid policies * @param subjectPublicKey the public key of the subject - * @throws NullPointerException if the subjectPublicKey or - * trustAnchor parameters are null + * @throws NullPointerException if the {@code subjectPublicKey} or + * {@code trustAnchor} parameters are {@code null} */ public PKIXCertPathValidatorResult(TrustAnchor trustAnchor, PolicyNode policyTree, PublicKey subjectPublicKey) @@ -86,10 +86,10 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult { } /** - * Returns the TrustAnchor describing the CA that served + * Returns the {@code TrustAnchor} describing the CA that served * as a trust anchor for the certification path. * - * @return the TrustAnchor (never null) + * @return the {@code TrustAnchor} (never {@code null}) */ public TrustAnchor getTrustAnchor() { return trustAnchor; @@ -98,18 +98,18 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult { /** * Returns the root node of the valid policy tree resulting from the * PKIX certification path validation algorithm. The - * PolicyNode object that is returned and any objects that + * {@code PolicyNode} object that is returned and any objects that * it returns through public methods are immutable. * *

      Most applications will not need to examine the valid policy tree. * They can achieve their policy processing goals by setting the - * policy-related parameters in PKIXParameters. However, more + * policy-related parameters in {@code PKIXParameters}. However, more * sophisticated applications, especially those that process policy * qualifiers, may need to traverse the valid policy tree using the * {@link PolicyNode#getParent PolicyNode.getParent} and * {@link PolicyNode#getChildren PolicyNode.getChildren} methods. * - * @return the root node of the valid policy tree, or null + * @return the root node of the valid policy tree, or {@code null} * if there are no valid policies */ public PolicyNode getPolicyTree() { @@ -120,7 +120,7 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult { * Returns the public key of the subject (target) of the certification * path, including any inherited public key parameters if applicable. * - * @return the public key of the subject (never null) + * @return the public key of the subject (never {@code null}) */ public PublicKey getPublicKey() { return subjectPublicKey; @@ -142,10 +142,10 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult { /** * Return a printable representation of this - * PKIXCertPathValidatorResult. + * {@code PKIXCertPathValidatorResult}. * - * @return a String describing the contents of this - * PKIXCertPathValidatorResult + * @return a {@code String} describing the contents of this + * {@code PKIXCertPathValidatorResult} */ public String toString() { StringBuffer sb = new StringBuffer(); diff --git a/jdk/src/share/classes/java/security/cert/PKIXParameters.java b/jdk/src/share/classes/java/security/cert/PKIXParameters.java index 8b0100511e0..4d8a344532e 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXParameters.java +++ b/jdk/src/share/classes/java/security/cert/PKIXParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,34 +38,34 @@ import java.util.List; import java.util.Set; /** - * Parameters used as input for the PKIX CertPathValidator + * Parameters used as input for the PKIX {@code CertPathValidator} * algorithm. *

      - * A PKIX CertPathValidator uses these parameters to - * validate a CertPath according to the PKIX certification path + * A PKIX {@code CertPathValidator} uses these parameters to + * validate a {@code CertPath} according to the PKIX certification path * validation algorithm. * - *

      To instantiate a PKIXParameters object, an + *

      To instantiate a {@code PKIXParameters} object, an * application must specify one or more most-trusted CAs as defined by * the PKIX certification path validation algorithm. The most-trusted CAs * can be specified using one of two constructors. An application * can call {@link #PKIXParameters(Set) PKIXParameters(Set)}, - * specifying a Set of TrustAnchor objects, each + * specifying a {@code Set} of {@code TrustAnchor} objects, each * of which identify a most-trusted CA. Alternatively, an application can call * {@link #PKIXParameters(KeyStore) PKIXParameters(KeyStore)}, specifying a - * KeyStore instance containing trusted certificate entries, each + * {@code KeyStore} instance containing trusted certificate entries, each * of which will be considered as a most-trusted CA. *

      - * Once a PKIXParameters object has been created, other parameters + * Once a {@code PKIXParameters} object has been created, other parameters * can be specified (by calling {@link #setInitialPolicies setInitialPolicies} * or {@link #setDate setDate}, for instance) and then the - * PKIXParameters is passed along with the CertPath + * {@code PKIXParameters} is passed along with the {@code CertPath} * to be validated to {@link CertPathValidator#validate * CertPathValidator.validate}. *

      - * Any parameter that is not set (or is set to null) will + * Any parameter that is not set (or is set to {@code null}) will * be set to the default value for that parameter. The default value for the - * date parameter is null, which indicates + * {@code date} parameter is {@code null}, which indicates * the current time when the path is validated. The default for the * remaining parameters is the least constrained. *

      @@ -99,20 +99,20 @@ public class PKIXParameters implements CertPathParameters { private CertSelector certSelector; /** - * Creates an instance of PKIXParameters with the specified - * Set of most-trusted CAs. Each element of the + * Creates an instance of {@code PKIXParameters} with the specified + * {@code Set} of most-trusted CAs. Each element of the * set is a {@link TrustAnchor TrustAnchor}. *

      - * Note that the Set is copied to protect against + * Note that the {@code Set} is copied to protect against * subsequent modifications. * - * @param trustAnchors a Set of TrustAnchors + * @param trustAnchors a {@code Set} of {@code TrustAnchor}s * @throws InvalidAlgorithmParameterException if the specified - * Set is empty (trustAnchors.isEmpty() == true) - * @throws NullPointerException if the specified Set is - * null - * @throws ClassCastException if any of the elements in the Set - * are not of type java.security.cert.TrustAnchor + * {@code Set} is empty {@code (trustAnchors.isEmpty() == true)} + * @throws NullPointerException if the specified {@code Set} is + * {@code null} + * @throws ClassCastException if any of the elements in the {@code Set} + * are not of type {@code java.security.cert.TrustAnchor} */ public PKIXParameters(Set trustAnchors) throws InvalidAlgorithmParameterException @@ -125,18 +125,18 @@ public class PKIXParameters implements CertPathParameters { } /** - * Creates an instance of PKIXParameters that + * Creates an instance of {@code PKIXParameters} that * populates the set of most-trusted CAs from the trusted - * certificate entries contained in the specified KeyStore. - * Only keystore entries that contain trusted X509Certificates + * certificate entries contained in the specified {@code KeyStore}. + * Only keystore entries that contain trusted {@code X509Certificates} * are considered; all other certificate types are ignored. * - * @param keystore a KeyStore from which the set of + * @param keystore a {@code KeyStore} from which the set of * most-trusted CAs will be populated * @throws KeyStoreException if the keystore has not been initialized * @throws InvalidAlgorithmParameterException if the keystore does * not contain at least one trusted certificate entry - * @throws NullPointerException if the keystore is null + * @throws NullPointerException if the keystore is {@code null} */ public PKIXParameters(KeyStore keystore) throws KeyStoreException, InvalidAlgorithmParameterException @@ -161,11 +161,11 @@ public class PKIXParameters implements CertPathParameters { } /** - * Returns an immutable Set of the most-trusted + * Returns an immutable {@code Set} of the most-trusted * CAs. * - * @return an immutable Set of TrustAnchors - * (never null) + * @return an immutable {@code Set} of {@code TrustAnchor}s + * (never {@code null}) * * @see #setTrustAnchors */ @@ -174,18 +174,18 @@ public class PKIXParameters implements CertPathParameters { } /** - * Sets the Set of most-trusted CAs. + * Sets the {@code Set} of most-trusted CAs. *

      - * Note that the Set is copied to protect against + * Note that the {@code Set} is copied to protect against * subsequent modifications. * - * @param trustAnchors a Set of TrustAnchors + * @param trustAnchors a {@code Set} of {@code TrustAnchor}s * @throws InvalidAlgorithmParameterException if the specified - * Set is empty (trustAnchors.isEmpty() == true) - * @throws NullPointerException if the specified Set is - * null + * {@code Set} is empty {@code (trustAnchors.isEmpty() == true)} + * @throws NullPointerException if the specified {@code Set} is + * {@code null} * @throws ClassCastException if any of the elements in the set - * are not of type java.security.cert.TrustAnchor + * are not of type {@code java.security.cert.TrustAnchor} * * @see #getTrustAnchors */ @@ -211,16 +211,16 @@ public class PKIXParameters implements CertPathParameters { } /** - * Returns an immutable Set of initial + * Returns an immutable {@code Set} of initial * policy identifiers (OID strings), indicating that any one of these * policies would be acceptable to the certificate user for the purposes of * certification path processing. The default return value is an empty - * Set, which is interpreted as meaning that any policy would + * {@code Set}, which is interpreted as meaning that any policy would * be acceptable. * - * @return an immutable Set of initial policy OIDs in - * String format, or an empty Set (implying any - * policy is acceptable). Never returns null. + * @return an immutable {@code Set} of initial policy OIDs in + * {@code String} format, or an empty {@code Set} (implying any + * policy is acceptable). Never returns {@code null}. * * @see #setInitialPolicies */ @@ -229,21 +229,21 @@ public class PKIXParameters implements CertPathParameters { } /** - * Sets the Set of initial policy identifiers + * Sets the {@code Set} of initial policy identifiers * (OID strings), indicating that any one of these * policies would be acceptable to the certificate user for the purposes of * certification path processing. By default, any policy is acceptable * (i.e. all policies), so a user that wants to allow any policy as * acceptable does not need to call this method, or can call it - * with an empty Set (or null). + * with an empty {@code Set} (or {@code null}). *

      - * Note that the Set is copied to protect against + * Note that the {@code Set} is copied to protect against * subsequent modifications. * - * @param initialPolicies a Set of initial policy - * OIDs in String format (or null) + * @param initialPolicies a {@code Set} of initial policy + * OIDs in {@code String} format (or {@code null}) * @throws ClassCastException if any of the elements in the set are - * not of type String + * not of type {@code String} * * @see #getInitialPolicies */ @@ -262,19 +262,19 @@ public class PKIXParameters implements CertPathParameters { } /** - * Sets the list of CertStores to be used in finding - * certificates and CRLs. May be null, in which case - * no CertStores will be used. The first - * CertStores in the list may be preferred to those that + * Sets the list of {@code CertStore}s to be used in finding + * certificates and CRLs. May be {@code null}, in which case + * no {@code CertStore}s will be used. The first + * {@code CertStore}s in the list may be preferred to those that * appear later. *

      - * Note that the List is copied to protect against + * Note that the {@code List} is copied to protect against * subsequent modifications. * - * @param stores a List of CertStores (or - * null) + * @param stores a {@code List} of {@code CertStore}s (or + * {@code null}) * @throws ClassCastException if any of the elements in the list are - * not of type java.security.cert.CertStore + * not of type {@code java.security.cert.CertStore} * * @see #getCertStores */ @@ -293,10 +293,10 @@ public class PKIXParameters implements CertPathParameters { } /** - * Adds a CertStore to the end of the list of - * CertStores used in finding certificates and CRLs. + * Adds a {@code CertStore} to the end of the list of + * {@code CertStore}s used in finding certificates and CRLs. * - * @param store the CertStore to add. If null, + * @param store the {@code CertStore} to add. If {@code null}, * the store is ignored (not added to list). */ public void addCertStore(CertStore store) { @@ -306,11 +306,11 @@ public class PKIXParameters implements CertPathParameters { } /** - * Returns an immutable List of CertStores that + * Returns an immutable {@code List} of {@code CertStore}s that * are used to find certificates and CRLs. * - * @return an immutable List of CertStores - * (may be empty, but never null) + * @return an immutable {@code List} of {@code CertStore}s + * (may be empty, but never {@code null}) * * @see #setCertStores */ @@ -325,7 +325,7 @@ public class PKIXParameters implements CertPathParameters { * will be used. If this flag is false, the default revocation checking * mechanism will be disabled (not used). *

      - * When a PKIXParameters object is created, this flag is set + * When a {@code PKIXParameters} object is created, this flag is set * to true. This setting reflects the most common strategy for checking * revocation, since each service provider must support revocation * checking to be PKIX compliant. Sophisticated applications should set @@ -360,8 +360,8 @@ public class PKIXParameters implements CertPathParameters { * acceptable policy needs to be explicitly identified in every certificate. * By default, the ExplicitPolicyRequired flag is false. * - * @param val true if explicit policy is to be required, - * false otherwise + * @param val {@code true} if explicit policy is to be required, + * {@code false} otherwise */ public void setExplicitPolicyRequired(boolean val) { explicitPolicyRequired = val; @@ -372,8 +372,8 @@ public class PKIXParameters implements CertPathParameters { * acceptable policy needs to be explicitly identified in every certificate. * By default, the ExplicitPolicyRequired flag is false. * - * @return true if explicit policy is required, - * false otherwise + * @return {@code true} if explicit policy is required, + * {@code false} otherwise */ public boolean isExplicitPolicyRequired() { return explicitPolicyRequired; @@ -384,8 +384,8 @@ public class PKIXParameters implements CertPathParameters { * mapping is inhibited. By default, policy mapping is not inhibited (the * flag is false). * - * @param val true if policy mapping is to be inhibited, - * false otherwise + * @param val {@code true} if policy mapping is to be inhibited, + * {@code false} otherwise */ public void setPolicyMappingInhibited(boolean val) { policyMappingInhibited = val; @@ -406,10 +406,10 @@ public class PKIXParameters implements CertPathParameters { * Sets state to determine if the any policy OID should be processed * if it is included in a certificate. By default, the any policy OID * is not inhibited ({@link #isAnyPolicyInhibited isAnyPolicyInhibited()} - * returns false). + * returns {@code false}). * - * @param val true if the any policy OID is to be - * inhibited, false otherwise + * @param val {@code true} if the any policy OID is to be + * inhibited, {@code false} otherwise */ public void setAnyPolicyInhibited(boolean val) { anyPolicyInhibited = val; @@ -419,8 +419,8 @@ public class PKIXParameters implements CertPathParameters { * Checks whether the any policy OID should be processed if it * is included in a certificate. * - * @return true if the any policy OID is inhibited, - * false otherwise + * @return {@code true} if the any policy OID is inhibited, + * {@code false} otherwise */ public boolean isAnyPolicyInhibited() { return anyPolicyInhibited; @@ -432,7 +432,7 @@ public class PKIXParameters implements CertPathParameters { * policies extension that is marked critical are rejected. * If the flag is false, certificates are not rejected on this basis. * - *

      When a PKIXParameters object is created, this flag is + *

      When a {@code PKIXParameters} object is created, this flag is * set to true. This setting reflects the most common (and simplest) * strategy for processing policy qualifiers. Applications that want to use * a more sophisticated policy must set this flag to false. @@ -459,7 +459,7 @@ public class PKIXParameters implements CertPathParameters { * extension that is marked critical are rejected. * If the flag is false, certificates are not rejected on this basis. * - *

      When a PKIXParameters object is created, this flag is + *

      When a {@code PKIXParameters} object is created, this flag is * set to true. This setting reflects the most common (and simplest) * strategy for processing policy qualifiers. Applications that want to use * a more sophisticated policy must set this flag to false. @@ -473,12 +473,12 @@ public class PKIXParameters implements CertPathParameters { /** * Returns the time for which the validity of the certification path - * should be determined. If null, the current time is used. + * should be determined. If {@code null}, the current time is used. *

      - * Note that the Date returned is copied to protect against + * Note that the {@code Date} returned is copied to protect against * subsequent modifications. * - * @return the Date, or null if not set + * @return the {@code Date}, or {@code null} if not set * @see #setDate */ public Date getDate() { @@ -490,12 +490,12 @@ public class PKIXParameters implements CertPathParameters { /** * Sets the time for which the validity of the certification path - * should be determined. If null, the current time is used. + * should be determined. If {@code null}, the current time is used. *

      - * Note that the Date supplied here is copied to protect + * Note that the {@code Date} supplied here is copied to protect * against subsequent modifications. * - * @param date the Date, or null for the + * @param date the {@code Date}, or {@code null} for the * current time * @see #getDate */ @@ -507,39 +507,39 @@ public class PKIXParameters implements CertPathParameters { } /** - * Sets a List of additional certification path checkers. If - * the specified List contains an object that is not a - * PKIXCertPathChecker, it is ignored. + * Sets a {@code List} of additional certification path checkers. If + * the specified {@code List} contains an object that is not a + * {@code PKIXCertPathChecker}, it is ignored. *

      - * Each PKIXCertPathChecker specified implements + * Each {@code PKIXCertPathChecker} specified implements * additional checks on a certificate. Typically, these are checks to * process and verify private extensions contained in certificates. - * Each PKIXCertPathChecker should be instantiated with any + * Each {@code PKIXCertPathChecker} should be instantiated with any * initialization parameters needed to execute the check. *

      * This method allows sophisticated applications to extend a PKIX - * CertPathValidator or CertPathBuilder. - * Each of the specified PKIXCertPathCheckers will be called, - * in turn, by a PKIX CertPathValidator or - * CertPathBuilder for each certificate processed or + * {@code CertPathValidator} or {@code CertPathBuilder}. + * Each of the specified {@code PKIXCertPathChecker}s will be called, + * in turn, by a PKIX {@code CertPathValidator} or + * {@code CertPathBuilder} for each certificate processed or * validated. *

      - * Regardless of whether these additional PKIXCertPathCheckers - * are set, a PKIX CertPathValidator or - * CertPathBuilder must perform all of the required PKIX + * Regardless of whether these additional {@code PKIXCertPathChecker}s + * are set, a PKIX {@code CertPathValidator} or + * {@code CertPathBuilder} must perform all of the required PKIX * checks on each certificate. The one exception to this rule is if the * RevocationEnabled flag is set to false (see the {@link * #setRevocationEnabled setRevocationEnabled} method). *

      - * Note that the List supplied here is copied and each - * PKIXCertPathChecker in the list is cloned to protect + * Note that the {@code List} supplied here is copied and each + * {@code PKIXCertPathChecker} in the list is cloned to protect * against subsequent modifications. * - * @param checkers a List of PKIXCertPathCheckers. - * May be null, in which case no additional checkers will be + * @param checkers a {@code List} of {@code PKIXCertPathChecker}s. + * May be {@code null}, in which case no additional checkers will be * used. * @throws ClassCastException if any of the elements in the list - * are not of type java.security.cert.PKIXCertPathChecker + * are not of type {@code java.security.cert.PKIXCertPathChecker} * @see #getCertPathCheckers */ public void setCertPathCheckers(List checkers) { @@ -556,14 +556,14 @@ public class PKIXParameters implements CertPathParameters { } /** - * Returns the List of certification path checkers. - * The returned List is immutable, and each - * PKIXCertPathChecker in the List is cloned + * Returns the {@code List} of certification path checkers. + * The returned {@code List} is immutable, and each + * {@code PKIXCertPathChecker} in the {@code List} is cloned * to protect against subsequent modifications. * - * @return an immutable List of - * PKIXCertPathCheckers (may be empty, but not - * null) + * @return an immutable {@code List} of + * {@code PKIXCertPathChecker}s (may be empty, but not + * {@code null}) * @see #setCertPathCheckers */ public List getCertPathCheckers() { @@ -575,15 +575,15 @@ public class PKIXParameters implements CertPathParameters { } /** - * Adds a PKIXCertPathChecker to the list of certification + * Adds a {@code PKIXCertPathChecker} to the list of certification * path checkers. See the {@link #setCertPathCheckers setCertPathCheckers} * method for more details. *

      - * Note that the PKIXCertPathChecker is cloned to protect + * Note that the {@code PKIXCertPathChecker} is cloned to protect * against subsequent modifications. * - * @param checker a PKIXCertPathChecker to add to the list of - * checks. If null, the checker is ignored (not added to list). + * @param checker a {@code PKIXCertPathChecker} to add to the list of + * checks. If {@code null}, the checker is ignored (not added to list). */ public void addCertPathChecker(PKIXCertPathChecker checker) { if (checker != null) { @@ -592,10 +592,10 @@ public class PKIXParameters implements CertPathParameters { } /** - * Returns the signature provider's name, or null + * Returns the signature provider's name, or {@code null} * if not set. * - * @return the signature provider's name (or null) + * @return the signature provider's name (or {@code null}) * @see #setSigProvider */ public String getSigProvider() { @@ -605,10 +605,10 @@ public class PKIXParameters implements CertPathParameters { /** * Sets the signature provider's name. The specified provider will be * preferred when creating {@link java.security.Signature Signature} - * objects. If null or not set, the first provider found + * objects. If {@code null} or not set, the first provider found * supporting the algorithm will be used. * - * @param sigProvider the signature provider's name (or null) + * @param sigProvider the signature provider's name (or {@code null}) * @see #getSigProvider */ public void setSigProvider(String sigProvider) { @@ -617,14 +617,14 @@ public class PKIXParameters implements CertPathParameters { /** * Returns the required constraints on the target certificate. - * The constraints are returned as an instance of CertSelector. - * If null, no constraints are defined. + * The constraints are returned as an instance of {@code CertSelector}. + * If {@code null}, no constraints are defined. * - *

      Note that the CertSelector returned is cloned + *

      Note that the {@code CertSelector} returned is cloned * to protect against subsequent modifications. * - * @return a CertSelector specifying the constraints - * on the target certificate (or null) + * @return a {@code CertSelector} specifying the constraints + * on the target certificate (or {@code null}) * @see #setTargetCertConstraints */ public CertSelector getTargetCertConstraints() { @@ -638,14 +638,14 @@ public class PKIXParameters implements CertPathParameters { /** * Sets the required constraints on the target certificate. * The constraints are specified as an instance of - * CertSelector. If null, no constraints are + * {@code CertSelector}. If {@code null}, no constraints are * defined. * - *

      Note that the CertSelector specified is cloned + *

      Note that the {@code CertSelector} specified is cloned * to protect against subsequent modifications. * - * @param selector a CertSelector specifying the constraints - * on the target certificate (or null) + * @param selector a {@code CertSelector} specifying the constraints + * on the target certificate (or {@code null}) * @see #getTargetCertConstraints */ public void setTargetCertConstraints(CertSelector selector) { @@ -656,10 +656,10 @@ public class PKIXParameters implements CertPathParameters { } /** - * Makes a copy of this PKIXParameters object. Changes + * Makes a copy of this {@code PKIXParameters} object. Changes * to the copy will not affect the original and vice versa. * - * @return a copy of this PKIXParameters object + * @return a copy of this {@code PKIXParameters} object */ public Object clone() { try { diff --git a/jdk/src/share/classes/java/security/cert/PKIXReason.java b/jdk/src/share/classes/java/security/cert/PKIXReason.java index 9d81b132104..d58ded97541 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXReason.java +++ b/jdk/src/share/classes/java/security/cert/PKIXReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,10 @@ package java.security.cert; /** - * The PKIXReason enumerates the potential PKIX-specific reasons + * The {@code PKIXReason} enumerates the potential PKIX-specific reasons * that an X.509 certification path may be invalid according to the PKIX * (RFC 3280) standard. These reasons are in addition to those of the - * CertPathValidatorException.BasicReason enumeration. + * {@code CertPathValidatorException.BasicReason} enumeration. * * @since 1.7 */ diff --git a/jdk/src/share/classes/java/security/cert/PolicyNode.java b/jdk/src/share/classes/java/security/cert/PolicyNode.java index 7b16dfe8fbf..1633dcb83da 100644 --- a/jdk/src/share/classes/java/security/cert/PolicyNode.java +++ b/jdk/src/share/classes/java/security/cert/PolicyNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ import java.util.Set; * *

      Most applications will not need to examine the valid policy tree. * They can achieve their policy processing goals by setting the - * policy-related parameters in PKIXParameters. However, + * policy-related parameters in {@code PKIXParameters}. However, * the valid policy tree is available for more sophisticated applications, * especially those that process policy qualifiers. * @@ -50,12 +50,12 @@ import java.util.Set; * valid policy tree. The tree can be traversed using the * {@link #getChildren getChildren} and {@link #getParent getParent} methods. * Data about a particular node can be retrieved using other methods of - * PolicyNode. + * {@code PolicyNode}. * *

      Concurrent Access - *

      All PolicyNode objects must be immutable and + *

      All {@code PolicyNode} objects must be immutable and * thread-safe. Multiple threads may concurrently invoke the methods defined - * in this class on a single PolicyNode object (or more than one) + * in this class on a single {@code PolicyNode} object (or more than one) * with no ill effects. This stipulation applies to all public fields and * methods of this class and any added or overridden by subclasses. * @@ -65,10 +65,10 @@ import java.util.Set; public interface PolicyNode { /** - * Returns the parent of this node, or null if this is the + * Returns the parent of this node, or {@code null} if this is the * root node. * - * @return the parent of this node, or null if this is the + * @return the parent of this node, or {@code null} if this is the * root node */ PolicyNode getParent(); @@ -76,8 +76,8 @@ public interface PolicyNode { /** * Returns an iterator over the children of this node. Any attempts to * modify the children of this node through the - * Iterator's remove method must throw an - * UnsupportedOperationException. + * {@code Iterator}'s remove method must throw an + * {@code UnsupportedOperationException}. * * @return an iterator over the children of this node */ @@ -94,7 +94,7 @@ public interface PolicyNode { /** * Returns the valid policy represented by this node. * - * @return the String OID of the valid policy + * @return the {@code String} OID of the valid policy * represented by this node. For the root node, this method always returns * the special anyPolicy OID: "2.5.29.32.0". */ @@ -104,9 +104,9 @@ public interface PolicyNode { * Returns the set of policy qualifiers associated with the * valid policy represented by this node. * - * @return an immutable Set of - * PolicyQualifierInfos. For the root node, this - * is always an empty Set. + * @return an immutable {@code Set} of + * {@code PolicyQualifierInfo}s. For the root node, this + * is always an empty {@code Set}. */ Set getPolicyQualifiers(); @@ -114,9 +114,9 @@ public interface PolicyNode { * Returns the set of expected policies that would satisfy this * node's valid policy in the next certificate to be processed. * - * @return an immutable Set of expected policy - * String OIDs. For the root node, this method - * always returns a Set with one element, the + * @return an immutable {@code Set} of expected policy + * {@code String} OIDs. For the root node, this method + * always returns a {@code Set} with one element, the * special anyPolicy OID: "2.5.29.32.0". */ Set getExpectedPolicies(); @@ -125,8 +125,8 @@ public interface PolicyNode { * Returns the criticality indicator of the certificate policy extension * in the most recently processed certificate. * - * @return true if extension marked critical, - * false otherwise. For the root node, false + * @return {@code true} if extension marked critical, + * {@code false} otherwise. For the root node, {@code false} * is always returned. */ boolean isCritical(); diff --git a/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java b/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java index 75a8702ac84..bc083eb7a43 100644 --- a/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java +++ b/jdk/src/share/classes/java/security/cert/PolicyQualifierInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,12 +50,12 @@ import sun.security.util.DerValue; * policy information terms limit the set of policies for certification paths * which include this certificate. *

      - * A Set of PolicyQualifierInfo objects are returned + * A {@code Set} of {@code PolicyQualifierInfo} objects are returned * by the {@link PolicyNode#getPolicyQualifiers PolicyNode.getPolicyQualifiers} * method. This allows applications with specific policy requirements to * process and validate each policy qualifier. Applications that need to * process policy qualifiers should explicitly set the - * policyQualifiersRejected flag to false (by calling the + * {@code policyQualifiersRejected} flag to false (by calling the * {@link PKIXParameters#setPolicyQualifiersRejected * PKIXParameters.setPolicyQualifiersRejected} method) before validating * a certification path. @@ -64,17 +64,17 @@ import sun.security.util.DerValue; * that any policy qualifier in a certificate policies extension that is * marked critical must be processed and validated. Otherwise the * certification path must be rejected. If the - * policyQualifiersRejected flag is set to false, it is up to + * {@code policyQualifiersRejected} flag is set to false, it is up to * the application to validate all policy qualifiers in this manner in order * to be PKIX compliant. * *

      Concurrent Access * - *

      All PolicyQualifierInfo objects must be immutable and + *

      All {@code PolicyQualifierInfo} objects must be immutable and * thread-safe. That is, multiple threads may concurrently invoke the - * methods defined in this class on a single PolicyQualifierInfo + * methods defined in this class on a single {@code PolicyQualifierInfo} * object (or more than one) with no ill effects. Requiring - * PolicyQualifierInfo objects to be immutable and thread-safe + * {@code PolicyQualifierInfo} objects to be immutable and thread-safe * allows them to be passed around to various pieces of code without * worrying about coordinating access. * @@ -90,7 +90,7 @@ public class PolicyQualifierInfo { private String pqiString; /** - * Creates an instance of PolicyQualifierInfo from the + * Creates an instance of {@code PolicyQualifierInfo} from the * encoded bytes. The encoded byte array is copied on construction. * * @param encoded a byte array containing the qualifier in DER encoding @@ -115,12 +115,12 @@ public class PolicyQualifierInfo { } /** - * Returns the policyQualifierId field of this - * PolicyQualifierInfo. The policyQualifierId + * Returns the {@code policyQualifierId} field of this + * {@code PolicyQualifierInfo}. The {@code policyQualifierId} * is an Object Identifier (OID) represented by a set of nonnegative * integers separated by periods. * - * @return the OID (never null) + * @return the OID (never {@code null}) */ public final String getPolicyQualifierId() { return mId; @@ -128,9 +128,9 @@ public class PolicyQualifierInfo { /** * Returns the ASN.1 DER encoded form of this - * PolicyQualifierInfo. + * {@code PolicyQualifierInfo}. * - * @return the ASN.1 DER encoded bytes (never null). + * @return the ASN.1 DER encoded bytes (never {@code null}). * Note that a copy is returned, so the data is cloned each time * this method is called. */ @@ -139,10 +139,10 @@ public class PolicyQualifierInfo { } /** - * Returns the ASN.1 DER encoded form of the qualifier - * field of this PolicyQualifierInfo. + * Returns the ASN.1 DER encoded form of the {@code qualifier} + * field of this {@code PolicyQualifierInfo}. * - * @return the ASN.1 DER encoded bytes of the qualifier + * @return the ASN.1 DER encoded bytes of the {@code qualifier} * field. Note that a copy is returned, so the data is cloned each * time this method is called. */ @@ -152,10 +152,10 @@ public class PolicyQualifierInfo { /** * Return a printable representation of this - * PolicyQualifierInfo. + * {@code PolicyQualifierInfo}. * - * @return a String describing the contents of this - * PolicyQualifierInfo + * @return a {@code String} describing the contents of this + * {@code PolicyQualifierInfo} */ public String toString() { if (pqiString != null) diff --git a/jdk/src/share/classes/java/security/cert/TrustAnchor.java b/jdk/src/share/classes/java/security/cert/TrustAnchor.java index d9c88f405dc..fe267a52f66 100644 --- a/jdk/src/share/classes/java/security/cert/TrustAnchor.java +++ b/jdk/src/share/classes/java/security/cert/TrustAnchor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,16 +40,16 @@ import sun.security.x509.X500Name; * for validating X.509 certification paths. A most-trusted CA includes the * public key of the CA, the CA's name, and any constraints upon the set of * paths which may be validated using this key. These parameters can be - * specified in the form of a trusted X509Certificate or as + * specified in the form of a trusted {@code X509Certificate} or as * individual parameters. *

      * Concurrent Access *

      - *

      All TrustAnchor objects must be immutable and + *

      All {@code TrustAnchor} objects must be immutable and * thread-safe. That is, multiple threads may concurrently invoke the - * methods defined in this class on a single TrustAnchor + * methods defined in this class on a single {@code TrustAnchor} * object (or more than one) with no ill effects. Requiring - * TrustAnchor objects to be immutable and thread-safe + * {@code TrustAnchor} objects to be immutable and thread-safe * allows them to be passed around to various pieces of code without * worrying about coordinating access. This stipulation applies to all * public fields and methods of this class and any added or overridden @@ -71,8 +71,8 @@ public class TrustAnchor { private NameConstraintsExtension nc; /** - * Creates an instance of TrustAnchor with the specified - * X509Certificate and optional name constraints, which + * Creates an instance of {@code TrustAnchor} with the specified + * {@code X509Certificate} and optional name constraints, which * are intended to be used as additional constraints when validating * an X.509 certification path. *

      @@ -82,7 +82,7 @@ public class TrustAnchor { * RFC 3280 * and X.509. The ASN.1 definition of this structure appears below. * - *

      
      +     * 
      {@code
            *  NameConstraints ::= SEQUENCE {
            *       permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
            *       excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }
      @@ -106,20 +106,20 @@ public class TrustAnchor {
            *       uniformResourceIdentifier       [6]     IA5String,
            *       iPAddress                       [7]     OCTET STRING,
            *       registeredID                    [8]     OBJECT IDENTIFIER}
      -     * 
      + * }
      *

      * Note that the name constraints byte array supplied is cloned to protect * against subsequent modifications. * - * @param trustedCert a trusted X509Certificate + * @param trustedCert a trusted {@code X509Certificate} * @param nameConstraints a byte array containing the ASN.1 DER encoding of * a NameConstraints extension to be used for checking name constraints. * Only the value of the extension is included, not the OID or criticality - * flag. Specify null to omit the parameter. + * flag. Specify {@code null} to omit the parameter. * @throws IllegalArgumentException if the name constraints cannot be * decoded * @throws NullPointerException if the specified - * X509Certificate is null + * {@code X509Certificate} is {@code null} */ public TrustAnchor(X509Certificate trustedCert, byte[] nameConstraints) { @@ -134,7 +134,7 @@ public class TrustAnchor { } /** - * Creates an instance of TrustAnchor where the + * Creates an instance of {@code TrustAnchor} where the * most-trusted CA is specified as an X500Principal and public key. * Name constraints are an optional parameter, and are intended to be used * as additional constraints when validating an X.509 certification path. @@ -155,9 +155,9 @@ public class TrustAnchor { * @param nameConstraints a byte array containing the ASN.1 DER encoding of * a NameConstraints extension to be used for checking name constraints. * Only the value of the extension is included, not the OID or criticality - * flag. Specify null to omit the parameter. - * @throws NullPointerException if the specified caPrincipal or - * pubKey parameter is null + * flag. Specify {@code null} to omit the parameter. + * @throws NullPointerException if the specified {@code caPrincipal} or + * {@code pubKey} parameter is {@code null} * @since 1.5 */ public TrustAnchor(X500Principal caPrincipal, PublicKey pubKey, @@ -173,7 +173,7 @@ public class TrustAnchor { } /** - * Creates an instance of TrustAnchor where the + * Creates an instance of {@code TrustAnchor} where the * most-trusted CA is specified as a distinguished name and public key. * Name constraints are an optional parameter, and are intended to be used * as additional constraints when validating an X.509 certification path. @@ -191,17 +191,17 @@ public class TrustAnchor { * * @param caName the X.500 distinguished name of the most-trusted CA in * RFC 2253 - * String format + * {@code String} format * @param pubKey the public key of the most-trusted CA * @param nameConstraints a byte array containing the ASN.1 DER encoding of * a NameConstraints extension to be used for checking name constraints. * Only the value of the extension is included, not the OID or criticality - * flag. Specify null to omit the parameter. - * @throws IllegalArgumentException if the specified - * caName parameter is empty (caName.length() == 0) + * flag. Specify {@code null} to omit the parameter. + * @throws IllegalArgumentException if the specified + * {@code caName} parameter is empty {@code (caName.length() == 0)} * or incorrectly formatted or the name constraints cannot be decoded - * @throws NullPointerException if the specified caName or - * pubKey parameter is null + * @throws NullPointerException if the specified {@code caName} or + * {@code pubKey} parameter is {@code null} */ public TrustAnchor(String caName, PublicKey pubKey, byte[] nameConstraints) { @@ -225,7 +225,7 @@ public class TrustAnchor { /** * Returns the most-trusted CA certificate. * - * @return a trusted X509Certificate or null + * @return a trusted {@code X509Certificate} or {@code null} * if the trust anchor was not specified as a trusted certificate */ public final X509Certificate getTrustedCert() { @@ -236,7 +236,7 @@ public class TrustAnchor { * Returns the name of the most-trusted CA as an X500Principal. * * @return the X.500 distinguished name of the most-trusted CA, or - * null if the trust anchor was not specified as a trusted + * {@code null} if the trust anchor was not specified as a trusted * public key and name or X500Principal pair * @since 1.5 */ @@ -245,11 +245,11 @@ public class TrustAnchor { } /** - * Returns the name of the most-trusted CA in RFC 2253 String + * Returns the name of the most-trusted CA in RFC 2253 {@code String} * format. * * @return the X.500 distinguished name of the most-trusted CA, or - * null if the trust anchor was not specified as a trusted + * {@code null} if the trust anchor was not specified as a trusted * public key and name or X500Principal pair */ public final String getCAName() { @@ -259,7 +259,7 @@ public class TrustAnchor { /** * Returns the public key of the most-trusted CA. * - * @return the public key of the most-trusted CA, or null + * @return the public key of the most-trusted CA, or {@code null} * if the trust anchor was not specified as a trusted public key and name * or X500Principal pair */ @@ -306,16 +306,16 @@ public class TrustAnchor { * * @return a byte array containing the ASN.1 DER encoding of * a NameConstraints extension used for checking name constraints, - * or null if not set. + * or {@code null} if not set. */ public final byte [] getNameConstraints() { return ncBytes == null ? null : ncBytes.clone(); } /** - * Returns a formatted string describing the TrustAnchor. + * Returns a formatted string describing the {@code TrustAnchor}. * - * @return a formatted string describing the TrustAnchor + * @return a formatted string describing the {@code TrustAnchor} */ public String toString() { StringBuffer sb = new StringBuffer(); diff --git a/jdk/src/share/classes/java/security/cert/X509CRL.java b/jdk/src/share/classes/java/security/cert/X509CRL.java index cd1769f0724..5ce84847fa5 100644 --- a/jdk/src/share/classes/java/security/cert/X509CRL.java +++ b/jdk/src/share/classes/java/security/cert/X509CRL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,7 +72,7 @@ import sun.security.x509.X509CRLImpl; * RFC 3280: Internet X.509 * Public Key Infrastructure Certificate and CRL Profile. *

      - * The ASN.1 definition of tbsCertList is: + * The ASN.1 definition of {@code tbsCertList} is: *

        * TBSCertList  ::=  SEQUENCE  {
        *     version                 Version OPTIONAL,
      @@ -94,12 +94,12 @@ import sun.security.x509.X509CRLImpl;
        * 

      * CRLs are instantiated using a certificate factory. The following is an * example of how to instantiate an X.509 CRL: - *

      
      + * 
      {@code
        * try (InputStream inStream = new FileInputStream("fileName-of-crl")) {
        *     CertificateFactory cf = CertificateFactory.getInstance("X.509");
        *     X509CRL crl = (X509CRL)cf.generateCRL(inStream);
        * }
      - * 
      + * }
      * * @author Hemma Prafullchandra * @@ -122,8 +122,8 @@ public abstract class X509CRL extends CRL implements X509Extension { /** * Compares this CRL for equality with the given - * object. If the other object is an - * instanceof X509CRL, then + * object. If the {@code other} object is an + * {@code instanceof} {@code X509CRL}, then * its encoded form is retrieved and compared with the * encoded form of this CRL. * @@ -225,7 +225,7 @@ public abstract class X509CRL extends CRL implements X509Extension { * * This method was added to version 1.8 of the Java Platform Standard * Edition. In order to maintain backwards compatibility with existing - * service providers, this method is not abstract + * service providers, this method is not {@code abstract} * and it provides a default implementation. * * @param key the PublicKey used to carry out the verification. @@ -245,11 +245,12 @@ public abstract class X509CRL extends CRL implements X509Extension { } /** - * Gets the version (version number) value from the CRL. + * Gets the {@code version} (version number) value from the CRL. * The ASN.1 definition for this is: *
            * version    Version OPTIONAL,
      -     *             -- if present, must be v2

      + * -- if present, must be v2 + * * Version ::= INTEGER { v1(0), v2(1), v3(2) } * -- v3 does not apply to CRLs but appears for consistency * -- with definition of Version for certs @@ -261,12 +262,12 @@ public abstract class X509CRL extends CRL implements X509Extension { /** * Denigrated, replaced by {@linkplain - * #getIssuerX500Principal()}. This method returns the issuer + * #getIssuerX500Principal()}. This method returns the {@code issuer} * as an implementation specific Principal object, which should not be * relied upon by portable code. * *

      - * Gets the issuer (issuer distinguished name) value from + * Gets the {@code issuer} (issuer distinguished name) value from * the CRL. The issuer name identifies the entity that signed (and * issued) the CRL. * @@ -287,14 +288,14 @@ public abstract class X509CRL extends CRL implements X509Extension { * AttributeType ::= OBJECT IDENTIFIER * AttributeValue ::= ANY *

      - * The Name describes a hierarchical name composed of + * The {@code Name} describes a hierarchical name composed of * attributes, * such as country name, and corresponding values, such as US. - * The type of the AttributeValue component is determined by - * the AttributeType; in general it will be a - * directoryString. A directoryString is usually - * one of PrintableString, - * TeletexString or UniversalString. + * The type of the {@code AttributeValue} component is determined by + * the {@code AttributeType}; in general it will be a + * {@code directoryString}. A {@code directoryString} is usually + * one of {@code PrintableString}, + * {@code TeletexString} or {@code UniversalString}. * * @return a Principal whose name is the issuer distinguished name. */ @@ -302,11 +303,11 @@ public abstract class X509CRL extends CRL implements X509Extension { /** * Returns the issuer (issuer distinguished name) value from the - * CRL as an X500Principal. + * CRL as an {@code X500Principal}. *

      * It is recommended that subclasses override this method. * - * @return an X500Principal representing the issuer + * @return an {@code X500Principal} representing the issuer * distinguished name * @since 1.4 */ @@ -318,7 +319,7 @@ public abstract class X509CRL extends CRL implements X509Extension { } /** - * Gets the thisUpdate date from the CRL. + * Gets the {@code thisUpdate} date from the CRL. * The ASN.1 definition for this is: *

            * thisUpdate   ChoiceOfTime
      @@ -327,14 +328,14 @@ public abstract class X509CRL extends CRL implements X509Extension {
            *     generalTime    GeneralizedTime }
            * 
      * - * @return the thisUpdate date from the CRL. + * @return the {@code thisUpdate} date from the CRL. */ public abstract Date getThisUpdate(); /** - * Gets the nextUpdate date from the CRL. + * Gets the {@code nextUpdate} date from the CRL. * - * @return the nextUpdate date from the CRL, or null if + * @return the {@code nextUpdate} date from the CRL, or null if * not present. */ public abstract Date getNextUpdate(); @@ -388,7 +389,7 @@ public abstract class X509CRL extends CRL implements X509Extension { /** * Gets the DER-encoded CRL information, the - * tbsCertList from this CRL. + * {@code tbsCertList} from this CRL. * This can be used to verify the signature independently. * * @return the DER-encoded CRL information. @@ -397,7 +398,7 @@ public abstract class X509CRL extends CRL implements X509Extension { public abstract byte[] getTBSCertList() throws CRLException; /** - * Gets the signature value (the raw signature bits) from + * Gets the {@code signature} value (the raw signature bits) from * the CRL. * The ASN.1 definition for this is: *
      @@ -413,7 +414,8 @@ public abstract class X509CRL extends CRL implements X509Extension {
            * signature algorithm. An example is the string "SHA256withRSA".
            * The ASN.1 definition for this is:
            * 
      -     * signatureAlgorithm   AlgorithmIdentifier

      + * signatureAlgorithm AlgorithmIdentifier + * * AlgorithmIdentifier ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL } @@ -422,7 +424,7 @@ public abstract class X509CRL extends CRL implements X509Extension { * -- algorithm object identifier value *

      * - *

      The algorithm name is determined from the algorithm + *

      The algorithm name is determined from the {@code algorithm} * OID string. * * @return the signature algorithm name. diff --git a/jdk/src/share/classes/java/security/cert/X509CRLEntry.java b/jdk/src/share/classes/java/security/cert/X509CRLEntry.java index 517bbd2c03d..268fa819587 100644 --- a/jdk/src/share/classes/java/security/cert/X509CRLEntry.java +++ b/jdk/src/share/classes/java/security/cert/X509CRLEntry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,11 +43,11 @@ import sun.security.x509.X509CRLEntryImpl; * crlEntryExtensions Extensions OPTIONAL * -- if present, must be v2 * } OPTIONAL - *

      + * * CertificateSerialNumber ::= INTEGER - *

      + * * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension - *

      + * * Extension ::= SEQUENCE { * extnId OBJECT IDENTIFIER, * critical BOOLEAN DEFAULT FALSE, @@ -68,8 +68,8 @@ public abstract class X509CRLEntry implements X509Extension { /** * Compares this CRL entry for equality with the given - * object. If the other object is an - * instanceof X509CRLEntry, then + * object. If the {@code other} object is an + * {@code instanceof} {@code X509CRLEntry}, then * its encoded form (the inner SEQUENCE) is retrieved and compared * with the encoded form of this CRL entry. * @@ -178,7 +178,7 @@ public abstract class X509CRLEntry implements X509Extension { * in the Reason Code extension of this CRL entry. * * @return the reason the certificate has been revoked, or - * null if this CRL entry does not have + * {@code null} if this CRL entry does not have * a Reason Code extension * @since 1.7 */ diff --git a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java index 4258da39639..0580ee36bf2 100644 --- a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java +++ b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,18 +37,18 @@ import sun.security.x509.CRLNumberExtension; import sun.security.x509.X500Name; /** - * A CRLSelector that selects X509CRLs that + * A {@code CRLSelector} that selects {@code X509CRLs} that * match all specified criteria. This class is particularly useful when - * selecting CRLs from a CertStore to check revocation status + * selecting CRLs from a {@code CertStore} to check revocation status * of a particular certificate. *

      - * When first constructed, an X509CRLSelector has no criteria - * enabled and each of the get methods return a default - * value (null). Therefore, the {@link #match match} method - * would return true for any X509CRL. Typically, + * When first constructed, an {@code X509CRLSelector} has no criteria + * enabled and each of the {@code get} methods return a default + * value ({@code null}). Therefore, the {@link #match match} method + * would return {@code true} for any {@code X509CRL}. Typically, * several criteria are enabled (by calling {@link #setIssuers setIssuers} * or {@link #setDateAndTime setDateAndTime}, for instance) and then the - * X509CRLSelector is passed to + * {@code X509CRLSelector} is passed to * {@link CertStore#getCRLs CertStore.getCRLs} or some similar * method. *

      @@ -86,35 +86,35 @@ public class X509CRLSelector implements CRLSelector { private long skew = 0; /** - * Creates an X509CRLSelector. Initially, no criteria are set - * so any X509CRL will match. + * Creates an {@code X509CRLSelector}. Initially, no criteria are set + * so any {@code X509CRL} will match. */ public X509CRLSelector() {} /** * Sets the issuerNames criterion. The issuer distinguished name in the - * X509CRL must match at least one of the specified - * distinguished names. If null, any issuer distinguished name + * {@code X509CRL} must match at least one of the specified + * distinguished names. If {@code null}, any issuer distinguished name * will do. *

      * This method allows the caller to specify, with a single method call, - * the complete set of issuer names which X509CRLs may contain. + * the complete set of issuer names which {@code X509CRLs} may contain. * The specified value replaces the previous value for the issuerNames * criterion. *

      - * The names parameter (if not null) is a - * Collection of X500Principals. + * The {@code names} parameter (if not {@code null}) is a + * {@code Collection} of {@code X500Principal}s. *

      - * Note that the names parameter can contain duplicate + * Note that the {@code names} parameter can contain duplicate * distinguished names, but they may be removed from the - * Collection of names returned by the + * {@code Collection} of names returned by the * {@link #getIssuers getIssuers} method. *

      - * Note that a copy is performed on the Collection to + * Note that a copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @param issuers a Collection of X500Principals - * (or null) + * @param issuers a {@code Collection} of X500Principals + * (or {@code null}) * @see #getIssuers * @since 1.5 */ @@ -138,31 +138,31 @@ public class X509CRLSelector implements CRLSelector { * this method. See {@link #addIssuerName(String)} for more information. *

      * Sets the issuerNames criterion. The issuer distinguished name in the - * X509CRL must match at least one of the specified - * distinguished names. If null, any issuer distinguished name + * {@code X509CRL} must match at least one of the specified + * distinguished names. If {@code null}, any issuer distinguished name * will do. *

      * This method allows the caller to specify, with a single method call, - * the complete set of issuer names which X509CRLs may contain. + * the complete set of issuer names which {@code X509CRLs} may contain. * The specified value replaces the previous value for the issuerNames * criterion. *

      - * The names parameter (if not null) is a - * Collection of names. Each name is a String + * The {@code names} parameter (if not {@code null}) is a + * {@code Collection} of names. Each name is a {@code String} * or a byte array representing a distinguished name (in * RFC 2253 or - * ASN.1 DER encoded form, respectively). If null is supplied + * ASN.1 DER encoded form, respectively). If {@code null} is supplied * as the value for this argument, no issuerNames check will be performed. *

      - * Note that the names parameter can contain duplicate + * Note that the {@code names} parameter can contain duplicate * distinguished names, but they may be removed from the - * Collection of names returned by the + * {@code Collection} of names returned by the * {@link #getIssuerNames getIssuerNames} method. *

      * If a name is specified as a byte array, it should contain a single DER * encoded distinguished name, as defined in X.501. The ASN.1 notation for * this structure is as follows. - *

      
      +     * 
      {@code
            * Name ::= CHOICE {
            *   RDNSequence }
            *
      @@ -185,12 +185,12 @@ public class X509CRLSelector implements CRLSelector {
            *       universalString         UniversalString (SIZE (1..MAX)),
            *       utf8String              UTF8String (SIZE (1.. MAX)),
            *       bmpString               BMPString (SIZE (1..MAX)) }
      -     * 
      + * }
      *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @param names a Collection of names (or null) + * @param names a {@code Collection} of names (or {@code null}) * @throws IOException if a parsing error occurs * @see #getIssuerNames */ @@ -208,11 +208,11 @@ public class X509CRLSelector implements CRLSelector { /** * Adds a name to the issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified + * name in the {@code X509CRL} must match at least one of the specified * distinguished names. *

      * This method allows the caller to add a name to the set of issuer names - * which X509CRLs may contain. The specified name is added to + * which {@code X509CRLs} may contain. The specified name is added to * any previous value for the issuerNames criterion. * If the specified name is a duplicate, it may be ignored. * @@ -232,11 +232,11 @@ public class X509CRLSelector implements CRLSelector { * names. *

      * Adds a name to the issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified + * name in the {@code X509CRL} must match at least one of the specified * distinguished names. *

      * This method allows the caller to add a name to the set of issuer names - * which X509CRLs may contain. The specified name is added to + * which {@code X509CRLs} may contain. The specified name is added to * any previous value for the issuerNames criterion. * If the specified name is a duplicate, it may be ignored. * @@ -249,11 +249,11 @@ public class X509CRLSelector implements CRLSelector { /** * Adds a name to the issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified + * name in the {@code X509CRL} must match at least one of the specified * distinguished names. *

      * This method allows the caller to add a name to the set of issuer names - * which X509CRLs may contain. The specified name is added to + * which {@code X509CRLs} may contain. The specified name is added to * any previous value for the issuerNames criterion. If the specified name * is a duplicate, it may be ignored. * If a name is specified as a byte array, it should contain a single DER @@ -279,7 +279,7 @@ public class X509CRLSelector implements CRLSelector { /** * A private method that adds a name (String or byte array) to the * issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified + * name in the {@code X509CRL} must match at least one of the specified * distinguished names. * * @param name the name in string or byte array form @@ -301,11 +301,11 @@ public class X509CRLSelector implements CRLSelector { * Clone and check an argument of the form passed to * setIssuerNames. Throw an IOException if the argument is malformed. * - * @param names a Collection of names. Each entry is a + * @param names a {@code Collection} of names. Each entry is a * String or a byte array (the name, in string or ASN.1 - * DER encoded form, respectively). null is + * DER encoded form, respectively). {@code null} is * not an acceptable value. - * @return a deep copy of the specified Collection + * @return a deep copy of the specified {@code Collection} * @throws IOException if a parsing error occurs */ private static HashSet cloneAndCheckIssuerNames(Collection names) @@ -334,11 +334,11 @@ public class X509CRLSelector implements CRLSelector { * into a RuntimeException. This method should be used when the object being * cloned has already been checked, so there should never be any exceptions. * - * @param names a Collection of names. Each entry is a + * @param names a {@code Collection} of names. Each entry is a * String or a byte array (the name, in string or ASN.1 - * DER encoded form, respectively). null is + * DER encoded form, respectively). {@code null} is * not an acceptable value. - * @return a deep copy of the specified Collection + * @return a deep copy of the specified {@code Collection} * @throws RuntimeException if a parsing error occurs */ private static HashSet cloneIssuerNames(Collection names) { @@ -354,7 +354,7 @@ public class X509CRLSelector implements CRLSelector { * returning a Collection of issuerX500Principals. * Throw an IOException if the argument is malformed. * - * @param names a Collection of names. Each entry is a + * @param names a {@code Collection} of names. Each entry is a * String or a byte array (the name, in string or ASN.1 * DER encoded form, respectively). Null is * not an acceptable value. @@ -380,24 +380,24 @@ public class X509CRLSelector implements CRLSelector { } /** - * Sets the minCRLNumber criterion. The X509CRL must have a + * Sets the minCRLNumber criterion. The {@code X509CRL} must have a * CRL number extension whose value is greater than or equal to the - * specified value. If null, no minCRLNumber check will be + * specified value. If {@code null}, no minCRLNumber check will be * done. * - * @param minCRL the minimum CRL number accepted (or null) + * @param minCRL the minimum CRL number accepted (or {@code null}) */ public void setMinCRLNumber(BigInteger minCRL) { this.minCRL = minCRL; } /** - * Sets the maxCRLNumber criterion. The X509CRL must have a + * Sets the maxCRLNumber criterion. The {@code X509CRL} must have a * CRL number extension whose value is less than or equal to the - * specified value. If null, no maxCRLNumber check will be + * specified value. If {@code null}, no maxCRLNumber check will be * done. * - * @param maxCRL the maximum CRL number accepted (or null) + * @param maxCRL the maximum CRL number accepted (or {@code null}) */ public void setMaxCRLNumber(BigInteger maxCRL) { this.maxCRL = maxCRL; @@ -406,16 +406,16 @@ public class X509CRLSelector implements CRLSelector { /** * Sets the dateAndTime criterion. The specified date must be * equal to or later than the value of the thisUpdate component - * of the X509CRL and earlier than the value of the - * nextUpdate component. There is no match if the X509CRL + * of the {@code X509CRL} and earlier than the value of the + * nextUpdate component. There is no match if the {@code X509CRL} * does not contain a nextUpdate component. - * If null, no dateAndTime check will be done. + * If {@code null}, no dateAndTime check will be done. *

      - * Note that the Date supplied here is cloned to protect + * Note that the {@code Date} supplied here is cloned to protect * against subsequent modifications. * - * @param dateAndTime the Date to match against - * (or null) + * @param dateAndTime the {@code Date} to match against + * (or {@code null}) * @see #getDateAndTime */ public void setDateAndTime(Date dateAndTime) { @@ -438,13 +438,13 @@ public class X509CRLSelector implements CRLSelector { /** * Sets the certificate being checked. This is not a criterion. Rather, - * it is optional information that may help a CertStore + * it is optional information that may help a {@code CertStore} * find CRLs that would be relevant when checking revocation for the - * specified certificate. If null is specified, then no + * specified certificate. If {@code null} is specified, then no * such optional information is provided. * - * @param cert the X509Certificate being checked - * (or null) + * @param cert the {@code X509Certificate} being checked + * (or {@code null}) * @see #getCertificateChecking */ public void setCertificateChecking(X509Certificate cert) { @@ -453,15 +453,15 @@ public class X509CRLSelector implements CRLSelector { /** * Returns the issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified - * distinguished names. If the value returned is null, any + * name in the {@code X509CRL} must match at least one of the specified + * distinguished names. If the value returned is {@code null}, any * issuer distinguished name will do. *

      - * If the value returned is not null, it is a - * unmodifiable Collection of X500Principals. + * If the value returned is not {@code null}, it is a + * unmodifiable {@code Collection} of {@code X500Principal}s. * - * @return an unmodifiable Collection of names - * (or null) + * @return an unmodifiable {@code Collection} of names + * (or {@code null}) * @see #setIssuers * @since 1.5 */ @@ -474,25 +474,25 @@ public class X509CRLSelector implements CRLSelector { /** * Returns a copy of the issuerNames criterion. The issuer distinguished - * name in the X509CRL must match at least one of the specified - * distinguished names. If the value returned is null, any + * name in the {@code X509CRL} must match at least one of the specified + * distinguished names. If the value returned is {@code null}, any * issuer distinguished name will do. *

      - * If the value returned is not null, it is a - * Collection of names. Each name is a String + * If the value returned is not {@code null}, it is a + * {@code Collection} of names. Each name is a {@code String} * or a byte array representing a distinguished name (in RFC 2253 or * ASN.1 DER encoded form, respectively). Note that the - * Collection returned may contain duplicate names. + * {@code Collection} returned may contain duplicate names. *

      * If a name is specified as a byte array, it should contain a single DER * encoded distinguished name, as defined in X.501. The ASN.1 notation for * this structure is given in the documentation for * {@link #setIssuerNames setIssuerNames(Collection names)}. *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @return a Collection of names (or null) + * @return a {@code Collection} of names (or {@code null}) * @see #setIssuerNames */ public Collection getIssuerNames() { @@ -503,23 +503,23 @@ public class X509CRLSelector implements CRLSelector { } /** - * Returns the minCRLNumber criterion. The X509CRL must have a + * Returns the minCRLNumber criterion. The {@code X509CRL} must have a * CRL number extension whose value is greater than or equal to the - * specified value. If null, no minCRLNumber check will be done. + * specified value. If {@code null}, no minCRLNumber check will be done. * - * @return the minimum CRL number accepted (or null) + * @return the minimum CRL number accepted (or {@code null}) */ public BigInteger getMinCRL() { return minCRL; } /** - * Returns the maxCRLNumber criterion. The X509CRL must have a + * Returns the maxCRLNumber criterion. The {@code X509CRL} must have a * CRL number extension whose value is less than or equal to the - * specified value. If null, no maxCRLNumber check will be + * specified value. If {@code null}, no maxCRLNumber check will be * done. * - * @return the maximum CRL number accepted (or null) + * @return the maximum CRL number accepted (or {@code null}) */ public BigInteger getMaxCRL() { return maxCRL; @@ -528,15 +528,15 @@ public class X509CRLSelector implements CRLSelector { /** * Returns the dateAndTime criterion. The specified date must be * equal to or later than the value of the thisUpdate component - * of the X509CRL and earlier than the value of the + * of the {@code X509CRL} and earlier than the value of the * nextUpdate component. There is no match if the - * X509CRL does not contain a nextUpdate component. - * If null, no dateAndTime check will be done. + * {@code X509CRL} does not contain a nextUpdate component. + * If {@code null}, no dateAndTime check will be done. *

      - * Note that the Date returned is cloned to protect against + * Note that the {@code Date} returned is cloned to protect against * subsequent modifications. * - * @return the Date to match against (or null) + * @return the {@code Date} to match against (or {@code null}) * @see #setDateAndTime */ public Date getDateAndTime() { @@ -547,12 +547,12 @@ public class X509CRLSelector implements CRLSelector { /** * Returns the certificate being checked. This is not a criterion. Rather, - * it is optional information that may help a CertStore + * it is optional information that may help a {@code CertStore} * find CRLs that would be relevant when checking revocation for the - * specified certificate. If the value returned is null, then + * specified certificate. If the value returned is {@code null}, then * no such optional information is provided. * - * @return the certificate being checked (or null) + * @return the certificate being checked (or {@code null}) * @see #setCertificateChecking */ public X509Certificate getCertificateChecking() { @@ -560,10 +560,10 @@ public class X509CRLSelector implements CRLSelector { } /** - * Returns a printable representation of the X509CRLSelector. + * Returns a printable representation of the {@code X509CRLSelector}. * - * @return a String describing the contents of the - * X509CRLSelector. + * @return a {@code String} describing the contents of the + * {@code X509CRLSelector}. */ public String toString() { StringBuffer sb = new StringBuffer(); @@ -587,11 +587,11 @@ public class X509CRLSelector implements CRLSelector { } /** - * Decides whether a CRL should be selected. + * Decides whether a {@code CRL} should be selected. * - * @param crl the CRL to be checked - * @return true if the CRL should be selected, - * false otherwise + * @param crl the {@code CRL} to be checked + * @return {@code true} if the {@code CRL} should be selected, + * {@code false} otherwise */ public boolean match(CRL crl) { if (!(crl instanceof X509CRL)) { diff --git a/jdk/src/share/classes/java/security/cert/X509CertSelector.java b/jdk/src/share/classes/java/security/cert/X509CertSelector.java index 19ca2cb515d..e44dba125e4 100644 --- a/jdk/src/share/classes/java/security/cert/X509CertSelector.java +++ b/jdk/src/share/classes/java/security/cert/X509CertSelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,27 +39,27 @@ import sun.security.util.ObjectIdentifier; import sun.security.x509.*; /** - * A CertSelector that selects X509Certificates that + * A {@code CertSelector} that selects {@code X509Certificates} that * match all specified criteria. This class is particularly useful when - * selecting certificates from a CertStore to build a + * selecting certificates from a {@code CertStore} to build a * PKIX-compliant certification path. *

      - * When first constructed, an X509CertSelector has no criteria - * enabled and each of the get methods return a default value - * (null, or -1 for the {@link #getBasicConstraints + * When first constructed, an {@code X509CertSelector} has no criteria + * enabled and each of the {@code get} methods return a default value + * ({@code null}, or {@code -1} for the {@link #getBasicConstraints * getBasicConstraints} method). Therefore, the {@link #match match} - * method would return true for any X509Certificate. + * method would return {@code true} for any {@code X509Certificate}. * Typically, several criteria are enabled (by calling * {@link #setIssuer setIssuer} or * {@link #setKeyUsage setKeyUsage}, for instance) and then the - * X509CertSelector is passed to + * {@code X509CertSelector} is passed to * {@link CertStore#getCertificates CertStore.getCertificates} or some similar * method. *

      * Several criteria can be enabled (by calling {@link #setIssuer setIssuer} * and {@link #setSerialNumber setSerialNumber}, - * for example) such that the match method - * usually uniquely matches a single X509Certificate. We say + * for example) such that the {@code match} method + * usually uniquely matches a single {@code X509Certificate}. We say * usually, since it is possible for two issuing CAs to have the same * distinguished name and each issue a certificate with the same serial * number. Other unique combinations include the issuer, subject, @@ -149,8 +149,8 @@ public class X509CertSelector implements CertSelector { static final int NAME_OID = 8; /** - * Creates an X509CertSelector. Initially, no criteria are set - * so any X509Certificate will match. + * Creates an {@code X509CertSelector}. Initially, no criteria are set + * so any {@code X509Certificate} will match. */ public X509CertSelector() { // empty @@ -158,17 +158,17 @@ public class X509CertSelector implements CertSelector { /** * Sets the certificateEquals criterion. The specified - * X509Certificate must be equal to the - * X509Certificate passed to the match method. - * If null, then this check is not applied. + * {@code X509Certificate} must be equal to the + * {@code X509Certificate} passed to the {@code match} method. + * If {@code null}, then this check is not applied. * *

      This method is particularly useful when it is necessary to * match a single certificate. Although other criteria can be specified * in conjunction with the certificateEquals criterion, it is usually not * practical or necessary. * - * @param cert the X509Certificate to match (or - * null) + * @param cert the {@code X509Certificate} to match (or + * {@code null}) * @see #getCertificate */ public void setCertificate(X509Certificate cert) { @@ -178,11 +178,11 @@ public class X509CertSelector implements CertSelector { /** * Sets the serialNumber criterion. The specified serial number * must match the certificate serial number in the - * X509Certificate. If null, any certificate + * {@code X509Certificate}. If {@code null}, any certificate * serial number will do. * * @param serial the certificate serial number to match - * (or null) + * (or {@code null}) * @see #getSerialNumber */ public void setSerialNumber(BigInteger serial) { @@ -192,11 +192,11 @@ public class X509CertSelector implements CertSelector { /** * Sets the issuer criterion. The specified distinguished name * must match the issuer distinguished name in the - * X509Certificate. If null, any issuer + * {@code X509Certificate}. If {@code null}, any issuer * distinguished name will do. * * @param issuer a distinguished name as X500Principal - * (or null) + * (or {@code null}) * @since 1.5 */ public void setIssuer(X500Principal issuer) { @@ -213,14 +213,14 @@ public class X509CertSelector implements CertSelector { *

      * Sets the issuer criterion. The specified distinguished name * must match the issuer distinguished name in the - * X509Certificate. If null, any issuer + * {@code X509Certificate}. If {@code null}, any issuer * distinguished name will do. *

      - * If issuerDN is not null, it should contain a + * If {@code issuerDN} is not {@code null}, it should contain a * distinguished name, in RFC 2253 format. * * @param issuerDN a distinguished name in RFC 2253 format - * (or null) + * (or {@code null}) * @throws IOException if a parsing error occurs (incorrect form for DN) */ public void setIssuer(String issuerDN) throws IOException { @@ -234,14 +234,14 @@ public class X509CertSelector implements CertSelector { /** * Sets the issuer criterion. The specified distinguished name * must match the issuer distinguished name in the - * X509Certificate. If null is specified, + * {@code X509Certificate}. If {@code null} is specified, * the issuer criterion is disabled and any issuer distinguished name will * do. *

      - * If issuerDN is not null, it should contain a + * If {@code issuerDN} is not {@code null}, it should contain a * single DER encoded distinguished name, as defined in X.501. The ASN.1 * notation for this structure is as follows. - *

      
      +     * 
      {@code
            * Name ::= CHOICE {
            *   RDNSequence }
            *
      @@ -264,13 +264,13 @@ public class X509CertSelector implements CertSelector {
            *       universalString         UniversalString (SIZE (1..MAX)),
            *       utf8String              UTF8String (SIZE (1.. MAX)),
            *       bmpString               BMPString (SIZE (1..MAX)) }
      -     * 
      + * }
      *

      * Note that the byte array specified here is cloned to protect against * subsequent modifications. * * @param issuerDN a byte array containing the distinguished name - * in ASN.1 DER encoded form (or null) + * in ASN.1 DER encoded form (or {@code null}) * @throws IOException if an encoding error occurs (incorrect form for DN) */ public void setIssuer(byte[] issuerDN) throws IOException { @@ -284,11 +284,11 @@ public class X509CertSelector implements CertSelector { /** * Sets the subject criterion. The specified distinguished name * must match the subject distinguished name in the - * X509Certificate. If null, any subject + * {@code X509Certificate}. If {@code null}, any subject * distinguished name will do. * * @param subject a distinguished name as X500Principal - * (or null) + * (or {@code null}) * @since 1.5 */ public void setSubject(X500Principal subject) { @@ -304,14 +304,14 @@ public class X509CertSelector implements CertSelector { *

      * Sets the subject criterion. The specified distinguished name * must match the subject distinguished name in the - * X509Certificate. If null, any subject + * {@code X509Certificate}. If {@code null}, any subject * distinguished name will do. *

      - * If subjectDN is not null, it should contain a + * If {@code subjectDN} is not {@code null}, it should contain a * distinguished name, in RFC 2253 format. * * @param subjectDN a distinguished name in RFC 2253 format - * (or null) + * (or {@code null}) * @throws IOException if a parsing error occurs (incorrect form for DN) */ public void setSubject(String subjectDN) throws IOException { @@ -325,16 +325,16 @@ public class X509CertSelector implements CertSelector { /** * Sets the subject criterion. The specified distinguished name * must match the subject distinguished name in the - * X509Certificate. If null, any subject + * {@code X509Certificate}. If {@code null}, any subject * distinguished name will do. *

      - * If subjectDN is not null, it should contain a + * If {@code subjectDN} is not {@code null}, it should contain a * single DER encoded distinguished name, as defined in X.501. For the ASN.1 * notation for this structure, see * {@link #setIssuer(byte [] issuerDN) setIssuer(byte [] issuerDN)}. * * @param subjectDN a byte array containing the distinguished name in - * ASN.1 DER format (or null) + * ASN.1 DER format (or {@code null}) * @throws IOException if an encoding error occurs (incorrect form for DN) */ public void setSubject(byte[] subjectDN) throws IOException { @@ -347,34 +347,34 @@ public class X509CertSelector implements CertSelector { /** * Sets the subjectKeyIdentifier criterion. The - * X509Certificate must contain a SubjectKeyIdentifier + * {@code X509Certificate} must contain a SubjectKeyIdentifier * extension for which the contents of the extension * matches the specified criterion value. - * If the criterion value is null, no + * If the criterion value is {@code null}, no * subjectKeyIdentifier check will be done. *

      - * If subjectKeyID is not null, it + * If {@code subjectKeyID} is not {@code null}, it * should contain a single DER encoded value corresponding to the contents * of the extension value (not including the object identifier, * criticality setting, and encapsulating OCTET STRING) * for a SubjectKeyIdentifier extension. * The ASN.1 notation for this structure follows. *

      - *

      
      +     * 
      {@code
            * SubjectKeyIdentifier ::= KeyIdentifier
            *
            * KeyIdentifier ::= OCTET STRING
      -     * 
      + * }
      *

      * Since the format of subject key identifiers is not mandated by * any standard, subject key identifiers are not parsed by the - * X509CertSelector. Instead, the values are compared using + * {@code X509CertSelector}. Instead, the values are compared using * a byte-by-byte comparison. *

      * Note that the byte array supplied here is cloned to protect against * subsequent modifications. * - * @param subjectKeyID the subject key identifier (or null) + * @param subjectKeyID the subject key identifier (or {@code null}) * @see #getSubjectKeyIdentifier */ public void setSubjectKeyIdentifier(byte[] subjectKeyID) { @@ -387,46 +387,46 @@ public class X509CertSelector implements CertSelector { /** * Sets the authorityKeyIdentifier criterion. The - * X509Certificate must contain an + * {@code X509Certificate} must contain an * AuthorityKeyIdentifier extension for which the contents of the * extension value matches the specified criterion value. - * If the criterion value is null, no + * If the criterion value is {@code null}, no * authorityKeyIdentifier check will be done. *

      - * If authorityKeyID is not null, it + * If {@code authorityKeyID} is not {@code null}, it * should contain a single DER encoded value corresponding to the contents * of the extension value (not including the object identifier, * criticality setting, and encapsulating OCTET STRING) * for an AuthorityKeyIdentifier extension. * The ASN.1 notation for this structure follows. *

      - *

      
      +     * 
      {@code
            * AuthorityKeyIdentifier ::= SEQUENCE {
            *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
            *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
            *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
            *
            * KeyIdentifier ::= OCTET STRING
      -     * 
      + * }
      *

      * Authority key identifiers are not parsed by the - * X509CertSelector. Instead, the values are + * {@code X509CertSelector}. Instead, the values are * compared using a byte-by-byte comparison. *

      - * When the keyIdentifier field of - * AuthorityKeyIdentifier is populated, the value is - * usually taken from the SubjectKeyIdentifier extension + * When the {@code keyIdentifier} field of + * {@code AuthorityKeyIdentifier} is populated, the value is + * usually taken from the {@code SubjectKeyIdentifier} extension * in the issuer's certificate. Note, however, that the result of - * X509Certificate.getExtensionValue(<SubjectKeyIdentifier Object - * Identifier>) on the issuer's certificate may NOT be used - * directly as the input to setAuthorityKeyIdentifier. + * {@code X509Certificate.getExtensionValue()} on the issuer's certificate may NOT be used + * directly as the input to {@code setAuthorityKeyIdentifier}. * This is because the SubjectKeyIdentifier contains * only a KeyIdentifier OCTET STRING, and not a SEQUENCE of * KeyIdentifier, GeneralNames, and CertificateSerialNumber. * In order to use the extension value of the issuer certificate's - * SubjectKeyIdentifier + * {@code SubjectKeyIdentifier} * extension, it will be necessary to extract the value of the embedded - * KeyIdentifier OCTET STRING, then DER encode this OCTET + * {@code KeyIdentifier} OCTET STRING, then DER encode this OCTET * STRING inside a SEQUENCE. * For more details on SubjectKeyIdentifier, see * {@link #setSubjectKeyIdentifier(byte[] subjectKeyID)}. @@ -435,7 +435,7 @@ public class X509CertSelector implements CertSelector { * subsequent modifications. * * @param authorityKeyID the authority key identifier - * (or null) + * (or {@code null}) * @see #getAuthorityKeyIdentifier */ public void setAuthorityKeyIdentifier(byte[] authorityKeyID) { @@ -449,13 +449,13 @@ public class X509CertSelector implements CertSelector { /** * Sets the certificateValid criterion. The specified date must fall * within the certificate validity period for the - * X509Certificate. If null, no certificateValid + * {@code X509Certificate}. If {@code null}, no certificateValid * check will be done. *

      - * Note that the Date supplied here is cloned to protect + * Note that the {@code Date} supplied here is cloned to protect * against subsequent modifications. * - * @param certValid the Date to check (or null) + * @param certValid the {@code Date} to check (or {@code null}) * @see #getCertificateValid */ public void setCertificateValid(Date certValid) { @@ -469,14 +469,14 @@ public class X509CertSelector implements CertSelector { /** * Sets the privateKeyValid criterion. The specified date must fall * within the private key validity period for the - * X509Certificate. If null, no privateKeyValid + * {@code X509Certificate}. If {@code null}, no privateKeyValid * check will be done. *

      - * Note that the Date supplied here is cloned to protect + * Note that the {@code Date} supplied here is cloned to protect * against subsequent modifications. * - * @param privateKeyValid the Date to check (or - * null) + * @param privateKeyValid the {@code Date} to check (or + * {@code null}) * @see #getPrivateKeyValid */ public void setPrivateKeyValid(Date privateKeyValid) { @@ -489,12 +489,12 @@ public class X509CertSelector implements CertSelector { /** * Sets the subjectPublicKeyAlgID criterion. The - * X509Certificate must contain a subject public key - * with the specified algorithm. If null, no + * {@code X509Certificate} must contain a subject public key + * with the specified algorithm. If {@code null}, no * subjectPublicKeyAlgID check will be done. * * @param oid The object identifier (OID) of the algorithm to check - * for (or null). An OID is represented by a + * for (or {@code null}). An OID is represented by a * set of nonnegative integers separated by periods. * @throws IOException if the OID is invalid, such as * the first component being not 0, 1 or 2 or the second component @@ -512,10 +512,10 @@ public class X509CertSelector implements CertSelector { /** * Sets the subjectPublicKey criterion. The - * X509Certificate must contain the specified subject public - * key. If null, no subjectPublicKey check will be done. + * {@code X509Certificate} must contain the specified subject public + * key. If {@code null}, no subjectPublicKey check will be done. * - * @param key the subject public key to check for (or null) + * @param key the subject public key to check for (or {@code null}) * @see #getSubjectPublicKey */ public void setSubjectPublicKey(PublicKey key) { @@ -529,17 +529,17 @@ public class X509CertSelector implements CertSelector { } /** - * Sets the subjectPublicKey criterion. The X509Certificate - * must contain the specified subject public key. If null, + * Sets the subjectPublicKey criterion. The {@code X509Certificate} + * must contain the specified subject public key. If {@code null}, * no subjectPublicKey check will be done. *

      * Because this method allows the public key to be specified as a byte * array, it may be used for unknown key types. *

      - * If key is not null, it should contain a + * If {@code key} is not {@code null}, it should contain a * single DER encoded SubjectPublicKeyInfo structure, as defined in X.509. * The ASN.1 notation for this structure is as follows. - *

      
      +     * 
      {@code
            * SubjectPublicKeyInfo  ::=  SEQUENCE  {
            *   algorithm            AlgorithmIdentifier,
            *   subjectPublicKey     BIT STRING  }
      @@ -550,13 +550,13 @@ public class X509CertSelector implements CertSelector {
            *                              -- contains a value of the type
            *                              -- registered for use with the
            *                              -- algorithm object identifier value
      -     * 
      + * }
      *

      * Note that the byte array supplied here is cloned to protect against * subsequent modifications. * * @param key a byte array containing the subject public key in ASN.1 DER - * form (or null) + * form (or {@code null}) * @throws IOException if an encoding error occurs (incorrect form for * subject public key) * @see #getSubjectPublicKey @@ -572,9 +572,9 @@ public class X509CertSelector implements CertSelector { } /** - * Sets the keyUsage criterion. The X509Certificate - * must allow the specified keyUsage values. If null, no - * keyUsage check will be done. Note that an X509Certificate + * Sets the keyUsage criterion. The {@code X509Certificate} + * must allow the specified keyUsage values. If {@code null}, no + * keyUsage check will be done. Note that an {@code X509Certificate} * that has no keyUsage extension implicitly allows all keyUsage values. *

      * Note that the boolean array supplied here is cloned to protect against @@ -583,7 +583,7 @@ public class X509CertSelector implements CertSelector { * @param keyUsage a boolean array in the same format as the boolean * array returned by * {@link X509Certificate#getKeyUsage() X509Certificate.getKeyUsage()}. - * Or null. + * Or {@code null}. * @see #getKeyUsage */ public void setKeyUsage(boolean[] keyUsage) { @@ -595,18 +595,18 @@ public class X509CertSelector implements CertSelector { } /** - * Sets the extendedKeyUsage criterion. The X509Certificate + * Sets the extendedKeyUsage criterion. The {@code X509Certificate} * must allow the specified key purposes in its extended key usage - * extension. If keyPurposeSet is empty or null, + * extension. If {@code keyPurposeSet} is empty or {@code null}, * no extendedKeyUsage check will be done. Note that an - * X509Certificate that has no extendedKeyUsage extension + * {@code X509Certificate} that has no extendedKeyUsage extension * implicitly allows all key purposes. *

      - * Note that the Set is cloned to protect against + * Note that the {@code Set} is cloned to protect against * subsequent modifications. * - * @param keyPurposeSet a Set of key purpose OIDs in string - * format (or null). Each OID is represented by a set of + * @param keyPurposeSet a {@code Set} of key purpose OIDs in string + * format (or {@code null}). Each OID is represented by a set of * nonnegative integers separated by periods. * @throws IOException if the OID is invalid, such as * the first component being not 0, 1 or 2 or the second component @@ -632,15 +632,15 @@ public class X509CertSelector implements CertSelector { * specified in the {@link #setSubjectAlternativeNames * setSubjectAlternativeNames} or {@link #addSubjectAlternativeName * addSubjectAlternativeName} methods. If enabled, - * the X509Certificate must contain all of the + * the {@code X509Certificate} must contain all of the * specified subject alternative names. If disabled, the - * X509Certificate must contain at least one of the + * {@code X509Certificate} must contain at least one of the * specified subject alternative names. * - *

      The matchAllNames flag is true by default. + *

      The matchAllNames flag is {@code true} by default. * - * @param matchAllNames if true, the flag is enabled; - * if false, the flag is disabled. + * @param matchAllNames if {@code true}, the flag is enabled; + * if {@code false}, the flag is disabled. * @see #getMatchAllSubjectAltNames */ public void setMatchAllSubjectAltNames(boolean matchAllNames) { @@ -649,7 +649,7 @@ public class X509CertSelector implements CertSelector { /** * Sets the subjectAlternativeNames criterion. The - * X509Certificate must contain all or at least one of the + * {@code X509Certificate} must contain all or at least one of the * specified subjectAlternativeNames, depending on the value of * the matchAllNames flag (see {@link #setMatchAllSubjectAltNames * setMatchAllSubjectAltNames}). @@ -659,19 +659,19 @@ public class X509CertSelector implements CertSelector { * subjectAlternativeNames criterion. The specified value replaces * the previous value for the subjectAlternativeNames criterion. *

      - * The names parameter (if not null) is a - * Collection with one + * The {@code names} parameter (if not {@code null}) is a + * {@code Collection} with one * entry for each name to be included in the subject alternative name - * criterion. Each entry is a List whose first entry is an - * Integer (the name type, 0-8) and whose second - * entry is a String or a byte array (the name, in + * criterion. Each entry is a {@code List} whose first entry is an + * {@code Integer} (the name type, 0-8) and whose second + * entry is a {@code String} or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). - * There can be multiple names of the same type. If null + * There can be multiple names of the same type. If {@code null} * is supplied as the value for this argument, no * subjectAlternativeNames check will be performed. *

      - * Each subject alternative name in the Collection - * may be specified either as a String or as an ASN.1 encoded + * Each subject alternative name in the {@code Collection} + * may be specified either as a {@code String} or as an ASN.1 encoded * byte array. For more details about the formats used, see * {@link #addSubjectAlternativeName(int type, String name) * addSubjectAlternativeName(int type, String name)} and @@ -682,15 +682,15 @@ public class X509CertSelector implements CertSelector { * array form instead of the String form. See the note in * {@link #addSubjectAlternativeName(int, String)} for more information. *

      - * Note that the names parameter can contain duplicate + * Note that the {@code names} parameter can contain duplicate * names (same name and name type), but they may be removed from the - * Collection of names returned by the + * {@code Collection} of names returned by the * {@link #getSubjectAlternativeNames getSubjectAlternativeNames} method. *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @param names a Collection of names (or null) + * @param names a {@code Collection} of names (or {@code null}) * @throws IOException if a parsing error occurs * @see #getSubjectAlternativeNames */ @@ -714,7 +714,7 @@ public class X509CertSelector implements CertSelector { /** * Adds a name to the subjectAlternativeNames criterion. The - * X509Certificate must contain all or at least one + * {@code X509Certificate} must contain all or at least one * of the specified subjectAlternativeNames, depending on the value of * the matchAllNames flag (see {@link #setMatchAllSubjectAltNames * setMatchAllSubjectAltNames}). @@ -747,7 +747,7 @@ public class X509CertSelector implements CertSelector { * * @param type the name type (0-8, as specified in * RFC 3280, section 4.2.1.7) - * @param name the name in string form (not null) + * @param name the name in string form (not {@code null}) * @throws IOException if a parsing error occurs */ public void addSubjectAlternativeName(int type, String name) @@ -757,7 +757,7 @@ public class X509CertSelector implements CertSelector { /** * Adds a name to the subjectAlternativeNames criterion. The - * X509Certificate must contain all or at least one + * {@code X509Certificate} must contain all or at least one * of the specified subjectAlternativeNames, depending on the value of * the matchAllNames flag (see {@link #setMatchAllSubjectAltNames * setMatchAllSubjectAltNames}). @@ -774,7 +774,7 @@ public class X509CertSelector implements CertSelector { * the encoded value of the name, and should not include the tag associated * with the name in the GeneralName structure. The ASN.1 definition of this * structure appears below. - *

      
      +     * 
      {@code
            *  GeneralName ::= CHOICE {
            *       otherName                       [0]     OtherName,
            *       rfc822Name                      [1]     IA5String,
      @@ -785,7 +785,7 @@ public class X509CertSelector implements CertSelector {
            *       uniformResourceIdentifier       [6]     IA5String,
            *       iPAddress                       [7]     OCTET STRING,
            *       registeredID                    [8]     OBJECT IDENTIFIER}
      -     * 
      + * }
      *

      * Note that the byte array supplied here is cloned to protect against * subsequent modifications. @@ -802,7 +802,7 @@ public class X509CertSelector implements CertSelector { /** * A private method that adds a name (String or byte array) to the - * subjectAlternativeNames criterion. The X509Certificate + * subjectAlternativeNames criterion. The {@code X509Certificate} * must contain the specified subjectAlternativeName. * * @param type the name type (0-8, as specified in @@ -829,19 +829,19 @@ public class X509CertSelector implements CertSelector { /** * Parse an argument of the form passed to setSubjectAlternativeNames, - * returning a Collection of - * GeneralNameInterfaces. + * returning a {@code Collection} of + * {@code GeneralNameInterface}s. * Throw an IllegalArgumentException or a ClassCastException * if the argument is malformed. * * @param names a Collection with one entry per name. - * Each entry is a List whose first entry + * Each entry is a {@code List} whose first entry * is an Integer (the name type, 0-8) and whose second * entry is a String or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). * There can be multiple names of the same type. Null is * not an acceptable value. - * @return a Set of GeneralNameInterfaces + * @return a Set of {@code GeneralNameInterface}s * @throws IOException if a parsing error occurs */ private static Set parseNames(Collection> names) throws IOException { @@ -865,8 +865,8 @@ public class X509CertSelector implements CertSelector { /** * Compare for equality two objects of the form passed to * setSubjectAlternativeNames (or X509CRLSelector.setIssuerNames). - * Throw an IllegalArgumentException or a - * ClassCastException if one of the objects is malformed. + * Throw an {@code IllegalArgumentException} or a + * {@code ClassCastException} if one of the objects is malformed. * * @param object1 a Collection containing the first object to compare * @param object2 a Collection containing the second object to compare @@ -880,7 +880,7 @@ public class X509CertSelector implements CertSelector { } /** - * Make a GeneralNameInterface out of a name type (0-8) and an + * Make a {@code GeneralNameInterface} out of a name type (0-8) and an * Object that may be a byte array holding the ASN.1 DER encoded * name or a String form of the name. Except for X.509 * Distinguished Names, the String form of the name must not be the @@ -989,7 +989,7 @@ public class X509CertSelector implements CertSelector { /** - * Sets the name constraints criterion. The X509Certificate + * Sets the name constraints criterion. The {@code X509Certificate} * must have subject and subject alternative names that * meet the specified name constraints. *

      @@ -998,7 +998,7 @@ public class X509CertSelector implements CertSelector { * would appear in the NameConstraints structure defined in RFC 3280 * and X.509. The ASN.1 definition of this structure appears below. * - *

      
      +     * 
      {@code
            *  NameConstraints ::= SEQUENCE {
            *       permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
            *       excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }
      @@ -1022,7 +1022,7 @@ public class X509CertSelector implements CertSelector {
            *       uniformResourceIdentifier       [6]     IA5String,
            *       iPAddress                       [7]     OCTET STRING,
            *       registeredID                    [8]     OBJECT IDENTIFIER}
      -     * 
      + * }
      *

      * Note that the byte array supplied here is cloned to protect against * subsequent modifications. @@ -1031,7 +1031,7 @@ public class X509CertSelector implements CertSelector { * a NameConstraints extension to be used for checking * name constraints. Only the value of the extension is * included, not the OID or criticality flag. Can be - * null, + * {@code null}, * in which case no name constraints check will be performed. * @throws IOException if a parsing error occurs * @see #getNameConstraints @@ -1048,7 +1048,7 @@ public class X509CertSelector implements CertSelector { /** * Sets the basic constraints constraint. If the value is greater than or - * equal to zero, X509Certificates must include a + * equal to zero, {@code X509Certificates} must include a * basicConstraints extension with * a pathLen of at least this value. If the value is -2, only end-entity * certificates are accepted. If the value is -1, no check is done. @@ -1070,18 +1070,18 @@ public class X509CertSelector implements CertSelector { } /** - * Sets the policy constraint. The X509Certificate must + * Sets the policy constraint. The {@code X509Certificate} must * include at least one of the specified policies in its certificate - * policies extension. If certPolicySet is empty, then the - * X509Certificate must include at least some specified policy - * in its certificate policies extension. If certPolicySet is - * null, no policy check will be performed. + * policies extension. If {@code certPolicySet} is empty, then the + * {@code X509Certificate} must include at least some specified policy + * in its certificate policies extension. If {@code certPolicySet} is + * {@code null}, no policy check will be performed. *

      - * Note that the Set is cloned to protect against + * Note that the {@code Set} is cloned to protect against * subsequent modifications. * - * @param certPolicySet a Set of certificate policy OIDs in - * string format (or null). Each OID is + * @param certPolicySet a {@code Set} of certificate policy OIDs in + * string format (or {@code null}). Each OID is * represented by a set of nonnegative integers * separated by periods. * @throws IOException if a parsing error occurs on the OID such as @@ -1115,12 +1115,12 @@ public class X509CertSelector implements CertSelector { } /** - * Sets the pathToNames criterion. The X509Certificate must + * Sets the pathToNames criterion. The {@code X509Certificate} must * not include name constraints that would prohibit building a * path to the specified names. *

      * This method allows the caller to specify, with a single method call, - * the complete set of names which the X509Certificates's + * the complete set of names which the {@code X509Certificates}'s * name constraints must permit. The specified value replaces * the previous value for the pathToNames criterion. *

      @@ -1129,19 +1129,19 @@ public class X509CertSelector implements CertSelector { * built, any candidate certificate must not include name constraints that * would prohibit building a path to any of the names in the partial path. *

      - * The names parameter (if not null) is a - * Collection with one + * The {@code names} parameter (if not {@code null}) is a + * {@code Collection} with one * entry for each name to be included in the pathToNames - * criterion. Each entry is a List whose first entry is an - * Integer (the name type, 0-8) and whose second - * entry is a String or a byte array (the name, in + * criterion. Each entry is a {@code List} whose first entry is an + * {@code Integer} (the name type, 0-8) and whose second + * entry is a {@code String} or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). - * There can be multiple names of the same type. If null + * There can be multiple names of the same type. If {@code null} * is supplied as the value for this argument, no * pathToNames check will be performed. *

      - * Each name in the Collection - * may be specified either as a String or as an ASN.1 encoded + * Each name in the {@code Collection} + * may be specified either as a {@code String} or as an ASN.1 encoded * byte array. For more details about the formats used, see * {@link #addPathToName(int type, String name) * addPathToName(int type, String name)} and @@ -1152,16 +1152,16 @@ public class X509CertSelector implements CertSelector { * array form instead of the String form. See the note in * {@link #addPathToName(int, String)} for more information. *

      - * Note that the names parameter can contain duplicate + * Note that the {@code names} parameter can contain duplicate * names (same name and name type), but they may be removed from the - * Collection of names returned by the + * {@code Collection} of names returned by the * {@link #getPathToNames getPathToNames} method. *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @param names a Collection with one entry per name - * (or null) + * @param names a {@code Collection} with one entry per name + * (or {@code null}) * @throws IOException if a parsing error occurs * @see #getPathToNames */ @@ -1186,12 +1186,12 @@ public class X509CertSelector implements CertSelector { } /** - * Adds a name to the pathToNames criterion. The X509Certificate + * Adds a name to the pathToNames criterion. The {@code X509Certificate} * must not include name constraints that would prohibit building a * path to the specified name. *

      * This method allows the caller to add a name to the set of names which - * the X509Certificates's name constraints must permit. + * the {@code X509Certificates}'s name constraints must permit. * The specified name is added to any previous value for the * pathToNames criterion. If the name is a duplicate, it may be ignored. *

      @@ -1223,12 +1223,12 @@ public class X509CertSelector implements CertSelector { } /** - * Adds a name to the pathToNames criterion. The X509Certificate + * Adds a name to the pathToNames criterion. The {@code X509Certificate} * must not include name constraints that would prohibit building a * path to the specified name. *

      * This method allows the caller to add a name to the set of names which - * the X509Certificates's name constraints must permit. + * the {@code X509Certificates}'s name constraints must permit. * The specified name is added to any previous value for the * pathToNames criterion. If the name is a duplicate, it may be ignored. *

      @@ -1254,7 +1254,7 @@ public class X509CertSelector implements CertSelector { /** * A private method that adds a name (String or byte array) to the - * pathToNames criterion. The X509Certificate must contain + * pathToNames criterion. The {@code X509Certificate} must contain * the specified pathToName. * * @param type the name type (0-8, as specified in @@ -1279,11 +1279,11 @@ public class X509CertSelector implements CertSelector { /** * Returns the certificateEquals criterion. The specified - * X509Certificate must be equal to the - * X509Certificate passed to the match method. - * If null, this check is not applied. + * {@code X509Certificate} must be equal to the + * {@code X509Certificate} passed to the {@code match} method. + * If {@code null}, this check is not applied. * - * @return the X509Certificate to match (or null) + * @return the {@code X509Certificate} to match (or {@code null}) * @see #setCertificate */ public X509Certificate getCertificate() { @@ -1293,11 +1293,11 @@ public class X509CertSelector implements CertSelector { /** * Returns the serialNumber criterion. The specified serial number * must match the certificate serial number in the - * X509Certificate. If null, any certificate + * {@code X509Certificate}. If {@code null}, any certificate * serial number will do. * * @return the certificate serial number to match - * (or null) + * (or {@code null}) * @see #setSerialNumber */ public BigInteger getSerialNumber() { @@ -1305,13 +1305,13 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the issuer criterion as an X500Principal. This + * Returns the issuer criterion as an {@code X500Principal}. This * distinguished name must match the issuer distinguished name in the - * X509Certificate. If null, the issuer criterion + * {@code X509Certificate}. If {@code null}, the issuer criterion * is disabled and any issuer distinguished name will do. * * @return the required issuer distinguished name as X500Principal - * (or null) + * (or {@code null}) * @since 1.5 */ public X500Principal getIssuer() { @@ -1325,16 +1325,16 @@ public class X509CertSelector implements CertSelector { * encoding information in the RFC 2253 String form of some distinguished * names. *

      - * Returns the issuer criterion as a String. This + * Returns the issuer criterion as a {@code String}. This * distinguished name must match the issuer distinguished name in the - * X509Certificate. If null, the issuer criterion + * {@code X509Certificate}. If {@code null}, the issuer criterion * is disabled and any issuer distinguished name will do. *

      - * If the value returned is not null, it is a + * If the value returned is not {@code null}, it is a * distinguished name, in RFC 2253 format. * * @return the required issuer distinguished name in RFC 2253 format - * (or null) + * (or {@code null}) */ public String getIssuerAsString() { return (issuer == null ? null : issuer.getName()); @@ -1343,10 +1343,10 @@ public class X509CertSelector implements CertSelector { /** * Returns the issuer criterion as a byte array. This distinguished name * must match the issuer distinguished name in the - * X509Certificate. If null, the issuer criterion + * {@code X509Certificate}. If {@code null}, the issuer criterion * is disabled and any issuer distinguished name will do. *

      - * If the value returned is not null, it is a byte + * If the value returned is not {@code null}, it is a byte * array containing a single DER encoded distinguished name, as defined in * X.501. The ASN.1 notation for this structure is supplied in the * documentation for @@ -1356,7 +1356,7 @@ public class X509CertSelector implements CertSelector { * subsequent modifications. * * @return a byte array containing the required issuer distinguished name - * in ASN.1 DER format (or null) + * in ASN.1 DER format (or {@code null}) * @throws IOException if an encoding error occurs */ public byte[] getIssuerAsBytes() throws IOException { @@ -1364,13 +1364,13 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the subject criterion as an X500Principal. This + * Returns the subject criterion as an {@code X500Principal}. This * distinguished name must match the subject distinguished name in the - * X509Certificate. If null, the subject criterion + * {@code X509Certificate}. If {@code null}, the subject criterion * is disabled and any subject distinguished name will do. * * @return the required subject distinguished name as X500Principal - * (or null) + * (or {@code null}) * @since 1.5 */ public X500Principal getSubject() { @@ -1384,16 +1384,16 @@ public class X509CertSelector implements CertSelector { * encoding information in the RFC 2253 String form of some distinguished * names. *

      - * Returns the subject criterion as a String. This + * Returns the subject criterion as a {@code String}. This * distinguished name must match the subject distinguished name in the - * X509Certificate. If null, the subject criterion + * {@code X509Certificate}. If {@code null}, the subject criterion * is disabled and any subject distinguished name will do. *

      - * If the value returned is not null, it is a + * If the value returned is not {@code null}, it is a * distinguished name, in RFC 2253 format. * * @return the required subject distinguished name in RFC 2253 format - * (or null) + * (or {@code null}) */ public String getSubjectAsString() { return (subject == null ? null : subject.getName()); @@ -1402,10 +1402,10 @@ public class X509CertSelector implements CertSelector { /** * Returns the subject criterion as a byte array. This distinguished name * must match the subject distinguished name in the - * X509Certificate. If null, the subject criterion + * {@code X509Certificate}. If {@code null}, the subject criterion * is disabled and any subject distinguished name will do. *

      - * If the value returned is not null, it is a byte + * If the value returned is not {@code null}, it is a byte * array containing a single DER encoded distinguished name, as defined in * X.501. The ASN.1 notation for this structure is supplied in the * documentation for @@ -1415,7 +1415,7 @@ public class X509CertSelector implements CertSelector { * subsequent modifications. * * @return a byte array containing the required subject distinguished name - * in ASN.1 DER format (or null) + * in ASN.1 DER format (or {@code null}) * @throws IOException if an encoding error occurs */ public byte[] getSubjectAsBytes() throws IOException { @@ -1424,14 +1424,14 @@ public class X509CertSelector implements CertSelector { /** * Returns the subjectKeyIdentifier criterion. The - * X509Certificate must contain a SubjectKeyIdentifier - * extension with the specified value. If null, no + * {@code X509Certificate} must contain a SubjectKeyIdentifier + * extension with the specified value. If {@code null}, no * subjectKeyIdentifier check will be done. *

      * Note that the byte array returned is cloned to protect against * subsequent modifications. * - * @return the key identifier (or null) + * @return the key identifier (or {@code null}) * @see #setSubjectKeyIdentifier */ public byte[] getSubjectKeyIdentifier() { @@ -1443,14 +1443,14 @@ public class X509CertSelector implements CertSelector { /** * Returns the authorityKeyIdentifier criterion. The - * X509Certificate must contain a AuthorityKeyIdentifier - * extension with the specified value. If null, no + * {@code X509Certificate} must contain a AuthorityKeyIdentifier + * extension with the specified value. If {@code null}, no * authorityKeyIdentifier check will be done. *

      * Note that the byte array returned is cloned to protect against * subsequent modifications. * - * @return the key identifier (or null) + * @return the key identifier (or {@code null}) * @see #setAuthorityKeyIdentifier */ public byte[] getAuthorityKeyIdentifier() { @@ -1463,13 +1463,13 @@ public class X509CertSelector implements CertSelector { /** * Returns the certificateValid criterion. The specified date must fall * within the certificate validity period for the - * X509Certificate. If null, no certificateValid + * {@code X509Certificate}. If {@code null}, no certificateValid * check will be done. *

      - * Note that the Date returned is cloned to protect against + * Note that the {@code Date} returned is cloned to protect against * subsequent modifications. * - * @return the Date to check (or null) + * @return the {@code Date} to check (or {@code null}) * @see #setCertificateValid */ public Date getCertificateValid() { @@ -1482,13 +1482,13 @@ public class X509CertSelector implements CertSelector { /** * Returns the privateKeyValid criterion. The specified date must fall * within the private key validity period for the - * X509Certificate. If null, no privateKeyValid + * {@code X509Certificate}. If {@code null}, no privateKeyValid * check will be done. *

      - * Note that the Date returned is cloned to protect against + * Note that the {@code Date} returned is cloned to protect against * subsequent modifications. * - * @return the Date to check (or null) + * @return the {@code Date} to check (or {@code null}) * @see #setPrivateKeyValid */ public Date getPrivateKeyValid() { @@ -1500,12 +1500,12 @@ public class X509CertSelector implements CertSelector { /** * Returns the subjectPublicKeyAlgID criterion. The - * X509Certificate must contain a subject public key - * with the specified algorithm. If null, no + * {@code X509Certificate} must contain a subject public key + * with the specified algorithm. If {@code null}, no * subjectPublicKeyAlgID check will be done. * * @return the object identifier (OID) of the signature algorithm to check - * for (or null). An OID is represented by a set of + * for (or {@code null}). An OID is represented by a set of * nonnegative integers separated by periods. * @see #setSubjectPublicKeyAlgID */ @@ -1518,10 +1518,10 @@ public class X509CertSelector implements CertSelector { /** * Returns the subjectPublicKey criterion. The - * X509Certificate must contain the specified subject - * public key. If null, no subjectPublicKey check will be done. + * {@code X509Certificate} must contain the specified subject + * public key. If {@code null}, no subjectPublicKey check will be done. * - * @return the subject public key to check for (or null) + * @return the subject public key to check for (or {@code null}) * @see #setSubjectPublicKey */ public PublicKey getSubjectPublicKey() { @@ -1529,7 +1529,7 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the keyUsage criterion. The X509Certificate + * Returns the keyUsage criterion. The {@code X509Certificate} * must allow the specified keyUsage values. If null, no keyUsage * check will be done. *

      @@ -1539,7 +1539,7 @@ public class X509CertSelector implements CertSelector { * @return a boolean array in the same format as the boolean * array returned by * {@link X509Certificate#getKeyUsage() X509Certificate.getKeyUsage()}. - * Or null. + * Or {@code null}. * @see #setKeyUsage */ public boolean[] getKeyUsage() { @@ -1550,15 +1550,15 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the extendedKeyUsage criterion. The X509Certificate + * Returns the extendedKeyUsage criterion. The {@code X509Certificate} * must allow the specified key purposes in its extended key usage - * extension. If the keyPurposeSet returned is empty or - * null, no extendedKeyUsage check will be done. Note that an - * X509Certificate that has no extendedKeyUsage extension + * extension. If the {@code keyPurposeSet} returned is empty or + * {@code null}, no extendedKeyUsage check will be done. Note that an + * {@code X509Certificate} that has no extendedKeyUsage extension * implicitly allows all key purposes. * - * @return an immutable Set of key purpose OIDs in string - * format (or null) + * @return an immutable {@code Set} of key purpose OIDs in string + * format (or {@code null}) * @see #setExtendedKeyUsage */ public Set getExtendedKeyUsage() { @@ -1566,19 +1566,19 @@ public class X509CertSelector implements CertSelector { } /** - * Indicates if the X509Certificate must contain all + * Indicates if the {@code X509Certificate} must contain all * or at least one of the subjectAlternativeNames * specified in the {@link #setSubjectAlternativeNames * setSubjectAlternativeNames} or {@link #addSubjectAlternativeName - * addSubjectAlternativeName} methods. If true, - * the X509Certificate must contain all of the - * specified subject alternative names. If false, the - * X509Certificate must contain at least one of the + * addSubjectAlternativeName} methods. If {@code true}, + * the {@code X509Certificate} must contain all of the + * specified subject alternative names. If {@code false}, the + * {@code X509Certificate} must contain at least one of the * specified subject alternative names. * - * @return true if the flag is enabled; - * false if the flag is disabled. The flag is - * true by default. + * @return {@code true} if the flag is enabled; + * {@code false} if the flag is disabled. The flag is + * {@code true} by default. * @see #setMatchAllSubjectAltNames */ public boolean getMatchAllSubjectAltNames() { @@ -1587,35 +1587,35 @@ public class X509CertSelector implements CertSelector { /** * Returns a copy of the subjectAlternativeNames criterion. - * The X509Certificate must contain all or at least one + * The {@code X509Certificate} must contain all or at least one * of the specified subjectAlternativeNames, depending on the value * of the matchAllNames flag (see {@link #getMatchAllSubjectAltNames * getMatchAllSubjectAltNames}). If the value returned is - * null, no subjectAlternativeNames check will be performed. + * {@code null}, no subjectAlternativeNames check will be performed. *

      - * If the value returned is not null, it is a - * Collection with + * If the value returned is not {@code null}, it is a + * {@code Collection} with * one entry for each name to be included in the subject alternative name - * criterion. Each entry is a List whose first entry is an - * Integer (the name type, 0-8) and whose second - * entry is a String or a byte array (the name, in + * criterion. Each entry is a {@code List} whose first entry is an + * {@code Integer} (the name type, 0-8) and whose second + * entry is a {@code String} or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). * There can be multiple names of the same type. Note that the - * Collection returned may contain duplicate names (same name + * {@code Collection} returned may contain duplicate names (same name * and name type). *

      - * Each subject alternative name in the Collection - * may be specified either as a String or as an ASN.1 encoded + * Each subject alternative name in the {@code Collection} + * may be specified either as a {@code String} or as an ASN.1 encoded * byte array. For more details about the formats used, see * {@link #addSubjectAlternativeName(int type, String name) * addSubjectAlternativeName(int type, String name)} and * {@link #addSubjectAlternativeName(int type, byte [] name) * addSubjectAlternativeName(int type, byte [] name)}. *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @return a Collection of names (or null) + * @return a {@code Collection} of names (or {@code null}) * @see #setSubjectAlternativeNames */ public Collection> getSubjectAlternativeNames() { @@ -1628,21 +1628,21 @@ public class X509CertSelector implements CertSelector { /** * Clone an object of the form passed to * setSubjectAlternativeNames and setPathToNames. - * Throw a RuntimeException if the argument is malformed. + * Throw a {@code RuntimeException} if the argument is malformed. *

      * This method wraps cloneAndCheckNames, changing any - * IOException into a RuntimeException. This + * {@code IOException} into a {@code RuntimeException}. This * method should be used when the object being * cloned has already been checked, so there should never be any exceptions. * - * @param names a Collection with one entry per name. - * Each entry is a List whose first entry + * @param names a {@code Collection} with one entry per name. + * Each entry is a {@code List} whose first entry * is an Integer (the name type, 0-8) and whose second * entry is a String or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). * There can be multiple names of the same type. Null * is not an acceptable value. - * @return a deep copy of the specified Collection + * @return a deep copy of the specified {@code Collection} * @throws RuntimeException if a parsing error occurs */ private static Set> cloneNames(Collection> names) { @@ -1657,16 +1657,16 @@ public class X509CertSelector implements CertSelector { /** * Clone and check an argument of the form passed to * setSubjectAlternativeNames and setPathToNames. - * Throw an IOException if the argument is malformed. + * Throw an {@code IOException} if the argument is malformed. * - * @param names a Collection with one entry per name. - * Each entry is a List whose first entry + * @param names a {@code Collection} with one entry per name. + * Each entry is a {@code List} whose first entry * is an Integer (the name type, 0-8) and whose second * entry is a String or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). * There can be multiple names of the same type. - * null is not an acceptable value. - * @return a deep copy of the specified Collection + * {@code null} is not an acceptable value. + * @return a deep copy of the specified {@code Collection} * @throws IOException if a parsing error occurs */ private static Set> cloneAndCheckNames(Collection> names) throws IOException { @@ -1709,7 +1709,7 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the name constraints criterion. The X509Certificate + * Returns the name constraints criterion. The {@code X509Certificate} * must have subject and subject alternative names that * meet the specified name constraints. *

      @@ -1725,7 +1725,7 @@ public class X509CertSelector implements CertSelector { * * @return a byte array containing the ASN.1 DER encoding of * a NameConstraints extension used for checking name constraints. - * null if no name constraints check will be performed. + * {@code null} if no name constraints check will be performed. * @see #setNameConstraints */ public byte[] getNameConstraints() { @@ -1738,7 +1738,7 @@ public class X509CertSelector implements CertSelector { /** * Returns the basic constraints constraint. If the value is greater than - * or equal to zero, the X509Certificates must include a + * or equal to zero, the {@code X509Certificates} must include a * basicConstraints extension with a pathLen of at least this value. * If the value is -2, only end-entity certificates are accepted. If * the value is -1, no basicConstraints check is done. @@ -1751,15 +1751,15 @@ public class X509CertSelector implements CertSelector { } /** - * Returns the policy criterion. The X509Certificate must + * Returns the policy criterion. The {@code X509Certificate} must * include at least one of the specified policies in its certificate policies - * extension. If the Set returned is empty, then the - * X509Certificate must include at least some specified policy - * in its certificate policies extension. If the Set returned is - * null, no policy check will be performed. + * extension. If the {@code Set} returned is empty, then the + * {@code X509Certificate} must include at least some specified policy + * in its certificate policies extension. If the {@code Set} returned is + * {@code null}, no policy check will be performed. * - * @return an immutable Set of certificate policy OIDs in - * string format (or null) + * @return an immutable {@code Set} of certificate policy OIDs in + * string format (or {@code null}) * @see #setPolicy */ public Set getPolicy() { @@ -1768,33 +1768,33 @@ public class X509CertSelector implements CertSelector { /** * Returns a copy of the pathToNames criterion. The - * X509Certificate must not include name constraints that would + * {@code X509Certificate} must not include name constraints that would * prohibit building a path to the specified names. If the value - * returned is null, no pathToNames check will be performed. + * returned is {@code null}, no pathToNames check will be performed. *

      - * If the value returned is not null, it is a - * Collection with one + * If the value returned is not {@code null}, it is a + * {@code Collection} with one * entry for each name to be included in the pathToNames - * criterion. Each entry is a List whose first entry is an - * Integer (the name type, 0-8) and whose second - * entry is a String or a byte array (the name, in + * criterion. Each entry is a {@code List} whose first entry is an + * {@code Integer} (the name type, 0-8) and whose second + * entry is a {@code String} or a byte array (the name, in * string or ASN.1 DER encoded form, respectively). * There can be multiple names of the same type. Note that the - * Collection returned may contain duplicate names (same + * {@code Collection} returned may contain duplicate names (same * name and name type). *

      - * Each name in the Collection - * may be specified either as a String or as an ASN.1 encoded + * Each name in the {@code Collection} + * may be specified either as a {@code String} or as an ASN.1 encoded * byte array. For more details about the formats used, see * {@link #addPathToName(int type, String name) * addPathToName(int type, String name)} and * {@link #addPathToName(int type, byte [] name) * addPathToName(int type, byte [] name)}. *

      - * Note that a deep copy is performed on the Collection to + * Note that a deep copy is performed on the {@code Collection} to * protect against subsequent modifications. * - * @return a Collection of names (or null) + * @return a {@code Collection} of names (or {@code null}) * @see #setPathToNames */ public Collection> getPathToNames() { @@ -1805,10 +1805,10 @@ public class X509CertSelector implements CertSelector { } /** - * Return a printable representation of the CertSelector. + * Return a printable representation of the {@code CertSelector}. * - * @return a String describing the contents of the - * CertSelector + * @return a {@code String} describing the contents of the + * {@code CertSelector} */ public String toString() { StringBuffer sb = new StringBuffer(); @@ -1927,22 +1927,22 @@ public class X509CertSelector implements CertSelector { /** * Returns an Extension object given any X509Certificate and extension oid. - * Throw an IOException if the extension byte value is + * Throw an {@code IOException} if the extension byte value is * malformed. * - * @param cert a X509Certificate - * @param extId an integer which specifies the extension index. + * @param cert a {@code X509Certificate} + * @param extId an {@code integer} which specifies the extension index. * Currently, the supported extensions are as follows: * index 0 - PrivateKeyUsageExtension * index 1 - SubjectAlternativeNameExtension * index 2 - NameConstraintsExtension * index 3 - CertificatePoliciesExtension * index 4 - ExtendedKeyUsageExtension - * @return an Extension object whose real type is as specified + * @return an {@code Extension} object whose real type is as specified * by the extension oid. - * @throws IOException if cannot construct the Extension + * @throws IOException if cannot construct the {@code Extension} * object with the extension encoding retrieved from the passed in - * X509Certificate. + * {@code X509Certificate}. */ private static Extension getExtensionObject(X509Certificate cert, int extId) throws IOException { @@ -1990,11 +1990,11 @@ public class X509CertSelector implements CertSelector { } /** - * Decides whether a Certificate should be selected. + * Decides whether a {@code Certificate} should be selected. * - * @param cert the Certificate to be checked - * @return true if the Certificate should be - * selected, false otherwise + * @param cert the {@code Certificate} to be checked + * @return {@code true} if the {@code Certificate} should be + * selected, {@code false} otherwise */ public boolean match(Certificate cert) { if (!(cert instanceof X509Certificate)) { diff --git a/jdk/src/share/classes/java/security/cert/X509Certificate.java b/jdk/src/share/classes/java/security/cert/X509Certificate.java index f257d028f7b..0aba5da60c0 100644 --- a/jdk/src/share/classes/java/security/cert/X509Certificate.java +++ b/jdk/src/share/classes/java/security/cert/X509Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ import sun.security.x509.X509CertImpl; * RFC 3280: Internet X.509 * Public Key Infrastructure Certificate and CRL Profile. *

      - * The ASN.1 definition of tbsCertificate is: + * The ASN.1 definition of {@code tbsCertificate} is: *

        * TBSCertificate  ::=  SEQUENCE  {
        *     version         [0]  EXPLICIT Version DEFAULT v1,
      @@ -126,10 +126,12 @@ implements X509Extension {
            * is valid. It is defined in
            * ASN.1 as:
            * 
      -     * validity             Validity

      + * validity Validity + * * Validity ::= SEQUENCE { * notBefore CertificateValidityDate, - * notAfter CertificateValidityDate }

      + * notAfter CertificateValidityDate } + * * CertificateValidityDate ::= CHOICE { * utcTime UTCTime, * generalTime GeneralizedTime } @@ -151,9 +153,9 @@ implements X509Extension { * is valid at that date/time. * * @exception CertificateExpiredException if the certificate has expired - * with respect to the date supplied. + * with respect to the {@code date} supplied. * @exception CertificateNotYetValidException if the certificate is not - * yet valid with respect to the date supplied. + * yet valid with respect to the {@code date} supplied. * * @see #checkValidity() */ @@ -161,11 +163,12 @@ implements X509Extension { throws CertificateExpiredException, CertificateNotYetValidException; /** - * Gets the version (version number) value from the + * Gets the {@code version} (version number) value from the * certificate. * The ASN.1 definition for this is: *

      -     * version  [0] EXPLICIT Version DEFAULT v1

      + * version [0] EXPLICIT Version DEFAULT v1 + * * Version ::= INTEGER { v1(0), v2(1), v3(2) } *

      * @return the version number, i.e. 1, 2 or 3. @@ -173,14 +176,14 @@ implements X509Extension { public abstract int getVersion(); /** - * Gets the serialNumber value from the certificate. + * Gets the {@code serialNumber} value from the certificate. * The serial number is an integer assigned by the certification * authority to each certificate. It must be unique for each * certificate issued by a given CA (i.e., the issuer name and * serial number identify a unique certificate). * The ASN.1 definition for this is: *
      -     * serialNumber     CertificateSerialNumber

      + * serialNumber CertificateSerialNumber * * CertificateSerialNumber ::= INTEGER *

      @@ -191,12 +194,12 @@ implements X509Extension { /** * Denigrated, replaced by {@linkplain - * #getIssuerX500Principal()}. This method returns the issuer + * #getIssuerX500Principal()}. This method returns the {@code issuer} * as an implementation specific Principal object, which should not be * relied upon by portable code. * *

      - * Gets the issuer (issuer distinguished name) value from + * Gets the {@code issuer} (issuer distinguished name) value from * the certificate. The issuer name identifies the entity that signed (and * issued) the certificate. * @@ -204,7 +207,7 @@ implements X509Extension { * X.500 distinguished name (DN). * The ASN.1 definition for this is: *

      -     * issuer    Name

      + * issuer Name * * Name ::= CHOICE { RDNSequence } * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName @@ -217,14 +220,14 @@ implements X509Extension { * AttributeType ::= OBJECT IDENTIFIER * AttributeValue ::= ANY *

      - * The Name describes a hierarchical name composed of + * The {@code Name} describes a hierarchical name composed of * attributes, * such as country name, and corresponding values, such as US. - * The type of the AttributeValue component is determined by - * the AttributeType; in general it will be a - * directoryString. A directoryString is usually - * one of PrintableString, - * TeletexString or UniversalString. + * The type of the {@code AttributeValue} component is determined by + * the {@code AttributeType}; in general it will be a + * {@code directoryString}. A {@code directoryString} is usually + * one of {@code PrintableString}, + * {@code TeletexString} or {@code UniversalString}. * * @return a Principal whose name is the issuer distinguished name. */ @@ -232,11 +235,11 @@ implements X509Extension { /** * Returns the issuer (issuer distinguished name) value from the - * certificate as an X500Principal. + * certificate as an {@code X500Principal}. *

      * It is recommended that subclasses override this method. * - * @return an X500Principal representing the issuer + * @return an {@code X500Principal} representing the issuer * distinguished name * @since 1.4 */ @@ -249,22 +252,22 @@ implements X509Extension { /** * Denigrated, replaced by {@linkplain - * #getSubjectX500Principal()}. This method returns the subject + * #getSubjectX500Principal()}. This method returns the {@code subject} * as an implementation specific Principal object, which should not be * relied upon by portable code. * *

      - * Gets the subject (subject distinguished name) value - * from the certificate. If the subject value is empty, - * then the getName() method of the returned - * Principal object returns an empty string (""). + * Gets the {@code subject} (subject distinguished name) value + * from the certificate. If the {@code subject} value is empty, + * then the {@code getName()} method of the returned + * {@code Principal} object returns an empty string (""). * *

      The ASN.1 definition for this is: *

            * subject    Name
            * 
      * - *

      See {@link #getIssuerDN() getIssuerDN} for Name + *

      See {@link #getIssuerDN() getIssuerDN} for {@code Name} * and other relevant definitions. * * @return a Principal whose name is the subject name. @@ -273,13 +276,13 @@ implements X509Extension { /** * Returns the subject (subject distinguished name) value from the - * certificate as an X500Principal. If the subject value - * is empty, then the getName() method of the returned - * X500Principal object returns an empty string (""). + * certificate as an {@code X500Principal}. If the subject value + * is empty, then the {@code getName()} method of the returned + * {@code X500Principal} object returns an empty string (""). *

      * It is recommended that subclasses override this method. * - * @return an X500Principal representing the subject + * @return an {@code X500Principal} representing the subject * distinguished name * @since 1.4 */ @@ -291,15 +294,16 @@ implements X509Extension { } /** - * Gets the notBefore date from the validity period of + * Gets the {@code notBefore} date from the validity period of * the certificate. * The relevant ASN.1 definitions are: *

      -     * validity             Validity

      + * validity Validity * * Validity ::= SEQUENCE { * notBefore CertificateValidityDate, - * notAfter CertificateValidityDate }

      + * notAfter CertificateValidityDate } + * * CertificateValidityDate ::= CHOICE { * utcTime UTCTime, * generalTime GeneralizedTime } @@ -311,7 +315,7 @@ implements X509Extension { public abstract Date getNotBefore(); /** - * Gets the notAfter date from the validity period of + * Gets the {@code notAfter} date from the validity period of * the certificate. See {@link #getNotBefore() getNotBefore} * for relevant ASN.1 definitions. * @@ -322,7 +326,7 @@ implements X509Extension { /** * Gets the DER-encoded certificate information, the - * tbsCertificate from this certificate. + * {@code tbsCertificate} from this certificate. * This can be used to verify the signature independently. * * @return the DER-encoded certificate information. @@ -332,7 +336,7 @@ implements X509Extension { throws CertificateEncodingException; /** - * Gets the signature value (the raw signature bits) from + * Gets the {@code signature} value (the raw signature bits) from * the certificate. * The ASN.1 definition for this is: *

      @@ -348,7 +352,8 @@ implements X509Extension {
            * signature algorithm. An example is the string "SHA256withRSA".
            * The ASN.1 definition for this is:
            * 
      -     * signatureAlgorithm   AlgorithmIdentifier

      + * signatureAlgorithm AlgorithmIdentifier + * * AlgorithmIdentifier ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL } @@ -357,7 +362,7 @@ implements X509Extension { * -- algorithm object identifier value *

      * - *

      The algorithm name is determined from the algorithm + *

      The algorithm name is determined from the {@code algorithm} * OID string. * * @return the signature algorithm name. @@ -400,7 +405,7 @@ implements X509Extension { public abstract byte[] getSigAlgParams(); /** - * Gets the issuerUniqueID value from the certificate. + * Gets the {@code issuerUniqueID} value from the certificate. * The issuer unique identifier is present in the certificate * to handle the possibility of reuse of issuer names over time. * RFC 3280 recommends that names not be reused and that @@ -410,7 +415,8 @@ implements X509Extension { * *

      The ASN.1 definition for this is: *

      -     * issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL

      + * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL + * * UniqueIdentifier ::= BIT STRING *

      * @@ -420,11 +426,12 @@ implements X509Extension { public abstract boolean[] getIssuerUniqueID(); /** - * Gets the subjectUniqueID value from the certificate. + * Gets the {@code subjectUniqueID} value from the certificate. * *

      The ASN.1 definition for this is: *

      -     * subjectUniqueID  [2]  IMPLICIT UniqueIdentifier OPTIONAL

      + * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL + * * UniqueIdentifier ::= BIT STRING *

      * @@ -435,7 +442,7 @@ implements X509Extension { /** * Gets a boolean array representing bits of - * the KeyUsage extension, (OID = 2.5.29.15). + * the {@code KeyUsage} extension, (OID = 2.5.29.15). * The key usage extension defines the purpose (e.g., encipherment, * signature, certificate signing) of the key contained in the * certificate. @@ -467,16 +474,16 @@ implements X509Extension { /** * Gets an unmodifiable list of Strings representing the OBJECT - * IDENTIFIERs of the ExtKeyUsageSyntax field of the + * IDENTIFIERs of the {@code ExtKeyUsageSyntax} field of the * extended key usage extension, (OID = 2.5.29.37). It indicates * one or more purposes for which the certified public key may be * used, in addition to or in place of the basic purposes * indicated in the key usage extension field. The ASN.1 * definition for this is: *
      -     * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId

      + * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId * - * KeyPurposeId ::= OBJECT IDENTIFIER

      + * KeyPurposeId ::= OBJECT IDENTIFIER *

      * * Key purposes may be defined by any organization with a @@ -486,7 +493,7 @@ implements X509Extension { *

      * This method was added to version 1.4 of the Java 2 Platform Standard * Edition. In order to maintain backwards compatibility with existing - * service providers, this method is not abstract + * service providers, this method is not {@code abstract} * and it provides a default implementation. Subclasses * should override this method with a correct implementation. * @@ -503,13 +510,13 @@ implements X509Extension { /** * Gets the certificate constraints path length from the - * critical BasicConstraints extension, (OID = 2.5.29.19). + * critical {@code BasicConstraints} extension, (OID = 2.5.29.19). *

      * The basic constraints extension identifies whether the subject * of the certificate is a Certificate Authority (CA) and * how deep a certification path may exist through that CA. The - * pathLenConstraint field (see below) is meaningful - * only if cA is set to TRUE. In this case, it gives the + * {@code pathLenConstraint} field (see below) is meaningful + * only if {@code cA} is set to TRUE. In this case, it gives the * maximum number of CA certificates that may follow this certificate in a * certification path. A value of zero indicates that only an end-entity * certificate may follow in the path. @@ -521,21 +528,21 @@ implements X509Extension { * pathLenConstraint INTEGER (0..MAX) OPTIONAL } *

      * - * @return the value of pathLenConstraint if the + * @return the value of {@code pathLenConstraint} if the * BasicConstraints extension is present in the certificate and the * subject of the certificate is a CA, otherwise -1. * If the subject of the certificate is a CA and - * pathLenConstraint does not appear, - * Integer.MAX_VALUE is returned to indicate that there is no + * {@code pathLenConstraint} does not appear, + * {@code Integer.MAX_VALUE} is returned to indicate that there is no * limit to the allowed length of the certification path. */ public abstract int getBasicConstraints(); /** * Gets an immutable collection of subject alternative names from the - * SubjectAltName extension, (OID = 2.5.29.17). + * {@code SubjectAltName} extension, (OID = 2.5.29.17). *

      - * The ASN.1 definition of the SubjectAltName extension is: + * The ASN.1 definition of the {@code SubjectAltName} extension is: *

            * SubjectAltName ::= GeneralNames
            *
      @@ -553,23 +560,23 @@ implements X509Extension {
            *      registeredID                    [8]     OBJECT IDENTIFIER}
            * 
      *

      - * If this certificate does not contain a SubjectAltName - * extension, null is returned. Otherwise, a - * Collection is returned with an entry representing each - * GeneralName included in the extension. Each entry is a - * List whose first entry is an Integer - * (the name type, 0-8) and whose second entry is a String + * If this certificate does not contain a {@code SubjectAltName} + * extension, {@code null} is returned. Otherwise, a + * {@code Collection} is returned with an entry representing each + * {@code GeneralName} included in the extension. Each entry is a + * {@code List} whose first entry is an {@code Integer} + * (the name type, 0-8) and whose second entry is a {@code String} * or a byte array (the name, in string or ASN.1 DER encoded form, * respectively). *

      * RFC 822, DNS, and URI - * names are returned as Strings, + * names are returned as {@code String}s, * using the well-established string formats for those types (subject to * the restrictions included in RFC 3280). IPv4 address names are * returned using dotted quad notation. IPv6 address names are returned * in the form "a1:a2:...:a8", where a1-a8 are hexadecimal values * representing the eight 16-bit pieces of the address. OID names are - * returned as Strings represented as a series of nonnegative + * returned as {@code String}s represented as a series of nonnegative * integers separated by periods. And directory names (distinguished names) * are returned in * RFC 2253 string format. No standard string format is @@ -577,19 +584,19 @@ implements X509Extension { * other type of names. They are returned as byte arrays * containing the ASN.1 DER encoded form of the name. *

      - * Note that the Collection returned may contain more + * Note that the {@code Collection} returned may contain more * than one name of the same type. Also, note that the returned - * Collection is immutable and any entries containing byte + * {@code Collection} is immutable and any entries containing byte * arrays are cloned to protect against subsequent modifications. *

      * This method was added to version 1.4 of the Java 2 Platform Standard * Edition. In order to maintain backwards compatibility with existing - * service providers, this method is not abstract + * service providers, this method is not {@code abstract} * and it provides a default implementation. Subclasses * should override this method with a correct implementation. * - * @return an immutable Collection of subject alternative - * names (or null) + * @return an immutable {@code Collection} of subject alternative + * names (or {@code null}) * @throws CertificateParsingException if the extension cannot be decoded * @since 1.4 */ @@ -600,38 +607,38 @@ implements X509Extension { /** * Gets an immutable collection of issuer alternative names from the - * IssuerAltName extension, (OID = 2.5.29.18). + * {@code IssuerAltName} extension, (OID = 2.5.29.18). *

      - * The ASN.1 definition of the IssuerAltName extension is: + * The ASN.1 definition of the {@code IssuerAltName} extension is: *

            * IssuerAltName ::= GeneralNames
            * 
      - * The ASN.1 definition of GeneralNames is defined + * The ASN.1 definition of {@code GeneralNames} is defined * in {@link #getSubjectAlternativeNames getSubjectAlternativeNames}. *

      - * If this certificate does not contain an IssuerAltName - * extension, null is returned. Otherwise, a - * Collection is returned with an entry representing each - * GeneralName included in the extension. Each entry is a - * List whose first entry is an Integer - * (the name type, 0-8) and whose second entry is a String + * If this certificate does not contain an {@code IssuerAltName} + * extension, {@code null} is returned. Otherwise, a + * {@code Collection} is returned with an entry representing each + * {@code GeneralName} included in the extension. Each entry is a + * {@code List} whose first entry is an {@code Integer} + * (the name type, 0-8) and whose second entry is a {@code String} * or a byte array (the name, in string or ASN.1 DER encoded form, * respectively). For more details about the formats used for each - * name type, see the getSubjectAlternativeNames method. + * name type, see the {@code getSubjectAlternativeNames} method. *

      - * Note that the Collection returned may contain more + * Note that the {@code Collection} returned may contain more * than one name of the same type. Also, note that the returned - * Collection is immutable and any entries containing byte + * {@code Collection} is immutable and any entries containing byte * arrays are cloned to protect against subsequent modifications. *

      * This method was added to version 1.4 of the Java 2 Platform Standard * Edition. In order to maintain backwards compatibility with existing - * service providers, this method is not abstract + * service providers, this method is not {@code abstract} * and it provides a default implementation. Subclasses * should override this method with a correct implementation. * - * @return an immutable Collection of issuer alternative - * names (or null) + * @return an immutable {@code Collection} of issuer alternative + * names (or {@code null}) * @throws CertificateParsingException if the extension cannot be decoded * @since 1.4 */ @@ -649,7 +656,7 @@ implements X509Extension { * * This method was added to version 1.8 of the Java Platform Standard * Edition. In order to maintain backwards compatibility with existing - * service providers, this method is not abstract + * service providers, this method is not {@code abstract} * and it provides a default implementation. * * @param key the PublicKey used to carry out the verification. diff --git a/jdk/src/share/classes/java/security/cert/X509Extension.java b/jdk/src/share/classes/java/security/cert/X509Extension.java index e2c362ee3ff..03469606eed 100644 --- a/jdk/src/share/classes/java/security/cert/X509Extension.java +++ b/jdk/src/share/classes/java/security/cert/X509Extension.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,9 +59,9 @@ import java.util.Set; * -- the extnId object identifier value * } *

      - * Since not all extensions are known, the getExtensionValue + * Since not all extensions are known, the {@code getExtensionValue} * method returns the DER-encoded OCTET STRING of the - * extension value (i.e., the extnValue). This can then + * extension value (i.e., the {@code extnValue}). This can then * be handled by a Class that understands the extension. * * @author Hemma Prafullchandra @@ -72,8 +72,8 @@ public interface X509Extension { /** * Check if there is a critical extension that is not supported. * - * @return true if a critical extension is found that is - * not supported, otherwise false. + * @return {@code true} if a critical extension is found that is + * not supported, otherwise {@code false}. */ public boolean hasUnsupportedCriticalExtension(); @@ -84,12 +84,12 @@ public interface X509Extension { * * Here is sample code to get a Set of critical extensions from an * X509Certificate and print the OIDs: - *
      
      +     * 
      {@code
            * X509Certificate cert = null;
            * try (InputStream inStrm = new FileInputStream("DER-encoded-Cert")) {
            *     CertificateFactory cf = CertificateFactory.getInstance("X.509");
            *     cert = (X509Certificate)cf.generateCertificate(inStrm);
      -     * }

      + * } * * Set critSet = cert.getCriticalExtensionOIDs(); * if (critSet != null && !critSet.isEmpty()) { @@ -98,7 +98,7 @@ public interface X509Extension { * System.out.println(oid); * } * } - *

      + * }
      * @return a Set (or an empty Set if none are marked critical) of * the extension OID strings for extensions that are marked critical. * If there are no extensions present at all, then this method returns @@ -113,28 +113,28 @@ public interface X509Extension { * * Here is sample code to get a Set of non-critical extensions from an * X509CRL revoked certificate entry and print the OIDs: - *
      
      +     * 
      {@code
            * CertificateFactory cf = null;
            * X509CRL crl = null;
            * try (InputStream inStrm = new FileInputStream("DER-encoded-CRL")) {
            *     cf = CertificateFactory.getInstance("X.509");
            *     crl = (X509CRL)cf.generateCRL(inStrm);
      -     * }

      + * } * - * byte[] certData = <DER-encoded certificate data> + * byte[] certData = * ByteArrayInputStream bais = new ByteArrayInputStream(certData); * X509Certificate cert = (X509Certificate)cf.generateCertificate(bais); * X509CRLEntry badCert = - * crl.getRevokedCertificate(cert.getSerialNumber());

      + * crl.getRevokedCertificate(cert.getSerialNumber()); * * if (badCert != null) { - * Set nonCritSet = badCert.getNonCriticalExtensionOIDs();

      + * Set nonCritSet = badCert.getNonCriticalExtensionOIDs(); * if (nonCritSet != null) * for (String oid : nonCritSet) { * System.out.println(oid); * } * } - *

      + * }
      * * @return a Set (or an empty Set if none are marked non-critical) of * the extension OID strings for extensions that are marked non-critical. @@ -145,9 +145,9 @@ public interface X509Extension { /** * Gets the DER-encoded OCTET string for the extension value - * (extnValue) identified by the passed-in oid + * (extnValue) identified by the passed-in {@code oid} * String. - * The oid string is + * The {@code oid} string is * represented by a set of nonnegative whole numbers separated * by periods. * diff --git a/jdk/src/share/classes/java/security/cert/package-info.java b/jdk/src/share/classes/java/security/cert/package-info.java new file mode 100644 index 00000000000..58f5fb77e0a --- /dev/null +++ b/jdk/src/share/classes/java/security/cert/package-info.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * Provides classes and interfaces for parsing and managing + * certificates, certificate revocation lists (CRLs), and + * certification paths. It contains support for X.509 v3 + * certificates and X.509 v2 CRLs. + * + *

      Package Specification

      + * + * + * + *

      Related Documentation

      + * + * For information about X.509 certificates and CRLs, please see: + * + * + * @since 1.2 + */ +package java.security.cert; diff --git a/jdk/src/share/classes/java/security/cert/package.html b/jdk/src/share/classes/java/security/cert/package.html deleted file mode 100644 index 239f7ffe1dc..00000000000 --- a/jdk/src/share/classes/java/security/cert/package.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - -Provides classes and interfaces for parsing and managing -certificates, certificate revocation lists (CRLs), and -certification paths. It contains support for X.509 v3 -certificates and X.509 v2 CRLs. - -

      Package Specification

      - - - -

      Related Documentation

      - -For information about X.509 certificates and CRLs, please see: - - -@since 1.2 - - diff --git a/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java b/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java index 96a091ef84a..390835725b9 100644 --- a/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java +++ b/jdk/src/share/classes/java/security/interfaces/DSAKeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,8 @@ import java.security.*; /** * An interface to an object capable of generating DSA key pairs. * - *

      The initialize methods may each be called any number - * of times. If no initialize method is called on a + *

      The {@code initialize} methods may each be called any number + * of times. If no {@code initialize} method is called on a * DSAKeyPairGenerator, the default is to generate 1024-bit keys, using * precomputed p, q and g parameters and an instance of SecureRandom as * the random bit source. @@ -42,22 +42,22 @@ import java.security.*; *

        * *
      1. Get a key pair generator for the DSA algorithm by calling the - * KeyPairGenerator getInstance method with "DSA" + * KeyPairGenerator {@code getInstance} method with "DSA" * as its argument.

        * *

      2. Initialize the generator by casting the result to a DSAKeyPairGenerator * and calling one of the - * initialize methods from this DSAKeyPairGenerator interface.

        + * {@code initialize} methods from this DSAKeyPairGenerator interface.

        * - *

      3. Generate a key pair by calling the generateKeyPair + *
      4. Generate a key pair by calling the {@code generateKeyPair} * method from the KeyPairGenerator class. * *
      * *

      Note: it is not always necessary to do do algorithm-specific * initialization for a DSA key pair generator. That is, it is not always - * necessary to call an initialize method in this interface. - * Algorithm-independent initialization using the initialize method + * necessary to call an {@code initialize} method in this interface. + * Algorithm-independent initialization using the {@code initialize} method * in the KeyPairGenerator * interface is all that is needed when you accept defaults for algorithm-specific * parameters. @@ -80,7 +80,7 @@ public interface DSAKeyPairGenerator { * @param random the random bit source to use to generate key bits; * can be null. * - * @exception InvalidParameterException if the params + * @exception InvalidParameterException if the {@code params} * value is invalid, null, or unsupported. */ public void initialize(DSAParams params, SecureRandom random) @@ -92,7 +92,7 @@ public interface DSAKeyPairGenerator { * If a SecureRandom bit source is needed but not supplied, i.e. * null, a default SecureRandom instance will be used. * - *

      If genParams is true, this method generates new + *

      If {@code genParams} is true, this method generates new * p, q and g parameters. If it is false, the method uses precomputed * parameters for the modulus length requested. If there are no * precomputed parameters for that modulus length, an exception will be @@ -108,8 +108,8 @@ public interface DSAKeyPairGenerator { * @param genParams whether or not to generate new parameters for * the modulus length requested. * - * @exception InvalidParameterException if modlen is - * invalid, or unsupported, or if genParams is false and there + * @exception InvalidParameterException if {@code modlen} is + * invalid, or unsupported, or if {@code genParams} is false and there * are no precomputed parameters for the requested modulus length. */ public void initialize(int modlen, boolean genParams, SecureRandom random) diff --git a/jdk/src/share/classes/java/security/interfaces/DSAParams.java b/jdk/src/share/classes/java/security/interfaces/DSAParams.java index f20b8ec386b..8c46ed57e27 100644 --- a/jdk/src/share/classes/java/security/interfaces/DSAParams.java +++ b/jdk/src/share/classes/java/security/interfaces/DSAParams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,23 +42,23 @@ import java.math.BigInteger; public interface DSAParams { /** - * Returns the prime, p. + * Returns the prime, {@code p}. * - * @return the prime, p. + * @return the prime, {@code p}. */ public BigInteger getP(); /** - * Returns the subprime, q. + * Returns the subprime, {@code q}. * - * @return the subprime, q. + * @return the subprime, {@code q}. */ public BigInteger getQ(); /** - * Returns the base, g. + * Returns the base, {@code g}. * - * @return the base, g. + * @return the base, {@code g}. */ public BigInteger getG(); } diff --git a/jdk/src/share/classes/java/security/interfaces/DSAPrivateKey.java b/jdk/src/share/classes/java/security/interfaces/DSAPrivateKey.java index a0d189372e6..81ab3586f69 100644 --- a/jdk/src/share/classes/java/security/interfaces/DSAPrivateKey.java +++ b/jdk/src/share/classes/java/security/interfaces/DSAPrivateKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,9 @@ public interface DSAPrivateKey extends DSAKey, java.security.PrivateKey { static final long serialVersionUID = 7776497482533790279L; /** - * Returns the value of the private key, x. + * Returns the value of the private key, {@code x}. * - * @return the value of the private key, x. + * @return the value of the private key, {@code x}. */ public BigInteger getX(); } diff --git a/jdk/src/share/classes/java/security/interfaces/DSAPublicKey.java b/jdk/src/share/classes/java/security/interfaces/DSAPublicKey.java index b27373880e6..e56b795ae70 100644 --- a/jdk/src/share/classes/java/security/interfaces/DSAPublicKey.java +++ b/jdk/src/share/classes/java/security/interfaces/DSAPublicKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,9 @@ public interface DSAPublicKey extends DSAKey, java.security.PublicKey { static final long serialVersionUID = 1234526332779022332L; /** - * Returns the value of the public key, y. + * Returns the value of the public key, {@code y}. * - * @return the value of the public key, y. + * @return the value of the public key, {@code y}. */ public BigInteger getY(); } diff --git a/jdk/src/share/classes/java/security/interfaces/package-info.java b/jdk/src/share/classes/java/security/interfaces/package-info.java new file mode 100644 index 00000000000..54c9397e691 --- /dev/null +++ b/jdk/src/share/classes/java/security/interfaces/package-info.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * Provides interfaces for generating RSA (Rivest, Shamir and + * Adleman AsymmetricCipher algorithm) + * keys as defined in the RSA Laboratory Technical Note + * PKCS#1, and DSA (Digital Signature + * Algorithm) keys as defined in NIST's FIPS-186. + *

      + * Note that these interfaces are intended only for key + * implementations whose key material is accessible and + * available. These interfaces are not intended for key + * implementations whose key material resides in + * inaccessible, protected storage (such as in a + * hardware device). + *

      + * For more developer information on how to use these + * interfaces, including information on how to design + * {@code Key} classes for hardware devices, please refer + * to these cryptographic provider developer guides: + *

      + * + *

      Package Specification

      + * + *
        + *
      • PKCS #1: RSA Encryption Standard, Version 1.5, November 1993
      • + *
      • Federal Information Processing Standards Publication (FIPS PUB) 186: + * Digital Signature Standard (DSS)
      • + *
      + * + *

      Related Documentation

      + * + * For further documentation, please see: + * + * + * @since JDK1.1 + */ +package java.security.interfaces; diff --git a/jdk/src/share/classes/java/security/interfaces/package.html b/jdk/src/share/classes/java/security/interfaces/package.html deleted file mode 100644 index 70820dd70a5..00000000000 --- a/jdk/src/share/classes/java/security/interfaces/package.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - -Provides interfaces for generating RSA (Rivest, Shamir and -Adleman AsymmetricCipher algorithm) -keys as defined in the RSA Laboratory Technical Note -PKCS#1, and DSA (Digital Signature -Algorithm) keys as defined in NIST's FIPS-186. -

      -Note that these interfaces are intended only for key -implementations whose key material is accessible and -available. These interfaces are not intended for key -implementations whose key material resides in -inaccessible, protected storage (such as in a -hardware device). -

      -For more developer information on how to use these -interfaces, including information on how to design -Key classes for hardware devices, please refer -to these cryptographic provider developer guides: -

      - -

      Package Specification

      - -
        -
      • PKCS #1: RSA Encryption Standard, Version 1.5, November 1993
      • -
      • Federal Information Processing Standards Publication (FIPS PUB) 186: - Digital Signature Standard (DSS)
      • -
      - -

      Related Documentation

      - -For further documentation, please see: - - -@since JDK1.1 - - diff --git a/jdk/src/share/classes/java/security/package-info.java b/jdk/src/share/classes/java/security/package-info.java new file mode 100644 index 00000000000..599e95259ba --- /dev/null +++ b/jdk/src/share/classes/java/security/package-info.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/** + * Provides the classes and interfaces for the security framework. + * This includes classes that implement an easily configurable, + * fine-grained access control security architecture. + * This package also supports + * the generation and storage of cryptographic public key pairs, + * as well as a number of exportable cryptographic operations + * including those for message digest and signature generation. Finally, + * this package provides classes that support signed/guarded objects + * and secure random number generation. + * + * Many of the classes provided in this package (the cryptographic + * and secure random number generator classes in particular) are + * provider-based. The class itself defines a programming interface + * to which applications may write. The implementations themselves may + * then be written by independent third-party vendors and plugged + * in seamlessly as needed. Therefore application developers may + * take advantage of any number of provider-based implementations + * without having to add or rewrite code. + * + *

      Package Specification

      + * + * + * + *

      Related Documentation

      + * + * For further documentation, please see: + * + * + * @since 1.1 + */ +package java.security; diff --git a/jdk/src/share/classes/java/security/package.html b/jdk/src/share/classes/java/security/package.html deleted file mode 100644 index 65eb70c71af..00000000000 --- a/jdk/src/share/classes/java/security/package.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - -Provides the classes and interfaces for the security framework. -This includes classes that implement an easily configurable, -fine-grained access control security architecture. -This package also supports -the generation and storage of cryptographic public key pairs, -as well as a number of exportable cryptographic operations -including those for message digest and signature generation. Finally, -this package provides classes that support signed/guarded objects -and secure random number generation. - -Many of the classes provided in this package (the cryptographic -and secure random number generator classes in particular) are -provider-based. The class itself defines a programming interface -to which applications may write. The implementations themselves may -then be written by independent third-party vendors and plugged -in seamlessly as needed. Therefore application developers may -take advantage of any number of provider-based implementations -without having to add or rewrite code. - -

      Package Specification

      - - - -

      Related Documentation

      - -For further documentation, please see: - - -@since 1.1 - - diff --git a/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java b/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java index a354c4807ac..932a9f05ccd 100644 --- a/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java +++ b/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,13 +41,13 @@ public final class DSAGenParameterSpec implements AlgorithmParameterSpec { /** * Creates a domain parameter specification for DSA parameter - * generation using primePLen and subprimeQLen. - * The value of subprimeQLen is also used as the default + * generation using {@code primePLen} and {@code subprimeQLen}. + * The value of {@code subprimeQLen} is also used as the default * length of the domain parameter seed in bits. * @param primePLen the desired length of the prime P in bits. * @param subprimeQLen the desired length of the sub-prime Q in bits. - * @exception IllegalArgumentException if primePLen - * or subprimeQLen is illegal per the specification of + * @exception IllegalArgumentException if {@code primePLen} + * or {@code subprimeQLen} is illegal per the specification of * FIPS 186-3. */ public DSAGenParameterSpec(int primePLen, int subprimeQLen) { @@ -56,14 +56,14 @@ public final class DSAGenParameterSpec implements AlgorithmParameterSpec { /** * Creates a domain parameter specification for DSA parameter - * generation using primePLen, subprimeQLen, - * and seedLen. + * generation using {@code primePLen}, {@code subprimeQLen}, + * and {@code seedLen}. * @param primePLen the desired length of the prime P in bits. * @param subprimeQLen the desired length of the sub-prime Q in bits. * @param seedLen the desired length of the domain parameter seed in bits, - * shall be equal to or greater than subprimeQLen. - * @exception IllegalArgumentException if primePLenLen, - * subprimeQLen, or seedLen is illegal per the + * shall be equal to or greater than {@code subprimeQLen}. + * @exception IllegalArgumentException if {@code primePLenLen}, + * {@code subprimeQLen}, or {@code seedLen} is illegal per the * specification of FIPS 186-3. */ public DSAGenParameterSpec(int primePLen, int subprimeQLen, int seedLen) { diff --git a/jdk/src/share/classes/java/security/spec/DSAParameterSpec.java b/jdk/src/share/classes/java/security/spec/DSAParameterSpec.java index 2c9c546669d..eed6bdcae8b 100644 --- a/jdk/src/share/classes/java/security/spec/DSAParameterSpec.java +++ b/jdk/src/share/classes/java/security/spec/DSAParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,27 +61,27 @@ java.security.interfaces.DSAParams { } /** - * Returns the prime p. + * Returns the prime {@code p}. * - * @return the prime p. + * @return the prime {@code p}. */ public BigInteger getP() { return this.p; } /** - * Returns the sub-prime q. + * Returns the sub-prime {@code q}. * - * @return the sub-prime q. + * @return the sub-prime {@code q}. */ public BigInteger getQ() { return this.q; } /** - * Returns the base g. + * Returns the base {@code g}. * - * @return the base g. + * @return the base {@code g}. */ public BigInteger getG() { return this.g; diff --git a/jdk/src/share/classes/java/security/spec/DSAPrivateKeySpec.java b/jdk/src/share/classes/java/security/spec/DSAPrivateKeySpec.java index 44d6859fd6c..a004de75db3 100644 --- a/jdk/src/share/classes/java/security/spec/DSAPrivateKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/DSAPrivateKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,36 +69,36 @@ public class DSAPrivateKeySpec implements KeySpec { } /** - * Returns the private key x. + * Returns the private key {@code x}. * - * @return the private key x. + * @return the private key {@code x}. */ public BigInteger getX() { return this.x; } /** - * Returns the prime p. + * Returns the prime {@code p}. * - * @return the prime p. + * @return the prime {@code p}. */ public BigInteger getP() { return this.p; } /** - * Returns the sub-prime q. + * Returns the sub-prime {@code q}. * - * @return the sub-prime q. + * @return the sub-prime {@code q}. */ public BigInteger getQ() { return this.q; } /** - * Returns the base g. + * Returns the base {@code g}. * - * @return the base g. + * @return the base {@code g}. */ public BigInteger getG() { return this.g; diff --git a/jdk/src/share/classes/java/security/spec/DSAPublicKeySpec.java b/jdk/src/share/classes/java/security/spec/DSAPublicKeySpec.java index 2dfc7384298..a56e6f9c08e 100644 --- a/jdk/src/share/classes/java/security/spec/DSAPublicKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/DSAPublicKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,36 +69,36 @@ public class DSAPublicKeySpec implements KeySpec { } /** - * Returns the public key y. + * Returns the public key {@code y}. * - * @return the public key y. + * @return the public key {@code y}. */ public BigInteger getY() { return this.y; } /** - * Returns the prime p. + * Returns the prime {@code p}. * - * @return the prime p. + * @return the prime {@code p}. */ public BigInteger getP() { return this.p; } /** - * Returns the sub-prime q. + * Returns the sub-prime {@code q}. * - * @return the sub-prime q. + * @return the sub-prime {@code q}. */ public BigInteger getQ() { return this.q; } /** - * Returns the base g. + * Returns the base {@code g}. * - * @return the base g. + * @return the base {@code g}. */ public BigInteger getG() { return this.g; diff --git a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java index f271ccbd350..58843ab67da 100644 --- a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java +++ b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,9 +45,9 @@ public class ECFieldF2m implements ECField { /** * Creates an elliptic curve characteristic 2 finite - * field which has 2^m elements with normal basis. - * @param m with 2^m being the number of elements. - * @exception IllegalArgumentException if m + * field which has 2^{@code m} elements with normal basis. + * @param m with 2^{@code m} being the number of elements. + * @exception IllegalArgumentException if {@code m} * is not positive. */ public ECFieldF2m(int m) { @@ -61,24 +61,24 @@ public class ECFieldF2m implements ECField { /** * Creates an elliptic curve characteristic 2 finite - * field which has 2^m elements with + * field which has 2^{@code m} elements with * polynomial basis. * The reduction polynomial for this field is based - * on rp whose i-th bit correspondes to + * on {@code rp} whose i-th bit correspondes to * the i-th coefficient of the reduction polynomial.

      * Note: A valid reduction polynomial is either a - * trinomial (X^m + X^k + 1 - * with m > k >= 1) or a - * pentanomial (X^m + X^k3 - * + X^k2 + X^k1 + 1 with - * m > k3 > k2 - * > k1 >= 1). - * @param m with 2^m being the number of elements. + * trinomial (X^{@code m} + X^{@code k} + 1 + * with {@code m} > {@code k} >= 1) or a + * pentanomial (X^{@code m} + X^{@code k3} + * + X^{@code k2} + X^{@code k1} + 1 with + * {@code m} > {@code k3} > {@code k2} + * > {@code k1} >= 1). + * @param m with 2^{@code m} being the number of elements. * @param rp the BigInteger whose i-th bit corresponds to * the i-th coefficient of the reduction polynomial. - * @exception NullPointerException if rp is null. - * @exception IllegalArgumentException if m - * is not positive, or rp does not represent + * @exception NullPointerException if {@code rp} is null. + * @exception IllegalArgumentException if {@code m} + * is not positive, or {@code rp} does not represent * a valid reduction polynomial. */ public ECFieldF2m(int m, BigInteger rp) { @@ -106,28 +106,28 @@ public class ECFieldF2m implements ECField { /** * Creates an elliptic curve characteristic 2 finite - * field which has 2^m elements with + * field which has 2^{@code m} elements with * polynomial basis. The reduction polynomial for this - * field is based on ks whose content + * field is based on {@code ks} whose content * contains the order of the middle term(s) of the * reduction polynomial. * Note: A valid reduction polynomial is either a - * trinomial (X^m + X^k + 1 - * with m > k >= 1) or a - * pentanomial (X^m + X^k3 - * + X^k2 + X^k1 + 1 with - * m > k3 > k2 - * > k1 >= 1), so ks should + * trinomial (X^{@code m} + X^{@code k} + 1 + * with {@code m} > {@code k} >= 1) or a + * pentanomial (X^{@code m} + X^{@code k3} + * + X^{@code k2} + X^{@code k1} + 1 with + * {@code m} > {@code k3} > {@code k2} + * > {@code k1} >= 1), so {@code ks} should * have length 1 or 3. - * @param m with 2^m being the number of elements. + * @param m with 2^{@code m} being the number of elements. * @param ks the order of the middle term(s) of the * reduction polynomial. Contents of this array are copied * to protect against subsequent modification. - * @exception NullPointerException if ks is null. - * @exception IllegalArgumentException ifm - * is not positive, or the length of ks - * is neither 1 nor 3, or values in ks - * are not between m-1 and 1 (inclusive) + * @exception NullPointerException if {@code ks} is null. + * @exception IllegalArgumentException if{@code m} + * is not positive, or the length of {@code ks} + * is neither 1 nor 3, or values in {@code ks} + * are not between {@code m}-1 and 1 (inclusive) * and in descending order. */ public ECFieldF2m(int m, int[] ks) { @@ -160,7 +160,7 @@ public class ECFieldF2m implements ECField { } /** - * Returns the field size in bits which is m + * Returns the field size in bits which is {@code m} * for this characteristic 2 finite field. * @return the field size in bits. */ @@ -169,9 +169,9 @@ public class ECFieldF2m implements ECField { } /** - * Returns the value m of this characteristic + * Returns the value {@code m} of this characteristic * 2 finite field. - * @return m with 2^m being the + * @return {@code m} with 2^{@code m} being the * number of elements. */ public int getM() { @@ -211,8 +211,8 @@ public class ECFieldF2m implements ECField { * Compares this finite field for equality with the * specified object. * @param obj the object to be compared. - * @return true if obj is an instance - * of ECFieldF2m and both m and the reduction + * @return true if {@code obj} is an instance + * of ECFieldF2m and both {@code m} and the reduction * polynomial match, false otherwise. */ public boolean equals(Object obj) { diff --git a/jdk/src/share/classes/java/security/spec/ECFieldFp.java b/jdk/src/share/classes/java/security/spec/ECFieldFp.java index 183549981db..c578962d3c2 100644 --- a/jdk/src/share/classes/java/security/spec/ECFieldFp.java +++ b/jdk/src/share/classes/java/security/spec/ECFieldFp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,10 +43,10 @@ public class ECFieldFp implements ECField { /** * Creates an elliptic curve prime finite field - * with the specified prime p. + * with the specified prime {@code p}. * @param p the prime. - * @exception NullPointerException if p is null. - * @exception IllegalArgumentException if p + * @exception NullPointerException if {@code p} is null. + * @exception IllegalArgumentException if {@code p} * is not positive. */ public ECFieldFp(BigInteger p) { @@ -66,7 +66,7 @@ public class ECFieldFp implements ECField { }; /** - * Returns the prime p of this prime finite field. + * Returns the prime {@code p} of this prime finite field. * @return the prime. */ public BigInteger getP() { @@ -77,7 +77,7 @@ public class ECFieldFp implements ECField { * Compares this prime finite field for equality with the * specified object. * @param obj the object to be compared. - * @return true if obj is an instance + * @return true if {@code obj} is an instance * of ECFieldFp and the prime value match, false otherwise. */ public boolean equals(Object obj) { diff --git a/jdk/src/share/classes/java/security/spec/ECGenParameterSpec.java b/jdk/src/share/classes/java/security/spec/ECGenParameterSpec.java index da1694541b5..4f3f63b873a 100644 --- a/jdk/src/share/classes/java/security/spec/ECGenParameterSpec.java +++ b/jdk/src/share/classes/java/security/spec/ECGenParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,13 +41,13 @@ public class ECGenParameterSpec implements AlgorithmParameterSpec { /** * Creates a parameter specification for EC parameter * generation using a standard (or predefined) name - * stdName in order to generate the corresponding + * {@code stdName} in order to generate the corresponding * (precomputed) elliptic curve domain parameters. For the * list of supported names, please consult the documentation * of provider whose implementation will be used. * @param stdName the standard name of the to-be-generated EC * domain parameters. - * @exception NullPointerException if stdName + * @exception NullPointerException if {@code stdName} * is null. */ public ECGenParameterSpec(String stdName) { diff --git a/jdk/src/share/classes/java/security/spec/ECParameterSpec.java b/jdk/src/share/classes/java/security/spec/ECParameterSpec.java index 8837516e3bf..3f7cae3b82b 100644 --- a/jdk/src/share/classes/java/security/spec/ECParameterSpec.java +++ b/jdk/src/share/classes/java/security/spec/ECParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,12 +49,12 @@ public class ECParameterSpec implements AlgorithmParameterSpec { * @param curve the elliptic curve which this parameter * defines. * @param g the generator which is also known as the base point. - * @param n the order of the generator g. + * @param n the order of the generator {@code g}. * @param h the cofactor. - * @exception NullPointerException if curve, - * g, or n is null. - * @exception IllegalArgumentException if n - * or h is not positive. + * @exception NullPointerException if {@code curve}, + * {@code g}, or {@code n} is null. + * @exception IllegalArgumentException if {@code n} + * or {@code h} is not positive. */ public ECParameterSpec(EllipticCurve curve, ECPoint g, BigInteger n, int h) { diff --git a/jdk/src/share/classes/java/security/spec/ECPoint.java b/jdk/src/share/classes/java/security/spec/ECPoint.java index 0c2ce57d96c..1b051c71a13 100644 --- a/jdk/src/share/classes/java/security/spec/ECPoint.java +++ b/jdk/src/share/classes/java/security/spec/ECPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,11 +54,11 @@ public class ECPoint { /** * Creates an ECPoint from the specified affine x-coordinate - * x and affine y-coordinate y. + * {@code x} and affine y-coordinate {@code y}. * @param x the affine x-coordinate. * @param y the affine y-coordinate. - * @exception NullPointerException if x or - * y is null. + * @exception NullPointerException if {@code x} or + * {@code y} is null. */ public ECPoint(BigInteger x, BigInteger y) { if ((x==null) || (y==null)) { @@ -69,7 +69,7 @@ public class ECPoint { } /** - * Returns the affine x-coordinate x. + * Returns the affine x-coordinate {@code x}. * Note: POINT_INFINITY has a null affine x-coordinate. * @return the affine x-coordinate. */ @@ -78,7 +78,7 @@ public class ECPoint { } /** - * Returns the affine y-coordinate y. + * Returns the affine y-coordinate {@code y}. * Note: POINT_INFINITY has a null affine y-coordinate. * @return the affine y-coordinate. */ @@ -90,7 +90,7 @@ public class ECPoint { * Compares this elliptic curve point for equality with * the specified object. * @param obj the object to be compared. - * @return true if obj is an instance of + * @return true if {@code obj} is an instance of * ECPoint and the affine coordinates match, false otherwise. */ public boolean equals(Object obj) { diff --git a/jdk/src/share/classes/java/security/spec/ECPrivateKeySpec.java b/jdk/src/share/classes/java/security/spec/ECPrivateKeySpec.java index c8e2c408a86..7f03cfd49e6 100644 --- a/jdk/src/share/classes/java/security/spec/ECPrivateKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/ECPrivateKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,8 +48,8 @@ public class ECPrivateKeySpec implements KeySpec { * @param s the private value. * @param params the associated elliptic curve domain * parameters. - * @exception NullPointerException if s - * or params is null. + * @exception NullPointerException if {@code s} + * or {@code params} is null. */ public ECPrivateKeySpec(BigInteger s, ECParameterSpec params) { if (s == null) { diff --git a/jdk/src/share/classes/java/security/spec/ECPublicKeySpec.java b/jdk/src/share/classes/java/security/spec/ECPublicKeySpec.java index 2d8b510ecbd..e0cfb777c50 100644 --- a/jdk/src/share/classes/java/security/spec/ECPublicKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/ECPublicKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,9 +47,9 @@ public class ECPublicKeySpec implements KeySpec { * @param w the public point. * @param params the associated elliptic curve domain * parameters. - * @exception NullPointerException if w - * or params is null. - * @exception IllegalArgumentException if w + * @exception NullPointerException if {@code w} + * or {@code params} is null. + * @exception IllegalArgumentException if {@code w} * is point at infinity, i.e. ECPoint.POINT_INFINITY */ public ECPublicKeySpec(ECPoint w, ECParameterSpec params) { diff --git a/jdk/src/share/classes/java/security/spec/EllipticCurve.java b/jdk/src/share/classes/java/security/spec/EllipticCurve.java index a270ee72494..8ec97b05ed3 100644 --- a/jdk/src/share/classes/java/security/spec/EllipticCurve.java +++ b/jdk/src/share/classes/java/security/spec/EllipticCurve.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,15 +68,15 @@ public class EllipticCurve { /** * Creates an elliptic curve with the specified elliptic field - * field and the coefficients a and - * b. + * {@code field} and the coefficients {@code a} and + * {@code b}. * @param field the finite field that this elliptic curve is over. * @param a the first coefficient of this elliptic curve. * @param b the second coefficient of this elliptic curve. - * @exception NullPointerException if field, - * a, or b is null. - * @exception IllegalArgumentException if a - * or b is not null and not in field. + * @exception NullPointerException if {@code field}, + * {@code a}, or {@code b} is null. + * @exception IllegalArgumentException if {@code a} + * or {@code b} is not null and not in {@code field}. */ public EllipticCurve(ECField field, BigInteger a, BigInteger b) { @@ -85,18 +85,18 @@ public class EllipticCurve { /** * Creates an elliptic curve with the specified elliptic field - * field, the coefficients a and - * b, and the seed used for curve generation. + * {@code field}, the coefficients {@code a} and + * {@code b}, and the {@code seed} used for curve generation. * @param field the finite field that this elliptic curve is over. * @param a the first coefficient of this elliptic curve. * @param b the second coefficient of this elliptic curve. * @param seed the bytes used during curve generation for later * validation. Contents of this array are copied to protect against * subsequent modification. - * @exception NullPointerException if field, - * a, or b is null. - * @exception IllegalArgumentException if a - * or b is not null and not in field. + * @exception NullPointerException if {@code field}, + * {@code a}, or {@code b} is null. + * @exception IllegalArgumentException if {@code a} + * or {@code b} is not null and not in {@code field}. */ public EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed) { @@ -122,9 +122,9 @@ public class EllipticCurve { } /** - * Returns the finite field field that this + * Returns the finite field {@code field} that this * elliptic curve is over. - * @return the field field that this curve + * @return the field {@code field} that this curve * is over. */ public ECField getField() { @@ -132,27 +132,27 @@ public class EllipticCurve { } /** - * Returns the first coefficient a of the + * Returns the first coefficient {@code a} of the * elliptic curve. - * @return the first coefficient a. + * @return the first coefficient {@code a}. */ public BigInteger getA() { return a; } /** - * Returns the second coefficient b of the + * Returns the second coefficient {@code b} of the * elliptic curve. - * @return the second coefficient b. + * @return the second coefficient {@code b}. */ public BigInteger getB() { return b; } /** - * Returns the seeding bytes seed used + * Returns the seeding bytes {@code seed} used * during curve generation. May be null if not specified. - * @return the seeding bytes seed. A new + * @return the seeding bytes {@code seed}. A new * array is returned each time this method is called. */ public byte[] getSeed() { @@ -164,7 +164,7 @@ public class EllipticCurve { * Compares this elliptic curve for equality with the * specified object. * @param obj the object to be compared. - * @return true if obj is an instance of + * @return true if {@code obj} is an instance of * EllipticCurve and the field, A, and B match, false otherwise. */ public boolean equals(Object obj) { @@ -184,9 +184,9 @@ public class EllipticCurve { * Returns a hash code value for this elliptic curve. * @return a hash code value computed from the hash codes of the field, A, * and B, as follows: - * + *

      {@code
            *     (field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2)
      -     * 
      +     * }
      */ public int hashCode() { return (field.hashCode() << 6 + diff --git a/jdk/src/share/classes/java/security/spec/EncodedKeySpec.java b/jdk/src/share/classes/java/security/spec/EncodedKeySpec.java index b58781921d2..cc3b81e6ab3 100644 --- a/jdk/src/share/classes/java/security/spec/EncodedKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ public abstract class EncodedKeySpec implements KeySpec { * * @param encodedKey the encoded key. The contents of the * array are copied to protect against subsequent modification. - * @exception NullPointerException if encodedKey + * @exception NullPointerException if {@code encodedKey} * is null. */ public EncodedKeySpec(byte[] encodedKey) { @@ -74,9 +74,9 @@ public abstract class EncodedKeySpec implements KeySpec { * (see {@link java.security.Key Key}) can be transformed * (see {@link java.security.KeyFactory KeyFactory}) * into this key specification (or a subclass of it), - * getFormat called + * {@code getFormat} called * on the opaque key returns the same value as the - * getFormat method + * {@code getFormat} method * of this key specification. * * @return a string representation of the encoding format. diff --git a/jdk/src/share/classes/java/security/spec/InvalidKeySpecException.java b/jdk/src/share/classes/java/security/spec/InvalidKeySpecException.java index 670913d1366..4655c4abe0c 100644 --- a/jdk/src/share/classes/java/security/spec/InvalidKeySpecException.java +++ b/jdk/src/share/classes/java/security/spec/InvalidKeySpecException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,13 +63,13 @@ public class InvalidKeySpecException extends GeneralSecurityException { } /** - * Creates a InvalidKeySpecException with the specified + * Creates a {@code InvalidKeySpecException} with the specified * detail message and cause. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ @@ -78,13 +78,13 @@ public class InvalidKeySpecException extends GeneralSecurityException { } /** - * Creates a InvalidKeySpecException with the specified cause - * and a detail message of (cause==null ? null : cause.toString()) + * Creates a {@code InvalidKeySpecException} with the specified cause + * and a detail message of {@code (cause==null ? null : cause.toString())} * (which typically contains the class and detail message of - * cause). + * {@code cause}). * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A null value is permitted, + * {@link #getCause()} method). (A {@code null} value is permitted, * and indicates that the cause is nonexistent or unknown.) * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/spec/KeySpec.java b/jdk/src/share/classes/java/security/spec/KeySpec.java index 26c9777ef07..34fec5d3125 100644 --- a/jdk/src/share/classes/java/security/spec/KeySpec.java +++ b/jdk/src/share/classes/java/security/spec/KeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,7 @@ package java.security.spec; *

      A key may be specified in an algorithm-specific way, or in an * algorithm-independent encoding format (such as ASN.1). * For example, a DSA private key may be specified by its components - * x, p, q, and g + * {@code x}, {@code p}, {@code q}, and {@code g} * (see {@link DSAPrivateKeySpec}), or it may be * specified using its DER encoding * (see {@link PKCS8EncodedKeySpec}). diff --git a/jdk/src/share/classes/java/security/spec/MGF1ParameterSpec.java b/jdk/src/share/classes/java/security/spec/MGF1ParameterSpec.java index c1f1de37130..1be267f0ced 100644 --- a/jdk/src/share/classes/java/security/spec/MGF1ParameterSpec.java +++ b/jdk/src/share/classes/java/security/spec/MGF1ParameterSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,7 @@ public class MGF1ParameterSpec implements AlgorithmParameterSpec { * * @param mdName the algorithm name for the message digest * used in this mask generation function MGF1. - * @exception NullPointerException if mdName is null. + * @exception NullPointerException if {@code mdName} is null. */ public MGF1ParameterSpec(String mdName) { if (mdName == null) { diff --git a/jdk/src/share/classes/java/security/spec/PKCS8EncodedKeySpec.java b/jdk/src/share/classes/java/security/spec/PKCS8EncodedKeySpec.java index b6dabad364b..060f266fcb1 100644 --- a/jdk/src/share/classes/java/security/spec/PKCS8EncodedKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/PKCS8EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ package java.security.spec; /** * This class represents the ASN.1 encoding of a private key, - * encoded according to the ASN.1 type PrivateKeyInfo. - * The PrivateKeyInfo syntax is defined in the PKCS#8 standard + * encoded according to the ASN.1 type {@code PrivateKeyInfo}. + * The {@code PrivateKeyInfo} syntax is defined in the PKCS#8 standard * as follows: * *

      @@ -67,7 +67,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec {
            * @param encodedKey the key, which is assumed to be
            * encoded according to the PKCS #8 standard. The contents of
            * the array are copied to protect against subsequent modification.
      -     * @exception NullPointerException if encodedKey
      +     * @exception NullPointerException if {@code encodedKey}
            * is null.
            */
           public PKCS8EncodedKeySpec(byte[] encodedKey) {
      @@ -88,7 +88,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec {
            * Returns the name of the encoding format associated with this
            * key specification.
            *
      -     * @return the string "PKCS#8".
      +     * @return the string {@code "PKCS#8"}.
            */
           public final String getFormat() {
               return "PKCS#8";
      diff --git a/jdk/src/share/classes/java/security/spec/PSSParameterSpec.java b/jdk/src/share/classes/java/security/spec/PSSParameterSpec.java
      index 37a2eeb2625..a9b82d8e42b 100644
      --- a/jdk/src/share/classes/java/security/spec/PSSParameterSpec.java
      +++ b/jdk/src/share/classes/java/security/spec/PSSParameterSpec.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
        * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        *
        * This code is free software; you can redistribute it and/or modify it
      @@ -91,14 +91,14 @@ public class PSSParameterSpec implements AlgorithmParameterSpec {
           public static final PSSParameterSpec DEFAULT = new PSSParameterSpec();
       
           /**
      -     * Constructs a new PSSParameterSpec as defined in
      +     * Constructs a new {@code PSSParameterSpec} as defined in
            * the PKCS #1 standard using the default values.
            */
           private PSSParameterSpec() {
           }
       
           /**
      -     * Creates a new PSSParameterSpec as defined in
      +     * Creates a new {@code PSSParameterSpec} as defined in
            * the PKCS #1 standard using the specified message digest,
            * mask generation function, parameters for mask generation
            * function, salt length, and trailer field values.
      @@ -111,10 +111,10 @@ public class PSSParameterSpec implements AlgorithmParameterSpec {
            * getMGFParameters().
            * @param saltLen the length of salt.
            * @param trailerField the value of the trailer field.
      -     * @exception NullPointerException if mdName,
      -     * or mgfName is null.
      -     * @exception IllegalArgumentException if saltLen
      -     * or trailerField is less than 0.
      +     * @exception NullPointerException if {@code mdName},
      +     * or {@code mgfName} is null.
      +     * @exception IllegalArgumentException if {@code saltLen}
      +     * or {@code trailerField} is less than 0.
            * @since 1.5
            */
           public PSSParameterSpec(String mdName, String mgfName,
      @@ -143,13 +143,13 @@ public class PSSParameterSpec implements AlgorithmParameterSpec {
           }
       
           /**
      -     * Creates a new PSSParameterSpec
      +     * Creates a new {@code PSSParameterSpec}
            * using the specified salt length and other default values as
            * defined in PKCS#1.
            *
            * @param saltLen the length of salt in bits to be used in PKCS#1
            * PSS encoding.
      -     * @exception IllegalArgumentException if saltLen is
      +     * @exception IllegalArgumentException if {@code saltLen} is
            * less than 0.
            */
           public PSSParameterSpec(int saltLen) {
      diff --git a/jdk/src/share/classes/java/security/spec/RSAKeyGenParameterSpec.java b/jdk/src/share/classes/java/security/spec/RSAKeyGenParameterSpec.java
      index e9a10fa58a8..a73c6cd46b7 100644
      --- a/jdk/src/share/classes/java/security/spec/RSAKeyGenParameterSpec.java
      +++ b/jdk/src/share/classes/java/security/spec/RSAKeyGenParameterSpec.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
        * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        *
        * This code is free software; you can redistribute it and/or modify it
      @@ -55,7 +55,7 @@ public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec {
           public static final BigInteger F4 = BigInteger.valueOf(65537);
       
           /**
      -     * Constructs a new RSAParameterSpec object from the
      +     * Constructs a new {@code RSAParameterSpec} object from the
            * given keysize and public-exponent value.
            *
            * @param keysize the modulus size (specified in number of bits)
      diff --git a/jdk/src/share/classes/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java b/jdk/src/share/classes/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
      index 97346d6e22a..a198e43a2e1 100644
      --- a/jdk/src/share/classes/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
      +++ b/jdk/src/share/classes/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
        * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        *
        * This code is free software; you can redistribute it and/or modify it
      @@ -57,12 +57,12 @@ public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec {
           private final RSAOtherPrimeInfo otherPrimeInfo[];
       
          /**
      -    * Creates a new RSAMultiPrimePrivateCrtKeySpec
      +    * Creates a new {@code RSAMultiPrimePrivateCrtKeySpec}
           * given the modulus, publicExponent, privateExponent,
           * primeP, primeQ, primeExponentP, primeExponentQ,
           * crtCoefficient, and otherPrimeInfo as defined in PKCS#1 v2.1.
           *
      -    * 

      Note that the contents of otherPrimeInfo + *

      Note that the contents of {@code otherPrimeInfo} * are copied to protect against subsequent modification when * constructing this object. * @@ -78,13 +78,13 @@ public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec { * @param otherPrimeInfo triplets of the rest of primes, null can be * specified if there are only two prime factors (p and q). * @exception NullPointerException if any of the parameters, i.e. - * modulus, - * publicExponent, privateExponent, - * primeP, primeQ, - * primeExponentP, primeExponentQ, - * crtCoefficient, is null. + * {@code modulus}, + * {@code publicExponent}, {@code privateExponent}, + * {@code primeP}, {@code primeQ}, + * {@code primeExponentP}, {@code primeExponentQ}, + * {@code crtCoefficient}, is null. * @exception IllegalArgumentException if an empty, i.e. 0-length, - * otherPrimeInfo is specified. + * {@code otherPrimeInfo} is specified. */ public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, diff --git a/jdk/src/share/classes/java/security/spec/RSAOtherPrimeInfo.java b/jdk/src/share/classes/java/security/spec/RSAOtherPrimeInfo.java index e0889152dcd..10d8471765d 100644 --- a/jdk/src/share/classes/java/security/spec/RSAOtherPrimeInfo.java +++ b/jdk/src/share/classes/java/security/spec/RSAOtherPrimeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ public class RSAOtherPrimeInfo { /** - * Creates a new RSAOtherPrimeInfo + * Creates a new {@code RSAOtherPrimeInfo} * given the prime, primeExponent, and * crtCoefficient as defined in PKCS#1. * @@ -67,8 +67,8 @@ public class RSAOtherPrimeInfo { * @param crtCoefficient the Chinese Remainder Theorem * coefficient. * @exception NullPointerException if any of the parameters, i.e. - * prime, primeExponent, - * crtCoefficient, is null. + * {@code prime}, {@code primeExponent}, + * {@code crtCoefficient}, is null. * */ public RSAOtherPrimeInfo(BigInteger prime, diff --git a/jdk/src/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java b/jdk/src/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java index c8d8faa5e53..d0ba70be443 100644 --- a/jdk/src/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/RSAPrivateCrtKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec { /** - * Creates a new RSAPrivateCrtKeySpec + * Creates a new {@code RSAPrivateCrtKeySpec} * given the modulus, publicExponent, privateExponent, * primeP, primeQ, primeExponentP, primeExponentQ, and * crtCoefficient as defined in PKCS#1. diff --git a/jdk/src/share/classes/java/security/spec/X509EncodedKeySpec.java b/jdk/src/share/classes/java/security/spec/X509EncodedKeySpec.java index 7dd3d7bf244..b9984de87e3 100644 --- a/jdk/src/share/classes/java/security/spec/X509EncodedKeySpec.java +++ b/jdk/src/share/classes/java/security/spec/X509EncodedKeySpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ package java.security.spec; /** * This class represents the ASN.1 encoding of a public key, - * encoded according to the ASN.1 type SubjectPublicKeyInfo. - * The SubjectPublicKeyInfo syntax is defined in the X.509 + * encoded according to the ASN.1 type {@code SubjectPublicKeyInfo}. + * The {@code SubjectPublicKeyInfo} syntax is defined in the X.509 * standard as follows: * *

      @@ -57,7 +57,7 @@ public class X509EncodedKeySpec extends EncodedKeySpec {
            * @param encodedKey the key, which is assumed to be
            * encoded according to the X.509 standard. The contents of the
            * array are copied to protect against subsequent modification.
      -     * @exception NullPointerException if encodedKey
      +     * @exception NullPointerException if {@code encodedKey}
            * is null.
            */
           public X509EncodedKeySpec(byte[] encodedKey) {
      @@ -78,7 +78,7 @@ public class X509EncodedKeySpec extends EncodedKeySpec {
            * Returns the name of the encoding format associated with this
            * key specification.
            *
      -     * @return the string "X.509".
      +     * @return the string {@code "X.509"}.
            */
           public final String getFormat() {
               return "X.509";
      diff --git a/jdk/src/share/classes/java/security/spec/package-info.java b/jdk/src/share/classes/java/security/spec/package-info.java
      new file mode 100644
      index 00000000000..cb393088e5b
      --- /dev/null
      +++ b/jdk/src/share/classes/java/security/spec/package-info.java
      @@ -0,0 +1,73 @@
      +/*
      + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
      + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      + *
      + * This code is free software; you can redistribute it and/or modify it
      + * 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.
      + */
      +
      +/**
      + * Provides classes and interfaces for key specifications and algorithm
      + * parameter specifications.
      + *
      + * 

      A key specification is a transparent representation of the key material + * that constitutes a key. A key may be specified in an algorithm-specific + * way, or in an algorithm-independent encoding format (such as ASN.1). + * This package contains key specifications for DSA public and private keys, + * RSA public and private keys, PKCS #8 private keys in DER-encoded format, + * and X.509 public and private keys in DER-encoded format. + * + *

      An algorithm parameter specification is a transparent representation + * of the sets of parameters used with an algorithm. This package contains + * an algorithm parameter specification for parameters used with the + * DSA algorithm. + * + *

      Package Specification

      + * + *
        + *
      • PKCS #1: RSA Encryption Standard, Version 1.5, November 1993
      • + *
      • PKCS #8: Private-Key Information Syntax Standard, + * Version 1.2, November 1993
      • + *
      • Federal Information Processing Standards Publication (FIPS PUB) 186: + * Digital Signature Standard (DSS)
      • + *
      + * + *

      Related Documentation

      + * + * For documentation that includes information about algorithm parameter + * and key specifications, please see: + * + * + * @since 1.2 + */ +package java.security.spec; diff --git a/jdk/src/share/classes/java/security/spec/package.html b/jdk/src/share/classes/java/security/spec/package.html deleted file mode 100644 index 54558ae198a..00000000000 --- a/jdk/src/share/classes/java/security/spec/package.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - -Provides classes and interfaces for key specifications and algorithm -parameter specifications. - -

      A key specification is a transparent representation of the key material -that constitutes a key. A key may be specified in an algorithm-specific -way, or in an algorithm-independent encoding format (such as ASN.1). -This package contains key specifications for DSA public and private keys, -RSA public and private keys, PKCS #8 private keys in DER-encoded format, -and X.509 public and private keys in DER-encoded format. - -

      An algorithm parameter specification is a transparent representation -of the sets of parameters used with an algorithm. This package contains -an algorithm parameter specification for parameters used with the -DSA algorithm. - -

      Package Specification

      - -
        -
      • PKCS #1: RSA Encryption Standard, Version 1.5, November 1993
      • -
      • PKCS #8: Private-Key Information Syntax Standard, - Version 1.2, November 1993
      • -
      • Federal Information Processing Standards Publication (FIPS PUB) 186: - Digital Signature Standard (DSS)
      • -
      - -

      Related Documentation

      - -For documentation that includes information about algorithm parameter -and key specifications, please see: - - -@since 1.2 - - diff --git a/jdk/src/share/classes/java/sql/Blob.java b/jdk/src/share/classes/java/sql/Blob.java index 46b7c2f2013..90bb251c07b 100644 --- a/jdk/src/share/classes/java/sql/Blob.java +++ b/jdk/src/share/classes/java/sql/Blob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ import java.io.InputStream; /** * The representation (mapping) in - * the JavaTM programming + * the Java™ programming * language of an SQL * BLOB value. An SQL BLOB is a built-in type * that stores a Binary Large Object as a column value in a row of diff --git a/jdk/src/share/classes/java/sql/CallableStatement.java b/jdk/src/share/classes/java/sql/CallableStatement.java index a39af405220..dc98859bf8b 100644 --- a/jdk/src/share/classes/java/sql/CallableStatement.java +++ b/jdk/src/share/classes/java/sql/CallableStatement.java @@ -2445,6 +2445,7 @@ public interface CallableStatement extends PreparedStatement { * @param parameterIndex the first parameter is 1, the second is 2, and so on * @param type Class representing the Java data type to convert the * designated parameter to. + * @param the type of the class modeled by this Class object * @return an instance of {@code type} holding the OUT parameter value * @throws SQLException if conversion is not supported, type is null or * another error occurs. The getCause() method of the @@ -2473,6 +2474,7 @@ public interface CallableStatement extends PreparedStatement { * @param parameterName the name of the parameter * @param type Class representing the Java data type to convert * the designated parameter to. + * @param the type of the class modeled by this Class object * @return an instance of {@code type} holding the OUT parameter * value * @throws SQLException if conversion is not supported, type is null or diff --git a/jdk/src/share/classes/java/sql/Clob.java b/jdk/src/share/classes/java/sql/Clob.java index 868c862a013..8ffc38af754 100644 --- a/jdk/src/share/classes/java/sql/Clob.java +++ b/jdk/src/share/classes/java/sql/Clob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ package java.sql; import java.io.Reader; /** - * The mapping in the JavaTM programming language + * The mapping in the Java™ programming language * for the SQL CLOB type. * An SQL CLOB is a built-in type * that stores a Character Large Object as a column value in a row of diff --git a/jdk/src/share/classes/java/sql/DatabaseMetaData.java b/jdk/src/share/classes/java/sql/DatabaseMetaData.java index 7330b8eac02..63c6f131c4f 100644 --- a/jdk/src/share/classes/java/sql/DatabaseMetaData.java +++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java @@ -31,7 +31,7 @@ package java.sql; *

      * This interface is implemented by driver vendors to let users know the capabilities * of a Database Management System (DBMS) in combination with - * the driver based on JDBCTM technology + * the driver based on JDBC™ technology * ("JDBC driver") that is used with it. Different relational DBMSs often support * different features, implement features in different ways, and use different * data types. In addition, a driver may implement a feature on top of what the @@ -1218,21 +1218,21 @@ public interface DatabaseMetaData extends Wrapper { * *

      Each procedure description has the the following columns: *

        - *
      1. PROCEDURE_CAT String => procedure catalog (may be null) - *
      2. PROCEDURE_SCHEM String => procedure schema (may be null) - *
      3. PROCEDURE_NAME String => procedure name + *
      4. PROCEDURE_CAT String {@code =>} procedure catalog (may be null) + *
      5. PROCEDURE_SCHEM String {@code =>} procedure schema (may be null) + *
      6. PROCEDURE_NAME String {@code =>} procedure name *
      7. reserved for future use *
      8. reserved for future use *
      9. reserved for future use - *
      10. REMARKS String => explanatory comment on the procedure - *
      11. PROCEDURE_TYPE short => kind of procedure: + *
      12. REMARKS String {@code =>} explanatory comment on the procedure + *
      13. PROCEDURE_TYPE short {@code =>} kind of procedure: *
          *
        • procedureResultUnknown - Cannot determine if a return value * will be returned *
        • procedureNoResult - Does not return a return value *
        • procedureReturnsResult - Returns a return value *
        - *
      14. SPECIFIC_NAME String => The name which uniquely identifies this + *
      15. SPECIFIC_NAME String {@code =>} The name which uniquely identifies this * procedure within its schema. *
      *

      @@ -1297,11 +1297,11 @@ public interface DatabaseMetaData extends Wrapper { *

      Each row in the ResultSet is a parameter description or * column description with the following fields: *

        - *
      1. PROCEDURE_CAT String => procedure catalog (may be null) - *
      2. PROCEDURE_SCHEM String => procedure schema (may be null) - *
      3. PROCEDURE_NAME String => procedure name - *
      4. COLUMN_NAME String => column/parameter name - *
      5. COLUMN_TYPE Short => kind of column/parameter: + *
      6. PROCEDURE_CAT String {@code =>} procedure catalog (may be null) + *
      7. PROCEDURE_SCHEM String {@code =>} procedure schema (may be null) + *
      8. PROCEDURE_NAME String {@code =>} procedure name + *
      9. COLUMN_NAME String {@code =>} column/parameter name + *
      10. COLUMN_TYPE Short {@code =>} kind of column/parameter: *
          *
        • procedureColumnUnknown - nobody knows *
        • procedureColumnIn - IN parameter @@ -1310,44 +1310,44 @@ public interface DatabaseMetaData extends Wrapper { *
        • procedureColumnReturn - procedure return value *
        • procedureColumnResult - result column in ResultSet *
        - *
      11. DATA_TYPE int => SQL type from java.sql.Types - *
      12. TYPE_NAME String => SQL type name, for a UDT type the + *
      13. DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
      14. TYPE_NAME String {@code =>} SQL type name, for a UDT type the * type name is fully qualified - *
      15. PRECISION int => precision - *
      16. LENGTH int => length in bytes of data - *
      17. SCALE short => scale - null is returned for data types where + *
      18. PRECISION int {@code =>} precision + *
      19. LENGTH int {@code =>} length in bytes of data + *
      20. SCALE short {@code =>} scale - null is returned for data types where * SCALE is not applicable. - *
      21. RADIX short => radix - *
      22. NULLABLE short => can it contain NULL. + *
      23. RADIX short {@code =>} radix + *
      24. NULLABLE short {@code =>} can it contain NULL. *
          *
        • procedureNoNulls - does not allow NULL values *
        • procedureNullable - allows NULL values *
        • procedureNullableUnknown - nullability unknown *
        - *
      25. REMARKS String => comment describing parameter/column - *
      26. COLUMN_DEF String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) + *
      27. REMARKS String {@code =>} comment describing parameter/column + *
      28. COLUMN_DEF String {@code =>} default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) *
          *
        • The string NULL (not enclosed in quotes) - if NULL was specified as the default value *
        • TRUNCATE (not enclosed in quotes) - if the specified default value cannot be represented without truncation *
        • NULL - if a default value was not specified *
        - *
      29. SQL_DATA_TYPE int => reserved for future use - *
      30. SQL_DATETIME_SUB int => reserved for future use - *
      31. CHAR_OCTET_LENGTH int => the maximum length of binary and character based columns. For any other datatype the returned value is a + *
      32. SQL_DATA_TYPE int {@code =>} reserved for future use + *
      33. SQL_DATETIME_SUB int {@code =>} reserved for future use + *
      34. CHAR_OCTET_LENGTH int {@code =>} the maximum length of binary and character based columns. For any other datatype the returned value is a * NULL - *
      35. ORDINAL_POSITION int => the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0 + *
      36. ORDINAL_POSITION int {@code =>} the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0 *is returned if this row describes the procedure's return value. For result set columns, it is the *ordinal position of the column in the result set starting from 1. If there are *multiple result sets, the column ordinal positions are implementation * defined. - *
      37. IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
      38. IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
          *
        • YES --- if the column can include NULLs *
        • NO --- if the column cannot include NULLs *
        • empty string --- if the nullability for the * column is unknown *
        - *
      39. SPECIFIC_NAME String => the name which uniquely identifies this procedure within its schema. + *
      40. SPECIFIC_NAME String {@code =>} the name which uniquely identifies this procedure within its schema. *
      * *

      Note: Some databases may not return the column @@ -1481,19 +1481,19 @@ public interface DatabaseMetaData extends Wrapper { *

      * Each table description has the following columns: *

        - *
      1. TABLE_CAT String => table catalog (may be null) - *
      2. TABLE_SCHEM String => table schema (may be null) - *
      3. TABLE_NAME String => table name - *
      4. TABLE_TYPE String => table type. Typical types are "TABLE", + *
      5. TABLE_CAT String {@code =>} table catalog (may be null) + *
      6. TABLE_SCHEM String {@code =>} table schema (may be null) + *
      7. TABLE_NAME String {@code =>} table name + *
      8. TABLE_TYPE String {@code =>} table type. Typical types are "TABLE", * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", * "LOCAL TEMPORARY", "ALIAS", "SYNONYM". - *
      9. REMARKS String => explanatory comment on the table - *
      10. TYPE_CAT String => the types catalog (may be null) - *
      11. TYPE_SCHEM String => the types schema (may be null) - *
      12. TYPE_NAME String => type name (may be null) - *
      13. SELF_REFERENCING_COL_NAME String => name of the designated + *
      14. REMARKS String {@code =>} explanatory comment on the table + *
      15. TYPE_CAT String {@code =>} the types catalog (may be null) + *
      16. TYPE_SCHEM String {@code =>} the types schema (may be null) + *
      17. TYPE_NAME String {@code =>} type name (may be null) + *
      18. SELF_REFERENCING_COL_NAME String {@code =>} name of the designated * "identifier" column of a typed table (may be null) - *
      19. REF_GENERATION String => specifies how values in + *
      20. REF_GENERATION String {@code =>} specifies how values in * SELF_REFERENCING_COL_NAME are created. Values are * "SYSTEM", "USER", "DERIVED". (may be null) *
      @@ -1528,8 +1528,8 @@ public interface DatabaseMetaData extends Wrapper { * *

      The schema columns are: *

        - *
      1. TABLE_SCHEM String => schema name - *
      2. TABLE_CATALOG String => catalog name (may be null) + *
      3. TABLE_SCHEM String {@code =>} schema name + *
      4. TABLE_CATALOG String {@code =>} catalog name (may be null) *
      * * @return a ResultSet object in which each row is a @@ -1545,7 +1545,7 @@ public interface DatabaseMetaData extends Wrapper { * *

      The catalog column is: *

        - *
      1. TABLE_CAT String => catalog name + *
      2. TABLE_CAT String {@code =>} catalog name *
      * * @return a ResultSet object in which each row has a @@ -1560,7 +1560,7 @@ public interface DatabaseMetaData extends Wrapper { * *

      The table type is: *

        - *
      1. TABLE_TYPE String => table type. Typical types are "TABLE", + *
      2. TABLE_TYPE String {@code =>} table type. Typical types are "TABLE", * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", * "LOCAL TEMPORARY", "ALIAS", "SYNONYM". *
      @@ -1582,55 +1582,55 @@ public interface DatabaseMetaData extends Wrapper { * *

      Each column description has the following columns: *

        - *
      1. TABLE_CAT String => table catalog (may be null) - *
      2. TABLE_SCHEM String => table schema (may be null) - *
      3. TABLE_NAME String => table name - *
      4. COLUMN_NAME String => column name - *
      5. DATA_TYPE int => SQL type from java.sql.Types - *
      6. TYPE_NAME String => Data source dependent type name, + *
      7. TABLE_CAT String {@code =>} table catalog (may be null) + *
      8. TABLE_SCHEM String {@code =>} table schema (may be null) + *
      9. TABLE_NAME String {@code =>} table name + *
      10. COLUMN_NAME String {@code =>} column name + *
      11. DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
      12. TYPE_NAME String {@code =>} Data source dependent type name, * for a UDT the type name is fully qualified - *
      13. COLUMN_SIZE int => column size. + *
      14. COLUMN_SIZE int {@code =>} column size. *
      15. BUFFER_LENGTH is not used. - *
      16. DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
      17. DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
      18. NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
      19. NULLABLE int => is NULL allowed. + *
      20. NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
      21. NULLABLE int {@code =>} is NULL allowed. *
          *
        • columnNoNulls - might not allow NULL values *
        • columnNullable - definitely allows NULL values *
        • columnNullableUnknown - nullability unknown *
        - *
      22. REMARKS String => comment describing column (may be null) - *
      23. COLUMN_DEF String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) - *
      24. SQL_DATA_TYPE int => unused - *
      25. SQL_DATETIME_SUB int => unused - *
      26. CHAR_OCTET_LENGTH int => for char types the + *
      27. REMARKS String {@code =>} comment describing column (may be null) + *
      28. COLUMN_DEF String {@code =>} default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be null) + *
      29. SQL_DATA_TYPE int {@code =>} unused + *
      30. SQL_DATETIME_SUB int {@code =>} unused + *
      31. CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
      32. ORDINAL_POSITION int => index of column in table + *
      33. ORDINAL_POSITION int {@code =>} index of column in table * (starting at 1) - *
      34. IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
      35. IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
          *
        • YES --- if the column can include NULLs *
        • NO --- if the column cannot include NULLs *
        • empty string --- if the nullability for the * column is unknown *
        - *
      36. SCOPE_CATALOG String => catalog of table that is the scope + *
      37. SCOPE_CATALOG String {@code =>} catalog of table that is the scope * of a reference attribute (null if DATA_TYPE isn't REF) - *
      38. SCOPE_SCHEMA String => schema of table that is the scope + *
      39. SCOPE_SCHEMA String {@code =>} schema of table that is the scope * of a reference attribute (null if the DATA_TYPE isn't REF) - *
      40. SCOPE_TABLE String => table name that this the scope + *
      41. SCOPE_TABLE String {@code =>} table name that this the scope * of a reference attribute (null if the DATA_TYPE isn't REF) - *
      42. SOURCE_DATA_TYPE short => source type of a distinct type or user-generated + *
      43. SOURCE_DATA_TYPE short {@code =>} source type of a distinct type or user-generated * Ref type, SQL type from java.sql.Types (null if DATA_TYPE * isn't DISTINCT or user-generated REF) - *
      44. IS_AUTOINCREMENT String => Indicates whether this column is auto incremented + *
      45. IS_AUTOINCREMENT String {@code =>} Indicates whether this column is auto incremented *
          *
        • YES --- if the column is auto incremented *
        • NO --- if the column is not auto incremented *
        • empty string --- if it cannot be determined whether the column is auto incremented *
        - *
      46. IS_GENERATEDCOLUMN String => Indicates whether this is a generated column + *
      47. IS_GENERATEDCOLUMN String {@code =>} Indicates whether this is a generated column *
          *
        • YES --- if this a generated column *
        • NO --- if this not a generated column @@ -1703,15 +1703,15 @@ public interface DatabaseMetaData extends Wrapper { * *

          Each privilige description has the following columns: *

            - *
          1. TABLE_CAT String => table catalog (may be null) - *
          2. TABLE_SCHEM String => table schema (may be null) - *
          3. TABLE_NAME String => table name - *
          4. COLUMN_NAME String => column name - *
          5. GRANTOR String => grantor of access (may be null) - *
          6. GRANTEE String => grantee of access - *
          7. PRIVILEGE String => name of access (SELECT, + *
          8. TABLE_CAT String {@code =>} table catalog (may be null) + *
          9. TABLE_SCHEM String {@code =>} table schema (may be null) + *
          10. TABLE_NAME String {@code =>} table name + *
          11. COLUMN_NAME String {@code =>} column name + *
          12. GRANTOR String {@code =>} grantor of access (may be null) + *
          13. GRANTEE String {@code =>} grantee of access + *
          14. PRIVILEGE String {@code =>} name of access (SELECT, * INSERT, UPDATE, REFRENCES, ...) - *
          15. IS_GRANTABLE String => "YES" if grantee is permitted + *
          16. IS_GRANTABLE String {@code =>} "YES" if grantee is permitted * to grant to others; "NO" if not; null if unknown *
          * @@ -1749,14 +1749,14 @@ public interface DatabaseMetaData extends Wrapper { * *

          Each privilige description has the following columns: *

            - *
          1. TABLE_CAT String => table catalog (may be null) - *
          2. TABLE_SCHEM String => table schema (may be null) - *
          3. TABLE_NAME String => table name - *
          4. GRANTOR String => grantor of access (may be null) - *
          5. GRANTEE String => grantee of access - *
          6. PRIVILEGE String => name of access (SELECT, + *
          7. TABLE_CAT String {@code =>} table catalog (may be null) + *
          8. TABLE_SCHEM String {@code =>} table schema (may be null) + *
          9. TABLE_NAME String {@code =>} table name + *
          10. GRANTOR String {@code =>} grantor of access (may be null) + *
          11. GRANTEE String {@code =>} grantee of access + *
          12. PRIVILEGE String {@code =>} name of access (SELECT, * INSERT, UPDATE, REFRENCES, ...) - *
          13. IS_GRANTABLE String => "YES" if grantee is permitted + *
          14. IS_GRANTABLE String {@code =>} "YES" if grantee is permitted * to grant to others; "NO" if not; null if unknown *
          * @@ -1783,21 +1783,21 @@ public interface DatabaseMetaData extends Wrapper { * *

          Each column description has the following columns: *

            - *
          1. SCOPE short => actual scope of result + *
          2. SCOPE short {@code =>} actual scope of result *
              *
            • bestRowTemporary - very temporary, while using row *
            • bestRowTransaction - valid for remainder of current transaction *
            • bestRowSession - valid for remainder of current session *
            - *
          3. COLUMN_NAME String => column name - *
          4. DATA_TYPE int => SQL data type from java.sql.Types - *
          5. TYPE_NAME String => Data source dependent type name, + *
          6. COLUMN_NAME String {@code =>} column name + *
          7. DATA_TYPE int {@code =>} SQL data type from java.sql.Types + *
          8. TYPE_NAME String {@code =>} Data source dependent type name, * for a UDT the type name is fully qualified - *
          9. COLUMN_SIZE int => precision - *
          10. BUFFER_LENGTH int => not used - *
          11. DECIMAL_DIGITS short => scale - Null is returned for data types where + *
          12. COLUMN_SIZE int {@code =>} precision + *
          13. BUFFER_LENGTH int {@code =>} not used + *
          14. DECIMAL_DIGITS short {@code =>} scale - Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
          15. PSEUDO_COLUMN short => is this a pseudo column + *
          16. PSEUDO_COLUMN short {@code =>} is this a pseudo column * like an Oracle ROWID *
              *
            • bestRowUnknown - may or may not be pseudo column @@ -1902,15 +1902,15 @@ public interface DatabaseMetaData extends Wrapper { * *

              Each column description has the following columns: *

                - *
              1. SCOPE short => is not used - *
              2. COLUMN_NAME String => column name - *
              3. DATA_TYPE int => SQL data type from java.sql.Types - *
              4. TYPE_NAME String => Data source-dependent type name - *
              5. COLUMN_SIZE int => precision - *
              6. BUFFER_LENGTH int => length of column value in bytes - *
              7. DECIMAL_DIGITS short => scale - Null is returned for data types where + *
              8. SCOPE short {@code =>} is not used + *
              9. COLUMN_NAME String {@code =>} column name + *
              10. DATA_TYPE int {@code =>} SQL data type from java.sql.Types + *
              11. TYPE_NAME String {@code =>} Data source-dependent type name + *
              12. COLUMN_SIZE int {@code =>} precision + *
              13. BUFFER_LENGTH int {@code =>} length of column value in bytes + *
              14. DECIMAL_DIGITS short {@code =>} scale - Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
              15. PSEUDO_COLUMN short => whether this is pseudo column + *
              16. PSEUDO_COLUMN short {@code =>} whether this is pseudo column * like an Oracle ROWID *
                  *
                • versionColumnUnknown - may or may not be pseudo column @@ -1978,14 +1978,14 @@ public interface DatabaseMetaData extends Wrapper { * *

                  Each primary key column description has the following columns: *

                    - *
                  1. TABLE_CAT String => table catalog (may be null) - *
                  2. TABLE_SCHEM String => table schema (may be null) - *
                  3. TABLE_NAME String => table name - *
                  4. COLUMN_NAME String => column name - *
                  5. KEY_SEQ short => sequence number within primary key( a value + *
                  6. TABLE_CAT String {@code =>} table catalog (may be null) + *
                  7. TABLE_SCHEM String {@code =>} table schema (may be null) + *
                  8. TABLE_NAME String {@code =>} table name + *
                  9. COLUMN_NAME String {@code =>} column name + *
                  10. KEY_SEQ short {@code =>} sequence number within primary key( a value * of 1 represents the first column of the primary key, a value of 2 would * represent the second column within the primary key). - *
                  11. PK_NAME String => primary key name (may be null) + *
                  12. PK_NAME String {@code =>} primary key name (may be null) *
                  * * @param catalog a catalog name; must match the catalog name as it @@ -2012,22 +2012,22 @@ public interface DatabaseMetaData extends Wrapper { * *

                  Each primary key column description has the following columns: *

                    - *
                  1. PKTABLE_CAT String => primary key table catalog + *
                  2. PKTABLE_CAT String {@code =>} primary key table catalog * being imported (may be null) - *
                  3. PKTABLE_SCHEM String => primary key table schema + *
                  4. PKTABLE_SCHEM String {@code =>} primary key table schema * being imported (may be null) - *
                  5. PKTABLE_NAME String => primary key table name + *
                  6. PKTABLE_NAME String {@code =>} primary key table name * being imported - *
                  7. PKCOLUMN_NAME String => primary key column name + *
                  8. PKCOLUMN_NAME String {@code =>} primary key column name * being imported - *
                  9. FKTABLE_CAT String => foreign key table catalog (may be null) - *
                  10. FKTABLE_SCHEM String => foreign key table schema (may be null) - *
                  11. FKTABLE_NAME String => foreign key table name - *
                  12. FKCOLUMN_NAME String => foreign key column name - *
                  13. KEY_SEQ short => sequence number within a foreign key( a value + *
                  14. FKTABLE_CAT String {@code =>} foreign key table catalog (may be null) + *
                  15. FKTABLE_SCHEM String {@code =>} foreign key table schema (may be null) + *
                  16. FKTABLE_NAME String {@code =>} foreign key table name + *
                  17. FKCOLUMN_NAME String {@code =>} foreign key column name + *
                  18. KEY_SEQ short {@code =>} sequence number within a foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
                  19. UPDATE_RULE short => What happens to a + *
                  20. UPDATE_RULE short {@code =>} What happens to a * foreign key when the primary key is updated: *
                      *
                    • importedNoAction - do not allow update of primary @@ -2041,7 +2041,7 @@ public interface DatabaseMetaData extends Wrapper { *
                    • importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
                    - *
                  21. DELETE_RULE short => What happens to + *
                  22. DELETE_RULE short {@code =>} What happens to * the foreign key when primary is deleted. *
                      *
                    • importedKeyNoAction - do not allow delete of primary @@ -2054,9 +2054,9 @@ public interface DatabaseMetaData extends Wrapper { *
                    • importedKeySetDefault - change imported key to default if * its primary key has been deleted *
                    - *
                  23. FK_NAME String => foreign key name (may be null) - *
                  24. PK_NAME String => primary key name (may be null) - *
                  25. DEFERRABILITY short => can the evaluation of foreign key + *
                  26. FK_NAME String {@code =>} foreign key name (may be null) + *
                  27. PK_NAME String {@code =>} primary key name (may be null) + *
                  28. DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
                      *
                    • importedKeyInitiallyDeferred - see SQL92 for definition @@ -2195,22 +2195,22 @@ public interface DatabaseMetaData extends Wrapper { * *

                      Each foreign key column description has the following columns: *

                        - *
                      1. PKTABLE_CAT String => primary key table catalog (may be null) - *
                      2. PKTABLE_SCHEM String => primary key table schema (may be null) - *
                      3. PKTABLE_NAME String => primary key table name - *
                      4. PKCOLUMN_NAME String => primary key column name - *
                      5. FKTABLE_CAT String => foreign key table catalog (may be null) + *
                      6. PKTABLE_CAT String {@code =>} primary key table catalog (may be null) + *
                      7. PKTABLE_SCHEM String {@code =>} primary key table schema (may be null) + *
                      8. PKTABLE_NAME String {@code =>} primary key table name + *
                      9. PKCOLUMN_NAME String {@code =>} primary key column name + *
                      10. FKTABLE_CAT String {@code =>} foreign key table catalog (may be null) * being exported (may be null) - *
                      11. FKTABLE_SCHEM String => foreign key table schema (may be null) + *
                      12. FKTABLE_SCHEM String {@code =>} foreign key table schema (may be null) * being exported (may be null) - *
                      13. FKTABLE_NAME String => foreign key table name + *
                      14. FKTABLE_NAME String {@code =>} foreign key table name * being exported - *
                      15. FKCOLUMN_NAME String => foreign key column name + *
                      16. FKCOLUMN_NAME String {@code =>} foreign key column name * being exported - *
                      17. KEY_SEQ short => sequence number within foreign key( a value + *
                      18. KEY_SEQ short {@code =>} sequence number within foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
                      19. UPDATE_RULE short => What happens to + *
                      20. UPDATE_RULE short {@code =>} What happens to * foreign key when primary is updated: *
                          *
                        • importedNoAction - do not allow update of primary @@ -2224,7 +2224,7 @@ public interface DatabaseMetaData extends Wrapper { *
                        • importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
                        - *
                      21. DELETE_RULE short => What happens to + *
                      22. DELETE_RULE short {@code =>} What happens to * the foreign key when primary is deleted. *
                          *
                        • importedKeyNoAction - do not allow delete of primary @@ -2237,9 +2237,9 @@ public interface DatabaseMetaData extends Wrapper { *
                        • importedKeySetDefault - change imported key to default if * its primary key has been deleted *
                        - *
                      23. FK_NAME String => foreign key name (may be null) - *
                      24. PK_NAME String => primary key name (may be null) - *
                      25. DEFERRABILITY short => can the evaluation of foreign key + *
                      26. FK_NAME String {@code =>} foreign key name (may be null) + *
                      27. PK_NAME String {@code =>} primary key name (may be null) + *
                      28. DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
                          *
                        • importedKeyInitiallyDeferred - see SQL92 for definition @@ -2276,22 +2276,22 @@ public interface DatabaseMetaData extends Wrapper { * *

                          Each foreign key column description has the following columns: *

                            - *
                          1. PKTABLE_CAT String => parent key table catalog (may be null) - *
                          2. PKTABLE_SCHEM String => parent key table schema (may be null) - *
                          3. PKTABLE_NAME String => parent key table name - *
                          4. PKCOLUMN_NAME String => parent key column name - *
                          5. FKTABLE_CAT String => foreign key table catalog (may be null) + *
                          6. PKTABLE_CAT String {@code =>} parent key table catalog (may be null) + *
                          7. PKTABLE_SCHEM String {@code =>} parent key table schema (may be null) + *
                          8. PKTABLE_NAME String {@code =>} parent key table name + *
                          9. PKCOLUMN_NAME String {@code =>} parent key column name + *
                          10. FKTABLE_CAT String {@code =>} foreign key table catalog (may be null) * being exported (may be null) - *
                          11. FKTABLE_SCHEM String => foreign key table schema (may be null) + *
                          12. FKTABLE_SCHEM String {@code =>} foreign key table schema (may be null) * being exported (may be null) - *
                          13. FKTABLE_NAME String => foreign key table name + *
                          14. FKTABLE_NAME String {@code =>} foreign key table name * being exported - *
                          15. FKCOLUMN_NAME String => foreign key column name + *
                          16. FKCOLUMN_NAME String {@code =>} foreign key column name * being exported - *
                          17. KEY_SEQ short => sequence number within foreign key( a value + *
                          18. KEY_SEQ short {@code =>} sequence number within foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
                          19. UPDATE_RULE short => What happens to + *
                          20. UPDATE_RULE short {@code =>} What happens to * foreign key when parent key is updated: *
                              *
                            • importedNoAction - do not allow update of parent @@ -2305,7 +2305,7 @@ public interface DatabaseMetaData extends Wrapper { *
                            • importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
                            - *
                          21. DELETE_RULE short => What happens to + *
                          22. DELETE_RULE short {@code =>} What happens to * the foreign key when parent key is deleted. *
                              *
                            • importedKeyNoAction - do not allow delete of parent @@ -2318,9 +2318,9 @@ public interface DatabaseMetaData extends Wrapper { *
                            • importedKeySetDefault - change imported key to default if * its parent key has been deleted *
                            - *
                          23. FK_NAME String => foreign key name (may be null) - *
                          24. PK_NAME String => parent key name (may be null) - *
                          25. DEFERRABILITY short => can the evaluation of foreign key + *
                          26. FK_NAME String {@code =>} foreign key name (may be null) + *
                          27. PK_NAME String {@code =>} parent key name (may be null) + *
                          28. DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
                              *
                            • importedKeyInitiallyDeferred - see SQL92 for definition @@ -2371,40 +2371,40 @@ public interface DatabaseMetaData extends Wrapper { * *

                              Each type description has the following columns: *

                                - *
                              1. TYPE_NAME String => Type name - *
                              2. DATA_TYPE int => SQL data type from java.sql.Types - *
                              3. PRECISION int => maximum precision - *
                              4. LITERAL_PREFIX String => prefix used to quote a literal + *
                              5. TYPE_NAME String {@code =>} Type name + *
                              6. DATA_TYPE int {@code =>} SQL data type from java.sql.Types + *
                              7. PRECISION int {@code =>} maximum precision + *
                              8. LITERAL_PREFIX String {@code =>} prefix used to quote a literal * (may be null) - *
                              9. LITERAL_SUFFIX String => suffix used to quote a literal + *
                              10. LITERAL_SUFFIX String {@code =>} suffix used to quote a literal (may be null) - *
                              11. CREATE_PARAMS String => parameters used in creating + *
                              12. CREATE_PARAMS String {@code =>} parameters used in creating * the type (may be null) - *
                              13. NULLABLE short => can you use NULL for this type. + *
                              14. NULLABLE short {@code =>} can you use NULL for this type. *
                                  *
                                • typeNoNulls - does not allow NULL values *
                                • typeNullable - allows NULL values *
                                • typeNullableUnknown - nullability unknown *
                                - *
                              15. CASE_SENSITIVE boolean=> is it case sensitive. - *
                              16. SEARCHABLE short => can you use "WHERE" based on this type: + *
                              17. CASE_SENSITIVE boolean{@code =>} is it case sensitive. + *
                              18. SEARCHABLE short {@code =>} can you use "WHERE" based on this type: *
                                  *
                                • typePredNone - No support *
                                • typePredChar - Only supported with WHERE .. LIKE *
                                • typePredBasic - Supported except for WHERE .. LIKE *
                                • typeSearchable - Supported for all WHERE .. *
                                - *
                              19. UNSIGNED_ATTRIBUTE boolean => is it unsigned. - *
                              20. FIXED_PREC_SCALE boolean => can it be a money value. - *
                              21. AUTO_INCREMENT boolean => can it be used for an + *
                              22. UNSIGNED_ATTRIBUTE boolean {@code =>} is it unsigned. + *
                              23. FIXED_PREC_SCALE boolean {@code =>} can it be a money value. + *
                              24. AUTO_INCREMENT boolean {@code =>} can it be used for an * auto-increment value. - *
                              25. LOCAL_TYPE_NAME String => localized version of type name + *
                              26. LOCAL_TYPE_NAME String {@code =>} localized version of type name * (may be null) - *
                              27. MINIMUM_SCALE short => minimum scale supported - *
                              28. MAXIMUM_SCALE short => maximum scale supported - *
                              29. SQL_DATA_TYPE int => unused - *
                              30. SQL_DATETIME_SUB int => unused - *
                              31. NUM_PREC_RADIX int => usually 2 or 10 + *
                              32. MINIMUM_SCALE short {@code =>} minimum scale supported + *
                              33. MAXIMUM_SCALE short {@code =>} maximum scale supported + *
                              34. SQL_DATA_TYPE int {@code =>} unused + *
                              35. SQL_DATETIME_SUB int {@code =>} unused + *
                              36. NUM_PREC_RADIX int {@code =>} usually 2 or 10 *
                              * *

                              The PRECISION column represents the maximum column size that the server supports for the given datatype. @@ -2498,16 +2498,16 @@ public interface DatabaseMetaData extends Wrapper { * *

                              Each index column description has the following columns: *

                                - *
                              1. TABLE_CAT String => table catalog (may be null) - *
                              2. TABLE_SCHEM String => table schema (may be null) - *
                              3. TABLE_NAME String => table name - *
                              4. NON_UNIQUE boolean => Can index values be non-unique. + *
                              5. TABLE_CAT String {@code =>} table catalog (may be null) + *
                              6. TABLE_SCHEM String {@code =>} table schema (may be null) + *
                              7. TABLE_NAME String {@code =>} table name + *
                              8. NON_UNIQUE boolean {@code =>} Can index values be non-unique. * false when TYPE is tableIndexStatistic - *
                              9. INDEX_QUALIFIER String => index catalog (may be null); + *
                              10. INDEX_QUALIFIER String {@code =>} index catalog (may be null); * null when TYPE is tableIndexStatistic - *
                              11. INDEX_NAME String => index name; null when TYPE is + *
                              12. INDEX_NAME String {@code =>} index name; null when TYPE is * tableIndexStatistic - *
                              13. TYPE short => index type: + *
                              14. TYPE short {@code =>} index type: *
                                  *
                                • tableIndexStatistic - this identifies table statistics that are * returned in conjuction with a table's index descriptions @@ -2515,20 +2515,20 @@ public interface DatabaseMetaData extends Wrapper { *
                                • tableIndexHashed - this is a hashed index *
                                • tableIndexOther - this is some other style of index *
                                - *
                              15. ORDINAL_POSITION short => column sequence number + *
                              16. ORDINAL_POSITION short {@code =>} column sequence number * within index; zero when TYPE is tableIndexStatistic - *
                              17. COLUMN_NAME String => column name; null when TYPE is + *
                              18. COLUMN_NAME String {@code =>} column name; null when TYPE is * tableIndexStatistic - *
                              19. ASC_OR_DESC String => column sort sequence, "A" => ascending, - * "D" => descending, may be null if sort sequence is not supported; + *
                              20. ASC_OR_DESC String {@code =>} column sort sequence, "A" {@code =>} ascending, + * "D" {@code =>} descending, may be null if sort sequence is not supported; * null when TYPE is tableIndexStatistic - *
                              21. CARDINALITY long => When TYPE is tableIndexStatistic, then + *
                              22. CARDINALITY long {@code =>} When TYPE is tableIndexStatistic, then * this is the number of rows in the table; otherwise, it is the * number of unique values in the index. - *
                              23. PAGES long => When TYPE is tableIndexStatisic then + *
                              24. PAGES long {@code =>} When TYPE is tableIndexStatisic then * this is the number of pages used for the table, otherwise it * is the number of pages used for the current index. - *
                              25. FILTER_CONDITION String => Filter condition, if any. + *
                              26. FILTER_CONDITION String {@code =>} Filter condition, if any. * (may be null) *
                              * @@ -2781,14 +2781,14 @@ public interface DatabaseMetaData extends Wrapper { * *

                              Each type description has the following columns: *

                                - *
                              1. TYPE_CAT String => the type's catalog (may be null) - *
                              2. TYPE_SCHEM String => type's schema (may be null) - *
                              3. TYPE_NAME String => type name - *
                              4. CLASS_NAME String => Java class name - *
                              5. DATA_TYPE int => type value defined in java.sql.Types. + *
                              6. TYPE_CAT String {@code =>} the type's catalog (may be null) + *
                              7. TYPE_SCHEM String {@code =>} type's schema (may be null) + *
                              8. TYPE_NAME String {@code =>} type name + *
                              9. CLASS_NAME String {@code =>} Java class name + *
                              10. DATA_TYPE int {@code =>} type value defined in java.sql.Types. * One of JAVA_OBJECT, STRUCT, or DISTINCT - *
                              11. REMARKS String => explanatory comment on the type - *
                              12. BASE_TYPE short => type code of the source type of a + *
                              13. REMARKS String {@code =>} explanatory comment on the type + *
                              14. BASE_TYPE short {@code =>} type code of the source type of a * DISTINCT type or the type that implements the user-generated * reference type of the SELF_REFERENCING_COLUMN of a structured * type as defined in java.sql.Types (null if DATA_TYPE is not @@ -2894,14 +2894,14 @@ public interface DatabaseMetaData extends Wrapper { * describes the designated UDT and a direct supertype. A row has the following * columns: *
                                  - *
                                1. TYPE_CAT String => the UDT's catalog (may be null) - *
                                2. TYPE_SCHEM String => UDT's schema (may be null) - *
                                3. TYPE_NAME String => type name of the UDT - *
                                4. SUPERTYPE_CAT String => the direct super type's catalog + *
                                5. TYPE_CAT String {@code =>} the UDT's catalog (may be null) + *
                                6. TYPE_SCHEM String {@code =>} UDT's schema (may be null) + *
                                7. TYPE_NAME String {@code =>} type name of the UDT + *
                                8. SUPERTYPE_CAT String {@code =>} the direct super type's catalog * (may be null) - *
                                9. SUPERTYPE_SCHEM String => the direct super type's schema + *
                                10. SUPERTYPE_SCHEM String {@code =>} the direct super type's schema * (may be null) - *
                                11. SUPERTYPE_NAME String => the direct super type's name + *
                                12. SUPERTYPE_NAME String {@code =>} the direct super type's name *
                                * *

                                Note: If the driver does not support type hierarchies, an @@ -2936,10 +2936,10 @@ public interface DatabaseMetaData extends Wrapper { * *

                                Each type description has the following columns: *

                                  - *
                                1. TABLE_CAT String => the type's catalog (may be null) - *
                                2. TABLE_SCHEM String => type's schema (may be null) - *
                                3. TABLE_NAME String => type name - *
                                4. SUPERTABLE_NAME String => the direct super type's name + *
                                5. TABLE_CAT String {@code =>} the type's catalog (may be null) + *
                                6. TABLE_SCHEM String {@code =>} type's schema (may be null) + *
                                7. TABLE_NAME String {@code =>} type name + *
                                8. SUPERTABLE_NAME String {@code =>} the direct super type's name *
                                * *

                                Note: If the driver does not support type hierarchies, an @@ -3001,35 +3001,35 @@ public interface DatabaseMetaData extends Wrapper { * The ResultSet object that is returned has the following * columns: *

                                  - *
                                1. TYPE_CAT String => type catalog (may be null) - *
                                2. TYPE_SCHEM String => type schema (may be null) - *
                                3. TYPE_NAME String => type name - *
                                4. ATTR_NAME String => attribute name - *
                                5. DATA_TYPE int => attribute type SQL type from java.sql.Types - *
                                6. ATTR_TYPE_NAME String => Data source dependent type name. + *
                                7. TYPE_CAT String {@code =>} type catalog (may be null) + *
                                8. TYPE_SCHEM String {@code =>} type schema (may be null) + *
                                9. TYPE_NAME String {@code =>} type name + *
                                10. ATTR_NAME String {@code =>} attribute name + *
                                11. DATA_TYPE int {@code =>} attribute type SQL type from java.sql.Types + *
                                12. ATTR_TYPE_NAME String {@code =>} Data source dependent type name. * For a UDT, the type name is fully qualified. For a REF, the type name is * fully qualified and represents the target type of the reference type. - *
                                13. ATTR_SIZE int => column size. For char or date + *
                                14. ATTR_SIZE int {@code =>} column size. For char or date * types this is the maximum number of characters; for numeric or * decimal types this is precision. - *
                                15. DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
                                16. DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
                                17. NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
                                18. NULLABLE int => whether NULL is allowed + *
                                19. NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
                                20. NULLABLE int {@code =>} whether NULL is allowed *
                                    *
                                  • attributeNoNulls - might not allow NULL values *
                                  • attributeNullable - definitely allows NULL values *
                                  • attributeNullableUnknown - nullability unknown *
                                  - *
                                21. REMARKS String => comment describing column (may be null) - *
                                22. ATTR_DEF String => default value (may be null) - *
                                23. SQL_DATA_TYPE int => unused - *
                                24. SQL_DATETIME_SUB int => unused - *
                                25. CHAR_OCTET_LENGTH int => for char types the + *
                                26. REMARKS String {@code =>} comment describing column (may be null) + *
                                27. ATTR_DEF String {@code =>} default value (may be null) + *
                                28. SQL_DATA_TYPE int {@code =>} unused + *
                                29. SQL_DATETIME_SUB int {@code =>} unused + *
                                30. CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
                                31. ORDINAL_POSITION int => index of the attribute in the UDT + *
                                32. ORDINAL_POSITION int {@code =>} index of the attribute in the UDT * (starting at 1) - *
                                33. IS_NULLABLE String => ISO rules are used to determine + *
                                34. IS_NULLABLE String {@code =>} ISO rules are used to determine * the nullability for a attribute. *
                                    *
                                  • YES --- if the attribute can include NULLs @@ -3037,13 +3037,13 @@ public interface DatabaseMetaData extends Wrapper { *
                                  • empty string --- if the nullability for the * attribute is unknown *
                                  - *
                                35. SCOPE_CATALOG String => catalog of table that is the + *
                                36. SCOPE_CATALOG String {@code =>} catalog of table that is the * scope of a reference attribute (null if DATA_TYPE isn't REF) - *
                                37. SCOPE_SCHEMA String => schema of table that is the + *
                                38. SCOPE_SCHEMA String {@code =>} schema of table that is the * scope of a reference attribute (null if DATA_TYPE isn't REF) - *
                                39. SCOPE_TABLE String => table name that is the scope of a + *
                                40. SCOPE_TABLE String {@code =>} table name that is the scope of a * reference attribute (null if the DATA_TYPE isn't REF) - *
                                41. SOURCE_DATA_TYPE short => source type of a distinct type or user-generated + *
                                42. SOURCE_DATA_TYPE short {@code =>} source type of a distinct type or user-generated * Ref type,SQL type from java.sql.Types (null if DATA_TYPE * isn't DISTINCT or user-generated REF) *
                                @@ -3074,7 +3074,7 @@ public interface DatabaseMetaData extends Wrapper { * * @param holdability one of the following constants: * ResultSet.HOLD_CURSORS_OVER_COMMIT or - * ResultSet.CLOSE_CURSORS_AT_COMMIT + * ResultSet.CLOSE_CURSORS_AT_COMMIT * @return true if so; false otherwise * @exception SQLException if a database access error occurs * @see Connection @@ -3203,14 +3203,14 @@ public interface DatabaseMetaData extends Wrapper { * and if so the lifetime for which a RowId object remains valid. *

                                * The returned int values have the following relationship: - *

                                +     * 
                                {@code
                                      *     ROWID_UNSUPPORTED < ROWID_VALID_OTHER < ROWID_VALID_TRANSACTION
                                      *         < ROWID_VALID_SESSION < ROWID_VALID_FOREVER
                                -     * 
                                + * }
                                * so conditional logic such as - *
                                +     * 
                                {@code
                                      *     if (metadata.getRowIdLifetime() > DatabaseMetaData.ROWID_VALID_TRANSACTION)
                                -     * 
                                + * }
                                * can be used. Valid Forever means valid across all Sessions, and valid for * a Session means valid across all its contained Transactions. * @@ -3227,8 +3227,8 @@ public interface DatabaseMetaData extends Wrapper { * *

                                The schema columns are: *

                                  - *
                                1. TABLE_SCHEM String => schema name - *
                                2. TABLE_CATALOG String => catalog name (may be null) + *
                                3. TABLE_SCHEM String {@code =>} schema name + *
                                4. TABLE_CATALOG String {@code =>} catalog name (may be null) *
                                * * @@ -3273,10 +3273,10 @@ public interface DatabaseMetaData extends Wrapper { * that the driver supports. The result set contains the following columns *

                                *

                                  - *
                                1. NAME String=> The name of the client info property
                                  - *
                                2. MAX_LEN int=> The maximum length of the value for the property
                                  - *
                                3. DEFAULT_VALUE String=> The default value of the property
                                  - *
                                4. DESCRIPTION String=> A description of the property. This will typically + *
                                5. NAME String{@code =>} The name of the client info property
                                  + *
                                6. MAX_LEN int{@code =>} The maximum length of the value for the property
                                  + *
                                7. DEFAULT_VALUE String{@code =>} The default value of the property
                                  + *
                                8. DESCRIPTION String{@code =>} A description of the property. This will typically * contain information as to where this property is * stored in the database. *
                                @@ -3305,19 +3305,19 @@ public interface DatabaseMetaData extends Wrapper { * *

                                Each function description has the the following columns: *

                                  - *
                                1. FUNCTION_CAT String => function catalog (may be null) - *
                                2. FUNCTION_SCHEM String => function schema (may be null) - *
                                3. FUNCTION_NAME String => function name. This is the name + *
                                4. FUNCTION_CAT String {@code =>} function catalog (may be null) + *
                                5. FUNCTION_SCHEM String {@code =>} function schema (may be null) + *
                                6. FUNCTION_NAME String {@code =>} function name. This is the name * used to invoke the function - *
                                7. REMARKS String => explanatory comment on the function - *
                                8. FUNCTION_TYPE short => kind of function: + *
                                9. REMARKS String {@code =>} explanatory comment on the function + *
                                10. FUNCTION_TYPE short {@code =>} kind of function: *
                                    *
                                  • functionResultUnknown - Cannot determine if a return value * or table will be returned *
                                  • functionNoTable- Does not return a table *
                                  • functionReturnsTable - Returns a table *
                                  - *
                                11. SPECIFIC_NAME String => the name which uniquely identifies + *
                                12. SPECIFIC_NAME String {@code =>} the name which uniquely identifies * this function within its schema. This is a user specified, or DBMS * generated, name that may be different then the FUNCTION_NAME * for example with overload functions @@ -3359,12 +3359,12 @@ public interface DatabaseMetaData extends Wrapper { * is a parameter description, column description or * return type description with the following fields: *
                                    - *
                                  1. FUNCTION_CAT String => function catalog (may be null) - *
                                  2. FUNCTION_SCHEM String => function schema (may be null) - *
                                  3. FUNCTION_NAME String => function name. This is the name + *
                                  4. FUNCTION_CAT String {@code =>} function catalog (may be null) + *
                                  5. FUNCTION_SCHEM String {@code =>} function schema (may be null) + *
                                  6. FUNCTION_NAME String {@code =>} function name. This is the name * used to invoke the function - *
                                  7. COLUMN_NAME String => column/parameter name - *
                                  8. COLUMN_TYPE Short => kind of column/parameter: + *
                                  9. COLUMN_NAME String {@code =>} column/parameter name + *
                                  10. COLUMN_TYPE Short {@code =>} kind of column/parameter: *
                                      *
                                    • functionColumnUnknown - nobody knows *
                                    • functionColumnIn - IN parameter @@ -3374,30 +3374,30 @@ public interface DatabaseMetaData extends Wrapper { *
                                    • functionColumnResult - Indicates that the parameter or column * is a column in the ResultSet *
                                    - *
                                  11. DATA_TYPE int => SQL type from java.sql.Types - *
                                  12. TYPE_NAME String => SQL type name, for a UDT type the + *
                                  13. DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
                                  14. TYPE_NAME String {@code =>} SQL type name, for a UDT type the * type name is fully qualified - *
                                  15. PRECISION int => precision - *
                                  16. LENGTH int => length in bytes of data - *
                                  17. SCALE short => scale - null is returned for data types where + *
                                  18. PRECISION int {@code =>} precision + *
                                  19. LENGTH int {@code =>} length in bytes of data + *
                                  20. SCALE short {@code =>} scale - null is returned for data types where * SCALE is not applicable. - *
                                  21. RADIX short => radix - *
                                  22. NULLABLE short => can it contain NULL. + *
                                  23. RADIX short {@code =>} radix + *
                                  24. NULLABLE short {@code =>} can it contain NULL. *
                                      *
                                    • functionNoNulls - does not allow NULL values *
                                    • functionNullable - allows NULL values *
                                    • functionNullableUnknown - nullability unknown *
                                    - *
                                  25. REMARKS String => comment describing column/parameter - *
                                  26. CHAR_OCTET_LENGTH int => the maximum length of binary + *
                                  27. REMARKS String {@code =>} comment describing column/parameter + *
                                  28. CHAR_OCTET_LENGTH int {@code =>} the maximum length of binary * and character based parameters or columns. For any other datatype the returned value * is a NULL - *
                                  29. ORDINAL_POSITION int => the ordinal position, starting + *
                                  30. ORDINAL_POSITION int {@code =>} the ordinal position, starting * from 1, for the input and output parameters. A value of 0 * is returned if this row describes the function's return value. * For result set columns, it is the * ordinal position of the column in the result set starting from 1. - *
                                  31. IS_NULLABLE String => ISO rules are used to determine + *
                                  32. IS_NULLABLE String {@code =>} ISO rules are used to determine * the nullability for a parameter or column. *
                                      *
                                    • YES --- if the parameter or column can include NULLs @@ -3405,7 +3405,7 @@ public interface DatabaseMetaData extends Wrapper { *
                                    • empty string --- if the nullability for the * parameter or column is unknown *
                                    - *
                                  33. SPECIFIC_NAME String => the name which uniquely identifies + *
                                  34. SPECIFIC_NAME String {@code =>} the name which uniquely identifies * this function within its schema. This is a user specified, or DBMS * generated, name that may be different then the FUNCTION_NAME * for example with overload functions @@ -3591,21 +3591,21 @@ public interface DatabaseMetaData extends Wrapper { * *

                                    Each column description has the following columns: *

                                      - *
                                    1. TABLE_CAT String => table catalog (may be null) - *
                                    2. TABLE_SCHEM String => table schema (may be null) - *
                                    3. TABLE_NAME String => table name - *
                                    4. COLUMN_NAME String => column name - *
                                    5. DATA_TYPE int => SQL type from java.sql.Types - *
                                    6. COLUMN_SIZE int => column size. - *
                                    7. DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
                                    8. TABLE_CAT String {@code =>} table catalog (may be null) + *
                                    9. TABLE_SCHEM String {@code =>} table schema (may be null) + *
                                    10. TABLE_NAME String {@code =>} table name + *
                                    11. COLUMN_NAME String {@code =>} column name + *
                                    12. DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
                                    13. COLUMN_SIZE int {@code =>} column size. + *
                                    14. DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
                                    15. NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
                                    16. COLUMN_USAGE String => The allowed usage for the column. The + *
                                    17. NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
                                    18. COLUMN_USAGE String {@code =>} The allowed usage for the column. The * value returned will correspond to the enum name returned by {@link PseudoColumnUsage#name PseudoColumnUsage.name()} - *
                                    19. REMARKS String => comment describing column (may be null) - *
                                    20. CHAR_OCTET_LENGTH int => for char types the + *
                                    21. REMARKS String {@code =>} comment describing column (may be null) + *
                                    22. CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
                                    23. IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
                                    24. IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
                                        *
                                      • YES --- if the column can include NULLs *
                                      • NO --- if the column cannot include NULLs diff --git a/jdk/src/share/classes/java/sql/Driver.java b/jdk/src/share/classes/java/sql/Driver.java index 27ad3e0407d..3bb3e0c4576 100644 --- a/jdk/src/share/classes/java/sql/Driver.java +++ b/jdk/src/share/classes/java/sql/Driver.java @@ -144,7 +144,7 @@ public interface Driver { /** * Reports whether this driver is a genuine JDBC - * CompliantTM driver. + * Compliant™ driver. * A driver may only report true here if it passes the JDBC * compliance tests; otherwise it is required to return false. *

                                        @@ -173,7 +173,8 @@ public interface Driver { * In the worst case, this may be the root Logger. * * @return the parent Logger for this driver - * @throws SQLFeatureNotSupportedException if the driver does not use java.util.logging. + * @throws SQLFeatureNotSupportedException if the driver does not use + * {@code java.util.logging}. * @since 1.7 */ public Logger getParentLogger() throws SQLFeatureNotSupportedException; diff --git a/jdk/src/share/classes/java/sql/DriverAction.java b/jdk/src/share/classes/java/sql/DriverAction.java index 167168c9b85..59d98259620 100644 --- a/jdk/src/share/classes/java/sql/DriverAction.java +++ b/jdk/src/share/classes/java/sql/DriverAction.java @@ -33,7 +33,7 @@ package java.sql; * directly by applications. A JDBC Driver may choose * to create its {@code DriverAction} implementation in a private class * to avoid it being called directly. - * + *

                                        * The JDBC driver's static initialization block must call * {@linkplain DriverManager#registerDriver(java.sql.Driver, java.sql.DriverAction) } in order * to inform {@code DriverManager} which {@code DriverAction} implementation to diff --git a/jdk/src/share/classes/java/sql/DriverManager.java b/jdk/src/share/classes/java/sql/DriverManager.java index fbe16363529..797a920d230 100644 --- a/jdk/src/share/classes/java/sql/DriverManager.java +++ b/jdk/src/share/classes/java/sql/DriverManager.java @@ -36,7 +36,7 @@ import sun.reflect.Reflection; /** *

                                        The basic service for managing a set of JDBC drivers.
                                        - * NOTE: The {@link DataSource} interface, new in the + * NOTE: The {@link javax.sql.DataSource} interface, new in the * JDBC 2.0 API, provides another way to connect to a data source. * The use of a DataSource object is the preferred means of * connecting to a data source. diff --git a/jdk/src/share/classes/java/sql/NClob.java b/jdk/src/share/classes/java/sql/NClob.java index a70ed6190a6..f3d535c0afd 100644 --- a/jdk/src/share/classes/java/sql/NClob.java +++ b/jdk/src/share/classes/java/sql/NClob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ package java.sql; import java.sql.Clob; /** - * The mapping in the JavaTM programming language + * The mapping in the Java™ programming language * for the SQL NCLOB type. * An SQL NCLOB is a built-in type * that stores a Character Large Object using the National Character Set diff --git a/jdk/src/share/classes/java/sql/ResultSet.java b/jdk/src/share/classes/java/sql/ResultSet.java index ab547733128..ad954e89d1d 100644 --- a/jdk/src/share/classes/java/sql/ResultSet.java +++ b/jdk/src/share/classes/java/sql/ResultSet.java @@ -90,7 +90,7 @@ import java.io.InputStream; * the intended columns, which can be assured with the SQL AS clause. *

                                        * A set of updater methods were added to this interface - * in the JDBC 2.0 API (JavaTM 2 SDK, + * in the JDBC 2.0 API (Java™ 2 SDK, * Standard Edition, version 1.2). The comments regarding parameters * to the getter methods also apply to parameters to the * updater methods. @@ -148,7 +148,7 @@ import java.io.InputStream; public interface ResultSet extends Wrapper, AutoCloseable { /** - * Moves the cursor froward one row from its current position. + * Moves the cursor forward one row from its current position. * A ResultSet cursor is initially positioned * before the first row; the first call to the method * next makes the first row the current row; the @@ -1350,7 +1350,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * @param rows the number of rows to fetch * @exception SQLException if a database access error occurs; this method * is called on a closed result set or the - * condition rows >= 0 is not satisfied + * condition {@code rows >= 0} is not satisfied * @since 1.2 * @see #getFetchSize */ @@ -4101,7 +4101,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * Appendix B, Table B-3 and conversion of appropriate user defined SQL * types to a Java type which implements {@code SQLData}, or {@code Struct}. * Additional conversions may be supported and are vendor defined. - * + * @param the type of the class modeled by this Class object * @param columnIndex the first column is 1, the second is 2, ... * @param type Class representing the Java data type to convert the designated * column to. @@ -4135,6 +4135,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * of the column * @param type Class representing the Java data type to convert the designated * column to. + * @param the type of the class modeled by this Class object * @return an instance of {@code type} holding the column value * @throws SQLException if conversion is not supported, type is null or * another error occurs. The getCause() method of the @@ -4208,6 +4209,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * @param columnLabel the label for the column specified with the SQL AS * clause. If the SQL AS clause was not specified, then the label is * the name of the column + * @param x the new column value * @param targetSqlType the SQL type to be sent to the database * @param scaleOrLength for an object of {@code java.math.BigDecimal} , * this is the number of digits after the decimal point. For diff --git a/jdk/src/share/classes/java/sql/SQLInput.java b/jdk/src/share/classes/java/sql/SQLInput.java index 8d2540dc499..b768fa95e1e 100644 --- a/jdk/src/share/classes/java/sql/SQLInput.java +++ b/jdk/src/share/classes/java/sql/SQLInput.java @@ -444,6 +444,7 @@ public interface SQLInput { *

                                        * The default implementation will throw {@code SQLFeatureNotSupportedException} * + * @param the type of the class modeled by this Class object * @param type Class representing the Java data type to convert the attribute to. * @return the attribute at the head of the stream as an {@code Object} in the * Java programming language;{@code null} if the attribute is SQL {@code NULL} diff --git a/jdk/src/share/classes/java/sql/SQLPermission.java b/jdk/src/share/classes/java/sql/SQLPermission.java index 3aa5a42860b..d264706ab7d 100644 --- a/jdk/src/share/classes/java/sql/SQLPermission.java +++ b/jdk/src/share/classes/java/sql/SQLPermission.java @@ -103,7 +103,6 @@ import java.security.*; * Permits an application to remove a JDBC driver from the list of * registered Drivers and release its resources. * - * * *

                                        * @since 1.3 diff --git a/jdk/src/share/classes/java/sql/SQLXML.java b/jdk/src/share/classes/java/sql/SQLXML.java index 88e3baada72..2acc5d1d350 100644 --- a/jdk/src/share/classes/java/sql/SQLXML.java +++ b/jdk/src/share/classes/java/sql/SQLXML.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -360,6 +360,7 @@ public interface SQLXML * xmlReader.parse(saxSource.getInputSource()); *

      * + * @param the type of the class modeled by this Class object * @param sourceClass The class of the source, or null. * If the class is null, a vendor specifc Source implementation will be returned. * The following classes are supported at a minimum: @@ -401,6 +402,7 @@ public interface SQLXML * contentHandler.endDocument(); *
      * + * @param the type of the class modeled by this Class object * @param resultClass The class of the result, or null. * If resultClass is null, a vendor specific Result implementation will be returned. * The following classes are supported at a minimum: diff --git a/jdk/src/share/classes/java/sql/Statement.java b/jdk/src/share/classes/java/sql/Statement.java index 34859c52c44..29b372f522e 100644 --- a/jdk/src/share/classes/java/sql/Statement.java +++ b/jdk/src/share/classes/java/sql/Statement.java @@ -144,7 +144,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new column size limit in bytes; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closed Statement - * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxFieldSize */ void setMaxFieldSize(int max) throws SQLException; @@ -174,7 +174,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new max rows limit; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closed Statement - * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxRows */ void setMaxRows(int max) throws SQLException; @@ -240,7 +240,7 @@ public interface Statement extends Wrapper, AutoCloseable { * there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closed Statement - * or the condition seconds >= 0 is not satisfied + * or the condition {@code seconds >= 0} is not satisfied * @see #getQueryTimeout */ void setQueryTimeout(int seconds) throws SQLException; @@ -385,10 +385,10 @@ public interface Statement extends Wrapper, AutoCloseable { * object(s) obtained with the method getResultSet. * *

      There are no more results when the following is true: - *

      +     * 
      {@code
            *     // stmt is a Statement object
            *     ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
      -     * 
      + * }
      * * @return true if the next result is a ResultSet * object; false if it is an update count or there are @@ -452,7 +452,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param rows the number of rows to fetch * @exception SQLException if a database access error occurs, * this method is called on a closed Statement or the - * condition rows >= 0 is not satisfied. + * condition {@code rows >= 0} is not satisfied. * @since 1.2 * @see #getFetchSize */ @@ -665,10 +665,10 @@ public interface Statement extends Wrapper, AutoCloseable { * true if the next result is a ResultSet object. * *

      There are no more results when the following is true: - *

      +     * 
      {@code
            *     // stmt is a Statement object
            *     ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1))
      -     * 
      + * }
      * * @param current one of the following Statement * constants indicating what should happen to current @@ -1107,7 +1107,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new max rows limit; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closed Statement - * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxRows * @since 1.8 */ diff --git a/jdk/src/share/classes/java/sql/Wrapper.java b/jdk/src/share/classes/java/sql/Wrapper.java index 2eaa003f240..ee77431c0cd 100644 --- a/jdk/src/share/classes/java/sql/Wrapper.java +++ b/jdk/src/share/classes/java/sql/Wrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,7 @@ public interface Wrapper { * or a proxy for that result. If the receiver is not a * wrapper and does not implement the interface, then an SQLException is thrown. * + * @param the type of the class modeled by this Class object * @param iface A Class defining an interface that the result must implement. * @return an object that implements the interface. May be a proxy for the actual implementing object. * @throws java.sql.SQLException If no object found that implements the interface diff --git a/jdk/src/share/classes/java/text/CharacterIterator.java b/jdk/src/share/classes/java/text/CharacterIterator.java index 2b21e14e5ed..7674268db16 100644 --- a/jdk/src/share/classes/java/text/CharacterIterator.java +++ b/jdk/src/share/classes/java/text/CharacterIterator.java @@ -62,27 +62,27 @@ package java.text; *

      Examples:

      * * Traverse the text from start to finish - *

      + * 
      {@code
        * public void traverseForward(CharacterIterator iter) {
        *     for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
        *         processChar(c);
        *     }
        * }
      - * 
      + * }
      * * Traverse the text backwards, from end to start - *
      + * 
      {@code
        * public void traverseBackward(CharacterIterator iter) {
        *     for(char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) {
        *         processChar(c);
        *     }
        * }
      - * 
      + * }
      * * Traverse both forward and backward from a given position in the text. * Calls to notBoundary() in this example represents some * additional stopping criteria. - *
      + * 
      {@code
        * public void traverseOut(CharacterIterator iter, int pos) {
        *     for (char c = iter.setIndex(pos);
        *              c != CharacterIterator.DONE && notBoundary(c);
      @@ -96,7 +96,7 @@ package java.text;
        *     int start = iter.getIndex();
        *     processSection(start, end);
        * }
      - * 
      + * }
      * * @see StringCharacterIterator * @see AttributedCharacterIterator diff --git a/jdk/src/share/classes/java/text/ChoiceFormat.java b/jdk/src/share/classes/java/text/ChoiceFormat.java index 1e318848300..7814f0ef2c5 100644 --- a/jdk/src/share/classes/java/text/ChoiceFormat.java +++ b/jdk/src/share/classes/java/text/ChoiceFormat.java @@ -376,7 +376,7 @@ public class ChoiceFormat extends NumberFormat { /** * Returns pattern with formatted double. - * @param number number to be formatted & substituted. + * @param number number to be formatted and substituted. * @param toAppendTo where text is appended. * @param status ignore no useful status is returned. */ diff --git a/jdk/src/share/classes/java/text/Collator.java b/jdk/src/share/classes/java/text/Collator.java index aaa5276d6f7..d105a810439 100644 --- a/jdk/src/share/classes/java/text/Collator.java +++ b/jdk/src/share/classes/java/text/Collator.java @@ -72,14 +72,14 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * The following example shows how to compare two strings using * the Collator for the default locale. *
      - *
      + * 
      {@code
        * // Compare two strings in the default locale
        * Collator myCollator = Collator.getInstance();
        * if( myCollator.compare("abc", "ABC") < 0 )
        *     System.out.println("abc is less than ABC");
        * else
        *     System.out.println("abc is greater than or equal to ABC");
      - * 
      + * }
      *
      * *

      diff --git a/jdk/src/share/classes/java/text/DigitList.java b/jdk/src/share/classes/java/text/DigitList.java index da5e78d65b3..5f4321c025b 100644 --- a/jdk/src/share/classes/java/text/DigitList.java +++ b/jdk/src/share/classes/java/text/DigitList.java @@ -271,7 +271,7 @@ final class DigitList implements Cloneable { * @param maximumFractionDigits The most fractional digits which should * be converted. */ - public final void set(boolean isNegative, double source, int maximumFractionDigits) { + final void set(boolean isNegative, double source, int maximumFractionDigits) { set(isNegative, source, maximumFractionDigits, true); } @@ -288,10 +288,11 @@ final class DigitList implements Cloneable { */ final void set(boolean isNegative, double source, int maximumDigits, boolean fixedPoint) { - FloatingDecimal fd = new FloatingDecimal(source); - boolean hasBeenRoundedUp = fd.digitsRoundedUp(); - boolean allDecimalDigits = fd.decimalDigitsExact(); - String digitsString = fd.toJavaFormatString(); + FloatingDecimal.BinaryToASCIIConverter fdConverter = FloatingDecimal.getBinaryToASCIIConverter(source); + boolean hasBeenRoundedUp = fdConverter.digitsRoundedUp(); + boolean allDecimalDigits = fdConverter.decimalDigitsExact(); + assert !fdConverter.isExceptional(); + String digitsString = fdConverter.toJavaFormatString(); set(isNegative, digitsString, hasBeenRoundedUp, allDecimalDigits, @@ -305,9 +306,9 @@ final class DigitList implements Cloneable { * @param allDecimalDigits Boolean value indicating if the digits in s are * an exact decimal representation of the double that was passed. */ - final void set(boolean isNegative, String s, - boolean roundedUp, boolean allDecimalDigits, - int maximumDigits, boolean fixedPoint) { + private void set(boolean isNegative, String s, + boolean roundedUp, boolean allDecimalDigits, + int maximumDigits, boolean fixedPoint) { this.isNegative = isNegative; int len = s.length(); char[] source = getDataChars(len); @@ -607,7 +608,7 @@ final class DigitList implements Cloneable { /** * Utility routine to set the value of the digit list from a long */ - public final void set(boolean isNegative, long source) { + final void set(boolean isNegative, long source) { set(isNegative, source, 0); } @@ -620,7 +621,7 @@ final class DigitList implements Cloneable { * If maximumDigits is lower than the number of significant digits * in source, the representation will be rounded. Ignored if <= 0. */ - public final void set(boolean isNegative, long source, int maximumDigits) { + final void set(boolean isNegative, long source, int maximumDigits) { this.isNegative = isNegative; // This method does not expect a negative number. However, diff --git a/jdk/src/share/classes/java/text/SimpleDateFormat.java b/jdk/src/share/classes/java/text/SimpleDateFormat.java index 4e85d0d5651..9c5aaa35561 100644 --- a/jdk/src/share/classes/java/text/SimpleDateFormat.java +++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java @@ -1845,6 +1845,8 @@ public class SimpleDateFormat extends DateFormat { } ++pos.index; } + // Remember the actual start index + int actualStart = pos.index; parsing: { @@ -1924,9 +1926,9 @@ public class SimpleDateFormat extends DateFormat { // we made adjustments to place the 2-digit year in the proper // century, for parsed strings from "00" to "99". Any other string // is treated literally: "2250", "-1", "1", "002". - if (count <= 2 && (pos.index - start) == 2 - && Character.isDigit(text.charAt(start)) - && Character.isDigit(text.charAt(start+1))) { + if (count <= 2 && (pos.index - actualStart) == 2 + && Character.isDigit(text.charAt(actualStart)) + && Character.isDigit(text.charAt(actualStart + 1))) { // Assume for example that the defaultCenturyStart is 6/18/1903. // This means that two-digit years will be forced into the range // 6/18/1903 to 6/17/2003. As a result, years 00, 01, and 02 diff --git a/jdk/src/share/classes/java/time/format/DateTimeFormatter.java b/jdk/src/share/classes/java/time/format/DateTimeFormatter.java index 158c741dff4..2552f96e5ad 100644 --- a/jdk/src/share/classes/java/time/format/DateTimeFormatter.java +++ b/jdk/src/share/classes/java/time/format/DateTimeFormatter.java @@ -1304,6 +1304,7 @@ public final class DateTimeFormatter { * LocalTime time = parsed.query(LocalTime::from); * Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays()); *

      + * @return a query that provides access to the excess days that were parsed */ public static final TemporalQuery parsedExcessDays() { return PARSED_EXCESS_DAYS; @@ -1344,6 +1345,7 @@ public final class DateTimeFormatter { * // validate leap-second is correct and apply correct smoothing * } *
      + * @return a query that provides access to whether a leap-second was parsed */ public static final TemporalQuery parsedLeapSecond() { return PARSED_LEAP_SECOND; diff --git a/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java new file mode 100644 index 00000000000..ef59ec7d478 --- /dev/null +++ b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java @@ -0,0 +1,697 @@ +/* + * 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 java.util; + +/* + * Written by Doug Lea with assistance from members of JCP JSR-166 + * Expert Group and released to the public domain, as explained at + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.CountedCompleter; +import java.util.function.BinaryOperator; +import java.util.function.IntBinaryOperator; +import java.util.function.LongBinaryOperator; +import java.util.function.DoubleBinaryOperator; + +/** + * ForkJoin tasks to perform Arrays.parallelPrefix operations. + * + * @author Doug Lea + * @since 1.8 + */ +class ArrayPrefixHelpers { + private ArrayPrefixHelpers() {}; // non-instantiable + + /* + * Parallel prefix (aka cumulate, scan) task classes + * are based loosely on Guy Blelloch's original + * algorithm (http://www.cs.cmu.edu/~scandal/alg/scan.html): + * Keep dividing by two to threshold segment size, and then: + * Pass 1: Create tree of partial sums for each segment + * Pass 2: For each segment, cumulate with offset of left sibling + * + * This version improves performance within FJ framework mainly by + * allowing the second pass of ready left-hand sides to proceed + * even if some right-hand side first passes are still executing. + * It also combines first and second pass for leftmost segment, + * and skips the first pass for rightmost segment (whose result is + * not needed for second pass). It similarly manages to avoid + * requiring that users supply an identity basis for accumulations + * by tracking those segments/subtasks for which the first + * existing element is used as base. + * + * Managing this relies on ORing some bits in the pendingCount for + * phases/states: CUMULATE, SUMMED, and FINISHED. CUMULATE is the + * main phase bit. When false, segments compute only their sum. + * When true, they cumulate array elements. CUMULATE is set at + * root at beginning of second pass and then propagated down. But + * it may also be set earlier for subtrees with lo==0 (the left + * spine of tree). SUMMED is a one bit join count. For leafs, it + * is set when summed. For internal nodes, it becomes true when + * one child is summed. When the second child finishes summing, + * we then moves up tree to trigger the cumulate phase. FINISHED + * is also a one bit join count. For leafs, it is set when + * cumulated. For internal nodes, it becomes true when one child + * is cumulated. When the second child finishes cumulating, it + * then moves up tree, completing at the root. + * + * To better exploit locality and reduce overhead, the compute + * method loops starting with the current task, moving if possible + * to one of its subtasks rather than forking. + * + * As usual for this sort of utility, there are 4 versions, that + * are simple copy/paste/adapt variants of each other. (The + * double and int versions differ from long version soley by + * replacing "long" (with case-matching)). + */ + + // see above + static final int CUMULATE = 1; + static final int SUMMED = 2; + static final int FINISHED = 4; + + /** The smallest subtask array partition size to use as threshold */ + static final int MIN_PARTITION = 16; + + static final class CumulateTask extends CountedCompleter { + final T[] array; + final BinaryOperator function; + CumulateTask left, right; + T in, out; + final int lo, hi, origin, fence, threshold; + + /** Root task constructor */ + public CumulateTask(CumulateTask parent, + BinaryOperator function, + T[] array, int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.lo = this.origin = lo; this.hi = this.fence = hi; + int p; + this.threshold = + (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3)) + <= MIN_PARTITION ? MIN_PARTITION : p; + } + + /** Subtask constructor */ + CumulateTask(CumulateTask parent, BinaryOperator function, + T[] array, int origin, int fence, int threshold, + int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.origin = origin; this.fence = fence; + this.threshold = threshold; + this.lo = lo; this.hi = hi; + } + + public final void compute() { + final BinaryOperator fn; + final T[] a; + if ((fn = this.function) == null || (a = this.array) == null) + throw new NullPointerException(); // hoist checks + int th = threshold, org = origin, fnc = fence, l, h; + CumulateTask t = this; + outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) { + if (h - l > th) { + CumulateTask lt = t.left, rt = t.right, f; + if (lt == null) { // first pass + int mid = (l + h) >>> 1; + f = rt = t.right = + new CumulateTask(t, fn, a, org, fnc, th, mid, h); + t = lt = t.left = + new CumulateTask(t, fn, a, org, fnc, th, l, mid); + } + else { // possibly refork + T pin = t.in; + lt.in = pin; + f = t = null; + if (rt != null) { + T lout = lt.out; + rt.in = (l == org ? lout : + fn.apply(pin, lout)); + for (int c;;) { + if (((c = rt.getPendingCount()) & CUMULATE) != 0) + break; + if (rt.compareAndSetPendingCount(c, c|CUMULATE)){ + t = rt; + break; + } + } + } + for (int c;;) { + if (((c = lt.getPendingCount()) & CUMULATE) != 0) + break; + if (lt.compareAndSetPendingCount(c, c|CUMULATE)) { + if (t != null) + f = t; + t = lt; + break; + } + } + if (t == null) + break; + } + if (f != null) + f.fork(); + } + else { + int state; // Transition to sum, cumulate, or both + for (int b;;) { + if (((b = t.getPendingCount()) & FINISHED) != 0) + break outer; // already done + state = ((b & CUMULATE) != 0? FINISHED : + (l > org) ? SUMMED : (SUMMED|FINISHED)); + if (t.compareAndSetPendingCount(b, b|state)) + break; + } + + T sum; + if (state != SUMMED) { + int first; + if (l == org) { // leftmost; no in + sum = a[org]; + first = org + 1; + } + else { + sum = t.in; + first = l; + } + for (int i = first; i < h; ++i) // cumulate + a[i] = sum = fn.apply(sum, a[i]); + } + else if (h < fnc) { // skip rightmost + sum = a[l]; + for (int i = l + 1; i < h; ++i) // sum only + sum = fn.apply(sum, a[i]); + } + else + sum = t.in; + t.out = sum; + for (CumulateTask par;;) { // propagate + if ((par = (CumulateTask)t.getCompleter()) == null) { + if ((state & FINISHED) != 0) // enable join + t.quietlyComplete(); + break outer; + } + int b = par.getPendingCount(); + if ((b & state & FINISHED) != 0) + t = par; // both done + else if ((b & state & SUMMED) != 0) { // both summed + int nextState; CumulateTask lt, rt; + if ((lt = par.left) != null && + (rt = par.right) != null) { + T lout = lt.out; + par.out = (rt.hi == fnc ? lout : + fn.apply(lout, rt.out)); + } + int refork = (((b & CUMULATE) == 0 && + par.lo == org) ? CUMULATE : 0); + if ((nextState = b|state|refork) == b || + par.compareAndSetPendingCount(b, nextState)) { + state = SUMMED; // drop finished + t = par; + if (refork != 0) + par.fork(); + } + } + else if (par.compareAndSetPendingCount(b, b|state)) + break outer; // sib not ready + } + } + } + } + } + + static final class LongCumulateTask extends CountedCompleter { + final long[] array; + final LongBinaryOperator function; + LongCumulateTask left, right; + long in, out; + final int lo, hi, origin, fence, threshold; + + /** Root task constructor */ + public LongCumulateTask(LongCumulateTask parent, + LongBinaryOperator function, + long[] array, int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.lo = this.origin = lo; this.hi = this.fence = hi; + int p; + this.threshold = + (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3)) + <= MIN_PARTITION ? MIN_PARTITION : p; + } + + /** Subtask constructor */ + LongCumulateTask(LongCumulateTask parent, LongBinaryOperator function, + long[] array, int origin, int fence, int threshold, + int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.origin = origin; this.fence = fence; + this.threshold = threshold; + this.lo = lo; this.hi = hi; + } + + public final void compute() { + final LongBinaryOperator fn; + final long[] a; + if ((fn = this.function) == null || (a = this.array) == null) + throw new NullPointerException(); // hoist checks + int th = threshold, org = origin, fnc = fence, l, h; + LongCumulateTask t = this; + outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) { + if (h - l > th) { + LongCumulateTask lt = t.left, rt = t.right, f; + if (lt == null) { // first pass + int mid = (l + h) >>> 1; + f = rt = t.right = + new LongCumulateTask(t, fn, a, org, fnc, th, mid, h); + t = lt = t.left = + new LongCumulateTask(t, fn, a, org, fnc, th, l, mid); + } + else { // possibly refork + long pin = t.in; + lt.in = pin; + f = t = null; + if (rt != null) { + long lout = lt.out; + rt.in = (l == org ? lout : + fn.applyAsLong(pin, lout)); + for (int c;;) { + if (((c = rt.getPendingCount()) & CUMULATE) != 0) + break; + if (rt.compareAndSetPendingCount(c, c|CUMULATE)){ + t = rt; + break; + } + } + } + for (int c;;) { + if (((c = lt.getPendingCount()) & CUMULATE) != 0) + break; + if (lt.compareAndSetPendingCount(c, c|CUMULATE)) { + if (t != null) + f = t; + t = lt; + break; + } + } + if (t == null) + break; + } + if (f != null) + f.fork(); + } + else { + int state; // Transition to sum, cumulate, or both + for (int b;;) { + if (((b = t.getPendingCount()) & FINISHED) != 0) + break outer; // already done + state = ((b & CUMULATE) != 0? FINISHED : + (l > org) ? SUMMED : (SUMMED|FINISHED)); + if (t.compareAndSetPendingCount(b, b|state)) + break; + } + + long sum; + if (state != SUMMED) { + int first; + if (l == org) { // leftmost; no in + sum = a[org]; + first = org + 1; + } + else { + sum = t.in; + first = l; + } + for (int i = first; i < h; ++i) // cumulate + a[i] = sum = fn.applyAsLong(sum, a[i]); + } + else if (h < fnc) { // skip rightmost + sum = a[l]; + for (int i = l + 1; i < h; ++i) // sum only + sum = fn.applyAsLong(sum, a[i]); + } + else + sum = t.in; + t.out = sum; + for (LongCumulateTask par;;) { // propagate + if ((par = (LongCumulateTask)t.getCompleter()) == null) { + if ((state & FINISHED) != 0) // enable join + t.quietlyComplete(); + break outer; + } + int b = par.getPendingCount(); + if ((b & state & FINISHED) != 0) + t = par; // both done + else if ((b & state & SUMMED) != 0) { // both summed + int nextState; LongCumulateTask lt, rt; + if ((lt = par.left) != null && + (rt = par.right) != null) { + long lout = lt.out; + par.out = (rt.hi == fnc ? lout : + fn.applyAsLong(lout, rt.out)); + } + int refork = (((b & CUMULATE) == 0 && + par.lo == org) ? CUMULATE : 0); + if ((nextState = b|state|refork) == b || + par.compareAndSetPendingCount(b, nextState)) { + state = SUMMED; // drop finished + t = par; + if (refork != 0) + par.fork(); + } + } + else if (par.compareAndSetPendingCount(b, b|state)) + break outer; // sib not ready + } + } + } + } + } + + static final class DoubleCumulateTask extends CountedCompleter { + final double[] array; + final DoubleBinaryOperator function; + DoubleCumulateTask left, right; + double in, out; + final int lo, hi, origin, fence, threshold; + + /** Root task constructor */ + public DoubleCumulateTask(DoubleCumulateTask parent, + DoubleBinaryOperator function, + double[] array, int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.lo = this.origin = lo; this.hi = this.fence = hi; + int p; + this.threshold = + (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3)) + <= MIN_PARTITION ? MIN_PARTITION : p; + } + + /** Subtask constructor */ + DoubleCumulateTask(DoubleCumulateTask parent, DoubleBinaryOperator function, + double[] array, int origin, int fence, int threshold, + int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.origin = origin; this.fence = fence; + this.threshold = threshold; + this.lo = lo; this.hi = hi; + } + + public final void compute() { + final DoubleBinaryOperator fn; + final double[] a; + if ((fn = this.function) == null || (a = this.array) == null) + throw new NullPointerException(); // hoist checks + int th = threshold, org = origin, fnc = fence, l, h; + DoubleCumulateTask t = this; + outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) { + if (h - l > th) { + DoubleCumulateTask lt = t.left, rt = t.right, f; + if (lt == null) { // first pass + int mid = (l + h) >>> 1; + f = rt = t.right = + new DoubleCumulateTask(t, fn, a, org, fnc, th, mid, h); + t = lt = t.left = + new DoubleCumulateTask(t, fn, a, org, fnc, th, l, mid); + } + else { // possibly refork + double pin = t.in; + lt.in = pin; + f = t = null; + if (rt != null) { + double lout = lt.out; + rt.in = (l == org ? lout : + fn.applyAsDouble(pin, lout)); + for (int c;;) { + if (((c = rt.getPendingCount()) & CUMULATE) != 0) + break; + if (rt.compareAndSetPendingCount(c, c|CUMULATE)){ + t = rt; + break; + } + } + } + for (int c;;) { + if (((c = lt.getPendingCount()) & CUMULATE) != 0) + break; + if (lt.compareAndSetPendingCount(c, c|CUMULATE)) { + if (t != null) + f = t; + t = lt; + break; + } + } + if (t == null) + break; + } + if (f != null) + f.fork(); + } + else { + int state; // Transition to sum, cumulate, or both + for (int b;;) { + if (((b = t.getPendingCount()) & FINISHED) != 0) + break outer; // already done + state = ((b & CUMULATE) != 0? FINISHED : + (l > org) ? SUMMED : (SUMMED|FINISHED)); + if (t.compareAndSetPendingCount(b, b|state)) + break; + } + + double sum; + if (state != SUMMED) { + int first; + if (l == org) { // leftmost; no in + sum = a[org]; + first = org + 1; + } + else { + sum = t.in; + first = l; + } + for (int i = first; i < h; ++i) // cumulate + a[i] = sum = fn.applyAsDouble(sum, a[i]); + } + else if (h < fnc) { // skip rightmost + sum = a[l]; + for (int i = l + 1; i < h; ++i) // sum only + sum = fn.applyAsDouble(sum, a[i]); + } + else + sum = t.in; + t.out = sum; + for (DoubleCumulateTask par;;) { // propagate + if ((par = (DoubleCumulateTask)t.getCompleter()) == null) { + if ((state & FINISHED) != 0) // enable join + t.quietlyComplete(); + break outer; + } + int b = par.getPendingCount(); + if ((b & state & FINISHED) != 0) + t = par; // both done + else if ((b & state & SUMMED) != 0) { // both summed + int nextState; DoubleCumulateTask lt, rt; + if ((lt = par.left) != null && + (rt = par.right) != null) { + double lout = lt.out; + par.out = (rt.hi == fnc ? lout : + fn.applyAsDouble(lout, rt.out)); + } + int refork = (((b & CUMULATE) == 0 && + par.lo == org) ? CUMULATE : 0); + if ((nextState = b|state|refork) == b || + par.compareAndSetPendingCount(b, nextState)) { + state = SUMMED; // drop finished + t = par; + if (refork != 0) + par.fork(); + } + } + else if (par.compareAndSetPendingCount(b, b|state)) + break outer; // sib not ready + } + } + } + } + } + + static final class IntCumulateTask extends CountedCompleter { + final int[] array; + final IntBinaryOperator function; + IntCumulateTask left, right; + int in, out; + final int lo, hi, origin, fence, threshold; + + /** Root task constructor */ + public IntCumulateTask(IntCumulateTask parent, + IntBinaryOperator function, + int[] array, int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.lo = this.origin = lo; this.hi = this.fence = hi; + int p; + this.threshold = + (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3)) + <= MIN_PARTITION ? MIN_PARTITION : p; + } + + /** Subtask constructor */ + IntCumulateTask(IntCumulateTask parent, IntBinaryOperator function, + int[] array, int origin, int fence, int threshold, + int lo, int hi) { + super(parent); + this.function = function; this.array = array; + this.origin = origin; this.fence = fence; + this.threshold = threshold; + this.lo = lo; this.hi = hi; + } + + public final void compute() { + final IntBinaryOperator fn; + final int[] a; + if ((fn = this.function) == null || (a = this.array) == null) + throw new NullPointerException(); // hoist checks + int th = threshold, org = origin, fnc = fence, l, h; + IntCumulateTask t = this; + outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) { + if (h - l > th) { + IntCumulateTask lt = t.left, rt = t.right, f; + if (lt == null) { // first pass + int mid = (l + h) >>> 1; + f = rt = t.right = + new IntCumulateTask(t, fn, a, org, fnc, th, mid, h); + t = lt = t.left = + new IntCumulateTask(t, fn, a, org, fnc, th, l, mid); + } + else { // possibly refork + int pin = t.in; + lt.in = pin; + f = t = null; + if (rt != null) { + int lout = lt.out; + rt.in = (l == org ? lout : + fn.applyAsInt(pin, lout)); + for (int c;;) { + if (((c = rt.getPendingCount()) & CUMULATE) != 0) + break; + if (rt.compareAndSetPendingCount(c, c|CUMULATE)){ + t = rt; + break; + } + } + } + for (int c;;) { + if (((c = lt.getPendingCount()) & CUMULATE) != 0) + break; + if (lt.compareAndSetPendingCount(c, c|CUMULATE)) { + if (t != null) + f = t; + t = lt; + break; + } + } + if (t == null) + break; + } + if (f != null) + f.fork(); + } + else { + int state; // Transition to sum, cumulate, or both + for (int b;;) { + if (((b = t.getPendingCount()) & FINISHED) != 0) + break outer; // already done + state = ((b & CUMULATE) != 0? FINISHED : + (l > org) ? SUMMED : (SUMMED|FINISHED)); + if (t.compareAndSetPendingCount(b, b|state)) + break; + } + + int sum; + if (state != SUMMED) { + int first; + if (l == org) { // leftmost; no in + sum = a[org]; + first = org + 1; + } + else { + sum = t.in; + first = l; + } + for (int i = first; i < h; ++i) // cumulate + a[i] = sum = fn.applyAsInt(sum, a[i]); + } + else if (h < fnc) { // skip rightmost + sum = a[l]; + for (int i = l + 1; i < h; ++i) // sum only + sum = fn.applyAsInt(sum, a[i]); + } + else + sum = t.in; + t.out = sum; + for (IntCumulateTask par;;) { // propagate + if ((par = (IntCumulateTask)t.getCompleter()) == null) { + if ((state & FINISHED) != 0) // enable join + t.quietlyComplete(); + break outer; + } + int b = par.getPendingCount(); + if ((b & state & FINISHED) != 0) + t = par; // both done + else if ((b & state & SUMMED) != 0) { // both summed + int nextState; IntCumulateTask lt, rt; + if ((lt = par.left) != null && + (rt = par.right) != null) { + int lout = lt.out; + par.out = (rt.hi == fnc ? lout : + fn.applyAsInt(lout, rt.out)); + } + int refork = (((b & CUMULATE) == 0 && + par.lo == org) ? CUMULATE : 0); + if ((nextState = b|state|refork) == b || + par.compareAndSetPendingCount(b, nextState)) { + state = SUMMED; // drop finished + t = par; + if (refork != 0) + par.fork(); + } + } + else if (par.compareAndSetPendingCount(b, b|state)) + break outer; // sib not ready + } + } + } + } + } + + +} \ No newline at end of file diff --git a/jdk/src/share/classes/java/util/Arrays.java b/jdk/src/share/classes/java/util/Arrays.java index 4035666d2ab..196a31e5767 100644 --- a/jdk/src/share/classes/java/util/Arrays.java +++ b/jdk/src/share/classes/java/util/Arrays.java @@ -1559,6 +1559,183 @@ public class Arrays { } } + // Parallel prefix + + /** + * Cumulates, in parallel, each element of the given array in place, + * using the supplied function. For example if the array initially + * holds {@code [2, 1, 0, 3]} and the operation performs addition, + * then upon return the array holds {@code [2, 3, 3, 6]}. + * Parallel prefix computation is usually more efficient than + * sequential loops for large arrays. + * + * @param array the array, which is modified in-place by this method + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(T[] array, BinaryOperator op) { + if (array.length > 0) + new ArrayPrefixHelpers.CumulateTask<> + (null, op, array, 0, array.length).invoke(); + } + + /** + * Performs {@link #parallelPrefix(Object[], BinaryOperator)} + * for the given subrange of the array. + * + * @param array the array + * @param fromIndex the index of the first element, inclusive + * @param toIndex the index of the last element, exclusive + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws IllegalArgumentException if {@code fromIndex > toIndex} + * @throws ArrayIndexOutOfBoundsException + * if {@code fromIndex < 0} or {@code toIndex > array.length} + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(T[] array, int fromIndex, + int toIndex, BinaryOperator op) { + rangeCheck(array.length, fromIndex, toIndex); + if (fromIndex < toIndex) + new ArrayPrefixHelpers.CumulateTask<> + (null, op, array, fromIndex, toIndex).invoke(); + } + + /** + * Cumulates, in parallel, each element of the given array in place, + * using the supplied function. For example if the array initially + * holds {@code [2, 1, 0, 3]} and the operation performs addition, + * then upon return the array holds {@code [2, 3, 3, 6]}. + * Parallel prefix computation is usually more efficient than + * sequential loops for large arrays. + * + * @param array the array, which is modified in-place by this method + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(long[] array, LongBinaryOperator op) { + if (array.length > 0) + new ArrayPrefixHelpers.LongCumulateTask + (null, op, array, 0, array.length).invoke(); + } + + /** + * Performs {@link #parallelPrefix(long[], LongBinaryOperator)} + * for the given subrange of the array. + * + * @param array the array + * @param fromIndex the index of the first element, inclusive + * @param toIndex the index of the last element, exclusive + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws IllegalArgumentException if {@code fromIndex > toIndex} + * @throws ArrayIndexOutOfBoundsException + * if {@code fromIndex < 0} or {@code toIndex > array.length} + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(long[] array, int fromIndex, + int toIndex, LongBinaryOperator op) { + rangeCheck(array.length, fromIndex, toIndex); + if (fromIndex < toIndex) + new ArrayPrefixHelpers.LongCumulateTask + (null, op, array, fromIndex, toIndex).invoke(); + } + + /** + * Cumulates, in parallel, each element of the given array in place, + * using the supplied function. For example if the array initially + * holds {@code [2.0, 1.0, 0.0, 3.0]} and the operation performs addition, + * then upon return the array holds {@code [2.0, 3.0, 3.0, 6.0]}. + * Parallel prefix computation is usually more efficient than + * sequential loops for large arrays. + * + *

      Because floating-point operations may not be strictly associative, + * the returned result may not be identical to the value that would be + * obtained if the operation was performed sequentially. + * + * @param array the array, which is modified in-place by this method + * @param op a side-effect-free function to perform the cumulation + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(double[] array, DoubleBinaryOperator op) { + if (array.length > 0) + new ArrayPrefixHelpers.DoubleCumulateTask + (null, op, array, 0, array.length).invoke(); + } + + /** + * Performs {@link #parallelPrefix(double[], DoubleBinaryOperator)} + * for the given subrange of the array. + * + * @param array the array + * @param fromIndex the index of the first element, inclusive + * @param toIndex the index of the last element, exclusive + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws IllegalArgumentException if {@code fromIndex > toIndex} + * @throws ArrayIndexOutOfBoundsException + * if {@code fromIndex < 0} or {@code toIndex > array.length} + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(double[] array, int fromIndex, + int toIndex, DoubleBinaryOperator op) { + rangeCheck(array.length, fromIndex, toIndex); + if (fromIndex < toIndex) + new ArrayPrefixHelpers.DoubleCumulateTask + (null, op, array, fromIndex, toIndex).invoke(); + } + + /** + * Cumulates, in parallel, each element of the given array in place, + * using the supplied function. For example if the array initially + * holds {@code [2, 1, 0, 3]} and the operation performs addition, + * then upon return the array holds {@code [2, 3, 3, 6]}. + * Parallel prefix computation is usually more efficient than + * sequential loops for large arrays. + * + * @param array the array, which is modified in-place by this method + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(int[] array, IntBinaryOperator op) { + if (array.length > 0) + new ArrayPrefixHelpers.IntCumulateTask + (null, op, array, 0, array.length).invoke(); + } + + /** + * Performs {@link #parallelPrefix(int[], IntBinaryOperator)} + * for the given subrange of the array. + * + * @param array the array + * @param fromIndex the index of the first element, inclusive + * @param toIndex the index of the last element, exclusive + * @param op a side-effect-free, associative function to perform the + * cumulation + * @throws IllegalArgumentException if {@code fromIndex > toIndex} + * @throws ArrayIndexOutOfBoundsException + * if {@code fromIndex < 0} or {@code toIndex > array.length} + * @throws NullPointerException if the specified array or function is null + * @since 1.8 + */ + public static void parallelPrefix(int[] array, int fromIndex, + int toIndex, IntBinaryOperator op) { + rangeCheck(array.length, fromIndex, toIndex); + if (fromIndex < toIndex) + new ArrayPrefixHelpers.IntCumulateTask + (null, op, array, fromIndex, toIndex).invoke(); + } + // Searching /** diff --git a/jdk/src/share/classes/java/util/Calendar.java b/jdk/src/share/classes/java/util/Calendar.java index 19c3c8540a7..566b8b090be 100644 --- a/jdk/src/share/classes/java/util/Calendar.java +++ b/jdk/src/share/classes/java/util/Calendar.java @@ -2681,9 +2681,9 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar represents a time * before the time represented by the specified * Object. This method is equivalent to: - *

      + *
      {@code
            *         compareTo(when) < 0
      -     * 
      + * } * if and only if when is a Calendar * instance. Otherwise, the method returns false. * @@ -2702,9 +2702,9 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar
      represents a time * after the time represented by the specified * Object. This method is equivalent to: - *
      + *
      {@code
            *         compareTo(when) > 0
      -     * 
      + * } * if and only if when is a Calendar * instance. Otherwise, the method returns false. * diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index 30d589cdc7d..ad4540db14a 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -924,9 +924,9 @@ public class Collections { * Returns the starting position of the first occurrence of the specified * target list within the specified source list, or -1 if there is no * such occurrence. More formally, returns the lowest index i - * such that source.subList(i, i+target.size()).equals(target), + * such that {@code source.subList(i, i+target.size()).equals(target)}, * or -1 if there is no such index. (Returns -1 if - * target.size() > source.size().) + * {@code target.size() > source.size()}) * *

      This implementation uses the "brute force" technique of scanning * over the source list, looking for a match with the target at each @@ -977,9 +977,9 @@ public class Collections { * Returns the starting position of the last occurrence of the specified * target list within the specified source list, or -1 if there is no such * occurrence. More formally, returns the highest index i - * such that source.subList(i, i+target.size()).equals(target), + * such that {@code source.subList(i, i+target.size()).equals(target)}, * or -1 if there is no such index. (Returns -1 if - * target.size() > source.size().) + * {@code target.size() > source.size()}) * *

      This implementation uses the "brute force" technique of iterating * over the source list, looking for a match with the target at each @@ -4304,6 +4304,11 @@ public class Collections { } private Object readResolve() { return Collections.reverseOrder(); } + + @Override + public Comparator> reversed() { + return Comparator.naturalOrder(); + } } /** @@ -4367,6 +4372,11 @@ public class Collections { public int hashCode() { return cmp.hashCode() ^ Integer.MIN_VALUE; } + + @Override + public Comparator reversed() { + return cmp; + } } /** diff --git a/jdk/src/share/classes/java/util/Comparator.java b/jdk/src/share/classes/java/util/Comparator.java index 017c2e78e2c..cd65ca4ea06 100644 --- a/jdk/src/share/classes/java/util/Comparator.java +++ b/jdk/src/share/classes/java/util/Comparator.java @@ -25,10 +25,12 @@ package java.util; +import java.io.Serializable; import java.util.function.Function; import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; import java.util.function.ToDoubleFunction; +import java.util.Comparators; /** * A comparison function, which imposes a total ordering on some @@ -175,88 +177,357 @@ public interface Comparator { * Returns a comparator that imposes the reverse ordering of this * comparator. * - * @return A comparator that imposes the reverse ordering of this + * @return a comparator that imposes the reverse ordering of this * comparator. * @since 1.8 */ - default Comparator reverseOrder() { + default Comparator reversed() { return Collections.reverseOrder(this); } /** - * Constructs a lexicographic order comparator with another comparator. - * For example, a {@code Comparator byLastName} can be composed - * with another {@code Comparator byFirstName}, then {@code - * byLastName.thenComparing(byFirstName)} creates a {@code - * Comparator} which sorts by last name, and for equal last names - * sorts by first name. + * Returns a lexicographic-order comparator with another comparator. + * If this {@code Comparator} considers two elements equal, i.e. + * {@code compare(a, b) == 0}, {@code other} is used to determine the order. * - * @param other the other comparator used when equals on this. + *

      The returned comparator is serializable if the specified comparator + * is also serializable. + * + * @apiNote + * For example, to sort a collection of {@code String} based on the length + * and then case-insensitive natural ordering, the comparator can be + * composed using following code, + * + *

      {@code
      +     *     Comparator cmp = Comparator.comparing(String::length)
      +     *             .thenComparing(String.CASE_INSENSITIVE_ORDER);
      +     * }
      + * + * @param other the other comparator to be used when this comparator + * compares two objects that are equal. + * @return a lexicographic-order comparator composed of this and then the + * other comparator * @throws NullPointerException if the argument is null. * @since 1.8 */ default Comparator thenComparing(Comparator other) { - return Comparators.compose(this, other); + Objects.requireNonNull(other); + return (Comparator & Serializable) (c1, c2) -> { + int res = compare(c1, c2); + return (res != 0) ? res : other.compare(c1, c2); + }; } /** - * Constructs a lexicographic order comparator with a function that - * extracts a {@code Comparable} key. This default implementation calls - * {@code thenComparing(this, Comparators.comparing(keyExtractor))}. + * Returns a lexicographic-order comparator with a function that + * extracts a key to be compared with the given {@code Comparator}. * - * @param the {@link Comparable} type for comparison - * @param keyExtractor the function used to extract the {@link Comparable} sort key + * @implSpec This default implementation behaves as if {@code + * thenComparing(comparing(keyExtractor, cmp))}. + * + * @param the type of the sort key + * @param keyExtractor the function used to extract the sort key + * @param keyComparator the {@code Comparator} used to compare the sort key + * @return a lexicographic-order comparator composed of this comparator + * and then comparing on the key extracted by the keyExtractor function * @throws NullPointerException if the argument is null. - * @see Comparators#comparing(Function) + * @see #comparing(Function, Comparator) * @see #thenComparing(Comparator) * @since 1.8 */ - default > Comparator thenComparing(Function keyExtractor) { - return thenComparing(Comparators.comparing(keyExtractor)); + default > Comparator thenComparing( + Function keyExtractor, + Comparator keyComparator) + { + return thenComparing(comparing(keyExtractor, keyComparator)); } /** - * Constructs a lexicographic order comparator with a function that - * extracts a {@code int} value. This default implementation calls {@code - * thenComparing(this, Comparators.comparing(keyExtractor))}. + * Returns a lexicographic-order comparator with a function that + * extracts a {@code Comparable} sort key. * - * @param keyExtractor the function used to extract the integer value + * @implSpec This default implementation behaves as if {@code + * thenComparing(comparing(keyExtractor))}. + * + * @param the type of the {@link Comparable} sort key + * @param keyExtractor the function used to extract the {@link + * Comparable} sort key + * @return a lexicographic-order comparator composed of this and then the + * {@link Comparable} sort key. * @throws NullPointerException if the argument is null. - * @see Comparators#comparing(ToIntFunction) + * @see #comparing(Function) + * @see #thenComparing(Comparator) + * @since 1.8 + */ + default > Comparator thenComparing( + Function keyExtractor) + { + return thenComparing(comparing(keyExtractor)); + } + + /** + * Returns a lexicographic-order comparator with a function that + * extracts a {@code int} sort key. + * + * @implSpec This default implementation behaves as if {@code + * thenComparing(comparing(keyExtractor))}. + * + * @param keyExtractor the function used to extract the integer sort key + * @return a lexicographic-order comparator composed of this and then the + * {@code int} sort key + * @throws NullPointerException if the argument is null. + * @see #comparing(ToIntFunction) * @see #thenComparing(Comparator) * @since 1.8 */ default Comparator thenComparing(ToIntFunction keyExtractor) { - return thenComparing(Comparators.comparing(keyExtractor)); + return thenComparing(comparing(keyExtractor)); } /** - * Constructs a lexicographic order comparator with a function that - * extracts a {@code long} value. This default implementation calls - * {@code thenComparing(this, Comparators.comparing(keyExtractor))}. + * Returns a lexicographic-order comparator with a function that + * extracts a {@code long} sort key. * - * @param keyExtractor the function used to extract the long value + * @implSpec This default implementation behaves as if {@code + * thenComparing(comparing(keyExtractor))}. + * + * @param keyExtractor the function used to extract the long sort key + * @return a lexicographic-order comparator composed of this and then the + * {@code long} sort key * @throws NullPointerException if the argument is null. - * @see Comparators#comparing(ToLongFunction) + * @see #comparing(ToLongFunction) * @see #thenComparing(Comparator) * @since 1.8 */ default Comparator thenComparing(ToLongFunction keyExtractor) { - return thenComparing(Comparators.comparing(keyExtractor)); + return thenComparing(comparing(keyExtractor)); } /** - * Constructs a lexicographic order comparator with a function that - * extracts a {@code double} value. This default implementation calls - * {@code thenComparing(this, Comparators.comparing(keyExtractor))}. + * Returns a lexicographic-order comparator with a function that + * extracts a {@code double} sort key. * - * @param keyExtractor the function used to extract the double value + * @implSpec This default implementation behaves as if {@code + * thenComparing(comparing(keyExtractor))}. + * + * @param keyExtractor the function used to extract the double sort key + * @return a lexicographic-order comparator composed of this and then the + * {@code double} sort key * @throws NullPointerException if the argument is null. - * @see Comparators#comparing(ToDoubleFunction) + * @see #comparing(ToDoubleFunction) * @see #thenComparing(Comparator) * @since 1.8 */ default Comparator thenComparing(ToDoubleFunction keyExtractor) { - return thenComparing(Comparators.comparing(keyExtractor)); + return thenComparing(comparing(keyExtractor)); + } + + /** + * Returns a comparator that imposes the reverse of the natural + * ordering. + * + *

      The returned comparator is serializable and throws {@link + * NullPointerException} when comparing {@code null}. + * + * @param the {@link Comparable} type of element to be compared + * @return a comparator that imposes the reverse of the natural + * ordering on {@code Comparable} objects. + * @see Comparable + * @since 1.8 + */ + public static > Comparator reverseOrder() { + return Collections.reverseOrder(); + } + + /** + * Returns a comparator that compares {@link Comparable} objects in natural + * order. + * + *

      The returned comparator is serializable and throws {@link + * NullPointerException} when comparing {@code null}. + * + * @param the {@link Comparable} type of element to be compared + * @return a comparator that imposes the natural ordering on {@code + * Comparable} objects. + * @see Comparable + * @since 1.8 + */ + public static > Comparator naturalOrder() { + return (Comparator) Comparators.NaturalOrderComparator.INSTANCE; + } + + /** + * Returns a null-friendly comparator that considers {@code null} to be + * less than non-null. When both are {@code null}, they are considered + * equal. If both are non-null, the specified {@code Comparator} is used + * to determine the order. If the specified comparator is {@code null}, + * then the returned comparator considers all non-null values to be equal. + * + *

      The returned comparator is serializable if the specified comparator + * is serializable. + * + * @param the type of the elements to be compared + * @param comparator a {@code Comparator} for comparing non-null values + * @return a comparator that considers {@code null} to be less than + * non-null, and compares non-null objects with the supplied + * {@code Comparator}. + * @since 1.8 + */ + public static Comparator nullsFirst(Comparator comparator) { + return new Comparators.NullComparator(true, comparator); + } + + /** + * Returns a null-friendly comparator that considers {@code null} to be + * greater than non-null. When both are {@code null}, they are considered + * equal. If both are non-null, the specified {@code Comparator} is used + * to determine the order. If the specified comparator is {@code null}, + * then the returned comparator considers all non-null values to be equal. + * + *

      The returned comparator is serializable if the specified comparator + * is serializable. + * + * @param the type of the elements to be compared + * @param comparator a {@code Comparator} for comparing non-null values + * @return a comparator that considers {@code null} to be greater than + * non-null, and compares non-null objects with the supplied + * {@code Comparator}. + * @since 1.8 + */ + public static Comparator nullsLast(Comparator comparator) { + return new Comparators.NullComparator(false, comparator); + } + + /** + * Accepts a function that extracts a sort key from a type {@code T}, and + * returns a {@code Comparator} that compares by that sort key using + * the specified {@link Comparator}. + * + *

      The returned comparator is serializable if the specified function + * and comparator are both serializable. + * + * @apiNote + * For example, to obtain a {@code Comparator} that compares {@code + * Person} objects by their last name ignoring case differences, + * + *

      {@code
      +     *     Comparator cmp = Comparator.comparing(
      +     *             Person::getLastName,
      +     *             String.CASE_INSENSITIVE_ORDER);
      +     * }
      + * + * @param the type of element to be compared + * @param the type of the sort key + * @param keyExtractor the function used to extract the sort key + * @param keyComparator the {@code Comparator} used to compare the sort key + * @return a comparator that compares by an extracted key using the + * specified {@code Comparator} + * @throws NullPointerException if either argument is null + * @since 1.8 + */ + public static Comparator comparing( + Function keyExtractor, + Comparator keyComparator) + { + Objects.requireNonNull(keyExtractor); + Objects.requireNonNull(keyComparator); + return (Comparator & Serializable) + (c1, c2) -> keyComparator.compare(keyExtractor.apply(c1), + keyExtractor.apply(c2)); + } + + /** + * Accepts a function that extracts a {@link java.lang.Comparable + * Comparable} sort key from a type {@code T}, and returns a {@code + * Comparator} that compares by that sort key. + * + *

      The returned comparator is serializable if the specified function + * is also serializable. + * + * @apiNote + * For example, to obtain a {@code Comparator} that compares {@code + * Person} objects by their last name, + * + *

      {@code
      +     *     Comparator byLastName = Comparator.comparing(Person::getLastName);
      +     * }
      + * + * @param the type of element to be compared + * @param the type of the {@code Comparable} sort key + * @param keyExtractor the function used to extract the {@link + * Comparable} sort key + * @return a comparator that compares by an extracted key + * @throws NullPointerException if the argument is null + * @since 1.8 + */ + public static > Comparator comparing( + Function keyExtractor) + { + Objects.requireNonNull(keyExtractor); + return (Comparator & Serializable) + (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2)); + } + + /** + * Accepts a function that extracts an {@code int} sort key from a type + * {@code T}, and returns a {@code Comparator} that compares by that + * sort key. + * + *

      The returned comparator is serializable if the specified function + * is also serializable. + * + * @param the type of element to be compared + * @param keyExtractor the function used to extract the integer sort key + * @return a comparator that compares by an extracted key + * @see #comparing(Function) + * @throws NullPointerException if the argument is null + * @since 1.8 + */ + public static Comparator comparing(ToIntFunction keyExtractor) { + Objects.requireNonNull(keyExtractor); + return (Comparator & Serializable) + (c1, c2) -> Integer.compare(keyExtractor.applyAsInt(c1), keyExtractor.applyAsInt(c2)); + } + + /** + * Accepts a function that extracts a {@code long} sort key from a type + * {@code T}, and returns a {@code Comparator} that compares by that + * sort key. + * + *

      The returned comparator is serializable if the specified function is + * also serializable. + * + * @param the type of element to be compared + * @param keyExtractor the function used to extract the long sort key + * @return a comparator that compares by an extracted key + * @see #comparing(Function) + * @throws NullPointerException if the argument is null + * @since 1.8 + */ + public static Comparator comparing(ToLongFunction keyExtractor) { + Objects.requireNonNull(keyExtractor); + return (Comparator & Serializable) + (c1, c2) -> Long.compare(keyExtractor.applyAsLong(c1), keyExtractor.applyAsLong(c2)); + } + + /** + * Accepts a function that extracts a {@code double} sort key from a type + * {@code T}, and returns a {@code Comparator} that compares by that + * sort key. + * + *

      The returned comparator is serializable if the specified function + * is also serializable. + * + * @param the type of element to be compared + * @param keyExtractor the function used to extract the double sort key + * @return a comparator that compares by an extracted key + * @see #comparing(Function) + * @throws NullPointerException if the argument is null + * @since 1.8 + */ + public static Comparator comparing(ToDoubleFunction keyExtractor) { + Objects.requireNonNull(keyExtractor); + return (Comparator & Serializable) + (c1, c2) -> Double.compare(keyExtractor.applyAsDouble(c1), keyExtractor.applyAsDouble(c2)); } } diff --git a/jdk/src/share/classes/java/util/Comparators.java b/jdk/src/share/classes/java/util/Comparators.java index 97b7412f5c9..a9038321085 100644 --- a/jdk/src/share/classes/java/util/Comparators.java +++ b/jdk/src/share/classes/java/util/Comparators.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,16 +32,9 @@ import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; /** - * This class consists of {@code static} utility methods for comparators. Mostly - * factory method that returns a {@link Comparator}. - * - *

      Unless otherwise noted, passing a {@code null} argument to a method in - * this class will cause a {@link NullPointerException} to be thrown. - * - * @see Comparator - * @since 1.8 + * Package private supporting class for {@link Comparator}. */ -public class Comparators { +class Comparators { private Comparators() { throw new AssertionError("no instances"); } @@ -51,231 +44,55 @@ public class Comparators { * * @see Comparable */ - private enum NaturalOrderComparator implements Comparator> { + enum NaturalOrderComparator implements Comparator> { INSTANCE; @Override public int compare(Comparable c1, Comparable c2) { return c1.compareTo(c2); } + + @Override + public Comparator> reversed() { + return Comparator.reverseOrder(); + } } /** - * Returns a comparator that imposes the reverse of the natural - * ordering. - * - *

      The returned comparator is serializable. - * - * @param {@link Comparable} type - * - * @return A comparator that imposes the reverse of the natural - * ordering on a collection of objects that implement - * the {@link Comparable} interface. - * @see Comparable + * Null-friendly comparators */ - public static > Comparator reverseOrder() { - return Collections.reverseOrder(); - } + final static class NullComparator implements Comparator, Serializable { + private static final long serialVersionUID = -7569533591570686392L; + private final boolean nullFirst; + // if null, non-null Ts are considered equal + private final Comparator real; - /** - * Returns a comparator that imposes the reverse ordering of the specified - * {@link Comparator}. - * - *

      The returned comparator is serializable (assuming the specified - * comparator is also serializable). - * - * @param the element type to be compared - * @param cmp a comparator whose ordering is to be reversed by the returned - * comparator - * @return A comparator that imposes the reverse ordering of the - * specified comparator. - */ - public static Comparator reverseOrder(Comparator cmp) { - Objects.requireNonNull(cmp); - return Collections.reverseOrder(cmp); - } + @SuppressWarnings("unchecked") + NullComparator(boolean nullFirst, Comparator real) { + this.nullFirst = nullFirst; + this.real = (Comparator) real; + } - /** - * Gets a comparator compares {@link Comparable} type in natural order. - * - * @param {@link Comparable} type - */ - public static > Comparator naturalOrder() { - return (Comparator) NaturalOrderComparator.INSTANCE; - } + @Override + public int compare(T a, T b) { + if (a == null) { + return (b == null) ? 0 : (nullFirst ? -1 : 1); + } else if (b == null) { + return nullFirst ? 1: -1; + } else { + return (real == null) ? 0 : real.compare(a, b); + } + } - /** - * Gets a comparator compares {@link Map.Entry} in natural order on key. - * - * @param {@link Comparable} key type - * @param value type - */ - public static , V> Comparator> naturalOrderKeys() { - return (Comparator> & Serializable) - (c1, c2) -> c1.getKey().compareTo(c2.getKey()); - } + @Override + public Comparator thenComparing(Comparator other) { + Objects.requireNonNull(other); + return new NullComparator(nullFirst, real == null ? other : real.thenComparing(other)); + } - /** - * Gets a comparator compares {@link Map.Entry} in natural order on value. - * - * @param key type - * @param {@link Comparable} value type - */ - public static > Comparator> naturalOrderValues() { - return (Comparator> & Serializable) - (c1, c2) -> c1.getValue().compareTo(c2.getValue()); - } - - /** - * Gets a comparator compares {@link Map.Entry} by key using the given - * {@link Comparator}. - * - *

      The returned comparator is serializable assuming the specified - * comparators are also serializable. - * - * @param key type - * @param value type - * @param cmp the key {@link Comparator} - */ - public static Comparator> byKey(Comparator cmp) { - Objects.requireNonNull(cmp); - return (Comparator> & Serializable) - (c1, c2) -> cmp.compare(c1.getKey(), c2.getKey()); - } - - /** - * Gets a comparator compares {@link Map.Entry} by value using the given - * {@link Comparator}. - * - * @param key type - * @param value type - * @param cmp the value {@link Comparator} - */ - public static Comparator> byValue(Comparator cmp) { - Objects.requireNonNull(cmp); - return (Comparator> & Serializable) - (c1, c2) -> cmp.compare(c1.getValue(), c2.getValue()); - } - - /** - * Accepts a function that extracts a {@link java.lang.Comparable - * Comparable} sort key from a type {@code T}, and returns a {@code - * Comparator} that compares by that sort key. For example, if a class - * {@code Person} has a {@code String}-valued getter {@code getLastName}, - * then {@code comparing(Person::getLastName)} would return a {@code - * Comparator} that compares {@code Person} objects by their last - * name. - * - * @param the original element type - * @param the {@link Comparable} type for comparison - * @param keyExtractor the function used to extract the {@link Comparable} sort key - */ - public static > Comparator comparing(Function keyExtractor) { - Objects.requireNonNull(keyExtractor); - return (Comparator & Serializable) - (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2)); - } - - /** - * Accepts a function that extracts an {@code int} value from a type {@code - * T}, and returns a {@code Comparator} that compares by that value. - * - *

      The returned comparator is serializable assuming the specified - * function is also serializable. - * - * @see #comparing(Function) - * @param the original element type - * @param keyExtractor the function used to extract the integer value - */ - public static Comparator comparing(ToIntFunction keyExtractor) { - Objects.requireNonNull(keyExtractor); - return (Comparator & Serializable) - (c1, c2) -> Integer.compare(keyExtractor.applyAsInt(c1), keyExtractor.applyAsInt(c2)); - } - - /** - * Accepts a function that extracts a {@code long} value from a type {@code - * T}, and returns a {@code Comparator} that compares by that value. - * - *

      The returned comparator is serializable assuming the specified - * function is also serializable. - * - * @see #comparing(Function) - * @param the original element type - * @param keyExtractor the function used to extract the long value - */ - public static Comparator comparing(ToLongFunction keyExtractor) { - Objects.requireNonNull(keyExtractor); - return (Comparator & Serializable) - (c1, c2) -> Long.compare(keyExtractor.applyAsLong(c1), keyExtractor.applyAsLong(c2)); - } - - /** - * Accepts a function that extracts a {@code double} value from a type - * {@code T}, and returns a {@code Comparator} that compares by that - * value. - * - *

      The returned comparator is serializable assuming the specified - * function is also serializable. - * - * @see #comparing(Function) - * @param the original element type - * @param keyExtractor the function used to extract the double value - */ - public static Comparator comparing(ToDoubleFunction keyExtractor) { - Objects.requireNonNull(keyExtractor); - return (Comparator & Serializable) - (c1, c2) -> Double.compare(keyExtractor.applyAsDouble(c1), keyExtractor.applyAsDouble(c2)); - } - - /** - * Constructs a lexicographic order from two {@link Comparator}s. For - * example, if you have comparators {@code byLastName} and {@code - * byFirstName}, each of type {@code Comparator}, then {@code - * compose(byLastName, byFirstName)} creates a {@code Comparator} - * which sorts by last name, and for equal last names sorts by first name. - * - *

      The returned comparator is serializable assuming the specified - * comparators are also serializable. - * - * @param the element type to be compared - * @param first the first comparator - * @param second the secondary comparator used when equals on the first - */ - public static Comparator compose(Comparator first, Comparator second) { - Objects.requireNonNull(first); - Objects.requireNonNull(second); - return (Comparator & Serializable) (c1, c2) -> { - int res = first.compare(c1, c2); - return (res != 0) ? res : second.compare(c1, c2); - }; - } - - /** - * Constructs a {@link BinaryOperator} which returns the lesser of two elements - * according to the specified {@code Comparator} - * - * @param comparator A {@code Comparator} for comparing the two values - * @param the type of the elements to be compared - * @return a {@code BinaryOperator} which returns the lesser of its operands, - * according to the supplied {@code Comparator} - */ - public static BinaryOperator lesserOf(Comparator comparator) { - Objects.requireNonNull(comparator); - return (a, b) -> comparator.compare(a, b) <= 0 ? a : b; - } - - /** - * Constructs a {@link BinaryOperator} which returns the greater of two elements - * according to the specified {@code Comparator} - * - * @param comparator A {@code Comparator} for comparing the two values - * @param the type of the elements to be compared - * @return a {@code BinaryOperator} which returns the greater of its operands, - * according to the supplied {@code Comparator} - */ - public static BinaryOperator greaterOf(Comparator comparator) { - Objects.requireNonNull(comparator); - return (a, b) -> comparator.compare(a, b) >= 0 ? a : b; + @Override + public Comparator reversed() { + return new NullComparator(!nullFirst, real == null ? null : real.reversed()); + } } } diff --git a/jdk/src/share/classes/java/util/Currency.java b/jdk/src/share/classes/java/util/Currency.java index 94b72dc4285..2c4a2e720be 100644 --- a/jdk/src/share/classes/java/util/Currency.java +++ b/jdk/src/share/classes/java/util/Currency.java @@ -764,7 +764,7 @@ public final class Currency implements Serializable { private static void info(String message, Throwable t) { PlatformLogger logger = PlatformLogger.getLogger("java.util.Currency"); - if (logger.isLoggable(PlatformLogger.INFO)) { + if (logger.isLoggable(PlatformLogger.Level.INFO)) { if (t != null) { logger.info(message, t); } else { diff --git a/jdk/src/share/classes/java/util/Date.java b/jdk/src/share/classes/java/util/Date.java index 61dac350389..502daaefdbb 100644 --- a/jdk/src/share/classes/java/util/Date.java +++ b/jdk/src/share/classes/java/util/Date.java @@ -984,8 +984,9 @@ public class Date * exclusive OR of the two halves of the primitive long * value returned by the {@link Date#getTime} * method. That is, the hash code is the value of the expression: - *

      -     * (int)(this.getTime()^(this.getTime() >>> 32))
      + *
      {@code
      +     * (int)(this.getTime()^(this.getTime() >>> 32))
      +     * }
      * * @return a hash code value for this object. */ @@ -1085,7 +1086,7 @@ public class Date /** * Creates a string representation of this Date object of * the form: - * + *
            * d mon yyyy hh:mm:ss GMT
      * where:
        *
      • d is the day of the month (1 through 31), diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index 52e9a4a511f..7906c763fe2 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2807,10 +2807,10 @@ public final class Formatter implements Closeable, Flushable { cal = Calendar.getInstance(l == null ? Locale.US : l); cal.setTime((Date)arg); } else if (arg instanceof Calendar) { - cal = (Calendar) ((Calendar)arg).clone(); + cal = (Calendar) ((Calendar) arg).clone(); cal.setLenient(true); } else if (arg instanceof TemporalAccessor) { - print((TemporalAccessor)arg, c, l); + print((TemporalAccessor) arg, c, l); return; } else { failConversion(c, arg); @@ -3242,13 +3242,10 @@ public final class Formatter implements Closeable, Flushable { int prec = (precision == -1 ? 6 : precision); FormattedFloatingDecimal fd - = new FormattedFloatingDecimal(value, prec, - FormattedFloatingDecimal.Form.SCIENTIFIC); + = FormattedFloatingDecimal.valueOf(value, prec, + FormattedFloatingDecimal.Form.SCIENTIFIC); - char[] v = new char[MAX_FD_CHARS]; - int len = fd.getChars(v); - - char[] mant = addZeros(mantissa(v, len), prec); + char[] mant = addZeros(fd.getMantissa(), prec); // If the precision is zero and the '#' flag is set, add the // requested decimal point. @@ -3256,7 +3253,7 @@ public final class Formatter implements Closeable, Flushable { mant = addDot(mant); char[] exp = (value == 0.0) - ? new char[] {'+','0','0'} : exponent(v, len); + ? new char[] {'+','0','0'} : fd.getExponent(); int newW = width; if (width != -1) @@ -3279,15 +3276,10 @@ public final class Formatter implements Closeable, Flushable { int prec = (precision == -1 ? 6 : precision); FormattedFloatingDecimal fd - = new FormattedFloatingDecimal(value, prec, - FormattedFloatingDecimal.Form.DECIMAL_FLOAT); + = FormattedFloatingDecimal.valueOf(value, prec, + FormattedFloatingDecimal.Form.DECIMAL_FLOAT); - // MAX_FD_CHARS + 1 (round?) - char[] v = new char[MAX_FD_CHARS + 1 - + Math.abs(fd.getExponent())]; - int len = fd.getChars(v); - - char[] mant = addZeros(mantissa(v, len), prec); + char[] mant = addZeros(fd.getMantissa(), prec); // If the precision is zero and the '#' flag is set, add the // requested decimal point. @@ -3305,23 +3297,29 @@ public final class Formatter implements Closeable, Flushable { else if (precision == 0) prec = 1; - FormattedFloatingDecimal fd - = new FormattedFloatingDecimal(value, prec, - FormattedFloatingDecimal.Form.GENERAL); + char[] exp; + char[] mant; + int expRounded; + if (value == 0.0) { + exp = null; + mant = new char[] {'0'}; + expRounded = 0; + } else { + FormattedFloatingDecimal fd + = FormattedFloatingDecimal.valueOf(value, prec, + FormattedFloatingDecimal.Form.GENERAL); + exp = fd.getExponent(); + mant = fd.getMantissa(); + expRounded = fd.getExponentRounded(); + } - // MAX_FD_CHARS + 1 (round?) - char[] v = new char[MAX_FD_CHARS + 1 - + Math.abs(fd.getExponent())]; - int len = fd.getChars(v); - - char[] exp = exponent(v, len); if (exp != null) { prec -= 1; } else { - prec = prec - (value == 0 ? 0 : fd.getExponentRounded()) - 1; + prec -= expRounded + 1; } - char[] mant = addZeros(mantissa(v, len), prec); + mant = addZeros(mant, prec); // If the precision is zero and the '#' flag is set, add the // requested decimal point. if (f.contains(Flags.ALTERNATE) && (prec == 0)) @@ -3380,30 +3378,6 @@ public final class Formatter implements Closeable, Flushable { } } - private char[] mantissa(char[] v, int len) { - int i; - for (i = 0; i < len; i++) { - if (v[i] == 'e') - break; - } - char[] tmp = new char[i]; - System.arraycopy(v, 0, tmp, 0, i); - return tmp; - } - - private char[] exponent(char[] v, int len) { - int i; - for (i = len - 1; i >= 0; i--) { - if (v[i] == 'e') - break; - } - if (i == -1) - return null; - char[] tmp = new char[len - i - 1]; - System.arraycopy(v, i + 1, tmp, 0, len - i - 1); - return tmp; - } - // Add zeros to the requested precision. private char[] addZeros(char[] v, int prec) { // Look for the dot. If we don't find one, the we'll need to add diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java index c9b106ff759..eab47e3776d 100644 --- a/jdk/src/share/classes/java/util/HashMap.java +++ b/jdk/src/share/classes/java/util/HashMap.java @@ -28,6 +28,8 @@ package java.util; import java.io.*; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.BiFunction; import java.util.function.Function; @@ -912,7 +914,8 @@ public class HashMap */ final int initHashSeed() { if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { - return sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + return (seed != 0) ? seed : 1; } return 0; } @@ -1297,10 +1300,112 @@ public class HashMap */ public V remove(Object key) { Entry e = removeEntryForKey(key); - return (e == null ? null : e.value); + return (e == null ? null : e.value); + } + + // optimized implementations of default methods in Map + + @Override + public void forEach(BiConsumer action) { + Objects.requireNonNull(action); + final int expectedModCount = modCount; + if (nullKeyEntry != null) { + forEachNullKey(expectedModCount, action); + } + Object[] tab = this.table; + for (int index = 0; index < tab.length; index++) { + Object item = tab[index]; + if (item == null) { + continue; + } + if (item instanceof HashMap.TreeBin) { + eachTreeNode(expectedModCount, ((TreeBin)item).first, action); + continue; + } + @SuppressWarnings("unchecked") + Entry entry = (Entry)item; + while (entry != null) { + action.accept(entry.key, entry.value); + entry = (Entry)entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } } - // optimized implementations of default methods in Map + private void eachTreeNode(int expectedModCount, TreeNode node, BiConsumer action) { + while (node != null) { + @SuppressWarnings("unchecked") + Entry entry = (Entry)node.entry; + action.accept(entry.key, entry.value); + node = (TreeNode)entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + + private void forEachNullKey(int expectedModCount, BiConsumer action) { + action.accept(null, nullKeyEntry.value); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + + @Override + public void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + final int expectedModCount = modCount; + if (nullKeyEntry != null) { + replaceforNullKey(expectedModCount, function); + } + Object[] tab = this.table; + for (int index = 0; index < tab.length; index++) { + Object item = tab[index]; + if (item == null) { + continue; + } + if (item instanceof HashMap.TreeBin) { + replaceEachTreeNode(expectedModCount, ((TreeBin)item).first, function); + continue; + } + @SuppressWarnings("unchecked") + Entry entry = (Entry)item; + while (entry != null) { + entry.value = function.apply(entry.key, entry.value); + entry = (Entry)entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + } + + private void replaceEachTreeNode(int expectedModCount, TreeNode node, BiFunction function) { + while (node != null) { + @SuppressWarnings("unchecked") + Entry entry = (Entry)node.entry; + entry.value = function.apply(entry.key, entry.value); + node = (TreeNode)entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + + private void replaceforNullKey(int expectedModCount, BiFunction function) { + nullKeyEntry.value = function.apply(null, nullKeyEntry.value); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } @Override public V putIfAbsent(K key, V value) { @@ -1644,25 +1749,25 @@ public class HashMap V oldValue = pEntry.value; if (oldValue != null) { V newValue = remappingFunction.apply(key, oldValue); - if (newValue == null) { // remove mapping - modCount++; - size--; - tb.deleteTreeNode(p); - pEntry.recordRemoval(this); - if (tb.root == null || tb.first == null) { - // assert tb.root == null && tb.first == null : - // "TreeBin.first and root should both be null"; - // TreeBin is now empty, we should blank this bin - table[i] = null; - } - } else { - pEntry.value = newValue; - pEntry.recordAccess(this); + if (newValue == null) { // remove mapping + modCount++; + size--; + tb.deleteTreeNode(p); + pEntry.recordRemoval(this); + if (tb.root == null || tb.first == null) { + // assert tb.root == null && tb.first == null : + // "TreeBin.first and root should both be null"; + // TreeBin is now empty, we should blank this bin + table[i] = null; } - return newValue; + } else { + pEntry.value = newValue; + pEntry.recordAccess(this); } + return newValue; } } + } return null; } @@ -1674,7 +1779,7 @@ public class HashMap if (key == null) { V oldValue = nullKeyEntry == null ? null : nullKeyEntry.value; V newValue = remappingFunction.apply(key, oldValue); - if (newValue != oldValue) { + if (newValue != oldValue || (oldValue == null && nullKeyEntry != null)) { if (newValue == null) { removeNullKey(); } else { @@ -1698,7 +1803,7 @@ public class HashMap if (e.hash == hash && Objects.equals(e.key, key)) { V oldValue = e.value; V newValue = remappingFunction.apply(key, oldValue); - if (newValue != oldValue) { + if (newValue != oldValue || oldValue == null) { if (newValue == null) { modCount++; size--; @@ -1724,7 +1829,7 @@ public class HashMap TreeNode p = tb.getTreeNode(hash, key); V oldValue = p == null ? null : (V)p.entry.value; V newValue = remappingFunction.apply(key, oldValue); - if (newValue != oldValue) { + if (newValue != oldValue || (oldValue == null && p != null)) { if (newValue == null) { Entry pEntry = (Entry)p.entry; modCount++; @@ -2295,12 +2400,12 @@ public class HashMap if (e == null) throw new NoSuchElementException(); - if (e instanceof Entry) { - retVal = (Entry)e; - next = ((Entry)e).next; - } else { // TreeBin + if (e instanceof TreeNode) { // TreeBin retVal = (Entry)((TreeNode)e).entry; next = retVal.next; + } else { + retVal = (Entry)e; + next = ((Entry)e).next; } if (next == null) { // Move to next bin @@ -2572,8 +2677,9 @@ public class HashMap // set other fields that need values if (Holder.USE_HASHSEED) { + int seed = ThreadLocalRandom.current().nextInt(); Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET, - sun.misc.Hashing.randomHashSeed(this)); + (seed != 0) ? seed : 1); } table = EMPTY_TABLE; diff --git a/jdk/src/share/classes/java/util/Hashtable.java b/jdk/src/share/classes/java/util/Hashtable.java index a078aa3e207..a481719be0c 100644 --- a/jdk/src/share/classes/java/util/Hashtable.java +++ b/jdk/src/share/classes/java/util/Hashtable.java @@ -26,6 +26,7 @@ package java.util; import java.io.*; +import java.util.concurrent.ThreadLocalRandom; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.function.BiFunction; @@ -219,7 +220,8 @@ public class Hashtable */ final int initHashSeed() { if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { - return sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + return (seed != 0) ? seed : 1; } return 0; } @@ -930,19 +932,39 @@ public class Hashtable public synchronized void forEach(BiConsumer action) { Objects.requireNonNull(action); // explicit check required in case // table is empty. - Entry[] tab = table; - for (Entry entry : tab) { + final int expectedModCount = modCount; + + Entry[] tab = table; + for (Entry entry : tab) { while (entry != null) { action.accept((K)entry.key, (V)entry.value); entry = entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } } } } @Override - public synchronized void replaceAll( - BiFunction function) { - Map.super.replaceAll(function); + public synchronized void replaceAll(BiFunction function) { + Objects.requireNonNull(function); // explicit check required in case + // table is empty. + final int expectedModCount = modCount; + + Entry[] tab = (Entry[])table; + for (Entry entry : tab) { + while (entry != null) { + entry.value = Objects.requireNonNull( + function.apply(entry.key, entry.value)); + entry = entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } } @Override @@ -1056,7 +1078,7 @@ public class Hashtable } @Override - public V computeIfPresent(K key, BiFunction remappingFunction) { + public synchronized V computeIfPresent(K key, BiFunction remappingFunction) { Objects.requireNonNull(remappingFunction); Entry tab[] = table; @@ -1085,7 +1107,7 @@ public class Hashtable } @Override - public V compute(K key, BiFunction remappingFunction) { + public synchronized V compute(K key, BiFunction remappingFunction) { Objects.requireNonNull(remappingFunction); Entry tab[] = table; @@ -1120,7 +1142,7 @@ public class Hashtable } @Override - public V merge(K key, V value, BiFunction remappingFunction) { + public synchronized V merge(K key, V value, BiFunction remappingFunction) { Objects.requireNonNull(remappingFunction); Entry tab[] = table; @@ -1206,8 +1228,9 @@ public class Hashtable // set hashMask if (Holder.USE_HASHSEED) { + int seed = ThreadLocalRandom.current().nextInt(); Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET, - sun.misc.Hashing.randomHashSeed(this)); + (seed != 0) ? seed : 1); } // Read the original length of the array and number of elements diff --git a/jdk/src/share/classes/java/util/IdentityHashMap.java b/jdk/src/share/classes/java/util/IdentityHashMap.java index eb54db623e4..3064588c901 100644 --- a/jdk/src/share/classes/java/util/IdentityHashMap.java +++ b/jdk/src/share/classes/java/util/IdentityHashMap.java @@ -27,6 +27,8 @@ package java.util; import java.io.*; import java.lang.reflect.Array; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; import java.util.function.Consumer; /** @@ -1337,6 +1339,42 @@ public class IdentityHashMap tab[i + 1] = value; } + @Override + public void forEach(BiConsumer action) { + Objects.requireNonNull(action); + int expectedModCount = modCount; + + Object[] t = table; + for (int index = 0; index < t.length; index += 2) { + Object k = t[index]; + if (k != null) { + action.accept((K) unmaskNull(k), (V) t[index + 1]); + } + + if (modCount != expectedModCount) { + throw new ConcurrentModificationException(); + } + } + } + + @Override + public void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + int expectedModCount = modCount; + + Object[] t = table; + for (int index = 0; index < t.length; index += 2) { + Object k = t[index]; + if (k != null) { + t[index + 1] = function.apply((K) unmaskNull(k), (V) t[index + 1]); + } + + if (modCount != expectedModCount) { + throw new ConcurrentModificationException(); + } + } + } + /** * Similar form as array-based Spliterators, but skips blank elements, * and guestimates size as decreasing by half per split. diff --git a/jdk/src/share/classes/java/util/LinkedHashMap.java b/jdk/src/share/classes/java/util/LinkedHashMap.java index 100710b1bdd..ee9c221ef10 100644 --- a/jdk/src/share/classes/java/util/LinkedHashMap.java +++ b/jdk/src/share/classes/java/util/LinkedHashMap.java @@ -25,6 +25,8 @@ package java.util; import java.io.*; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; /** *

        Hash table and linked list implementation of the Map interface, @@ -296,6 +298,32 @@ public class LinkedHashMap header.before = header.after = header; } + @Override + public void forEach(BiConsumer action) { + Objects.requireNonNull(action); + int expectedModCount = modCount; + for (Entry entry = header.after; entry != header; entry = entry.after) { + action.accept(entry.key, entry.value); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + + @Override + public void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + int expectedModCount = modCount; + for (Entry entry = header.after; entry != header; entry = entry.after) { + entry.value = function.apply(entry.key, entry.value); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + /** * LinkedHashMap entry. */ @@ -437,13 +465,13 @@ public class LinkedHashMap *

        Sample use: this override will allow the map to grow up to 100 * entries and then delete the eldest entry each time a new entry is * added, maintaining a steady state of 100 entries. - *

        +     * 
        {@code
              *     private static final int MAX_ENTRIES = 100;
              *
              *     protected boolean removeEldestEntry(Map.Entry eldest) {
              *        return size() > MAX_ENTRIES;
              *     }
        -     * 
        + * }
        * *

        This method typically does not modify the map in any way, * instead allowing the map to modify itself as directed by its diff --git a/jdk/src/share/classes/java/util/Map.java b/jdk/src/share/classes/java/util/Map.java index acb595d8f07..8ad16ee8323 100644 --- a/jdk/src/share/classes/java/util/Map.java +++ b/jdk/src/share/classes/java/util/Map.java @@ -28,6 +28,7 @@ package java.util; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; +import java.io.Serializable; /** * An object that maps keys to values. A map cannot contain duplicate keys; @@ -446,6 +447,74 @@ public interface Map { * @see #equals(Object) */ int hashCode(); + + /** + * Returns a comparator that compares {@link Map.Entry} in natural order on key. + * + *

        The returned comparator is serializable and throws {@link + * NullPointerException} when comparing an entry with a null key. + * + * @param the {@link Comparable} type of then map keys + * @param the type of the map values + * @return a comparator that compares {@link Map.Entry} in natural order on key. + * @see Comparable + */ + public static , V> Comparator> comparingByKey() { + return (Comparator> & Serializable) + (c1, c2) -> c1.getKey().compareTo(c2.getKey()); + } + + /** + * Returns a comparator that compares {@link Map.Entry} in natural order on value. + * + *

        The returned comparator is serializable and throws {@link + * NullPointerException} when comparing an entry with null values. + * + * @param the type of the map keys + * @param the {@link Comparable} type of the map values + * @return a comparator that compares {@link Map.Entry} in natural order on value. + * @see Comparable + */ + public static > Comparator> comparingByValue() { + return (Comparator> & Serializable) + (c1, c2) -> c1.getValue().compareTo(c2.getValue()); + } + + /** + * Returns a comparator that compares {@link Map.Entry} by key using the given + * {@link Comparator}. + * + *

        The returned comparator is serializable if the specified comparator + * is also serializable. + * + * @param the type of the map keys + * @param the type of the map values + * @param cmp the key {@link Comparator} + * @return a comparator that compares {@link Map.Entry} by the key. + */ + public static Comparator> comparingByKey(Comparator cmp) { + Objects.requireNonNull(cmp); + return (Comparator> & Serializable) + (c1, c2) -> cmp.compare(c1.getKey(), c2.getKey()); + } + + /** + * Returns a comparator that compares {@link Map.Entry} by value using the given + * {@link Comparator}. + * + *

        The returned comparator is serializable if the specified comparator + * is also serializable. + * + * @param the type of the map keys + * @param the type of the map values + * @param cmp the value {@link Comparator} + * @return a comparator that compares {@link Map.Entry} by the value. + */ + public static Comparator> comparingByValue(Comparator cmp) { + Objects.requireNonNull(cmp); + return (Comparator> & Serializable) + (c1, c2) -> cmp.compare(c1.getValue(), c2.getValue()); + } } // Comparison and hashing @@ -545,6 +614,7 @@ public interface Map { k = entry.getKey(); v = entry.getValue(); } catch(IllegalStateException ise) { + // this usually means the entry is no longer in the map. throw new ConcurrentModificationException(ise); } action.accept(k, v); @@ -599,9 +669,19 @@ public interface Map { k = entry.getKey(); v = entry.getValue(); } catch(IllegalStateException ise) { + // this usually means the entry is no longer in the map. + throw new ConcurrentModificationException(ise); + } + + // ise thrown from function is not a cme. + v = function.apply(k, v); + + try { + entry.setValue(v); + } catch(IllegalStateException ise) { + // this usually means the entry is no longer in the map. throw new ConcurrentModificationException(ise); } - entry.setValue(function.apply(k, v)); } } @@ -629,7 +709,7 @@ public interface Map { * @param key key with which the specified value is to be associated * @param value value to be associated with the specified key * @return the previous value associated with the specified key, or - * {@code 1} if there was no mapping for the key. + * {@code null} if there was no mapping for the key. * (A {@code null} return can also indicate that the map * previously associated {@code null} with the key, * if the implementation supports null values.) @@ -983,20 +1063,40 @@ public interface Map { V oldValue = get(key); for (;;) { V newValue = remappingFunction.apply(key, oldValue); - if (oldValue != null) { - if (newValue != null) { - if (replace(key, oldValue, newValue)) - return newValue; - } else if (remove(key, oldValue)) { + if (newValue == null) { + // delete mapping + if(oldValue != null || containsKey(key)) { + // something to remove + if (remove(key, oldValue)) { + // removed the old value as expected + return null; + } + + // some other value replaced old value. try again. + oldValue = get(key); + } else { + // nothing to do. Leave things as they were. return null; } - oldValue = get(key); } else { - if (newValue != null) { - if ((oldValue = putIfAbsent(key, newValue)) == null) + // add or replace old mapping + if (oldValue != null) { + // replace + if (replace(key, oldValue, newValue)) { + // replaced as expected. return newValue; + } + + // some other value replaced old value. try again. + oldValue = get(key); } else { - return null; + // add (replace if oldValue was null) + if ((oldValue = putIfAbsent(key, newValue)) == null) { + // replaced + return newValue; + } + + // some other value replaced old value. try again. } } } diff --git a/jdk/src/share/classes/java/util/PrimitiveIterator.java b/jdk/src/share/classes/java/util/PrimitiveIterator.java index f05d9e06605..6689614b337 100644 --- a/jdk/src/share/classes/java/util/PrimitiveIterator.java +++ b/jdk/src/share/classes/java/util/PrimitiveIterator.java @@ -55,16 +55,34 @@ import java.util.function.LongConsumer; * is set to {@code true} then diagnostic warnings are reported if boxing of * primitive values occur when operating on primitive subtype specializations. * - * @param the boxed type of the primitive type + * @param the type of elements returned by this PrimitiveIterator. The + * type must be a wrapper type for a primitive type, such as + * {@code Integer} for the primitive {@code int} type. + * @param the type of primitive consumer. The type must be a + * primitive specialization of {@link java.util.function.Consumer} for + * {@code T}, such as {@link java.util.function.IntConsumer} for + * {@code Integer}. + * * @since 1.8 */ -public interface PrimitiveIterator extends Iterator { +public interface PrimitiveIterator extends Iterator { + + /** + * Performs the given action for each remaining element, in the order + * elements occur when iterating, until all elements have been processed + * or the action throws an exception. Errors or runtime exceptions + * thrown by the action are relayed to the caller. + * + * @param action The action to be performed for each element + * @throws NullPointerException if the specified action is null + */ + void forEachRemaining(T_CONS action); /** * An Iterator specialized for {@code int} values. * @since 1.8 */ - public static interface OfInt extends PrimitiveIterator { + public static interface OfInt extends PrimitiveIterator { /** * Returns the next {@code int} element in the iteration. @@ -138,7 +156,7 @@ public interface PrimitiveIterator extends Iterator { * An Iterator specialized for {@code long} values. * @since 1.8 */ - public static interface OfLong extends PrimitiveIterator { + public static interface OfLong extends PrimitiveIterator { /** * Returns the next {@code long} element in the iteration. @@ -211,7 +229,7 @@ public interface PrimitiveIterator extends Iterator { * An Iterator specialized for {@code double} values. * @since 1.8 */ - public static interface OfDouble extends PrimitiveIterator { + public static interface OfDouble extends PrimitiveIterator { /** * Returns the next {@code double} element in the iteration. diff --git a/jdk/src/share/classes/java/util/Properties.java b/jdk/src/share/classes/java/util/Properties.java index 3e899d00113..ed0bf857d66 100644 --- a/jdk/src/share/classes/java/util/Properties.java +++ b/jdk/src/share/classes/java/util/Properties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -443,6 +443,9 @@ class Properties extends Hashtable { if (len == 0 || isCommentLine) { return -1; } + if (precedingBackslash) { + len--; + } return len; } } @@ -510,6 +513,9 @@ class Properties extends Hashtable { :inStream.read(inByteBuf); inOff = 0; if (inLimit <= 0) { + if (precedingBackslash) { + len--; + } return len; } } diff --git a/jdk/src/share/classes/java/util/Random.java b/jdk/src/share/classes/java/util/Random.java index c169e053dfd..ca430bae26f 100644 --- a/jdk/src/share/classes/java/util/Random.java +++ b/jdk/src/share/classes/java/util/Random.java @@ -372,7 +372,7 @@ class Random implements java.io.Serializable { * range {@code 0.0f} (inclusive) to {@code 1.0f} (exclusive), is * pseudorandomly generated and returned. All 224 possible {@code float} values - * of the form m x 2m x 2-24, where m is a positive * integer less than 224 , are * produced with (approximately) equal probability. diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java index 0d52daa9c48..1d9d80b90a4 100644 --- a/jdk/src/share/classes/java/util/ResourceBundle.java +++ b/jdk/src/share/classes/java/util/ResourceBundle.java @@ -2323,9 +2323,9 @@ public abstract class ResourceBundle { * is returned. And if the resource bundles for the "ja" and * "" Locales are found, then the runtime resource * lookup path (parent chain) is: - *

        +         * 
        {@code
                  *     Messages_ja -> Messages
        -         * 
        + * }
        * * @param baseName * the base name of the resource bundle, a fully diff --git a/jdk/src/share/classes/java/util/Scanner.java b/jdk/src/share/classes/java/util/Scanner.java index cc19b0d1257..f6967f3a75c 100644 --- a/jdk/src/share/classes/java/util/Scanner.java +++ b/jdk/src/share/classes/java/util/Scanner.java @@ -49,47 +49,51 @@ import sun.misc.LRUCache; * *

        For example, this code allows a user to read a number from * System.in: - *

        + * 
        {@code
          *     Scanner sc = new Scanner(System.in);
          *     int i = sc.nextInt();
        - * 
        + * }
        * *

        As another example, this code allows long types to be * assigned from entries in a file myNumbers: - *

        + * 
        {@code
          *      Scanner sc = new Scanner(new File("myNumbers"));
          *      while (sc.hasNextLong()) {
          *          long aLong = sc.nextLong();
        - *      }
        + * } + * }
        * *

        The scanner can also use delimiters other than whitespace. This * example reads several items in from a string: - *

        + * 
        {@code
          *     String input = "1 fish 2 fish red fish blue fish";
          *     Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*");
          *     System.out.println(s.nextInt());
          *     System.out.println(s.nextInt());
          *     System.out.println(s.next());
          *     System.out.println(s.next());
        - *     s.close(); 
        + * s.close(); + * }
        *

        * prints the following output: - *

        + * 
        {@code
          *     1
          *     2
          *     red
        - *     blue 
        + * blue + * } * *

        The same output can be generated with this code, which uses a regular * expression to parse all four tokens at once: - *

        + * 
        {@code
          *     String input = "1 fish 2 fish red fish blue fish";
          *     Scanner s = new Scanner(input);
          *     s.findInLine("(\\d+) fish (\\d+) fish (\\w+) fish (\\w+)");
          *     MatchResult result = s.match();
          *     for (int i=1; i<=result.groupCount(); i++)
          *         System.out.println(result.group(i));
        - *     s.close(); 
        + * s.close(); + * }
        * *

        The default whitespace delimiter used * by a scanner is as recognized by {@link java.lang.Character}.{@link @@ -2640,11 +2644,11 @@ public final class Scanner implements Iterator, Closeable { * scanner.reset() behaves in exactly the same way as the * invocation * - *

        +     * 
        {@code
              *   scanner.useDelimiter("\\p{javaWhitespace}+")
              *          .useLocale(Locale.getDefault(Locale.Category.FORMAT))
              *          .useRadix(10);
        -     * 
        + * }
        * * @return this scanner * diff --git a/jdk/src/share/classes/java/util/Spliterators.java b/jdk/src/share/classes/java/util/Spliterators.java index 860f37a812b..f0d7a4e3175 100644 --- a/jdk/src/share/classes/java/util/Spliterators.java +++ b/jdk/src/share/classes/java/util/Spliterators.java @@ -663,7 +663,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static Iterator iteratorFromSpliterator(Spliterator spliterator) { + public static Iterator iterator(Spliterator spliterator) { Objects.requireNonNull(spliterator); class Adapter implements Iterator, Consumer { boolean valueReady = false; @@ -708,7 +708,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfInt iteratorFromSpliterator(Spliterator.OfInt spliterator) { + public static PrimitiveIterator.OfInt iterator(Spliterator.OfInt spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfInt, IntConsumer { boolean valueReady = false; @@ -753,7 +753,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfLong iteratorFromSpliterator(Spliterator.OfLong spliterator) { + public static PrimitiveIterator.OfLong iterator(Spliterator.OfLong spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfLong, LongConsumer { boolean valueReady = false; @@ -798,7 +798,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfDouble iteratorFromSpliterator(Spliterator.OfDouble spliterator) { + public static PrimitiveIterator.OfDouble iterator(Spliterator.OfDouble spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfDouble, DoubleConsumer { boolean valueReady = false; diff --git a/jdk/src/share/classes/java/util/TimeZone.java b/jdk/src/share/classes/java/util/TimeZone.java index b49d8d210ef..ba4abb91f2c 100644 --- a/jdk/src/share/classes/java/util/TimeZone.java +++ b/jdk/src/share/classes/java/util/TimeZone.java @@ -419,17 +419,6 @@ abstract public class TimeZone implements Serializable, Cloneable { return ZoneInfoFile.toCustomID(offset); } - private static class DisplayNames { - // Cache for managing display names per timezone per locale - // The structure is: - // Map(key=id, value=SoftReference(Map(key=locale, value=displaynames))) - private static final Map>> CACHE = - new ConcurrentHashMap<>(); - - private DisplayNames() { - } - } - private static String[] getDisplayNames(String id, Locale locale) { return TimeZoneNameUtility.retrieveDisplayNames(id, locale); } diff --git a/jdk/src/share/classes/java/util/TimerTask.java b/jdk/src/share/classes/java/util/TimerTask.java index b8c83408680..691c9a03dae 100644 --- a/jdk/src/share/classes/java/util/TimerTask.java +++ b/jdk/src/share/classes/java/util/TimerTask.java @@ -130,14 +130,14 @@ public abstract class TimerTask implements Runnable { *

        This method is typically invoked from within a task's run method, to * determine whether the current execution of the task is sufficiently * timely to warrant performing the scheduled activity: - *

        +     * 
        {@code
              *   public void run() {
              *       if (System.currentTimeMillis() - scheduledExecutionTime() >=
              *           MAX_TARDINESS)
              *               return;  // Too late; skip this execution.
              *       // Perform the task
              *   }
        -     * 
        + * }
        * This method is typically not used in conjunction with * fixed-delay execution repeating tasks, as their scheduled * execution times are allowed to drift over time, and so are not terribly diff --git a/jdk/src/share/classes/java/util/TreeMap.java b/jdk/src/share/classes/java/util/TreeMap.java index c96fa41652d..44d7449e07a 100644 --- a/jdk/src/share/classes/java/util/TreeMap.java +++ b/jdk/src/share/classes/java/util/TreeMap.java @@ -25,6 +25,8 @@ package java.util; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; import java.util.function.Consumer; /** @@ -945,6 +947,33 @@ public class TreeMap return tailMap(fromKey, true); } + @Override + public void forEach(BiConsumer action) { + Objects.requireNonNull(action); + int expectedModCount = modCount; + for (Entry e = getFirstEntry(); e != null; e = successor(e)) { + action.accept(e.key, e.value); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + + @Override + public void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + int expectedModCount = modCount; + + for (Entry e = getFirstEntry(); e != null; e = successor(e)) { + e.value = Objects.requireNonNull(function.apply(e.key, e.value)); + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + // View class support class Values extends AbstractCollection { @@ -2909,13 +2938,13 @@ public class TreeMap public int characteristics() { return (side == 0 ? Spliterator.SIZED : 0) | - Spliterator.DISTINCT | Spliterator.SORTED | Spliterator.ORDERED; + Spliterator.DISTINCT | Spliterator.SORTED | Spliterator.ORDERED; } @Override public Comparator> getComparator() { return tree.comparator != null ? - Comparators.byKey(tree.comparator) : null; + Map.Entry.comparingByKey(tree.comparator) : null; } } } diff --git a/jdk/src/share/classes/java/util/WeakHashMap.java b/jdk/src/share/classes/java/util/WeakHashMap.java index 183909afd1e..eb2e636e2ba 100644 --- a/jdk/src/share/classes/java/util/WeakHashMap.java +++ b/jdk/src/share/classes/java/util/WeakHashMap.java @@ -27,6 +27,9 @@ package java.util; import java.lang.ref.WeakReference; import java.lang.ref.ReferenceQueue; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; import java.util.function.Consumer; @@ -215,7 +218,8 @@ public class WeakHashMap if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { // Do not set hashSeed more than once! // assert hashSeed == 0; - hashSeed = sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + hashSeed = (seed != 0) ? seed : 1; } } @@ -1034,6 +1038,48 @@ public class WeakHashMap } } + @Override + public void forEach(BiConsumer action) { + Objects.requireNonNull(action); + int expectedModCount = modCount; + + Entry[] tab = getTable(); + for (Entry entry : tab) { + while (entry != null) { + Object key = entry.get(); + if (key != null) { + action.accept((K)WeakHashMap.unmaskNull(key), entry.value); + } + entry = entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + } + + @Override + public void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + int expectedModCount = modCount; + + Entry[] tab = getTable();; + for (Entry entry : tab) { + while (entry != null) { + Object key = entry.get(); + if (key != null) { + entry.value = function.apply((K)WeakHashMap.unmaskNull(key), entry.value); + } + entry = entry.next; + + if (expectedModCount != modCount) { + throw new ConcurrentModificationException(); + } + } + } + } + /** * Similar form as other hash Spliterators, but skips dead * elements. diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java index fee5689db89..f0c42bb321a 100644 --- a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java +++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java @@ -35,6 +35,8 @@ package java.util.concurrent; import java.util.Map; +import java.util.Objects; +import java.util.function.BiFunction; /** * A {@link java.util.Map} providing additional atomic @@ -183,4 +185,26 @@ public interface ConcurrentMap extends Map { * or value prevents it from being stored in this map */ V replace(K key, V value); + + /** + * {@inheritDoc} + * + * @implNote This implementation assumes that the ConcurrentMap cannot + * contain null values and get() returning null unambiguously means the key + * is absent. Implementations which support null values + * must override this default implementation. + */ + @Override + default void replaceAll(BiFunction function) { + Objects.requireNonNull(function); + forEach((k,v) -> { + while(!replace(k, v, function.apply(k, v))) { + // v changed or k is gone + if( (v = get(k)) == null) { + // k is no longer in the map. + break; + } + } + }); + } } diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java index 04bc975f9c8..bb2dd42e730 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java @@ -92,7 +92,7 @@ public class AtomicBoolean implements java.io.Serializable { * * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(boolean expect, boolean update) { @@ -105,13 +105,13 @@ public class AtomicBoolean implements java.io.Serializable { * Atomically sets the value to the given updated value * if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public boolean weakCompareAndSet(boolean expect, boolean update) { int e = expect ? 1 : 0; diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java index 8fed658a54c..c67e42f3bf1 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java @@ -126,7 +126,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int expect, int update) { @@ -137,13 +137,13 @@ public class AtomicInteger extends Number implements java.io.Serializable { * Atomically sets the value to the given updated value * if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(int expect, int update) { return unsafe.compareAndSwapInt(this, valueOffset, expect, update); @@ -155,7 +155,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndIncrement() { - return getAndAdd(1); + return unsafe.getAndAddInt(this, valueOffset, 1); } /** @@ -164,7 +164,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the previous value */ public final int getAndDecrement() { - return getAndAdd(-1); + return unsafe.getAndAddInt(this, valueOffset, -1); } /** @@ -183,7 +183,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int incrementAndGet() { - return getAndAdd(1) + 1; + return unsafe.getAndAddInt(this, valueOffset, 1) + 1; } /** @@ -192,7 +192,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int decrementAndGet() { - return getAndAdd(-1) - 1; + return unsafe.getAndAddInt(this, valueOffset, -1) - 1; } /** @@ -202,7 +202,7 @@ public class AtomicInteger extends Number implements java.io.Serializable { * @return the updated value */ public final int addAndGet(int delta) { - return getAndAdd(delta) + delta; + return unsafe.getAndAddInt(this, valueOffset, delta) + delta; } /** diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java index 7c259fee06f..3cbf3f4b446 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java @@ -157,7 +157,7 @@ public class AtomicIntegerArray implements java.io.Serializable { * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int i, int expect, int update) { @@ -172,14 +172,14 @@ public class AtomicIntegerArray implements java.io.Serializable { * Atomically sets the element at position {@code i} to the given * updated value if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(int i, int expect, int update) { return compareAndSet(i, expect, update); @@ -247,6 +247,7 @@ public class AtomicIntegerArray implements java.io.Serializable { return getAndAdd(i, delta) + delta; } + /** * Atomically updates the element at index {@code i} with the results * of applying the given function, returning the previous value. The diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java index e761b6ec73d..af72a4755d4 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java @@ -37,14 +37,13 @@ package java.util.concurrent.atomic; import java.util.function.IntUnaryOperator; import java.util.function.IntBinaryOperator; import sun.misc.Unsafe; -import sun.reflect.CallerSensitive; -import sun.reflect.Reflection; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; /** * A reflection-based utility that enables atomic updates to @@ -81,8 +80,10 @@ public abstract class AtomicIntegerFieldUpdater { * access control */ @CallerSensitive - public static AtomicIntegerFieldUpdater newUpdater(Class tclass, String fieldName) { - return new AtomicIntegerFieldUpdaterImpl(tclass, fieldName, Reflection.getCallerClass()); + public static AtomicIntegerFieldUpdater newUpdater(Class tclass, + String fieldName) { + return new AtomicIntegerFieldUpdaterImpl + (tclass, fieldName, Reflection.getCallerClass()); } /** @@ -101,7 +102,7 @@ public abstract class AtomicIntegerFieldUpdater { * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful * @throws ClassCastException if {@code obj} is not an instance * of the class possessing the field established in the constructor */ @@ -114,14 +115,14 @@ public abstract class AtomicIntegerFieldUpdater { * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful * @throws ClassCastException if {@code obj} is not an instance * of the class possessing the field established in the constructor */ @@ -363,7 +364,8 @@ public abstract class AtomicIntegerFieldUpdater { /** * Standard hotspot implementation using intrinsics */ - private static class AtomicIntegerFieldUpdaterImpl extends AtomicIntegerFieldUpdater { + private static class AtomicIntegerFieldUpdaterImpl + extends AtomicIntegerFieldUpdater { private static final Unsafe unsafe = Unsafe.getUnsafe(); private final long offset; private final Class tclass; @@ -371,8 +373,7 @@ public abstract class AtomicIntegerFieldUpdater { AtomicIntegerFieldUpdaterImpl(final Class tclass, final String fieldName, - final Class caller) - { + final Class caller) { final Field field; final int modifiers; try { diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLong.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLong.java index 35af7759ac7..85ea910a96c 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLong.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLong.java @@ -140,7 +140,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(long expect, long update) { @@ -151,13 +151,13 @@ public class AtomicLong extends Number implements java.io.Serializable { * Atomically sets the value to the given updated value * if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(long expect, long update) { return unsafe.compareAndSwapLong(this, valueOffset, expect, update); @@ -169,7 +169,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndIncrement() { - return getAndAdd(1); + return unsafe.getAndAddLong(this, valueOffset, 1L); } /** @@ -178,7 +178,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the previous value */ public final long getAndDecrement() { - return getAndAdd(-1); + return unsafe.getAndAddLong(this, valueOffset, -1L); } /** @@ -197,7 +197,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long incrementAndGet() { - return getAndAdd(1) + 1; + return unsafe.getAndAddLong(this, valueOffset, 1L) + 1L; } /** @@ -206,7 +206,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long decrementAndGet() { - return getAndAdd(-1) - 1; + return unsafe.getAndAddLong(this, valueOffset, -1L) - 1L; } /** @@ -216,7 +216,7 @@ public class AtomicLong extends Number implements java.io.Serializable { * @return the updated value */ public final long addAndGet(long delta) { - return getAndAdd(delta) + delta; + return unsafe.getAndAddLong(this, valueOffset, delta) + delta; } /** diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java index 216479abeca..bf7aa6ecca8 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java @@ -156,7 +156,7 @@ public class AtomicLongArray implements java.io.Serializable { * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int i, long expect, long update) { @@ -171,14 +171,14 @@ public class AtomicLongArray implements java.io.Serializable { * Atomically sets the element at position {@code i} to the given * updated value if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(int i, long expect, long update) { return compareAndSet(i, expect, update); diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java index 7ac0e73d601..9a298d64931 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java @@ -37,14 +37,13 @@ package java.util.concurrent.atomic; import java.util.function.LongUnaryOperator; import java.util.function.LongBinaryOperator; import sun.misc.Unsafe; -import sun.reflect.CallerSensitive; -import sun.reflect.Reflection; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; /** * A reflection-based utility that enables atomic updates to @@ -71,17 +70,18 @@ public abstract class AtomicLongFieldUpdater { * generic types match. * * @param tclass the class of the objects holding the field - * @param fieldName the name of the field to be updated. + * @param fieldName the name of the field to be updated * @return the updater * @throws IllegalArgumentException if the field is not a - * volatile long type. + * volatile long type * @throws RuntimeException with a nested reflection-based * exception if the class does not hold field or is the wrong type, * or the field is inaccessible to the caller according to Java language * access control */ @CallerSensitive - public static AtomicLongFieldUpdater newUpdater(Class tclass, String fieldName) { + public static AtomicLongFieldUpdater newUpdater(Class tclass, + String fieldName) { Class caller = Reflection.getCallerClass(); if (AtomicLong.VM_SUPPORTS_LONG_CAS) return new CASUpdater(tclass, fieldName, caller); @@ -105,9 +105,9 @@ public abstract class AtomicLongFieldUpdater { * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful * @throws ClassCastException if {@code obj} is not an instance - * of the class possessing the field established in the constructor. + * of the class possessing the field established in the constructor */ public abstract boolean compareAndSet(T obj, long expect, long update); @@ -118,16 +118,16 @@ public abstract class AtomicLongFieldUpdater { * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful * @throws ClassCastException if {@code obj} is not an instance - * of the class possessing the field established in the constructor. + * of the class possessing the field established in the constructor */ public abstract boolean weakCompareAndSet(T obj, long expect, long update); @@ -370,7 +370,8 @@ public abstract class AtomicLongFieldUpdater { private final Class tclass; private final Class cclass; - CASUpdater(final Class tclass, final String fieldName, final Class caller) { + CASUpdater(final Class tclass, final String fieldName, + final Class caller) { final Field field; final int modifiers; try { @@ -493,7 +494,8 @@ public abstract class AtomicLongFieldUpdater { private final Class tclass; private final Class cclass; - LockedUpdater(final Class tclass, final String fieldName, final Class caller) { + LockedUpdater(final Class tclass, final String fieldName, + final Class caller) { Field field = null; int modifiers = 0; try { diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java index b1dc71dfdce..f7becccb13a 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java @@ -112,15 +112,15 @@ public class AtomicMarkableReference { * current reference is {@code ==} to the expected reference * and the current mark is equal to the expected mark. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expectedReference the expected value of the reference * @param newReference the new value for the reference * @param expectedMark the expected value of the mark * @param newMark the new value for the mark - * @return true if successful + * @return {@code true} if successful */ public boolean weakCompareAndSet(V expectedReference, V newReference, @@ -140,7 +140,7 @@ public class AtomicMarkableReference { * @param newReference the new value for the reference * @param expectedMark the expected value of the mark * @param newMark the new value for the mark - * @return true if successful + * @return {@code true} if successful */ public boolean compareAndSet(V expectedReference, V newReference, @@ -178,7 +178,7 @@ public class AtomicMarkableReference { * * @param expectedReference the expected value of the reference * @param newMark the new value for the mark - * @return true if successful + * @return {@code true} if successful */ public boolean attemptMark(V expectedReference, boolean newMark) { Pair current = pair; diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java index ddce0734300..04fbe52effa 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java @@ -109,7 +109,7 @@ public class AtomicReference implements java.io.Serializable { * if the current value {@code ==} the expected value. * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(V expect, V update) { @@ -120,13 +120,13 @@ public class AtomicReference implements java.io.Serializable { * Atomically sets the value to the given updated value * if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(V expect, V update) { return unsafe.compareAndSwapObject(this, valueOffset, expect, update); diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java index f8787ba1d40..4500bdf2fcb 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java @@ -34,10 +34,9 @@ */ package java.util.concurrent.atomic; - -import java.util.Arrays; import java.util.function.UnaryOperator; import java.util.function.BinaryOperator; +import java.util.Arrays; import java.lang.reflect.Array; import sun.misc.Unsafe; @@ -60,19 +59,18 @@ public class AtomicReferenceArray implements java.io.Serializable { private final Object[] array; // must have exact type Object[] static { - int scale; try { unsafe = Unsafe.getUnsafe(); arrayFieldOffset = unsafe.objectFieldOffset (AtomicReferenceArray.class.getDeclaredField("array")); base = unsafe.arrayBaseOffset(Object[].class); - scale = unsafe.arrayIndexScale(Object[].class); + int scale = unsafe.arrayIndexScale(Object[].class); + if ((scale & (scale - 1)) != 0) + throw new Error("data type scale not a power of two"); + shift = 31 - Integer.numberOfLeadingZeros(scale); } catch (Exception e) { throw new Error(e); } - if ((scale & (scale - 1)) != 0) - throw new Error("data type scale not a power of two"); - shift = 31 - Integer.numberOfLeadingZeros(scale); } private long checkedByteOffset(int i) { @@ -173,7 +171,7 @@ public class AtomicReferenceArray implements java.io.Serializable { * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that + * @return {@code true} if successful. False return indicates that * the actual value was not equal to the expected value. */ public final boolean compareAndSet(int i, E expect, E update) { @@ -188,20 +186,20 @@ public class AtomicReferenceArray implements java.io.Serializable { * Atomically sets the element at position {@code i} to the given * updated value if the current value {@code ==} the expected value. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param i the index * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public final boolean weakCompareAndSet(int i, E expect, E update) { return compareAndSet(i, expect, update); } - /** + /** * Atomically updates the element at index {@code i} with the results * of applying the given function, returning the previous value. The * function should be side-effect-free, since it may be re-applied diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java index 2cd0e1df369..901b71c9d2b 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java @@ -37,14 +37,13 @@ package java.util.concurrent.atomic; import java.util.function.UnaryOperator; import java.util.function.BinaryOperator; import sun.misc.Unsafe; -import sun.reflect.CallerSensitive; -import sun.reflect.Reflection; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; /** * A reflection-based utility that enables atomic updates to @@ -82,29 +81,30 @@ import java.security.PrivilegedActionException; * @param The type of the object holding the updatable field * @param The type of the field */ -public abstract class AtomicReferenceFieldUpdater { +public abstract class AtomicReferenceFieldUpdater { /** * Creates and returns an updater for objects with the given field. * The Class arguments are needed to check that reflective types and * generic types match. * - * @param tclass the class of the objects holding the field. + * @param tclass the class of the objects holding the field * @param vclass the class of the field - * @param fieldName the name of the field to be updated. + * @param fieldName the name of the field to be updated * @return the updater - * @throws IllegalArgumentException if the field is not a volatile reference type. + * @throws ClassCastException if the field is of the wrong type + * @throws IllegalArgumentException if the field is not volatile * @throws RuntimeException with a nested reflection-based * exception if the class does not hold field or is the wrong type, * or the field is inaccessible to the caller according to Java language * access control */ @CallerSensitive - public static AtomicReferenceFieldUpdater newUpdater(Class tclass, Class vclass, String fieldName) { - return new AtomicReferenceFieldUpdaterImpl(tclass, - vclass, - fieldName, - Reflection.getCallerClass()); + public static AtomicReferenceFieldUpdater newUpdater(Class tclass, + Class vclass, + String fieldName) { + return new AtomicReferenceFieldUpdaterImpl + (tclass, vclass, fieldName, Reflection.getCallerClass()); } /** @@ -123,7 +123,7 @@ public abstract class AtomicReferenceFieldUpdater { * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public abstract boolean compareAndSet(T obj, V expect, V update); @@ -134,14 +134,14 @@ public abstract class AtomicReferenceFieldUpdater { * other calls to {@code compareAndSet} and {@code set}, but not * necessarily with respect to other changes in the field. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param obj An object whose field to conditionally set * @param expect the expected value * @param update the new value - * @return true if successful + * @return {@code true} if successful */ public abstract boolean weakCompareAndSet(T obj, V expect, V update); @@ -301,10 +301,9 @@ public abstract class AtomicReferenceFieldUpdater { */ AtomicReferenceFieldUpdaterImpl(final Class tclass, - Class vclass, + final Class vclass, final String fieldName, - final Class caller) - { + final Class caller) { final Field field; final Class fieldClass; final int modifiers; diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java index 5f8f1a03db9..56feb2febe7 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java @@ -112,15 +112,15 @@ public class AtomicStampedReference { * current reference is {@code ==} to the expected reference * and the current stamp is equal to the expected stamp. * - *

        May fail spuriously - * and does not provide ordering guarantees, so is only rarely an - * appropriate alternative to {@code compareAndSet}. + *

        May fail + * spuriously and does not provide ordering guarantees, so is + * only rarely an appropriate alternative to {@code compareAndSet}. * * @param expectedReference the expected value of the reference * @param newReference the new value for the reference * @param expectedStamp the expected value of the stamp * @param newStamp the new value for the stamp - * @return true if successful + * @return {@code true} if successful */ public boolean weakCompareAndSet(V expectedReference, V newReference, @@ -140,7 +140,7 @@ public class AtomicStampedReference { * @param newReference the new value for the reference * @param expectedStamp the expected value of the stamp * @param newStamp the new value for the stamp - * @return true if successful + * @return {@code true} if successful */ public boolean compareAndSet(V expectedReference, V newReference, @@ -178,7 +178,7 @@ public class AtomicStampedReference { * * @param expectedReference the expected value of the reference * @param newStamp the new value for the stamp - * @return true if successful + * @return {@code true} if successful */ public boolean attemptStamp(V expectedReference, int newStamp) { Pair current = pair; diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java index 277f185f869..841f6477d46 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAccumulator.java @@ -65,7 +65,7 @@ import java.util.function.DoubleBinaryOperator; *

        Class {@link DoubleAdder} provides analogs of the functionality * of this class for the common special case of maintaining sums. The * call {@code new DoubleAdder()} is equivalent to {@code new - * DoubleAccumulator((x, y) -> x + y, 0.0}. + * DoubleAccumulator((x, y) -> x + y, 0.0)}. * *

        This class extends {@link Number}, but does not define * methods such as {@code equals}, {@code hashCode} and {@code @@ -84,11 +84,13 @@ public class DoubleAccumulator extends Striped64 implements Serializable { /** * Creates a new instance using the given accumulator function * and identity element. + * @param accumulatorFunction a side-effect-free function of two arguments + * @param identity identity (initial value) for the accumulator function */ public DoubleAccumulator(DoubleBinaryOperator accumulatorFunction, double identity) { this.function = accumulatorFunction; - base = this.identity = Double.doubleToRawLongBits(identity); + base = this.identity = Double.doubleToRawLongBits(identity); } /** diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java index 30ff552747d..2db7ca89c59 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/DoubleAdder.java @@ -63,7 +63,7 @@ import java.io.Serializable; public class DoubleAdder extends Striped64 implements Serializable { private static final long serialVersionUID = 7249069246863182397L; - /** + /* * Note that we must use "long" for underlying representations, * because there is no compareAndSet for double, due to the fact * that the bitwise equals used in any CAS implementation is not diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java b/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java index bfddcd3dcbd..1289e6b52cf 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/LongAccumulator.java @@ -86,6 +86,8 @@ public class LongAccumulator extends Striped64 implements Serializable { /** * Creates a new instance using the given accumulator function * and identity element. + * @param accumulatorFunction a side-effect-free function of two arguments + * @param identity identity (initial value) for the accumulator function */ public LongAccumulator(LongBinaryOperator accumulatorFunction, long identity) { diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/Striped64.java b/jdk/src/share/classes/java/util/concurrent/atomic/Striped64.java index 708b4c2574f..16dcb4da6cc 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/Striped64.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/Striped64.java @@ -52,13 +52,13 @@ abstract class Striped64 extends Number { * accessed directly by subclasses. * * Table entries are of class Cell; a variant of AtomicLong padded - * to reduce cache contention on most processors. Padding is - * overkill for most Atomics because they are usually irregularly - * scattered in memory and thus don't interfere much with each - * other. But Atomic objects residing in arrays will tend to be - * placed adjacent to each other, and so will most often share - * cache lines (with a huge negative performance impact) without - * this precaution. + * (via @sun.misc.Contended) to reduce cache contention. Padding + * is overkill for most Atomics because they are usually + * irregularly scattered in memory and thus don't interfere much + * with each other. But Atomic objects residing in arrays will + * tend to be placed adjacent to each other, and so will most + * often share cache lines (with a huge negative performance + * impact) without this precaution. * * In part because Cells are relatively large, we avoid creating * them until they are needed. When there is no contention, all @@ -112,18 +112,13 @@ abstract class Striped64 extends Number { /** * Padded variant of AtomicLong supporting only raw accesses plus CAS. - * The value field is placed between pads, hoping that the JVM doesn't - * reorder them. * * JVM intrinsics note: It would be possible to use a release-only * form of CAS here, if it were provided. */ - static final class Cell { - volatile long p0, p1, p2, p3, p4, p5, p6; + @sun.misc.Contended static final class Cell { volatile long value; - volatile long q0, q1, q2, q3, q4, q5, q6; Cell(long x) { value = x; } - final boolean cas(long cmp, long val) { return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); } diff --git a/jdk/src/share/classes/java/util/concurrent/atomic/package-info.java b/jdk/src/share/classes/java/util/concurrent/atomic/package-info.java index 5cc25956255..ce497eb53b9 100644 --- a/jdk/src/share/classes/java/util/concurrent/atomic/package-info.java +++ b/jdk/src/share/classes/java/util/concurrent/atomic/package-info.java @@ -84,19 +84,18 @@ * write your utility method as follows: *

         {@code
          * long getAndTransform(AtomicLong var) {
        - *   while (true) {
        - *     long current = var.get();
        - *     long next = transform(current);
        - *     if (var.compareAndSet(current, next))
        - *         return current;
        - *         // return next; for transformAndGet
        - *   }
        + *   long prev, next;
        + *   do {
        + *     prev = var.get();
        + *     next = transform(prev);
        + *   } while (!var.compareAndSet(prev, next));
        + *   return prev; // return next; for transformAndGet
          * }}
        * *

        The memory effects for accesses and updates of atomics generally * follow the rules for volatiles, as stated in - * - * The Java Language Specification, Third Edition (17.4 Memory Model): + * + * The Java Language Specification (17.4 Memory Model): * *

          * @@ -152,13 +151,12 @@ * semantics for their array elements, which is not supported for * ordinary arrays. * - * - *

          The atomic classes also support method {@code weakCompareAndSet}, - * which has limited applicability. On some platforms, the weak version - * may be more efficient than {@code compareAndSet} in the normal case, - * but differs in that any given invocation of the - * {@code weakCompareAndSet} method may return {@code false} - * spuriously (that is, for no apparent reason). A + *

          The atomic classes also support method + * {@code weakCompareAndSet}, which has limited applicability. On some + * platforms, the weak version may be more efficient than {@code + * compareAndSet} in the normal case, but differs in that any given + * invocation of the {@code weakCompareAndSet} method may return {@code + * false} spuriously (that is, for no apparent reason). A * {@code false} return means only that the operation may be retried if * desired, relying on the guarantee that repeated invocation when the * variable holds {@code expectedValue} and no other thread is also @@ -194,7 +192,7 @@ * *

          Atomic classes are not general purpose replacements for * {@code java.lang.Integer} and related classes. They do not - * define methods such as {@code hashCode} and + * define methods such as {@code equals}, {@code hashCode} and * {@code compareTo}. (Because atomic variables are expected to be * mutated, they are poor choices for hash table keys.) Additionally, * classes are provided only for those types that are commonly useful in diff --git a/jdk/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java b/jdk/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java index 39a51e5a90c..30dec97a6e0 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java @@ -39,7 +39,7 @@ package java.util.concurrent.locks; * A synchronizer that may be exclusively owned by a thread. This * class provides a basis for creating locks and related synchronizers * that may entail a notion of ownership. The - * AbstractOwnableSynchronizer class itself does not manage or + * {@code AbstractOwnableSynchronizer} class itself does not manage or * use this information. However, subclasses and tools may use * appropriately maintained values to help control and monitor access * and provide diagnostics. @@ -64,20 +64,20 @@ public abstract class AbstractOwnableSynchronizer private transient Thread exclusiveOwnerThread; /** - * Sets the thread that currently owns exclusive access. A - * null argument indicates that no thread owns access. + * Sets the thread that currently owns exclusive access. + * A {@code null} argument indicates that no thread owns access. * This method does not otherwise impose any synchronization or - * volatile field accesses. + * {@code volatile} field accesses. + * @param thread the owner thread */ - protected final void setExclusiveOwnerThread(Thread t) { - exclusiveOwnerThread = t; + protected final void setExclusiveOwnerThread(Thread thread) { + exclusiveOwnerThread = thread; } /** - * Returns the thread last set by - * setExclusiveOwnerThread, or null if never - * set. This method does not otherwise impose any synchronization - * or volatile field accesses. + * Returns the thread last set by {@code setExclusiveOwnerThread}, + * or {@code null} if never set. This method does not otherwise + * impose any synchronization or {@code volatile} field accesses. * @return the owner thread */ protected final Thread getExclusiveOwnerThread() { diff --git a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java index 46ad577cf10..4d885f44376 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java @@ -42,11 +42,11 @@ import sun.misc.Unsafe; /** * A version of {@link AbstractQueuedSynchronizer} in - * which synchronization state is maintained as a long. + * which synchronization state is maintained as a {@code long}. * This class has exactly the same structure, properties, and methods - * as AbstractQueuedSynchronizer with the exception + * as {@code AbstractQueuedSynchronizer} with the exception * that all state-related parameters and results are defined - * as long rather than int. This class + * as {@code long} rather than {@code int}. This class * may be useful when creating synchronizers such as * multilevel locks and barriers that require * 64 bits of state. @@ -71,7 +71,7 @@ public abstract class AbstractQueuedLongSynchronizer */ /** - * Creates a new AbstractQueuedLongSynchronizer instance + * Creates a new {@code AbstractQueuedLongSynchronizer} instance * with initial synchronization state of zero. */ protected AbstractQueuedLongSynchronizer() { } @@ -104,7 +104,7 @@ public abstract class AbstractQueuedLongSynchronizer * *

          Insertion into a CLH queue requires only a single atomic * operation on "tail", so there is a simple atomic point of - * demarcation from unqueued to queued. Similarly, dequeing + * demarcation from unqueued to queued. Similarly, dequeuing * involves only updating the "head". However, it takes a bit * more work for nodes to determine who their successors are, * in part to deal with possible cancellation due to timeouts @@ -211,7 +211,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Link to predecessor node that current node/thread relies on - * for checking waitStatus. Assigned during enqueing, and nulled + * for checking waitStatus. Assigned during enqueuing, and nulled * out (for sake of GC) only upon dequeuing. Also, upon * cancellation of a predecessor, we short-circuit while * finding a non-cancelled one, which will always exist @@ -256,7 +256,7 @@ public abstract class AbstractQueuedLongSynchronizer Node nextWaiter; /** - * Returns true if node is waiting in shared mode + * Returns true if node is waiting in shared mode. */ final boolean isShared() { return nextWaiter == SHARED; @@ -312,7 +312,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Returns the current value of synchronization state. - * This operation has memory semantics of a volatile read. + * This operation has memory semantics of a {@code volatile} read. * @return current state value */ protected final long getState() { @@ -321,7 +321,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Sets the value of synchronization state. - * This operation has memory semantics of a volatile write. + * This operation has memory semantics of a {@code volatile} write. * @param newState the new state value */ protected final void setState(long newState) { @@ -331,12 +331,12 @@ public abstract class AbstractQueuedLongSynchronizer /** * Atomically sets synchronization state to the given updated * value if the current state value equals the expected value. - * This operation has memory semantics of a volatile read + * This operation has memory semantics of a {@code volatile} read * and write. * * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that the actual + * @return {@code true} if successful. False return indicates that the actual * value was not equal to the expected value. */ protected final boolean compareAndSetState(long expect, long update) { @@ -441,7 +441,7 @@ public abstract class AbstractQueuedLongSynchronizer } /** - * Release action for shared mode -- signal successor and ensure + * Release action for shared mode -- signals successor and ensures * propagation. (Note: For exclusive mode, release just amounts * to calling unparkSuccessor of head if it needs signal.) */ @@ -562,7 +562,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Checks and updates status for a node that failed to acquire. * Returns true if thread should block. This is the main signal - * control in all acquire loops. Requires that pred == node.prev + * control in all acquire loops. Requires that pred == node.prev. * * @param pred node's predecessor holding status * @param node the node @@ -1066,7 +1066,7 @@ public abstract class AbstractQueuedLongSynchronizer * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread * is interrupted. - * @param arg the acquire argument + * @param arg the acquire argument. * This value is conveyed to {@link #tryAcquireShared} but is * otherwise uninterpreted and can represent anything * you like. @@ -1441,7 +1441,7 @@ public abstract class AbstractQueuedLongSynchronizer * Returns true if successful. * @param node the node * @return true if successfully transferred (else the node was - * cancelled before signal). + * cancelled before signal) */ final boolean transferForSignal(Node node) { /* @@ -1464,11 +1464,10 @@ public abstract class AbstractQueuedLongSynchronizer } /** - * Transfers node, if necessary, to sync queue after a cancelled - * wait. Returns true if thread was cancelled before being - * signalled. - * @param current the waiting thread - * @param node its node + * Transfers node, if necessary, to sync queue after a cancelled wait. + * Returns true if thread was cancelled before being signalled. + * + * @param node the node * @return true if cancelled before the node was signalled */ final boolean transferAfterCancelledWait(Node node) { @@ -1516,7 +1515,7 @@ public abstract class AbstractQueuedLongSynchronizer * uses this synchronizer as its lock. * * @param condition the condition - * @return true if owned + * @return {@code true} if owned * @throws NullPointerException if the condition is null */ public final boolean owns(ConditionObject condition) { @@ -1526,13 +1525,13 @@ public abstract class AbstractQueuedLongSynchronizer /** * Queries whether any threads are waiting on the given condition * associated with this synchronizer. Note that because timeouts - * and interrupts may occur at any time, a true return - * does not guarantee that a future signal will awaken + * and interrupts may occur at any time, a {@code true} return + * does not guarantee that a future {@code signal} will awaken * any threads. This method is designed primarily for use in * monitoring of the system state. * * @param condition the condition - * @return true if there are any waiting threads + * @return {@code true} if there are any waiting threads * @throws IllegalMonitorStateException if exclusive synchronization * is not held * @throws IllegalArgumentException if the given condition is @@ -1599,7 +1598,7 @@ public abstract class AbstractQueuedLongSynchronizer * and Condition users. Exported versions of this class will in * general need to be accompanied by documentation describing * condition semantics that rely on those of the associated - * AbstractQueuedLongSynchronizer. + * {@code AbstractQueuedLongSynchronizer}. * *

          This class is Serializable, but all fields are transient, * so deserialized conditions have no waiters. @@ -1614,7 +1613,7 @@ public abstract class AbstractQueuedLongSynchronizer private transient Node lastWaiter; /** - * Creates a new ConditionObject instance. + * Creates a new {@code ConditionObject} instance. */ public ConditionObject() { } @@ -1967,7 +1966,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Queries whether any threads are waiting on this condition. - * Implements {@link AbstractQueuedLongSynchronizer#hasWaiters}. + * Implements {@link AbstractQueuedLongSynchronizer#hasWaiters(ConditionObject)}. * * @return {@code true} if there are any waiting threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} @@ -1986,7 +1985,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Returns an estimate of the number of threads waiting on * this condition. - * Implements {@link AbstractQueuedLongSynchronizer#getWaitQueueLength}. + * Implements {@link AbstractQueuedLongSynchronizer#getWaitQueueLength(ConditionObject)}. * * @return the estimated number of waiting threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} @@ -2006,7 +2005,7 @@ public abstract class AbstractQueuedLongSynchronizer /** * Returns a collection containing those threads that may be * waiting on this Condition. - * Implements {@link AbstractQueuedLongSynchronizer#getWaitingThreads}. + * Implements {@link AbstractQueuedLongSynchronizer#getWaitingThreads(ConditionObject)}. * * @return the collection of threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} diff --git a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java index 6f39256c0d6..f0bdeb9030e 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java @@ -45,12 +45,12 @@ import sun.misc.Unsafe; * synchronizers (semaphores, events, etc) that rely on * first-in-first-out (FIFO) wait queues. This class is designed to * be a useful basis for most kinds of synchronizers that rely on a - * single atomic int value to represent state. Subclasses + * single atomic {@code int} value to represent state. Subclasses * must define the protected methods that change this state, and which * define what that state means in terms of this object being acquired * or released. Given these, the other methods in this class carry * out all queuing and blocking mechanics. Subclasses can maintain - * other state fields, but only the atomically updated int + * other state fields, but only the atomically updated {@code int} * value manipulated using methods {@link #getState}, {@link * #setState} and {@link #compareAndSetState} is tracked with respect * to synchronization. @@ -58,7 +58,7 @@ import sun.misc.Unsafe; *

          Subclasses should be defined as non-public internal helper * classes that are used to implement the synchronization properties * of their enclosing class. Class - * AbstractQueuedSynchronizer does not implement any + * {@code AbstractQueuedSynchronizer} does not implement any * synchronization interface. Instead it defines methods such as * {@link #acquireInterruptibly} that can be invoked as * appropriate by concrete locks and related synchronizers to @@ -85,7 +85,7 @@ import sun.misc.Unsafe; * invoked with the current {@link #getState} value fully releases * this object, and {@link #acquire}, given this saved state value, * eventually restores this object to its previous acquired state. No - * AbstractQueuedSynchronizer method otherwise creates such a + * {@code AbstractQueuedSynchronizer} method otherwise creates such a * condition, so if this constraint cannot be met, do not use it. The * behavior of {@link ConditionObject} depends of course on the * semantics of its synchronizer implementation. @@ -93,13 +93,13 @@ import sun.misc.Unsafe; *

          This class provides inspection, instrumentation, and monitoring * methods for the internal queue, as well as similar methods for * condition objects. These can be exported as desired into classes - * using an AbstractQueuedSynchronizer for their + * using an {@code AbstractQueuedSynchronizer} for their * synchronization mechanics. * *

          Serialization of this class stores only the underlying atomic * integer maintaining state, so deserialized objects have empty * thread queues. Typical subclasses requiring serializability will - * define a readObject method that restores this to a known + * define a {@code readObject} method that restores this to a known * initial state upon deserialization. * *

          Usage

          @@ -115,14 +115,14 @@ import sun.misc.Unsafe; *
        • {@link #tryAcquireShared} *
        • {@link #tryReleaseShared} *
        • {@link #isHeldExclusively} - *
        + *
      * * Each of these methods by default throws {@link * UnsupportedOperationException}. Implementations of these methods * must be internally thread-safe, and should in general be short and * not block. Defining these methods is the only supported * means of using this class. All other methods are declared - * final because they cannot be independently varied. + * {@code final} because they cannot be independently varied. * *

      You may also find the inherited methods from {@link * AbstractOwnableSynchronizer} useful to keep track of the thread @@ -148,16 +148,16 @@ import sun.misc.Unsafe; * * (Shared mode is similar but may involve cascading signals.) * - *

      Because checks in acquire are invoked before + *

      Because checks in acquire are invoked before * enqueuing, a newly acquiring thread may barge ahead of * others that are blocked and queued. However, you can, if desired, - * define tryAcquire and/or tryAcquireShared to + * define {@code tryAcquire} and/or {@code tryAcquireShared} to * disable barging by internally invoking one or more of the inspection * methods, thereby providing a fair FIFO acquisition order. - * In particular, most fair synchronizers can define tryAcquire - * to return false if {@link #hasQueuedPredecessors} (a method + * In particular, most fair synchronizers can define {@code tryAcquire} + * to return {@code false} if {@link #hasQueuedPredecessors} (a method * specifically designed to be used by fair synchronizers) returns - * true. Other variations are possible. + * {@code true}. Other variations are possible. * *

      Throughput and scalability are generally highest for the * default barging (also known as greedy, @@ -167,7 +167,7 @@ import sun.misc.Unsafe; * threads, and each recontention has an unbiased chance to succeed * against incoming threads. Also, while acquires do not * "spin" in the usual sense, they may perform multiple - * invocations of tryAcquire interspersed with other + * invocations of {@code tryAcquire} interspersed with other * computations before blocking. This gives most of the benefits of * spins when exclusive synchronization is only briefly held, without * most of the liabilities when it isn't. If so desired, you can @@ -178,7 +178,7 @@ import sun.misc.Unsafe; * *

      This class provides an efficient and scalable basis for * synchronization in part by specializing its range of use to - * synchronizers that can rely on int state, acquire, and + * synchronizers that can rely on {@code int} state, acquire, and * release parameters, and an internal FIFO wait queue. When this does * not suffice, you can build synchronizers from a lower level using * {@link java.util.concurrent.atomic atomic} classes, your own custom @@ -200,12 +200,12 @@ import sun.misc.Unsafe; * * // Our internal helper class * private static class Sync extends AbstractQueuedSynchronizer { - * // Report whether in locked state + * // Reports whether in locked state * protected boolean isHeldExclusively() { * return getState() == 1; * } * - * // Acquire the lock if state is zero + * // Acquires the lock if state is zero * public boolean tryAcquire(int acquires) { * assert acquires == 1; // Otherwise unused * if (compareAndSetState(0, 1)) { @@ -215,7 +215,7 @@ import sun.misc.Unsafe; * return false; * } * - * // Release the lock by setting state to zero + * // Releases the lock by setting state to zero * protected boolean tryRelease(int releases) { * assert releases == 1; // Otherwise unused * if (getState() == 0) throw new IllegalMonitorStateException(); @@ -224,10 +224,10 @@ import sun.misc.Unsafe; * return true; * } * - * // Provide a Condition + * // Provides a Condition * Condition newCondition() { return new ConditionObject(); } * - * // Deserialize properly + * // Deserializes properly * private void readObject(ObjectInputStream s) * throws IOException, ClassNotFoundException { * s.defaultReadObject(); @@ -255,8 +255,8 @@ import sun.misc.Unsafe; * *

      Here is a latch class that is like a * {@link java.util.concurrent.CountDownLatch CountDownLatch} - * except that it only requires a single signal to - * fire. Because a latch is non-exclusive, it uses the shared + * except that it only requires a single {@code signal} to + * fire. Because a latch is non-exclusive, it uses the {@code shared} * acquire and release methods. * *

       {@code
      @@ -293,7 +293,7 @@ public abstract class AbstractQueuedSynchronizer
           private static final long serialVersionUID = 7373984972572414691L;
       
           /**
      -     * Creates a new AbstractQueuedSynchronizer instance
      +     * Creates a new {@code AbstractQueuedSynchronizer} instance
            * with initial synchronization state of zero.
            */
           protected AbstractQueuedSynchronizer() { }
      @@ -326,7 +326,7 @@ public abstract class AbstractQueuedSynchronizer
            *
            * 

      Insertion into a CLH queue requires only a single atomic * operation on "tail", so there is a simple atomic point of - * demarcation from unqueued to queued. Similarly, dequeing + * demarcation from unqueued to queued. Similarly, dequeuing * involves only updating the "head". However, it takes a bit * more work for nodes to determine who their successors are, * in part to deal with possible cancellation due to timeouts @@ -433,7 +433,7 @@ public abstract class AbstractQueuedSynchronizer /** * Link to predecessor node that current node/thread relies on - * for checking waitStatus. Assigned during enqueing, and nulled + * for checking waitStatus. Assigned during enqueuing, and nulled * out (for sake of GC) only upon dequeuing. Also, upon * cancellation of a predecessor, we short-circuit while * finding a non-cancelled one, which will always exist @@ -478,7 +478,7 @@ public abstract class AbstractQueuedSynchronizer Node nextWaiter; /** - * Returns true if node is waiting in shared mode + * Returns true if node is waiting in shared mode. */ final boolean isShared() { return nextWaiter == SHARED; @@ -534,7 +534,7 @@ public abstract class AbstractQueuedSynchronizer /** * Returns the current value of synchronization state. - * This operation has memory semantics of a volatile read. + * This operation has memory semantics of a {@code volatile} read. * @return current state value */ protected final int getState() { @@ -543,7 +543,7 @@ public abstract class AbstractQueuedSynchronizer /** * Sets the value of synchronization state. - * This operation has memory semantics of a volatile write. + * This operation has memory semantics of a {@code volatile} write. * @param newState the new state value */ protected final void setState(int newState) { @@ -553,12 +553,12 @@ public abstract class AbstractQueuedSynchronizer /** * Atomically sets synchronization state to the given updated * value if the current state value equals the expected value. - * This operation has memory semantics of a volatile read + * This operation has memory semantics of a {@code volatile} read * and write. * * @param expect the expected value * @param update the new value - * @return true if successful. False return indicates that the actual + * @return {@code true} if successful. False return indicates that the actual * value was not equal to the expected value. */ protected final boolean compareAndSetState(int expect, int update) { @@ -663,7 +663,7 @@ public abstract class AbstractQueuedSynchronizer } /** - * Release action for shared mode -- signal successor and ensure + * Release action for shared mode -- signals successor and ensures * propagation. (Note: For exclusive mode, release just amounts * to calling unparkSuccessor of head if it needs signal.) */ @@ -784,7 +784,7 @@ public abstract class AbstractQueuedSynchronizer /** * Checks and updates status for a node that failed to acquire. * Returns true if thread should block. This is the main signal - * control in all acquire loops. Requires that pred == node.prev + * control in all acquire loops. Requires that pred == node.prev. * * @param pred node's predecessor holding status * @param node the node @@ -1288,7 +1288,7 @@ public abstract class AbstractQueuedSynchronizer * thread is queued, possibly repeatedly blocking and unblocking, * invoking {@link #tryAcquireShared} until success or the thread * is interrupted. - * @param arg the acquire argument + * @param arg the acquire argument. * This value is conveyed to {@link #tryAcquireShared} but is * otherwise uninterpreted and can represent anything * you like. @@ -1663,7 +1663,7 @@ public abstract class AbstractQueuedSynchronizer * Returns true if successful. * @param node the node * @return true if successfully transferred (else the node was - * cancelled before signal). + * cancelled before signal) */ final boolean transferForSignal(Node node) { /* @@ -1686,11 +1686,10 @@ public abstract class AbstractQueuedSynchronizer } /** - * Transfers node, if necessary, to sync queue after a cancelled - * wait. Returns true if thread was cancelled before being - * signalled. - * @param current the waiting thread - * @param node its node + * Transfers node, if necessary, to sync queue after a cancelled wait. + * Returns true if thread was cancelled before being signalled. + * + * @param node the node * @return true if cancelled before the node was signalled */ final boolean transferAfterCancelledWait(Node node) { @@ -1738,7 +1737,7 @@ public abstract class AbstractQueuedSynchronizer * uses this synchronizer as its lock. * * @param condition the condition - * @return true if owned + * @return {@code true} if owned * @throws NullPointerException if the condition is null */ public final boolean owns(ConditionObject condition) { @@ -1748,13 +1747,13 @@ public abstract class AbstractQueuedSynchronizer /** * Queries whether any threads are waiting on the given condition * associated with this synchronizer. Note that because timeouts - * and interrupts may occur at any time, a true return - * does not guarantee that a future signal will awaken + * and interrupts may occur at any time, a {@code true} return + * does not guarantee that a future {@code signal} will awaken * any threads. This method is designed primarily for use in * monitoring of the system state. * * @param condition the condition - * @return true if there are any waiting threads + * @return {@code true} if there are any waiting threads * @throws IllegalMonitorStateException if exclusive synchronization * is not held * @throws IllegalArgumentException if the given condition is @@ -1821,7 +1820,7 @@ public abstract class AbstractQueuedSynchronizer * and Condition users. Exported versions of this class will in * general need to be accompanied by documentation describing * condition semantics that rely on those of the associated - * AbstractQueuedSynchronizer. + * {@code AbstractQueuedSynchronizer}. * *

      This class is Serializable, but all fields are transient, * so deserialized conditions have no waiters. @@ -1834,7 +1833,7 @@ public abstract class AbstractQueuedSynchronizer private transient Node lastWaiter; /** - * Creates a new ConditionObject instance. + * Creates a new {@code ConditionObject} instance. */ public ConditionObject() { } @@ -2187,7 +2186,7 @@ public abstract class AbstractQueuedSynchronizer /** * Queries whether any threads are waiting on this condition. - * Implements {@link AbstractQueuedSynchronizer#hasWaiters}. + * Implements {@link AbstractQueuedSynchronizer#hasWaiters(ConditionObject)}. * * @return {@code true} if there are any waiting threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} @@ -2206,7 +2205,7 @@ public abstract class AbstractQueuedSynchronizer /** * Returns an estimate of the number of threads waiting on * this condition. - * Implements {@link AbstractQueuedSynchronizer#getWaitQueueLength}. + * Implements {@link AbstractQueuedSynchronizer#getWaitQueueLength(ConditionObject)}. * * @return the estimated number of waiting threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} @@ -2226,7 +2225,7 @@ public abstract class AbstractQueuedSynchronizer /** * Returns a collection containing those threads that may be * waiting on this Condition. - * Implements {@link AbstractQueuedSynchronizer#getWaitingThreads}. + * Implements {@link AbstractQueuedSynchronizer#getWaitingThreads(ConditionObject)}. * * @return the collection of threads * @throws IllegalMonitorStateException if {@link #isHeldExclusively} diff --git a/jdk/src/share/classes/java/util/concurrent/locks/Condition.java b/jdk/src/share/classes/java/util/concurrent/locks/Condition.java index 02cbee904bc..06fb8f1cf02 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/Condition.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/Condition.java @@ -324,7 +324,7 @@ public interface Condition { * } * }}

      * - *

      Design note: This method requires a nanosecond argument so + *

      Design note: This method requires a nanosecond argument so * as to avoid truncation errors in reporting remaining times. * Such precision loss would make it difficult for programmers to * ensure that total waiting times are not systematically shorter diff --git a/jdk/src/share/classes/java/util/concurrent/locks/Lock.java b/jdk/src/share/classes/java/util/concurrent/locks/Lock.java index d9ae1bcc4ed..371a6c7c13a 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/Lock.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/Lock.java @@ -121,8 +121,8 @@ import java.util.concurrent.TimeUnit; *

      All {@code Lock} implementations must enforce the same * memory synchronization semantics as provided by the built-in monitor * lock, as described in - * - * The Java Language Specification, Third Edition (17.4 Memory Model): + * + * The Java Language Specification (17.4 Memory Model): *

        *
      • A successful {@code lock} operation has the same memory * synchronization effects as a successful Lock action. @@ -136,7 +136,7 @@ import java.util.concurrent.TimeUnit; * *

        Implementation Considerations

        * - *

        The three forms of lock acquisition (interruptible, + *

        The three forms of lock acquisition (interruptible, * non-interruptible, and timed) may differ in their performance * characteristics, ordering guarantees, or other implementation * qualities. Further, the ability to interrupt the ongoing @@ -227,7 +227,7 @@ public interface Lock { * * @throws InterruptedException if the current thread is * interrupted while acquiring the lock (and interruption - * of lock acquisition is supported). + * of lock acquisition is supported) */ void lockInterruptibly() throws InterruptedException; diff --git a/jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java b/jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java index 20abfacc3c8..46a0ab597c8 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java @@ -67,10 +67,10 @@ import sun.misc.Unsafe; * {@code blocker} object parameter. This object is recorded while * the thread is blocked to permit monitoring and diagnostic tools to * identify the reasons that threads are blocked. (Such tools may - * access blockers using method {@link #getBlocker}.) The use of these - * forms rather than the original forms without this parameter is - * strongly encouraged. The normal argument to supply as a - * {@code blocker} within a lock implementation is {@code this}. + * access blockers using method {@link #getBlocker(Thread)}.) + * The use of these forms rather than the original forms without this + * parameter is strongly encouraged. The normal argument to supply as + * a {@code blocker} within a lock implementation is {@code this}. * *

        These methods are designed to be used as tools for creating * higher-level synchronization utilities, and are not in themselves diff --git a/jdk/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java b/jdk/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java index fd6632b0b57..40b0f344238 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java @@ -36,16 +36,16 @@ package java.util.concurrent.locks; /** - * A ReadWriteLock maintains a pair of associated {@link + * A {@code ReadWriteLock} maintains a pair of associated {@link * Lock locks}, one for read-only operations and one for writing. * The {@link #readLock read lock} may be held simultaneously by * multiple reader threads, so long as there are no writers. The * {@link #writeLock write lock} is exclusive. * - *

        All ReadWriteLock implementations must guarantee that - * the memory synchronization effects of writeLock operations + *

        All {@code ReadWriteLock} implementations must guarantee that + * the memory synchronization effects of {@code writeLock} operations * (as specified in the {@link Lock} interface) also hold with respect - * to the associated readLock. That is, a thread successfully + * to the associated {@code readLock}. That is, a thread successfully * acquiring the read lock will see all updates made upon previous * release of the write lock. * @@ -120,14 +120,14 @@ public interface ReadWriteLock { /** * Returns the lock used for reading. * - * @return the lock used for reading. + * @return the lock used for reading */ Lock readLock(); /** * Returns the lock used for writing. * - * @return the lock used for writing. + * @return the lock used for writing */ Lock writeLock(); } diff --git a/jdk/src/share/classes/java/util/concurrent/locks/ReentrantLock.java b/jdk/src/share/classes/java/util/concurrent/locks/ReentrantLock.java index 5ca1335aaf6..06c7e61ab65 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/ReentrantLock.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/ReentrantLock.java @@ -64,7 +64,7 @@ import java.util.Collection; * fair lock may obtain it multiple times in succession while other * active threads are not progressing and not currently holding the * lock. - * Also note that the untimed {@link #tryLock() tryLock} method does not + * Also note that the untimed {@link #tryLock()} method does not * honor the fairness setting. It will succeed if the lock * is available even if other threads are waiting. * @@ -88,10 +88,9 @@ import java.util.Collection; * }} * *

        In addition to implementing the {@link Lock} interface, this - * class defines methods {@code isLocked} and - * {@code getLockQueueLength}, as well as some associated - * {@code protected} access methods that may be useful for - * instrumentation and monitoring. + * class defines a number of {@code public} and {@code protected} + * methods for inspecting the state of the lock. Some of these + * methods are only useful for instrumentation and monitoring. * *

        Serialization of this class behaves in the same way as built-in * locks: a deserialized lock is in the unlocked state, regardless of @@ -124,9 +123,8 @@ public class ReentrantLock implements Lock, java.io.Serializable { abstract void lock(); /** - * Performs non-fair tryLock. tryAcquire is - * implemented in subclasses, but both need nonfair - * try for trylock method. + * Performs non-fair tryLock. tryAcquire is implemented in + * subclasses, but both need nonfair try for trylock method. */ final boolean nonfairTryAcquire(int acquires) { final Thread current = Thread.currentThread(); @@ -353,7 +351,7 @@ public class ReentrantLock implements Lock, java.io.Serializable { * {@link #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) } * which is almost equivalent (it also detects interruption). * - *

        If the current thread already holds this lock then the hold + *

        If the current thread already holds this lock then the hold * count is incremented by one and the method returns {@code true}. * *

        If the lock is held by another thread then this method will return @@ -538,10 +536,10 @@ public class ReentrantLock implements Lock, java.io.Serializable { /** * Queries if this lock is held by the current thread. * - *

        Analogous to the {@link Thread#holdsLock} method for built-in - * monitor locks, this method is typically used for debugging and - * testing. For example, a method that should only be called while - * a lock is held can assert that this is the case: + *

        Analogous to the {@link Thread#holdsLock(Object)} method for + * built-in monitor locks, this method is typically used for + * debugging and testing. For example, a method that should only be + * called while a lock is held can assert that this is the case: * *

         {@code
              * class X {
        diff --git a/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java b/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
        index 3698bab27bb..519477e5244 100644
        --- a/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
        +++ b/jdk/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
        @@ -45,7 +45,7 @@ import java.util.Collection;
          * 
          *
        • Acquisition order * - *

          This class does not impose a reader or writer preference + *

          This class does not impose a reader or writer preference * ordering for lock access. However, it does support an optional * fairness policy. * @@ -59,7 +59,7 @@ import java.util.Collection; *

          * *

          Fair mode - *
          When constructed as fair, threads contend for entry using an + *
          When constructed as fair, threads contend for entry using an * approximately arrival-order policy. When the currently held lock * is released, either the longest-waiting single writer thread will * be assigned the write lock, or if there is a group of reader threads @@ -277,7 +277,7 @@ public class ReentrantReadWriteLock static final class HoldCounter { int count = 0; // Use id, not reference, to avoid garbage retention - final long tid = Thread.currentThread().getId(); + final long tid = getThreadId(Thread.currentThread()); } /** @@ -420,7 +420,7 @@ public class ReentrantReadWriteLock firstReaderHoldCount--; } else { HoldCounter rh = cachedHoldCounter; - if (rh == null || rh.tid != current.getId()) + if (rh == null || rh.tid != getThreadId(current)) rh = readHolds.get(); int count = rh.count; if (count <= 1) { @@ -478,7 +478,7 @@ public class ReentrantReadWriteLock firstReaderHoldCount++; } else { HoldCounter rh = cachedHoldCounter; - if (rh == null || rh.tid != current.getId()) + if (rh == null || rh.tid != getThreadId(current)) cachedHoldCounter = rh = readHolds.get(); else if (rh.count == 0) readHolds.set(rh); @@ -515,7 +515,7 @@ public class ReentrantReadWriteLock } else { if (rh == null) { rh = cachedHoldCounter; - if (rh == null || rh.tid != current.getId()) { + if (rh == null || rh.tid != getThreadId(current)) { rh = readHolds.get(); if (rh.count == 0) readHolds.remove(); @@ -536,7 +536,7 @@ public class ReentrantReadWriteLock } else { if (rh == null) rh = cachedHoldCounter; - if (rh == null || rh.tid != current.getId()) + if (rh == null || rh.tid != getThreadId(current)) rh = readHolds.get(); else if (rh.count == 0) readHolds.set(rh); @@ -592,7 +592,7 @@ public class ReentrantReadWriteLock firstReaderHoldCount++; } else { HoldCounter rh = cachedHoldCounter; - if (rh == null || rh.tid != current.getId()) + if (rh == null || rh.tid != getThreadId(current)) cachedHoldCounter = rh = readHolds.get(); else if (rh.count == 0) readHolds.set(rh); @@ -643,7 +643,7 @@ public class ReentrantReadWriteLock return firstReaderHoldCount; HoldCounter rh = cachedHoldCounter; - if (rh != null && rh.tid == current.getId()) + if (rh != null && rh.tid == getThreadId(current)) return rh.count; int count = readHolds.get().count; @@ -875,7 +875,7 @@ public class ReentrantReadWriteLock /** * Attempts to release this lock. * - *

          If the number of readers is now zero then the lock + *

          If the number of readers is now zero then the lock * is made available for write lock attempts. */ public void unlock() { @@ -1017,7 +1017,7 @@ public class ReentrantReadWriteLock * #tryLock(long, TimeUnit) tryLock(0, TimeUnit.SECONDS) } * which is almost equivalent (it also detects interruption). * - *

          If the current thread already holds this lock then the + *

          If the current thread already holds this lock then the * hold count is incremented by one and the method returns * {@code true}. * @@ -1126,7 +1126,7 @@ public class ReentrantReadWriteLock * IllegalMonitorStateException} is thrown. * * @throws IllegalMonitorStateException if the current thread does not - * hold this lock. + * hold this lock */ public void unlock() { sync.release(1); @@ -1254,7 +1254,7 @@ public class ReentrantReadWriteLock * Queries the number of read locks held for this lock. This * method is designed for use in monitoring system state, not for * synchronization control. - * @return the number of read locks held. + * @return the number of read locks held */ public int getReadLockCount() { return sync.getReadLockCount(); @@ -1484,4 +1484,28 @@ public class ReentrantReadWriteLock "[Write locks = " + w + ", Read locks = " + r + "]"; } + /** + * Returns the thread id for the given thread. We must access + * this directly rather than via method Thread.getId() because + * getId() is not final, and has been known to be overridden in + * ways that do not preserve unique mappings. + */ + static final long getThreadId(Thread thread) { + return UNSAFE.getLongVolatile(thread, TID_OFFSET); + } + + // Unsafe mechanics + private static final sun.misc.Unsafe UNSAFE; + private static final long TID_OFFSET; + static { + try { + UNSAFE = sun.misc.Unsafe.getUnsafe(); + Class tk = Thread.class; + TID_OFFSET = UNSAFE.objectFieldOffset + (tk.getDeclaredField("tid")); + } catch (Exception e) { + throw new Error(e); + } + } + } diff --git a/jdk/src/share/classes/java/util/concurrent/locks/StampedLock.java b/jdk/src/share/classes/java/util/concurrent/locks/StampedLock.java index 0ca43f630f7..1506e5a4e46 100644 --- a/jdk/src/share/classes/java/util/concurrent/locks/StampedLock.java +++ b/jdk/src/share/classes/java/util/concurrent/locks/StampedLock.java @@ -366,6 +366,8 @@ public class StampedLock implements java.io.Serializable { * Behavior under timeout and interruption matches that specified * for method {@link Lock#tryLock(long,TimeUnit)}. * + * @param time the maximum time to wait for the lock + * @param unit the time unit of the {@code time} argument * @return a stamp that can be used to unlock or convert mode, * or zero if the lock is not available * @throws InterruptedException if the current thread is interrupted @@ -445,6 +447,8 @@ public class StampedLock implements java.io.Serializable { * Behavior under timeout and interruption matches that specified * for method {@link Lock#tryLock(long,TimeUnit)}. * + * @param time the maximum time to wait for the lock + * @param unit the time unit of the {@code time} argument * @return a stamp that can be used to unlock or convert mode, * or zero if the lock is not available * @throws InterruptedException if the current thread is interrupted @@ -510,7 +514,8 @@ public class StampedLock implements java.io.Serializable { * obtained from {@link #tryOptimisticRead} or a locking method * for this lock has no defined effect or result. * - * @return true if the lock has not been exclusively acquired + * @param stamp a stamp + * @return {@code true} if the lock has not been exclusively acquired * since issuance of the given stamp; else false */ public boolean validate(long stamp) { @@ -723,7 +728,7 @@ public class StampedLock implements java.io.Serializable { * stamp value. This method may be useful for recovery after * errors. * - * @return true if the lock was held, else false + * @return {@code true} if the lock was held, else false */ public boolean tryUnlockWrite() { long s; WNode h; @@ -741,7 +746,7 @@ public class StampedLock implements java.io.Serializable { * requiring a stamp value. This method may be useful for recovery * after errors. * - * @return true if the read lock was held, else false + * @return {@code true} if the read lock was held, else false */ public boolean tryUnlockRead() { long s, m; WNode h; @@ -773,18 +778,18 @@ public class StampedLock implements java.io.Serializable { } /** - * Returns true if the lock is currently held exclusively. + * Returns {@code true} if the lock is currently held exclusively. * - * @return true if the lock is currently held exclusively + * @return {@code true} if the lock is currently held exclusively */ public boolean isWriteLocked() { return (state & WBIT) != 0L; } /** - * Returns true if the lock is currently held non-exclusively. + * Returns {@code true} if the lock is currently held non-exclusively. * - * @return true if the lock is currently held non-exclusively + * @return {@code true} if the lock is currently held non-exclusively */ public boolean isReadLocked() { return (state & RBITS) != 0L; diff --git a/jdk/src/share/classes/java/util/function/BinaryOperator.java b/jdk/src/share/classes/java/util/function/BinaryOperator.java index e81bce8c553..195eba1c3c1 100644 --- a/jdk/src/share/classes/java/util/function/BinaryOperator.java +++ b/jdk/src/share/classes/java/util/function/BinaryOperator.java @@ -24,6 +24,9 @@ */ package java.util.function; +import java.util.Objects; +import java.util.Comparator; + /** * An operation upon two operands yielding a result. This is a specialization of * {@code BiFunction} where the operands and the result are all of the same type. @@ -35,4 +38,33 @@ package java.util.function; */ @FunctionalInterface public interface BinaryOperator extends BiFunction { + /** + * Returns a {@link BinaryOperator} which returns the lesser of two elements + * according to the specified {@code Comparator} + * + * @param the type of values to be compared and returned + * @param comparator a {@code Comparator} for comparing the two values + * @return a {@code BinaryOperator} which returns the lesser of its operands, + * according to the supplied {@code Comparator} + * @throws NullPointerException if the argument is null + */ + public static BinaryOperator minBy(Comparator comparator) { + Objects.requireNonNull(comparator); + return (a, b) -> comparator.compare(a, b) <= 0 ? a : b; + } + + /** + * Returns a {@link BinaryOperator} which returns the greater of two elements + * according to the specified {@code Comparator} + * + * @param the type of values to be compared and returned + * @param comparator a {@code Comparator} for comparing the two values + * @return a {@code BinaryOperator} which returns the greater of its operands, + * according to the supplied {@code Comparator} + * @throws NullPointerException if the argument is null + */ + public static BinaryOperator maxBy(Comparator comparator) { + Objects.requireNonNull(comparator); + return (a, b) -> comparator.compare(a, b) >= 0 ? a : b; + } } diff --git a/jdk/src/share/classes/java/util/function/Function.java b/jdk/src/share/classes/java/util/function/Function.java index 3cab4bf99d8..084ba4cc9c7 100644 --- a/jdk/src/share/classes/java/util/function/Function.java +++ b/jdk/src/share/classes/java/util/function/Function.java @@ -87,6 +87,7 @@ public interface Function { * Returns a {@code Function} whose {@code apply} method returns its input. * * @param the type of the input and output objects to the function + * @return a {@code Function} whose {@code apply} method returns its input */ static Function identity() { return t -> t; diff --git a/jdk/src/share/classes/java/util/function/UnaryOperator.java b/jdk/src/share/classes/java/util/function/UnaryOperator.java index 87fda16bbeb..e7794ca19e5 100644 --- a/jdk/src/share/classes/java/util/function/UnaryOperator.java +++ b/jdk/src/share/classes/java/util/function/UnaryOperator.java @@ -40,6 +40,7 @@ public interface UnaryOperator extends Function { /** * Returns a unary operator that provides its input value as the result. * + * @param the type of the input and output objects to the function * @return a unary operator that provides its input value as the result */ static UnaryOperator identity() { diff --git a/jdk/src/share/classes/java/util/jar/Pack200.java b/jdk/src/share/classes/java/util/jar/Pack200.java index c3ea39587a4..cf4fb98db8f 100644 --- a/jdk/src/share/classes/java/util/jar/Pack200.java +++ b/jdk/src/share/classes/java/util/jar/Pack200.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ import java.beans.PropertyChangeListener; * transform the byte-stream back to JAR format. *

          * Here is an example using packer and unpacker:

          - *

          + * 
          {@code
            *    import java.util.jar.Pack200;
            *    import java.util.jar.Pack200.*;
            *    ...
          @@ -90,7 +90,7 @@ import java.beans.PropertyChangeListener;
            *    } catch (IOException ioe) {
            *        ioe.printStackTrace();
            *    }
          - * 
          + * }
        *

        * A Pack200 file compressed with gzip can be hosted on HTTP/1.1 web servers. * The deployment applications can use "Accept-Encoding=pack200-gzip". This @@ -112,7 +112,7 @@ public abstract class Pack200 { // Static methods of the Pack200 class. /** * Obtain new instance of a class that implements Packer. - * + *

          *
        • If the system property java.util.jar.Pack200.Packer * is defined, then the value is taken to be the fully-qualified name * of a concrete implementation class, which must implement Packer. @@ -122,6 +122,7 @@ public abstract class Pack200 { *

        • If an implementation has not been specified with the system * property, then the system-default implementation class is instantiated, * and the result is returned.

        • + *
        * *

        Note: The returned object is not guaranteed to operate * correctly if multiple threads use it at the same time. @@ -137,7 +138,7 @@ public abstract class Pack200 { /** * Obtain new instance of a class that implements Unpacker. - * + *

          *
        • If the system property java.util.jar.Pack200.Unpacker * is defined, then the value is taken to be the fully-qualified * name of a concrete implementation class, which must implement Unpacker. @@ -147,6 +148,7 @@ public abstract class Pack200 { *

        • If an implementation has not been specified with the * system property, then the system-default implementation class * is instantiated, and the result is returned.

        • + *
        * *

        Note: The returned object is not guaranteed to operate * correctly if multiple threads use it at the same time. @@ -350,14 +352,14 @@ public abstract class Pack200 { * directory will be passed also. *

        * Examples: - *

        
        +         * 
        {@code
                  *     Map p = packer.properties();
                  *     p.put(PASS_FILE_PFX+0, "mutants/Rogue.class");
                  *     p.put(PASS_FILE_PFX+1, "mutants/Wolverine.class");
                  *     p.put(PASS_FILE_PFX+2, "mutants/Storm.class");
                  *     # Pass all files in an entire directory hierarchy:
                  *     p.put(PASS_FILE_PFX+3, "police/");
        -         * 
        . + * }
        */ String PASS_FILE_PFX = "pack.pass.file."; @@ -378,12 +380,12 @@ public abstract class Pack200 { * This is the default value for this property. *

        * Examples: - *

        
        +         * 
        {@code
                  *     Map p = pack200.getProperties();
                  *     p.put(UNKNOWN_ATTRIBUTE, ERROR);
                  *     p.put(UNKNOWN_ATTRIBUTE, STRIP);
                  *     p.put(UNKNOWN_ATTRIBUTE, PASS);
        -         * 
        + * }
        */ String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute"; diff --git a/jdk/src/share/classes/java/util/logging/ConsoleHandler.java b/jdk/src/share/classes/java/util/logging/ConsoleHandler.java index e0e70a5e689..a8b4bc4f0cd 100644 --- a/jdk/src/share/classes/java/util/logging/ConsoleHandler.java +++ b/jdk/src/share/classes/java/util/logging/ConsoleHandler.java @@ -35,7 +35,7 @@ import java.net.*; *

        * Configuration: * By default each ConsoleHandler is initialized using the following - * LogManager configuration properties where + * LogManager configuration properties where {@code } * refers to the fully-qualified class name of the handler. * If properties are not defined * (or have invalid values) then the specified default values are used. diff --git a/jdk/src/share/classes/java/util/logging/FileHandler.java b/jdk/src/share/classes/java/util/logging/FileHandler.java index 8d3b28d8d52..52360c206ee 100644 --- a/jdk/src/share/classes/java/util/logging/FileHandler.java +++ b/jdk/src/share/classes/java/util/logging/FileHandler.java @@ -333,7 +333,7 @@ public class FileHandler extends StreamHandler { * @exception IOException if there are IO problems opening the files. * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). - * @exception IllegalArgumentException if limit < 0, or count < 1. + * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if pattern is an empty string */ public FileHandler(String pattern, int limit, int count) @@ -371,7 +371,7 @@ public class FileHandler extends StreamHandler { * @exception IOException if there are IO problems opening the files. * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). - * @exception IllegalArgumentException if limit < 0, or count < 1. + * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if pattern is an empty string * */ diff --git a/jdk/src/share/classes/java/util/logging/Handler.java b/jdk/src/share/classes/java/util/logging/Handler.java index c44dafbb7ba..a8c3eb4b036 100644 --- a/jdk/src/share/classes/java/util/logging/Handler.java +++ b/jdk/src/share/classes/java/util/logging/Handler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,6 +209,7 @@ public abstract class Handler { /** * Retrieves the ErrorManager for this Handler. * + * @return the ErrorManager for this Handler * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). */ diff --git a/jdk/src/share/classes/java/util/logging/LogManager.java b/jdk/src/share/classes/java/util/logging/LogManager.java index 387b3351742..0d63468b3cc 100644 --- a/jdk/src/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/share/classes/java/util/logging/LogManager.java @@ -193,13 +193,27 @@ public class LogManager { // Create and retain Logger for the root of the namespace. manager.rootLogger = manager.new RootLogger(); + // since by design the global manager's userContext and + // systemContext don't have their requiresDefaultLoggers + // flag set - we make sure to add the root logger to + // the global manager's default contexts here. manager.addLogger(manager.rootLogger); - manager.systemContext.addLocalLogger(manager.rootLogger); + manager.systemContext.addLocalLogger(manager.rootLogger, false); + manager.userContext.addLocalLogger(manager.rootLogger, false); // Adding the global Logger. Doing so in the Logger. // would deadlock with the LogManager.. - Logger.global.setLogManager(manager); - manager.addLogger(Logger.global); + // Do not call Logger.getGlobal() here as this might trigger + // the deadlock too. + @SuppressWarnings("deprecation") + final Logger global = Logger.global; + global.setLogManager(manager); + + // Make sure the global logger will be registered in the + // global manager's default contexts. + manager.addLogger(global); + manager.systemContext.addLocalLogger(global, false); + manager.userContext.addLocalLogger(global, false); // We don't call readConfiguration() here, as we may be running // very early in the JVM startup sequence. Instead readConfiguration @@ -257,7 +271,8 @@ public class LogManager { } /** - * Return the global LogManager object. + * Returns the global LogManager object. + * @return the global LogManager object */ public static LogManager getLogManager() { if (manager != null) { @@ -391,27 +406,27 @@ public class LogManager { // from the execution stack. Object ecx = javaAwtAccess.getExecutionContext(); if (ecx == null) { - // fall back to AppContext.getAppContext() + // fall back to thread group seach of AppContext ecx = javaAwtAccess.getContext(); } - context = (LoggerContext)javaAwtAccess.get(ecx, LoggerContext.class); - if (context == null) { - if (javaAwtAccess.isMainAppContext()) { - context = userContext; - } else { - context = new LoggerContext(); - // during initialization, rootLogger is null when - // instantiating itself RootLogger - if (manager.rootLogger != null) - context.addLocalLogger(manager.rootLogger); + if (ecx != null) { + context = (LoggerContext)javaAwtAccess.get(ecx, LoggerContext.class); + if (context == null) { + if (javaAwtAccess.isMainAppContext()) { + context = userContext; + } else { + // Create a new LoggerContext for the applet. + // The new logger context has its requiresDefaultLoggers + // flag set to true - so that these loggers will be + // lazily added when the context is firt accessed. + context = new LoggerContext(true); + } + javaAwtAccess.put(ecx, LoggerContext.class, context); } - javaAwtAccess.put(ecx, LoggerContext.class, context); } } - } else { - context = userContext; } - return context; + return context != null ? context : userContext; } private List contexts() { @@ -511,9 +526,13 @@ public class LogManager { private final Hashtable namedLoggers = new Hashtable<>(); // Tree of named Loggers private final LogNode root; - + private final boolean requiresDefaultLoggers; private LoggerContext() { + this(false); + } + private LoggerContext(boolean requiresDefaultLoggers) { this.root = new LogNode(null, this); + this.requiresDefaultLoggers = requiresDefaultLoggers; } Logger demandLogger(String name, String resourceBundleName) { @@ -522,7 +541,27 @@ public class LogManager { return manager.demandLogger(name, resourceBundleName, null); } + + // Due to subtle deadlock issues getUserContext() no longer + // calls addLocalLogger(rootLogger); + // Therefore - we need to add the default loggers later on. + // Checks that the context is properly initialized + // This is necessary before calling e.g. find(name) + // or getLoggerNames() + // + private void ensureInitialized() { + if (requiresDefaultLoggers) { + // Ensure that the root and global loggers are set. + ensureDefaultLogger(manager.rootLogger); + ensureDefaultLogger(Logger.global); + } + } + + synchronized Logger findLogger(String name) { + // ensure that this context is properly initialized before + // looking for loggers. + ensureInitialized(); LoggerWeakRef ref = namedLoggers.get(name); if (ref == null) { return null; @@ -536,14 +575,81 @@ public class LogManager { return logger; } + // This method is called before adding a logger to the + // context. + // 'logger' is the context that will be added. + // This method will ensure that the defaults loggers are added + // before adding 'logger'. + // + private void ensureAllDefaultLoggers(Logger logger) { + if (requiresDefaultLoggers) { + final String name = logger.getName(); + if (!name.isEmpty()) { + ensureDefaultLogger(manager.rootLogger); + } + if (!Logger.GLOBAL_LOGGER_NAME.equals(name)) { + ensureDefaultLogger(Logger.global); + } + } + } + + private void ensureDefaultLogger(Logger logger) { + // Used for lazy addition of root logger and global logger + // to a LoggerContext. + + // This check is simple sanity: we do not want that this + // method be called for anything else than Logger.global + // or owner.rootLogger. + if (!requiresDefaultLoggers || logger == null + || logger != Logger.global && logger != manager.rootLogger) { + + // the case where we have a non null logger which is neither + // Logger.global nor manager.rootLogger indicates a serious + // issue - as ensureDefaultLogger should never be called + // with any other loggers than one of these two (or null - if + // e.g manager.rootLogger is not yet initialized)... + assert logger == null; + + return; + } + + // Adds the logger if it's not already there. + if (!namedLoggers.containsKey(logger.getName())) { + // It is important to prevent addLocalLogger to + // call ensureAllDefaultLoggers when we're in the process + // off adding one of those default loggers - as this would + // immediately cause a stack overflow. + // Therefore we must pass addDefaultLoggersIfNeeded=false, + // even if requiresDefaultLoggers is true. + addLocalLogger(logger, false); + } + } + + boolean addLocalLogger(Logger logger) { + // no need to add default loggers if it's not required + return addLocalLogger(logger, requiresDefaultLoggers); + } + // Add a logger to this context. This method will only set its level // and process parent loggers. It doesn't set its handlers. - synchronized boolean addLocalLogger(Logger logger) { + synchronized boolean addLocalLogger(Logger logger, boolean addDefaultLoggersIfNeeded) { + // addDefaultLoggersIfNeeded serves to break recursion when adding + // default loggers. If we're adding one of the default loggers + // (we're being called from ensureDefaultLogger()) then + // addDefaultLoggersIfNeeded will be false: we don't want to + // call ensureAllDefaultLoggers again. + // + // Note: addDefaultLoggersIfNeeded can also be false when + // requiresDefaultLoggers is false - since calling + // ensureAllDefaultLoggers would have no effect in this case. + if (addDefaultLoggersIfNeeded) { + ensureAllDefaultLoggers(logger); + } + final String name = logger.getName(); if (name == null) { throw new NullPointerException(); } - LoggerWeakRef ref = namedLoggers.get(name); if (ref != null) { if (ref.get() == null) { @@ -606,6 +712,9 @@ public class LogManager { } synchronized Enumeration getLoggerNames() { + // ensure that this context is properly initialized before + // returning logger names. + ensureInitialized(); return namedLoggers.keys(); } diff --git a/jdk/src/share/classes/java/util/logging/LogRecord.java b/jdk/src/share/classes/java/util/logging/LogRecord.java index 93540d9a009..50444f1cd8a 100644 --- a/jdk/src/share/classes/java/util/logging/LogRecord.java +++ b/jdk/src/share/classes/java/util/logging/LogRecord.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -211,6 +211,7 @@ public class LogRecord implements java.io.Serializable { * the message string before formatting it. The result may * be null if the message is not localizable, or if no suitable * ResourceBundle is available. + * @return the localization resource bundle */ public ResourceBundle getResourceBundle() { return resourceBundle; @@ -231,6 +232,7 @@ public class LogRecord implements java.io.Serializable { * This is the name for the ResourceBundle that should be * used to localize the message string before formatting it. * The result may be null if the message is not localizable. + * @return the localization resource bundle name */ public String getResourceBundleName() { return resourceBundleName; @@ -281,6 +283,7 @@ public class LogRecord implements java.io.Serializable { *

        * Sequence numbers are normally assigned in the LogRecord constructor, * so it should not normally be necessary to use this method. + * @param seq the sequence number */ public void setSequenceNumber(long seq) { sequenceNumber = seq; diff --git a/jdk/src/share/classes/java/util/logging/Logger.java b/jdk/src/share/classes/java/util/logging/Logger.java index 11b0c0ce672..1c959ecd6a1 100644 --- a/jdk/src/share/classes/java/util/logging/Logger.java +++ b/jdk/src/share/classes/java/util/logging/Logger.java @@ -232,6 +232,27 @@ public class Logger { * @since 1.7 */ public static final Logger getGlobal() { + // In order to break a cyclic dependence between the LogManager + // and Logger static initializers causing deadlocks, the global + // logger is created with a special constructor that does not + // initialize its log manager. + // + // If an application calls Logger.getGlobal() before any logger + // has been initialized, it is therefore possible that the + // LogManager class has not been initialized yet, and therefore + // Logger.global.manager will be null. + // + // In order to finish the initialization of the global logger, we + // will therefore call LogManager.getLogManager() here. + // + // Care must be taken *not* to call Logger.getGlobal() in + // LogManager static initializers in order to avoid such + // deadlocks. + // + if (global != null && global.manager == null) { + // Complete initialization of the global Logger. + global.manager = LogManager.getLogManager(); + } return global; } diff --git a/jdk/src/share/classes/java/util/logging/MemoryHandler.java b/jdk/src/share/classes/java/util/logging/MemoryHandler.java index 5c545cc2912..ddf72c2a1e1 100644 --- a/jdk/src/share/classes/java/util/logging/MemoryHandler.java +++ b/jdk/src/share/classes/java/util/logging/MemoryHandler.java @@ -64,7 +64,7 @@ package java.util.logging; * (defaults to no Filter).

      • *
      • <handler-name>.size * defines the buffer size (defaults to 1000).
      • - *
      • <handler-name>.push + *
      • <handler-name>.push * defines the pushLevel (defaults to level.SEVERE).
      • *
      • <handler-name>.target * specifies the name of the target Handler class. @@ -155,7 +155,7 @@ public class MemoryHandler extends Handler { * @param size the number of log records to buffer (must be greater than zero) * @param pushLevel message level to push on * - * @throws IllegalArgumentException if size is <= 0 + * @throws IllegalArgumentException if {@code size is <= 0} */ public MemoryHandler(Handler target, int size, Level pushLevel) { if (target == null || pushLevel == null) { diff --git a/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java b/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java index b7723d831ac..31c35d7fa46 100644 --- a/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java +++ b/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1121,6 +1121,8 @@ public abstract class AbstractPreferences extends Preferences { * removed. (The implementor needn't check for any of these things.) * *

        This method is invoked with the lock on this node held. + * @param key the key + * @param value the value */ protected abstract void putSpi(String key, String value); @@ -1139,6 +1141,7 @@ public abstract class AbstractPreferences extends Preferences { * *

        This method is invoked with the lock on this node held. * + * @param key the key * @return the value associated with the specified key at this preference * node, or null if there is no association for this * key, or the association cannot be determined at this time. @@ -1152,6 +1155,7 @@ public abstract class AbstractPreferences extends Preferences { * (The implementor needn't check for either of these things.) * *

        This method is invoked with the lock on this node held. + * @param key the key */ protected abstract void removeSpi(String key); diff --git a/jdk/src/share/classes/java/util/prefs/Preferences.java b/jdk/src/share/classes/java/util/prefs/Preferences.java index 1867fca9186..e3f459290b2 100644 --- a/jdk/src/share/classes/java/util/prefs/Preferences.java +++ b/jdk/src/share/classes/java/util/prefs/Preferences.java @@ -134,52 +134,52 @@ import java.lang.Double; * subsequently restore from the backup. * *

        The XML document has the following DOCTYPE declaration: - *

        - * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
        - * 
        + *
        {@code
        + * 
        + * }
        * Note that the system URI (http://java.sun.com/dtd/preferences.dtd) is * not accessed when exporting or importing preferences; it merely * serves as a string to uniquely identify the DTD, which is: - *
        - *    <?xml version="1.0" encoding="UTF-8"?>
        + * 
        {@code
        + *    
          *
        - *    <!-- DTD for a Preferences tree. -->
        + *    
          *
        - *    <!-- The preferences element is at the root of an XML document
        - *         representing a Preferences tree. -->
        - *    <!ELEMENT preferences (root)>
        + *    
        + *    
          *
        - *    <!-- The preferences element contains an optional version attribute,
        - *          which specifies version of DTD. -->
        - *    <!ATTLIST preferences EXTERNAL_XML_VERSION CDATA "0.0" >
        + *    
        + *    
          *
        - *    <!-- The root element has a map representing the root's preferences
        - *         (if any), and one node for each child of the root (if any). -->
        - *    <!ELEMENT root (map, node*) >
        + *    
        + *    
          *
        - *    <!-- Additionally, the root contains a type attribute, which
        - *         specifies whether it's the system or user root. -->
        - *    <!ATTLIST root
        - *              type (system|user) #REQUIRED >
        + *    
        + *    
          *
        - *    <!-- Each node has a map representing its preferences (if any),
        - *         and one node for each child (if any). -->
        - *    <!ELEMENT node (map, node*) >
        + *    
        + *    
          *
        - *    <!-- Additionally, each node has a name attribute -->
        - *    <!ATTLIST node
        - *              name CDATA #REQUIRED >
        + *    
        + *    
          *
        - *    <!-- A map represents the preferences stored at a node (if any). -->
        - *    <!ELEMENT map (entry*) >
        + *    
        + *    
          *
        - *    <!-- An entry represents a single preference, which is simply
        - *          a key-value pair. -->
        - *    <!ELEMENT entry EMPTY >
        - *    <!ATTLIST entry
        + *    
        + *    
        + *    
        + *              value CDATA #REQUIRED >
        + * }
        * * Every Preferences implementation must have an associated {@link * PreferencesFactory} implementation. Every Java(TM) SE implementation must provide @@ -1161,9 +1161,9 @@ public abstract class Preferences { * This XML document is, in effect, an offline backup of the node. * *

        The XML document will have the following DOCTYPE declaration: - *

        -     * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
        -     * 
        + *
        {@code
        +     * 
        +     * }
        * The UTF-8 character encoding will be used. * *

        This method is an exception to the general rule that the results of @@ -1192,9 +1192,9 @@ public abstract class Preferences { * effect, an offline backup of the subtree rooted at the node. * *

        The XML document will have the following DOCTYPE declaration: - *

        -     * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
        -     * 
        + *
        {@code
        +     * 
        +     * }
        * The UTF-8 character encoding will be used. * *

        This method is an exception to the general rule that the results of @@ -1228,9 +1228,9 @@ public abstract class Preferences { * do not exist, the nodes will be created. * *

        The XML document must have the following DOCTYPE declaration: - *

        -     * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">
        -     * 
        + *
        {@code
        +     * 
        +     * }
        * (This method is designed for use in conjunction with * {@link #exportNode(OutputStream)} and * {@link #exportSubtree(OutputStream)}. diff --git a/jdk/src/share/classes/java/util/prefs/PreferencesFactory.java b/jdk/src/share/classes/java/util/prefs/PreferencesFactory.java index 8bf37bc3c5c..d7341e6569d 100644 --- a/jdk/src/share/classes/java/util/prefs/PreferencesFactory.java +++ b/jdk/src/share/classes/java/util/prefs/PreferencesFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ public interface PreferencesFactory { /** * Returns the system root preference node. (Multiple calls on this * method will return the same object reference.) + * @return the system root preference node */ Preferences systemRoot(); @@ -52,6 +53,8 @@ public interface PreferencesFactory { * Returns the user root preference node corresponding to the calling * user. In a server, the returned value will typically depend on * some implicit client-context. + * @return the user root preference node corresponding to the calling + * user */ Preferences userRoot(); } diff --git a/jdk/src/share/classes/java/util/regex/MatchResult.java b/jdk/src/share/classes/java/util/regex/MatchResult.java index 9b52331808f..9767d286377 100644 --- a/jdk/src/share/classes/java/util/regex/MatchResult.java +++ b/jdk/src/share/classes/java/util/regex/MatchResult.java @@ -79,7 +79,7 @@ public interface MatchResult { /** * Returns the offset after the last character matched.

        * - * @return @return The offset after the last character matched + * @return The offset after the last character matched * * @throws IllegalStateException * If no match has yet been attempted, diff --git a/jdk/src/share/classes/java/util/regex/Pattern.java b/jdk/src/share/classes/java/util/regex/Pattern.java index 14cde68c552..ae7468758c8 100644 --- a/jdk/src/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/share/classes/java/util/regex/Pattern.java @@ -108,7 +108,7 @@ import java.util.stream.StreamSupport; * \x{h...h} * The character with hexadecimal value 0xh...h * ({@link java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT} - *  <= 0xh...h <=  + *  <= 0xh...h <=  * {@link java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT}) * \t * The tab character ('\u0009') diff --git a/jdk/src/share/classes/java/util/spi/LocaleServiceProvider.java b/jdk/src/share/classes/java/util/spi/LocaleServiceProvider.java index b59dba1978c..87af9788f50 100644 --- a/jdk/src/share/classes/java/util/spi/LocaleServiceProvider.java +++ b/jdk/src/share/classes/java/util/spi/LocaleServiceProvider.java @@ -42,7 +42,7 @@ import java.util.Locale; * interfaces to offer support for locales beyond the set of locales * supported by the Java runtime environment itself. *

        - *

        Packaging of Locale Sensitive Service Provider Implementations

        + *

        Packaging of Locale Sensitive Service Provider Implementations

        * Implementations of these locale sensitive services are packaged using the * Java Extension Mechanism * as installed extensions. A provider identifies itself with a @@ -94,7 +94,7 @@ import java.util.Locale; * supports the requested locale, the methods go through a list of candidate * locales and repeat the availability check for each until a match is found. * The algorithm used for creating a list of candidate locales is same as - * the one used by ResourceBunlde by default (see + * the one used by ResourceBundle by default (see * {@link java.util.ResourceBundle.Control#getCandidateLocales getCandidateLocales} * for the details). Even if a locale is resolved from the candidate list, * methods that return requested objects or names are invoked with the original @@ -165,7 +165,7 @@ public abstract class LocaleServiceProvider { /** * Returns {@code true} if the given {@code locale} is supported by * this locale service provider. The given {@code locale} may contain - * extensions that should be + * extensions that should be * taken into account for the support determination. * *

        The default implementation returns {@code true} if the given {@code locale} diff --git a/jdk/src/share/classes/java/util/stream/AbstractPipeline.java b/jdk/src/share/classes/java/util/stream/AbstractPipeline.java index 37575b0c72c..efda9407152 100644 --- a/jdk/src/share/classes/java/util/stream/AbstractPipeline.java +++ b/jdk/src/share/classes/java/util/stream/AbstractPipeline.java @@ -375,6 +375,12 @@ abstract class AbstractPipeline> // NOTE: there are no size-injecting ops if (StreamOpFlag.SHORT_CIRCUIT.isKnown(thisOpFlags)) { backPropagationHead = p; + // Clear the short circuit flag for next pipeline stage + // This stage encapsulates short-circuiting, the next + // stage may not have any short-circuit operations, and + // if so spliterator.forEachRemaining should be be used + // for traversal + thisOpFlags = thisOpFlags & ~StreamOpFlag.IS_SHORT_CIRCUIT; } depth = 0; @@ -447,6 +453,15 @@ abstract class AbstractPipeline> // PipelineHelper + @Override + final StreamShape getSourceShape() { + AbstractPipeline p = AbstractPipeline.this; + while (p.depth > 0) { + p = p.previousStage; + } + return p.getOutputShape(); + } + @Override final long exactOutputSizeIfKnown(Spliterator spliterator) { return StreamOpFlag.SIZED.isKnown(getStreamAndOpFlags()) ? spliterator.getExactSizeIfKnown() : -1; @@ -502,6 +517,16 @@ abstract class AbstractPipeline> return (Sink) sink; } + @Override + final Spliterator wrapSpliterator(Spliterator sourceSpliterator) { + if (depth == 0) { + return (Spliterator) sourceSpliterator; + } + else { + return wrap(this, () -> sourceSpliterator, isParallel()); + } + } + @Override @SuppressWarnings("unchecked") final Node evaluate(Spliterator spliterator, diff --git a/jdk/src/share/classes/java/util/stream/AbstractTask.java b/jdk/src/share/classes/java/util/stream/AbstractTask.java index 1b7ad212286..75fc3a11f60 100644 --- a/jdk/src/share/classes/java/util/stream/AbstractTask.java +++ b/jdk/src/share/classes/java/util/stream/AbstractTask.java @@ -316,6 +316,7 @@ abstract class AbstractTask> byDept @@ -89,7 +88,7 @@ import java.util.function.ToLongFunction; * Map highestPaidByDept * = employees.stream() * .collect(Collectors.groupingBy(Employee::getDepartment, - * Collectors.maxBy(Comparators.comparing(Employee::getSalary)))); + * Collectors.maxBy(Comparator.comparing(Employee::getSalary)))); * * // Partition students into passing and failing * Map> passingFailing = @@ -404,7 +403,7 @@ public final class Collectors { * @implSpec * This produces a result equivalent to: *

        {@code
        -     *     reducing(Comparators.lesserOf(comparator))
        +     *     reducing(BinaryOperator.minBy(comparator))
              * }
        * * @param the type of the input elements @@ -413,7 +412,7 @@ public final class Collectors { */ public static Collector minBy(Comparator comparator) { - return reducing(Comparators.lesserOf(comparator)); + return reducing(BinaryOperator.minBy(comparator)); } /** @@ -423,7 +422,7 @@ public final class Collectors { * @implSpec * This produces a result equivalent to: *
        {@code
        -     *     reducing(Comparators.greaterOf(comparator))
        +     *     reducing(BinaryOperator.maxBy(comparator))
              * }
        * * @param the type of the input elements @@ -432,7 +431,7 @@ public final class Collectors { */ public static Collector maxBy(Comparator comparator) { - return reducing(Comparators.greaterOf(comparator)); + return reducing(BinaryOperator.maxBy(comparator)); } /** @@ -491,8 +490,8 @@ public final class Collectors { *

        For example, given a stream of {@code Person}, to calculate tallest * person in each city: *

        {@code
        -     *     Comparator byHeight = Comparators.comparing(Person::getHeight);
        -     *     BinaryOperator tallerOf = Comparators.greaterOf(byHeight);
        +     *     Comparator byHeight = Comparator.comparing(Person::getHeight);
        +     *     BinaryOperator tallerOf = BinaryOperator.greaterOf(byHeight);
              *     Map tallestByCity
              *         = people.stream().collect(groupingBy(Person::getCity, reducing(tallerOf)));
              * }
        @@ -531,8 +530,8 @@ public final class Collectors { *

        For example, given a stream of {@code Person}, to calculate the longest * last name of residents in each city: *

        {@code
        -     *     Comparator byLength = Comparators.comparing(String::length);
        -     *     BinaryOperator longerOf = Comparators.greaterOf(byLength);
        +     *     Comparator byLength = Comparator.comparing(String::length);
        +     *     BinaryOperator longerOf = BinaryOperator.greaterOf(byLength);
              *     Map longestLastNameByCity
              *         = people.stream().collect(groupingBy(Person::getCity,
              *                                              reducing(Person::getLastName, longerOf)));
        diff --git a/jdk/src/share/classes/java/util/stream/DoublePipeline.java b/jdk/src/share/classes/java/util/stream/DoublePipeline.java
        index b403a433fbf..52fd60f4163 100644
        --- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java
        +++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java
        @@ -168,7 +168,7 @@ abstract class DoublePipeline
         
             @Override
             public final PrimitiveIterator.OfDouble iterator() {
        -        return Spliterators.iteratorFromSpliterator(spliterator());
        +        return Spliterators.iterator(spliterator());
             }
         
             @Override
        @@ -258,6 +258,12 @@ abstract class DoublePipeline
                     @Override
                     Sink opWrapSink(int flags, Sink sink) {
                         return new Sink.ChainedDouble(sink) {
        +                    @Override
        +                    public void begin(long size) {
        +                        downstream.begin(-1);
        +                    }
        +
        +                    @Override
                             public void accept(double t) {
                                 // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it
                                 DoubleStream result = mapper.apply(t);
        @@ -289,6 +295,11 @@ abstract class DoublePipeline
                     @Override
                     Sink opWrapSink(int flags, Sink sink) {
                         return new Sink.ChainedDouble(sink) {
        +                    @Override
        +                    public void begin(long size) {
        +                        downstream.begin(-1);
        +                    }
        +
                             @Override
                             public void accept(double t) {
                                 if (predicate.test(t))
        @@ -461,7 +472,7 @@ abstract class DoublePipeline
             @Override
             public final double[] toArray() {
                 return Nodes.flattenDouble((Node.OfDouble) evaluateToArrayNode(Double[]::new))
        -                        .asDoubleArray();
        +                        .asPrimitiveArray();
             }
         
             //
        diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java
        index f402b5daee6..55d244fc4c3 100644
        --- a/jdk/src/share/classes/java/util/stream/DoubleStream.java
        +++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java
        @@ -743,85 +743,7 @@ public interface DoubleStream extends BaseStream {
              */
             public static DoubleStream generate(DoubleSupplier s) {
                 Objects.requireNonNull(s);
        -        return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(
        -                new PrimitiveIterator.OfDouble() {
        -                    @Override
        -                    public boolean hasNext() { return true; }
        -
        -                    @Override
        -                    public double nextDouble() { return s.getAsDouble(); }
        -                },
        -                Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL));
        -    }
        -
        -    /**
        -     * Returns a sequential {@code DoubleStream} from {@code startInclusive} (inclusive)
        -     * to {@code endExclusive} (exclusive) by an incremental step of 1.0.
        -     *
        -     * @implSpec
        -     * The implementation behaves as if:
        -     * 
        {@code
        -     *     doubleRange(startInclusive, endExclusive, 1.0);
        -     * }
        - * - * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @return a sequential {@code DoubleStream} for the range of {@code double} - * elements - */ - public static DoubleStream range(double startInclusive, double endExclusive) { - return range(startInclusive, endExclusive, 1.0); - } - - /** - * Returns a sequential {@code DoubleStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by {@code step}. If - * {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. - * - * An equivalent sequence of increasing values can be produced - * sequentially using a {@code for} loop as follows: - *
        {@code
        -     *     long size = (long) Math.ceil((startInclusive - endExclusive) / step);
        -     *     long i = 0
        -     *     for (double v = startInclusive; i < size; i++, v = startInclusive + step * i) {
        -     *         ...
        -     *     }
        -     * }
        - * - * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the difference between consecutive values - * @return a sequential {@code DoubleStream} for tne range of {@code double} - * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0. is {@code NaN}, or the count of elements in the range would be - * greater than {@code Long.MAX_VALUE} - */ - public static DoubleStream range(double startInclusive, double endExclusive, double step) { - // @@@ Need to check for ranges that may not produce distinct values - // such as when the step is very small - // Also clarify the size of the range which may produce more or less - // than expected - if (step <= 0 || Double.isNaN(step)) { - throw new IllegalArgumentException(String.format("Illegal step: %f", step)); - } else { - double range = endExclusive - startInclusive; - if (range <= 0) { - return empty(); - } - double size = Math.ceil((endExclusive - startInclusive) / step); - if (Double.isNaN(size)) { - throw new IllegalArgumentException( - String.format("Illegal range: %f size is NaN", size)); - } else if (size > Long.MAX_VALUE) { - throw new IllegalArgumentException( - String.format("Illegal range: size %f > Long.MAX_VALUE", size)); - } else { - return StreamSupport.doubleStream( - new Streams.RangeDoubleSpliterator( - startInclusive, endExclusive, step, 0, (long) size)); - } - } + return StreamSupport.doubleStream( + new StreamSpliterators.InfiniteSupplyingSpliterator.OfDouble(Long.MAX_VALUE, s)); } } diff --git a/jdk/src/share/classes/java/util/stream/ForEachOps.java b/jdk/src/share/classes/java/util/stream/ForEachOps.java index 944dec6211f..6f20677cd66 100644 --- a/jdk/src/share/classes/java/util/stream/ForEachOps.java +++ b/jdk/src/share/classes/java/util/stream/ForEachOps.java @@ -342,7 +342,7 @@ final class ForEachOps { doCompute(this); } - private static void doCompute(ForEachOrderedTask task) { + private static void doCompute(ForEachOrderedTask task) { while (true) { Spliterator split; if (!AbstractTask.suggestSplit(task.spliterator, task.targetSize) diff --git a/jdk/src/share/classes/java/util/stream/IntPipeline.java b/jdk/src/share/classes/java/util/stream/IntPipeline.java index ec6a4eb0bd3..10cfb890719 100644 --- a/jdk/src/share/classes/java/util/stream/IntPipeline.java +++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java @@ -172,7 +172,7 @@ abstract class IntPipeline @Override public final PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -183,7 +183,7 @@ abstract class IntPipeline // Stateless intermediate ops from IntStream @Override - public final LongStream longs() { + public final LongStream asLongStream() { return new LongPipeline.StatelessOp(this, StreamShape.INT_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -199,7 +199,7 @@ abstract class IntPipeline } @Override - public final DoubleStream doubles() { + public final DoubleStream asDoubleStream() { return new DoublePipeline.StatelessOp(this, StreamShape.INT_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -294,6 +294,12 @@ abstract class IntPipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedInt(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(int t) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it IntStream result = mapper.apply(t); @@ -325,6 +331,11 @@ abstract class IntPipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedInt(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + @Override public void accept(int t) { if (predicate.test(t)) @@ -424,7 +435,7 @@ abstract class IntPipeline @Override public final long count() { - return longs().map(e -> 1L).sum(); + return asLongStream().map(e -> 1L).sum(); } @Override @@ -498,7 +509,7 @@ abstract class IntPipeline @Override public final int[] toArray() { return Nodes.flattenInt((Node.OfInt) evaluateToArrayNode(Integer[]::new)) - .asIntArray(); + .asPrimitiveArray(); } // diff --git a/jdk/src/share/classes/java/util/stream/IntStream.java b/jdk/src/share/classes/java/util/stream/IntStream.java index 576a6aadea2..3eb4409c4e5 100644 --- a/jdk/src/share/classes/java/util/stream/IntStream.java +++ b/jdk/src/share/classes/java/util/stream/IntStream.java @@ -625,7 +625,7 @@ public interface IntStream extends BaseStream { * @return a {@code LongStream} consisting of the elements of this stream, * converted to {@code long} */ - LongStream longs(); + LongStream asLongStream(); /** * Returns a {@code DoubleStream} consisting of the elements of this stream, @@ -634,7 +634,7 @@ public interface IntStream extends BaseStream { * @return a {@code DoubleStream} consisting of the elements of this stream, * converted to {@code double} */ - DoubleStream doubles(); + DoubleStream asDoubleStream(); /** * Returns a {@code Stream} consisting of the elements of this stream, @@ -745,26 +745,20 @@ public interface IntStream extends BaseStream { */ public static IntStream generate(IntSupplier s) { Objects.requireNonNull(s); - return StreamSupport.intStream(Spliterators.spliteratorUnknownSize( - new PrimitiveIterator.OfInt() { - @Override - public boolean hasNext() { return true; } - - @Override - public int nextInt() { return s.getAsInt(); } - }, - Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL)); + return StreamSupport.intStream( + new StreamSpliterators.InfiniteSupplyingSpliterator.OfInt(Long.MAX_VALUE, s)); } /** * Returns a sequential {@code IntStream} from {@code startInclusive} * (inclusive) to {@code endExclusive} (exclusive) by an incremental step of - * 1. + * {@code 1}. * - * @implSpec - * The implementation behaves as if: + * @apiNote + *

        An equivalent sequence of increasing values can be produced + * sequentially using a {@code for} loop as follows: *

        {@code
        -     *     intRange(startInclusive, endExclusive, 1);
        +     *     for (int i = startInclusive; i < endExclusive ; i++) { ... }
              * }
        * * @param startInclusive the (inclusive) initial value @@ -773,36 +767,37 @@ public interface IntStream extends BaseStream { * elements */ public static IntStream range(int startInclusive, int endExclusive) { - return range(startInclusive, endExclusive, 1); + if (startInclusive >= endExclusive) { + return empty(); + } else { + return StreamSupport.intStream( + new Streams.RangeIntSpliterator(startInclusive, endExclusive, false)); + } } /** * Returns a sequential {@code IntStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by a positive {@code - * step}. If {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. + * (inclusive) to {@code endInclusive} (inclusive) by an incremental step of + * {@code 1}. * + * @apiNote *

        An equivalent sequence of increasing values can be produced * sequentially using a {@code for} loop as follows: *

        {@code
        -     *     for (int i = startInclusive; i < endExclusive ; i += step) { ... }
        +     *     for (int i = startInclusive; i <= endInclusive ; i++) { ... }
              * }
        * * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the positive difference between consecutive values + * @param endInclusive the inclusive upper bound * @return a sequential {@code IntStream} for the range of {@code int} * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0 */ - public static IntStream range(int startInclusive, int endExclusive, int step) { - if (step <= 0) { - throw new IllegalArgumentException(String.format("Illegal step: %d", step)); - } else if (startInclusive >= endExclusive) { + public static IntStream rangeClosed(int startInclusive, int endInclusive) { + if (startInclusive > endInclusive) { return empty(); } else { - return StreamSupport.intStream(new Streams.RangeIntSpliterator(startInclusive, endExclusive, step)); + return StreamSupport.intStream( + new Streams.RangeIntSpliterator(startInclusive, endInclusive, true)); } } } diff --git a/jdk/src/share/classes/java/util/stream/LongPipeline.java b/jdk/src/share/classes/java/util/stream/LongPipeline.java index 1a4da10b040..e52a5cade16 100644 --- a/jdk/src/share/classes/java/util/stream/LongPipeline.java +++ b/jdk/src/share/classes/java/util/stream/LongPipeline.java @@ -169,7 +169,7 @@ abstract class LongPipeline @Override public final PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -180,7 +180,7 @@ abstract class LongPipeline // Stateless intermediate ops from LongStream @Override - public final DoubleStream doubles() { + public final DoubleStream asDoubleStream() { return new DoublePipeline.StatelessOp(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -275,6 +275,12 @@ abstract class LongPipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedLong(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(long t) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it LongStream result = mapper.apply(t); @@ -306,6 +312,11 @@ abstract class LongPipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedLong(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + @Override public void accept(long t) { if (predicate.test(t)) @@ -479,7 +490,8 @@ abstract class LongPipeline @Override public final long[] toArray() { - return Nodes.flattenLong((Node.OfLong) evaluateToArrayNode(Long[]::new)).asLongArray(); + return Nodes.flattenLong((Node.OfLong) evaluateToArrayNode(Long[]::new)) + .asPrimitiveArray(); } diff --git a/jdk/src/share/classes/java/util/stream/LongStream.java b/jdk/src/share/classes/java/util/stream/LongStream.java index 22fae149baa..3bc0f76a494 100644 --- a/jdk/src/share/classes/java/util/stream/LongStream.java +++ b/jdk/src/share/classes/java/util/stream/LongStream.java @@ -625,7 +625,7 @@ public interface LongStream extends BaseStream { * @return a {@code DoubleStream} consisting of the elements of this stream, * converted to {@code double} */ - DoubleStream doubles(); + DoubleStream asDoubleStream(); /** * Returns a {@code Stream} consisting of the elements of this stream, @@ -736,26 +736,20 @@ public interface LongStream extends BaseStream { */ public static LongStream generate(LongSupplier s) { Objects.requireNonNull(s); - return StreamSupport.longStream(Spliterators.spliteratorUnknownSize( - new PrimitiveIterator.OfLong() { - @Override - public boolean hasNext() { return true; } - - @Override - public long nextLong() { return s.getAsLong(); } - }, - Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL)); + return StreamSupport.longStream( + new StreamSpliterators.InfiniteSupplyingSpliterator.OfLong(Long.MAX_VALUE, s)); } /** * Returns a sequential {@code LongStream} from {@code startInclusive} * (inclusive) to {@code endExclusive} (exclusive) by an incremental step of - * 1. + * {@code 1}. * - * @implSpec - * The implementation behaves as if: + * @apiNote + *

        An equivalent sequence of increasing values can be produced + * sequentially using a {@code for} loop as follows: *

        {@code
        -     *     longRange(startInclusive, endExclusive, 1);
        +     *     for (long i = startInclusive; i < endExclusive ; i++) { ... }
              * }
        * * @param startInclusive the (inclusive) initial value @@ -764,36 +758,56 @@ public interface LongStream extends BaseStream { * elements */ public static LongStream range(long startInclusive, final long endExclusive) { - return range(startInclusive, endExclusive, 1); + if (startInclusive >= endExclusive) { + return empty(); + } else if (endExclusive - startInclusive < 0) { + // Size of range > Long.MAX_VALUE + // Split the range in two and concatenate + // Note: if the range is [Long.MIN_VALUE, Long.MAX_VALUE) then + // the lower range, [Long.MIN_VALUE, 0) will be further split in two +// long m = startInclusive + Long.divideUnsigned(endExclusive - startInclusive, 2) + 1; +// return Streams.concat(range(startInclusive, m), range(m, endExclusive)); + // This is temporary until Streams.concat is supported + throw new UnsupportedOperationException(); + } else { + return StreamSupport.longStream( + new Streams.RangeLongSpliterator(startInclusive, endExclusive, false)); + } } /** * Returns a sequential {@code LongStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by {@code step}. If - * {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. + * (inclusive) to {@code endInclusive} (inclusive) by an incremental step of + * {@code 1}. * + * @apiNote *

        An equivalent sequence of increasing values can be produced * sequentially using a {@code for} loop as follows: *

        {@code
        -     *     for (long i = startInclusive; i < endExclusive ; i += step) { ... }
        +     *     for (long i = startInclusive; i <= endInclusive ; i++) { ... }
              * }
        * * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the difference between consecutive values + * @param endInclusive the inclusive upper bound * @return a sequential {@code LongStream} for the range of {@code long} * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0 */ - public static LongStream range(long startInclusive, final long endExclusive, final long step) { - if (step <= 0) { - throw new IllegalArgumentException(String.format("Illegal step: %d", step)); - } else if (startInclusive >= endExclusive) { + public static LongStream rangeClosed(long startInclusive, final long endInclusive) { + if (startInclusive > endInclusive) { return empty(); + } else if (endInclusive - startInclusive + 1 <= 0) { + // Size of range > Long.MAX_VALUE + // Split the range in two and concatenate + // Note: if the range is [Long.MIN_VALUE, Long.MAX_VALUE] then + // the lower range, [Long.MIN_VALUE, 0), and upper range, + // [0, Long.MAX_VALUE], will both be further split in two +// long m = startInclusive + Long.divideUnsigned(endInclusive - startInclusive, 2) + 1; +// return Streams.concat(range(startInclusive, m), rangeClosed(m, endInclusive)); + // This is temporary until Streams.concat is supported + throw new UnsupportedOperationException(); } else { - return StreamSupport.longStream(new Streams.RangeLongSpliterator(startInclusive, endExclusive, step)); + return StreamSupport.longStream( + new Streams.RangeLongSpliterator(startInclusive, endInclusive, true)); } } } diff --git a/jdk/src/share/classes/java/util/stream/Node.java b/jdk/src/share/classes/java/util/stream/Node.java index 528c3a6cca2..bf4c2c6340a 100644 --- a/jdk/src/share/classes/java/util/stream/Node.java +++ b/jdk/src/share/classes/java/util/stream/Node.java @@ -104,6 +104,32 @@ interface Node { throw new IndexOutOfBoundsException(); } + /** + * Return a node describing a subsequence of the elements of this node, + * starting at the given inclusive start offset and ending at the given + * exclusive end offset. + * + * @param from The (inclusive) starting offset of elements to include, must + * be in range 0..count(). + * @param to The (exclusive) end offset of elements to include, must be + * in range 0..count(). + * @param generator A function to be used to create a new array, if needed, + * for reference nodes. + * @return the truncated node + */ + default Node truncate(long from, long to, IntFunction generator) { + if (from == 0 && to == count()) + return this; + Spliterator spliterator = spliterator(); + long size = to - from; + Node.Builder nodeBuilder = Nodes.builder(size, generator); + nodeBuilder.begin(size); + for (int i = 0; i < from && spliterator.tryAdvance(e -> { }); i++) { } + for (int i = 0; (i < size) && spliterator.tryAdvance(nodeBuilder); i++) { } + nodeBuilder.end(); + return nodeBuilder.build(); + } + /** * Provides an array view of the contents of this node. * @@ -192,19 +218,90 @@ interface Node { } } - /** - * Specialized {@code Node} for int elements - */ - interface OfInt extends Node { + public interface OfPrimitive, + T_NODE extends OfPrimitive> + extends Node { /** * {@inheritDoc} * - * @return a {@link Spliterator.OfInt} describing the elements of this - * node + * @return a {@link Spliterator.OfPrimitive} describing the elements of + * this node */ @Override - Spliterator.OfInt spliterator(); + T_SPLITR spliterator(); + + /** + * Traverses the elements of this node, and invoke the provided + * {@code action} with each element. + * + * @param action a consumer that is to be invoked with each + * element in this {@code Node.OfPrimitive} + */ + void forEach(T_CONS action); + + @Override + default T_NODE getChild(int i) { + throw new IndexOutOfBoundsException(); + } + + T_NODE truncate(long from, long to, IntFunction generator); + + /** + * {@inheritDoc} + * + * @implSpec the default implementation invokes the generator to create + * an instance of a boxed primitive array with a length of + * {@link #count()} and then invokes {@link #copyInto(T[], int)} with + * that array at an offset of 0. + */ + @Override + default T[] asArray(IntFunction generator) { + T[] boxed = generator.apply((int) count()); + copyInto(boxed, 0); + return boxed; + } + + /** + * Views this node as a primitive array. + * + *

        Depending on the underlying implementation this may return a + * reference to an internal array rather than a copy. It is the callers + * responsibility to decide if either this node or the array is utilized + * as the primary reference for the data.

        + * + * @return an array containing the contents of this {@code Node} + */ + T_ARR asPrimitiveArray(); + + /** + * Creates a new primitive array. + * + * @param count the length of the primitive array. + * @return the new primitive array. + */ + T_ARR newArray(int count); + + /** + * Copies the content of this {@code Node} into a primitive array, + * starting at a given offset into the array. It is the caller's + * responsibility to ensure there is sufficient room in the array. + * + * @param array the array into which to copy the contents of this + * {@code Node} + * @param offset the starting offset within the array + * @throws IndexOutOfBoundsException if copying would cause access of + * data outside array bounds + * @throws NullPointerException if {@code array} is {@code null} + */ + void copyInto(T_ARR array, int offset); + } + + /** + * Specialized {@code Node} for int elements + */ + interface OfInt extends OfPrimitive { /** * {@inheritDoc} @@ -226,80 +323,43 @@ interface Node { } } - /** - * Traverses the elements of this node, and invoke the provided - * {@code IntConsumer} with each element. - * - * @param consumer a {@code IntConsumer} that is to be invoked with each - * element in this {@code Node} - */ - void forEach(IntConsumer consumer); - /** * {@inheritDoc} * - * @implSpec the default implementation invokes the generator to create - * an instance of an Integer[] array with a length of {@link #count()} - * and then invokes {@link #copyInto(Integer[], int)} with that - * Integer[] array at an offset of 0. This is not efficient and it is - * recommended to invoke {@link #asIntArray()}. - */ - @Override - default Integer[] asArray(IntFunction generator) { - Integer[] boxed = generator.apply((int) count()); - copyInto(boxed, 0); - return boxed; - } - - /** - * {@inheritDoc} - * - * @implSpec the default implementation invokes {@link #asIntArray()} to + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} to * obtain an int[] array then and copies the elements from that int[] * array into the boxed Integer[] array. This is not efficient and it - * is recommended to invoke {@link #copyInto(int[], int)}. + * is recommended to invoke {@link #copyInto(Object, int)}. */ @Override default void copyInto(Integer[] boxed, int offset) { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfInt.copyInto(Integer[], int)"); - int[] array = asIntArray(); + int[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } } @Override - default Node.OfInt getChild(int i) { - throw new IndexOutOfBoundsException(); + default Node.OfInt truncate(long from, long to, IntFunction generator) { + if (from == 0 && to == count()) + return this; + long size = to - from; + Spliterator.OfInt spliterator = spliterator(); + Node.Builder.OfInt nodeBuilder = Nodes.intBuilder(size); + nodeBuilder.begin(size); + for (int i = 0; i < from && spliterator.tryAdvance((IntConsumer) e -> { }); i++) { } + for (int i = 0; (i < size) && spliterator.tryAdvance((IntConsumer) nodeBuilder); i++) { } + nodeBuilder.end(); + return nodeBuilder.build(); } - /** - * Views this node as an int[] array. - * - *

        Depending on the underlying implementation this may return a - * reference to an internal array rather than a copy. It is the callers - * responsibility to decide if either this node or the array is utilized - * as the primary reference for the data.

        - * - * @return an array containing the contents of this {@code Node} - */ - int[] asIntArray(); - - /** - * Copies the content of this {@code Node} into an int[] array, starting - * at a given offset into the array. It is the caller's responsibility - * to ensure there is sufficient room in the array. - * - * @param array the array into which to copy the contents of this - * {@code Node} - * @param offset the starting offset within the array - * @throws IndexOutOfBoundsException if copying would cause access of - * data outside array bounds - * @throws NullPointerException if {@code array} is {@code null} - */ - void copyInto(int[] array, int offset); + @Override + default int[] newArray(int count) { + return new int[count]; + } /** * {@inheritDoc} @@ -309,22 +369,12 @@ interface Node { default StreamShape getShape() { return StreamShape.INT_VALUE; } - } /** * Specialized {@code Node} for long elements */ - interface OfLong extends Node { - - /** - * {@inheritDoc} - * - * @return a {@link Spliterator.OfLong} describing the elements of this - * node - */ - @Override - Spliterator.OfLong spliterator(); + interface OfLong extends OfPrimitive { /** * {@inheritDoc} @@ -346,80 +396,43 @@ interface Node { } } - /** - * Traverses the elements of this node, and invoke the provided - * {@code LongConsumer} with each element. - * - * @param consumer a {@code LongConsumer} that is to be invoked with - * each element in this {@code Node} - */ - void forEach(LongConsumer consumer); - /** * {@inheritDoc} * - * @implSpec the default implementation invokes the generator to create - * an instance of a Long[] array with a length of {@link #count()} and - * then invokes {@link #copyInto(Long[], int)} with that Long[] array at - * an offset of 0. This is not efficient and it is recommended to - * invoke {@link #asLongArray()}. - */ - @Override - default Long[] asArray(IntFunction generator) { - Long[] boxed = generator.apply((int) count()); - copyInto(boxed, 0); - return boxed; - } - - /** - * {@inheritDoc} - * - * @implSpec the default implementation invokes {@link #asLongArray()} + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} * to obtain a long[] array then and copies the elements from that * long[] array into the boxed Long[] array. This is not efficient and - * it is recommended to invoke {@link #copyInto(long[], int)}. + * it is recommended to invoke {@link #copyInto(Object, int)}. */ @Override default void copyInto(Long[] boxed, int offset) { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfInt.copyInto(Long[], int)"); - long[] array = asLongArray(); + long[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } } @Override - default Node.OfLong getChild(int i) { - throw new IndexOutOfBoundsException(); + default Node.OfLong truncate(long from, long to, IntFunction generator) { + if (from == 0 && to == count()) + return this; + long size = to - from; + Spliterator.OfLong spliterator = spliterator(); + Node.Builder.OfLong nodeBuilder = Nodes.longBuilder(size); + nodeBuilder.begin(size); + for (int i = 0; i < from && spliterator.tryAdvance((LongConsumer) e -> { }); i++) { } + for (int i = 0; (i < size) && spliterator.tryAdvance((LongConsumer) nodeBuilder); i++) { } + nodeBuilder.end(); + return nodeBuilder.build(); } - /** - * Views this node as a long[] array. - * - *

        Depending on the underlying implementation this may return a - * reference to an internal array rather than a copy. It is the callers - * responsibility to decide if either this node or the array is utilized - * as the primary reference for the data. - * - * @return an array containing the contents of this {@code Node} - */ - long[] asLongArray(); - - /** - * Copies the content of this {@code Node} into a long[] array, starting - * at a given offset into the array. It is the caller's responsibility - * to ensure there is sufficient room in the array. - * - * @param array the array into which to copy the contents of this - * {@code Node} - * @param offset the starting offset within the array - * @throws IndexOutOfBoundsException if copying would cause access of - * data outside array bounds - * @throws NullPointerException if {@code array} is {@code null} - */ - void copyInto(long[] array, int offset); + @Override + default long[] newArray(int count) { + return new long[count]; + } /** * {@inheritDoc} @@ -429,23 +442,12 @@ interface Node { default StreamShape getShape() { return StreamShape.LONG_VALUE; } - - } /** * Specialized {@code Node} for double elements */ - interface OfDouble extends Node { - - /** - * {@inheritDoc} - * - * @return A {@link Spliterator.OfDouble} describing the elements of - * this node - */ - @Override - Spliterator.OfDouble spliterator(); + interface OfDouble extends OfPrimitive { /** * {@inheritDoc} @@ -467,82 +469,45 @@ interface Node { } } - /** - * Traverses the elements of this node, and invoke the provided - * {@code DoubleConsumer} with each element. - * - * @param consumer A {@code DoubleConsumer} that is to be invoked with - * each element in this {@code Node} - */ - void forEach(DoubleConsumer consumer); - // /** * {@inheritDoc} * - * @implSpec the default implementation invokes the generator to create - * an instance of a Double[] array with a length of {@link #count()} and - * then invokes {@link #copyInto(Double[], int)} with that Double[] - * array at an offset of 0. This is not efficient and it is recommended - * to invoke {@link #asDoubleArray()}. - */ - @Override - default Double[] asArray(IntFunction generator) { - Double[] boxed = generator.apply((int) count()); - copyInto(boxed, 0); - return boxed; - } - - /** - * {@inheritDoc} - * - * @implSpec the default implementation invokes {@link #asDoubleArray()} + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} * to obtain a double[] array then and copies the elements from that * double[] array into the boxed Double[] array. This is not efficient - * and it is recommended to invoke {@link #copyInto(double[], int)}. + * and it is recommended to invoke {@link #copyInto(Object, int)}. */ @Override default void copyInto(Double[] boxed, int offset) { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfDouble.copyInto(Double[], int)"); - double[] array = asDoubleArray(); + double[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } } @Override - default Node.OfDouble getChild(int i) { - throw new IndexOutOfBoundsException(); + default Node.OfDouble truncate(long from, long to, IntFunction generator) { + if (from == 0 && to == count()) + return this; + long size = to - from; + Spliterator.OfDouble spliterator = spliterator(); + Node.Builder.OfDouble nodeBuilder = Nodes.doubleBuilder(size); + nodeBuilder.begin(size); + for (int i = 0; i < from && spliterator.tryAdvance((DoubleConsumer) e -> { }); i++) { } + for (int i = 0; (i < size) && spliterator.tryAdvance((DoubleConsumer) nodeBuilder); i++) { } + nodeBuilder.end(); + return nodeBuilder.build(); } - /** - * Views this node as a double[] array. - * - *

        Depending on the underlying implementation this may return a - * reference to an internal array rather than a copy. It is the callers - * responsibility to decide if either this node or the array is utilized - * as the primary reference for the data. - * - * @return an array containing the contents of this {@code Node} - */ - double[] asDoubleArray(); - - /** - * Copies the content of this {@code Node} into a double[] array, starting - * at a given offset into the array. It is the caller's responsibility - * to ensure there is sufficient room in the array. - * - * @param array the array into which to copy the contents of this - * {@code Node} - * @param offset the starting offset within the array - * @throws IndexOutOfBoundsException if copying would cause access of - * data outside array bounds - * @throws NullPointerException if {@code array} is {@code null} - */ - void copyInto(double[] array, int offset); + @Override + default double[] newArray(int count) { + return new double[count]; + } /** * {@inheritDoc} diff --git a/jdk/src/share/classes/java/util/stream/Nodes.java b/jdk/src/share/classes/java/util/stream/Nodes.java index 57e8a7c070c..f79a88c470b 100644 --- a/jdk/src/share/classes/java/util/stream/Nodes.java +++ b/jdk/src/share/classes/java/util/stream/Nodes.java @@ -33,11 +33,13 @@ import java.util.Objects; import java.util.Spliterator; import java.util.Spliterators; import java.util.concurrent.CountedCompleter; +import java.util.function.BinaryOperator; import java.util.function.Consumer; import java.util.function.DoubleConsumer; import java.util.function.IntConsumer; import java.util.function.IntFunction; import java.util.function.LongConsumer; +import java.util.function.LongFunction; /** * Factory methods for constructing implementations of {@link Node} and @@ -97,131 +99,28 @@ final class Nodes { * * @param the type of elements of the concatenated node * @param shape the shape of the concatenated node to be created - * @param nodes the input nodes + * @param left the left input node + * @param right the right input node * @return a {@code Node} covering the elements of the input nodes * @throws IllegalStateException if all {@link Node} elements of the list * are an not instance of type supported by this factory. */ @SuppressWarnings("unchecked") - static Node conc(StreamShape shape, List> nodes) { - int size = nodes.size(); - if (size == 0) - return emptyNode(shape); - else if (size == 1) - return nodes.get(0); - else { - // Create a right-balanced tree when there are more that 2 nodes - switch (shape) { - case REFERENCE: { - List> refNodes = (List>) nodes; - ConcNode c = new ConcNode<>(refNodes.get(size - 2), refNodes.get(size - 1)); - for (int i = size - 3; i >= 0; i--) { - c = new ConcNode<>(refNodes.get(i), c); - } - return c; - } - case INT_VALUE: { - List intNodes = (List) nodes; - IntConcNode c = new IntConcNode(intNodes.get(size - 2), intNodes.get(size - 1)); - for (int i = size - 3; i >= 0; i--) { - c = new IntConcNode(intNodes.get(i), c); - } - return (Node) c; - } - case LONG_VALUE: { - List longNodes = (List) nodes; - LongConcNode c = new LongConcNode(longNodes.get(size - 2), longNodes.get(size - 1)); - for (int i = size - 3; i >= 0; i--) { - c = new LongConcNode(longNodes.get(i), c); - } - return (Node) c; - } - case DOUBLE_VALUE: { - List doubleNodes = (List) nodes; - DoubleConcNode c = new DoubleConcNode(doubleNodes.get(size - 2), doubleNodes.get(size - 1)); - for (int i = size - 3; i >= 0; i--) { - c = new DoubleConcNode(doubleNodes.get(i), c); - } - return (Node) c; - } - default: - throw new IllegalStateException("Unknown shape " + shape); - } - } - - } - - /** - * Truncate a {@link Node}, returning a node describing a subsequence of - * the contents of the input node. - * - * @param the type of elements of the input node and truncated node - * @param input the input node - * @param from the starting offset to include in the truncated node (inclusive) - * @param to the ending offset ot include in the truncated node (exclusive) - * @param generator the array factory (only used for reference nodes) - * @return the truncated node - */ - @SuppressWarnings("unchecked") - static Node truncateNode(Node input, long from, long to, IntFunction generator) { - StreamShape shape = input.getShape(); - long size = truncatedSize(input.count(), from, to); - if (size == 0) - return emptyNode(shape); - else if (from == 0 && to >= input.count()) - return input; - + static Node conc(StreamShape shape, Node left, Node right) { switch (shape) { - case REFERENCE: { - Spliterator spliterator = input.spliterator(); - Node.Builder nodeBuilder = Nodes.builder(size, generator); - nodeBuilder.begin(size); - for (int i = 0; i < from && spliterator.tryAdvance(e -> { }); i++) { } - for (int i = 0; (i < size) && spliterator.tryAdvance(nodeBuilder); i++) { } - nodeBuilder.end(); - return nodeBuilder.build(); - } - case INT_VALUE: { - Spliterator.OfInt spliterator = ((Node.OfInt) input).spliterator(); - Node.Builder.OfInt nodeBuilder = Nodes.intBuilder(size); - nodeBuilder.begin(size); - for (int i = 0; i < from && spliterator.tryAdvance((IntConsumer) e -> { }); i++) { } - for (int i = 0; (i < size) && spliterator.tryAdvance((IntConsumer) nodeBuilder); i++) { } - nodeBuilder.end(); - return (Node) nodeBuilder.build(); - } - case LONG_VALUE: { - Spliterator.OfLong spliterator = ((Node.OfLong) input).spliterator(); - Node.Builder.OfLong nodeBuilder = Nodes.longBuilder(size); - nodeBuilder.begin(size); - for (int i = 0; i < from && spliterator.tryAdvance((LongConsumer) e -> { }); i++) { } - for (int i = 0; (i < size) && spliterator.tryAdvance((LongConsumer) nodeBuilder); i++) { } - nodeBuilder.end(); - return (Node) nodeBuilder.build(); - } - case DOUBLE_VALUE: { - Spliterator.OfDouble spliterator = ((Node.OfDouble) input).spliterator(); - Node.Builder.OfDouble nodeBuilder = Nodes.doubleBuilder(size); - nodeBuilder.begin(size); - for (int i = 0; i < from && spliterator.tryAdvance((DoubleConsumer) e -> { }); i++) { } - for (int i = 0; (i < size) && spliterator.tryAdvance((DoubleConsumer) nodeBuilder); i++) { } - nodeBuilder.end(); - return (Node) nodeBuilder.build(); - } + case REFERENCE: + return new ConcNode<>(left, right); + case INT_VALUE: + return (Node) new ConcNode.OfInt((Node.OfInt) left, (Node.OfInt) right); + case LONG_VALUE: + return (Node) new ConcNode.OfLong((Node.OfLong) left, (Node.OfLong) right); + case DOUBLE_VALUE: + return (Node) new ConcNode.OfDouble((Node.OfDouble) left, (Node.OfDouble) right); default: throw new IllegalStateException("Unknown shape " + shape); } } - private static long truncatedSize(long size, long from, long to) { - if (from >= 0) - size = Math.max(0, size - from); - long limit = to - from; - if (limit >= 0) - size = Math.min(size, limit); - return size; - } - // Reference-based node methods /** @@ -422,7 +321,7 @@ final class Nodes { new SizedCollectorTask.OfRef<>(spliterator, helper, array).invoke(); return node(array); } else { - Node node = new CollectorTask<>(helper, generator, spliterator).invoke(); + Node node = new CollectorTask.OfRef<>(helper, generator, spliterator).invoke(); return flattenTree ? flatten(node, generator) : node; } } @@ -460,7 +359,7 @@ final class Nodes { return node(array); } else { - Node.OfInt node = new IntCollectorTask<>(helper, spliterator).invoke(); + Node.OfInt node = new CollectorTask.OfInt<>(helper, spliterator).invoke(); return flattenTree ? flattenInt(node) : node; } } @@ -498,7 +397,7 @@ final class Nodes { return node(array); } else { - Node.OfLong node = new LongCollectorTask<>(helper, spliterator).invoke(); + Node.OfLong node = new CollectorTask.OfLong<>(helper, spliterator).invoke(); return flattenTree ? flattenLong(node) : node; } } @@ -536,7 +435,7 @@ final class Nodes { return node(array); } else { - Node.OfDouble node = new DoubleCollectorTask<>(helper, spliterator).invoke(); + Node.OfDouble node = new CollectorTask.OfDouble<>(helper, spliterator).invoke(); return flattenTree ? flattenDouble(node) : node; } } @@ -679,7 +578,7 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { return EMPTY_INT_ARRAY; } } @@ -696,7 +595,7 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { return EMPTY_LONG_ARRAY; } } @@ -713,7 +612,7 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { return EMPTY_DOUBLE_ARRAY; } } @@ -763,8 +662,6 @@ final class Nodes { return curSize; } - // Traversable - @Override public void forEach(Consumer consumer) { for (int i = 0; i < curSize; i++) { @@ -829,13 +726,12 @@ final class Nodes { /** * Node class for an internal node with two or more children */ - static final class ConcNode implements Node { - private final Node left; - private final Node right; - + private static abstract class AbstractConcNode> implements Node { + protected final T_NODE left; + protected final T_NODE right; private final long size; - ConcNode(Node left, Node right) { + AbstractConcNode(T_NODE left, T_NODE right) { this.left = left; this.right = right; // The Node count will be required when the Node spliterator is @@ -845,25 +741,37 @@ final class Nodes { this.size = left.count() + right.count(); } - // Node - - @Override - public Spliterator spliterator() { - return new Nodes.InternalNodeSpliterator.OfRef<>(this); - } - @Override public int getChildCount() { return 2; } @Override - public Node getChild(int i) { + public T_NODE getChild(int i) { if (i == 0) return left; if (i == 1) return right; throw new IndexOutOfBoundsException(); } + @Override + public long count() { + return size; + } + } + + static final class ConcNode + extends AbstractConcNode> + implements Node { + + ConcNode(Node left, Node right) { + super(left, right); + } + + @Override + public Spliterator spliterator() { + return new Nodes.InternalNodeSpliterator.OfRef<>(this); + } + @Override public void copyInto(T[] array, int offset) { Objects.requireNonNull(array); @@ -878,17 +786,27 @@ final class Nodes { return array; } - @Override - public long count() { - return size; - } - @Override public void forEach(Consumer consumer) { left.forEach(consumer); right.forEach(consumer); } + @Override + public Node truncate(long from, long to, IntFunction generator) { + if (from == 0 && to == count()) + return this; + long leftCount = left.count(); + if (from >= leftCount) + return right.truncate(from - leftCount, to - leftCount, generator); + else if (to <= leftCount) + return left.truncate(from, to, generator); + else { + return Nodes.conc(getShape(), left.truncate(from, leftCount, generator), + right.truncate(0, to - leftCount, generator)); + } + } + @Override public String toString() { if (count() < 32) { @@ -897,12 +815,92 @@ final class Nodes { return String.format("ConcNode[size=%d]", count()); } } + + private abstract static class OfPrimitive, + T_NODE extends Node.OfPrimitive> + extends AbstractConcNode + implements Node.OfPrimitive { + + OfPrimitive(T_NODE left, T_NODE right) { + super(left, right); + } + + @Override + public void forEach(T_CONS consumer) { + left.forEach(consumer); + right.forEach(consumer); + } + + @Override + public void copyInto(T_ARR array, int offset) { + left.copyInto(array, offset); + right.copyInto(array, offset + (int) left.count()); + } + + @Override + public T_ARR asPrimitiveArray() { + T_ARR array = newArray((int) count()); + copyInto(array, 0); + return array; + } + + @Override + public String toString() { + if (count() < 32) + return String.format("%s[%s.%s]", this.getClass().getName(), left, right); + else + return String.format("%s[size=%d]", this.getClass().getName(), count()); + } + } + + static final class OfInt + extends ConcNode.OfPrimitive + implements Node.OfInt { + + OfInt(Node.OfInt left, Node.OfInt right) { + super(left, right); + } + + @Override + public Spliterator.OfInt spliterator() { + return new InternalNodeSpliterator.OfInt(this); + } + } + + static final class OfLong + extends ConcNode.OfPrimitive + implements Node.OfLong { + + OfLong(Node.OfLong left, Node.OfLong right) { + super(left, right); + } + + @Override + public Spliterator.OfLong spliterator() { + return new InternalNodeSpliterator.OfLong(this); + } + } + + static final class OfDouble + extends ConcNode.OfPrimitive + implements Node.OfDouble { + + OfDouble(Node.OfDouble left, Node.OfDouble right) { + super(left, right); + } + + @Override + public Spliterator.OfDouble spliterator() { + return new InternalNodeSpliterator.OfDouble(this); + } + } } /** Abstract class for spliterator for all internal node classes */ private static abstract class InternalNodeSpliterator, - N extends Node, C> + N extends Node> implements Spliterator { // Node we are pointing to // null if full traversal has occurred @@ -960,7 +958,7 @@ final class Nodes { return null; } - protected final boolean internalTryAdvance(C consumer) { + protected final boolean initTryAdvance() { if (curNode == null) return false; @@ -981,29 +979,12 @@ final class Nodes { else tryAdvanceSpliterator = lastNodeSpliterator; } - - boolean hasNext = tryAdvance(tryAdvanceSpliterator, consumer); - if (!hasNext) { - if (lastNodeSpliterator == null) { - // Advance to the spliterator of the next non-empty leaf node - Node leaf = findNextLeafNode(tryAdvanceStack); - if (leaf != null) { - tryAdvanceSpliterator = (S) leaf.spliterator(); - // Since the node is not-empty the spliterator can be advanced - return tryAdvance(tryAdvanceSpliterator, consumer); - } - } - // No more elements to traverse - curNode = null; - } - return hasNext; + return true; } - protected abstract boolean tryAdvance(S spliterator, C consumer); - @Override @SuppressWarnings("unchecked") - public S trySplit() { + public final S trySplit() { if (curNode == null || tryAdvanceSpliterator != null) return null; // Cannot split if fully or partially traversed else if (lastNodeSpliterator != null) @@ -1024,7 +1005,7 @@ final class Nodes { } @Override - public long estimateSize() { + public final long estimateSize() { if (curNode == null) return 0; @@ -1041,12 +1022,12 @@ final class Nodes { } @Override - public int characteristics() { + public final int characteristics() { return Spliterator.SIZED; } private static final class OfRef - extends InternalNodeSpliterator, Node, Consumer> { + extends InternalNodeSpliterator, Node> { OfRef(Node curNode) { super(curNode); @@ -1054,13 +1035,24 @@ final class Nodes { @Override public boolean tryAdvance(Consumer consumer) { - return internalTryAdvance(consumer); - } + if (!initTryAdvance()) + return false; - @Override - protected boolean tryAdvance(Spliterator spliterator, - Consumer consumer) { - return spliterator.tryAdvance(consumer); + boolean hasNext = tryAdvanceSpliterator.tryAdvance(consumer); + if (!hasNext) { + if (lastNodeSpliterator == null) { + // Advance to the spliterator of the next non-empty leaf node + Node leaf = findNextLeafNode(tryAdvanceStack); + if (leaf != null) { + tryAdvanceSpliterator = leaf.spliterator(); + // Since the node is not-empty the spliterator can be advanced + return tryAdvanceSpliterator.tryAdvance(consumer); + } + } + // No more elements to traverse + curNode = null; + } + return hasNext; } @Override @@ -1085,127 +1077,85 @@ final class Nodes { } } + private static abstract class OfPrimitive, + N extends Node.OfPrimitive> + extends InternalNodeSpliterator + implements Spliterator.OfPrimitive { + + OfPrimitive(N cur) { + super(cur); + } + + @Override + public boolean tryAdvance(T_CONS consumer) { + if (!initTryAdvance()) + return false; + + boolean hasNext = tryAdvanceSpliterator.tryAdvance(consumer); + if (!hasNext) { + if (lastNodeSpliterator == null) { + // Advance to the spliterator of the next non-empty leaf node + N leaf = findNextLeafNode(tryAdvanceStack); + if (leaf != null) { + tryAdvanceSpliterator = leaf.spliterator(); + // Since the node is not-empty the spliterator can be advanced + return tryAdvanceSpliterator.tryAdvance(consumer); + } + } + // No more elements to traverse + curNode = null; + } + return hasNext; + } + + @Override + public void forEachRemaining(T_CONS consumer) { + if (curNode == null) + return; + + if (tryAdvanceSpliterator == null) { + if (lastNodeSpliterator == null) { + Deque stack = initStack(); + N leaf; + while ((leaf = findNextLeafNode(stack)) != null) { + leaf.forEach(consumer); + } + curNode = null; + } + else + lastNodeSpliterator.forEachRemaining(consumer); + } + else + while(tryAdvance(consumer)) { } + } + } + private static final class OfInt - extends InternalNodeSpliterator + extends OfPrimitive implements Spliterator.OfInt { OfInt(Node.OfInt cur) { super(cur); } - - @Override - public boolean tryAdvance(IntConsumer consumer) { - return internalTryAdvance(consumer); - } - - @Override - protected boolean tryAdvance(Spliterator.OfInt spliterator, - IntConsumer consumer) { - return spliterator.tryAdvance(consumer); - } - - @Override - public void forEachRemaining(IntConsumer consumer) { - if (curNode == null) - return; - - if (tryAdvanceSpliterator == null) { - if (lastNodeSpliterator == null) { - Deque stack = initStack(); - Node.OfInt leaf; - while ((leaf = findNextLeafNode(stack)) != null) { - leaf.forEach(consumer); - } - curNode = null; - } - else - lastNodeSpliterator.forEachRemaining(consumer); - } - else - while(tryAdvance(consumer)) { } - } } private static final class OfLong - extends InternalNodeSpliterator + extends OfPrimitive implements Spliterator.OfLong { OfLong(Node.OfLong cur) { super(cur); } - - @Override - public boolean tryAdvance(LongConsumer consumer) { - return internalTryAdvance(consumer); - } - - @Override - protected boolean tryAdvance(Spliterator.OfLong spliterator, - LongConsumer consumer) { - return spliterator.tryAdvance(consumer); - } - - @Override - public void forEachRemaining(LongConsumer consumer) { - if (curNode == null) - return; - - if (tryAdvanceSpliterator == null) { - if (lastNodeSpliterator == null) { - Deque stack = initStack(); - Node.OfLong leaf; - while ((leaf = findNextLeafNode(stack)) != null) { - leaf.forEach(consumer); - } - curNode = null; - } - else - lastNodeSpliterator.forEachRemaining(consumer); - } - else - while(tryAdvance(consumer)) { } - } } private static final class OfDouble - extends InternalNodeSpliterator + extends OfPrimitive implements Spliterator.OfDouble { OfDouble(Node.OfDouble cur) { super(cur); } - - @Override - public boolean tryAdvance(DoubleConsumer consumer) { - return internalTryAdvance(consumer); - } - - @Override - protected boolean tryAdvance(Spliterator.OfDouble spliterator, - DoubleConsumer consumer) { - return spliterator.tryAdvance(consumer); - } - - @Override - public void forEachRemaining(DoubleConsumer consumer) { - if (curNode == null) - return; - - if (tryAdvanceSpliterator == null) { - if (lastNodeSpliterator == null) { - Deque stack = initStack(); - Node.OfDouble leaf; - while ((leaf = findNextLeafNode(stack)) != null) { - leaf.forEach(consumer); - } - curNode = null; - } - else - lastNodeSpliterator.forEachRemaining(consumer); - } - else - while(tryAdvance(consumer)) { } - } } } @@ -1330,47 +1280,6 @@ final class Nodes { private static final long[] EMPTY_LONG_ARRAY = new long[0]; private static final double[] EMPTY_DOUBLE_ARRAY = new double[0]; - private abstract static class AbstractPrimitiveConcNode> - implements Node { - final N left; - final N right; - final long size; - - AbstractPrimitiveConcNode(N left, N right) { - this.left = left; - this.right = right; - // The Node count will be required when the Node spliterator is - // obtained and it is cheaper to aggressively calculate bottom up as - // the tree is built rather than later on by traversing the tree - this.size = left.count() + right.count(); - } - - @Override - public int getChildCount() { - return 2; - } - - @Override - public N getChild(int i) { - if (i == 0) return left; - if (i == 1) return right; - throw new IndexOutOfBoundsException(); - } - - @Override - public long count() { - return size; - } - - @Override - public String toString() { - if (count() < 32) - return String.format("%s[%s.%s]", this.getClass().getName(), left, right); - else - return String.format("%s[size=%d]", this.getClass().getName(), count()); - } - } - private static class IntArrayNode implements Node.OfInt { final int[] array; int curSize; @@ -1395,7 +1304,7 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1449,7 +1358,7 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1503,7 +1412,7 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1535,105 +1444,6 @@ final class Nodes { } } - static final class IntConcNode - extends AbstractPrimitiveConcNode - implements Node.OfInt { - - IntConcNode(Node.OfInt left, Node.OfInt right) { - super(left, right); - } - - @Override - public void forEach(IntConsumer consumer) { - left.forEach(consumer); - right.forEach(consumer); - } - - @Override - public Spliterator.OfInt spliterator() { - return new InternalNodeSpliterator.OfInt(this); - } - - @Override - public void copyInto(int[] array, int offset) { - left.copyInto(array, offset); - right.copyInto(array, offset + (int) left.count()); - } - - @Override - public int[] asIntArray() { - int[] array = new int[(int) count()]; - copyInto(array, 0); - return array; - } - } - - static final class LongConcNode - extends AbstractPrimitiveConcNode - implements Node.OfLong { - - LongConcNode(Node.OfLong left, Node.OfLong right) { - super(left, right); - } - - @Override - public void forEach(LongConsumer consumer) { - left.forEach(consumer); - right.forEach(consumer); - } - - @Override - public Spliterator.OfLong spliterator() { - return new InternalNodeSpliterator.OfLong(this); - } - - @Override - public void copyInto(long[] array, int offset) { - left.copyInto(array, offset); - right.copyInto(array, offset + (int) left.count()); - } - - @Override - public long[] asLongArray() { - long[] array = new long[(int) count()]; - copyInto(array, 0); - return array; - } - } - - static final class DoubleConcNode - extends AbstractPrimitiveConcNode - implements Node.OfDouble { - - DoubleConcNode(Node.OfDouble left, Node.OfDouble right) { - super(left, right); - } - - @Override - public void forEach(DoubleConsumer consumer) { - left.forEach(consumer); - right.forEach(consumer); - } - - @Override - public Spliterator.OfDouble spliterator() { - return new InternalNodeSpliterator.OfDouble(this); - } - - @Override - public void copyInto(double[] array, int offset) { - left.copyInto(array, offset); - right.copyInto(array, offset + (int) left.count()); - } - - @Override - public double[] asDoubleArray() { - double[] array = new double[(int) count()]; - copyInto(array, 0); - return array; - } - } - private static final class IntFixedNodeBuilder extends IntArrayNode implements Node.Builder.OfInt { @@ -1844,9 +1654,9 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { assert !building : "during building"; - return super.asIntArray(); + return super.asPrimitiveArray(); } @Override @@ -1904,9 +1714,9 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { assert !building : "during building"; - return super.asLongArray(); + return super.asPrimitiveArray(); } @Override @@ -1964,9 +1774,9 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { assert !building : "during building"; - return super.asDoubleArray(); + return super.asPrimitiveArray(); } @Override @@ -2245,23 +2055,25 @@ final class Nodes { } } - private static final class OfInt - extends ToArrayTask { - private final int[] array; + private static class OfPrimitive, + T_NODE extends Node.OfPrimitive> + extends ToArrayTask> { + private final T_ARR array; - private OfInt(Node.OfInt node, int[] array, int offset) { + private OfPrimitive(T_NODE node, T_ARR array, int offset) { super(node, offset); this.array = array; } - private OfInt(OfInt parent, Node.OfInt node, int offset) { + private OfPrimitive(OfPrimitive parent, T_NODE node, int offset) { super(parent, node, offset); this.array = parent.array; } @Override - OfInt makeChild(int childIndex, int offset) { - return new OfInt(this, node.getChild(childIndex), offset); + OfPrimitive makeChild(int childIndex, int offset) { + return new OfPrimitive<>(this, node.getChild(childIndex), offset); } @Override @@ -2270,198 +2082,98 @@ final class Nodes { } } + private static final class OfInt + extends OfPrimitive { + private OfInt(Node.OfInt node, int[] array, int offset) { + super(node, array, offset); + } + } + private static final class OfLong - extends ToArrayTask { - private final long[] array; - + extends OfPrimitive { private OfLong(Node.OfLong node, long[] array, int offset) { - super(node, offset); - this.array = array; - } - - private OfLong(OfLong parent, Node.OfLong node, int offset) { - super(parent, node, offset); - this.array = parent.array; - } - - @Override - OfLong makeChild(int childIndex, int offset) { - return new OfLong(this, node.getChild(childIndex), offset); - } - - @Override - void copyNodeToArray() { - node.copyInto(array, offset); + super(node, array, offset); } } private static final class OfDouble - extends ToArrayTask { - private final double[] array; - + extends OfPrimitive { private OfDouble(Node.OfDouble node, double[] array, int offset) { - super(node, offset); - this.array = array; - } - - private OfDouble(OfDouble parent, Node.OfDouble node, int offset) { - super(parent, node, offset); - this.array = parent.array; - } - - @Override - OfDouble makeChild(int childIndex, int offset) { - return new OfDouble(this, node.getChild(childIndex), offset); - } - - @Override - void copyNodeToArray() { - node.copyInto(array, offset); + super(node, array, offset); } } } - private static final class CollectorTask - extends AbstractTask, CollectorTask> { - private final PipelineHelper helper; - private final IntFunction generator; + private static class CollectorTask, T_BUILDER extends Node.Builder> + extends AbstractTask> { + protected final PipelineHelper helper; + protected final LongFunction builderFactory; + protected final BinaryOperator concFactory; CollectorTask(PipelineHelper helper, - IntFunction generator, - Spliterator spliterator) { + Spliterator spliterator, + LongFunction builderFactory, + BinaryOperator concFactory) { super(helper, spliterator); this.helper = helper; - this.generator = generator; + this.builderFactory = builderFactory; + this.concFactory = concFactory; } - CollectorTask(CollectorTask parent, Spliterator spliterator) { + CollectorTask(CollectorTask parent, + Spliterator spliterator) { super(parent, spliterator); helper = parent.helper; - generator = parent.generator; + builderFactory = parent.builderFactory; + concFactory = parent.concFactory; } @Override - protected CollectorTask makeChild(Spliterator spliterator) { + protected CollectorTask makeChild(Spliterator spliterator) { return new CollectorTask<>(this, spliterator); } @Override - protected Node doLeaf() { - Node.Builder builder - = builder(helper.exactOutputSizeIfKnown(spliterator), - generator); - return helper.wrapAndCopyInto(builder, spliterator).build(); + protected T_NODE doLeaf() { + T_BUILDER builder = builderFactory.apply(helper.exactOutputSizeIfKnown(spliterator)); + return (T_NODE) helper.wrapAndCopyInto(builder, spliterator).build(); } @Override public void onCompletion(CountedCompleter caller) { - if (!isLeaf()) { - setLocalResult(new ConcNode<>(leftChild.getLocalResult(), rightChild.getLocalResult())); - } + if (!isLeaf()) + setLocalResult(concFactory.apply(leftChild.getLocalResult(), rightChild.getLocalResult())); super.onCompletion(caller); } - } - private static final class IntCollectorTask - extends AbstractTask> { - private final PipelineHelper helper; - - IntCollectorTask(PipelineHelper helper, Spliterator spliterator) { - super(helper, spliterator); - this.helper = helper; - } - - IntCollectorTask(IntCollectorTask parent, Spliterator spliterator) { - super(parent, spliterator); - helper = parent.helper; - } - - @Override - protected IntCollectorTask makeChild(Spliterator spliterator) { - return new IntCollectorTask<>(this, spliterator); - } - - @Override - protected Node.OfInt doLeaf() { - Node.Builder.OfInt builder = intBuilder(helper.exactOutputSizeIfKnown(spliterator)); - return helper.wrapAndCopyInto(builder, spliterator).build(); - } - - @Override - public void onCompletion(CountedCompleter caller) { - if (!isLeaf()) { - setLocalResult(new IntConcNode(leftChild.getLocalResult(), rightChild.getLocalResult())); + private static final class OfRef + extends CollectorTask, Node.Builder> { + OfRef(PipelineHelper helper, + IntFunction generator, + Spliterator spliterator) { + super(helper, spliterator, s -> builder(s, generator), ConcNode::new); } - super.onCompletion(caller); - } - } - - private static final class LongCollectorTask - extends AbstractTask> { - private final PipelineHelper helper; - - LongCollectorTask(PipelineHelper helper, Spliterator spliterator) { - super(helper, spliterator); - this.helper = helper; } - LongCollectorTask(LongCollectorTask parent, Spliterator spliterator) { - super(parent, spliterator); - helper = parent.helper; - } - - @Override - protected LongCollectorTask makeChild(Spliterator spliterator) { - return new LongCollectorTask<>(this, spliterator); - } - - @Override - protected Node.OfLong doLeaf() { - Node.Builder.OfLong builder = longBuilder(helper.exactOutputSizeIfKnown(spliterator)); - return helper.wrapAndCopyInto(builder, spliterator).build(); - } - - @Override - public void onCompletion(CountedCompleter caller) { - if (!isLeaf()) { - setLocalResult(new LongConcNode(leftChild.getLocalResult(), rightChild.getLocalResult())); + private static final class OfInt + extends CollectorTask { + OfInt(PipelineHelper helper, Spliterator spliterator) { + super(helper, spliterator, Nodes::intBuilder, ConcNode.OfInt::new); } - super.onCompletion(caller); - } - } - - private static final class DoubleCollectorTask - extends AbstractTask> { - private final PipelineHelper helper; - - DoubleCollectorTask(PipelineHelper helper, Spliterator spliterator) { - super(helper, spliterator); - this.helper = helper; } - DoubleCollectorTask(DoubleCollectorTask parent, Spliterator spliterator) { - super(parent, spliterator); - helper = parent.helper; - } - - @Override - protected DoubleCollectorTask makeChild(Spliterator spliterator) { - return new DoubleCollectorTask<>(this, spliterator); - } - - @Override - protected Node.OfDouble doLeaf() { - Node.Builder.OfDouble builder - = doubleBuilder(helper.exactOutputSizeIfKnown(spliterator)); - return helper.wrapAndCopyInto(builder, spliterator).build(); - } - - @Override - public void onCompletion(CountedCompleter caller) { - if (!isLeaf()) { - setLocalResult(new DoubleConcNode(leftChild.getLocalResult(), rightChild.getLocalResult())); + private static final class OfLong + extends CollectorTask { + OfLong(PipelineHelper helper, Spliterator spliterator) { + super(helper, spliterator, Nodes::longBuilder, ConcNode.OfLong::new); + } + } + + private static final class OfDouble + extends CollectorTask { + OfDouble(PipelineHelper helper, Spliterator spliterator) { + super(helper, spliterator, Nodes::doubleBuilder, ConcNode.OfDouble::new); } - super.onCompletion(caller); } } } diff --git a/jdk/src/share/classes/java/util/stream/PipelineHelper.java b/jdk/src/share/classes/java/util/stream/PipelineHelper.java index 853a1ffac48..6824e3b3179 100644 --- a/jdk/src/share/classes/java/util/stream/PipelineHelper.java +++ b/jdk/src/share/classes/java/util/stream/PipelineHelper.java @@ -44,7 +44,7 @@ import java.util.function.IntFunction; * and {@link AbstractPipeline#opEvaluateParallel(PipelineHelper, java.util.Spliterator, * java.util.function.IntFunction)}, methods, which can use the * {@code PipelineHelper} to access information about the pipeline such as - * input shape, output shape, stream flags, and size, and use the helper methods + * head shape, stream flags, and size, and use the helper methods * such as {@link #wrapAndCopyInto(Sink, Spliterator)}, * {@link #copyInto(Sink, Spliterator)}, and {@link #wrapSink(Sink)} to execute * pipeline operations. @@ -54,6 +54,13 @@ import java.util.function.IntFunction; */ abstract class PipelineHelper { + /** + * Gets the stream shape for the source of the pipeline segment. + * + * @return the stream shape for the source of the pipeline segment. + */ + abstract StreamShape getSourceShape(); + /** * Gets the combined stream and operation flags for the output of the described * pipeline. This will incorporate stream flags from the stream source, all @@ -145,6 +152,14 @@ abstract class PipelineHelper { */ abstract Sink wrapSink(Sink sink); + /** + * + * @param spliterator + * @param + * @return + */ + abstract Spliterator wrapSpliterator(Spliterator spliterator); + /** * Constructs a @{link Node.Builder} compatible with the output shape of * this {@code PipelineHelper}. diff --git a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java index 6fc4cc0e7ff..8a86c2d6c3b 100644 --- a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java +++ b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java @@ -25,7 +25,6 @@ package java.util.stream; import java.util.Comparator; -import java.util.Comparators; import java.util.Iterator; import java.util.Objects; import java.util.Optional; @@ -137,7 +136,7 @@ abstract class ReferencePipeline @Override public final Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @@ -165,6 +164,11 @@ abstract class ReferencePipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedReference(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + @Override public void accept(P_OUT u) { if (predicate.test(u)) @@ -252,6 +256,12 @@ abstract class ReferencePipeline @Override Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedReference(sink) { + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(P_OUT u) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it Stream result = mapper.apply(u); @@ -273,6 +283,12 @@ abstract class ReferencePipeline Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedReference(sink) { IntConsumer downstreamAsInt = downstream::accept; + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(P_OUT u) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it IntStream result = mapper.apply(u); @@ -294,6 +310,12 @@ abstract class ReferencePipeline Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedReference(sink) { DoubleConsumer downstreamAsDouble = downstream::accept; + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(P_OUT u) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it DoubleStream result = mapper.apply(u); @@ -315,6 +337,12 @@ abstract class ReferencePipeline Sink opWrapSink(int flags, Sink sink) { return new Sink.ChainedReference(sink) { LongConsumer downstreamAsLong = downstream::accept; + @Override + public void begin(long size) { + downstream.begin(-1); + } + + @Override public void accept(P_OUT u) { // We can do better that this too; optimize for depth=0 case and just grab spliterator and forEach it LongStream result = mapper.apply(u); @@ -483,12 +511,12 @@ abstract class ReferencePipeline @Override public final Optional max(Comparator comparator) { - return reduce(Comparators.greaterOf(comparator)); + return reduce(BinaryOperator.maxBy(comparator)); } @Override public final Optional min(Comparator comparator) { - return reduce(Comparators.lesserOf(comparator)); + return reduce(BinaryOperator.minBy(comparator)); } diff --git a/jdk/src/share/classes/java/util/stream/SliceOps.java b/jdk/src/share/classes/java/util/stream/SliceOps.java index 4dc26ce04c9..78fd3d7f0d5 100644 --- a/jdk/src/share/classes/java/util/stream/SliceOps.java +++ b/jdk/src/share/classes/java/util/stream/SliceOps.java @@ -24,8 +24,6 @@ */ package java.util.stream; -import java.util.ArrayList; -import java.util.List; import java.util.Spliterator; import java.util.concurrent.CountedCompleter; import java.util.function.IntFunction; @@ -41,6 +39,63 @@ final class SliceOps { // No instances private SliceOps() { } + /** + * Calculates the sliced size given the current size, number of elements + * skip, and the number of elements to limit. + * + * @param size the current size + * @param skip the number of elements to skip, assumed to be >= 0 + * @param limit the number of elements to limit, assumed to be >= 0, with + * a value of {@code Long.MAX_VALUE} if there is no limit + * @return the sliced size + */ + private static long calcSize(long size, long skip, long limit) { + return size >= 0 ? Math.max(-1, Math.min(size - skip, limit)) : -1; + } + + /** + * Calculates the slice fence, which is one past the index of the slice + * range + * @param skip the number of elements to skip, assumed to be >= 0 + * @param limit the number of elements to limit, assumed to be >= 0, with + * a value of {@code Long.MAX_VALUE} if there is no limit + * @return the slice fence. + */ + private static long calcSliceFence(long skip, long limit) { + long sliceFence = limit >= 0 ? skip + limit : Long.MAX_VALUE; + // Check for overflow + return (sliceFence >= 0) ? sliceFence : Long.MAX_VALUE; + } + + /** + * Creates a slice spliterator given a stream shape governing the + * spliterator type. Requires that the underlying Spliterator + * be SUBSIZED. + */ + @SuppressWarnings("unchecked") + private static Spliterator sliceSpliterator(StreamShape shape, + Spliterator s, + long skip, long limit) { + assert s.hasCharacteristics(Spliterator.SUBSIZED); + long sliceFence = calcSliceFence(skip, limit); + switch (shape) { + case REFERENCE: + return new StreamSpliterators + .SliceSpliterator.OfRef<>(s, skip, sliceFence); + case INT_VALUE: + return (Spliterator) new StreamSpliterators + .SliceSpliterator.OfInt((Spliterator.OfInt) s, skip, sliceFence); + case LONG_VALUE: + return (Spliterator) new StreamSpliterators + .SliceSpliterator.OfLong((Spliterator.OfLong) s, skip, sliceFence); + case DOUBLE_VALUE: + return (Spliterator) new StreamSpliterators + .SliceSpliterator.OfDouble((Spliterator.OfDouble) s, skip, sliceFence); + default: + throw new IllegalStateException("Unknown shape " + shape); + } + } + /** * Appends a "slice" operation to the provided stream. The slice operation * may be may be skip-only, limit-only, or skip-and-limit. @@ -58,11 +113,71 @@ final class SliceOps { return new ReferencePipeline.StatefulOp(upstream, StreamShape.REFERENCE, flags(limit)) { + Spliterator unorderedSkipLimitSpliterator(Spliterator s, + long skip, long limit, long sizeIfKnown) { + if (skip <= sizeIfKnown) { + // Use just the limit if the number of elements + // to skip is <= the known pipeline size + limit = limit >= 0 ? Math.min(limit, sizeIfKnown - skip) : sizeIfKnown - skip; + skip = 0; + } + return new StreamSpliterators.UnorderedSliceSpliterator.OfRef<>(s, skip, limit); + } + + @Override + Spliterator opEvaluateParallelLazy(PipelineHelper helper, Spliterator spliterator) { + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + return new StreamSpliterators.SliceSpliterator.OfRef<>( + helper.wrapSpliterator(spliterator), + skip, + calcSliceFence(skip, limit)); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + return unorderedSkipLimitSpliterator( + helper.wrapSpliterator(spliterator), + skip, limit, size); + } + else { + // @@@ OOMEs will occur for LongStream.longs().filter(i -> true).limit(n) + // regardless of the value of n + // Need to adjust the target size of splitting for the + // SliceTask from say (size / k) to say min(size / k, 1 << 14) + // This will limit the size of the buffers created at the leaf nodes + // cancellation will be more aggressive cancelling later tasks + // if the target slice size has been reached from a given task, + // cancellation should also clear local results if any + return new SliceTask<>(this, helper, spliterator, i -> (T[]) new Object[i], skip, limit). + invoke().spliterator(); + } + } + @Override Node opEvaluateParallel(PipelineHelper helper, Spliterator spliterator, IntFunction generator) { - return new SliceTask<>(this, helper, spliterator, generator, skip, limit).invoke(); + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + // Because the pipeline is SIZED the slice spliterator + // can be created from the source, this requires matching + // to shape of the source, and is potentially more efficient + // than creating the slice spliterator from the pipeline + // wrapping spliterator + Spliterator s = sliceSpliterator(helper.getSourceShape(), spliterator, skip, limit); + return Nodes.collect(helper, s, true, generator); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + Spliterator s = unorderedSkipLimitSpliterator( + helper.wrapSpliterator(spliterator), + skip, limit, size); + // Collect using this pipeline, which is empty and therefore + // can be used with the pipeline wrapping spliterator + // Note that we cannot create a slice spliterator from + // the source spliterator if the pipeline is not SIZED + return Nodes.collect(this, s, true, generator); + } + else { + return new SliceTask<>(this, helper, spliterator, generator, skip, limit). + invoke(); + } } @Override @@ -71,6 +186,11 @@ final class SliceOps { long n = skip; long m = limit >= 0 ? limit : Long.MAX_VALUE; + @Override + public void begin(long size) { + downstream.begin(calcSize(size, skip, m)); + } + @Override public void accept(T t) { if (n == 0) { @@ -109,11 +229,64 @@ final class SliceOps { return new IntPipeline.StatefulOp(upstream, StreamShape.INT_VALUE, flags(limit)) { + Spliterator.OfInt unorderedSkipLimitSpliterator( + Spliterator.OfInt s, long skip, long limit, long sizeIfKnown) { + if (skip <= sizeIfKnown) { + // Use just the limit if the number of elements + // to skip is <= the known pipeline size + limit = limit >= 0 ? Math.min(limit, sizeIfKnown - skip) : sizeIfKnown - skip; + skip = 0; + } + return new StreamSpliterators.UnorderedSliceSpliterator.OfInt(s, skip, limit); + } + + @Override + Spliterator opEvaluateParallelLazy(PipelineHelper helper, + Spliterator spliterator) { + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + return new StreamSpliterators.SliceSpliterator.OfInt( + (Spliterator.OfInt) helper.wrapSpliterator(spliterator), + skip, + calcSliceFence(skip, limit)); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + return unorderedSkipLimitSpliterator( + (Spliterator.OfInt) helper.wrapSpliterator(spliterator), + skip, limit, size); + } + else { + return new SliceTask<>(this, helper, spliterator, Integer[]::new, skip, limit). + invoke().spliterator(); + } + } + @Override Node opEvaluateParallel(PipelineHelper helper, Spliterator spliterator, IntFunction generator) { - return new SliceTask<>(this, helper, spliterator, generator, skip, limit).invoke(); + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + // Because the pipeline is SIZED the slice spliterator + // can be created from the source, this requires matching + // to shape of the source, and is potentially more efficient + // than creating the slice spliterator from the pipeline + // wrapping spliterator + Spliterator s = sliceSpliterator(helper.getSourceShape(), spliterator, skip, limit); + return Nodes.collectInt(helper, s, true); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + Spliterator.OfInt s = unorderedSkipLimitSpliterator( + (Spliterator.OfInt) helper.wrapSpliterator(spliterator), + skip, limit, size); + // Collect using this pipeline, which is empty and therefore + // can be used with the pipeline wrapping spliterator + // Note that we cannot create a slice spliterator from + // the source spliterator if the pipeline is not SIZED + return Nodes.collectInt(this, s, true); + } + else { + return new SliceTask<>(this, helper, spliterator, generator, skip, limit). + invoke(); + } } @Override @@ -122,6 +295,11 @@ final class SliceOps { long n = skip; long m = limit >= 0 ? limit : Long.MAX_VALUE; + @Override + public void begin(long size) { + downstream.begin(calcSize(size, skip, m)); + } + @Override public void accept(int t) { if (n == 0) { @@ -160,11 +338,64 @@ final class SliceOps { return new LongPipeline.StatefulOp(upstream, StreamShape.LONG_VALUE, flags(limit)) { + Spliterator.OfLong unorderedSkipLimitSpliterator( + Spliterator.OfLong s, long skip, long limit, long sizeIfKnown) { + if (skip <= sizeIfKnown) { + // Use just the limit if the number of elements + // to skip is <= the known pipeline size + limit = limit >= 0 ? Math.min(limit, sizeIfKnown - skip) : sizeIfKnown - skip; + skip = 0; + } + return new StreamSpliterators.UnorderedSliceSpliterator.OfLong(s, skip, limit); + } + + @Override + Spliterator opEvaluateParallelLazy(PipelineHelper helper, + Spliterator spliterator) { + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + return new StreamSpliterators.SliceSpliterator.OfLong( + (Spliterator.OfLong) helper.wrapSpliterator(spliterator), + skip, + calcSliceFence(skip, limit)); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + return unorderedSkipLimitSpliterator( + (Spliterator.OfLong) helper.wrapSpliterator(spliterator), + skip, limit, size); + } + else { + return new SliceTask<>(this, helper, spliterator, Long[]::new, skip, limit). + invoke().spliterator(); + } + } + @Override Node opEvaluateParallel(PipelineHelper helper, Spliterator spliterator, IntFunction generator) { - return new SliceTask<>(this, helper, spliterator, generator, skip, limit).invoke(); + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + // Because the pipeline is SIZED the slice spliterator + // can be created from the source, this requires matching + // to shape of the source, and is potentially more efficient + // than creating the slice spliterator from the pipeline + // wrapping spliterator + Spliterator s = sliceSpliterator(helper.getSourceShape(), spliterator, skip, limit); + return Nodes.collectLong(helper, s, true); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + Spliterator.OfLong s = unorderedSkipLimitSpliterator( + (Spliterator.OfLong) helper.wrapSpliterator(spliterator), + skip, limit, size); + // Collect using this pipeline, which is empty and therefore + // can be used with the pipeline wrapping spliterator + // Note that we cannot create a slice spliterator from + // the source spliterator if the pipeline is not SIZED + return Nodes.collectLong(this, s, true); + } + else { + return new SliceTask<>(this, helper, spliterator, generator, skip, limit). + invoke(); + } } @Override @@ -173,6 +404,11 @@ final class SliceOps { long n = skip; long m = limit >= 0 ? limit : Long.MAX_VALUE; + @Override + public void begin(long size) { + downstream.begin(calcSize(size, skip, m)); + } + @Override public void accept(long t) { if (n == 0) { @@ -211,11 +447,64 @@ final class SliceOps { return new DoublePipeline.StatefulOp(upstream, StreamShape.DOUBLE_VALUE, flags(limit)) { + Spliterator.OfDouble unorderedSkipLimitSpliterator( + Spliterator.OfDouble s, long skip, long limit, long sizeIfKnown) { + if (skip <= sizeIfKnown) { + // Use just the limit if the number of elements + // to skip is <= the known pipeline size + limit = limit >= 0 ? Math.min(limit, sizeIfKnown - skip) : sizeIfKnown - skip; + skip = 0; + } + return new StreamSpliterators.UnorderedSliceSpliterator.OfDouble(s, skip, limit); + } + + @Override + Spliterator opEvaluateParallelLazy(PipelineHelper helper, + Spliterator spliterator) { + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + return new StreamSpliterators.SliceSpliterator.OfDouble( + (Spliterator.OfDouble) helper.wrapSpliterator(spliterator), + skip, + calcSliceFence(skip, limit)); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + return unorderedSkipLimitSpliterator( + (Spliterator.OfDouble) helper.wrapSpliterator(spliterator), + skip, limit, size); + } + else { + return new SliceTask<>(this, helper, spliterator, Double[]::new, skip, limit). + invoke().spliterator(); + } + } + @Override Node opEvaluateParallel(PipelineHelper helper, Spliterator spliterator, IntFunction generator) { - return new SliceTask<>(this, helper, spliterator, generator, skip, limit).invoke(); + long size = helper.exactOutputSizeIfKnown(spliterator); + if (size > 0 && spliterator.hasCharacteristics(Spliterator.SUBSIZED)) { + // Because the pipeline is SIZED the slice spliterator + // can be created from the source, this requires matching + // to shape of the source, and is potentially more efficient + // than creating the slice spliterator from the pipeline + // wrapping spliterator + Spliterator s = sliceSpliterator(helper.getSourceShape(), spliterator, skip, limit); + return Nodes.collectDouble(helper, s, true); + } else if (!StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags())) { + Spliterator.OfDouble s = unorderedSkipLimitSpliterator( + (Spliterator.OfDouble) helper.wrapSpliterator(spliterator), + skip, limit, size); + // Collect using this pipeline, which is empty and therefore + // can be used with the pipeline wrapping spliterator + // Note that we cannot create a slice spliterator from + // the source spliterator if the pipeline is not SIZED + return Nodes.collectDouble(this, s, true); + } + else { + return new SliceTask<>(this, helper, spliterator, generator, skip, limit). + invoke(); + } } @Override @@ -224,6 +513,11 @@ final class SliceOps { long n = skip; long m = limit >= 0 ? limit : Long.MAX_VALUE; + @Override + public void begin(long size) { + downstream.begin(calcSize(size, skip, m)); + } + @Override public void accept(double t) { if (n == 0) { @@ -250,20 +544,6 @@ final class SliceOps { return StreamOpFlag.NOT_SIZED | ((limit != -1) ? StreamOpFlag.IS_SHORT_CIRCUIT : 0); } - // Parallel strategy -- two cases - // IF we have full size information - // - decompose, keeping track of each leaf's (offset, size) - // - calculate leaf only if intersection between (offset, size) and desired slice - // - Construct a Node containing the appropriate sections of the appropriate leaves - // IF we don't - // - decompose, and calculate size of each leaf - // - on complete of any node, compute completed initial size from the root, and if big enough, cancel later nodes - // - @@@ this can be significantly improved - - // @@@ Currently we don't do the sized version at all - - // @@@ Should take into account ORDERED flag; if not ORDERED, we can limit in temporal order instead - /** * {@code ForkJoinTask} implementing slice computation. * @@ -316,19 +596,18 @@ final class SliceOps { ? op.exactOutputSizeIfKnown(spliterator) : -1; final Node.Builder nb = op.makeNodeBuilder(sizeIfKnown, generator); - Sink opSink = op.opWrapSink(op.sourceOrOpFlags, nb); - - if (!StreamOpFlag.SHORT_CIRCUIT.isKnown(op.sourceOrOpFlags)) - helper.wrapAndCopyInto(opSink, spliterator); - else - helper.copyIntoWithCancel(helper.wrapSink(opSink), spliterator); - return nb.build(); + Sink opSink = op.opWrapSink(helper.getStreamAndOpFlags(), nb); + helper.copyIntoWithCancel(helper.wrapSink(opSink), spliterator); + // It is necessary to truncate here since the result at the root + // can only be set once + return doTruncate(nb.build()); } else { Node node = helper.wrapAndCopyInto(helper.makeNodeBuilder(-1, generator), - spliterator).build(); + spliterator).build(); thisNodeSize = node.count(); completed = true; + spliterator = null; return node; } } @@ -336,176 +615,95 @@ final class SliceOps { @Override public final void onCompletion(CountedCompleter caller) { if (!isLeaf()) { + Node result; thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize; - completed = true; - - if (isRoot()) { - // Only collect nodes once absolute size information is known - - ArrayList> nodes = new ArrayList<>(); - visit(nodes, 0); - Node result; - if (nodes.size() == 0) - result = Nodes.emptyNode(op.getOutputShape()); - else if (nodes.size() == 1) - result = nodes.get(0); - else - // This will create a tree of depth 1 and will not be a sub-tree - // for leaf nodes within the require range - result = Nodes.conc(op.getOutputShape(), nodes); - setLocalResult(result); - } - } - if (targetSize >= 0) { - if (((SliceTask) getRoot()).leftSize() >= targetOffset + targetSize) - cancelLaterNodes(); - } - // Don't call super.onCompletion(), we don't look at the child nodes until farther up the tree - } - - /** Compute the cumulative size of the longest leading prefix of completed children */ - private long leftSize() { - if (completed) - return thisNodeSize; - else if (isLeaf()) - return 0; - else { - long leftSize = 0; - for (SliceTask child = leftChild, p = null; child != p; - p = child, child = rightChild) { - if (child.completed) - leftSize += child.thisNodeSize; - else { - leftSize += child.leftSize(); - break; - } - } - return leftSize; - } - } - - private void visit(List> results, int offset) { - if (!isLeaf()) { - for (SliceTask child = leftChild, p = null; child != p; - p = child, child = rightChild) { - child.visit(results, offset); - offset += child.thisNodeSize; - } - } - else { - if (results.size() == 0) { - if (offset + thisNodeSize >= targetOffset) - results.add(truncateNode(getLocalResult(), - Math.max(0, targetOffset - offset), - targetSize >= 0 ? Math.max(0, offset + thisNodeSize - (targetOffset + targetSize)) : 0)); + if (canceled) { + thisNodeSize = 0; + result = getEmptyResult(); } + else if (thisNodeSize == 0) + result = getEmptyResult(); + else if (leftChild.thisNodeSize == 0) + result = rightChild.getLocalResult(); else { - if (targetSize == -1 || offset < targetOffset + targetSize) { - results.add(truncateNode(getLocalResult(), - 0, - targetSize >= 0 ? Math.max(0, offset + thisNodeSize - (targetOffset + targetSize)) : 0)); - } + result = Nodes.conc(op.getOutputShape(), + leftChild.getLocalResult(), rightChild.getLocalResult()); } + setLocalResult(isRoot() ? doTruncate(result) : result); + completed = true; } + if (targetSize >= 0 + && !isRoot() + && isLeftCompleted(targetOffset + targetSize)) + cancelLaterNodes(); + + super.onCompletion(caller); + } + + @Override + protected void cancel() { + super.cancel(); + if (completed) + setLocalResult(getEmptyResult()); + } + + private Node doTruncate(Node input) { + long to = targetSize >= 0 ? Math.min(input.count(), targetOffset + targetSize) : thisNodeSize; + return input.truncate(targetOffset, to, generator); } /** - * Return a new node describing the result of truncating an existing Node - * at the left and/or right. + * Determine if the number of completed elements in this node and nodes + * to the left of this node is greater than or equal to the target size. + * + * @param target the target size + * @return true if the number of elements is greater than or equal to + * the target size, otherwise false. */ - private Node truncateNode(Node input, - long skipLeft, long skipRight) { - if (skipLeft == 0 && skipRight == 0) - return input; + private boolean isLeftCompleted(long target) { + long size = completed ? thisNodeSize : completedSize(target); + if (size >= target) + return true; + for (SliceTask parent = getParent(), node = this; + parent != null; + node = parent, parent = parent.getParent()) { + if (node == parent.rightChild) { + SliceTask left = parent.leftChild; + if (left != null) { + size += left.completedSize(target); + if (size >= target) + return true; + } + } + } + return size >= target; + } + + /** + * Compute the number of completed elements in this node. + *

        + * Computation terminates if all nodes have been processed or the + * number of completed elements is greater than or equal to the target + * size. + * + * @param target the target size + * @return return the number of completed elements + */ + private long completedSize(long target) { + if (completed) + return thisNodeSize; else { - return Nodes.truncateNode(input, skipLeft, thisNodeSize - skipRight, generator); + SliceTask left = leftChild; + SliceTask right = rightChild; + if (left == null || right == null) { + // must be completed + return thisNodeSize; + } + else { + long leftSize = left.completedSize(target); + return (leftSize >= target) ? leftSize : leftSize + right.completedSize(target); + } } } } - - // @@@ Currently unused -- optimization for when all sizes are known -// private static class SizedSliceTask extends AbstractShortCircuitTask, SizedSliceTask> { -// private final int targetOffset, targetSize; -// private final int offset, size; -// -// private SizedSliceTask(ParallelPipelineHelper helper, int offset, int size) { -// super(helper); -// targetOffset = offset; -// targetSize = size; -// this.offset = 0; -// this.size = spliterator.getSizeIfKnown(); -// } -// -// private SizedSliceTask(SizedSliceTask parent, Spliterator spliterator) { -// // Makes assumptions about order in which siblings are created and linked into parent! -// super(parent, spliterator); -// targetOffset = parent.targetOffset; -// targetSize = parent.targetSize; -// int siblingSizes = 0; -// for (SizedSliceTask sibling = parent.children; sibling != null; sibling = sibling.nextSibling) -// siblingSizes += sibling.size; -// size = spliterator.getSizeIfKnown(); -// offset = parent.offset + siblingSizes; -// } -// -// @Override -// protected SizedSliceTask makeChild(Spliterator spliterator) { -// return new SizedSliceTask<>(this, spliterator); -// } -// -// @Override -// protected Node getEmptyResult() { -// return Nodes.emptyNode(); -// } -// -// @Override -// public boolean taskCanceled() { -// if (offset > targetOffset+targetSize || offset+size < targetOffset) -// return true; -// else -// return super.taskCanceled(); -// } -// -// @Override -// protected Node doLeaf() { -// int skipLeft = Math.max(0, targetOffset - offset); -// int skipRight = Math.max(0, offset + size - (targetOffset + targetSize)); -// if (skipLeft == 0 && skipRight == 0) -// return helper.into(Nodes.makeBuilder(spliterator.getSizeIfKnown())).build(); -// else { -// // If we're the first or last node that intersects the target range, peel off irrelevant elements -// int truncatedSize = size - skipLeft - skipRight; -// NodeBuilder builder = Nodes.makeBuilder(truncatedSize); -// Sink wrappedSink = helper.wrapSink(builder); -// wrappedSink.begin(truncatedSize); -// Iterator iterator = spliterator.iterator(); -// for (int i=0; i caller) { -// if (!isLeaf()) { -// Node result = null; -// for (SizedSliceTask child = children.nextSibling; child != null; child = child.nextSibling) { -// Node childResult = child.getRawResult(); -// if (childResult == null) -// continue; -// else if (result == null) -// result = childResult; -// else -// result = Nodes.node(result, childResult); -// } -// setRawResult(result); -// if (offset <= targetOffset && offset+size >= targetOffset+targetSize) -// shortCircuit(result); -// } -// } -// } - } diff --git a/jdk/src/share/classes/java/util/stream/SortedOps.java b/jdk/src/share/classes/java/util/stream/SortedOps.java index 976f207f662..de02ba8e32f 100644 --- a/jdk/src/share/classes/java/util/stream/SortedOps.java +++ b/jdk/src/share/classes/java/util/stream/SortedOps.java @@ -27,7 +27,6 @@ package java.util.stream; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; -import java.util.Comparators; import java.util.Objects; import java.util.Spliterator; import java.util.concurrent.ForkJoinTask; @@ -114,7 +113,7 @@ final class SortedOps { StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SORTED); this.isNaturalSort = true; // Will throw CCE when we try to sort if T is not Comparable - this.comparator = (Comparator) Comparators.naturalOrder(); + this.comparator = (Comparator) Comparator.naturalOrder(); } /** @@ -192,7 +191,7 @@ final class SortedOps { else { Node.OfInt n = (Node.OfInt) helper.evaluate(spliterator, true, generator); - int[] content = n.asIntArray(); + int[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -231,7 +230,7 @@ final class SortedOps { else { Node.OfLong n = (Node.OfLong) helper.evaluate(spliterator, true, generator); - long[] content = n.asLongArray(); + long[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -270,7 +269,7 @@ final class SortedOps { else { Node.OfDouble n = (Node.OfDouble) helper.evaluate(spliterator, true, generator); - double[] content = n.asDoubleArray(); + double[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -401,7 +400,7 @@ final class SortedOps { @Override public void end() { - int[] ints = b.asIntArray(); + int[] ints = b.asPrimitiveArray(); Arrays.sort(ints); downstream.begin(ints.length); for (int anInt : ints) @@ -466,7 +465,7 @@ final class SortedOps { @Override public void end() { - long[] longs = b.asLongArray(); + long[] longs = b.asPrimitiveArray(); Arrays.sort(longs); downstream.begin(longs.length); for (long aLong : longs) @@ -531,7 +530,7 @@ final class SortedOps { @Override public void end() { - double[] doubles = b.asDoubleArray(); + double[] doubles = b.asPrimitiveArray(); Arrays.sort(doubles); downstream.begin(doubles.length); for (double aDouble : doubles) diff --git a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java index 8c051f00ca4..77c375612ea 100644 --- a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java +++ b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java @@ -227,7 +227,7 @@ class SpinedBuffer @Override public Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -269,25 +269,45 @@ class SpinedBuffer * Return a {@link Spliterator} describing the contents of the buffer. */ public Spliterator spliterator() { - return new Spliterator() { + class Splitr implements Spliterator { // The current spine index int splSpineIndex; + // Last spine index + final int lastSpineIndex; + // The current element index into the current spine int splElementIndex; - // When splSpineIndex >= spineIndex and splElementIndex >= elementIndex then + // Last spine's last element index + 1 + final int lastSpineElementFence; + + // When splSpineIndex >= lastSpineIndex and + // splElementIndex >= lastSpineElementFence then // this spliterator is fully traversed // tryAdvance can set splSpineIndex > spineIndex if the last spine is full // The current spine array - E[] splChunk = (spine == null) ? curChunk : spine[0]; + E[] splChunk; + + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + this.splSpineIndex = firstSpineIndex; + this.lastSpineIndex = lastSpineIndex; + this.splElementIndex = firstSpineElementIndex; + this.lastSpineElementFence = lastSpineElementFence; + assert spine != null || firstSpineIndex == 0 && lastSpineIndex == 0; + splChunk = (spine == null) ? curChunk : spine[firstSpineIndex]; + } @Override public long estimateSize() { - return (spine == null) - ? (elementIndex - splElementIndex) - : count() - (priorElementCount[splSpineIndex] + splElementIndex); + return (splSpineIndex == lastSpineIndex) + ? (long) lastSpineElementFence - splElementIndex + : // # of elements prior to end - + priorElementCount[lastSpineIndex] + lastSpineElementFence - + // # of elements prior to current + priorElementCount[splSpineIndex] - splElementIndex; } @Override @@ -297,14 +317,14 @@ class SpinedBuffer @Override public boolean tryAdvance(Consumer consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { consumer.accept(splChunk[splElementIndex++]); if (splElementIndex == splChunk.length) { splElementIndex = 0; ++splSpineIndex; - if (spine != null && splSpineIndex < spine.length) + if (spine != null && splSpineIndex <= lastSpineIndex) splChunk = spine[splSpineIndex]; } return true; @@ -314,45 +334,47 @@ class SpinedBuffer @Override public void forEachRemaining(Consumer consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { int i = splElementIndex; // completed chunks, if any - for (int sp = splSpineIndex; sp < spineIndex; sp++) { + for (int sp = splSpineIndex; sp < lastSpineIndex; sp++) { E[] chunk = spine[sp]; for (; i < chunk.length; i++) { consumer.accept(chunk[i]); } i = 0; } - - // current chunk - E[] chunk = curChunk; - int hElementIndex = elementIndex; + // last (or current uncompleted) chunk + E[] chunk = (splSpineIndex == lastSpineIndex) ? splChunk : spine[lastSpineIndex]; + int hElementIndex = lastSpineElementFence; for (; i < hElementIndex; i++) { consumer.accept(chunk[i]); } - - splSpineIndex = spineIndex; - splElementIndex = elementIndex; + // mark consumed + splSpineIndex = lastSpineIndex; + splElementIndex = lastSpineElementFence; } } @Override public Spliterator trySplit() { - if (splSpineIndex < spineIndex) { - Spliterator ret = Arrays.spliterator(spine[splSpineIndex], - splElementIndex, spine[splSpineIndex].length); - splChunk = spine[++splSpineIndex]; + if (splSpineIndex < lastSpineIndex) { + // split just before last chunk (if it is full this means 50:50 split) + Spliterator ret = new Splitr(splSpineIndex, lastSpineIndex - 1, + splElementIndex, spine[lastSpineIndex-1].length); + // position to start of last chunk + splSpineIndex = lastSpineIndex; splElementIndex = 0; + splChunk = spine[splSpineIndex]; return ret; } - else if (splSpineIndex == spineIndex) { - int t = (elementIndex - splElementIndex) / 2; + else if (splSpineIndex == lastSpineIndex) { + int t = (lastSpineElementFence - splElementIndex) / 2; if (t == 0) return null; else { - Spliterator ret = Arrays.spliterator(curChunk, splElementIndex, splElementIndex + t); + Spliterator ret = Arrays.spliterator(splChunk, splElementIndex, splElementIndex + t); splElementIndex += t; return ret; } @@ -361,7 +383,8 @@ class SpinedBuffer return null; } } - }; + } + return new Splitr(0, spineIndex, 0, elementIndex); } /** @@ -436,7 +459,7 @@ class SpinedBuffer protected abstract T_ARR[] newArrayArray(int size); /** Create a new array of the proper type and size */ - protected abstract T_ARR newArray(int size); + public abstract T_ARR newArray(int size); /** Get the length of an array */ protected abstract int arrayLength(T_ARR array); @@ -555,30 +578,53 @@ class SpinedBuffer arrayForEach(curChunk, 0, elementIndex, consumer); } - abstract class BaseSpliterator> - implements Spliterator { + abstract class BaseSpliterator> + implements Spliterator.OfPrimitive { // The current spine index int splSpineIndex; + // Last spine index + final int lastSpineIndex; + // The current element index into the current spine int splElementIndex; - // When splSpineIndex >= spineIndex and splElementIndex >= elementIndex then + // Last spine's last element index + 1 + final int lastSpineElementFence; + + // When splSpineIndex >= lastSpineIndex and + // splElementIndex >= lastSpineElementFence then // this spliterator is fully traversed // tryAdvance can set splSpineIndex > spineIndex if the last spine is full // The current spine array - T_ARR splChunk = (spine == null) ? curChunk : spine[0]; + T_ARR splChunk; + + BaseSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + this.splSpineIndex = firstSpineIndex; + this.lastSpineIndex = lastSpineIndex; + this.splElementIndex = firstSpineElementIndex; + this.lastSpineElementFence = lastSpineElementFence; + assert spine != null || firstSpineIndex == 0 && lastSpineIndex == 0; + splChunk = (spine == null) ? curChunk : spine[firstSpineIndex]; + } + + abstract T_SPLITR newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence); abstract void arrayForOne(T_ARR array, int index, T_CONS consumer); - abstract T_SPLITER arraySpliterator(T_ARR array, int offset, int len); + abstract T_SPLITR arraySpliterator(T_ARR array, int offset, int len); @Override public long estimateSize() { - return (spine == null) - ? (elementIndex - splElementIndex) - : count() - (priorElementCount[splSpineIndex] + splElementIndex); + return (splSpineIndex == lastSpineIndex) + ? (long) lastSpineElementFence - splElementIndex + : // # of elements prior to end - + priorElementCount[lastSpineIndex] + lastSpineElementFence - + // # of elements prior to current + priorElementCount[splSpineIndex] - splElementIndex; } @Override @@ -586,15 +632,16 @@ class SpinedBuffer return SPLITERATOR_CHARACTERISTICS; } + @Override public boolean tryAdvance(T_CONS consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { arrayForOne(splChunk, splElementIndex++, consumer); if (splElementIndex == arrayLength(splChunk)) { splElementIndex = 0; ++splSpineIndex; - if (spine != null && splSpineIndex < spine.length) + if (spine != null && splSpineIndex <= lastSpineIndex) splChunk = spine[splSpineIndex]; } return true; @@ -602,39 +649,44 @@ class SpinedBuffer return false; } + @Override public void forEachRemaining(T_CONS consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { int i = splElementIndex; // completed chunks, if any - for (int sp = splSpineIndex; sp < spineIndex; sp++) { + for (int sp = splSpineIndex; sp < lastSpineIndex; sp++) { T_ARR chunk = spine[sp]; arrayForEach(chunk, i, arrayLength(chunk), consumer); i = 0; } - - arrayForEach(curChunk, i, elementIndex, consumer); - - splSpineIndex = spineIndex; - splElementIndex = elementIndex; + // last (or current uncompleted) chunk + T_ARR chunk = (splSpineIndex == lastSpineIndex) ? splChunk : spine[lastSpineIndex]; + arrayForEach(chunk, i, lastSpineElementFence, consumer); + // mark consumed + splSpineIndex = lastSpineIndex; + splElementIndex = lastSpineElementFence; } } @Override - public T_SPLITER trySplit() { - if (splSpineIndex < spineIndex) { - T_SPLITER ret = arraySpliterator(spine[splSpineIndex], splElementIndex, - arrayLength(spine[splSpineIndex]) - splElementIndex); - splChunk = spine[++splSpineIndex]; + public T_SPLITR trySplit() { + if (splSpineIndex < lastSpineIndex) { + // split just before last chunk (if it is full this means 50:50 split) + T_SPLITR ret = newSpliterator(splSpineIndex, lastSpineIndex - 1, + splElementIndex, arrayLength(spine[lastSpineIndex - 1])); + // position us to start of last chunk + splSpineIndex = lastSpineIndex; splElementIndex = 0; + splChunk = spine[splSpineIndex]; return ret; } - else if (splSpineIndex == spineIndex) { - int t = (elementIndex - splElementIndex) / 2; + else if (splSpineIndex == lastSpineIndex) { + int t = (lastSpineElementFence - splElementIndex) / 2; if (t == 0) return null; else { - T_SPLITER ret = arraySpliterator(curChunk, splElementIndex, t); + T_SPLITR ret = arraySpliterator(splChunk, splElementIndex, t); splElementIndex += t; return ret; } @@ -675,7 +727,7 @@ class SpinedBuffer } @Override - protected int[] newArray(int size) { + public int[] newArray(int size) { return new int[size]; } @@ -706,18 +758,26 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public int[] asIntArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfInt spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfInt { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } @Override void arrayForOne(int[] array, int index, IntConsumer consumer) { @@ -728,13 +788,13 @@ class SpinedBuffer Spliterator.OfInt arraySpliterator(int[] array, int offset, int len) { return Arrays.spliterator(array, offset, offset+len); } - }; - return new Splitr(); + } + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - int[] array = asIntArray(); + int[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, @@ -778,7 +838,7 @@ class SpinedBuffer } @Override - protected long[] newArray(int size) { + public long[] newArray(int size) { return new long[size]; } @@ -809,19 +869,28 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public long[] asLongArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfLong spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfLong { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + @Override void arrayForOne(long[] array, int index, LongConsumer consumer) { consumer.accept(array[index]); @@ -831,13 +900,13 @@ class SpinedBuffer Spliterator.OfLong arraySpliterator(long[] array, int offset, int len) { return Arrays.spliterator(array, offset, offset+len); } - }; - return new Splitr(); + } + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - long[] array = asLongArray(); + long[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, @@ -882,7 +951,7 @@ class SpinedBuffer } @Override - protected double[] newArray(int size) { + public double[] newArray(int size) { return new double[size]; } @@ -913,18 +982,27 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public double[] asDoubleArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfDouble spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfDouble { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + @Override void arrayForOne(double[] array, int index, DoubleConsumer consumer) { consumer.accept(array[index]); @@ -935,12 +1013,12 @@ class SpinedBuffer return Arrays.spliterator(array, offset, offset+len); } } - return new Splitr(); + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - double[] array = asDoubleArray(); + double[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, diff --git a/jdk/src/share/classes/java/util/stream/Stream.java b/jdk/src/share/classes/java/util/stream/Stream.java index f06a01b7aea..32b3585fdbf 100644 --- a/jdk/src/share/classes/java/util/stream/Stream.java +++ b/jdk/src/share/classes/java/util/stream/Stream.java @@ -880,14 +880,7 @@ public interface Stream extends BaseStream> { */ public static Stream generate(Supplier s) { Objects.requireNonNull(s); - return StreamSupport.stream(Spliterators.spliteratorUnknownSize( - new Iterator() { - @Override - public boolean hasNext() { return true; } - - @Override - public T next() { return s.get(); } - }, - Spliterator.ORDERED | Spliterator.IMMUTABLE)); + return StreamSupport.stream( + new StreamSpliterators.InfiniteSupplyingSpliterator.OfRef<>(Long.MAX_VALUE, s)); } } diff --git a/jdk/src/share/classes/java/util/stream/StreamSpliterators.java b/jdk/src/share/classes/java/util/stream/StreamSpliterators.java index ff669dbaa18..d0dc61ed1e0 100644 --- a/jdk/src/share/classes/java/util/stream/StreamSpliterators.java +++ b/jdk/src/share/classes/java/util/stream/StreamSpliterators.java @@ -26,11 +26,15 @@ package java.util.stream; import java.util.Comparator; import java.util.Spliterator; +import java.util.concurrent.atomic.AtomicLong; import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.DoubleConsumer; +import java.util.function.DoubleSupplier; import java.util.function.IntConsumer; +import java.util.function.IntSupplier; import java.util.function.LongConsumer; +import java.util.function.LongSupplier; import java.util.function.Supplier; /** @@ -212,9 +216,10 @@ class StreamSpliterators { @Override public final long estimateSize() { init(); - return StreamOpFlag.SIZED.isKnown(ph.getStreamAndOpFlags()) - ? spliterator.estimateSize() - : Long.MAX_VALUE; + // Use the estimate of the wrapped spliterator + // Note this may not be accurate if there are filter/flatMap + // operations filtering or adding elements to the stream + return spliterator.estimateSize(); } @Override @@ -240,7 +245,7 @@ class StreamSpliterators { // but for sub-splits only an estimate is known if ((c & Spliterator.SIZED) != 0) { c &= ~(Spliterator.SIZED | Spliterator.SUBSIZED); - c |= (spliterator.characteristics() & Spliterator.SIZED & Spliterator.SUBSIZED); + c |= (spliterator.characteristics() & (Spliterator.SIZED | Spliterator.SUBSIZED)); } return c; @@ -304,7 +309,7 @@ class StreamSpliterators { finished = true; } else { - while (tryAdvance(consumer)) { } + do { } while (tryAdvance(consumer)); } } } @@ -360,7 +365,7 @@ class StreamSpliterators { finished = true; } else { - while (tryAdvance(consumer)) { } + do { } while (tryAdvance(consumer)); } } } @@ -416,7 +421,7 @@ class StreamSpliterators { finished = true; } else { - while (tryAdvance(consumer)) { } + do { } while (tryAdvance(consumer)); } } } @@ -472,7 +477,7 @@ class StreamSpliterators { finished = true; } else { - while (tryAdvance(consumer)) { } + do { } while (tryAdvance(consumer)); } } } @@ -483,17 +488,17 @@ class StreamSpliterators { * first call to any spliterator method. * @param */ - static class DelegatingSpliterator implements Spliterator { - private final Supplier> supplier; + static class DelegatingSpliterator> + implements Spliterator { + private final Supplier supplier; - private Spliterator s; + private T_SPLITR s; - @SuppressWarnings("unchecked") - DelegatingSpliterator(Supplier> supplier) { - this.supplier = (Supplier>) supplier; + DelegatingSpliterator(Supplier supplier) { + this.supplier = supplier; } - Spliterator get() { + T_SPLITR get() { if (s == null) { s = supplier.get(); } @@ -501,8 +506,8 @@ class StreamSpliterators { } @Override - public Spliterator trySplit() { - return get().trySplit(); + public T_SPLITR trySplit() { + return (T_SPLITR) get().trySplit(); } @Override @@ -540,97 +545,881 @@ class StreamSpliterators { return getClass().getName() + "[" + get() + "]"; } - static final class OfInt extends DelegatingSpliterator implements Spliterator.OfInt { - private Spliterator.OfInt s; + static class OfPrimitive> + extends DelegatingSpliterator + implements Spliterator.OfPrimitive { + OfPrimitive(Supplier supplier) { + super(supplier); + } + + @Override + public boolean tryAdvance(T_CONS consumer) { + return get().tryAdvance(consumer); + } + + @Override + public void forEachRemaining(T_CONS consumer) { + get().forEachRemaining(consumer); + } + } + + static final class OfInt + extends OfPrimitive + implements Spliterator.OfInt { OfInt(Supplier supplier) { super(supplier); } - - @Override - Spliterator.OfInt get() { - if (s == null) { - s = (Spliterator.OfInt) super.get(); - } - return s; - } - - @Override - public Spliterator.OfInt trySplit() { - return get().trySplit(); - } - - @Override - public boolean tryAdvance(IntConsumer consumer) { - return get().tryAdvance(consumer); - } - - @Override - public void forEachRemaining(IntConsumer consumer) { - get().forEachRemaining(consumer); - } } - static final class OfLong extends DelegatingSpliterator implements Spliterator.OfLong { - private Spliterator.OfLong s; + static final class OfLong + extends OfPrimitive + implements Spliterator.OfLong { OfLong(Supplier supplier) { super(supplier); } - - @Override - Spliterator.OfLong get() { - if (s == null) { - s = (Spliterator.OfLong) super.get(); - } - return s; - } - - @Override - public Spliterator.OfLong trySplit() { - return get().trySplit(); - } - - @Override - public boolean tryAdvance(LongConsumer consumer) { - return get().tryAdvance(consumer); - } - - @Override - public void forEachRemaining(LongConsumer consumer) { - get().forEachRemaining(consumer); - } } - static final class OfDouble extends DelegatingSpliterator implements Spliterator.OfDouble { - private Spliterator.OfDouble s; + static final class OfDouble + extends OfPrimitive + implements Spliterator.OfDouble { OfDouble(Supplier supplier) { super(supplier); } + } + } + + /** + * A slice Spliterator from a source Spliterator that reports + * {@code SUBSIZED}. + * + */ + static abstract class SliceSpliterator> { + // The start index of the slice + final long sliceOrigin; + // One past the last index of the slice + final long sliceFence; + + // The spliterator to slice + T_SPLITR s; + // current (absolute) index, modified on advance/split + long index; + // one past last (absolute) index or sliceFence, which ever is smaller + long fence; + + SliceSpliterator(T_SPLITR s, long sliceOrigin, long sliceFence, long origin, long fence) { + assert s.hasCharacteristics(Spliterator.SUBSIZED); + this.s = s; + this.sliceOrigin = sliceOrigin; + this.sliceFence = sliceFence; + this.index = origin; + this.fence = fence; + } + + protected abstract T_SPLITR makeSpliterator(T_SPLITR s, long sliceOrigin, long sliceFence, long origin, long fence); + + public T_SPLITR trySplit() { + if (sliceOrigin >= fence) + return null; + + if (index >= fence) + return null; + + // Keep splitting until the left and right splits intersect with the slice + // thereby ensuring the size estimate decreases. + // This also avoids creating empty spliterators which can result in + // existing and additionally created F/J tasks that perform + // redundant work on no elements. + while (true) { + T_SPLITR leftSplit = (T_SPLITR) s.trySplit(); + if (leftSplit == null) + return null; + + long leftSplitFenceUnbounded = index + leftSplit.estimateSize(); + long leftSplitFence = Math.min(leftSplitFenceUnbounded, sliceFence); + if (sliceOrigin >= leftSplitFence) { + // The left split does not intersect with, and is to the left of, the slice + // The right split does intersect + // Discard the left split and split further with the right split + index = leftSplitFence; + } + else if (leftSplitFence >= sliceFence) { + // The right split does not intersect with, and is to the right of, the slice + // The left split does intersect + // Discard the right split and split further with the left split + s = leftSplit; + fence = leftSplitFence; + } + else if (index >= sliceOrigin && leftSplitFenceUnbounded <= sliceFence) { + // The left split is contained within the slice, return the underlying left split + // Right split is contained within or intersects with the slice + index = leftSplitFence; + return leftSplit; + } else { + // The left split intersects with the slice + // Right split is contained within or intersects with the slice + return makeSpliterator(leftSplit, sliceOrigin, sliceFence, index, index = leftSplitFence); + } + } + } + + public long estimateSize() { + return (sliceOrigin < fence) + ? fence - Math.max(sliceOrigin, index) : 0; + } + + public int characteristics() { + return s.characteristics(); + } + + static final class OfRef + extends SliceSpliterator> + implements Spliterator { + + OfRef(Spliterator s, long sliceOrigin, long sliceFence) { + this(s, sliceOrigin, sliceFence, 0, Math.min(s.estimateSize(), sliceFence)); + } + + private OfRef(Spliterator s, + long sliceOrigin, long sliceFence, long origin, long fence) { + super(s, sliceOrigin, sliceFence, origin, fence); + } @Override - Spliterator.OfDouble get() { - if (s == null) { - s = (Spliterator.OfDouble) super.get(); + protected Spliterator makeSpliterator(Spliterator s, + long sliceOrigin, long sliceFence, + long origin, long fence) { + return new OfRef<>(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + public boolean tryAdvance(Consumer action) { + if (sliceOrigin >= fence) + return false; + + while (sliceOrigin > index) { + s.tryAdvance(e -> {}); + index++; } - return s; + + if (index >= fence) + return false; + + index++; + return s.tryAdvance(action); + } + + @Override + public void forEachRemaining(Consumer action) { + if (sliceOrigin >= fence) + return; + + if (index >= fence) + return; + + if (index >= sliceOrigin && (index + s.estimateSize()) <= sliceFence) { + // The spliterator is contained within the slice + s.forEachRemaining(action); + index = fence; + } else { + // The spliterator intersects with the slice + while (sliceOrigin > index) { + s.tryAdvance(e -> {}); + index++; + } + // Traverse elements up to the fence + for (;index < fence; index++) { + s.tryAdvance(action); + } + } + } + } + + static abstract class OfPrimitive, + T_CONS> + extends SliceSpliterator + implements Spliterator.OfPrimitive { + + OfPrimitive(T_SPLITR s, long sliceOrigin, long sliceFence) { + this(s, sliceOrigin, sliceFence, 0, Math.min(s.estimateSize(), sliceFence)); + } + + private OfPrimitive(T_SPLITR s, + long sliceOrigin, long sliceFence, long origin, long fence) { + super(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + public boolean tryAdvance(T_CONS action) { + if (sliceOrigin >= fence) + return false; + + while (sliceOrigin > index) { + s.tryAdvance(emptyConsumer()); + index++; + } + + if (index >= fence) + return false; + + index++; + return s.tryAdvance(action); + } + + @Override + public void forEachRemaining(T_CONS action) { + if (sliceOrigin >= fence) + return; + + if (index >= fence) + return; + + if (index >= sliceOrigin && (index + s.estimateSize()) <= sliceFence) { + // The spliterator is contained within the slice + s.forEachRemaining(action); + index = fence; + } else { + // The spliterator intersects with the slice + while (sliceOrigin > index) { + s.tryAdvance(emptyConsumer()); + index++; + } + // Traverse elements up to the fence + for (;index < fence; index++) { + s.tryAdvance(action); + } + } + } + + protected abstract T_CONS emptyConsumer(); + } + + static final class OfInt extends OfPrimitive + implements Spliterator.OfInt { + OfInt(Spliterator.OfInt s, long sliceOrigin, long sliceFence) { + super(s, sliceOrigin, sliceFence); + } + + OfInt(Spliterator.OfInt s, + long sliceOrigin, long sliceFence, long origin, long fence) { + super(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected Spliterator.OfInt makeSpliterator(Spliterator.OfInt s, + long sliceOrigin, long sliceFence, + long origin, long fence) { + return new SliceSpliterator.OfInt(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected IntConsumer emptyConsumer() { + return e -> {}; + } + } + + static final class OfLong extends OfPrimitive + implements Spliterator.OfLong { + OfLong(Spliterator.OfLong s, long sliceOrigin, long sliceFence) { + super(s, sliceOrigin, sliceFence); + } + + OfLong(Spliterator.OfLong s, + long sliceOrigin, long sliceFence, long origin, long fence) { + super(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected Spliterator.OfLong makeSpliterator(Spliterator.OfLong s, + long sliceOrigin, long sliceFence, + long origin, long fence) { + return new SliceSpliterator.OfLong(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected LongConsumer emptyConsumer() { + return e -> {}; + } + } + + static final class OfDouble extends OfPrimitive + implements Spliterator.OfDouble { + OfDouble(Spliterator.OfDouble s, long sliceOrigin, long sliceFence) { + super(s, sliceOrigin, sliceFence); + } + + OfDouble(Spliterator.OfDouble s, + long sliceOrigin, long sliceFence, long origin, long fence) { + super(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected Spliterator.OfDouble makeSpliterator(Spliterator.OfDouble s, + long sliceOrigin, long sliceFence, + long origin, long fence) { + return new SliceSpliterator.OfDouble(s, sliceOrigin, sliceFence, origin, fence); + } + + @Override + protected DoubleConsumer emptyConsumer() { + return e -> {}; + } + } + } + + /** + * A slice Spliterator that does not preserve order, if any, of a source + * Spliterator. + * + * Note: The source spliterator may report {@code ORDERED} since that + * spliterator be the result of a previous pipeline stage that was + * collected to a {@code Node}. It is the order of the pipeline stage + * that governs whether the this slice spliterator is to be used or not. + */ + static abstract class UnorderedSliceSpliterator> { + static final int CHUNK_SIZE = 1 << 7; + + // The spliterator to slice + protected final T_SPLITR s; + protected final boolean unlimited; + private final long skipThreshold; + private final AtomicLong permits; + + UnorderedSliceSpliterator(T_SPLITR s, long skip, long limit) { + this.s = s; + this.unlimited = limit < 0; + this.skipThreshold = limit >= 0 ? limit : 0; + this.permits = new AtomicLong(limit >= 0 ? skip + limit : skip); + } + + UnorderedSliceSpliterator(T_SPLITR s, UnorderedSliceSpliterator parent) { + this.s = s; + this.unlimited = parent.unlimited; + this.permits = parent.permits; + this.skipThreshold = parent.skipThreshold; + } + + /** + * Acquire permission to skip or process elements. The caller must + * first acquire the elements, then consult this method for guidance + * as to what to do with the data. + * + *

        We use an {@code AtomicLong} to atomically maintain a counter, + * which is initialized as skip+limit if we are limiting, or skip only + * if we are not limiting. The user should consult the method + * {@code checkPermits()} before acquiring data elements. + * + * @param numElements the number of elements the caller has in hand + * @return the number of elements that should be processed; any + * remaining elements should be discarded. + */ + protected final long acquirePermits(long numElements) { + long remainingPermits; + long grabbing; + // permits never increase, and don't decrease below zero + assert numElements > 0; + do { + remainingPermits = permits.get(); + if (remainingPermits == 0) + return unlimited ? numElements : 0; + grabbing = Math.min(remainingPermits, numElements); + } while (grabbing > 0 && + !permits.compareAndSet(remainingPermits, remainingPermits - grabbing)); + + if (unlimited) + return Math.max(numElements - grabbing, 0); + else if (remainingPermits > skipThreshold) + return Math.max(grabbing - (remainingPermits - skipThreshold), 0); + else + return grabbing; + } + + enum PermitStatus { NO_MORE, MAYBE_MORE, UNLIMITED } + + /** Call to check if permits might be available before acquiring data */ + protected final PermitStatus permitStatus() { + if (permits.get() > 0) + return PermitStatus.MAYBE_MORE; + else + return unlimited ? PermitStatus.UNLIMITED : PermitStatus.NO_MORE; + } + + public final T_SPLITR trySplit() { + // Stop splitting when there are no more limit permits + if (permits.get() == 0) + return null; + T_SPLITR split = (T_SPLITR) s.trySplit(); + return split == null ? null : makeSpliterator(split); + } + + protected abstract T_SPLITR makeSpliterator(T_SPLITR s); + + public final long estimateSize() { + return s.estimateSize(); + } + + public final int characteristics() { + return s.characteristics() & + ~(Spliterator.SIZED | Spliterator.SUBSIZED | Spliterator.ORDERED); + } + + static final class OfRef extends UnorderedSliceSpliterator> + implements Spliterator, Consumer { + T tmpSlot; + + OfRef(Spliterator s, long skip, long limit) { + super(s, skip, limit); + } + + OfRef(Spliterator s, OfRef parent) { + super(s, parent); + } + + @Override + public final void accept(T t) { + tmpSlot = t; + } + + @Override + public boolean tryAdvance(Consumer action) { + while (permitStatus() != PermitStatus.NO_MORE) { + if (!s.tryAdvance(this)) + return false; + else if (acquirePermits(1) == 1) { + action.accept(tmpSlot); + tmpSlot = null; + return true; + } + } + return false; + } + + @Override + public void forEachRemaining(Consumer action) { + ArrayBuffer.OfRef sb = null; + PermitStatus permitStatus; + while ((permitStatus = permitStatus()) != PermitStatus.NO_MORE) { + if (permitStatus == PermitStatus.MAYBE_MORE) { + // Optimistically traverse elements up to a threshold of CHUNK_SIZE + if (sb == null) + sb = new ArrayBuffer.OfRef<>(CHUNK_SIZE); + else + sb.reset(); + long permitsRequested = 0; + do { } while (s.tryAdvance(sb) && ++permitsRequested < CHUNK_SIZE); + if (permitsRequested == 0) + return; + sb.forEach(action, acquirePermits(permitsRequested)); + } + else { + // Must be UNLIMITED; let 'er rip + s.forEachRemaining(action); + return; + } + } + } + + @Override + protected Spliterator makeSpliterator(Spliterator s) { + return new UnorderedSliceSpliterator.OfRef<>(s, this); + } + } + + /** + * Concrete sub-types must also be an instance of type {@code T_CONS}. + * + * @param the type of the spined buffer. Must also be a type of + * {@code T_CONS}. + */ + static abstract class OfPrimitive< + T, + T_CONS, + T_BUFF extends ArrayBuffer.OfPrimitive, + T_SPLITR extends Spliterator.OfPrimitive> + extends UnorderedSliceSpliterator + implements Spliterator.OfPrimitive { + OfPrimitive(T_SPLITR s, long skip, long limit) { + super(s, skip, limit); + } + + OfPrimitive(T_SPLITR s, UnorderedSliceSpliterator.OfPrimitive parent) { + super(s, parent); + } + + @Override + public boolean tryAdvance(T_CONS action) { + while (permitStatus() != PermitStatus.NO_MORE) { + if (!s.tryAdvance((T_CONS) this)) + return false; + else if (acquirePermits(1) == 1) { + acceptConsumed(action); + return true; + } + } + return false; + } + + protected abstract void acceptConsumed(T_CONS action); + + @Override + public void forEachRemaining(T_CONS action) { + T_BUFF sb = null; + PermitStatus permitStatus; + while ((permitStatus = permitStatus()) != PermitStatus.NO_MORE) { + if (permitStatus == PermitStatus.MAYBE_MORE) { + // Optimistically traverse elements up to a threshold of CHUNK_SIZE + if (sb == null) + sb = bufferCreate(CHUNK_SIZE); + else + sb.reset(); + @SuppressWarnings("unchecked") + T_CONS sbc = (T_CONS) sb; + long permitsRequested = 0; + do { } while (s.tryAdvance(sbc) && ++permitsRequested < CHUNK_SIZE); + if (permitsRequested == 0) + return; + sb.forEach(action, acquirePermits(permitsRequested)); + } + else { + // Must be UNLIMITED; let 'er rip + s.forEachRemaining(action); + return; + } + } + } + + protected abstract T_BUFF bufferCreate(int initialCapacity); + } + + static final class OfInt + extends OfPrimitive + implements Spliterator.OfInt, IntConsumer { + + int tmpValue; + + OfInt(Spliterator.OfInt s, long skip, long limit) { + super(s, skip, limit); + } + + OfInt(Spliterator.OfInt s, UnorderedSliceSpliterator.OfInt parent) { + super(s, parent); + } + + @Override + public void accept(int value) { + tmpValue = value; + } + + @Override + protected void acceptConsumed(IntConsumer action) { + action.accept(tmpValue); + } + + @Override + protected ArrayBuffer.OfInt bufferCreate(int initialCapacity) { + return new ArrayBuffer.OfInt(initialCapacity); + } + + @Override + protected Spliterator.OfInt makeSpliterator(Spliterator.OfInt s) { + return new UnorderedSliceSpliterator.OfInt(s, this); + } + } + + static final class OfLong + extends OfPrimitive + implements Spliterator.OfLong, LongConsumer { + + long tmpValue; + + OfLong(Spliterator.OfLong s, long skip, long limit) { + super(s, skip, limit); + } + + OfLong(Spliterator.OfLong s, UnorderedSliceSpliterator.OfLong parent) { + super(s, parent); + } + + @Override + public void accept(long value) { + tmpValue = value; + } + + @Override + protected void acceptConsumed(LongConsumer action) { + action.accept(tmpValue); + } + + @Override + protected ArrayBuffer.OfLong bufferCreate(int initialCapacity) { + return new ArrayBuffer.OfLong(initialCapacity); + } + + @Override + protected Spliterator.OfLong makeSpliterator(Spliterator.OfLong s) { + return new UnorderedSliceSpliterator.OfLong(s, this); + } + } + + static final class OfDouble + extends OfPrimitive + implements Spliterator.OfDouble, DoubleConsumer { + + double tmpValue; + + OfDouble(Spliterator.OfDouble s, long skip, long limit) { + super(s, skip, limit); + } + + OfDouble(Spliterator.OfDouble s, UnorderedSliceSpliterator.OfDouble parent) { + super(s, parent); + } + + @Override + public void accept(double value) { + tmpValue = value; + } + + @Override + protected void acceptConsumed(DoubleConsumer action) { + action.accept(tmpValue); + } + + @Override + protected ArrayBuffer.OfDouble bufferCreate(int initialCapacity) { + return new ArrayBuffer.OfDouble(initialCapacity); + } + + @Override + protected Spliterator.OfDouble makeSpliterator(Spliterator.OfDouble s) { + return new UnorderedSliceSpliterator.OfDouble(s, this); + } + } + } + + /** + * A Spliterator that infinitely supplies elements in no particular order. + * + *

        Splitting divides the estimated size in two and stops when the + * estimate size is 0. + * + *

        The {@code forEachRemaining} method if invoked will never terminate. + * The {@coe tryAdvance} method always returns true. + * + */ + static abstract class InfiniteSupplyingSpliterator implements Spliterator { + long estimate; + + protected InfiniteSupplyingSpliterator(long estimate) { + this.estimate = estimate; + } + + @Override + public long estimateSize() { + return estimate; + } + + @Override + public int characteristics() { + return IMMUTABLE; + } + + static final class OfRef extends InfiniteSupplyingSpliterator { + final Supplier s; + + OfRef(long size, Supplier s) { + super(size); + this.s = s; + } + + @Override + public boolean tryAdvance(Consumer action) { + action.accept(s.get()); + return true; + } + + @Override + public Spliterator trySplit() { + if (estimate == 0) + return null; + return new InfiniteSupplyingSpliterator.OfRef<>(estimate >>>= 1, s); + } + } + + static final class OfInt extends InfiniteSupplyingSpliterator + implements Spliterator.OfInt { + final IntSupplier s; + + OfInt(long size, IntSupplier s) { + super(size); + this.s = s; + } + + @Override + public boolean tryAdvance(IntConsumer action) { + action.accept(s.getAsInt()); + return true; + } + + @Override + public Spliterator.OfInt trySplit() { + if (estimate == 0) + return null; + return new InfiniteSupplyingSpliterator.OfInt(estimate = estimate >>> 1, s); + } + } + + static final class OfLong extends InfiniteSupplyingSpliterator + implements Spliterator.OfLong { + final LongSupplier s; + + OfLong(long size, LongSupplier s) { + super(size); + this.s = s; + } + + @Override + public boolean tryAdvance(LongConsumer action) { + action.accept(s.getAsLong()); + return true; + } + + @Override + public Spliterator.OfLong trySplit() { + if (estimate == 0) + return null; + return new InfiniteSupplyingSpliterator.OfLong(estimate = estimate >>> 1, s); + } + } + + static final class OfDouble extends InfiniteSupplyingSpliterator + implements Spliterator.OfDouble { + final DoubleSupplier s; + + OfDouble(long size, DoubleSupplier s) { + super(size); + this.s = s; + } + + @Override + public boolean tryAdvance(DoubleConsumer action) { + action.accept(s.getAsDouble()); + return true; } @Override public Spliterator.OfDouble trySplit() { - return get().trySplit(); - } - - @Override - public boolean tryAdvance(DoubleConsumer consumer) { - return get().tryAdvance(consumer); - } - - @Override - public void forEachRemaining(DoubleConsumer consumer) { - get().forEachRemaining(consumer); + if (estimate == 0) + return null; + return new InfiniteSupplyingSpliterator.OfDouble(estimate = estimate >>> 1, s); } } } -} + + // @@@ Consolidate with Node.Builder + static abstract class ArrayBuffer { + int index; + + void reset() { + index = 0; + } + + static final class OfRef extends ArrayBuffer implements Consumer { + final Object[] array; + + OfRef(int size) { + this.array = new Object[size]; + } + + @Override + public void accept(T t) { + array[index++] = t; + } + + public void forEach(Consumer action, long fence) { + for (int i = 0; i < fence; i++) { + @SuppressWarnings("unchecked") + T t = (T) array[i]; + action.accept(t); + } + } + } + + static abstract class OfPrimitive extends ArrayBuffer { + int index; + + @Override + void reset() { + index = 0; + } + + abstract void forEach(T_CONS action, long fence); + } + + static final class OfInt extends OfPrimitive + implements IntConsumer { + final int[] array; + + OfInt(int size) { + this.array = new int[size]; + } + + @Override + public void accept(int t) { + array[index++] = t; + } + + @Override + public void forEach(IntConsumer action, long fence) { + for (int i = 0; i < fence; i++) { + action.accept(array[i]); + } + } + } + + static final class OfLong extends OfPrimitive + implements LongConsumer { + final long[] array; + + OfLong(int size) { + this.array = new long[size]; + } + + @Override + public void accept(long t) { + array[index++] = t; + } + + @Override + public void forEach(LongConsumer action, long fence) { + for (int i = 0; i < fence; i++) { + action.accept(array[i]); + } + } + } + + static final class OfDouble extends OfPrimitive + implements DoubleConsumer { + final double[] array; + + OfDouble(int size) { + this.array = new double[size]; + } + + @Override + public void accept(double t) { + array[index++] = t; + } + + @Override + void forEach(DoubleConsumer action, long fence) { + for (int i = 0; i < fence; i++) { + action.accept(array[i]); + } + } + } + } +} \ No newline at end of file diff --git a/jdk/src/share/classes/java/util/stream/Streams.java b/jdk/src/share/classes/java/util/stream/Streams.java index 9693839de62..11dbbe3d7ca 100644 --- a/jdk/src/share/classes/java/util/stream/Streams.java +++ b/jdk/src/share/classes/java/util/stream/Streams.java @@ -25,7 +25,6 @@ package java.util.stream; import java.util.Comparator; -import java.util.Iterator; import java.util.Objects; import java.util.Spliterator; import java.util.Spliterators; @@ -62,39 +61,62 @@ class Streams { * An {@code int} range spliterator. */ static final class RangeIntSpliterator implements Spliterator.OfInt { + // Can never be greater that upTo, this avoids overflow if upper bound + // is Integer.MAX_VALUE + // All elements are traversed if from == upTo & last == 0 private int from; private final int upTo; - private final int step; + // 1 if the range is closed and the last element has not been traversed + // Otherwise, 0 if the range is open, or is a closed range and all + // elements have been traversed + private int last; - RangeIntSpliterator(int from, int upTo, int step) { + RangeIntSpliterator(int from, int upTo, boolean closed) { + this(from, upTo, closed ? 1 : 0); + } + + private RangeIntSpliterator(int from, int upTo, int last) { this.from = from; this.upTo = upTo; - this.step = step; + this.last = last; } @Override public boolean tryAdvance(IntConsumer consumer) { - boolean hasNext = from < upTo; - if (hasNext) { - consumer.accept(from); - from += step; + final int i = from; + if (i < upTo) { + from++; + consumer.accept(i); + return true; } - return hasNext; + else if (last > 0) { + last = 0; + consumer.accept(i); + return true; + } + return false; } @Override public void forEachRemaining(IntConsumer consumer) { - int hUpTo = upTo; - int hStep = step; // hoist accesses and checks from loop - for (int i = from; i < hUpTo; i += hStep) - consumer.accept(i); + int i = from; + final int hUpTo = upTo; + int hLast = last; from = upTo; + last = 0; + while (i < hUpTo) { + consumer.accept(i++); + } + if (hLast > 0) { + // Last element of closed range + consumer.accept(i); + } } @Override public long estimateSize() { - int d = upTo - from; - return (d / step) + ((d % step == 0) ? 0 : 1); + // Ensure ranges of size > Integer.MAX_VALUE report the correct size + return ((long) upTo) - from + last; } @Override @@ -111,57 +133,108 @@ class Streams { @Override public Spliterator.OfInt trySplit() { - return estimateSize() <= 1 + long size = estimateSize(); + return size <= 1 ? null - : new RangeIntSpliterator(from, from = from + midPoint(), step); + // Left split always has a half-open range + : new RangeIntSpliterator(from, from = from + splitPoint(size), 0); } - private int midPoint() { - // Size is known to be >= 2 - int bisection = (upTo - from) / 2; - // If bisection > step then round down to nearest multiple of step - // otherwise round up to step - return bisection > step ? bisection - bisection % step : step; + /** + * The spliterator size below which the spliterator will be split + * at the mid-point to produce balanced splits. Above this size the + * spliterator will be split at a ratio of + * 1:(RIGHT_BALANCED_SPLIT_RATIO - 1) + * to produce right-balanced splits. + * + *

        Such splitting ensures that for very large ranges that the left + * side of the range will more likely be processed at a lower-depth + * than a balanced tree at the expense of a higher-depth for the right + * side of the range. + * + *

        This is optimized for cases such as IntStream.ints() that is + * implemented as range of 0 to Integer.MAX_VALUE but is likely to be + * augmented with a limit operation that limits the number of elements + * to a count lower than this threshold. + */ + private static final int BALANCED_SPLIT_THRESHOLD = 1 << 24; + + /** + * The split ratio of the left and right split when the spliterator + * size is above BALANCED_SPLIT_THRESHOLD. + */ + private static final int RIGHT_BALANCED_SPLIT_RATIO = 1 << 3; + + private int splitPoint(long size) { + int d = (size < BALANCED_SPLIT_THRESHOLD) ? 2 : RIGHT_BALANCED_SPLIT_RATIO; + // 2 <= size <= 2^32 + return (int) (size / d); } } /** * A {@code long} range spliterator. + * + * This implementation cannot be used for ranges whose size is greater + * than Long.MAX_VALUE */ static final class RangeLongSpliterator implements Spliterator.OfLong { + // Can never be greater that upTo, this avoids overflow if upper bound + // is Long.MAX_VALUE + // All elements are traversed if from == upTo & last == 0 private long from; private final long upTo; - private final long step; + // 1 if the range is closed and the last element has not been traversed + // Otherwise, 0 if the range is open, or is a closed range and all + // elements have been traversed + private int last; - RangeLongSpliterator(long from, long upTo, long step) { + RangeLongSpliterator(long from, long upTo, boolean closed) { + this(from, upTo, closed ? 1 : 0); + } + + private RangeLongSpliterator(long from, long upTo, int last) { + assert upTo - from + last > 0; this.from = from; this.upTo = upTo; - this.step = step; + this.last = last; } @Override public boolean tryAdvance(LongConsumer consumer) { - boolean hasNext = from < upTo; - if (hasNext) { - consumer.accept(from); - from += step; + final long i = from; + if (i < upTo) { + from++; + consumer.accept(i); + return true; } - return hasNext; + else if (last > 0) { + last = 0; + consumer.accept(i); + return true; + } + return false; } @Override public void forEachRemaining(LongConsumer consumer) { - long hUpTo = upTo; - long hStep = step; // hoist accesses and checks from loop - for (long i = from; i < hUpTo; i += hStep) - consumer.accept(i); + long i = from; + final long hUpTo = upTo; + int hLast = last; from = upTo; + last = 0; + while (i < hUpTo) { + consumer.accept(i++); + } + if (hLast > 0) { + // Last element of closed range + consumer.accept(i); + } } @Override public long estimateSize() { - long d = upTo - from; - return (d / step) + ((d % step == 0) ? 0 : 1); + return upTo - from + last; } @Override @@ -178,98 +251,42 @@ class Streams { @Override public Spliterator.OfLong trySplit() { - return estimateSize() <= 1 + long size = estimateSize(); + return size <= 1 ? null - : new RangeLongSpliterator(from, from = from + midPoint(), step); + // Left split always has a half-open range + : new RangeLongSpliterator(from, from = from + splitPoint(size), 0); } - private long midPoint() { - // Size is known to be >= 2 - long bisection = (upTo - from) / 2; - // If bisection > step then round down to nearest multiple of step - // otherwise round up to step - return bisection > step ? bisection - bisection % step : step; - } - } + /** + * The spliterator size below which the spliterator will be split + * at the mid-point to produce balanced splits. Above this size the + * spliterator will be split at a ratio of + * 1:(RIGHT_BALANCED_SPLIT_RATIO - 1) + * to produce right-balanced splits. + * + *

        Such splitting ensures that for very large ranges that the left + * side of the range will more likely be processed at a lower-depth + * than a balanced tree at the expense of a higher-depth for the right + * side of the range. + * + *

        This is optimized for cases such as LongStream.longs() that is + * implemented as range of 0 to Long.MAX_VALUE but is likely to be + * augmented with a limit operation that limits the number of elements + * to a count lower than this threshold. + */ + private static final long BALANCED_SPLIT_THRESHOLD = 1 << 24; - /** - * A {@code double} range spliterator. - * - *

        The traversing and splitting logic is equivalent to that of - * {@code RangeLongSpliterator} for increasing values with a {@code step} of - * {@code 1}. - * - *

        A {@code double} value is calculated from the function - * {@code start + i * step} where {@code i} is the absolute position of the - * value when traversing an instance of this class that has not been split. - * This ensures the same values are produced at the same absolute positions - * regardless of how an instance of this class is split or traversed. - */ - static final class RangeDoubleSpliterator implements Spliterator.OfDouble { - private final double from; - private final double upTo; - private final double step; + /** + * The split ratio of the left and right split when the spliterator + * size is above BALANCED_SPLIT_THRESHOLD. + */ + private static final long RIGHT_BALANCED_SPLIT_RATIO = 1 << 3; - private long lFrom; - private final long lUpTo; - - RangeDoubleSpliterator(double from, double upTo, double step, long lFrom, long lUpTo) { - this.from = from; - this.upTo = upTo; - this.step = step; - this.lFrom = lFrom; - this.lUpTo = lUpTo; - } - - @Override - public boolean tryAdvance(DoubleConsumer consumer) { - boolean hasNext = lFrom < lUpTo; - if (hasNext) { - consumer.accept(from + lFrom * step); - lFrom++; - } - return hasNext; - } - - @Override - public void forEachRemaining(DoubleConsumer consumer) { - double hOrigin = from; - double hStep = step; - long hLUpTo = lUpTo; - long i = lFrom; - for (; i < hLUpTo; i++) { - consumer.accept(hOrigin + i * hStep); - } - lFrom = i; - } - - @Override - public long estimateSize() { - return lUpTo - lFrom; - } - - @Override - public int characteristics() { - return Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED | - Spliterator.IMMUTABLE | Spliterator.NONNULL | - Spliterator.DISTINCT | Spliterator.SORTED; - } - - @Override - public Comparator getComparator() { - return null; - } - - @Override - public Spliterator.OfDouble trySplit() { - return estimateSize() <= 1 - ? null - : new RangeDoubleSpliterator(from, upTo, step, lFrom, lFrom = lFrom + midPoint()); - } - - private long midPoint() { - // Size is known to be >= 2 - return (lUpTo - lFrom) / 2; + private long splitPoint(long size) { + long d = (size < BALANCED_SPLIT_THRESHOLD) ? 2 : RIGHT_BALANCED_SPLIT_RATIO; + // 2 <= size <= Long.MAX_VALUE + return size / d; } } diff --git a/jdk/src/share/classes/java/util/stream/package-info.java b/jdk/src/share/classes/java/util/stream/package-info.java index 4dfb1e998d2..39509ffffc6 100644 --- a/jdk/src/share/classes/java/util/stream/package-info.java +++ b/jdk/src/share/classes/java/util/stream/package-info.java @@ -141,7 +141,7 @@ * parallelism is explicitly requested. For example, {@code Collection} has methods * {@link java.util.Collection#stream} and {@link java.util.Collection#parallelStream}, * which produce sequential and parallel streams respectively; other stream-bearing methods - * such as {@link java.util.stream.Streams#intRange(int, int)} produce sequential + * such as {@link java.util.stream.IntStream#range(int, int)} produce sequential * streams but these can be efficiently parallelized by calling {@code parallel()} on the * result. The set of operations on serial and parallel streams is identical. To execute the * "sum of weights of blocks" query in parallel, we would do: diff --git a/jdk/src/share/classes/java/util/zip/Deflater.java b/jdk/src/share/classes/java/util/zip/Deflater.java index 227c06d1c14..085287996be 100644 --- a/jdk/src/share/classes/java/util/zip/Deflater.java +++ b/jdk/src/share/classes/java/util/zip/Deflater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -461,7 +461,7 @@ class Deflater { } /** - * Returns the total number of uncompressed bytes input so far.

        + * Returns the total number of uncompressed bytes input so far. * * @return the total (non-negative) number of uncompressed bytes input so far * @since 1.5 @@ -487,7 +487,7 @@ class Deflater { } /** - * Returns the total number of compressed bytes output so far.

        + * Returns the total number of compressed bytes output so far. * * @return the total (non-negative) number of compressed bytes output so far * @since 1.5 diff --git a/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java index a996b14e0eb..cdca7f63bfc 100644 --- a/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java @@ -97,7 +97,7 @@ public class DeflaterInputStream extends FilterInputStream { * @param in input stream to read the uncompressed data to * @param defl compressor ("deflater") for this stream * @param bufLen compression buffer size - * @throws IllegalArgumentException if {@code bufLen} is <= 0 + * @throws IllegalArgumentException if {@code bufLen <= 0} * @throws NullPointerException if {@code in} or {@code defl} is null */ public DeflaterInputStream(InputStream in, Deflater defl, int bufLen) { @@ -163,8 +163,7 @@ public class DeflaterInputStream extends FilterInputStream { * @param len maximum number of compressed bytes to read into {@code b} * @return the actual number of bytes read, or -1 if the end of the * uncompressed input stream is reached - * @throws IndexOutOfBoundsException if {@code len} > {@code b.length - - * off} + * @throws IndexOutOfBoundsException if {@code len > b.length - off} * @throws IOException if an I/O error occurs or if this input stream is * already closed */ diff --git a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java index c19a222e5dc..7cb0f8388c4 100644 --- a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java @@ -71,7 +71,7 @@ class DeflaterOutputStream extends FilterOutputStream { * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream * - * @throws IllegalArgumentException if size is <= 0 + * @throws IllegalArgumentException if {@code size <= 0} * * @since 1.7 */ @@ -101,7 +101,7 @@ class DeflaterOutputStream extends FilterOutputStream { * @param out the output stream * @param def the compressor ("deflater") * @param size the output buffer size - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public DeflaterOutputStream(OutputStream out, Deflater def, int size) { this(out, def, size, false); diff --git a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java index 74a5c60f1a8..b3d9240ba01 100644 --- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java +++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java @@ -71,7 +71,7 @@ class GZIPInputStream extends InflaterInputStream { * @exception ZipException if a GZIP format error has occurred or the * compression method used is unsupported * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public GZIPInputStream(InputStream in, int size) throws IOException { super(in, new Inflater(true), size); diff --git a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java index d5edcf1226a..e454956a127 100644 --- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java @@ -61,8 +61,7 @@ class GZIPOutputStream extends DeflaterOutputStream { * @param out the output stream * @param size the output buffer size * @exception IOException If an I/O error has occurred. - * @exception IllegalArgumentException if size is <= 0 - + * @exception IllegalArgumentException if {@code size <= 0} */ public GZIPOutputStream(OutputStream out, int size) throws IOException { this(out, size, false); @@ -81,7 +80,7 @@ class GZIPOutputStream extends DeflaterOutputStream { * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream * @exception IOException If an I/O error has occurred. - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} * * @since 1.7 */ diff --git a/jdk/src/share/classes/java/util/zip/Inflater.java b/jdk/src/share/classes/java/util/zip/Inflater.java index 25f9d2dcd34..c1eefe122d8 100644 --- a/jdk/src/share/classes/java/util/zip/Inflater.java +++ b/jdk/src/share/classes/java/util/zip/Inflater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -305,7 +305,7 @@ class Inflater { } /** - * Returns the total number of compressed bytes input so far.

        + * Returns the total number of compressed bytes input so far. * * @return the total (non-negative) number of compressed bytes input so far * @since 1.5 @@ -331,7 +331,7 @@ class Inflater { } /** - * Returns the total number of uncompressed bytes output so far.

        + * Returns the total number of uncompressed bytes output so far. * * @return the total (non-negative) number of uncompressed bytes output so far * @since 1.5 diff --git a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java index b948905d0e8..23cb9d943d2 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java @@ -75,7 +75,7 @@ class InflaterInputStream extends FilterInputStream { * @param in the input stream * @param inf the decompressor ("inflater") * @param size the input buffer size - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); @@ -191,7 +191,7 @@ class InflaterInputStream extends FilterInputStream { * @param n the number of bytes to skip * @return the actual number of bytes skipped. * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if n < 0 + * @exception IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { diff --git a/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java index ab90ccb0300..53f8b5dedee 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java @@ -97,7 +97,7 @@ public class InflaterOutputStream extends FilterOutputStream { * @param out output stream to write the uncompressed data to * @param infl decompressor ("inflater") for this stream * @param bufLen decompression buffer size - * @throws IllegalArgumentException if {@code bufLen} is <= 0 + * @throws IllegalArgumentException if {@code bufLen <= 0} * @throws NullPointerException if {@code out} or {@code infl} is null */ public InflaterOutputStream(OutputStream out, Inflater infl, int bufLen) { @@ -211,8 +211,8 @@ public class InflaterOutputStream extends FilterOutputStream { * the output stream * @param off starting offset of the compressed data within {@code b} * @param len number of bytes to decompress from {@code b} - * @throws IndexOutOfBoundsException if {@code off} < 0, or if - * {@code len} < 0, or if {@code len} > {@code b.length - off} + * @throws IndexOutOfBoundsException if {@code off < 0}, or if + * {@code len < 0}, or if {@code len > b.length - off} * @throws IOException if an I/O error occurs or this stream is already * closed * @throws NullPointerException if {@code b} is null diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java index be82c728de3..97d415c4a51 100644 --- a/jdk/src/share/classes/java/util/zip/ZipFile.java +++ b/jdk/src/share/classes/java/util/zip/ZipFile.java @@ -59,9 +59,10 @@ import static java.util.zip.ZipUtils.*; */ public class ZipFile implements ZipConstants, Closeable { - private long jzfile; // address of jzfile data - private String name; // zip file name - private int total; // total number of entries + private long jzfile; // address of jzfile data + private final String name; // zip file name + private final int total; // total number of entries + private final boolean locsig; // if zip file starts with LOCSIG (usually true) private volatile boolean closeRequested = false; private static final int STORED = ZipEntry.STORED; @@ -221,6 +222,7 @@ class ZipFile implements ZipConstants, Closeable { sun.misc.PerfCounter.getZipFileCount().increment(); this.name = name; this.total = getTotal(jzfile); + this.locsig = startsWithLOC(jzfile); } /** @@ -805,10 +807,28 @@ class ZipFile implements ZipConstants, Closeable { } } + static { + sun.misc.SharedSecrets.setJavaUtilZipFileAccess( + new sun.misc.JavaUtilZipFileAccess() { + public boolean startsWithLocHeader(ZipFile zip) { + return zip.startsWithLocHeader(); + } + } + ); + } + + /** + * Returns {@code true} if, and only if, the zip file begins with {@code + * LOCSIG}. + */ + private boolean startsWithLocHeader() { + return locsig; + } private static native long open(String name, int mode, long lastModified, boolean usemmap) throws IOException; private static native int getTotal(long jzfile); + private static native boolean startsWithLOC(long jzfile); private static native int read(long jzfile, long jzentry, long pos, byte[] b, int off, int len); diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java index 5c315d452c0..fee9f5108d3 100644 --- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java +++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java @@ -232,7 +232,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { * @return the actual number of bytes skipped * @exception ZipException if a ZIP file error has occurred * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if n < 0 + * @exception IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { diff --git a/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java b/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java index e396c5b45f2..fa1eaedd2f2 100644 --- a/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java @@ -68,7 +68,7 @@ public class IvParameterSpec implements AlgorithmParameterSpec { * starts. * @param len the number of IV bytes. * @throws IllegalArgumentException if iv is null - * or (iv.length - offset < len) + * or {@code (iv.length - offset < len)} * @throws ArrayIndexOutOfBoundsException is thrown if offset * or len index bytes outside the iv. */ diff --git a/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java b/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java index 7248eefa804..499480c2c5f 100644 --- a/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java @@ -80,7 +80,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * bytes of the buffer are copied to protect against subsequent * modification. * @exception IllegalArgumentException if iv is - * null or (iv.length < 2 * (wordSize / 8)) + * null or {@code (iv.length < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { this(version, rounds, wordSize, iv, 0); @@ -107,7 +107,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * @param offset the offset in iv where the IV starts. * @exception IllegalArgumentException if iv is * null or - * (iv.length - offset < 2 * (wordSize / 8)) + * {@code (iv.length - offset < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) { diff --git a/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java b/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java index 827be0f5274..586399dea4f 100644 --- a/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java @@ -130,7 +130,7 @@ public class SecretKeySpec implements KeySpec, SecretKey { * for information about standard algorithm names. * @exception IllegalArgumentException if algorithm * is null or key is null, empty, or too short, - * i.e. key.length-offset. + * i.e. {@code key.length-offsetoffset or len index bytes outside the * key. diff --git a/jdk/src/share/classes/javax/management/JMX.java b/jdk/src/share/classes/javax/management/JMX.java index 0b580d3a525..7f8cc411964 100644 --- a/jdk/src/share/classes/javax/management/JMX.java +++ b/jdk/src/share/classes/javax/management/JMX.java @@ -27,7 +27,9 @@ package javax.management; import com.sun.jmx.mbeanserver.Introspector; import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Modifier; import java.lang.reflect.Proxy; +import sun.reflect.misc.ReflectUtil; /** * Static methods from the JMX API. There are no instances of this class. @@ -203,11 +205,7 @@ public class JMX { ObjectName objectName, Class interfaceClass, boolean notificationEmitter) { - return MBeanServerInvocationHandler.newProxyInstance( - connection, - objectName, - interfaceClass, - notificationEmitter); + return createProxy(connection, objectName, interfaceClass, notificationEmitter, false); } /** @@ -345,26 +343,7 @@ public class JMX { ObjectName objectName, Class interfaceClass, boolean notificationEmitter) { - // Check interface for MXBean compliance - // - try { - Introspector.testComplianceMXBeanInterface(interfaceClass); - } catch (NotCompliantMBeanException e) { - throw new IllegalArgumentException(e); - } - InvocationHandler handler = new MBeanServerInvocationHandler( - connection, objectName, true); - final Class[] interfaces; - if (notificationEmitter) { - interfaces = - new Class[] {interfaceClass, NotificationEmitter.class}; - } else - interfaces = new Class[] {interfaceClass}; - Object proxy = Proxy.newProxyInstance( - interfaceClass.getClassLoader(), - interfaces, - handler); - return interfaceClass.cast(proxy); + return createProxy(connection, objectName, interfaceClass, notificationEmitter, true); } /** @@ -392,4 +371,65 @@ public class JMX { // exactly the string "MXBean" since that would mean there // was no package name, which is pretty unlikely in practice. } + + /** + * Centralised M(X)Bean proxy creation code + * @param connection {@linkplain MBeanServerConnection} to use + * @param objectName M(X)Bean object name + * @param interfaceClass M(X)Bean interface class + * @param notificationEmitter Is a notification emitter? + * @param isMXBean Is an MXBean? + * @return Returns an M(X)Bean proxy generated for the provided interface class + * @throws SecurityException + * @throws IllegalArgumentException + */ + private static T createProxy(MBeanServerConnection connection, + ObjectName objectName, + Class interfaceClass, + boolean notificationEmitter, + boolean isMXBean) { + + if (System.getSecurityManager() != null) { + checkProxyInterface(interfaceClass); + } + try { + if (isMXBean) { + // Check interface for MXBean compliance + Introspector.testComplianceMXBeanInterface(interfaceClass); + } else { + // Check interface for MBean compliance + Introspector.testComplianceMBeanInterface(interfaceClass); + } + } catch (NotCompliantMBeanException e) { + throw new IllegalArgumentException(e); + } + + InvocationHandler handler = new MBeanServerInvocationHandler( + connection, objectName, isMXBean); + final Class[] interfaces; + if (notificationEmitter) { + interfaces = + new Class[] {interfaceClass, NotificationEmitter.class}; + } else + interfaces = new Class[] {interfaceClass}; + + Object proxy = Proxy.newProxyInstance( + interfaceClass.getClassLoader(), + interfaces, + handler); + return interfaceClass.cast(proxy); + } + + /** + * Checks for the M(X)Bean proxy interface being public and not restricted + * @param interfaceClass MBean proxy interface + * @throws SecurityException when the proxy interface comes from a restricted + * package or is not public + */ + private static void checkProxyInterface(Class interfaceClass) { + if (!Modifier.isPublic(interfaceClass.getModifiers())) { + throw new SecurityException("mbean proxy interface non-public"); + } + ReflectUtil.checkPackageAccess(interfaceClass); + } } diff --git a/jdk/src/share/classes/javax/management/MBeanServerFactory.java b/jdk/src/share/classes/javax/management/MBeanServerFactory.java index d6f133a0b6b..1e0ad2fb9c1 100644 --- a/jdk/src/share/classes/javax/management/MBeanServerFactory.java +++ b/jdk/src/share/classes/javax/management/MBeanServerFactory.java @@ -34,6 +34,7 @@ import java.security.Permission; import java.util.ArrayList; import java.util.logging.Level; import javax.management.loading.ClassLoaderRepository; +import sun.reflect.misc.ReflectUtil; /** @@ -446,7 +447,7 @@ public class MBeanServerFactory { } // No context class loader? Try with Class.forName() - return Class.forName(builderClassName); + return ReflectUtil.forName(builderClassName); } /** diff --git a/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java b/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java index 41a969c7021..bc174fb303f 100644 --- a/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java +++ b/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java @@ -231,20 +231,7 @@ public class MBeanServerInvocationHandler implements InvocationHandler { ObjectName objectName, Class interfaceClass, boolean notificationBroadcaster) { - final InvocationHandler handler = - new MBeanServerInvocationHandler(connection, objectName); - final Class[] interfaces; - if (notificationBroadcaster) { - interfaces = - new Class[] {interfaceClass, NotificationEmitter.class}; - } else - interfaces = new Class[] {interfaceClass}; - - Object proxy = - Proxy.newProxyInstance(interfaceClass.getClassLoader(), - interfaces, - handler); - return interfaceClass.cast(proxy); + return JMX.newMBeanProxy(connection, objectName, interfaceClass, notificationBroadcaster); } public Object invoke(Object proxy, Method method, Object[] args) diff --git a/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java b/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java index c382f59eecf..47dbbce2781 100644 --- a/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java +++ b/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ package javax.management; import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Executor; @@ -288,6 +289,7 @@ public class NotificationBroadcasterSupport implements NotificationEmitter { this.handback = handback; } + @Override public boolean equals(Object o) { if (!(o instanceof ListenerInfo)) return false; @@ -298,6 +300,11 @@ public class NotificationBroadcasterSupport implements NotificationEmitter { return (li.listener == listener && li.filter == filter && li.handback == handback); } + + @Override + public int hashCode() { + return Objects.hashCode(listener); + } } private static class WildcardListenerInfo extends ListenerInfo { @@ -305,10 +312,16 @@ public class NotificationBroadcasterSupport implements NotificationEmitter { super(listener, null, null); } + @Override public boolean equals(Object o) { assert (!(o instanceof WildcardListenerInfo)); return o.equals(this); } + + @Override + public int hashCode() { + return super.hashCode(); + } } private List listenerList = diff --git a/jdk/src/share/classes/javax/management/StandardEmitterMBean.java b/jdk/src/share/classes/javax/management/StandardEmitterMBean.java index 5b22c34dd5e..a7ac7a11b67 100644 --- a/jdk/src/share/classes/javax/management/StandardEmitterMBean.java +++ b/jdk/src/share/classes/javax/management/StandardEmitterMBean.java @@ -64,6 +64,9 @@ package javax.management; public class StandardEmitterMBean extends StandardMBean implements NotificationEmitter { + private static final MBeanNotificationInfo[] NO_NOTIFICATION_INFO = + new MBeanNotificationInfo[0]; + private final NotificationEmitter emitter; private final MBeanNotificationInfo[] notificationInfo; @@ -99,11 +102,7 @@ public class StandardEmitterMBean extends StandardMBean */ public StandardEmitterMBean(T implementation, Class mbeanInterface, NotificationEmitter emitter) { - super(implementation, mbeanInterface, false); - if (emitter == null) - throw new IllegalArgumentException("Null emitter"); - this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + this(implementation, mbeanInterface, false, emitter); } /** @@ -148,7 +147,12 @@ public class StandardEmitterMBean extends StandardMBean if (emitter == null) throw new IllegalArgumentException("Null emitter"); this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + MBeanNotificationInfo[] infos = emitter.getNotificationInfo(); + if (infos == null || infos.length == 0) { + this.notificationInfo = NO_NOTIFICATION_INFO; + } else { + this.notificationInfo = infos.clone(); + } } /** @@ -184,11 +188,7 @@ public class StandardEmitterMBean extends StandardMBean */ protected StandardEmitterMBean(Class mbeanInterface, NotificationEmitter emitter) { - super(mbeanInterface, false); - if (emitter == null) - throw new IllegalArgumentException("Null emitter"); - this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + this(mbeanInterface, false, emitter); } /** @@ -231,7 +231,12 @@ public class StandardEmitterMBean extends StandardMBean if (emitter == null) throw new IllegalArgumentException("Null emitter"); this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + MBeanNotificationInfo[] infos = emitter.getNotificationInfo(); + if (infos == null || infos.length == 0) { + this.notificationInfo = NO_NOTIFICATION_INFO; + } else { + this.notificationInfo = infos.clone(); + } } public void removeNotificationListener(NotificationListener listener) @@ -253,7 +258,16 @@ public class StandardEmitterMBean extends StandardMBean } public MBeanNotificationInfo[] getNotificationInfo() { - return notificationInfo; + // this getter might get called from the super constructor + // when the notificationInfo has not been properly set yet + if (notificationInfo == null) { + return NO_NOTIFICATION_INFO; + } + if (notificationInfo.length == 0) { + return notificationInfo; + } else { + return notificationInfo.clone(); + } } /** diff --git a/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java b/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java index d58ab7d0e8f..6b420500552 100644 --- a/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java +++ b/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java @@ -169,6 +169,8 @@ public class CompositeDataInvocationHandler implements InvocationHandler { the only non-final methods in Object that are not handled above are finalize and clone, and these are not overridden in generated proxies. */ + // this plain Method.invoke is called only if the declaring class + // is Object and so it's safe. return method.invoke(this, args); } } diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java index 070c39d9cc2..116ca6d9eca 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java @@ -45,6 +45,9 @@ import javax.management.DescriptorRead; import javax.management.ImmutableDescriptor; import javax.management.MBeanAttributeInfo; import com.sun.jmx.remote.util.EnvHelp; +import sun.reflect.misc.ConstructorUtil; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** * Describes an attribute of an open MBean. @@ -690,6 +693,7 @@ public class OpenMBeanAttributeInfoSupport private static T convertFromString(String s, OpenType openType) { Class c; try { + ReflectUtil.checkPackageAccess(openType.safeGetClassName()); c = cast(Class.forName(openType.safeGetClassName())); } catch (ClassNotFoundException e) { throw new NoClassDefFoundError(e.toString()); // can't happen @@ -698,6 +702,8 @@ public class OpenMBeanAttributeInfoSupport // Look for: public static T valueOf(String) Method valueOf; try { + // It is safe to call this plain Class.getMethod because the class "c" + // was checked before by ReflectUtil.checkPackageAccess(openType.safeGetClassName()); valueOf = c.getMethod("valueOf", String.class); if (!Modifier.isStatic(valueOf.getModifiers()) || valueOf.getReturnType() != c) @@ -707,7 +713,7 @@ public class OpenMBeanAttributeInfoSupport } if (valueOf != null) { try { - return c.cast(valueOf.invoke(null, s)); + return c.cast(MethodUtil.invoke(valueOf, null, new Object[] {s})); } catch (Exception e) { final String msg = "Could not convert \"" + s + "\" using method: " + valueOf; @@ -718,6 +724,8 @@ public class OpenMBeanAttributeInfoSupport // Look for: public T(String) Constructor con; try { + // It is safe to call this plain Class.getConstructor because the class "c" + // was checked before by ReflectUtil.checkPackageAccess(openType.safeGetClassName()); con = c.getConstructor(String.class); } catch (NoSuchMethodException e) { con = null; diff --git a/jdk/src/share/classes/javax/management/relation/RelationNotification.java b/jdk/src/share/classes/javax/management/relation/RelationNotification.java index d9389f17233..a05aa719b1b 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationNotification.java +++ b/jdk/src/share/classes/javax/management/relation/RelationNotification.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package javax.management.relation; import javax.management.Notification; import javax.management.ObjectName; +import java.io.InvalidObjectException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -37,8 +38,11 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import com.sun.jmx.mbeanserver.GetPropertyAction; import static com.sun.jmx.mbeanserver.Util.cast; @@ -256,21 +260,14 @@ public class RelationNotification extends Notification { super(notifType, sourceObj, sequence, timeStamp, message); - // Can throw IllegalArgumentException - initMembers(1, - notifType, - sourceObj, - sequence, - timeStamp, - message, - id, - typeName, - objectName, - unregMBeanList, - null, - null, - null); - return; + if (!isValidBasic(notifType,sourceObj,id,typeName) || !isValidCreate(notifType)) { + throw new IllegalArgumentException("Invalid parameter."); + } + + relationId = id; + relationTypeName = typeName; + relationObjName = safeGetObjectName(objectName); + unregisterMBeanList = safeGetObjectNameList(unregMBeanList); } /** @@ -313,21 +310,17 @@ public class RelationNotification extends Notification { super(notifType, sourceObj, sequence, timeStamp, message); - // Can throw IllegalArgumentException - initMembers(2, - notifType, - sourceObj, - sequence, - timeStamp, - message, - id, - typeName, - objectName, - null, - name, - newValue, - oldValue); - return; + if (!isValidBasic(notifType,sourceObj,id,typeName) || !isValidUpdate(notifType,name,newValue,oldValue)) { + throw new IllegalArgumentException("Invalid parameter."); + } + + relationId = id; + relationTypeName = typeName; + relationObjName = safeGetObjectName(objectName); + + roleName = name; + oldRoleValue = safeGetObjectNameList(oldValue); + newRoleValue = safeGetObjectNameList(newValue); } // @@ -463,83 +456,64 @@ public class RelationNotification extends Notification { // - no role name (for role update) // - no role old value (for role update) // - no role new value (for role update) - private void initMembers(int notifKind, - String notifType, - Object sourceObj, - long sequence, - long timeStamp, - String message, - String id, - String typeName, - ObjectName objectName, - List unregMBeanList, - String name, - List newValue, - List oldValue) - throws IllegalArgumentException { - boolean badInitFlg = false; - - if (notifType == null || - sourceObj == null || - (!(sourceObj instanceof RelationService) && - !(sourceObj instanceof ObjectName)) || - id == null || - typeName == null) { - - badInitFlg = true; + private boolean isValidBasic(String notifType, Object sourceObj, String id, String typeName){ + if (notifType == null || sourceObj == null || + id == null || typeName == null) { + return false; } - if (notifKind == 1) { + if (!(sourceObj instanceof RelationService) && + !(sourceObj instanceof ObjectName)) { + return false; + } - if ((!(notifType.equals(RelationNotification.RELATION_BASIC_CREATION))) - && - (!(notifType.equals(RelationNotification.RELATION_MBEAN_CREATION))) - && - (!(notifType.equals(RelationNotification.RELATION_BASIC_REMOVAL))) - && - (!(notifType.equals(RelationNotification.RELATION_MBEAN_REMOVAL))) - ) { + return true; + } - // Creation/removal - badInitFlg = true; - } + private boolean isValidCreate(String notifType) { + String[] validTypes= {RelationNotification.RELATION_BASIC_CREATION, + RelationNotification.RELATION_MBEAN_CREATION, + RelationNotification.RELATION_BASIC_REMOVAL, + RelationNotification.RELATION_MBEAN_REMOVAL}; - } else if (notifKind == 2) { + Set ctSet = new HashSet(Arrays.asList(validTypes)); + return ctSet.contains(notifType); + } - if (((!(notifType.equals(RelationNotification.RELATION_BASIC_UPDATE))) - && - (!(notifType.equals(RelationNotification.RELATION_MBEAN_UPDATE)))) - || name == null || - oldValue == null || - newValue == null) { + private boolean isValidUpdate(String notifType, String name, + List newValue, List oldValue) { - // Role update - badInitFlg = true; + if (!(notifType.equals(RelationNotification.RELATION_BASIC_UPDATE)) && + !(notifType.equals(RelationNotification.RELATION_MBEAN_UPDATE))) { + return false; + } + + if (name == null || oldValue == null || newValue == null) { + return false; + } + + return true; + } + + private ArrayList safeGetObjectNameList(List src){ + ArrayList dest = null; + if (src != null) { + dest = new ArrayList(); + for (ObjectName item : src) { + // NPE thrown if we attempt to add null object + dest.add(ObjectName.getInstance(item)); } } + return dest; + } - if (badInitFlg) { - String excMsg = "Invalid parameter."; - throw new IllegalArgumentException(excMsg); + private ObjectName safeGetObjectName(ObjectName src){ + ObjectName dest = null; + if (src != null) { + dest = ObjectName.getInstance(src); } - - relationId = id; - relationTypeName = typeName; - relationObjName = objectName; - if (unregMBeanList != null) { - unregisterMBeanList = new ArrayList(unregMBeanList); - } - if (name != null) { - roleName = name; - } - if (oldValue != null) { - oldRoleValue = new ArrayList(oldValue); - } - if (newValue != null) { - newRoleValue = new ArrayList(newValue); - } - return; + return dest; } /** @@ -547,53 +521,56 @@ public class RelationNotification extends Notification { */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - if (compat) - { - // Read an object serialized in the old serial form - // + + String tmpRelationId, tmpRelationTypeName, tmpRoleName; + + ObjectName tmpRelationObjName; + List tmpNewRoleValue, tmpOldRoleValue, tmpUnregMBeanList; + ObjectInputStream.GetField fields = in.readFields(); - newRoleValue = cast(fields.get("myNewRoleValue", null)); - if (fields.defaulted("myNewRoleValue")) - { - throw new NullPointerException("newRoleValue"); + + if (compat) { + tmpRelationId = (String)fields.get("myRelId", null); + tmpRelationTypeName = (String)fields.get("myRelTypeName", null); + tmpRoleName = (String)fields.get("myRoleName", null); + + tmpRelationObjName = (ObjectName)fields.get("myRelObjName", null); + tmpNewRoleValue = cast(fields.get("myNewRoleValue", null)); + tmpOldRoleValue = cast(fields.get("myOldRoleValue", null)); + tmpUnregMBeanList = cast(fields.get("myUnregMBeanList", null)); } - oldRoleValue = cast(fields.get("myOldRoleValue", null)); - if (fields.defaulted("myOldRoleValue")) - { - throw new NullPointerException("oldRoleValue"); + else { + tmpRelationId = (String)fields.get("relationId", null); + tmpRelationTypeName = (String)fields.get("relationTypeName", null); + tmpRoleName = (String)fields.get("roleName", null); + + tmpRelationObjName = (ObjectName)fields.get("relationObjName", null); + tmpNewRoleValue = cast(fields.get("newRoleValue", null)); + tmpOldRoleValue = cast(fields.get("oldRoleValue", null)); + tmpUnregMBeanList = cast(fields.get("unregisterMBeanList", null)); } - relationId = (String) fields.get("myRelId", null); - if (fields.defaulted("myRelId")) - { - throw new NullPointerException("relationId"); + + // Validate fields we just read, throw InvalidObjectException + // if something goes wrong + + String notifType = super.getType(); + if (!isValidBasic(notifType,super.getSource(),tmpRelationId,tmpRelationTypeName) || + (!isValidCreate(notifType) && + !isValidUpdate(notifType,tmpRoleName,tmpNewRoleValue,tmpOldRoleValue))) { + + super.setSource(null); + throw new InvalidObjectException("Invalid object read"); } - relationObjName = (ObjectName) fields.get("myRelObjName", null); - if (fields.defaulted("myRelObjName")) - { - throw new NullPointerException("relationObjName"); - } - relationTypeName = (String) fields.get("myRelTypeName", null); - if (fields.defaulted("myRelTypeName")) - { - throw new NullPointerException("relationTypeName"); - } - roleName = (String) fields.get("myRoleName", null); - if (fields.defaulted("myRoleName")) - { - throw new NullPointerException("roleName"); - } - unregisterMBeanList = cast(fields.get("myUnregMBeanList", null)); - if (fields.defaulted("myUnregMBeanList")) - { - throw new NullPointerException("unregisterMBeanList"); - } - } - else - { - // Read an object serialized in the new serial form - // - in.defaultReadObject(); - } + + // assign deserialized vaules to object fields + relationObjName = safeGetObjectName(tmpRelationObjName); + newRoleValue = safeGetObjectNameList(tmpNewRoleValue); + oldRoleValue = safeGetObjectNameList(tmpOldRoleValue); + unregisterMBeanList = safeGetObjectNameList(tmpUnregMBeanList); + + relationId = tmpRelationId; + relationTypeName = tmpRelationTypeName; + roleName = tmpRoleName; } diff --git a/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java b/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java index 3cea5d44879..f78ff505105 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java +++ b/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java @@ -39,6 +39,7 @@ import java.security.PrivilegedAction; import com.sun.jmx.remote.util.ClassLogger; import com.sun.jmx.remote.util.EnvHelp; +import sun.reflect.misc.ReflectUtil; /** @@ -412,10 +413,10 @@ public class JMXConnectorFactory { } static T getProvider(JMXServiceURL serviceURL, - Map environment, + final Map environment, String providerClassName, Class targetInterface, - ClassLoader loader) + final ClassLoader loader) throws IOException { final String protocol = serviceURL.getProtocol(); @@ -425,11 +426,14 @@ public class JMXConnectorFactory { T instance = null; if (pkgs != null) { - environment.put(PROTOCOL_PROVIDER_CLASS_LOADER, loader); - instance = getProvider(protocol, pkgs, loader, providerClassName, targetInterface); + + if (instance != null) { + boolean needsWrap = (loader != instance.getClass().getClassLoader()); + environment.put(PROTOCOL_PROVIDER_CLASS_LOADER, needsWrap ? wrap(loader) : loader); + } } return instance; @@ -442,6 +446,21 @@ public class JMXConnectorFactory { return serviceLoader.iterator(); } + private static ClassLoader wrap(final ClassLoader parent) { + return parent != null ? AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + return new ClassLoader(parent) { + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + ReflectUtil.checkPackageAccess(name); + return super.loadClass(name, resolve); + } + }; + } + }) : null; + } + private static JMXConnector getConnectorAsService(ClassLoader loader, JMXServiceURL url, Map map) @@ -542,14 +561,9 @@ public class JMXConnectorFactory { } } - if (loader == null) - loader = AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - return - Thread.currentThread().getContextClassLoader(); - } - }); + if (loader == null) { + loader = Thread.currentThread().getContextClassLoader(); + } return loader; } @@ -557,5 +571,4 @@ public class JMXConnectorFactory { private static String protocol2package(String protocol) { return protocol.replace('+', '.').replace('-', '_'); } - } diff --git a/jdk/src/share/classes/javax/management/remote/NotificationResult.java b/jdk/src/share/classes/javax/management/remote/NotificationResult.java index 50e91a5e769..cbc79755099 100644 --- a/jdk/src/share/classes/javax/management/remote/NotificationResult.java +++ b/jdk/src/share/classes/javax/management/remote/NotificationResult.java @@ -89,7 +89,7 @@ public class NotificationResult implements Serializable { this.earliestSequenceNumber = earliestSequenceNumber; this.nextSequenceNumber = nextSequenceNumber; - this.targetedNotifications = targetedNotifications; + this.targetedNotifications = (targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone()); } /** @@ -122,7 +122,7 @@ public class NotificationResult implements Serializable { * listeners they correspond to. This array can be empty. */ public TargetedNotification[] getTargetedNotifications() { - return targetedNotifications; + return targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone(); } /** diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java index 3f880d0a8f9..294308d64a3 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java +++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java @@ -48,6 +48,7 @@ import javax.management.remote.JMXServerErrorException; import javax.management.remote.NotificationResult; import javax.management.remote.TargetedNotification; import javax.security.auth.Subject; +import sun.reflect.misc.ReflectUtil; import static com.sun.jmx.mbeanserver.Util.cast; import com.sun.jmx.remote.internal.ServerCommunicatorAdmin; @@ -1792,6 +1793,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { @Override protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + ReflectUtil.checkPackageAccess(name); try { super.loadClass(name, resolve); } catch(Exception e) { diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java index b3a4558d4b2..53e6754e6ed 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -103,6 +103,7 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.ssl.SslRMIClientSocketFactory; import javax.security.auth.Subject; +import sun.reflect.misc.ReflectUtil; import sun.rmi.server.UnicastRef2; import sun.rmi.transport.LiveRef; @@ -2002,7 +2003,9 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable @Override protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException { - return Class.forName(classDesc.getName(), false, loader); + String name = classDesc.getName(); + ReflectUtil.checkPackageAccess(name); + return Class.forName(name, false, loader); } private final ClassLoader loader; diff --git a/jdk/src/share/classes/javax/naming/BinaryRefAddr.java b/jdk/src/share/classes/javax/naming/BinaryRefAddr.java index 541c0342094..711a834087b 100644 --- a/jdk/src/share/classes/javax/naming/BinaryRefAddr.java +++ b/jdk/src/share/classes/javax/naming/BinaryRefAddr.java @@ -89,9 +89,9 @@ public class BinaryRefAddr extends RefAddr { * @param src The non-null contents of the address as a byte array. * The contents of src is copied into the new BinaryRefAddr. * @param offset The starting index in src to get the bytes. - * 0 <= offset <= src.length. + * {@code 0 <= offset <= src.length}. * @param count The number of bytes to extract from src. - * 0 <= count <= src.length-offset. + * {@code 0 <= count <= src.length-offset}. */ public BinaryRefAddr(String addrType, byte[] src, int offset, int count) { super(addrType); diff --git a/jdk/src/share/classes/javax/naming/CompositeName.java b/jdk/src/share/classes/javax/naming/CompositeName.java index fe9a09966c8..ffa837d4a23 100644 --- a/jdk/src/share/classes/javax/naming/CompositeName.java +++ b/jdk/src/share/classes/javax/naming/CompositeName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import java.util.Properties; * The most significant component is at index 0. * An empty composite name has no components. *

        - *

        JNDI Composite Name Syntax

        + *

        JNDI Composite Name Syntax

        * JNDI defines a standard string representation for composite names. This * representation is the concatenation of the components of a composite name * from left to right using the component separator (a forward @@ -73,12 +73,12 @@ import java.util.Properties; * a separator) denotes a trailing empty component. * Adjacent component separators denote an empty component. *

        - *

        Composite Name Examples

        + *

        Composite Name Examples

        *This table shows examples of some composite names. Each row shows *the string form of a composite name and its corresponding structural form *(CompositeName). *

        - +
        @@ -137,14 +137,14 @@ import java.util.Properties;
        String Name
        *

        - *

        Composition Examples

        + *

        Composition Examples

        * Here are some composition examples. The right column shows composing * string composite names while the left column shows composing the * corresponding CompositeNames. Notice that composing the * string forms of two composite names simply involves concatenating * their string forms together. -

        +

        @@ -189,7 +189,7 @@ import java.util.Properties;
        String Names
        *

        - *

        Multithreaded Access

        + *

        Multithreaded Access

        * A CompositeName instance is not synchronized against concurrent * multithreaded access. Multiple threads trying to access and modify a * CompositeName should lock the object. diff --git a/jdk/src/share/classes/javax/naming/CompoundName.java b/jdk/src/share/classes/javax/naming/CompoundName.java index 76bd672cf01..49269e6bc4a 100644 --- a/jdk/src/share/classes/javax/naming/CompoundName.java +++ b/jdk/src/share/classes/javax/naming/CompoundName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import java.util.Properties; * The most significant component is at index 0. * An empty compound name has no components. *

        - *

        Compound Name Syntax

        + *

        Compound Name Syntax

        * The syntax of a compound name is specified using a set of properties: *
        *
        jndi.syntax.direction @@ -136,7 +136,7 @@ import java.util.Properties; * so that when the same string is parsed, it will yield the same components * of the original compound name. *

        - *

        Multithreaded Access

        + *

        Multithreaded Access

        * A CompoundName instance is not synchronized against concurrent * multithreaded access. Multiple threads trying to access and modify a * CompoundName should lock the object. diff --git a/jdk/src/share/classes/javax/naming/Context.java b/jdk/src/share/classes/javax/naming/Context.java index 567c401bf8a..36040e70fe3 100644 --- a/jdk/src/share/classes/javax/naming/Context.java +++ b/jdk/src/share/classes/javax/naming/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import java.util.Hashtable; * consists of a set of name-to-object bindings. * It contains methods for examining and updating these bindings. *

        - *

        Names

        + *

        Names

        * Each name passed as an argument to a Context method is relative * to that context. The empty name is used to name the context itself. * A name parameter may never be null. @@ -69,12 +69,12 @@ import java.util.Hashtable; * names in a composite namespace, at the discretion of the service * provider. *

        - *

        Exceptions

        + *

        Exceptions

        * All the methods in this interface can throw a NamingException or * any of its subclasses. See NamingException and their subclasses * for details on each exception. *

        - *

        Concurrent Access

        + *

        Concurrent Access

        * A Context instance is not guaranteed to be synchronized against * concurrent access by multiple threads. Threads that need to access * a single Context instance concurrently should synchronize amongst @@ -91,7 +91,7 @@ import java.util.Hashtable; * being followed. * *

        - *

        Parameters

        + *

        Parameters

        * A Name parameter passed to any method of the * Context interface or one of its subinterfaces * will not be modified by the service provider. @@ -103,7 +103,7 @@ import java.util.Hashtable; * The caller may subsequently modify it; the service provider may not. * *

        - *

        Environment Properties

        + *

        Environment Properties

        *

        * JNDI applications need a way to communicate various preferences * and properties that define the environment in which naming and @@ -138,7 +138,7 @@ import java.util.Hashtable; * *

        * - *

        Resource Files

        + *

        Resource Files

        *

        * To simplify the task of setting up the environment * required by a JNDI application, @@ -151,11 +151,11 @@ import java.util.Hashtable; * and the value is a string in the format defined * for that property. Here is an example of a JNDI resource file: * - *

        + * 
        {@code * java.naming.factory.object=com.sun.jndi.ldap.AttrsToCorba:com.wiz.from.Person * java.naming.factory.state=com.sun.jndi.ldap.CorbaToAttrs:com.wiz.from.Person * java.naming.factory.control=com.sun.jndi.ldap.ResponseControlFactory - *
        + * } * * The JNDI class library reads the resource files and makes the property * values freely available. Thus JNDI resource files should be considered @@ -165,7 +165,7 @@ import java.util.Hashtable; * There are two kinds of JNDI resource files: * provider and application. * - *
        Provider Resource Files
        + *

        Provider Resource Files

        * * Each service provider has an optional resource that lists properties * specific to that provider. The name of this resource is: @@ -200,7 +200,7 @@ import java.util.Hashtable; * The service provider's documentation should clearly state which * properties are allowed; other properties in the file will be ignored. * - *
        Application Resource Files
        + *

        Application Resource Files

        * * When an application is deployed, it will generally have several * codebase directories and JARs in its classpath. Similarly, when an @@ -232,7 +232,7 @@ import java.util.Hashtable; * collects and uses all of these export lists when searching for factory * classes. * - *
        Search Algorithm for Properties
        + *

        Search Algorithm for Properties

        * * When JNDI constructs an initial context, the context's environment * is initialized with properties defined in the environment parameter diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java index 6dbc5be0518..6a10cf6ce72 100644 --- a/jdk/src/share/classes/javax/naming/InitialContext.java +++ b/jdk/src/share/classes/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -258,6 +258,7 @@ public class InitialContext implements Context { * environment may be modified independently and it may be accessed * concurrently). * + * @param the type of the returned object * @param name * the name of the object to look up * @return the object bound to name @@ -276,11 +277,12 @@ public class InitialContext implements Context { /** * A static method to retrieve the named object. * See {@link #doLookup(Name)} for details. + * @param the type of the returned object * @param name * the name of the object to look up * @return the object bound to name * @throws NamingException if a naming exception is encountered - * @since 1.6 + * @since 1.6 */ @SuppressWarnings("unchecked") public static T doLookup(String name) diff --git a/jdk/src/share/classes/javax/naming/RefAddr.java b/jdk/src/share/classes/javax/naming/RefAddr.java index 72ca93334d6..92ac4320f5d 100644 --- a/jdk/src/share/classes/javax/naming/RefAddr.java +++ b/jdk/src/share/classes/javax/naming/RefAddr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,7 +91,8 @@ public abstract class RefAddr implements java.io.Serializable { * Determines whether obj is equal to this RefAddr. *

        * obj is equal to this RefAddr all of these conditions are true - *

          non-null + *
            + *
          • non-null *
          • instance of RefAddr *
          • obj has the same address type as this RefAddr (using String.compareTo()) *
          • both obj and this RefAddr's contents are null or they are equal diff --git a/jdk/src/share/classes/javax/naming/ReferralException.java b/jdk/src/share/classes/javax/naming/ReferralException.java index 7c67429a4a9..23d77cf3c65 100644 --- a/jdk/src/share/classes/javax/naming/ReferralException.java +++ b/jdk/src/share/classes/javax/naming/ReferralException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import java.util.Hashtable; * constructors and/or corresponding "set" methods). *

            * The following code sample shows how ReferralException can be used. - *

            + * 
            {@code * while (true) { * try { * bindings = ctx.listBindings(name); @@ -51,7 +51,7 @@ import java.util.Hashtable; * ctx = e.getReferralContext(); * } * } - *

            + * } *

            * ReferralException is an abstract class. Concrete implementations * determine its synchronization and serialization properties. diff --git a/jdk/src/share/classes/javax/naming/directory/Attribute.java b/jdk/src/share/classes/javax/naming/directory/Attribute.java index fda9e3de264..6ed0d9ad530 100644 --- a/jdk/src/share/classes/javax/naming/directory/Attribute.java +++ b/jdk/src/share/classes/javax/naming/directory/Attribute.java @@ -265,7 +265,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * If the attribute values are unordered, * this method returns the value that happens to be at that index. * @param ix The index of the value in the ordered list of attribute values. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @return The possibly null attribute value at index ix; * null if the attribute value is null. * @exception NamingException If a naming exception was encountered while @@ -284,7 +284,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * the front of the list (and their indices decremented by one). * * @param ix The index of the value to remove. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @return The possibly null attribute value at index ix that was removed; * null if the attribute value is null. * @exception IndexOutOfBoundsException If ix is outside the specified range. @@ -302,7 +302,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * IllegalStateException is thrown. * * @param ix The index in the ordered list of attribute values to add the new value. - * 0 <= ix <= size(). + * {@code 0 <= ix <= size()}. * @param attrVal The possibly null attribute value to add; if null, null is * the value added. * @exception IndexOutOfBoundsException If ix is outside the specified range. @@ -322,7 +322,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * In that case, IllegalStateException is thrown. * * @param ix The index of the value in the ordered list of attribute values. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @param attrVal The possibly null attribute value to use. * If null, 'null' replaces the old value. * @return The possibly null attribute value at index ix that was replaced. diff --git a/jdk/src/share/classes/javax/naming/directory/DirContext.java b/jdk/src/share/classes/javax/naming/directory/DirContext.java index 4b9fc59d6b6..e3728792c58 100644 --- a/jdk/src/share/classes/javax/naming/directory/DirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import javax.naming.*; * methods for examining and updating attributes * associated with objects, and for searching the directory. *

            - *

            Names

            + *

            Names

            * Each name passed as an argument to a DirContext method is relative * to that context. The empty name is used to name the context itself. * The name parameter may never be null. @@ -51,7 +51,7 @@ import javax.naming.*; * name argument to the Context methods. These same rules * apply to the name argument to the DirContext methods. *

            - *

            Attribute Models

            + *

            Attribute Models

            * There are two basic models of what attributes should be * associated with. First, attributes may be directly associated with a * DirContext object. @@ -81,7 +81,7 @@ import javax.naming.*; * whether an object's attributes are stored as part of the object, or stored * within the parent object and associated with the object's name. *

            - *

            Attribute Type Names

            + *

            Attribute Type Names

            * In the getAttributes() and search() methods, * you can supply the attributes to return by supplying a list of * attribute names (strings). @@ -113,7 +113,7 @@ import javax.naming.*; *
          * *

          - *

          Operational Attributes

          + *

          Operational Attributes

          *

          * Some directories have the notion of "operational attributes" which are * attributes associated with a directory object for administrative @@ -127,7 +127,7 @@ import javax.naming.*; * In order to retrieve operational attributes, you must name them explicitly. * *

          - *

          Named Context

          + *

          Named Context

          *

          * There are certain methods in which the name must resolve to a context * (for example, when searching a single level context). The documentation @@ -138,7 +138,7 @@ import javax.naming.*; * Aside from these methods, there is no requirement that the * named object be a DirContext. *

          - *

          Parameters

          + *

          Parameters

          *

          * An Attributes, SearchControls, or array object * passed as a parameter to any method will not be modified by the @@ -150,7 +150,7 @@ import javax.naming.*; * the caller. The caller may subsequently modify it; the service * provider will not. *

          - *

          Exceptions

          + *

          Exceptions

          *

          * All the methods in this interface can throw a NamingException or * any of its subclasses. See NamingException and their subclasses diff --git a/jdk/src/share/classes/javax/naming/event/EventContext.java b/jdk/src/share/classes/javax/naming/event/EventContext.java index f9ae24935a8..fd44876475b 100644 --- a/jdk/src/share/classes/javax/naming/event/EventContext.java +++ b/jdk/src/share/classes/javax/naming/event/EventContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ import javax.naming.NamingException; * Contains methods for registering/deregistering listeners to be notified of * events fired when objects named in a context changes. *

          - *

          Target

          + *

          Target

          * The name parameter in the addNamingListener() methods is referred * to as the target. The target, along with the scope, identify * the object(s) that the listener is interested in. @@ -59,7 +59,7 @@ import javax.naming.NamingException; * whether a EventContext supports registration * of nonexistent targets. *

          - *

          Event Source

          + *

          Event Source

          * The EventContext instance on which you invoke the * registration methods is the event source of the events that are * (potentially) generated. @@ -93,7 +93,7 @@ import javax.naming.NamingException; * it needs to keep a reference to the listener in order to remove it * later). It cannot expect to do a lookup() and get another instance of * a EventContext on which to perform the deregistration. - *

          Lifetime of Registration

          + *

          Lifetime of Registration

          * A registered listener becomes deregistered when: *
            *
          • It is removed using removeNamingListener(). @@ -105,7 +105,7 @@ import javax.naming.NamingException; * Until that point, a EventContext instance that has outstanding * listeners will continue to exist and be maintained by the service provider. * - *

            Listener Implementations

            + *

            Listener Implementations

            * The registration/deregistration methods accept an instance of * NamingListener. There are subinterfaces of NamingListener * for different of event types of NamingEvent. @@ -118,7 +118,7 @@ import javax.naming.NamingException; * of the listeners, this allows some service providers to optimize the * registration. * - *

            Threading Issues

            + *

            Threading Issues

            * * Like Context instances in general, instances of * EventContext are not guaranteed to be thread-safe. diff --git a/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java index cbd9b8ab853..4ab5a347f66 100644 --- a/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java +++ b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ import com.sun.naming.internal.ResourceManager; */ public abstract class ControlFactory { - /* + /** * Creates a new instance of a control factory. */ protected ControlFactory() { diff --git a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java index df77164af5f..8dde5cb7afc 100644 --- a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java @@ -38,7 +38,7 @@ import java.util.Hashtable; * javax.naming.InitialDirContext for details on synchronization, * and the policy for how an initial context is created. * - *

            Request Controls

            + *

            Request Controls

            * When you create an initial context (InitialLdapContext), * you can specify a list of request controls. * These controls will be used as the request controls for any diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java index 93d60c4afca..8cb5fb0be01 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,10 +78,8 @@ import java.util.Hashtable; *

            Context Request Controls

            * There are two ways in which a context instance gets its request controls: *
              - * - *
            1. ldapContext.newInstance(reqCtls) - *
            2. ldapContext.setRequestControls(reqCtls) - * + *
            3. ldapContext.newInstance(reqCtls) + *
            4. ldapContext.setRequestControls(reqCtls) *
            * where ldapContext is an instance of LdapContext. * Specifying null or an empty array for reqCtls @@ -102,12 +100,10 @@ import java.util.Hashtable; *

            Connection Request Controls

            * There are three ways in which connection request controls are set: *
              - * - *
            1. - * new InitialLdapContext(env, connCtls) - *
            2. refException.getReferralContext(env, connCtls) - *
            3. ldapContext.reconnect(connCtls); - * + *
            4. + * new InitialLdapContext(env, connCtls) + *
            5. refException.getReferralContext(env, connCtls) + *
            6. ldapContext.reconnect(connCtls); *
            * where refException is an instance of * LdapReferralException, and ldapContext is an diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapName.java b/jdk/src/share/classes/javax/naming/ldap/LdapName.java index 256f7530cdc..ce94537062d 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java @@ -443,7 +443,7 @@ public class LdapName implements Name { * @throws InvalidNameException if suffix is not a valid LDAP * name, or if the addition of the components would violate the * syntax rules of this LDAP name. - * @throws IndexOutOfBoundsException. + * @throws IndexOutOfBoundsException * If posn is outside the specified range. */ public Name addAll(int posn, Name suffix) @@ -474,7 +474,7 @@ public class LdapName implements Name { * Must be in the range [0,size()]. * * @return The updated name (not a new instance). - * @throws IndexOutOfBoundsException. + * @throws IndexOutOfBoundsException * If posn is outside the specified range. */ public Name addAll(int posn, List suffixRdns) { @@ -527,7 +527,7 @@ public class LdapName implements Name { * Must be in the range [0,size()]. * @return The updated LdapName, not a new instance. * Cannot be null. - * @exception IndexOutOfBoundsException. + * @exception IndexOutOfBoundsException * If posn is outside the specified range. * @exception InvalidNameException If adding comp at the * specified position would violate the name's syntax. diff --git a/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java b/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java index 07e29b7a36f..18c08e59933 100644 --- a/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java @@ -36,7 +36,7 @@ import com.sun.jndi.ldap.BerEncoder; * at which it invokes search operations. *

            * The following code sample shows how the class may be used: - *

            + * 
            {@code
              *
              *     // Open an LDAP association
              *     LdapContext ctx = new InitialLdapContext();
            @@ -89,13 +89,13 @@ import com.sun.jndi.ldap.BerEncoder;
              *     ctx.close();
              *     ...
              *
            - * 
            + * }
            *

            * This class implements the LDAPv3 Control for paged-results as defined in * RFC 2696. * * The control's value has the following ASN.1 definition: - *

            + * 
            {@code
              *
              *     realSearchControlValue ::= SEQUENCE {
              *         size      INTEGER (0..maxInt),
            @@ -104,7 +104,7 @@ import com.sun.jndi.ldap.BerEncoder;
              *         cookie    OCTET STRING
              *     }
              *
            - * 
            + * }
            * * @since 1.5 * @see PagedResultsResponseControl diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java index 486600f72fd..3aef9fdd9ec 100644 --- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java @@ -40,7 +40,7 @@ import com.sun.jndi.ldap.BerEncoder; * then the search operation is not performed and an error is returned. *

            * The following code sample shows how the class may be used: - *

            + * 
            {@code
              *
              *     // Open an LDAP association
              *     LdapContext ctx = new InitialLdapContext();
            @@ -85,7 +85,7 @@ import com.sun.jndi.ldap.BerEncoder;
              *     ctx.close();
              *     ...
              *
            - * 
            + * }
            *

            * This class implements the LDAPv3 Request Control for server-side sorting * as defined in diff --git a/jdk/src/share/classes/javax/net/ssl/SNIHostName.java b/jdk/src/share/classes/javax/net/ssl/SNIHostName.java index 1d02104e172..588a8547e11 100644 --- a/jdk/src/share/classes/javax/net/ssl/SNIHostName.java +++ b/jdk/src/share/classes/javax/net/ssl/SNIHostName.java @@ -295,8 +295,8 @@ public final class SNIHostName extends SNIServerName { * representing the hostname(s) to match * @throws NullPointerException if {@code regex} is * {@code null} - * @throws PatternSyntaxException if the regular expression's syntax - * is invalid + * @throws java.util.regex.PatternSyntaxException if the regular expression's + * syntax is invalid */ public static SNIMatcher createSNIMatcher(String regex) { if (regex == null) { diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java index 433361c6a6b..92e838623f4 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java @@ -211,7 +211,7 @@ import java.nio.ReadOnlyBufferException; * that the source buffer has enough room to hold a record (enlarging if * necessary), and then obtain more inbound data. * - *

            + * 
            {@code
              *   SSLEngineResult r = engine.unwrap(src, dst);
              *   switch (r.getStatus()) {
              *   BUFFER_OVERFLOW:
            @@ -238,7 +238,7 @@ import java.nio.ReadOnlyBufferException;
              *       break;
              *   // other cases: CLOSED, OK.
              *   }
            - * 
            + * }
            * *

            * Unlike SSLSocket, all methods of SSLEngine are @@ -442,7 +442,7 @@ public abstract class SSLEngine { *

                  * {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
                  *     engine.wrap(new ByteBuffer [] { src }, 0, 1, dst);}
            -     * 
            +     * 
            * * @param src * a ByteBuffer containing outbound application data @@ -478,7 +478,7 @@ public abstract class SSLEngine { *
                  * {@link #wrap(ByteBuffer [], int, int, ByteBuffer)
                  *     engine.wrap(srcs, 0, srcs.length, dst);}
            -     * 
            +     * 
            * * @param srcs * an array of ByteBuffers containing the @@ -597,7 +597,7 @@ public abstract class SSLEngine { *
                  * {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
                  *     engine.unwrap(src, new ByteBuffer [] { dst }, 0, 1);}
            -     * 
            +     * 
            * * @param src * a ByteBuffer containing inbound network data. @@ -633,7 +633,7 @@ public abstract class SSLEngine { *
                  * {@link #unwrap(ByteBuffer, ByteBuffer [], int, int)
                  *     engine.unwrap(src, dsts, 0, dsts.length);}
            -     * 
            +     * 
            * * @param src * a ByteBuffer containing inbound network data. diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java b/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java index 45dcddbdeca..93ad6a7b383 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java @@ -173,7 +173,7 @@ public class SSLEngineResult { * * @throws IllegalArgumentException * if the status or handshakeStatus - * arguments are null, or if <bytesConsumed or + * arguments are null, or if bytesConsumed or * bytesProduced is negative. */ public SSLEngineResult(Status status, HandshakeStatus handshakeStatus, diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java b/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java index 61f1ddcccce..3459545e96d 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java @@ -90,7 +90,7 @@ public interface SSLSessionContext { * @param seconds the new session timeout limit in seconds; zero means * there is no limit. * - * @exception IllegalArgumentException if the timeout specified is < 0. + * @exception IllegalArgumentException if the timeout specified is {@code < 0}. * @see #getSessionTimeout */ public void setSessionTimeout(int seconds) @@ -122,7 +122,7 @@ public interface SSLSessionContext { * * @param size the new session cache size limit; zero means there is no * limit. - * @exception IllegalArgumentException if the specified size is < 0. + * @exception IllegalArgumentException if the specified size is {@code < 0}. * @see #getSessionCacheSize */ public void setSessionCacheSize(int size) diff --git a/jdk/src/share/classes/javax/script/Invocable.java b/jdk/src/share/classes/javax/script/Invocable.java index e0b1bc78048..81d363c01e9 100644 --- a/jdk/src/share/classes/javax/script/Invocable.java +++ b/jdk/src/share/classes/javax/script/Invocable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,6 +63,7 @@ public interface Invocable { /** * Used to call top-level procedures and functions defined in scripts. * + * @param name of the procedure or function to call * @param args Arguments to pass to the procedure or function * @return The value returned by the procedure or function * @@ -79,6 +80,7 @@ public interface Invocable { * the interpreter. The methods of the interface * may be implemented using the invokeFunction method. * + * @param the type of the interface to return * @param clasz The Class object of the interface to return. * * @return An instance of requested interface - null if the requested interface is unavailable, @@ -95,6 +97,7 @@ public interface Invocable { * a scripting object compiled in the interpreter. The methods of the * interface may be implemented using the invokeMethod method. * + * @param the type of the interface to return * @param thiz The scripting object whose member functions are used to implement the methods of the interface. * @param clasz The Class object of the interface to return. * diff --git a/jdk/src/share/classes/javax/script/ScriptContext.java b/jdk/src/share/classes/javax/script/ScriptContext.java index 78247bb7436..8d1076b6d9f 100644 --- a/jdk/src/share/classes/javax/script/ScriptContext.java +++ b/jdk/src/share/classes/javax/script/ScriptContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,6 +78,7 @@ public interface ScriptContext { * @return The associated Bindings. Returns null if it has not * been set. * + * @param scope The scope * @throws IllegalArgumentException If no Bindings is defined for the * specified scope value in ScriptContext of this type. */ diff --git a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java index ae064acf9b7..298b4ad7b41 100644 --- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java +++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,6 +80,7 @@ public interface ScriptEngineFactory { * identify the ScriptEngine by the ScriptEngineManager. * For instance, an implementation based on the Mozilla Rhino Javascript engine might * return list containing {"javascript", "rhino"}. + * @return an immutable list of short names */ public List getNames(); @@ -144,8 +145,7 @@ public interface ScriptEngineFactory { * of the supported scripting language. For instance, an implementaton for a Javascript * engine might be; *

            - *

            -     * 
            +     * 
            {@code
                  * public String getMethodCallSyntax(String obj,
                  *                                   String m, String... args) {
                  *      String ret = obj;
            @@ -159,8 +159,7 @@ public interface ScriptEngineFactory {
                  *      ret += ")";
                  *      return ret;
                  * }
            -     *
            -     *
            + * }
            *

            * * @param obj The name representing the object whose method is to be invoked. The @@ -200,17 +199,17 @@ public interface ScriptEngineFactory { * Returns A valid scripting language executable progam with given statements. * For instance an implementation for a PHP engine might be: *

            - *

            
            +     * 
            {@code
                  * public String getProgram(String... statements) {
            -     *      $retval = "<?\n";
            +     *      $retval = "";
                  *
                  * }
            -     * 
            + * }
            * * @param statements The statements to be executed. May be return values of * calls to the getMethodCallSyntax and getOutputStatement methods. diff --git a/jdk/src/share/classes/javax/script/ScriptEngineManager.java b/jdk/src/share/classes/javax/script/ScriptEngineManager.java index 7ce42d89298..769c41c9686 100644 --- a/jdk/src/share/classes/javax/script/ScriptEngineManager.java +++ b/jdk/src/share/classes/javax/script/ScriptEngineManager.java @@ -28,9 +28,6 @@ import java.util.*; import java.security.*; import java.util.ServiceLoader; import java.util.ServiceConfigurationError; -import sun.reflect.CallerSensitive; -import sun.reflect.Reflection; -import sun.security.util.SecurityConstants; /** * The ScriptEngineManager implements a discovery and instantiation @@ -54,23 +51,14 @@ import sun.security.util.SecurityConstants; public class ScriptEngineManager { private static final boolean DEBUG = false; /** - * If the thread context ClassLoader can be accessed by the caller, - * then the effect of calling this constructor is the same as calling + * The effect of calling this constructor is the same as calling * ScriptEngineManager(Thread.currentThread().getContextClassLoader()). - * Otherwise, the effect is the same as calling ScriptEngineManager(null). * * @see java.lang.Thread#getContextClassLoader */ - @CallerSensitive public ScriptEngineManager() { ClassLoader ctxtLoader = Thread.currentThread().getContextClassLoader(); - if (canCallerAccessLoader(ctxtLoader, Reflection.getCallerClass())) { - if (DEBUG) System.out.println("using " + ctxtLoader); - init(ctxtLoader); - } else { - if (DEBUG) System.out.println("using bootstrap loader"); - init(null); - } + init(ctxtLoader); } /** @@ -420,41 +408,4 @@ public class ScriptEngineManager { /** Global bindings associated with script engines created by this manager. */ private Bindings globalScope; - - private boolean canCallerAccessLoader(ClassLoader loader, Class caller) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - ClassLoader callerLoader = getClassLoader(caller); - if (!sun.misc.VM.isSystemDomainLoader(callerLoader)) { - if (loader != callerLoader || !isAncestor(loader, callerLoader)) { - try { - sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); - } catch (SecurityException exp) { - if (DEBUG) exp.printStackTrace(); - return false; - } - } // else fallthru.. - } // else fallthru.. - } // else fallthru.. - - return true; - } - - // Note that this code is same as ClassLoader.getClassLoader(). - // But, that method is package private and hence we can't call here. - private ClassLoader getClassLoader(Class caller) { - if (caller == null) { - return null; - } - return caller.getClassLoader(); - } - - // is cl1 ancestor of cl2? - private boolean isAncestor(ClassLoader cl1, ClassLoader cl2) { - do { - cl2 = cl2.getParent(); - if (cl1 == cl2) return true; - } while (cl2 != null); - return false; - } } diff --git a/jdk/src/share/classes/javax/script/SimpleScriptContext.java b/jdk/src/share/classes/javax/script/SimpleScriptContext.java index 98f8c81d5e3..a5bf12f9a22 100644 --- a/jdk/src/share/classes/javax/script/SimpleScriptContext.java +++ b/jdk/src/share/classes/javax/script/SimpleScriptContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,9 @@ public class SimpleScriptContext implements ScriptContext { */ protected Bindings globalScope; - + /** + * Create a {@code SimpleScriptContext}. + */ public SimpleScriptContext() { engineScope = new SimpleBindings(); globalScope = null; diff --git a/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java b/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java index 4c6e9a271fa..843accac99b 100644 --- a/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java +++ b/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java @@ -79,7 +79,7 @@ public interface CallbackHandler { * This example code is for guidance only. Many details, * including proper error handling, are left out for simplicity. * - *
            +     * 
            {@code
                  * public void handle(Callback[] callbacks)
                  * throws IOException, UnsupportedCallbackException {
                  *
            @@ -133,7 +133,7 @@ public interface CallbackHandler {
                  * private char[] readPassword(InputStream in) throws IOException {
                  *    // insert code to read a user password from the input stream
                  * }
            -     * 
            + * }
            * * @param callbacks an array of Callback objects provided * by an underlying security service which contains diff --git a/jdk/src/share/classes/javax/security/sasl/Sasl.java b/jdk/src/share/classes/javax/security/sasl/Sasl.java index 6bdc104b98a..bb9fb2eec04 100644 --- a/jdk/src/share/classes/javax/security/sasl/Sasl.java +++ b/jdk/src/share/classes/javax/security/sasl/Sasl.java @@ -278,7 +278,7 @@ public class Sasl { * * This method uses the JCA Security Provider Framework, described in the - * "Java Cryptography Architecture API Specification & Reference", for + * "Java Cryptography Architecture API Specification & Reference", for * locating and selecting a SaslClient implementation. * * First, it @@ -303,7 +303,7 @@ public class Sasl { * SaslClientFactory.DIGEST-MD5 com.wiz.sasl.digest.ClientFactory *

            * See the - * "Java Cryptography Architecture API Specification & Reference" + * "Java Cryptography Architecture API Specification & Reference" * for information about how to install and configure security service * providers. * @@ -428,7 +428,7 @@ public class Sasl { * This method uses the JCA Security Provider Framework, * described in the - * "Java Cryptography Architecture API Specification & Reference", for + * "Java Cryptography Architecture API Specification & Reference", for * locating and selecting a SaslServer implementation. * * First, it @@ -453,7 +453,7 @@ public class Sasl { * SaslServerFactory.DIGEST-MD5 com.wiz.sasl.digest.ServerFactory *

            * See the - * "Java Cryptography Architecture API Specification & Reference" + * "Java Cryptography Architecture API Specification & Reference" * for information about how to install and configure security * service providers. * diff --git a/jdk/src/share/classes/javax/security/sasl/SaslClient.java b/jdk/src/share/classes/javax/security/sasl/SaslClient.java index 010246c4b13..10f8d3dc3c2 100644 --- a/jdk/src/share/classes/javax/security/sasl/SaslClient.java +++ b/jdk/src/share/classes/javax/security/sasl/SaslClient.java @@ -38,13 +38,13 @@ package javax.security.sasl; *

            * Here's an example of how an LDAP library might use a SaslClient. * It first gets an instance of a SaslClient: - *

            + *
            {@code
              * SaslClient sc = Sasl.createSaslClient(mechanisms,
              *     authorizationId, protocol, serverName, props, callbackHandler);
            - *
            + *}
            * It can then proceed to use the client for authentication. * For example, an LDAP library might use the client as follows: - *
            + *
            {@code
              * // Get initial response and send to server
              * byte[] response = (sc.hasInitialResponse() ? sc.evaluateChallenge(new byte[0]) :
              *     null);
            @@ -74,7 +74,7 @@ package javax.security.sasl;
              *      ldap.out = new SecureOutputStream(sc, ldap.out);
              *    }
              * }
            - *
            + *}
            * * If the mechanism has an initial response, the library invokes * evaluateChallenge() with an empty diff --git a/jdk/src/share/classes/javax/security/sasl/SaslServer.java b/jdk/src/share/classes/javax/security/sasl/SaslServer.java index 54ba6843411..ec5d20a230d 100644 --- a/jdk/src/share/classes/javax/security/sasl/SaslServer.java +++ b/jdk/src/share/classes/javax/security/sasl/SaslServer.java @@ -47,7 +47,7 @@ package javax.security.sasl; * For example, suppose the LDAP server received an LDAP BIND request * containing the name of the SASL mechanism and an (optional) initial * response. It then might use the server as follows: - *
            + *
            {@code
              * while (!ss.isComplete()) {
              *     try {
              *         byte[] challenge = ss.evaluateResponse(response);
            @@ -75,7 +75,7 @@ package javax.security.sasl;
              *      ldap.out = new SecureOutputStream(ss, ldap.out);
              *    }
              * }
            - *
            + *}
            * * @since 1.5 * diff --git a/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java b/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java index 94859e83098..7caa52eb5d6 100644 --- a/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java +++ b/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java @@ -121,7 +121,7 @@ public final class ResponseAPDU implements java.io.Serializable { * Returns the value of the status bytes SW1 and SW2 as a single * status word SW. * It is defined as - * (getSW1() << 8) | getSW2(). + * {@code (getSW1() << 8) | getSW2()} * * @return the value of the status word SW. */ diff --git a/jdk/src/share/classes/javax/sound/midi/MetaMessage.java b/jdk/src/share/classes/javax/sound/midi/MetaMessage.java index f0025a432d0..b7c235565f3 100644 --- a/jdk/src/share/classes/javax/sound/midi/MetaMessage.java +++ b/jdk/src/share/classes/javax/sound/midi/MetaMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,6 @@ package javax.sound.midi; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; - /** * A MetaMessage is a {@link MidiMessage} that is not meaningful to synthesizers, but @@ -71,14 +67,6 @@ public class MetaMessage extends MidiMessage { */ public static final int META = 0xFF; // 255 - - // Default meta message data: just the META status byte value - // $$kk: 09.09.99: need a real event here!! - - private static byte[] defaultMessage = { (byte)META, 0 }; - - - // Instance variables /** @@ -98,8 +86,8 @@ public class MetaMessage extends MidiMessage { * to set them subsequently. */ public MetaMessage() { - //super(defaultMessage); - this(defaultMessage); + // Default meta message data: just the META status byte value + this(new byte[]{(byte) META, 0}); } /** diff --git a/jdk/src/share/classes/javax/sound/sampled/Mixer.java b/jdk/src/share/classes/javax/sound/sampled/Mixer.java index a7f0081a73f..c4d0ccbef03 100644 --- a/jdk/src/share/classes/javax/sound/sampled/Mixer.java +++ b/jdk/src/share/classes/javax/sound/sampled/Mixer.java @@ -253,22 +253,22 @@ public interface Mixer extends Line { /** * Mixer name. */ - private /*final*/ String name; + private final String name; /** * Mixer vendor. */ - private /*final*/ String vendor; + private final String vendor; /** * Mixer description. */ - private /*final*/ String description; + private final String description; /** * Mixer version. */ - private /*final*/ String version; + private final String version; /** * Constructs a mixer's info object, passing it the given diff --git a/jdk/src/share/classes/javax/sql/CommonDataSource.java b/jdk/src/share/classes/javax/sql/CommonDataSource.java index 25b40686d87..51f5ea03eb7 100644 --- a/jdk/src/share/classes/javax/sql/CommonDataSource.java +++ b/jdk/src/share/classes/javax/sql/CommonDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,8 @@ public interface CommonDataSource { * In the worst case, this may be the root Logger. * * @return the parent Logger for this data source - * @throws SQLFeatureNotSupportedException if the data source does not use java.util.logging. + * @throws SQLFeatureNotSupportedException if the data source does not use + * {@code java.util.logging} * @since 1.7 */ public Logger getParentLogger() throws SQLFeatureNotSupportedException; diff --git a/jdk/src/share/classes/javax/sql/ConnectionPoolDataSource.java b/jdk/src/share/classes/javax/sql/ConnectionPoolDataSource.java index 8bb34ed273b..6388735adc6 100644 --- a/jdk/src/share/classes/javax/sql/ConnectionPoolDataSource.java +++ b/jdk/src/share/classes/javax/sql/ConnectionPoolDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import java.sql.SQLException; * A factory for PooledConnection * objects. An object that implements this interface will typically be * registered with a naming service that is based on the - * JavaTM Naming and Directory Interface + * Java™ Naming and Directory Interface * (JNDI). * * @since 1.4 diff --git a/jdk/src/share/classes/javax/sql/DataSource.java b/jdk/src/share/classes/javax/sql/DataSource.java index d4d9d70ddd4..71fa074e204 100644 --- a/jdk/src/share/classes/javax/sql/DataSource.java +++ b/jdk/src/share/classes/javax/sql/DataSource.java @@ -36,7 +36,7 @@ import java.sql.Wrapper; * is the preferred means of getting a connection. An object that implements * the {@code DataSource} interface will typically be * registered with a naming service based on the - * JavaTM Naming and Directory (JNDI) API. + * Java™ Naming and Directory (JNDI) API. *

            * The {@code DataSource} interface is implemented by a driver vendor. * There are three types of implementations: @@ -82,7 +82,7 @@ public interface DataSource extends CommonDataSource, Wrapper { * * @return a connection to the data source * @exception SQLException if a database access error occurs - * @throws SQLTimeoutException when the driver has determined that the + * @throws java.sql.SQLTimeoutException when the driver has determined that the * timeout value specified by the {@code setLoginTimeout} method * has been exceeded and has at least tried to cancel the * current database connection attempt @@ -98,7 +98,7 @@ public interface DataSource extends CommonDataSource, Wrapper { * @param password the user's password * @return a connection to the data source * @exception SQLException if a database access error occurs - * @throws SQLTimeoutException when the driver has determined that the + * @throws java.sql.SQLTimeoutException when the driver has determined that the * timeout value specified by the {@code setLoginTimeout} method * has been exceeded and has at least tried to cancel the * current database connection attempt diff --git a/jdk/src/share/classes/javax/sql/RowSet.java b/jdk/src/share/classes/javax/sql/RowSet.java index fd33529667e..38cd35a3c3c 100644 --- a/jdk/src/share/classes/javax/sql/RowSet.java +++ b/jdk/src/share/classes/javax/sql/RowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ import java.util.*; /** * The interface that adds support to the JDBC API for the - * JavaBeansTM component model. + * JavaBeans™ component model. * A rowset, which can be used as a JavaBeans component in * a visual Bean development environment, can be created and * configured at design time and executed at run time. diff --git a/jdk/src/share/classes/javax/sql/XADataSource.java b/jdk/src/share/classes/javax/sql/XADataSource.java index 325f015f733..b768601c7f3 100644 --- a/jdk/src/share/classes/javax/sql/XADataSource.java +++ b/jdk/src/share/classes/javax/sql/XADataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ import java.sql.*; * A factory for {@code XAConnection} objects that is used internally. * An object that implements the {@code XADataSource} interface is * typically registered with a naming service that uses the - * Java Naming and Directory InterfaceTM + * Java Naming and Directory Interface™ * (JNDI). *

            * An implementation of {@code XADataSource} must include a public no-arg diff --git a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java index 1019b8de19f..1ca60adbfa4 100644 --- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import javax.sql.rowset.serial.*; /** * An abstract class providing a RowSet object with its basic functionality. * The basic functions include having properties and sending event notifications, - * which all JavaBeansTM components must implement. + * which all JavaBeans™ components must implement. *

            *

            1.0 Overview

            * The BaseRowSet class provides the core functionality @@ -93,7 +93,7 @@ import javax.sql.rowset.serial.*; * NOTE: In order to use a DataSource object for making a * connection, the DataSource object must have been registered * with a naming service that uses the Java Naming and Directory - * InterfaceTM (JNDI) API. This registration + * Interface™ (JNDI) API. This registration * is usually done by a person acting in the capacity of a system administrator. *

            *

            3.0 Setting the Command and Its Parameters

            @@ -106,13 +106,13 @@ import javax.sql.rowset.serial.*; * to null if required. *

            * The following code fragment illustrates how the - * CachedRowSetTM + * CachedRowSet™ * object crs might have its command property set. Note that if a * tool is used to set properties, this is the code that the tool would use. - *

            + * 
            {@code
              *    crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
              *                   "WHERE CREDIT_LIMIT > ? AND REGION = ?");
            - * 
            + * }
            *

            * In this example, the values for CREDIT_LIMIT and * REGION are placeholder parameters, which are indicated with a @@ -129,16 +129,16 @@ import javax.sql.rowset.serial.*; *

            * The following code fragment demonstrates * setting the two parameters in the query from the previous example. - *

            + * 
            {@code
              *    crs.setInt(1, 5000);
              *    crs.setString(2, "West");
            - * 
            + * }
            * If the execute method is called at this point, the query * sent to the DBMS will be: - *
            + * 
            {@code
              *    "SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
              *                   "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'"
            - * 
            + * }
            * NOTE: Setting Array, Clob, Blob and * Ref objects as a command parameter, stores these values as * SerialArray, SerialClob, SerialBlob @@ -158,7 +158,7 @@ import javax.sql.rowset.serial.*; * When the method execute is called, the values in the * Hashtable object are substituted for the appropriate placeholder * parameters in the command. - * + *

            * A call to the method getParams returns the values stored in the * Hashtable object as an array of Object instances. * An element in this array may be a simple Object instance or an @@ -2535,7 +2535,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { * specific abstract data types. *

            * The parameter value set by this method is stored internally and - * will be supplied as the appropriate parameter in this RowSetRowSet * object's command when the method execute is called. * Methods such as execute and populate must be * provided in any class that extends this class and implements one or diff --git a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java index 7861223911b..26862715edf 100644 --- a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ import javax.sql.rowset.spi.*; * A CachedRowSet object is a container for rows of data * that caches its rows in memory, which makes it possible to operate without always being * connected to its data source. Further, it is a - * JavaBeansTM component and is scrollable, + * JavaBeans™ component and is scrollable, * updatable, and serializable. A CachedRowSet object typically * contains rows from a result set, but it can also contain rows from any file * with a tabular format, such as a spread sheet. The reference implementation @@ -118,7 +118,7 @@ import javax.sql.rowset.spi.*; *

            * There are two ways for a CachedRowSet object to specify which * SyncProvider object it will use. - * *

          • Supplying the name of the implementation to the constructor
            * The following line of code creates the CachedRowSet * object crs2 that is initialized with default values except that its @@ -135,7 +135,7 @@ import javax.sql.rowset.spi.*; *
              *           crs.setSyncProvider("com.fred.providers.HighAvailabilityProvider");
              *      
            - * * See the comments for SyncFactory and SyncProvider for * more details. * @@ -410,7 +410,7 @@ import javax.sql.rowset.spi.*; * NOTE: In order to use a DataSource object for making a * connection, the DataSource object must have been registered * with a naming service that uses the Java Naming and Directory - * InterfaceTM (JNDI) API. This registration + * Interface™ (JNDI) API. This registration * is usually done by a person acting in the capacity of a system * administrator. *

            @@ -426,10 +426,10 @@ import javax.sql.rowset.spi.*; * The following code fragment illustrates how the CachedRowSet * object crs might have its command property set. Note that if a * tool is used to set properties, this is the code that the tool would use. - *

            + * 
            {@code
              *    crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS " +
              *                   "WHERE CREDIT_LIMIT > ? AND REGION = ?");
            - * 
            + * }
            *

            * The values that will be used to set the command's placeholder parameters are * contained in the RowSet object's params field, which is a @@ -457,7 +457,7 @@ import javax.sql.rowset.spi.*; * The following code fragment gives an idea of how the reader * does this, after obtaining the Connection object * con. - *

            + * 
            {@code
              *    PreparedStatement pstmt = con.prepareStatement(crs.getCommand());
              *    reader.decodeParams();
              *    // decodeParams figures out which setter methods to use and does something
            @@ -465,16 +465,16 @@ import javax.sql.rowset.spi.*;
              *    //    for (i = 0; i < params.length; i++) {
              *    //        pstmt.setObject(i + 1, params[i]);
              *    //    }
            - * 
            + * }
            *

            - * At this point, the command for crs is the query "SELECT + * At this point, the command for crs is the query {@code "SELECT * FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS WHERE CREDIT_LIMIT > 5000 - * AND REGION = "West". After the readData method executes + * AND REGION = "West"}. After the readData method executes * this command with the following line of code, it will have the data from * rs with which to populate crs. - *

            + * 
            {@code
              *     ResultSet rs = pstmt.executeQuery();
            - * 
            + * }
            *

            * The preceding code fragments give an idea of what goes on behind the * scenes; they would not appear in an application, which would not invoke @@ -484,13 +484,13 @@ import javax.sql.rowset.spi.*; * the command. Simply by calling the execute method, * crs populates itself with the requested data from the * table CUSTOMERS. - *

            + * 
            {@code
              *    crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +
              *                   "WHERE CREDIT_LIMIT > ? AND REGION = ?");
              *    crs.setInt(1, 5000);
              *    crs.setString(2, "West");
              *    crs.execute();
            - * 
            + * }
            * *

            10.0 Paging Data

            * Because a CachedRowSet object stores data in memory, @@ -734,7 +734,6 @@ public interface CachedRowSet extends RowSet, Joinable { * source. Otherwise, the application must explicity call the * commit() or rollback() methods as appropriate. * - * @throws SQLException if the cursor is on the insert row * @throws SyncProviderException if the underlying * synchronization provider's writer fails to write the updates * back to the data source @@ -805,7 +804,6 @@ public interface CachedRowSet extends RowSet, Joinable { * commit or rollback methods as appropriate. * * @param con a standard JDBC Connection object - * @throws SQLException if the cursor is on the insert row * @throws SyncProviderException if the underlying * synchronization provider's writer fails to write the updates * back to the data source @@ -1371,7 +1369,7 @@ public interface CachedRowSet extends RowSet, Joinable { * Applications can form a WebRowSet object from the CachedRowSet * object returned by this method in order * to export the RowSet schema definition to XML for future use. - * + * @return An empty copy of this {@code CachedRowSet} object * @throws SQLException if an error occurs in cloning the structure of this * CachedRowSet object * @see #createShared @@ -1543,6 +1541,7 @@ public interface CachedRowSet extends RowSet, Joinable { * @param numRows when populating, the number of rows interval on which the * CachedRowSet populated should fire; the default value * is zero; cannot be less than fetchSize or zero + * @throws SQLException {@code numRows < 0 or numRows < getFetchSize() } */ public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException; diff --git a/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java b/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java index 15bfa42a840..754bc49159d 100644 --- a/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/FilteredRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ import java.math.*; *

            * A JDBC FilteredRowSet standard implementation implements the * RowSet interfaces and extends the - * CachedRowSetTM class. The + * CachedRowSet™ class. The * CachedRowSet class provides a set of protected cursor manipulation * methods, which a FilteredRowSet implementation can override * to supply filtering support. @@ -69,8 +69,8 @@ import java.math.*; * class JavaDoc), a FilteredRowSet could then be used as described * below. *

            - * *

            + * {@code
              *     FilteredRowSet frs = new FilteredRowSetImpl();
              *     frs.populate(rs);
              *
            @@ -78,8 +78,8 @@ import java.math.*;
              *     frs.setFilter(name);
              *
              *     frs.next() // only names from "Alpha" to "Bravo" will be returned
            + * }
              * 
            - * * In the example above, we initialize a Range object which * implements the Predicate interface. This object expresses * the following constraints: All rows outputted or modified from this diff --git a/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java b/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java index 448f4cd8ce4..bcb05d104dc 100644 --- a/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/JdbcRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import java.io.*; * *

            1.0 Overview

            * A wrapper around a ResultSet object that makes it possible - * to use the result set as a JavaBeansTM + * to use the result set as a JavaBeans™ * component. Thus, a JdbcRowSet object can be one of the Beans that * a tool makes available for composing an application. Because * a JdbcRowSet is a connected rowset, that is, it continually @@ -113,7 +113,7 @@ import java.io.*; *

            * The implementation of the RowSet method execute in the * JdbcRowSet reference implementation differs from that in the - * CachedRowSetTM + * CachedRowSet™ * reference implementation to account for the different * requirements of connected and disconnected RowSet objects. *

            @@ -238,6 +238,7 @@ public interface JdbcRowSet extends RowSet, Joinable { * call to either the method commit or the method rollback. By default, * new connections are in auto-commit mode. * + * @return {@code true} if auto-commit is enabled; {@code false} otherwise * @throws SQLException if a database access error occurs * @see java.sql.Connection#getAutoCommit() */ @@ -251,7 +252,8 @@ public interface JdbcRowSet extends RowSet, Joinable { * to allow an application to set the JdbcRowSet transaction behavior. *

            * Sets the current auto-commit mode for this Connection object. - * + * @param autoCommit {@code true} to enable auto-commit; {@code false} to + * disable auto-commit * @throws SQLException if a database access error occurs * @see java.sql.Connection#setAutoCommit(boolean) */ @@ -277,7 +279,7 @@ public interface JdbcRowSet extends RowSet, Joinable { * Undoes all changes made in the current transaction to the last set savepoint * and releases any database locks currently held by this Connection * object. This method should be used only when auto-commit mode has been disabled. - * + * @param s The {@code Savepoint} to rollback to * @throws SQLException if a database access error occurs or this Connection * object within this JdbcRowSet is in auto-commit mode. * @see #rollback diff --git a/jdk/src/share/classes/javax/sql/rowset/Joinable.java b/jdk/src/share/classes/javax/sql/rowset/Joinable.java index 7a789474b76..c15f44de54c 100644 --- a/jdk/src/share/classes/javax/sql/rowset/Joinable.java +++ b/jdk/src/share/classes/javax/sql/rowset/Joinable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -137,7 +137,7 @@ public interface Joinable { * object. A JoinRowSet object can now add this RowSet * object based on the match column. *

            - * Sub-interfaces such as the CachedRowSetTM + * Sub-interfaces such as the CachedRowSet™ * interface define the method CachedRowSet.setKeyColumns, which allows * primary key semantics to be enforced on specific columns. * Implementations of the setMatchColumn(int columnIdx) method diff --git a/jdk/src/share/classes/javax/sql/rowset/Predicate.java b/jdk/src/share/classes/javax/sql/rowset/Predicate.java index a9672c98e10..63d76fdca6b 100644 --- a/jdk/src/share/classes/javax/sql/rowset/Predicate.java +++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,8 +53,7 @@ import java.sql.*; * and application motivated implementations of Predicate to emerge. *

            * A sample implementation would look something like this: - *

            - * 
            + * 
            {@code
              *    public class Range implements Predicate {
              *
              *       private Object lo[];
            @@ -79,19 +78,19 @@ import java.sql.*;
              *              if ((rs.getObject(idx[i]) >= lo[i]) &&
              *                  (rs.getObject(idx[i]) >= hi[i]) {
              *                  bool1 = true; // within filter constraints
            + *              } else {
            + *                  bool2 = true; // outside of filter constraints
            + *              }
            + *          }
            + *
            + *          if (bool2) {
            + *             return false;
              *          } else {
            - *            bool2 = true; // outside of filter constraints
            + *             return true;
              *          }
              *      }
            - *
            - *      if (bool2) {
            - *         return false;
            - *      } else {
            - *         return true;
            - *      }
              *  }
            - * 
            - * 
            + * }
            *

            * The example above implements a simple range predicate. Note, that * implementations should but are not required to provider String @@ -112,7 +111,7 @@ public interface Predicate { * cursor moving from row to the next. In addition, if this internal method * moves the cursor onto a row that has been deleted, the internal method will * continue to ove the cursor until a valid row is found. - * + * @param rs The {@code RowSet} to be evaluated * @return true if there are more rows in the filter; * false otherwise */ diff --git a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java index e1b78a9202c..a5c998170c3 100644 --- a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java +++ b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java @@ -159,7 +159,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { * @param property true if the given column is * automatically incremented; false * otherwise - * @throws SQLException if a database access error occurs or + * @throws SQLException if a database access error occurs or * the given index is out of bounds */ public void setAutoIncrement(int columnIndex, boolean property) throws SQLException { @@ -195,7 +195,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { * value can be used in a WHERE clause; * false otherwise * - * @throws SQLException if a database access error occurs or + * @throws SQLException if a database access error occurs or * the given column number is out of bounds */ public void setSearchable(int columnIndex, boolean property) @@ -212,7 +212,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { * must be between 1 and the number of columns, * inclusive between 1 and the number of columns, inclusive * @param property true if the value is a cash value; false otherwise. - * @throws SQLException if a database access error occurs + * @throws SQLException if a database access error occurs * or the given column number is out of bounds */ public void setCurrency(int columnIndex, boolean property) @@ -233,7 +233,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { * columnNullable, or * columnNullableUnknown * - * @throws SQLException if a database access error occurs, + * @throws SQLException if a database access error occurs, * the given column number is out of bounds, or the value supplied * for the property parameter is not one of the following * constants: diff --git a/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java b/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java index 1dd2d8315e7..654bb88ea24 100644 --- a/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java +++ b/jdk/src/share/classes/javax/sql/rowset/RowSetProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,9 @@ public class RowSetProvider { debug = val != null && !"false".equals(val); } - + /** + * RowSetProvider constructor + */ protected RowSetProvider () { } diff --git a/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java b/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java index 57b9e438399..c110834c2cf 100644 --- a/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java +++ b/jdk/src/share/classes/javax/sql/rowset/RowSetWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ import java.sql.SQLException; * This class complements the SQLWarning class. *

            * Rowset warnings may be retrieved from JdbcRowSet, - * CachedRowSetTM, + * CachedRowSet™, * WebRowSet, FilteredRowSet, or JoinRowSet * implementations. To retrieve the first warning reported on any * RowSet diff --git a/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java b/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java index abef62f1271..3f0ba94b739 100644 --- a/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/WebRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,306 +33,310 @@ import java.math.*; import org.xml.sax.*; /** - * The standard interface that all implementations of a WebRowSet + * The standard interface that all implementations of a {@code WebRowSet} * must implement. *

            *

            1.0 Overview

            - * The WebRowSetImpl provides the standard + * The {@code WebRowSetImpl} provides the standard * reference implementation, which may be extended if required. *

            * The standard WebRowSet XML Schema definition is available at the following * URI: *

            * It describes the standard XML document format required when describing a - * RowSet object in XML and must be used be all standard implementations - * of the WebRowSet interface to ensure interoperability. In addition, - * the WebRowSet schema uses specific SQL/XML Schema annotations, + * {@code RowSet} object in XML and must be used be all standard implementations + * of the {@code WebRowSet} interface to ensure interoperability. In addition, + * the {@code WebRowSet} schema uses specific SQL/XML Schema annotations, * thus ensuring greater cross * platform inter-operability. This is an effort currently under way at the ISO * organization. The SQL/XML definition is available at the following URI: * - * The schema definition describes the internal data of a RowSet object + * The schema definition describes the internal data of a {@code RowSet} object * in three distinct areas: *
              - *
            • properties
            • - * These properties describe the standard synchronization provider properties in - * addition to the more general RowSet properties. - *

              - *

            • metadata
            • - * This describes the metadata associated with the tabular structure governed by a - * WebRowSet object. The metadata described is closely aligned with the - * metadata accessible in the underlying java.sql.ResultSet interface. - *

              - *

            • data
            • - * This describes the original data (the state of data since the last population - * or last synchronization of the WebRowSet object) and the current + *
            • properties - These properties describe the standard synchronization + * provider properties in addition to the more general {@code RowSet} properties. + *
            • + *
            • metadata - This describes the metadata associated with the tabular structure governed by a + * {@code WebRowSet} object. The metadata described is closely aligned with the + * metadata accessible in the underlying {@code java.sql.ResultSet} interface. + *
            • + *
            • data - This describes the original data (the state of data since the + * last population + * or last synchronization of the {@code WebRowSet} object) and the current * data. By keeping track of the delta between the original data and the current data, - * a WebRowSet maintains - * the ability to synchronize changes in its data back to the originating data source. + * a {@code WebRowSet} maintains the ability to synchronize changes + * in its data back to the originating data source. + *
            • *
            *

            *

            2.0 WebRowSet States

            - * The following sections demonstrates how a WebRowSet implementation + * The following sections demonstrates how a {@code WebRowSet} implementation * should use the XML Schema to describe update, insert, and delete operations - * and to describe the state of a WebRowSet object in XML. + * and to describe the state of a {@code WebRowSet} object in XML. *

            - *

            2.1 State 1 - Outputting a WebRowSet Object to XML

            - * In this example, a WebRowSet object is created and populated with a simple 2 column, - * 5 row table from a data source. Having the 5 rows in a WebRowSet object + *

            2.1 State 1 - Outputting a {@code WebRowSet} Object to XML

            + * In this example, a {@code WebRowSet} object is created and populated with a simple 2 column, + * 5 row table from a data source. Having the 5 rows in a {@code WebRowSet} object * makes it possible to describe them in XML. The * metadata describing the various standard JavaBeans properties as defined * in the RowSet interface plus the standard properties defined in - * the CachedRowSetTM interface + * the {@code CachedRowSet}™ interface * provide key details that describe WebRowSet * properties. Outputting the WebRowSet object to XML using the standard - * writeXml methods describes the internal properties as follows: + * {@code writeXml} methods describes the internal properties as follows: *
            - * <properties>
            - *       <command>select co1, col2 from test_table</command>
            - *      <concurrency>1</concurrency>
            - *      <datasource/>
            - *      <escape-processing>true</escape-processing>
            - *      <fetch-direction>0</fetch-direction>
            - *      <fetch-size>0</fetch-size>
            - *      <isolation-level>1</isolation-level>
            - *      <key-columns/>
            - *      <map/>
            - *      <max-field-size>0</max-field-size>
            - *      <max-rows>0</max-rows>
            - *      <query-timeout>0</query-timeout>
            - *      <read-only>false</read-only>
            - *      <rowset-type>TRANSACTION_READ_UNCOMMITED</rowset-type>
            - *      <show-deleted>false</show-deleted>
            - *      <table-name/>
            - *      <url>jdbc:thin:oracle</url>
            - *      <sync-provider>
            - *              <sync-provider-name>.com.rowset.provider.RIOptimisticProvider</sync-provider-name>
            - *              <sync-provider-vendor>Oracle Corporation</sync-provider-vendor>
            - *              <sync-provider-version>1.0</sync-provider-name>
            - *              <sync-provider-grade>LOW</sync-provider-grade>
            - *              <data-source-lock>NONE</data-source-lock>
            - *      </sync-provider>
            - * </properties>
            - * 
            + * {@code + * + * select co1, col2 from test_table + * 1 + * + * true + * 0 + * 0 + * 1 + * + * + * 0 + * 0 + * 0 + * false + * TRANSACTION_READ_UNCOMMITED + * false + * + * jdbc:thin:oracle + * + * .com.rowset.provider.RIOptimisticProvider + * Oracle Corporation + * 1.0 + * LOW + * NONE + * + * + * }
        * The meta-data describing the make up of the WebRowSet is described * in XML as detailed below. Note both columns are described between the - * column-definition tags. + * {@code column-definition} tags. *
        - * <metadata>
        - *      <column-count>2</column-count>
        - *      <column-definition>
        - *              <column-index>1</column-index>
        - *              <auto-increment>false</auto-increment>
        - *              <case-sensitive>true</case-sensitive>
        - *              <currency>false</currency>
        - *              <nullable>1</nullable>
        - *              <signed>false</signed>
        - *              <searchable>true</searchable>
        - *              <column-display-size>10</column-display-size>
        - *              <column-label>COL1</column-label>
        - *              <column-name>COL1</column-name>
        - *              <schema-name/>
        - *              <column-precision>10</column-precision>
        - *              <column-scale>0</column-scale>
        - *              <table-name/>
        - *              <catalog-name/>
        - *              <column-type>1</column-type>
        - *              <column-type-name>CHAR</column-type-name>
        - *      </column-definition>
        - *      <column-definition>
        - *              <column-index>2</column-index>
        - *              <auto-increment>false</auto-increment>
        - *              <case-sensitive>false</case-sensitive>
        - *              <currency>false</currency>
        - *              <nullable>1</nullable>
        - *              <signed>true</signed>
        - *              <searchable>true</searchable>
        - *              <column-display-size>39</column-display-size>
        - *              <column-label>COL2</column-label>
        - *              <column-name>COL2</column-name>
        - *              <schema-name/>
        - *              <column-precision>38</column-precision>
        - *              <column-scale>0</column-scale>
        - *              <table-name/>
        - *              <catalog-name/>
        - *              <column-type>3</column-type>
        - *              <column-type-name>NUMBER</column-type-name>
        - *      </column-definition>
        - * </metadata>
        - * 
        + * {@code + * + * 2 + * + * 1 + * false + * true + * false + * 1 + * false + * true + * 10 + * COL1 + * COL1 + * + * 10 + * 0 + * + * + * 1 + * CHAR + * + * + * 2 + * false + * false + * false + * 1 + * true + * true + * 39 + * COL2 + * COL2 + * + * 38 + * 0 + * + * + * 3 + * NUMBER + * + * + * }
        * Having detailed how the properties and metadata are described, the following details - * how the contents of a WebRowSet object is described in XML. Note, that - * this describes a WebRowSet object that has not undergone any + * how the contents of a {@code WebRowSet} object is described in XML. Note, that + * this describes a {@code WebRowSet} object that has not undergone any * modifications since its instantiation. - * A currentRow tag is mapped to each row of the table structure that the - * WebRowSet object provides. A columnValue tag may contain - * either the stringData or binaryData tag, according to + * A {@code currentRow} tag is mapped to each row of the table structure that the + * {@code WebRowSet} object provides. A {@code columnValue} tag may contain + * either the {@code stringData} or {@code binaryData} tag, according to * the SQL type that - * the XML value is mapping back to. The binaryData tag contains data in the - * Base64 encoding and is typically used for BLOB and CLOB type data. + * the XML value is mapping back to. The {@code binaryData} tag contains data in the + * Base64 encoding and is typically used for {@code BLOB} and {@code CLOB} type data. *
        - * <data>
        - *      <currentRow>
        - *              <columnValue>
        + * {@code
        + * 
        + *      
        + *              
          *                      firstrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      1
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      secondrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      2
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      thirdrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      3
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fourthrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      4
        - *              </columnValue>
        - *      </currentRow>
        - * </data>
        - * 
        + * + * + * + * } *

        2.2 State 2 - Deleting a Row

        - * Deleting a row in a WebRowSet object involves simply moving to the row - * to be deleted and then calling the method deleteRow, as in any other - * RowSet object. The following - * two lines of code, in which wrs is a WebRowSet object, delete + * Deleting a row in a {@code WebRowSet} object involves simply moving to the row + * to be deleted and then calling the method {@code deleteRow}, as in any other + * {@code RowSet} object. The following + * two lines of code, in which wrs is a {@code WebRowSet} object, delete * the third row. *
          *     wrs.absolute(3);
          *     wrs.deleteRow();
          * 
        - * The XML description shows the third row is marked as a deleteRow, - * which eliminates the third row in the WebRowSet object. + * The XML description shows the third row is marked as a {@code deleteRow}, + * which eliminates the third row in the {@code WebRowSet} object. *
        - * <data>
        - *      <currentRow>
        - *              <columnValue>
        + * {@code
        + * 
        + *      
        + *              
          *                      firstrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      1
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      secondrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      2
        - *              </columnValue>
        - *      </currentRow>
        - *      <deleteRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      thirdrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      3
        - *              </columnValue>
        - *      </deleteRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fourthrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      4
        - *              </columnValue>
        - *      </currentRow>
        - * </data>
        - * 
        + * + * + * + *} *

        2.3 State 3 - Inserting a Row

        - * A WebRowSet object can insert a new row by moving to the insert row, + * A {@code WebRowSet} object can insert a new row by moving to the insert row, * calling the appropriate updater methods for each column in the row, and then - * calling the method insertRow. + * calling the method {@code insertRow}. *
        + * {@code
          * wrs.moveToInsertRow();
          * wrs.updateString(1, "fifththrow");
          * wrs.updateString(2, "5");
          * wrs.insertRow();
        - * 
        + * } * The following code fragment changes the second column value in the row just inserted. * Note that this code applies when new rows are inserted right after the current row, - * which is why the method next moves the cursor to the correct row. - * Calling the method acceptChanges writes the change to the data source. + * which is why the method {@code next} moves the cursor to the correct row. + * Calling the method {@code acceptChanges} writes the change to the data source. * *
        - * wrs.moveToCurrentRow();
        + * {@code wrs.moveToCurrentRow();
          * wrs.next();
          * wrs.updateString(2, "V");
          * wrs.acceptChanges();
        - * :
        - * 
        + * } * Describing this in XML demonstrates where the Java code inserts a new row and then * performs an update on the newly inserted row on an individual field. *
        - * <data>
        - *      <currentRow>
        - *              <columnValue>
        + * {@code
        + * 
        + *      
        + *              
          *                      firstrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      1
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      secondrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      2
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      newthirdrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      III
        - *              </columnValue>
        - *      </currentRow>
        - *      <insertRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fifthrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      5
        - *              </columnValue>
        - *              <updateValue>
        + *              
        + *              
          *                      V
        - *              </updateValue>
        - *      </insertRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fourthrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      4
        - *              </columnValue>
        - *      </currentRow>
        - * </date>
        - * 
        + * + * + * + *} *

        2.4 State 4 - Modifying a Row

        * Modifying a row produces specific XML that records both the new value and the * value that was replaced. The value that was replaced becomes the original value, @@ -340,63 +344,65 @@ import org.xml.sax.*; * code moves the cursor to a specific row, performs some modifications, and updates * the row when complete. *
        + *{@code
          * wrs.absolute(5);
          * wrs.updateString(1, "new4thRow");
          * wrs.updateString(2, "IV");
          * wrs.updateRow();
        - * 
        - * In XML, this is described by the modifyRow tag. Both the original and new + * } + * In XML, this is described by the {@code modifyRow} tag. Both the original and new * values are contained within the tag for original row tracking purposes. *
        - * <data>
        - *      <currentRow>
        - *              <columnValue>
        + * {@code
        + * 
        + *      
        + *              
          *                      firstrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      1
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      secondrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      2
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      newthirdrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      III
        - *              </columnValue>
        - *      </currentRow>
        - *      <currentRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fifthrow
        - *              </columnValue>
        - *              <columnValue>
        + *              
        + *              
          *                      5
        - *              </columnValue>
        - *      </currentRow>
        - *      <modifyRow>
        - *              <columnValue>
        + *              
        + *      
        + *      
        + *              
          *                      fourthrow
        - *              </columnValue>
        - *              <updateValue>
        + *              
        + *              
          *                      new4thRow
        - *              </updateValue>
        - *              <columnValue>
        + *              
        + *              
          *                      4
        - *              </columnValue>
        - *              <updateValue>
        + *              
        + *              
          *                      IV
        - *              </updateValue>
        - *      </modifyRow>
        - * </data>
        - * 
        + * + * + * + * } * * @see javax.sql.rowset.JdbcRowSet * @see javax.sql.rowset.CachedRowSet @@ -407,78 +413,78 @@ import org.xml.sax.*; public interface WebRowSet extends CachedRowSet { /** - * Reads a WebRowSet object in its XML format from the given - * Reader object. + * Reads a {@code WebRowSet} object in its XML format from the given + * {@code Reader} object. * - * @param reader the java.io.Reader stream from which this - * WebRowSet object will be populated + * @param reader the {@code java.io.Reader} stream from which this + * {@code WebRowSet} object will be populated * @throws SQLException if a database access error occurs */ public void readXml(java.io.Reader reader) throws SQLException; /** - * Reads a stream based XML input to populate this WebRowSet + * Reads a stream based XML input to populate this {@code WebRowSet} * object. * - * @param iStream the java.io.InputStream from which this - * WebRowSet object will be populated + * @param iStream the {@code java.io.InputStream} from which this + * {@code WebRowSet} object will be populated * @throws SQLException if a data source access error occurs * @throws IOException if an IO exception occurs */ public void readXml(java.io.InputStream iStream) throws SQLException, IOException; /** - * Populates this WebRowSet object with - * the contents of the given ResultSet object and writes its + * Populates this {@code WebRowSet} object with + * the contents of the given {@code ResultSet} object and writes its * data, properties, and metadata - * to the given Writer object in XML format. + * to the given {@code Writer} object in XML format. *

        - * NOTE: The WebRowSet cursor may be moved to write out the + * NOTE: The {@code WebRowSet} cursor may be moved to write out the * contents to the XML data source. If implemented in this way, the cursor must - * be returned to its position just prior to the writeXml() call. + * be returned to its position just prior to the {@code writeXml()} call. * - * @param rs the ResultSet object with which to populate this - * WebRowSet object - * @param writer the java.io.Writer object to write to. + * @param rs the {@code ResultSet} object with which to populate this + * {@code WebRowSet} object + * @param writer the {@code java.io.Writer} object to write to. * @throws SQLException if an error occurs writing out the rowset * contents in XML format */ public void writeXml(ResultSet rs, java.io.Writer writer) throws SQLException; /** - * Populates this WebRowSet object with - * the contents of the given ResultSet object and writes its + * Populates this {@code WebRowSet} object with + * the contents of the given {@code ResultSet} object and writes its * data, properties, and metadata - * to the given OutputStream object in XML format. + * to the given {@code OutputStream} object in XML format. *

        - * NOTE: The WebRowSet cursor may be moved to write out the + * NOTE: The {@code WebRowSet} cursor may be moved to write out the * contents to the XML data source. If implemented in this way, the cursor must - * be returned to its position just prior to the writeXml() call. + * be returned to its position just prior to the {@code writeXml()} call. * - * @param rs the ResultSet object with which to populate this - * WebRowSet object - * @param oStream the java.io.OutputStream to write to + * @param rs the {@code ResultSet} object with which to populate this + * {@code WebRowSet} object + * @param oStream the {@code java.io.OutputStream} to write to * @throws SQLException if a data source access error occurs * @throws IOException if a IO exception occurs */ public void writeXml(ResultSet rs, java.io.OutputStream oStream) throws SQLException, IOException; /** - * Writes the data, properties, and metadata for this WebRowSet object - * to the given Writer object in XML format. + * Writes the data, properties, and metadata for this {@code WebRowSet} object + * to the given {@code Writer} object in XML format. * - * @param writer the java.io.Writer stream to write to + * @param writer the {@code java.io.Writer} stream to write to * @throws SQLException if an error occurs writing out the rowset * contents to XML */ public void writeXml(java.io.Writer writer) throws SQLException; /** - * Writes the data, properties, and metadata for this WebRowSet object - * to the given OutputStream object in XML format. + * Writes the data, properties, and metadata for this {@code WebRowSet} object + * to the given {@code OutputStream} object in XML format. * - * @param oStream the java.io.OutputStream stream to write to + * @param oStream the {@code java.io.OutputStream} stream to write to * @throws SQLException if a data source access error occurs * @throws IOException if a IO exception occurs */ @@ -486,14 +492,14 @@ public interface WebRowSet extends CachedRowSet { /** * The public identifier for the XML Schema definition that defines the XML - * tags and their valid values for a WebRowSet implementation. + * tags and their valid values for a {@code WebRowSet} implementation. */ public static String PUBLIC_XML_SCHEMA = "--//Oracle Corporation//XSD Schema//EN"; /** * The URL for the XML Schema definition file that defines the XML tags and - * their valid values for a WebRowSet implementation. + * their valid values for a {@code WebRowSet} implementation. */ public static String SCHEMA_SYSTEM_ID = "http://java.sun.com/xml/ns/jdbc/webrowset.xsd"; } diff --git a/jdk/src/share/classes/javax/sql/rowset/package.html b/jdk/src/share/classes/javax/sql/rowset/package.html index 61073131eec..e8b494ee744 100644 --- a/jdk/src/share/classes/javax/sql/rowset/package.html +++ b/jdk/src/share/classes/javax/sql/rowset/package.html @@ -67,7 +67,7 @@ interfaces.

        • JdbcRowSet - A wrapper around a ResultSet object that makes it possible to use the result set as a -JavaBeansTM component. Thus, +JavaBeans™ component. Thus, a JdbcRowSet object can be a Bean that any tool makes available for assembling an application as part of a component based architecture . A JdbcRowSet object is a connected RowSet @@ -79,7 +79,7 @@ data structure as defined in the JDBC 3.0 specification.

        • CachedRowSet - - A CachedRowSet object is a JavaBeansTM + - A CachedRowSet object is a JavaBeans™ component that is scrollable, updatable, serializable, and generally disconnected from the source of its data. A CachedRowSet object typically contains rows from a result set, but it can also contain rows from any diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java index 3d3926cb83c..1e0e440bcef 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ import java.util.Arrays; * if necessary. At this time, logical pointers to the data in the data source, * such as locators, are not currently supported. * - *

          Thread safety

          + *

          Thread safety

          * * 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 diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java index e7bdbcf87e0..4c5a6b867a9 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ import java.util.Arrays; * Blob object within a SerialBlob object * and to update or truncate a Blob object. * - *

          Thread safety

          + *

          Thread safety

          * *

          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 diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java index 5ea5fee14bc..a2177b2c153 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ import java.util.Arrays; * from a SerialClob object or to locate the start of * a pattern of characters. * - *

          Thread safety

          + *

          Thread safety

          * *

          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 diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java index 4cfcfb1155a..ad053bcdec9 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ import java.net.URL; * java.net.URL url = rowset.getURL(1); * * - *

          Thread safety

          + *

          Thread safety

          * * 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 @@ -77,6 +77,7 @@ public class SerialDatalink implements Serializable, Cloneable { * Constructs a new SerialDatalink object from the given * java.net.URL object. *

          + * @param url the {@code URL} to create the {@code SerialDataLink} from * @throws SerialException if url parameter is a null */ public SerialDatalink(URL url) throws SerialException { diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java index b85ed1b620c..4a9ce17b4c8 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,9 @@ import java.lang.reflect.*; import java.util.Arrays; import java.util.Vector; import javax.sql.rowset.RowSetWarning; +import sun.reflect.CallerSensitive; +import sun.reflect.Reflection; +import sun.reflect.misc.ReflectUtil; /** * A serializable mapping in the Java programming language of an SQL @@ -44,7 +47,7 @@ import javax.sql.rowset.RowSetWarning; * Static or transient fields cannot be serialized; an attempt to serialize * them will result in a SerialException object being thrown. * - *

          Thread safety

          + *

          Thread safety

          * * 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 @@ -119,10 +122,31 @@ public class SerialJavaObject implements Serializable, Cloneable { * @return an array of Field objects * @throws SerialException if an error is encountered accessing * the serialized object + * @throws SecurityException If a security manager, s, is present + * and the caller's class loader is not the same as or an + * ancestor of the class loader for the class of the + * {@linkplain #getObject object} being serialized + * and invocation of {@link SecurityManager#checkPackageAccess + * s.checkPackageAccess()} denies access to the package + * of that class. + * @see Class#getFields */ + @CallerSensitive public Field[] getFields() throws SerialException { if (fields != null) { Class c = this.obj.getClass(); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + /* + * Check if the caller is allowed to access the specified class's package. + * If access is denied, throw a SecurityException. + */ + Class caller = sun.reflect.Reflection.getCallerClass(); + if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), + c.getClassLoader())) { + ReflectUtil.checkPackageAccess(c); + } + } return c.getFields(); } else { throw new SerialException("SerialJavaObject does not contain" + diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java index 0c7269dd658..834fafe32b6 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; * creating a SerialRef instance from a Ref * object and provides methods for getting and setting the Ref object. * - *

          Thread safety

          + *

          Thread safety

          * * 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 @@ -202,7 +202,7 @@ public class SerialRef implements Ref, Serializable, Cloneable { } /** - * Returns a clone of this {@code SerialRef}. . + * Returns a clone of this {@code SerialRef}. * The underlying {@code Ref} object will be set to null. * * @return a clone of this SerialRef diff --git a/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java b/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java index 7a73a5c5c33..6eef84f3ef9 100644 --- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java +++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ import javax.sql.rowset.*; * the SQL type name of the SQL structured type in the database, and methods * for retrieving its attribute values. * - *

          Thread safety

          + *

          Thread safety

          * * 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 @@ -87,6 +87,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable { * object for custom mapping the SQL structured type or any of its * attributes that are SQL structured types. * + * @param in an instance of {@code Struct} * @param map a java.util.Map object in which * each entry consists of 1) a String object * giving the fully qualified name of a UDT and 2) the diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java index 10e6158e77b..6797dc0d397 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -260,13 +260,14 @@ public class SyncFactory { *

          * Synchronization providers bound to a JNDI context can be * registered by binding a SyncProvider instance to a JNDI namespace. - *

            + * *
            +     * {@code
                  * SyncProvider p = new MySyncProvider();
                  * InitialContext ic = new InitialContext();
                  * ic.bind ("jdbc/rowset/MySyncProvider", p);
            -     * 
            - *
          + * } + * * Furthermore, an initial JNDI context should be set with the * SyncFactory using the setJNDIContext method. * The SyncFactory leverages this context to search for @@ -564,6 +565,8 @@ public class SyncFactory { * * @return Enumeration A enumeration of available synchronization * providers that are registered with this Factory + * @throws SyncFactoryException If an error occurs obtaining the registered + * providers */ public static Enumeration getRegisteredProviders() throws SyncFactoryException { @@ -627,8 +630,6 @@ public class SyncFactory { * required * @throws java.lang.SecurityException if a security manager exists and its * {@code checkPermission} method denies calling {@code setLogger} - * @throws java.util.logging.LoggingPermission if a security manager exists and its - * {@code checkPermission} method denies calling {@code setLevel} * @throws NullPointerException if the logger is null * @see SecurityManager#checkPermission * @see LoggingPermission @@ -650,7 +651,8 @@ public class SyncFactory { /** * Returns the logging object for applications to retrieve * synchronization events posted by SyncProvider implementations. - * + * @return The {@code Logger} that has been specified for use by + * {@code SyncProvider} implementations * @throws SyncFactoryException if no logging object has been set. */ public static Logger getLogger() throws SyncFactoryException { diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java index 87b5393a725..71f463fef2f 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,10 +81,13 @@ import java.sql.SQLException; * SyncProviderException method getSyncResolver to get * the SyncResolver object resolver. *
          + * {@code
            *     } catch (SyncProviderException spe) {
            *         SyncResolver resolver = spe.getSyncResolver();
            *     ...
            *     }
          + *
          + * }
            * 
          *

          * With resolver in hand, an application can use it to get the information @@ -97,7 +100,7 @@ import java.sql.SQLException; * The following kinds of information can be obtained from a SyncResolver * object: *

          - *

        • What operation was being attempted when a conflict occurred
          + *

          What operation was being attempted when a conflict occurred

          * The SyncProvider interface defines four constants * describing states that may occur. Three * constants describe the type of operation (update, delete, or insert) that a @@ -106,10 +109,10 @@ import java.sql.SQLException; * These constants are the possible return values when a SyncResolver object * calls the method getStatus. *
          - *     int operation = resolver.getStatus();
          + *     {@code int operation = resolver.getStatus(); }
            * 
          *

          - *

        • The value in the data source that caused a conflict
          + *

          The value in the data source that caused a conflict

          * A conflict exists when a value that a RowSet object has changed * and is attempting to write to the data source * has also been changed in the data source since the last synchronization. An @@ -122,7 +125,6 @@ import java.sql.SQLException; * * Note that the column in resolver can be designated by the column number, * as is done in the preceding line of code, or by the column name. - *
        *

        * With the information retrieved from the methods getStatus and * getConflictValue, the application may make a determination as to @@ -194,6 +196,7 @@ import java.sql.SQLException; * that it will be used to overwrite the conflict value in the data source. * *

        + * {@code
          *     try {
          *
          *         crs.acceptChanges(con);
        @@ -202,8 +205,8 @@ import java.sql.SQLException;
          *
          *         SyncResolver resolver = spe.getSyncResolver();
          *
        - *         Object crsValue;  // value in the RowSet object
        - *         Object resolverValue:  // value in the SyncResolver object
        + *         Object crsValue;  // value in the RowSet object
        + *         Object resolverValue:  // value in the SyncResolver object
          *         Object resolvedValue:  // value to be persisted
          *
          *         while(resolver.nextConflict())  {
        @@ -227,7 +230,7 @@ import java.sql.SQLException;
          *              }
          *          }
          *      }
        - * 
        + * } * @author Jonathan Bruce */ diff --git a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java index 577ddf0cf72..402e6a62827 100644 --- a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java +++ b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java @@ -215,7 +215,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { } private void dispose(java.util.List bufferInfos) { - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("BufferStrategyPaintManager disposed", new RuntimeException()); } @@ -300,7 +300,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { } } // Invalid root, do what Swing has always done. - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("prepare failed"); } return super.paint(paintingComponent, bufferComponent, g, x, y, w, h); @@ -332,7 +332,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { } accumulate(x + xOffset + deltaX, y + yOffset + deltaY, w, h); } else { - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("copyArea: prepare failed or not in sync"); } // Prepare failed, or not in sync. By calling super.copyArea @@ -360,7 +360,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { } } } - if (LOGGER.isLoggable(PlatformLogger.FINEST)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINEST)) { LOGGER.finest("beginPaint"); } // Reset the area that needs to be painted. @@ -368,7 +368,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { } public void endPaint() { - if (LOGGER.isLoggable(PlatformLogger.FINEST)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINEST)) { LOGGER.finest("endPaint: region " + accumulatedX + " " + accumulatedY + " " + accumulatedMaxX + " " + accumulatedMaxY); @@ -417,7 +417,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { contentsLost = bufferStrategy.contentsLost(); } if (contentsLost) { - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("endPaint: contents lost"); } // Shown region was bogus, mark buffer as out of sync. @@ -511,7 +511,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { contentsLost = true; bufferInfo = new BufferInfo(root); bufferInfos.add(bufferInfo); - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("prepare: new BufferInfo: " + root); } } @@ -522,7 +522,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { bsg = bufferStrategy.getDrawGraphics(); if (bufferStrategy.contentsRestored()) { contentsLost = true; - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("prepare: contents restored in prepare"); } } @@ -535,7 +535,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { if (bufferInfo.getContentsLostDuringExpose()) { contentsLost = true; bufferInfo.setContentsLostDuringExpose(false); - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("prepare: contents lost on expose"); } } @@ -638,7 +638,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { if (biRoot == null) { // Window gc'ed bufferInfos.remove(counter); - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("BufferInfo pruned, root null"); } } @@ -744,7 +744,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { if (bs != null) { weakBS = new WeakReference(bs); } - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("getBufferStrategy: created bs: " + bs); } } @@ -802,7 +802,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { BufferStrategy bs = null; if (SwingUtilities3.isVsyncRequested(root)) { bs = createBufferStrategy(root, true); - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("createBufferStrategy: using vsynced strategy"); } } @@ -844,7 +844,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { invoke(root); } catch (InvocationTargetException ite) { // Type is not supported - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("createBufferStratety failed", ite); } @@ -860,7 +860,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { bs = ((Window)root).getBufferStrategy(); } catch (AWTException e) { // Type not supported - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("createBufferStratety failed", e); } @@ -874,7 +874,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { */ public void dispose() { Container root = getRoot(); - if (LOGGER.isLoggable(PlatformLogger.FINER)) { + if (LOGGER.isLoggable(PlatformLogger.Level.FINER)) { LOGGER.finer("disposed BufferInfo for: " + root); } if (root != null) { diff --git a/jdk/src/share/classes/javax/swing/JFileChooser.java b/jdk/src/share/classes/javax/swing/JFileChooser.java index 2e1655d6d70..d30c69675ae 100644 --- a/jdk/src/share/classes/javax/swing/JFileChooser.java +++ b/jdk/src/share/classes/javax/swing/JFileChooser.java @@ -1146,9 +1146,25 @@ public class JFileChooser extends JComponent implements Accessible { * @see #resetChoosableFileFilters */ public boolean removeChoosableFileFilter(FileFilter f) { - if(filters.contains(f)) { + int index = filters.indexOf(f); + if (index >= 0) { if(getFileFilter() == f) { - setFileFilter(null); + if (isAcceptAllFileFilterUsed()) { + // choose default filter if it is used + setFileFilter(getAcceptAllFileFilter()); + } + else if (index > 0) { + // choose the first filter, because it is not removed + setFileFilter(filters.get(0)); + } + else if (filters.size() > 1) { + // choose the second filter, because the first one is removed + setFileFilter(filters.get(1)); + } + else { + // no more filters + setFileFilter(null); + } } FileFilter[] oldValue = getChoosableFileFilters(); filters.removeElement(f); diff --git a/jdk/src/share/classes/javax/swing/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java index f4d89e00424..09b31da9f28 100644 --- a/jdk/src/share/classes/javax/swing/JTree.java +++ b/jdk/src/share/classes/javax/swing/JTree.java @@ -3751,7 +3751,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * the nodes identified by in e. */ void removeDescendantSelectedPaths(TreeModelEvent e) { - TreePath pPath = e.getTreePath(); + TreePath pPath = SwingUtilities2.getTreePath(e, getModel()); Object[] oldChildren = e.getChildren(); TreeSelectionModel sm = getSelectionModel(); @@ -3785,7 +3785,7 @@ public class JTree extends JComponent implements Scrollable, Accessible // and update BasicTreeUIs treeStructureChanged method // to update descendants in response to a treeStructureChanged // event, all the children of the event won't collapse! - TreePath parent = e.getTreePath(); + TreePath parent = SwingUtilities2.getTreePath(e, getModel()); if(parent == null) return; @@ -3822,7 +3822,7 @@ public class JTree extends JComponent implements Scrollable, Accessible if(e == null) return; - TreePath parent = e.getTreePath(); + TreePath parent = SwingUtilities2.getTreePath(e, getModel()); Object[] children = e.getChildren(); if(children == null) diff --git a/jdk/src/share/classes/javax/swing/RepaintManager.java b/jdk/src/share/classes/javax/swing/RepaintManager.java index 8f2e6093393..461f93d5fc4 100644 --- a/jdk/src/share/classes/javax/swing/RepaintManager.java +++ b/jdk/src/share/classes/javax/swing/RepaintManager.java @@ -354,7 +354,7 @@ public class RepaintManager // Queue a Runnable to invoke paintDirtyRegions and // validateInvalidComponents. - scheduleProcessingRunnable(); + scheduleProcessingRunnable(SunToolkit.targetToAppContext(invalidComponent)); } @@ -443,7 +443,7 @@ public class RepaintManager // Queue a Runnable to invoke paintDirtyRegions and // validateInvalidComponents. - scheduleProcessingRunnable(); + scheduleProcessingRunnable(SunToolkit.targetToAppContext(c)); } /** @@ -1389,10 +1389,6 @@ public class RepaintManager return paintManager; } - private void scheduleProcessingRunnable() { - scheduleProcessingRunnable(AppContext.getAppContext()); - } - private void scheduleProcessingRunnable(AppContext context) { if (processingRunnable.markPending()) { Toolkit tk = Toolkit.getDefaultToolkit(); diff --git a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java index 4a70270f23c..cbdfc015a19 100644 --- a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java +++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java @@ -115,7 +115,7 @@ public class SortingFocusTraversalPolicy try { index = Collections.binarySearch(cycle, aComponent, comparator); } catch (ClassCastException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### During the binary search for " + aComponent + " the exception occured: ", e); } return -1; @@ -193,7 +193,7 @@ public class SortingFocusTraversalPolicy if (getImplicitDownCycleTraversal()) { retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont); - if (retComp != null && log.isLoggable(PlatformLogger.FINE)) { + if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Transfered focus down-cycle to " + retComp + " in the focus cycle root " + cont); } @@ -205,7 +205,7 @@ public class SortingFocusTraversalPolicy cont.getFocusTraversalPolicy().getDefaultComponent(cont) : cont.getFocusTraversalPolicy().getLastComponent(cont)); - if (retComp != null && log.isLoggable(PlatformLogger.FINE)) { + if (retComp != null && log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont); } } @@ -236,7 +236,7 @@ public class SortingFocusTraversalPolicy * aComponent is null */ public Component getComponentAfter(Container aContainer, Component aComponent) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Searching in " + aContainer + " for component after " + aComponent); } @@ -260,7 +260,7 @@ public class SortingFocusTraversalPolicy // See if the component is inside of policy provider. Container provider = getTopmostProvider(aContainer, aComponent); if (provider != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Asking FTP " + provider + " for component after " + aComponent); } @@ -271,7 +271,7 @@ public class SortingFocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (afterComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### FTP returned " + afterComp); } return afterComp; @@ -281,14 +281,14 @@ public class SortingFocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle + ", component is " + aComponent); } int index = getComponentIndex(cycle, aComponent); if (index < 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer); } return getFirstComponent(aContainer); @@ -353,7 +353,7 @@ public class SortingFocusTraversalPolicy // See if the component is inside of policy provider. Container provider = getTopmostProvider(aContainer, aComponent); if (provider != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Asking FTP " + provider + " for component after " + aComponent); } @@ -364,7 +364,7 @@ public class SortingFocusTraversalPolicy // Null result means that we overstepped the limit of the FTP's cycle. // In that case we must quit the cycle, otherwise return the component found. if (beforeComp != null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### FTP returned " + beforeComp); } return beforeComp; @@ -379,14 +379,14 @@ public class SortingFocusTraversalPolicy List cycle = getFocusTraversalCycle(aContainer); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle + ", component is " + aComponent); } int index = getComponentIndex(cycle, aComponent); if (index < 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer); } return getLastComponent(aContainer); @@ -432,7 +432,7 @@ public class SortingFocusTraversalPolicy public Component getFirstComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Getting first component in " + aContainer); } if (aContainer == null) { @@ -446,12 +446,12 @@ public class SortingFocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is empty"); } return null; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle); } @@ -480,7 +480,7 @@ public class SortingFocusTraversalPolicy */ public Component getLastComponent(Container aContainer) { List cycle; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Getting last component in " + aContainer); } @@ -495,12 +495,12 @@ public class SortingFocusTraversalPolicy } if (cycle.size() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is empty"); } return null; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### Cycle is " + cycle); } diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java index 62389469839..3c92dc16377 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java @@ -128,7 +128,7 @@ public class TreeModelEvent extends EventObject { public TreeModelEvent(Object source, Object[] path, int[] childIndices, Object[] children) { - this(source, new TreePath(path), childIndices, children); + this(source, (path == null) ? null : new TreePath(path), childIndices, children); } /** @@ -183,7 +183,7 @@ public class TreeModelEvent extends EventObject { */ public TreeModelEvent(Object source, Object[] path) { - this(source, new TreePath(path)); + this(source, (path == null) ? null : new TreePath(path)); } /** diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java index 1b741db47f6..c902252f4dc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -73,6 +73,9 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener { if ( anObject != null ) { text = anObject.toString(); + if (text == null) { + text = ""; + } oldValue = anObject; } else { text = ""; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 3d39cf6a876..0e7cd1768e7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -3827,7 +3827,7 @@ public class BasicTreeUI extends TreeUI // public void treeNodesChanged(TreeModelEvent e) { if(treeState != null && e != null) { - TreePath parentPath = e.getTreePath(); + TreePath parentPath = SwingUtilities2.getTreePath(e, getModel()); int[] indices = e.getChildIndices(); if (indices == null || indices.length == 0) { // The root has changed @@ -3882,7 +3882,7 @@ public class BasicTreeUI extends TreeUI updateLeadSelectionRow(); - TreePath path = e.getTreePath(); + TreePath path = SwingUtilities2.getTreePath(e, getModel()); if(treeState.isExpanded(path)) { updateSize(); @@ -3907,7 +3907,7 @@ public class BasicTreeUI extends TreeUI updateLeadSelectionRow(); - TreePath path = e.getTreePath(); + TreePath path = SwingUtilities2.getTreePath(e, getModel()); if(treeState.isExpanded(path) || treeModel.getChildCount(path.getLastPathComponent()) == 0) @@ -3921,7 +3921,7 @@ public class BasicTreeUI extends TreeUI updateLeadSelectionRow(); - TreePath pPath = e.getTreePath(); + TreePath pPath = SwingUtilities2.getTreePath(e, getModel()); if (pPath != null) { pPath = pPath.getParentPath(); diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java index 097e6c33313..c2e1e023d5a 100644 --- a/jdk/src/share/classes/javax/swing/text/View.java +++ b/jdk/src/share/classes/javax/swing/text/View.java @@ -1174,7 +1174,7 @@ public abstract class View implements SwingConstants { // formed by added elements (i.e. they will be updated // by initialization. index0 = Math.max(index0, 0); - index1 = getViewIndex(elem.getDocument().getLength(), Position.Bias.Forward); + index1 = Math.max((getViewCount() - 1), 0); for (int i = index0; i <= index1; i++) { if (! ((i >= hole0) && (i <= hole1))) { v = getView(i); diff --git a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java index fffea8b0b5b..4f61aff7304 100644 --- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java @@ -26,13 +26,14 @@ package javax.swing.tree; import javax.swing.event.TreeModelEvent; -import java.awt.Dimension; import java.awt.Rectangle; import java.util.Enumeration; import java.util.Hashtable; import java.util.NoSuchElementException; import java.util.Stack; +import sun.swing.SwingUtilities2; + /** * NOTE: This will become more open in a future release. *

        @@ -346,7 +347,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { if(e != null) { int changedIndexs[]; FHTreeStateNode changedParent = getNodeForPath - (e.getTreePath(), false, false); + (SwingUtilities2.getTreePath(e, getModel()), false, false); int maxCounter; changedIndexs = e.getChildIndices(); @@ -390,7 +391,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { if(e != null) { int changedIndexs[]; FHTreeStateNode changedParent = getNodeForPath - (e.getTreePath(), false, false); + (SwingUtilities2.getTreePath(e, getModel()), false, false); int maxCounter; changedIndexs = e.getChildIndices(); @@ -429,7 +430,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { if(e != null) { int changedIndexs[]; int maxCounter; - TreePath parentPath = e.getTreePath(); + TreePath parentPath = SwingUtilities2.getTreePath(e, getModel()); FHTreeStateNode changedParentNode = getNodeForPath (parentPath, false, false); @@ -475,7 +476,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { */ public void treeStructureChanged(TreeModelEvent e) { if(e != null) { - TreePath changedPath = e.getTreePath(); + TreePath changedPath = SwingUtilities2.getTreePath(e, getModel()); FHTreeStateNode changedNode = getNodeForPath (changedPath, false, false); diff --git a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java index ad91d1c84c2..5185194ed3b 100644 --- a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java @@ -26,7 +26,6 @@ package javax.swing.tree; import javax.swing.event.TreeModelEvent; -import java.awt.Dimension; import java.awt.Rectangle; import java.util.Enumeration; import java.util.Hashtable; @@ -34,6 +33,8 @@ import java.util.NoSuchElementException; import java.util.Stack; import java.util.Vector; +import sun.swing.SwingUtilities2; + /** * NOTE: This will become more open in a future release. *

        @@ -413,7 +414,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { TreeStateNode changedNode; changedIndexs = e.getChildIndices(); - changedNode = getNodeForPath(e.getTreePath(), false, false); + changedNode = getNodeForPath(SwingUtilities2.getTreePath(e, getModel()), false, false); if(changedNode != null) { Object changedValue = changedNode.getValue(); @@ -466,7 +467,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { TreeStateNode changedParentNode; changedIndexs = e.getChildIndices(); - changedParentNode = getNodeForPath(e.getTreePath(), false, false); + changedParentNode = getNodeForPath(SwingUtilities2.getTreePath(e, getModel()), false, false); /* Only need to update the children if the node has been expanded once. */ // PENDING(scott): make sure childIndexs is sorted! @@ -540,7 +541,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { TreeStateNode changedParentNode; changedIndexs = e.getChildIndices(); - changedParentNode = getNodeForPath(e.getTreePath(), false, false); + changedParentNode = getNodeForPath(SwingUtilities2.getTreePath(e, getModel()), false, false); // PENDING(scott): make sure that changedIndexs are sorted in // ascending order. if(changedParentNode != null && changedIndexs != null && @@ -628,7 +629,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache { public void treeStructureChanged(TreeModelEvent e) { if(e != null) { - TreePath changedPath = e.getTreePath(); + TreePath changedPath = SwingUtilities2.getTreePath(e, getModel()); TreeStateNode changedNode; changedNode = getNodeForPath(changedPath, false, false); diff --git a/jdk/src/share/classes/javax/xml/crypto/dsig/Manifest.java b/jdk/src/share/classes/javax/xml/crypto/dsig/Manifest.java index 7df2c230681..8c7662640be 100644 --- a/jdk/src/share/classes/javax/xml/crypto/dsig/Manifest.java +++ b/jdk/src/share/classes/javax/xml/crypto/dsig/Manifest.java @@ -35,15 +35,15 @@ import java.util.List; * the * W3C Recommendation for XML-Signature Syntax and Processing. * The XML Schema Definition is defined as: - *

        
        - * <element name="Manifest" type="ds:ManifestType"/>
        - *   <complexType name="ManifestType">
        - *     <sequence>
        - *       <element ref="ds:Reference" maxOccurs="unbounded"/>
        - *     </sequence>
        - *     <attribute name="Id" type="ID" use="optional"/>
        - *   </complexType>
        - * 
        + *
        {@code
        + * 
        + *   
        + *     
        + *       
        + *     
        + *     
        + *   
        + * }
        * * A Manifest instance may be created by invoking * one of the {@link XMLSignatureFactory#newManifest newManifest} diff --git a/jdk/src/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java b/jdk/src/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java index 0af36e428a2..2ed14003ff9 100644 --- a/jdk/src/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java +++ b/jdk/src/share/classes/javax/xml/crypto/dsig/dom/DOMValidateContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,11 +74,7 @@ public class DOMValidateContext extends DOMCryptoContext if (ks == null) { throw new NullPointerException("key selector is null"); } - if (node == null) { - throw new NullPointerException("node is null"); - } - setKeySelector(ks); - this.node = node; + init(node, ks); } /** @@ -97,11 +93,20 @@ public class DOMValidateContext extends DOMCryptoContext if (validatingKey == null) { throw new NullPointerException("validatingKey is null"); } + init(node, KeySelector.singletonKeySelector(validatingKey)); + } + + private void init(Node node, KeySelector ks) { if (node == null) { throw new NullPointerException("node is null"); } - setKeySelector(KeySelector.singletonKeySelector(validatingKey)); + this.node = node; + super.setKeySelector(ks); + if (System.getSecurityManager() != null) { + super.setProperty("org.jcp.xml.dsig.secureValidation", + Boolean.TRUE); + } } /** diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java index 9fa0591f97c..fac4024f8a4 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java @@ -193,7 +193,7 @@ public abstract class ApacheCanonicalizer extends TransformService { if (apacheTransform == null) { try { - apacheTransform = Transform.getInstance + apacheTransform = new Transform (ownerDoc, getAlgorithm(), transformElem.getChildNodes()); apacheTransform.setElement(transformElem, xc.getBaseURI()); if (log.isLoggable(Level.FINE)) { diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java index 735b3488a29..2d9d2e090e8 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java @@ -48,7 +48,7 @@ public class ApacheNodeSetData implements ApacheData, NodeSetData { public Iterator iterator() { // If nodefilters are set, must execute them first to create node-set - if (xi.getNodeFilters() != null) { + if (xi.getNodeFilters() != null && !xi.getNodeFilters().isEmpty()) { return Collections.unmodifiableSet (getNodeSet(xi.getNodeFilters())).iterator(); } diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java index e15f1098fc8..b1d9c04686a 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheTransform.java @@ -38,6 +38,7 @@ import org.w3c.dom.NodeList; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.transforms.Transform; +import com.sun.org.apache.xml.internal.security.transforms.Transforms; import javax.xml.crypto.*; import javax.xml.crypto.dom.DOMCryptoContext; @@ -117,7 +118,7 @@ public abstract class ApacheTransform extends TransformService { if (apacheTransform == null) { try { - apacheTransform = Transform.getInstance + apacheTransform = new Transform (ownerDoc, getAlgorithm(), transformElem.getChildNodes()); apacheTransform.setElement(transformElem, xc.getBaseURI()); if (log.isLoggable(Level.FINE)) { @@ -130,6 +131,15 @@ public abstract class ApacheTransform extends TransformService { } } + if (Utils.secureValidation(xc)) { + String algorithm = getAlgorithm(); + if (Transforms.TRANSFORM_XSLT.equals(algorithm)) { + throw new TransformException( + "Transform " + algorithm + + " is forbidden when secure validation is enabled"); + } + } + XMLSignatureInput in; if (data instanceof ApacheData) { if (log.isLoggable(Level.FINE)) { diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java index bf675be688f..700694e2dd6 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java @@ -51,6 +51,11 @@ public class DOMCanonicalizationMethod extends DOMTransform public DOMCanonicalizationMethod(TransformService spi) throws InvalidAlgorithmParameterException { super(spi); + if (!(spi instanceof ApacheCanonicalizer) && + !isC14Nalg(spi.getAlgorithm())) { + throw new InvalidAlgorithmParameterException( + "Illegal CanonicalizationMethod"); + } } /** @@ -63,6 +68,10 @@ public class DOMCanonicalizationMethod extends DOMTransform public DOMCanonicalizationMethod(Element cmElem, XMLCryptoContext context, Provider provider) throws MarshalException { super(cmElem, context, provider); + if (!(spi instanceof ApacheCanonicalizer) && + !isC14Nalg(spi.getAlgorithm())) { + throw new MarshalException("Illegal CanonicalizationMethod"); + } } /** @@ -101,4 +110,13 @@ public class DOMCanonicalizationMethod extends DOMTransform return (getAlgorithm().equals(ocm.getAlgorithm()) && DOMUtils.paramsEqual(getParameterSpec(), ocm.getParameterSpec())); } + + private static boolean isC14Nalg(String alg) { + return (alg.equals(CanonicalizationMethod.INCLUSIVE) || + alg.equals(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS) || + alg.equals(CanonicalizationMethod.EXCLUSIVE) || + alg.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) || + alg.equals(DOMCanonicalXMLC14N11Method.C14N_11) || + alg.equals(DOMCanonicalXMLC14N11Method.C14N_11_WITH_COMMENTS)); + } } diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java index 724783f40f6..e9a3f1eca03 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfo.java @@ -34,6 +34,7 @@ import javax.xml.crypto.dom.*; import java.security.Provider; import java.util.*; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -87,7 +88,13 @@ public final class DOMKeyInfo extends DOMStructure implements KeyInfo { public DOMKeyInfo(Element kiElem, XMLCryptoContext context, Provider provider) throws MarshalException { // get Id attribute, if specified - id = DOMUtils.getAttributeValue(kiElem, "Id"); + Attr attr = kiElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + id = attr.getValue(); + kiElem.setIdAttributeNode(attr, true); + } else { + id = null; + } // get all children nodes NodeList nl = kiElem.getChildNodes(); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java index 775c0944660..0da7241ec59 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMManifest.java @@ -32,6 +32,7 @@ import javax.xml.crypto.dsig.*; import java.security.Provider; import java.util.*; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -85,12 +86,30 @@ public final class DOMManifest extends DOMStructure implements Manifest { */ public DOMManifest(Element manElem, XMLCryptoContext context, Provider provider) throws MarshalException { - this.id = DOMUtils.getAttributeValue(manElem, "Id"); + Attr attr = manElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + this.id = attr.getValue(); + manElem.setIdAttributeNode(attr, true); + } else { + this.id = null; + } + + boolean secVal = Utils.secureValidation(context); Element refElem = DOMUtils.getFirstChildElement(manElem); List refs = new ArrayList(); + int refCount = 0; while (refElem != null) { refs.add(new DOMReference(refElem, context, provider)); refElem = DOMUtils.getNextSiblingElement(refElem); + + refCount++; + if (secVal && (refCount > DOMSignedInfo.MAXIMUM_REFERENCE_COUNT)) { + String error = "A maxiumum of " + + DOMSignedInfo.MAXIMUM_REFERENCE_COUNT + + " references per Manifest are allowed with" + + " secure validation"; + throw new MarshalException(error); + } } this.references = Collections.unmodifiableList(refs); } diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java index 03839094525..6d92f75bf86 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java @@ -51,6 +51,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.jcp.xml.dsig.internal.DigesterOutputStream; +import com.sun.org.apache.xml.internal.security.algorithms.MessageDigestAlgorithm; import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.utils.Base64; @@ -65,6 +66,12 @@ import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream public final class DOMReference extends DOMStructure implements Reference, DOMURIReference { + /** + * The maximum number of transforms per reference, if secure validation + * is enabled. + */ + public static final int MAXIMUM_TRANSFORM_COUNT = 5; + /** * Look up useC14N11 system property. If true, an explicit C14N11 transform * will be added if necessary when generating the signature. See section @@ -184,15 +191,27 @@ public final class DOMReference extends DOMStructure */ public DOMReference(Element refElem, XMLCryptoContext context, Provider provider) throws MarshalException { + boolean secVal = Utils.secureValidation(context); + // unmarshal Transforms, if specified Element nextSibling = DOMUtils.getFirstChildElement(refElem); List transforms = new ArrayList(5); if (nextSibling.getLocalName().equals("Transforms")) { Element transformElem = DOMUtils.getFirstChildElement(nextSibling); + + int transformCount = 0; while (transformElem != null) { transforms.add (new DOMTransform(transformElem, context, provider)); transformElem = DOMUtils.getNextSiblingElement(transformElem); + + transformCount++; + if (secVal && (transformCount > MAXIMUM_TRANSFORM_COUNT)) { + String error = "A maxiumum of " + MAXIMUM_TRANSFORM_COUNT + + " transforms per Reference are allowed" + + " with secure validation"; + throw new MarshalException(error); + } } nextSibling = DOMUtils.getNextSiblingElement(nextSibling); } @@ -200,6 +219,14 @@ public final class DOMReference extends DOMStructure // unmarshal DigestMethod Element dmElem = nextSibling; this.digestMethod = DOMDigestMethod.unmarshal(dmElem); + String digestMethodAlgorithm = this.digestMethod.getAlgorithm(); + if (secVal + && MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5.equals(digestMethodAlgorithm)) + { + throw new MarshalException("It is forbidden to use algorithm " + + digestMethod + + " when secure validation is enabled"); + } // unmarshal DigestValue try { @@ -211,7 +238,14 @@ public final class DOMReference extends DOMStructure // unmarshal attributes this.uri = DOMUtils.getAttributeValue(refElem, "URI"); - this.id = DOMUtils.getAttributeValue(refElem, "Id"); + + Attr attr = refElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + this.id = attr.getValue(); + refElem.setIdAttributeNode(attr, true); + } else { + this.id = null; + } this.type = DOMUtils.getAttributeValue(refElem, "Type"); this.here = refElem.getAttributeNodeNS(null, "URI"); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java index 233e7979081..8b8e5275c43 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java @@ -38,6 +38,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.security.Provider; import java.util.*; +import javax.xml.XMLConstants; import javax.xml.crypto.*; import javax.xml.crypto.dsig.*; import javax.xml.crypto.dom.DOMCryptoContext; @@ -124,9 +125,13 @@ public final class DOMRetrievalMethod extends DOMStructure // get here node here = rmElem.getAttributeNodeNS(null, "URI"); + boolean secVal = Utils.secureValidation(context); + // get Transforms, if specified List transforms = new ArrayList(); Element transformsElem = DOMUtils.getFirstChildElement(rmElem); + + int transformCount = 0; if (transformsElem != null) { Element transformElem = DOMUtils.getFirstChildElement(transformsElem); @@ -134,6 +139,17 @@ public final class DOMRetrievalMethod extends DOMStructure transforms.add (new DOMTransform(transformElem, context, provider)); transformElem = DOMUtils.getNextSiblingElement(transformElem); + + transformCount++; + if (secVal && + (transformCount > DOMReference.MAXIMUM_TRANSFORM_COUNT)) + { + String error = "A maxiumum of " + + DOMReference.MAXIMUM_TRANSFORM_COUNT + + " transforms per Reference are allowed" + + " with secure validation"; + throw new MarshalException(error); + } } } if (transforms.isEmpty()) { @@ -214,6 +230,21 @@ public final class DOMRetrievalMethod extends DOMStructure } catch (Exception e) { throw new URIReferenceException(e); } + + // guard against RetrievalMethod loops + if ((data instanceof NodeSetData) && Utils.secureValidation(context)) { + NodeSetData nsd = (NodeSetData)data; + Iterator i = nsd.iterator(); + if (i.hasNext()) { + Node root = (Node)i.next(); + if ("RetrievalMethod".equals(root.getLocalName())) { + throw new URIReferenceException( + "It is forbidden to have one RetrievalMethod point " + + "to another when secure validation is enabled"); + } + } + } + return data; } @@ -224,6 +255,8 @@ public final class DOMRetrievalMethod extends DOMStructure ApacheData data = (ApacheData) dereference(context); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + Boolean.TRUE); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new ByteArrayInputStream (data.getXMLSignatureInput().getBytes())); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java index ef121992794..424724f1d28 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperties.java @@ -31,6 +31,7 @@ import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.*; import java.util.*; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -86,7 +87,13 @@ public final class DOMSignatureProperties extends DOMStructure */ public DOMSignatureProperties(Element propsElem) throws MarshalException{ // unmarshal attributes - id = DOMUtils.getAttributeValue(propsElem, "Id"); + Attr attr = propsElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + id = attr.getValue(); + propsElem.setIdAttributeNode(attr, true); + } else { + id = null; + } NodeList nodes = propsElem.getChildNodes(); int length = nodes.getLength(); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java index e15f448ed26..9bb8838aadb 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java @@ -31,6 +31,7 @@ import javax.xml.crypto.dom.DOMCryptoContext; import javax.xml.crypto.dsig.*; import java.util.*; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -94,7 +95,13 @@ public final class DOMSignatureProperty extends DOMStructure if (target == null) { throw new MarshalException("target cannot be null"); } - id = DOMUtils.getAttributeValue(propElem, "Id"); + Attr attr = propElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + id = attr.getValue(); + propElem.setIdAttributeNode(attr, true); + } else { + id = null; + } NodeList nodes = propElem.getChildNodes(); int length = nodes.getLength(); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java index 472a533ee7e..36ebabc612d 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignedInfo.java @@ -45,6 +45,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import com.sun.org.apache.xml.internal.security.utils.Base64; +import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.UnsyncBufferedOutputStream; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; @@ -55,7 +56,22 @@ import com.sun.org.apache.xml.internal.security.utils.XMLUtils; */ public final class DOMSignedInfo extends DOMStructure implements SignedInfo { + /** + * The maximum number of references per Manifest, if secure validation is + * enabled. + */ + public static final int MAXIMUM_REFERENCE_COUNT = 30; + private static Logger log = Logger.getLogger("org.jcp.xml.dsig.internal.dom"); + + /** Signature - NOT Recommended RSAwithMD5 */ + private static final String ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5 = + Constants.MoreAlgorithmsSpecNS + "rsa-md5"; + + /** HMAC - NOT Recommended HMAC-MD5 */ + private static final String ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5 = + Constants.MoreAlgorithmsSpecNS + "hmac-md5"; + private List references; private CanonicalizationMethod canonicalizationMethod; private SignatureMethod signatureMethod; @@ -143,12 +159,31 @@ public final class DOMSignedInfo extends DOMStructure implements SignedInfo { Element smElem = DOMUtils.getNextSiblingElement(cmElem); signatureMethod = DOMSignatureMethod.unmarshal(smElem); + boolean secVal = Utils.secureValidation(context); + String sigMethAlg = signatureMethod.getAlgorithm(); + if (secVal && ((ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5.equals(sigMethAlg) + || ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5.equals(sigMethAlg)))) + { + throw new MarshalException("It is forbidden to use algorithm " + + signatureMethod + + " when secure validation is enabled"); + } + // unmarshal References ArrayList refList = new ArrayList(5); Element refElem = DOMUtils.getNextSiblingElement(smElem); + int refCount = 0; while (refElem != null) { refList.add(new DOMReference(refElem, context, provider)); refElem = DOMUtils.getNextSiblingElement(refElem); + + refCount++; + if (secVal && (refCount > MAXIMUM_REFERENCE_COUNT)) { + String error = "A maxiumum of " + MAXIMUM_REFERENCE_COUNT + + " references per SignedInfo are allowed with" + + " secure validation"; + throw new MarshalException(error); + } } references = Collections.unmodifiableList(refList); } diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java index f0ff9a2a413..cca0c9e2e03 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java @@ -31,7 +31,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import com.sun.org.apache.xml.internal.security.Init; -import com.sun.org.apache.xml.internal.security.utils.IdResolver; +import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; @@ -68,8 +68,11 @@ public class DOMURIDereferencer implements URIDereferencer { Attr uriAttr = (Attr) domRef.getHere(); String uri = uriRef.getURI(); DOMCryptoContext dcc = (DOMCryptoContext) context; + String baseURI = context.getBaseURI(); - // Check if same-document URI and register ID + boolean secVal = Utils.secureValidation(context); + + // Check if same-document URI and already registered on the context if (uri != null && uri.length() != 0 && uri.charAt(0) == '#') { String id = uri.substring(1); @@ -79,19 +82,38 @@ public class DOMURIDereferencer implements URIDereferencer { id = id.substring(i1+1, i2); } - // this is a bit of a hack to check for registered - // IDRefs and manually register them with Apache's IdResolver - // map which includes builtin schema knowledge of DSig/Enc IDs - Node referencedElem = dcc.getElementById(id); - if (referencedElem != null) { - IdResolver.registerElementById((Element) referencedElem, id); + Node refElem = dcc.getElementById(id); + if (refElem != null) { + if (secVal) { + Element start = + refElem.getOwnerDocument().getDocumentElement(); + if (!XMLUtils.protectAgainstWrappingAttack(start, + (Element)refElem, + id)) { + String error = "Multiple Elements with the same ID " + + id + " were detected"; + throw new URIReferenceException(error); + } + } + + XMLSignatureInput result = new XMLSignatureInput(refElem); + if (!uri.substring(1).startsWith("xpointer(id(")) { + result.setExcludeComments(true); + } + + result.setMIMEType("text/xml"); + if (baseURI != null && baseURI.length() > 0) { + result.setSourceURI(baseURI.concat(uriAttr.getNodeValue())); + } else { + result.setSourceURI(uriAttr.getNodeValue()); + } + return new ApacheNodeSetData(result); } } try { - String baseURI = context.getBaseURI(); ResourceResolver apacheResolver = - ResourceResolver.getInstance(uriAttr, baseURI); + ResourceResolver.getInstance(uriAttr, baseURI, secVal); XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI); if (in.isOctetStream()) { return new ApacheOctetStreamData(in); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java index 85cfd91033c..184a6d34426 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMUtils.java @@ -38,8 +38,6 @@ import javax.xml.crypto.dsig.dom.DOMSignContext; import javax.xml.crypto.dsig.*; import javax.xml.crypto.dsig.spec.*; -import com.sun.org.apache.xml.internal.security.utils.IdResolver; - /** * Useful static DOM utility methods. * @@ -107,7 +105,7 @@ public class DOMUtils { public static void setAttributeID(Element elem, String name, String value) { if (value == null) return; elem.setAttributeNS(null, name, value); - IdResolver.registerElementById(elem, value); + elem.setIdAttributeNS(null, name, true); } /** diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java index 650b25ec5cd..a5416f5d770 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLObject.java @@ -32,6 +32,7 @@ import javax.xml.crypto.dsig.*; import java.security.Provider; import java.util.*; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -91,7 +92,14 @@ public final class DOMXMLObject extends DOMStructure implements XMLObject { Provider provider) throws MarshalException { // unmarshal attributes this.encoding = DOMUtils.getAttributeValue(objElem, "Encoding"); - this.id = DOMUtils.getAttributeValue(objElem, "Id"); + + Attr attr = objElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + this.id = attr.getValue(); + objElem.setIdAttributeNode(attr, true); + } else { + this.id = null; + } this.mimeType = DOMUtils.getAttributeValue(objElem, "MimeType"); NodeList nodes = objElem.getChildNodes(); diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java index 263ca2bb369..6c91e369f42 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java @@ -50,6 +50,7 @@ import java.util.HashMap; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -492,7 +493,13 @@ public final class DOMXMLSignature extends DOMStructure throw new MarshalException(bde); } - id = DOMUtils.getAttributeValue(sigValueElem, "Id"); + Attr attr = sigValueElem.getAttributeNodeNS(null, "Id"); + if (attr != null) { + id = attr.getValue(); + sigValueElem.setIdAttributeNode(attr, true); + } else { + id = null; + } this.sigValueElem = sigValueElem; } diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java index ba510aee0d8..8f0e3526806 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java @@ -30,6 +30,7 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.IOException; import java.util.*; +import javax.xml.crypto.XMLCryptoContext; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -104,4 +105,16 @@ public final class Utils { public static boolean sameDocumentURI(String uri) { return (uri != null && (uri.length() == 0 || uri.charAt(0) == '#')); } + + static boolean secureValidation(XMLCryptoContext xc) { + if (xc == null) { + return false; + } + return getBoolean(xc, "org.jcp.xml.dsig.secureValidation"); + } + + private static boolean getBoolean(XMLCryptoContext xc, String name) { + Boolean value = (Boolean)xc.getProperty(name); + return (value != null && value.booleanValue()); + } } diff --git a/jdk/src/share/classes/sun/applet/AppletSecurity.java b/jdk/src/share/classes/sun/applet/AppletSecurity.java index 860815d6188..4bd67decbcc 100644 --- a/jdk/src/share/classes/sun/applet/AppletSecurity.java +++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java @@ -52,7 +52,6 @@ import sun.security.util.SecurityConstants; */ public class AppletSecurity extends AWTSecurityManager { - private AppContext mainAppContext; //URLClassLoader.acc private static Field facc = null; @@ -77,7 +76,6 @@ class AppletSecurity extends AWTSecurityManager { */ public AppletSecurity() { reset(); - mainAppContext = AppContext.getAppContext(); } // Cache to store known restricted packages @@ -312,7 +310,7 @@ class AppletSecurity extends AWTSecurityManager { AppContext appContext = AppContext.getAppContext(); AppletClassLoader appletClassLoader = currentAppletClassLoader(); - if ((appContext == mainAppContext) && (appletClassLoader != null)) { + if (AppContext.isMainContext(appContext) && (appletClassLoader != null)) { // If we're about to allow access to the main EventQueue, // and anything untrusted is on the class context stack, // disallow access. diff --git a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java index c64a51eaa12..a96f92626c4 100644 --- a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java +++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_CN.java @@ -137,7 +137,7 @@ public class MsgAppletViewer_zh_CN extends ListResourceBundle { {"appletpanel.fileexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u5F02\u5E38\u9519\u8BEF: {1}"}, {"appletpanel.filedeath", "\u52A0\u8F7D\u65F6\u5DF2\u7EC8\u6B62{0}: {1}"}, {"appletpanel.fileerror", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u9519\u8BEF: {1}"}, - {"appletpanel.badattribute.exception", "HTML \u8BED\u6CD5\u5206\u6790: \u5BBD\u5EA6/\u9AD8\u5EA6\u5C5E\u6027\u7684\u503C\u4E0D\u6B63\u786E"}, + {"appletpanel.badattribute.exception", "HTML \u89E3\u6790: \u5BBD\u5EA6/\u9AD8\u5EA6\u5C5E\u6027\u7684\u503C\u4E0D\u6B63\u786E"}, {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream \u9700\u8981\u975E\u7A7A\u52A0\u8F7D\u5668"}, {"appletprops.title", "AppletViewer \u5C5E\u6027"}, {"appletprops.label.http.server", "Http \u4EE3\u7406\u670D\u52A1\u5668:"}, diff --git a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java index 54a23e3b8cb..5440cf1b11e 100644 --- a/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java +++ b/jdk/src/share/classes/sun/applet/resources/MsgAppletViewer_zh_TW.java @@ -73,7 +73,7 @@ public class MsgAppletViewer_zh_TW extends ListResourceBundle { {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"}, {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"}, {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: \u4E0D\u518D\u652F\u63F4 \u6A19\u8A18\uFF0C\u8ACB\u6539\u7528 :"}, - {"appletviewer.usage", "\u7528\u6CD5: appletviewer <\u9078\u9805> url(s)\n\n\u5176\u4E2D\u7684 <\u9078\u9805> \u5305\u62EC:\n -debug \u5728 Java \u9664\u932F\u7A0B\u5F0F\u4E2D\u555F\u52D5 Applet \u6AA2\u8996\u5668\n -encoding <\u7DE8\u78BC> \u6307\u5B9A HTML \u6A94\u6848\u4F7F\u7528\u7684\u5B57\u5143\u7DE8\u78BC\n -J<\u57F7\u884C\u968E\u6BB5\u65D7\u6A19> \u5C07\u5F15\u6578\u50B3\u9001\u81F3 java \u89E3\u8B6F\u5668\n\n -J \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002"}, + {"appletviewer.usage", "\u7528\u6CD5: appletviewer url(s)\n\n\u5176\u4E2D\u7684 \u5305\u62EC:\n -debug \u5728 Java \u9664\u932F\u7A0B\u5F0F\u4E2D\u555F\u52D5 Applet \u6AA2\u8996\u5668\n -encoding \u6307\u5B9A HTML \u6A94\u6848\u4F7F\u7528\u7684\u5B57\u5143\u7DE8\u78BC\n -J \u5C07\u5F15\u6578\u50B3\u9001\u81F3 java \u89E3\u8B6F\u5668\n\n -J \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002"}, {"appletviewer.main.err.unsupportedopt", "\u4E0D\u652F\u63F4\u7684\u9078\u9805: {0}"}, {"appletviewer.main.err.unrecognizedarg", "\u7121\u6CD5\u8FA8\u8B58\u7684\u5F15\u6578: {0}"}, {"appletviewer.main.err.dupoption", "\u91CD\u8907\u4F7F\u7528\u9078\u9805: {0}"}, diff --git a/jdk/src/share/classes/sun/audio/AudioData.java b/jdk/src/share/classes/sun/audio/AudioData.java index 9e4ececdd28..023fd3a93f4 100644 --- a/jdk/src/share/classes/sun/audio/AudioData.java +++ b/jdk/src/share/classes/sun/audio/AudioData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,7 @@ import javax.sound.sampled.*; */ -public class AudioData { +public final class AudioData { private static final AudioFormat DEFAULT_FORMAT = new AudioFormat(AudioFormat.Encoding.ULAW, diff --git a/jdk/src/share/classes/sun/audio/AudioDataStream.java b/jdk/src/share/classes/sun/audio/AudioDataStream.java index 0065e6c5c92..dcc21a88233 100644 --- a/jdk/src/share/classes/sun/audio/AudioDataStream.java +++ b/jdk/src/share/classes/sun/audio/AudioDataStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,8 +26,6 @@ package sun.audio; import java.io.*; -import javax.sound.sampled.*; -import javax.sound.midi.*; /** * An input stream to play AudioData. @@ -39,18 +37,18 @@ import javax.sound.midi.*; */ public class AudioDataStream extends ByteArrayInputStream { - AudioData ad; + private final AudioData ad; /** * Constructor */ - public AudioDataStream(AudioData data) { + public AudioDataStream(final AudioData data) { super(data.buffer); this.ad = data; } - AudioData getAudioData() { + final AudioData getAudioData() { return ad; } } diff --git a/jdk/src/share/classes/sun/audio/AudioDevice.java b/jdk/src/share/classes/sun/audio/AudioDevice.java index 757119c27b3..05c180748f0 100644 --- a/jdk/src/share/classes/sun/audio/AudioDevice.java +++ b/jdk/src/share/classes/sun/audio/AudioDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,12 +27,9 @@ package sun.audio; import java.util.Hashtable; import java.util.Vector; -import java.util.Enumeration; import java.io.IOException; import java.io.InputStream; import java.io.BufferedInputStream; -import java.io.OutputStream; -import java.io.ByteArrayInputStream; import javax.sound.sampled.*; import javax.sound.midi.*; @@ -57,8 +54,7 @@ import com.sun.media.sound.Toolkit; * @author Florian Bomers */ -public class - AudioDevice { +public final class AudioDevice { private boolean DEBUG = false /*true*/ ; @@ -404,11 +400,11 @@ public class // INFO CLASS - class Info implements MetaEventListener { + final class Info implements MetaEventListener { - Sequencer sequencer; - InputStream in; - DataPusher datapusher; + final Sequencer sequencer; + final InputStream in; + final DataPusher datapusher; Info( Sequencer sequencer, InputStream in, DataPusher datapusher ) { diff --git a/jdk/src/share/classes/sun/audio/AudioPlayer.java b/jdk/src/share/classes/sun/audio/AudioPlayer.java index 28eee896d09..f6e9a30e9e8 100644 --- a/jdk/src/share/classes/sun/audio/AudioPlayer.java +++ b/jdk/src/share/classes/sun/audio/AudioPlayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,13 +25,7 @@ package sun.audio; -import java.util.Vector; -import java.util.Enumeration; -import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.FileOutputStream; - import java.security.AccessController; import java.security.PrivilegedAction; @@ -69,11 +63,10 @@ import java.security.PrivilegedAction; * @author Arthur van Hoff, Thomas Ball */ -public - class AudioPlayer extends Thread { +public final class AudioPlayer extends Thread { - private AudioDevice devAudio; - private static boolean DEBUG = false /*true*/; + private final AudioDevice devAudio; + private final static boolean DEBUG = false /*true*/; /** * The default audio player. This audio player is initialized diff --git a/jdk/src/share/classes/sun/audio/AudioStream.java b/jdk/src/share/classes/sun/audio/AudioStream.java index 7ccc4b51e75..7fdf2559b97 100644 --- a/jdk/src/share/classes/sun/audio/AudioStream.java +++ b/jdk/src/share/classes/sun/audio/AudioStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,7 @@ package sun.audio; import java.io.InputStream; -import java.io.DataInputStream; import java.io.FilterInputStream; -import java.io.ByteArrayInputStream; import java.io.BufferedInputStream; import java.io.IOException; @@ -41,13 +39,13 @@ import javax.sound.midi.*; */ -public class AudioStream extends FilterInputStream { +public final class AudioStream extends FilterInputStream { // AudioContainerInputStream acis; - protected AudioInputStream ais = null; - protected AudioFormat format = null; - protected MidiFileFormat midiformat = null; - protected InputStream stream = null; + AudioInputStream ais = null; + AudioFormat format = null; + MidiFileFormat midiformat = null; + InputStream stream = null; /* diff --git a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java b/jdk/src/share/classes/sun/audio/AudioStreamSequence.java index f7f409d58f9..f948070c1ce 100644 --- a/jdk/src/share/classes/sun/audio/AudioStreamSequence.java +++ b/jdk/src/share/classes/sun/audio/AudioStreamSequence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,6 @@ package sun.audio; -import java.io.IOException; import java.io.InputStream; import java.io.SequenceInputStream; import java.util.Enumeration; @@ -44,8 +43,8 @@ import java.util.Enumeration; * @see AudioPlayer * @author Arthur van Hoff */ -public - class AudioStreamSequence extends SequenceInputStream { +public final class AudioStreamSequence extends SequenceInputStream { + Enumeration e; InputStream in; diff --git a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java b/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java index 958fca0b4fc..44c76b4d1c8 100644 --- a/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java +++ b/jdk/src/share/classes/sun/audio/AudioTranslatorStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,18 +26,15 @@ package sun.audio; import java.io.InputStream; -import java.io.DataInputStream; -import java.io.FilterInputStream; import java.io.IOException; /** * Translator for native audio formats (not implemented in this release). * */ -public - class AudioTranslatorStream extends NativeAudioStream { +public final class AudioTranslatorStream extends NativeAudioStream { - private int length = 0; + private final int length = 0; public AudioTranslatorStream(InputStream in) throws IOException { super(in); diff --git a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java b/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java index 7264877aae7..e4adf18c33a 100644 --- a/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java +++ b/jdk/src/share/classes/sun/audio/ContinuousAudioDataStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,11 +42,10 @@ package sun.audio; * @author Arthur van Hoff */ -public - class ContinuousAudioDataStream extends AudioDataStream { +public final class ContinuousAudioDataStream extends AudioDataStream { - /** + /** * Create a continuous stream of audio. */ public ContinuousAudioDataStream(AudioData data) { diff --git a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java b/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java index 0ff5beb9955..9b12af84a03 100644 --- a/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java +++ b/jdk/src/share/classes/sun/audio/InvalidAudioFormatException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,20 +29,20 @@ import java.io.IOException; /** * Signals an invalid audio stream for the stream handler. */ -class InvalidAudioFormatException extends IOException { +final class InvalidAudioFormatException extends IOException { /** * Constructor. */ - public InvalidAudioFormatException() { + InvalidAudioFormatException() { super(); } /** * Constructor with a detail message. */ - public InvalidAudioFormatException(String s) { + InvalidAudioFormatException(String s) { super(s); } } diff --git a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java index 8c6ae9ad0fb..fca64f89ec6 100644 --- a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java +++ b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java @@ -375,7 +375,7 @@ public final class AWTAutoShutdown implements Runnable { } final void dumpPeers(final PlatformLogger aLog) { - if (aLog.isLoggable(PlatformLogger.FINE)) { + if (aLog.isLoggable(PlatformLogger.Level.FINE)) { synchronized (activationLock) { synchronized (mainLock) { aLog.fine("Mapped peers:"); diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java index 47f472737ea..4af13ce5703 100644 --- a/jdk/src/share/classes/sun/awt/AppContext.java +++ b/jdk/src/share/classes/sun/awt/AppContext.java @@ -162,7 +162,8 @@ public final class AppContext { } /* The main "system" AppContext, used by everything not otherwise - contained in another AppContext. + contained in another AppContext. It is implicitly created for + standalone apps only (i.e. not applets) */ private static volatile AppContext mainAppContext = null; @@ -189,10 +190,16 @@ public final class AppContext { public static final String DISPOSED_PROPERTY_NAME = "disposed"; public static final String GUI_DISPOSED = "guidisposed"; - private volatile boolean isDisposed = false; // true if AppContext is disposed + private enum State { + VALID, + BEING_DISPOSED, + DISPOSED + }; + + private volatile State state = State.VALID; public boolean isDisposed() { - return isDisposed; + return state == State.DISPOSED; } /* @@ -204,25 +211,6 @@ public final class AppContext { */ private static final AtomicInteger numAppContexts = new AtomicInteger(0); - static { - // On the main Thread, we get the ThreadGroup, make a corresponding - // AppContext, and instantiate the Java EventQueue. This way, legacy - // code is unaffected by the move to multiple AppContext ability. - AccessController.doPrivileged(new PrivilegedAction() { - public Void run() { - ThreadGroup currentThreadGroup = - Thread.currentThread().getThreadGroup(); - ThreadGroup parentThreadGroup = currentThreadGroup.getParent(); - while (parentThreadGroup != null) { - // Find the root ThreadGroup to construct our main AppContext - currentThreadGroup = parentThreadGroup; - parentThreadGroup = currentThreadGroup.getParent(); - } - mainAppContext = new AppContext(currentThreadGroup); - return null; - } - }); - } /* * The context ClassLoader that was used to create this AppContext. @@ -266,6 +254,27 @@ public final class AppContext { private static final ThreadLocal threadAppContext = new ThreadLocal(); + private final static void initMainAppContext() { + // On the main Thread, we get the ThreadGroup, make a corresponding + // AppContext, and instantiate the Java EventQueue. This way, legacy + // code is unaffected by the move to multiple AppContext ability. + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + ThreadGroup currentThreadGroup = + Thread.currentThread().getThreadGroup(); + ThreadGroup parentThreadGroup = currentThreadGroup.getParent(); + while (parentThreadGroup != null) { + // Find the root ThreadGroup to construct our main AppContext + currentThreadGroup = parentThreadGroup; + parentThreadGroup = currentThreadGroup.getParent(); + } + + mainAppContext = SunToolkit.createNewAppContext(currentThreadGroup); + return null; + } + }); + } + /** * Returns the appropriate AppContext for the caller, * as determined by its ThreadGroup. If the main "system" AppContext @@ -278,8 +287,10 @@ public final class AppContext { * @since 1.2 */ public final static AppContext getAppContext() { - if (numAppContexts.get() == 1) // If there's only one system-wide, - return mainAppContext; // return the main system AppContext. + // we are standalone app, return the main app context + if (numAppContexts.get() == 1 && mainAppContext != null) { + return mainAppContext; + } AppContext appContext = threadAppContext.get(); @@ -293,29 +304,37 @@ public final class AppContext { // when new AppContext objects are created. ThreadGroup currentThreadGroup = Thread.currentThread().getThreadGroup(); ThreadGroup threadGroup = currentThreadGroup; + + // Special case: we implicitly create the main app context + // if no contexts have been created yet. This covers standalone apps + // and excludes applets because by the time applet starts + // a number of contexts have already been created by the plugin. + if (numAppContexts.get() == 0) { + // This check is not necessary, its purpose is to help + // Plugin devs to catch all the cases of main AC creation. + if (System.getProperty("javaplugin.version") == null && + System.getProperty("javawebstart.version") == null) { + initMainAppContext(); + } + } + AppContext context = threadGroup2appContext.get(threadGroup); while (context == null) { threadGroup = threadGroup.getParent(); if (threadGroup == null) { - // If we get here, we're running under a ThreadGroup that - // has no AppContext associated with it. This should never - // happen, because createNewContext() should be used by the - // toolkit to create the ThreadGroup that everything runs - // under. - throw new RuntimeException("Invalid ThreadGroup"); + return null; } context = threadGroup2appContext.get(threadGroup); } + // In case we did anything in the above while loop, we add // all the intermediate ThreadGroups to threadGroup2appContext // so we won't spin again. for (ThreadGroup tg = currentThreadGroup; tg != threadGroup; tg = tg.getParent()) { threadGroup2appContext.put(tg, context); } + // Now we're done, so we cache the latest key/value pair. - // (we do this before checking with any AWTSecurityManager, so if - // this Thread equates with the main AppContext in the cache, it - // still will) threadAppContext.set(context); return context; @@ -323,19 +342,20 @@ public final class AppContext { }); } - if (appContext == mainAppContext) { - // Before we return the main "system" AppContext, check to - // see if there's an AWTSecurityManager installed. If so, - // allow it to choose the AppContext to return. - AppContext secAppContext = getExecutionAppContext(); - if (secAppContext != null) { - appContext = secAppContext; // Return what we're told - } - } - return appContext; } + /** + * Returns true if the specified AppContext is the main AppContext. + * + * @param ctx the context to compare with the main context + * @return true if the specified AppContext is the main AppContext. + * @since 1.8 + */ + public final static boolean isMainContext(AppContext ctx) { + return (ctx != null && ctx == mainAppContext); + } + private final static AppContext getExecutionAppContext() { SecurityManager securityManager = System.getSecurityManager(); if ((securityManager != null) && @@ -348,16 +368,6 @@ public final class AppContext { return null; } - /** - * Returns the main ("system") AppContext. - * - * @return the main AppContext - * @since 1.8 - */ - final static AppContext getMainAppContext() { - return mainAppContext; - } - private long DISPOSAL_TIMEOUT = 5000; // Default to 5-second timeout // for disposal of all Frames // (we wait for this time twice, @@ -389,10 +399,11 @@ public final class AppContext { } synchronized(this) { - if (this.isDisposed) { - return; // If already disposed, bail. + if (this.state != State.VALID) { + return; // If already disposed or being disposed, bail. } - this.isDisposed = true; + + this.state = State.BEING_DISPOSED; } final PropertyChangeSupport changeSupport = this.changeSupport; @@ -462,6 +473,11 @@ public final class AppContext { } catch (InterruptedException e) { } } + // We are done with posting events, so change the state to disposed + synchronized(this) { + this.state = State.DISPOSED; + } + // Next, we interrupt all Threads in the ThreadGroup this.threadGroup.interrupt(); // Note, the EventDispatchThread we've interrupted may dump an @@ -798,19 +814,27 @@ public final class AppContext { static { sun.misc.SharedSecrets.setJavaAWTAccess(new sun.misc.JavaAWTAccess() { public Object get(Object key) { - return getAppContext().get(key); + AppContext ac = getAppContext(); + return (ac == null) ? null : ac.get(key); } public void put(Object key, Object value) { - getAppContext().put(key, value); + AppContext ac = getAppContext(); + if (ac != null) { + ac.put(key, value); + } } public void remove(Object key) { - getAppContext().remove(key); + AppContext ac = getAppContext(); + if (ac != null) { + ac.remove(key); + } } public boolean isDisposed() { - return getAppContext().isDisposed(); + AppContext ac = getAppContext(); + return (ac == null) ? true : ac.isDisposed(); } public boolean isMainAppContext() { - return (numAppContexts.get() == 1); + return (numAppContexts.get() == 1 && mainAppContext != null); } public Object getContext() { return getAppContext(); diff --git a/jdk/src/share/classes/sun/awt/DebugSettings.java b/jdk/src/share/classes/sun/awt/DebugSettings.java index b4cd81ab0d7..5b4e3ed1c59 100644 --- a/jdk/src/share/classes/sun/awt/DebugSettings.java +++ b/jdk/src/share/classes/sun/awt/DebugSettings.java @@ -128,7 +128,7 @@ final class DebugSettings { }); // echo the initial property settings to stdout - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("DebugSettings:\n{0}", this); } } @@ -250,7 +250,7 @@ final class DebugSettings { } private void println(Object object) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer(object.toString()); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XIconInfo.java b/jdk/src/share/classes/sun/awt/IconInfo.java similarity index 89% rename from jdk/src/solaris/classes/sun/awt/X11/XIconInfo.java rename to jdk/src/share/classes/sun/awt/IconInfo.java index 54b65c08226..0ae1f733e05 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XIconInfo.java +++ b/jdk/src/share/classes/sun/awt/IconInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.awt.X11; +package sun.awt; import java.awt.*; import java.awt.color.*; import java.awt.image.*; @@ -30,17 +30,17 @@ import sun.awt.image.ToolkitImage; import sun.awt.image.ImageRepresentation; import java.util.Arrays; -class XIconInfo { +public class IconInfo { /** - * Representation of image as an int array - * It's being used for _NET_WM_ICON hint - * with 32-bit X data model + * Representation of image as an int array. + * It's used on platforms where icon data + * is expected to be in 32-bit format. */ private int[] intIconData; /** - * Representation of image as an int array - * It's being used for _NET_WM_ICON hint - * with 64-bit X data model + * Representation of image as an long array. + * It's used on platforms where icon data + * is expected to be in 64-bit format. */ private long[] longIconData; /** @@ -68,7 +68,7 @@ class XIconInfo { */ private int rawLength; - XIconInfo(int[] intIconData) { + public IconInfo(int[] intIconData) { this.intIconData = (null == intIconData) ? null : Arrays.copyOf(intIconData, intIconData.length); this.width = intIconData[0]; @@ -78,7 +78,7 @@ class XIconInfo { this.rawLength = width * height + 2; } - XIconInfo(long[] longIconData) { + public IconInfo(long[] longIconData) { this.longIconData = (null == longIconData) ? null : Arrays.copyOf(longIconData, longIconData.length); this.width = (int)longIconData[0]; @@ -88,7 +88,7 @@ class XIconInfo { this.rawLength = width * height + 2; } - XIconInfo(Image image) { + public IconInfo(Image image) { this.image = image; if (image instanceof ToolkitImage) { ImageRepresentation ir = ((ToolkitImage)image).getImageRep(); @@ -107,33 +107,33 @@ class XIconInfo { /* * It sets size of scaled icon. */ - void setScaledSize(int width, int height) { + public void setScaledSize(int width, int height) { this.scaledWidth = width; this.scaledHeight = height; this.rawLength = width * height + 2; } - boolean isValid() { + public boolean isValid() { return (width > 0 && height > 0); } - int getWidth() { + public int getWidth() { return width; } - int getHeight() { + public int getHeight() { return height; } public String toString() { - return "XIconInfo[w=" + width + ",h=" + height + ",sw=" + scaledWidth + ",sh=" + scaledHeight + "]"; + return "IconInfo[w=" + width + ",h=" + height + ",sw=" + scaledWidth + ",sh=" + scaledHeight + "]"; } - int getRawLength() { + public int getRawLength() { return rawLength; } - int[] getIntData() { + public int[] getIntData() { if (this.intIconData == null) { if (this.longIconData != null) { this.intIconData = longArrayToIntArray(longIconData); @@ -144,7 +144,7 @@ class XIconInfo { return this.intIconData; } - long[] getLongData() { + public long[] getLongData() { if (this.longIconData == null) { if (this.intIconData != null) { this.longIconData = intArrayToLongArray(this.intIconData); @@ -156,7 +156,7 @@ class XIconInfo { return this.longIconData; } - Image getImage() { + public Image getImage() { if (this.image == null) { if (this.intIconData != null) { this.image = intArrayToImage(this.intIconData); diff --git a/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java b/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java index 760a48bc76f..f9aa85d7838 100644 --- a/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java +++ b/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java @@ -57,7 +57,7 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { @@ -127,7 +127,7 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST, false, lightweightChild, cause); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Posting focus event: " + fl); } SunToolkit.postEvent(SunToolkit.targetToAppContext(currentOwner), fl); @@ -136,7 +136,7 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED, false, currentOwner, cause); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Posting focus event: " + fg); } SunToolkit.postEvent(SunToolkit.targetToAppContext(lightweightChild), fg); diff --git a/jdk/src/share/classes/sun/awt/ScrollPaneWheelScroller.java b/jdk/src/share/classes/sun/awt/ScrollPaneWheelScroller.java index 024f734670d..73aebd75ab8 100644 --- a/jdk/src/share/classes/sun/awt/ScrollPaneWheelScroller.java +++ b/jdk/src/share/classes/sun/awt/ScrollPaneWheelScroller.java @@ -47,7 +47,7 @@ public abstract class ScrollPaneWheelScroller { * Called from ScrollPane.processMouseWheelEvent() */ public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource()); } int increment = 0; @@ -56,7 +56,7 @@ public abstract class ScrollPaneWheelScroller { Adjustable adj = getAdjustableToScroll(sp); if (adj != null) { increment = getIncrementFromAdjustable(adj, e); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment); } scrollAdjustable(adj, increment); @@ -74,7 +74,7 @@ public abstract class ScrollPaneWheelScroller { // if policy is display always or never, use vert if (policy == ScrollPane.SCROLLBARS_ALWAYS || policy == ScrollPane.SCROLLBARS_NEVER) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("using vertical scrolling due to scrollbar policy"); } return sp.getVAdjustable(); @@ -85,7 +85,7 @@ public abstract class ScrollPaneWheelScroller { Insets ins = sp.getInsets(); int vertScrollWidth = sp.getVScrollbarWidth(); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("insets: l = " + ins.left + ", r = " + ins.right + ", t = " + ins.top + ", b = " + ins.bottom); log.finer("vertScrollWidth = " + vertScrollWidth); @@ -94,7 +94,7 @@ public abstract class ScrollPaneWheelScroller { // Check if scrollbar is showing by examining insets of the // ScrollPane if (ins.right >= vertScrollWidth) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("using vertical scrolling because scrollbar is present"); } return sp.getVAdjustable(); @@ -102,13 +102,13 @@ public abstract class ScrollPaneWheelScroller { else { int horizScrollHeight = sp.getHScrollbarHeight(); if (ins.bottom >= horizScrollHeight) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("using horiz scrolling because scrollbar is present"); } return sp.getHAdjustable(); } else { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("using NO scrollbar becsause neither is present"); } return null; @@ -124,7 +124,7 @@ public abstract class ScrollPaneWheelScroller { */ public static int getIncrementFromAdjustable(Adjustable adj, MouseWheelEvent e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (adj == null) { log.fine("Assertion (adj != null) failed"); } @@ -146,7 +146,7 @@ public abstract class ScrollPaneWheelScroller { * bounds and sets the new value to the Adjustable. */ public static void scrollAdjustable(Adjustable adj, int amount) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (adj == null) { log.fine("Assertion (adj != null) failed"); } @@ -157,7 +157,7 @@ public abstract class ScrollPaneWheelScroller { int current = adj.getValue(); int upperLimit = adj.getMaximum() - adj.getVisibleAmount(); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("doScrolling by " + amount); } diff --git a/jdk/src/share/classes/sun/awt/SunDisplayChanger.java b/jdk/src/share/classes/sun/awt/SunDisplayChanger.java index c1ef6f3c61b..dc127dacf5e 100644 --- a/jdk/src/share/classes/sun/awt/SunDisplayChanger.java +++ b/jdk/src/share/classes/sun/awt/SunDisplayChanger.java @@ -71,12 +71,12 @@ public class SunDisplayChanger { * notified when the display is changed. */ public void add(DisplayChangedListener theListener) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (theListener == null) { log.fine("Assertion (theListener != null) failed"); } } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Adding listener: " + theListener); } listeners.put(theListener, null); @@ -86,12 +86,12 @@ public class SunDisplayChanger { * Remove the given DisplayChangeListener from this SunDisplayChanger. */ public void remove(DisplayChangedListener theListener) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (theListener == null) { log.fine("Assertion (theListener != null) failed"); } } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Removing listener: " + theListener); } listeners.remove(theListener); @@ -102,7 +102,7 @@ public class SunDisplayChanger { * taken place by calling their displayChanged() methods. */ public void notifyListeners() { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("notifyListeners"); } // This method is implemented by making a clone of the set of listeners, @@ -126,7 +126,7 @@ public class SunDisplayChanger { while (itr.hasNext()) { DisplayChangedListener current = itr.next(); try { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("displayChanged for listener: " + current); } current.displayChanged(); @@ -146,7 +146,7 @@ public class SunDisplayChanger { * taken place by calling their paletteChanged() methods. */ public void notifyPaletteChanged() { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("notifyPaletteChanged"); } // This method is implemented by making a clone of the set of listeners, @@ -169,7 +169,7 @@ public class SunDisplayChanger { while (itr.hasNext()) { DisplayChangedListener current = itr.next(); try { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("paletteChanged for listener: " + current); } current.paletteChanged(); diff --git a/jdk/src/share/classes/sun/awt/SunGraphicsCallback.java b/jdk/src/share/classes/sun/awt/SunGraphicsCallback.java index 69d21084542..f09568e6f2a 100644 --- a/jdk/src/share/classes/sun/awt/SunGraphicsCallback.java +++ b/jdk/src/share/classes/sun/awt/SunGraphicsCallback.java @@ -88,7 +88,7 @@ public abstract class SunGraphicsCallback { int ncomponents = comps.length; Shape clip = g.getClip(); - if (log.isLoggable(PlatformLogger.FINER) && (clip != null)) { + if (log.isLoggable(PlatformLogger.Level.FINER) && (clip != null)) { Rectangle newrect = clip.getBounds(); log.finer("x = " + newrect.x + ", y = " + newrect.y + ", width = " + newrect.width + diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java index 733d677aafe..8341bdf870d 100644 --- a/jdk/src/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/share/classes/sun/awt/SunToolkit.java @@ -58,7 +58,7 @@ public abstract class SunToolkit extends Toolkit implements WindowClosingSupport, WindowClosingListener, ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider { - private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunToolkit"); + // 8014718: logging has been removed from SunToolkit /* Load debug settings for native code */ static { @@ -97,6 +97,14 @@ public abstract class SunToolkit extends Toolkit */ public final static int MAX_BUTTONS_SUPPORTED = 20; + /** + * Creates and initializes EventQueue instance for the specified + * AppContext. + * Note that event queue must be created from createNewAppContext() + * only in order to ensure that EventQueue constructor obtains + * the correct AppContext. + * @param appContext AppContext to associate with the event queue + */ private static void initEQ(AppContext appContext) { EventQueue eventQueue; @@ -117,8 +125,6 @@ public abstract class SunToolkit extends Toolkit } public SunToolkit() { - // 7122796: Always create an EQ for the main AppContext - initEQ(AppContext.getMainAppContext()); } public boolean useBufferPerWindow() { @@ -281,11 +287,14 @@ public abstract class SunToolkit extends Toolkit */ public static AppContext createNewAppContext() { ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); + return createNewAppContext(threadGroup); + } + + static final AppContext createNewAppContext(ThreadGroup threadGroup) { // Create appContext before initialization of EventQueue, so all // the calls to AppContext.getAppContext() from EventQueue ctor // return correct values AppContext appContext = new AppContext(threadGroup); - initEQ(appContext); return appContext; @@ -487,9 +496,7 @@ public abstract class SunToolkit extends Toolkit setSystemGenerated(event); AppContext eventContext = targetToAppContext(event.getSource()); if (eventContext != null && !eventContext.equals(appContext)) { - if (log.isLoggable(PlatformLogger.FINE)) { - log.fine("Event posted on wrong app context : " + event); - } + throw new RuntimeException("Event posted on wrong app context : " + event); } PostEventQueue postEventQueue = (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY); @@ -880,10 +887,6 @@ public abstract class SunToolkit extends Toolkit //with scale factors x1, x3/4, x2/3, xN, x1/N. Image im = i.next(); if (im == null) { - if (log.isLoggable(PlatformLogger.FINER)) { - log.finer("SunToolkit.getScaledIconImage: " + - "Skipping the image passed into Java because it's null."); - } continue; } if (im instanceof ToolkitImage) { @@ -896,10 +899,6 @@ public abstract class SunToolkit extends Toolkit iw = im.getWidth(null); ih = im.getHeight(null); } catch (Exception e){ - if (log.isLoggable(PlatformLogger.FINER)) { - log.finer("SunToolkit.getScaledIconImage: " + - "Perhaps the image passed into Java is broken. Skipping this icon."); - } continue; } if (iw > 0 && ih > 0) { @@ -971,14 +970,6 @@ public abstract class SunToolkit extends Toolkit try { int x = (width - bestWidth) / 2; int y = (height - bestHeight) / 2; - if (log.isLoggable(PlatformLogger.FINER)) { - log.finer("WWindowPeer.getScaledIconData() result : " + - "w : " + width + " h : " + height + - " iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) + - " sim : " + bestSimilarity + " sf : " + bestScaleFactor + - " adjW : " + bestWidth + " adjH : " + bestHeight + - " x : " + x + " y : " + y); - } g.drawImage(bestImage, x, y, bestWidth, bestHeight, null); } finally { g.dispose(); @@ -989,10 +980,6 @@ public abstract class SunToolkit extends Toolkit public static DataBufferInt getScaledIconData(java.util.List imageList, int width, int height) { BufferedImage bimage = getScaledIconImage(imageList, width, height); if (bimage == null) { - if (log.isLoggable(PlatformLogger.FINER)) { - log.finer("SunToolkit.getScaledIconData: " + - "Perhaps the image passed into Java is broken. Skipping this icon."); - } return null; } Raster raster = bimage.getRaster(); diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index 2c364e4acd5..0011e120e10 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -398,7 +398,7 @@ public abstract class DataTransferer { * "text". */ public static boolean doesSubtypeSupportCharset(DataFlavor flavor) { - if (dtLog.isLoggable(PlatformLogger.FINE)) { + if (dtLog.isLoggable(PlatformLogger.Level.FINE)) { if (!"text".equals(flavor.getPrimaryType())) { dtLog.fine("Assertion (\"text\".equals(flavor.getPrimaryType())) failed"); } diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java index 66d1bf7b3b6..efbf14f1a6a 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java @@ -869,7 +869,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer, void registerEvent(SunDropTargetEvent e) { handler.lock(); - if (!eventSet.add(e) && dndLog.isLoggable(PlatformLogger.FINE)) { + if (!eventSet.add(e) && dndLog.isLoggable(PlatformLogger.Level.FINE)) { dndLog.fine("Event is already registered: " + e); } handler.unlock(); diff --git a/jdk/src/share/classes/sun/awt/im/InputContext.java b/jdk/src/share/classes/sun/awt/im/InputContext.java index 7c6fb2043da..9f85c895980 100644 --- a/jdk/src/share/classes/sun/awt/im/InputContext.java +++ b/jdk/src/share/classes/sun/awt/im/InputContext.java @@ -387,7 +387,7 @@ public class InputContext extends java.awt.im.InputContext } previousInputMethod = null; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current client component " + currentClientComponent); } if (inputMethod instanceof InputMethodAdapter) { @@ -887,7 +887,7 @@ public class InputContext extends java.awt.im.InputContext private void logCreationFailed(Throwable throwable) { PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im"); - if (logger.isLoggable(PlatformLogger.CONFIG)) { + if (logger.isLoggable(PlatformLogger.Level.CONFIG)) { String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed", "Could not create {0}. Reason: {1}"); Object[] args = diff --git a/jdk/src/share/classes/sun/awt/image/ByteBandedRaster.java b/jdk/src/share/classes/sun/awt/image/ByteBandedRaster.java index 56d7316a5c8..e3277160b70 100644 --- a/jdk/src/share/classes/sun/awt/image/ByteBandedRaster.java +++ b/jdk/src/share/classes/sun/awt/image/ByteBandedRaster.java @@ -159,7 +159,7 @@ public class ByteBandedRaster extends SunWritableRaster { throw new RasterFormatException("ByteBandedRasters must have"+ "BandedSampleModels"); } - verify(false); + verify(); } @@ -731,16 +731,37 @@ public class ByteBandedRaster extends SunWritableRaster { } /** - * Verify that the layout parameters are consistent with - * the data. If strictCheck - * is false, this method will check for ArrayIndexOutOfBounds conditions. If - * strictCheck is true, this method will check for additional error - * conditions such as line wraparound (width of a line greater than - * the scanline stride). - * @return String Error string, if the layout is incompatible with - * the data. Otherwise returns null. + * Verify that the layout parameters are consistent with the data. + * Verifies whether the data buffer has enough data for the raster, + * taking into account offsets, after ensuring all offsets are >=0. + * @throws RasterFormatException if a problem is detected. */ - private void verify (boolean strictCheck) { + private void verify() { + + /* Need to re-verify the dimensions since a sample model may be + * specified to the constructor + */ + if (width <= 0 || height <= 0 || + height > (Integer.MAX_VALUE / width)) + { + throw new RasterFormatException("Invalid raster dimension"); + } + + if (scanlineStride < 0 || + scanlineStride > (Integer.MAX_VALUE / height)) + { + // integer overflow + throw new RasterFormatException("Incorrect scanline stride: " + + scanlineStride); + } + + for (int i = 0; i < data.length; i++) { + if (scanlineStride > data[i].length) { + throw new RasterFormatException("Incorrect scanline stride: " + + scanlineStride); + } + } + // Make sure data for Raster is in a legal range for (int i=0; i < dataOffsets.length; i++) { if (dataOffsets[i] < 0) { @@ -750,32 +771,42 @@ public class ByteBandedRaster extends SunWritableRaster { } } - int maxSize = 0; - int size; + int lastScanOffset = (height - 1) * scanlineStride; + + if ((width - 1) > (Integer.MAX_VALUE - lastScanOffset)) { + throw new RasterFormatException("Invalid raster dimension"); + } + int lastPixelOffset = lastScanOffset + (width-1); + + int maxIndex = 0; + int index; for (int i=0; i < numDataElements; i++) { - size = (height-1)*scanlineStride + (width-1) + dataOffsets[i]; - if (size > maxSize) { - maxSize = size; + if (dataOffsets[i] > (Integer.MAX_VALUE - lastPixelOffset)) { + throw new RasterFormatException("Invalid raster dimension"); + } + index = lastPixelOffset + dataOffsets[i]; + if (index > maxIndex) { + maxIndex = index; } } if (data.length == 1) { - if (data[0].length < maxSize*numDataElements) { + if (data[0].length <= maxIndex*numDataElements) { throw new RasterFormatException("Data array too small "+ "(it is "+data[0].length+ - " and should be "+ - (maxSize*numDataElements)+ + " and should be > "+ + (maxIndex*numDataElements)+ " )"); } } else { for (int i=0; i < numDataElements; i++) { - if (data[i].length < maxSize) { + if (data[i].length <= maxIndex) { throw new RasterFormatException("Data array too small "+ "(it is "+data[i].length+ - " and should be "+ - maxSize+" )"); + " and should be > "+ + maxIndex+" )"); } } } diff --git a/jdk/src/share/classes/sun/awt/image/ByteComponentRaster.java b/jdk/src/share/classes/sun/awt/image/ByteComponentRaster.java index f2675dbf97d..13954f3a364 100644 --- a/jdk/src/share/classes/sun/awt/image/ByteComponentRaster.java +++ b/jdk/src/share/classes/sun/awt/image/ByteComponentRaster.java @@ -885,12 +885,10 @@ public class ByteComponentRaster extends SunWritableRaster { } } - int maxSize = 0; - int size; - // we can be sure that width and height are greater than 0 if (scanlineStride < 0 || - scanlineStride > (Integer.MAX_VALUE / height)) + scanlineStride > (Integer.MAX_VALUE / height) || + scanlineStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect scanline stride: " @@ -899,7 +897,8 @@ public class ByteComponentRaster extends SunWritableRaster { int lastScanOffset = (height - 1) * scanlineStride; if (pixelStride < 0 || - pixelStride > (Integer.MAX_VALUE / width)) + pixelStride > (Integer.MAX_VALUE / width) || + pixelStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect pixel stride: " @@ -913,6 +912,8 @@ public class ByteComponentRaster extends SunWritableRaster { } lastPixelOffset += lastScanOffset; + int index; + int maxIndex = 0; for (int i = 0; i < numDataElements; i++) { if (dataOffsets[i] > (Integer.MAX_VALUE - lastPixelOffset)) { throw new RasterFormatException("Incorrect band offset: " @@ -920,15 +921,15 @@ public class ByteComponentRaster extends SunWritableRaster { } - size = lastPixelOffset + dataOffsets[i]; + index = lastPixelOffset + dataOffsets[i]; - if (size > maxSize) { - maxSize = size; + if (index > maxIndex) { + maxIndex = index; } } - if (data.length < maxSize) { - throw new RasterFormatException("Data array too small (should be " - + maxSize + " )"); + if (data.length <= maxIndex) { + throw new RasterFormatException("Data array too small (should be > " + + maxIndex + " )"); } } diff --git a/jdk/src/share/classes/sun/awt/image/BytePackedRaster.java b/jdk/src/share/classes/sun/awt/image/BytePackedRaster.java index 598d68dce47..c819c9d52f5 100644 --- a/jdk/src/share/classes/sun/awt/image/BytePackedRaster.java +++ b/jdk/src/share/classes/sun/awt/image/BytePackedRaster.java @@ -1387,7 +1387,8 @@ public class BytePackedRaster extends SunWritableRaster { } if (scanlineStride < 0 || - scanlineStride > (Integer.MAX_VALUE / height)) + scanlineStride > (Integer.MAX_VALUE / height) || + scanlineStride > data.length) { throw new RasterFormatException("Invalid scanline stride"); } diff --git a/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java b/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java index 92bec9f944a..2f495971cf4 100644 --- a/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java +++ b/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java @@ -654,12 +654,10 @@ public class IntegerComponentRaster extends SunWritableRaster { ") must be >= 0"); } - int maxSize = 0; - int size; - // we can be sure that width and height are greater than 0 if (scanlineStride < 0 || - scanlineStride > (Integer.MAX_VALUE / height)) + scanlineStride > (Integer.MAX_VALUE / height) || + scanlineStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect scanline stride: " @@ -668,7 +666,8 @@ public class IntegerComponentRaster extends SunWritableRaster { int lastScanOffset = (height - 1) * scanlineStride; if (pixelStride < 0 || - pixelStride > (Integer.MAX_VALUE / width)) + pixelStride > (Integer.MAX_VALUE / width) || + pixelStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect pixel stride: " @@ -682,21 +681,23 @@ public class IntegerComponentRaster extends SunWritableRaster { } lastPixelOffset += lastScanOffset; + int index; + int maxIndex = 0; for (int i = 0; i < numDataElements; i++) { if (dataOffsets[i] > (Integer.MAX_VALUE - lastPixelOffset)) { throw new RasterFormatException("Incorrect band offset: " + dataOffsets[i]); } - size = lastPixelOffset + dataOffsets[i]; + index = lastPixelOffset + dataOffsets[i]; - if (size > maxSize) { - maxSize = size; + if (index > maxIndex) { + maxIndex = index; } } - if (data.length < maxSize) { - throw new RasterFormatException("Data array too small (should be " - + maxSize + " )"); + if (data.length <= maxIndex) { + throw new RasterFormatException("Data array too small (should be > " + + maxIndex + " )"); } } diff --git a/jdk/src/share/classes/sun/awt/image/ShortBandedRaster.java b/jdk/src/share/classes/sun/awt/image/ShortBandedRaster.java index d56a25f3f84..058a2573c09 100644 --- a/jdk/src/share/classes/sun/awt/image/ShortBandedRaster.java +++ b/jdk/src/share/classes/sun/awt/image/ShortBandedRaster.java @@ -156,7 +156,7 @@ public class ShortBandedRaster extends SunWritableRaster { throw new RasterFormatException("ShortBandedRasters must have "+ "BandedSampleModels"); } - verify(false); + verify(); } /** @@ -730,16 +730,37 @@ public class ShortBandedRaster extends SunWritableRaster { } /** - * Verify that the layout parameters are consistent with - * the data. If strictCheck - * is false, this method will check for ArrayIndexOutOfBounds conditions. If - * strictCheck is true, this method will check for additional error - * conditions such as line wraparound (width of a line greater than - * the scanline stride). - * @return String Error string, if the layout is incompatible with - * the data. Otherwise returns null. + * Verify that the layout parameters are consistent with the data. + * Verifies whether the data buffer has enough data for the raster, + * taking into account offsets, after ensuring all offsets are >=0. + * @throws RasterFormatException if a problem is detected. */ - private void verify (boolean strictCheck) { + private void verify() { + + /* Need to re-verify the dimensions since a sample model may be + * specified to the constructor + */ + if (width <= 0 || height <= 0 || + height > (Integer.MAX_VALUE / width)) + { + throw new RasterFormatException("Invalid raster dimension"); + } + + if (scanlineStride < 0 || + scanlineStride > (Integer.MAX_VALUE / height)) + { + // integer overflow + throw new RasterFormatException("Incorrect scanline stride: " + + scanlineStride); + } + + for (int i = 0; i < data.length; i++) { + if (scanlineStride > data[i].length) { + throw new RasterFormatException("Incorrect scanline stride: " + + scanlineStride); + } + } + // Make sure data for Raster is in a legal range for (int i=0; i < dataOffsets.length; i++) { if (dataOffsets[i] < 0) { @@ -749,19 +770,28 @@ public class ShortBandedRaster extends SunWritableRaster { } } - int maxSize = 0; - int size; + int lastScanOffset = (height - 1) * scanlineStride; + if ((width - 1) > (Integer.MAX_VALUE - lastScanOffset)) { + throw new RasterFormatException("Invalid raster dimension"); + } + int lastPixelOffset = lastScanOffset + (width - 1); + + int maxIndex = 0; + int index; for (int i=0; i < numDataElements; i++) { - size = (height-1)*scanlineStride + (width-1) + dataOffsets[i]; - if (size > maxSize) { - maxSize = size; + if (dataOffsets[i] > (Integer.MAX_VALUE - lastPixelOffset)) { + throw new RasterFormatException("Invalid raster dimension"); + } + index = lastPixelOffset + dataOffsets[i]; + if (index > maxIndex) { + maxIndex = index; } } for (int i=0; i < numDataElements; i++) { - if (data[i].length < maxSize) { - throw new RasterFormatException("Data array too small (should be "+ - maxSize+" )"); + if (data[i].length <= maxIndex) { + throw new RasterFormatException("Data array too small " + + "(should be > "+ maxIndex+" )"); } } } diff --git a/jdk/src/share/classes/sun/awt/image/ShortComponentRaster.java b/jdk/src/share/classes/sun/awt/image/ShortComponentRaster.java index 3b33595c129..a84da635599 100644 --- a/jdk/src/share/classes/sun/awt/image/ShortComponentRaster.java +++ b/jdk/src/share/classes/sun/awt/image/ShortComponentRaster.java @@ -819,12 +819,10 @@ public class ShortComponentRaster extends SunWritableRaster { } } - int maxSize = 0; - int size; - // we can be sure that width and height are greater than 0 if (scanlineStride < 0 || - scanlineStride > (Integer.MAX_VALUE / height)) + scanlineStride > (Integer.MAX_VALUE / height) || + scanlineStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect scanline stride: " @@ -833,7 +831,8 @@ public class ShortComponentRaster extends SunWritableRaster { int lastScanOffset = (height - 1) * scanlineStride; if (pixelStride < 0 || - pixelStride > (Integer.MAX_VALUE / width)) + pixelStride > (Integer.MAX_VALUE / width) || + pixelStride > data.length) { // integer overflow throw new RasterFormatException("Incorrect pixel stride: " @@ -847,21 +846,23 @@ public class ShortComponentRaster extends SunWritableRaster { } lastPixelOffset += lastScanOffset; + int index; + int maxIndex = 0; for (int i = 0; i < numDataElements; i++) { if (dataOffsets[i] > (Integer.MAX_VALUE - lastPixelOffset)) { throw new RasterFormatException("Incorrect band offset: " + dataOffsets[i]); } - size = lastPixelOffset + dataOffsets[i]; + index = lastPixelOffset + dataOffsets[i]; - if (size > maxSize) { - maxSize = size; + if (index > maxIndex) { + maxIndex = index; } } - if (data.length < maxSize) { - throw new RasterFormatException("Data array too small (should be " - + maxSize + " )"); + if (data.length <= maxIndex) { + throw new RasterFormatException("Data array too small (should be > " + + maxIndex + " )"); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png b/jdk/src/share/classes/sun/awt/resources/security-icon-bw16.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-bw16.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png b/jdk/src/share/classes/sun/awt/resources/security-icon-bw24.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-bw24.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png b/jdk/src/share/classes/sun/awt/resources/security-icon-bw32.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-bw32.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png b/jdk/src/share/classes/sun/awt/resources/security-icon-bw48.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-bw48.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png b/jdk/src/share/classes/sun/awt/resources/security-icon-interim16.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-interim16.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png b/jdk/src/share/classes/sun/awt/resources/security-icon-interim24.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-interim24.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png b/jdk/src/share/classes/sun/awt/resources/security-icon-interim32.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-interim32.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png b/jdk/src/share/classes/sun/awt/resources/security-icon-interim48.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-interim48.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png b/jdk/src/share/classes/sun/awt/resources/security-icon-yellow16.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-yellow16.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png b/jdk/src/share/classes/sun/awt/resources/security-icon-yellow24.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-yellow24.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png b/jdk/src/share/classes/sun/awt/resources/security-icon-yellow32.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-yellow32.png diff --git a/jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png b/jdk/src/share/classes/sun/awt/resources/security-icon-yellow48.png similarity index 100% rename from jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png rename to jdk/src/share/classes/sun/awt/resources/security-icon-yellow48.png diff --git a/jdk/src/share/classes/sun/font/CreatedFontTracker.java b/jdk/src/share/classes/sun/font/CreatedFontTracker.java index 541dd7065ca..11aff595a60 100644 --- a/jdk/src/share/classes/sun/font/CreatedFontTracker.java +++ b/jdk/src/share/classes/sun/font/CreatedFontTracker.java @@ -25,13 +25,22 @@ package sun.font; +import java.io.File; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; + +import sun.awt.AppContext; + public class CreatedFontTracker { public static final int MAX_FILE_SIZE = 32 * 1024 * 1024; public static final int MAX_TOTAL_BYTES = 10 * MAX_FILE_SIZE; - static int numBytes; static CreatedFontTracker tracker; + int numBytes; public static synchronized CreatedFontTracker getTracker() { if (tracker == null) { @@ -40,6 +49,10 @@ public class CreatedFontTracker { return tracker; } + private CreatedFontTracker() { + numBytes = 0; + } + public synchronized int getNumBytes() { return numBytes; } @@ -51,4 +64,108 @@ public class CreatedFontTracker { public synchronized void subBytes(int sz) { numBytes -= sz; } + + /** + * Returns an AppContext-specific counting semaphore. + */ + private static synchronized Semaphore getCS() { + final AppContext appContext = AppContext.getAppContext(); + Semaphore cs = (Semaphore) appContext.get(CreatedFontTracker.class); + if (cs == null) { + // Make a semaphore with 5 permits that obeys the first-in first-out + // granting of permits. + cs = new Semaphore(5, true); + appContext.put(CreatedFontTracker.class, cs); + } + return cs; + } + + public boolean acquirePermit() throws InterruptedException { + // This does a timed-out wait. + return getCS().tryAcquire(120, TimeUnit.SECONDS); + } + + public void releasePermit() { + getCS().release(); + } + + public void add(File file) { + TempFileDeletionHook.add(file); + } + + public void set(File file, OutputStream os) { + TempFileDeletionHook.set(file, os); + } + + public void remove(File file) { + TempFileDeletionHook.remove(file); + } + + /** + * Helper class for cleanup of temp files created while processing fonts. + * Note that this only applies to createFont() from an InputStream object. + */ + private static class TempFileDeletionHook { + private static HashMap files = new HashMap<>(); + + private static Thread t = null; + static void init() { + if (t == null) { + // Add a shutdown hook to remove the temp file. + java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + /* The thread must be a member of a thread group + * which will not get GCed before VM exit. + * Make its parent the top-level thread group. + */ + ThreadGroup tg = + Thread.currentThread().getThreadGroup(); + for (ThreadGroup tgn = tg; + tgn != null; + tg = tgn, tgn = tg.getParent()); + t = new Thread(tg, new Runnable() { + public void run() { + runHooks(); + } + }); + t.setContextClassLoader(null); + Runtime.getRuntime().addShutdownHook(t); + return null; + } + }); + } + } + + private TempFileDeletionHook() {} + + static synchronized void add(File file) { + init(); + files.put(file, null); + } + + static synchronized void set(File file, OutputStream os) { + files.put(file, os); + } + + static synchronized void remove(File file) { + files.remove(file); + } + + static synchronized void runHooks() { + if (files.isEmpty()) { + return; + } + + for (Map.Entry entry : files.entrySet()) { + // Close the associated output stream, and then delete the file. + try { + if (entry.getValue() != null) { + entry.getValue().close(); + } + } catch (Exception e) {} + entry.getKey().delete(); + } + } + } } diff --git a/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java b/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java index 571d07ac3ca..220f3697540 100644 --- a/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java +++ b/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java @@ -247,6 +247,10 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La float aw = 0f; float ah = cm.ascent + cm.descent; + if (charinfo == null || charinfo.length == 0) { + return new Rectangle2D.Float(al, at, aw, ah); + } + boolean lineIsLTR = (source.getLayoutFlags() & 0x8) == 0; int rn = info.length - numvals; if (lineIsLTR) { @@ -350,23 +354,44 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La public float getCharX(int index) { validate(index); - return getCharinfo()[l2v(index) * numvals + posx]; + float[] charinfo = getCharinfo(); + int idx = l2v(index) * numvals + posx; + if (charinfo == null || idx >= charinfo.length) { + return 0f; + } else { + return charinfo[idx]; + } } public float getCharY(int index) { validate(index); - return getCharinfo()[l2v(index) * numvals + posy]; + float[] charinfo = getCharinfo(); + int idx = l2v(index) * numvals + posy; + if (charinfo == null || idx >= charinfo.length) { + return 0f; + } else { + return charinfo[idx]; + } } public float getCharAdvance(int index) { validate(index); - return getCharinfo()[l2v(index) * numvals + advx]; + float[] charinfo = getCharinfo(); + int idx = l2v(index) * numvals + advx; + if (charinfo == null || idx >= charinfo.length) { + return 0f; + } else { + return charinfo[idx]; + } } public Rectangle2D handleGetCharVisualBounds(int index) { validate(index); float[] charinfo = getCharinfo(); index = l2v(index) * numvals; + if (charinfo == null || (index+vish) >= charinfo.length) { + return new Rectangle2D.Float(); + } return new Rectangle2D.Float( charinfo[index + visx], charinfo[index + visy], @@ -456,7 +481,11 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La int length = source.getLength(); --start; while (width >= 0 && ++start < length) { - float adv = charinfo[l2v(start) * numvals + advx]; + int cidx = l2v(start) * numvals + advx; + if (cidx >= charinfo.length) { + break; // layout bailed for some reason + } + float adv = charinfo[cidx]; width -= adv; } @@ -469,7 +498,11 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La float[] charinfo = getCharinfo(); --start; while (++start < limit) { - a += charinfo[l2v(start) * numvals + advx]; + int cidx = l2v(start) * numvals + advx; + if (cidx >= charinfo.length) { + break; // layout bailed for some reason + } + a += charinfo[cidx]; } return a; @@ -501,7 +534,13 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La // } //} - return getCharinfo()[v * numvals + advx] != 0; + int idx = v * numvals + advx; + float[] charinfo = getCharinfo(); + if (charinfo == null || idx >= charinfo.length) { + return false; + } else { + return charinfo[idx] != 0; + } } private final float[] getCharinfo() { @@ -593,6 +632,9 @@ class ExtendedTextSourceLabel extends ExtendedTextLabel implements Decoration.La */ int numGlyphs = gv.getNumGlyphs(); + if (numGlyphs == 0) { + return glyphinfo; + } int[] indices = gv.getGlyphCharIndices(0, numGlyphs, null); boolean DEBUG = false; diff --git a/jdk/src/share/classes/sun/font/GlyphLayout.java b/jdk/src/share/classes/sun/font/GlyphLayout.java index 100b66b9809..d29ecf34cb2 100644 --- a/jdk/src/share/classes/sun/font/GlyphLayout.java +++ b/jdk/src/share/classes/sun/font/GlyphLayout.java @@ -464,7 +464,12 @@ public final class GlyphLayout { break; } catch (IndexOutOfBoundsException e) { - _gvdata.grow(); + if (_gvdata._count >=0) { + _gvdata.grow(); + } + } + if (_gvdata._count < 0) { + break; } } } @@ -473,7 +478,19 @@ public final class GlyphLayout { // _gvdata.adjustPositions(txinfo.invdtx); // } - StandardGlyphVector gv = _gvdata.createGlyphVector(font, frc, result); + // If layout fails (negative glyph count) create an un-laid out GV instead. + // ie default positions. This will be a lot better than the alternative of + // a complete blank layout. + StandardGlyphVector gv; + if (_gvdata._count < 0) { + gv = new StandardGlyphVector(font, text, offset, count, frc); + if (FontUtilities.debugFonts()) { + FontUtilities.getLogger().warning("OpenType layout failed on font: " + + font); + } + } else { + gv = _gvdata.createGlyphVector(font, frc, result); + } // System.err.println("Layout returns: " + gv); return gv; } diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index 0a822d7861c..e5c06b834c5 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -3236,7 +3236,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { registeredFontFiles.add(fullName); if (FontUtilities.debugFonts() - && FontUtilities.getLogger().isLoggable(PlatformLogger.INFO)) { + && FontUtilities.getLogger().isLoggable(PlatformLogger.Level.INFO)) { String message = "Registering font " + fullName; String[] natNames = getNativeNames(fullName, null); if (natNames == null) { diff --git a/jdk/src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java b/jdk/src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java new file mode 100644 index 00000000000..e6100bbefd4 --- /dev/null +++ b/jdk/src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.cmm; + +public class ProfileDataVerifier { + /** + * Throws an IllegalArgumentException if the data does not correspond + * to a valid ICC Profile. + * + * @param data the specified profile data. + */ + public static void verify(byte[] data) { + if (data == null) { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + if (data.length < TOC_OFFSET) { + // not enough data for profile header + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + // check profile size + final int size = readInt32(data, 0); + final int tagCount = readInt32(data, HEADER_SIZE); + + if (tagCount < 0 || tagCount > MAX_TAG_COUNT) { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + if (size < (TOC_OFFSET + (tagCount * TOC_RECORD_SIZE)) || + size > data.length) + { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + final int sig = readInt32(data, 36); + + if (PROFILE_FILE_SIGNATURE != sig) { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + // verify table of content + for (int i = 0; i < tagCount; i++) { + final int tag_offset = getTagOffset(i, data); + final int tag_size = getTagSize(i, data); + + if (tag_offset < TOC_OFFSET || tag_offset > size) { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + + if (tag_size < 0 || + tag_size > (Integer.MAX_VALUE - tag_offset) || + tag_size + tag_offset > size) + { + throw new IllegalArgumentException("Invalid ICC Profile Data"); + } + } + } + + private static int getTagOffset(int idx, byte[] data) { + final int pos = TOC_OFFSET + idx * TOC_RECORD_SIZE + 4; + return readInt32(data, pos); + } + + private static int getTagSize(int idx, byte[] data) { + final int pos = TOC_OFFSET + idx * TOC_RECORD_SIZE + 8; + return readInt32(data, pos); + } + + private static int readInt32(byte[] data, int off) { + int res = 0; + for (int i = 0; i < 4; i++) { + res = res << 8; + + res |= (0xff & data[off++]); + } + return res; + } + + /** + * Lcms limit for the number of tags: 100 + * Kcms limit for the number of tags: N/A + */ + private static final int MAX_TAG_COUNT = 100; + + private static final int HEADER_SIZE = 128; + private static final int TOC_OFFSET = HEADER_SIZE + 4; + private static final int TOC_RECORD_SIZE = 12; + + private static final int PROFILE_FILE_SIGNATURE = 0x61637370; +} diff --git a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java index 1957b705b59..2f862cdeb10 100644 --- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java +++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java @@ -76,6 +76,7 @@ class LCMSImageLayout { int width; int height; int nextRowOffset; + private int nextPixelOffset; int offset; /* This flag indicates whether the image can be processed @@ -93,6 +94,7 @@ class LCMSImageLayout { this.pixelType = pixelType; width = np; height = 1; + nextPixelOffset = pixelSize; nextRowOffset = safeMult(pixelSize, np); offset = 0; } @@ -104,6 +106,7 @@ class LCMSImageLayout { this.pixelType = pixelType; this.width = width; this.height = height; + nextPixelOffset = pixelSize; nextRowOffset = safeMult(pixelSize, width); offset = 0; } @@ -221,6 +224,7 @@ class LCMSImageLayout { IntegerComponentRaster intRaster = (IntegerComponentRaster) image.getRaster(); l.nextRowOffset = safeMult(4, intRaster.getScanlineStride()); + l.nextPixelOffset = safeMult(4, intRaster.getPixelStride()); l.offset = safeMult(4, intRaster.getDataOffset(0)); l.dataArray = intRaster.getDataStorage(); l.dataArrayLength = 4 * intRaster.getDataStorage().length; @@ -238,6 +242,8 @@ class LCMSImageLayout { ByteComponentRaster byteRaster = (ByteComponentRaster) image.getRaster(); l.nextRowOffset = byteRaster.getScanlineStride(); + l.nextPixelOffset = byteRaster.getPixelStride(); + int firstBand = image.getSampleModel().getNumBands() - 1; l.offset = byteRaster.getDataOffset(firstBand); l.dataArray = byteRaster.getDataStorage(); @@ -254,6 +260,8 @@ class LCMSImageLayout { ByteComponentRaster byteRaster = (ByteComponentRaster) image.getRaster(); l.nextRowOffset = byteRaster.getScanlineStride(); + l.nextPixelOffset = byteRaster.getPixelStride(); + l.dataArrayLength = byteRaster.getDataStorage().length; l.offset = byteRaster.getDataOffset(0); l.dataArray = byteRaster.getDataStorage(); @@ -270,6 +278,8 @@ class LCMSImageLayout { ShortComponentRaster shortRaster = (ShortComponentRaster) image.getRaster(); l.nextRowOffset = safeMult(2, shortRaster.getScanlineStride()); + l.nextPixelOffset = safeMult(2, shortRaster.getPixelStride()); + l.offset = safeMult(2, shortRaster.getDataOffset(0)); l.dataArray = shortRaster.getDataStorage(); l.dataArrayLength = 2 * shortRaster.getDataStorage().length; @@ -331,9 +341,15 @@ class LCMSImageLayout { throw new ImageLayoutException("Invalid image layout"); } - int lastPixelOffset = safeMult(nextRowOffset, (height - 1)); + if (nextPixelOffset != getBytesPerPixel(pixelType)) { + throw new ImageLayoutException("Invalid image layout"); + } - lastPixelOffset = safeAdd(lastPixelOffset, (width - 1)); + int lastScanOffset = safeMult(nextRowOffset, (height - 1)); + + int lastPixelOffset = safeMult(nextPixelOffset, (width -1 )); + + lastPixelOffset = safeAdd(lastPixelOffset, lastScanOffset); int off = safeAdd(offset, lastPixelOffset); @@ -392,6 +408,8 @@ class LCMSImageLayout { } l.nextRowOffset = br.getScanlineStride(); + l.nextPixelOffset = br.getPixelStride(); + l.offset = br.getDataOffset(firstBand); l.dataArray = br.getDataStorage(); l.dataType = DT_BYTE; @@ -406,4 +424,25 @@ class LCMSImageLayout { } return null; } + + /** + * Derives number of bytes per pixel from the pixel format. + * Following bit fields are used here: + * [0..2] - bytes per sample + * [3..6] - number of color samples per pixel + * [7..9] - number of non-color samples per pixel + * + * A complete description of the pixel format can be found + * here: lcms2.h, lines 651 - 667. + * + * @param pixelType pixel format in lcms2 notation. + * @return number of bytes per pixel for given pixel format. + */ + private static int getBytesPerPixel(int pixelType) { + int bytesPerSample = (0x7 & pixelType); + int colorSamplesPerPixel = 0xF & (pixelType >> 3); + int extraSamplesPerPixel = 0x7 & (pixelType >> 7); + + return bytesPerSample * (colorSamplesPerPixel + extraSamplesPerPixel); + } } diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties index ac82d46ad03..4d5ef284277 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_de.properties @@ -37,7 +37,7 @@ java.launcher.ergo.message2 =\ weil die Ausf\u00FChrung auf ei java.launcher.opt.footer =\ -cp \n -classpath \n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -D=\n Legt eine Systemeigenschaft fest\n -verbose[:class|gc|jni]\n Aktiviert die Verbose-Ausgabe\n -version Druckt Produktversion und beendet das Programm\n -version:\n Erfordert die angegebene Version zur Ausf\u00FChrung\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -jre-restrict-search | -no-jre-restrict-search\n Bezieht private JREs des Benutzers in Versionssuche ein bzw. schlie\u00DFt sie aus\n -? -help Druckt diese Hilfemeldung\n -X Druckt Hilfe zu Nicht-Standardoptionen\n -ea[:...|:]\n -enableassertions[:...|:]\n Aktiviert Assertionen mit angegebener Granularit\u00E4t\n -da[:...|:]\n -disableassertions[:...|:]\n Deaktiviert Assertionen mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert Systemassertionen\n -dsa | -disablesystemassertions\n Deaktiviert Systemassertionen\n -agentlib:[=]\n L\u00E4dt native Agent Library , z.B. -agentlib:hprof\n siehe auch -agentlib:jdwp=help und -agentlib:hprof=help\n -agentpath:[=]\n L\u00E4dt native Agent Library nach vollem Pfadnamen\n -javaagent:[=]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:\n Zeigt Startbildschirm mit angegebenem Bild\nWeitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html # Translators please note do not translate the options themselves -java.launcher.X.usage=\ -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xbootclasspath:\n Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n -Xbootclasspath/a:\n H\u00E4ngt an das Ende des Bootstrap Classpath an\n -Xbootclasspath/p:\n Stellt Bootstrap Classpath voran\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xnoclassgc Deaktiviert Klassen-Garbage Collection\n -Xincgc Aktiviert inkrementelle Garbage Collection\n -Xloggc: Loggt GC-Status in einer Datei mit Zeitstempeln\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xms Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n -Xmx Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n -Xss Legt Java-Thread-Stack-Gr\u00F6\u00DFe fest\n -Xprof Gibt CPU-Profiling-Daten aus\n -Xfuture Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n -Xrs Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n -Xshare:off Kein Versuch, gemeinsame Klassendaten zu verwenden\n -Xshare:auto Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:on Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n +java.launcher.X.usage=\ -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xbootclasspath:\n Legt Suchpfad f\u00FCr Bootstrap-Klassen und Ressourcen fest\n -Xbootclasspath/a:\n H\u00E4ngt an das Ende des Bootstrap Classpath an\n -Xbootclasspath/p:\n Stellt Bootstrap Classpath voran\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xnoclassgc Deaktiviert Klassen-Garbage Collection\n -Xincgc Aktiviert inkrementelle Garbage Collection\n -Xloggc: Loggt GC-Status in einer Datei mit Zeitstempeln\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xms Legt anf\u00E4ngliche Java Heap-Gr\u00F6\u00DFe fest\n -Xmx Legt maximale Java Heap-Gr\u00F6\u00DFe fest\n -Xss Legt Java-Thread-Stackgr\u00F6\u00DFe fest\n -Xprof Gibt CPU-Profiling-Daten aus\n -Xfuture Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n -Xrs Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n -Xshare:off Kein Versuch, gemeinsame Klassendaten zu verwenden\n -Xshare:auto Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:on Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n -XstartOnFirstThread\n f\u00FChrt die main()-Methode f\u00FCr den ersten (AppKit) Thread aus\n -Xdock:name="\n \u00DCberschreibt den in der Uhr angezeigten Standardanwendungsnamen\n -Xdock:icon=\n \u00DCberschreibt das in der Uhr angezeigte Standardsymbol\n\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=Fehler: Zum Ausf\u00FChren dieser Anwendung ben\u00F6ti java.launcher.jar.error1=Fehler: Beim Versuch, Datei {0} zu \u00F6ffnen, ist ein unerwarteter Fehler aufgetreten java.launcher.jar.error2=Manifest in {0} nicht gefunden java.launcher.jar.error3=kein Hauptmanifestattribut, in {0} +java.launcher.jar.error4=kein Profilmanifestattribut in {0} +java.launcher.jar.error5=Das f\u00FCr {1} erforderliche Profil {0} wird von dieser Runtime-Anwendung nicht unterst\u00FCtzt java.launcher.init.error=Initialisierungsfehler java.launcher.javafx.error1=Fehler: Die JavaFX-Methode launchApplication hat die falsche Signatur, sie\nmuss als statisch deklariert werden und einen Wert vom Typ VOID zur\u00FCckgeben diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties index b6d4df5b086..1aefa5f0194 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_es.properties @@ -34,10 +34,10 @@ java.launcher.ergo.message1 =\ La VM por defecto es {0} java.launcher.ergo.message2 =\ porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n\\ -classpath \n\\ Lista separada por {0} de directorios, archivos JAR\n\\ y archivos ZIP para buscar archivos de clase.\n\\ -D=\n\\ definir una propiedad del sistema\n\\ -verbose:[class|gc|jni]\n\\ activar la salida verbose\n\\ -version imprimir la versi\u00F3n del producto y salir\n\\ -version:\n\\ es necesario que se ejecute la versi\u00F3n especificada\n\\ -showversion imprimir la versi\u00F3n del producto y continuar\n\\ -jre-restrict-search | -no-jre-restrict-search\n\\ incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n\\ -? -help imprimir este mensaje de ayuda\n\\ -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n\\ -ea[:...|:]\n\\ -enableassertions[:...|:]\n\\ activar afirmaciones con la granularidad especificada\n\\ -da[:...|:]\n\\ -disableassertions[:...|:]\n\\ desactivar afirmaciones con la granularidad especificada\n\\ -esa | -enablesystemassertions\n\\ activar afirmaciones del sistema\n\\ -dsa | -disablesystemassertions\n\\ desactivar afirmaciones del sistema\n\\ -agentlib:[=]\n\\ cargar la biblioteca de agente nativa , como -agentlib:hprof\n\\ v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n\\ -agentpath:[=]\n\\ cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n\\ -javaagent:[=]\n\\ cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n\\ -splash:\n\\ mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n. +java.launcher.opt.footer =\ -cp \n -classpath \n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -D=\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida verbose\n -version imprimir la versi\u00F3n del producto y salir\n -version:\n es necesario que se ejecute la versi\u00F3n especificada\n -showversion imprimir la versi\u00F3n del producto y continuar\n -jre-restrict-search | -no-jre-restrict-search\n incluir/excluir JRE privados de usuario en la b\u00FAsqueda de versi\u00F3n\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda sobre las opciones que no sean est\u00E1ndar\n -ea[:...|:]\n -enableassertions[:...|:]\n activar afirmaciones con la granularidad especificada\n -da[:...|:]\n -disableassertions[:...|:]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:[=]\n cargar la biblioteca de agente nativa , como -agentlib:hprof\n v\u00E9ase tambi\u00E9n -agentlib:jdwp=help y -agentlib:hprof=help\n -agentpath:[=]\n cargar biblioteca de agente nativa con el nombre de la ruta de acceso completa\n -javaagent:[=]\n cargar agente de lenguaje de programaci\u00F3n Java, v\u00E9ase java.lang.instrument\n -splash:\n mostrar una pantalla de presentaci\u00F3n con la imagen especificada\nConsulte http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n. # Translators please note do not translate the options themselves -java.launcher.X.usage=\ -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xint s\u00F3lo ejecuci\u00F3n de modo interpretado\n -Xbootclasspath:\n definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n -Xbootclasspath/a:\n agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xbootclasspath/p:\n anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xincgc activar la recolecci\u00F3n de basura de clases\n -Xloggc: registrar el estado de GC en un archivo con registros de hora\n -Xbatch desactivar compilaci\u00F3n en segundo plano\n -Xms definir tama\u00F1o de pila Java inicial\n -Xmx definir tama\u00F1o de pila Java m\u00E1ximo\n -Xss definir tama\u00F1o de la pila del thread de Java\n -Xprof datos de salida de creaci\u00F3n de perfil de CPU\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n -XshowSettings mostrar todos los valores y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:vm mostrar todos los valores de la VM y continuar\n -XshowSettings:properties\n mostrar todos los valores de las propiedades y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n +java.launcher.X.usage=\ -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xint s\u00F3lo ejecuci\u00F3n de modo interpretado\n -Xbootclasspath:\n definir la ruta de acceso de b\u00FAsqueda para los recursos y clases de inicializaci\u00F3n de datos\n -Xbootclasspath/a:\n agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xbootclasspath/p:\n anteponer a la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xincgc activar la recolecci\u00F3n de basura de clases\n -Xloggc: registrar el estado de GC en un archivo con registros de hora\n -Xbatch desactivar compilaci\u00F3n en segundo plano\n -Xms definir tama\u00F1o de pila Java inicial\n -Xmx definir tama\u00F1o de pila Java m\u00E1ximo\n -Xss definir tama\u00F1o de la pila del thread de Java\n -Xprof datos de salida de creaci\u00F3n de perfil de CPU\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n -XshowSettings mostrar todos los valores y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:vm mostrar todos los valores de la VM y continuar\n -XshowSettings:properties\n mostrar todos los valores de las propiedades y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n\nLas opciones -X no son est\u00E1ndar, por lo que podr\u00EDan cambiarse sin previo aviso.\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n -XstartOnFirstThread\n ejecuta el m\u00E9todo main() del primer thread (AppKit)\n -Xdock:name="\n sustituye al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n -Xdock:icon=\n sustituye al icono por defecto que se muestra en el Dock\n\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=Error: faltan los componentes de JavaFX runtime y son n java.launcher.jar.error1=Error: se ha producido un error inesperado al intentar abrir el archivo {0} java.launcher.jar.error2=no se ha encontrado el manifiesto en {0} java.launcher.jar.error3=no hay ning\u00FAn atributo de manifiesto principal en {0} +java.launcher.jar.error4=no hay ning\u00FAn atributo de manifiesto de perfil en {0} +java.launcher.jar.error5=El perfil {0} que necesita {1} no est\u00E1 soportado por este tiempo de ejecuci\u00F3n java.launcher.init.error=error de inicializaci\u00F3n java.launcher.javafx.error1=Error: el m\u00E9todo launchApplication de JavaFX tiene una firma que no es correcta.\\nSe debe declarar est\u00E1tico y devolver un valor de tipo nulo diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties index 11577d4ef15..6e5d9891828 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_fr.properties @@ -50,5 +50,7 @@ java.launcher.cls.error5=Erreur : des composants d'ex\u00E9cution JavaFX obligat java.launcher.jar.error1=Erreur : une erreur inattendue est survenue lors de la tentative d''ouverture du fichier {0} java.launcher.jar.error2=fichier manifeste introuvable dans {0} java.launcher.jar.error3=aucun attribut manifest principal dans {0} +java.launcher.jar.error4=aucun attribut manifest ''Profile'' dans {0} +java.launcher.jar.error5=Profil {0} requis par {1} non pris en charge par cette ex\u00E9cution java.launcher.init.error=erreur d'initialisation java.launcher.javafx.error1=Erreur : la signature de la m\u00E9thode launchApplication JavaFX est incorrecte, la\nm\u00E9thode doit \u00EAtre d\u00E9clar\u00E9e statique et renvoyer une valeur de type void diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties index aacd8fc7ec2..7ca3cf357c8 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_it.properties @@ -34,7 +34,7 @@ java.launcher.ergo.message1 =\ La VM predefinita \u00E8 {0} java.launcher.ergo.message2 =\ perch\u00E9 si utilizza un computer di classe server.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n\\ -classpath \n\\ Una lista separata da {0} di directory, archivi JAR,\n\\ e archivi ZIP utilizzata per la ricerca di file di classe.\n\\ -D=\n\\ imposta una propriet\u00E0 di sistema\n\\ -verbose:[class|gc|jni]\n\\ abilita l''output descrittivo\n\\ -version stampa la versione del prodotto ed esce\n\\ -version:\n\\ richiede l''esecuzione della versione specificata\n\\ -showversion stampa la versione del prodotto e continua\n\\ -jre-restrict-search | -no-jre-restrict-search\n\\ include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n\\ -? -help stampa questo messaggio della Guida\n\\ -X stampa la Guida sulle opzioni non standard\n\\ -ea[:...|:]\n\\ -enableassertions[:...|:]\n\\ abilita le asserzioni con la granularit\u00E0 specificata\n\\ -da[:...|:]\n\\ -disableassertions[:...|:]\n\\ disabilita le asserzioni con la granularit\u00E0 specificata\n\\ -esa | -enablesystemassertions\n\\ abilita le asserzioni di sistema\n\\ -dsa | -disablesystemassertions\n\\ disabilita le asserzioni di sistema\n\\ -agentlib:[=]\n\\ carica la libreria agenti nativa , ad esempio -agentlib:hprof\n\\ vedere anche, -agentlib:jdwp=help and -agentlib:hprof=help\n\\ -agentpath:[=]\n\\ carica la libreria agenti nativa con il percorso completo\n\\ -javaagent:[=]\n\\ carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n\\ -splash:\n\\ mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html. +java.launcher.opt.footer =\ -cp \n -classpath \n Una lista separata da {0} di directory, archivi JAR,\n e archivi ZIP utilizzata per la ricerca di file di classe.\n -D=\n imposta una propriet\u00E0 di sistema\n -verbose:[class|gc|jni]\n abilita l''output descrittivo\n -version stampa la versione del prodotto ed esce\n -version:\n richiede l''esecuzione della versione specificata\n -showversion stampa la versione del prodotto e continua\n -jre-restrict-search | -no-jre-restrict-search\n include/esclude gli ambienti JRE privati dell''utente nella ricerca della versione\n -? -help stampa questo messaggio della Guida\n -X stampa la Guida sulle opzioni non standard\n -ea[:...|:]\n -enableassertions[:...|:]\n abilita le asserzioni con la granularit\u00E0 specificata\n -da[:...|:]\n -disableassertions[:...|:]\n disabilita le asserzioni con la granularit\u00E0 specificata\n -esa | -enablesystemassertions\n abilita le asserzioni di sistema\n -dsa | -disablesystemassertions\n disabilita le asserzioni di sistema\n -agentlib:[=]\n carica la libreria agenti nativa , ad esempio -agentlib:hprof\n vedere anche, -agentlib:jdwp=help and -agentlib:hprof=help\n -agentpath:[=]\n carica la libreria agenti nativa con il percorso completo\n -javaagent:[=]\n carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument\n -splash:\n mostra la schermata iniziale con l''immagine specificata\nPer ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xbootclasspath:\n imposta il percorso di ricerca per le classi e le risorse di bootstrap\n -Xbootclasspath/a:\n aggiunge alla fine del classpath di bootstrap\n -Xbootclasspath/p:\n antepone al classpath di bootstrap\n -Xdiag mostra messaggi di diagnostica aggiuntivi\n -Xnoclassgc disabilita la garbage collection della classe\n -Xincgc abilita la garbage collection incrementale\n -Xloggc: registra lo stato GC in un file di log con indicatori orari\n -Xbatch disabilita la compilazione in background\n -Xms imposta la dimensione heap Java iniziale\n -Xmx imposta la dimensione heap Java massima\n -Xss imposta la dimensione dello stack di thread Java\n -Xprof visualizza i dati di profilo della CPU\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xshare:off non tenta di utilizzare i dati della classe condivisi\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=Errore: non sono presenti i componenti runtime di JavaF java.launcher.jar.error1=Errore: si \u00E8 verificato un errore imprevisto durante il tentativo di aprire il file {0} java.launcher.jar.error2=manifest non trovato in {0} java.launcher.jar.error3=nessun attributo manifest principale in {0} +java.launcher.jar.error4=nessun attributo manifest di profilo in {0} +java.launcher.jar.error5=Il profilo {0} richiesto da {1} non \u00E8 supportato da questo runtime java.launcher.init.error=errore di inizializzazione java.launcher.javafx.error1=Errore: il metodo JavaFX launchApplication dispone di una firma errata, \nla firma deve essere dichiarata static e restituire un valore di tipo void diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties index 841ba3454e6..52c220a6926 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_ja.properties @@ -37,7 +37,8 @@ java.launcher.ergo.message2 =\ \u3053\u308C\u306F\u30B5\u30FC\ java.launcher.opt.footer =\ -cp \n -classpath \n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3067\u3059\u3002\n -D=\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -version:\n \u6307\u5B9A\u3057\u305F\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u5B9F\u884C\u306B\u5FC5\u9808\u306B\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -jre-restrict-search | -no-jre-restrict-search\n \u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8JRE\u3092\u30D0\u30FC\u30B8\u30E7\u30F3\u691C\u7D22\u306B\u542B\u3081\u308B/\u9664\u5916\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:...|:]\n -disableassertions[:...|:]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:[=]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:hprof\n -agentlib:jdwp=help\u3068-agentlib:hprof=help\u3082\u53C2\u7167\n -agentpath:[=]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:[=]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:\n \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n\u8A73\u7D30\u306Fhttp://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 # Translators please note do not translate the options themselves -java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xbootclasspath:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n -Xbootclasspath/a:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xbootclasspath/p:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xincgc \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xloggc: \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xms Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xss Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\n-X\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u6A19\u6E96\u306A\u306E\u3067\u3001\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n +java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xbootclasspath:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u306E\u30AF\u30E9\u30B9\u3068\u30EA\u30BD\u30FC\u30B9\u306E\u691C\u7D22\u30D1\u30B9\u3092\u8A2D\u5B9A\u3059\u308B\n -Xbootclasspath/a:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xbootclasspath/p:\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u524D\u306B\u4ED8\u52A0\u3059\u308B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xincgc \u5897\u5206\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xloggc: \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xms Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xss Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \ +\u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n\n-X\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u6A19\u6E96\u306A\u306E\u3067\u3001\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059\u3002\n -XstartOnFirstThread\n main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n -Xdock:name="\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -Xdock:icon=\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n @@ -50,5 +51,7 @@ java.launcher.cls.error5=\u30A8\u30E9\u30FC: JavaFX\u30E9\u30F3\u30BF\u30A4\u30E java.launcher.jar.error1=\u30A8\u30E9\u30FC: \u30D5\u30A1\u30A4\u30EB{0}\u3092\u958B\u3053\u3046\u3068\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u3001\u4E88\u671F\u3057\u306A\u3044\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F java.launcher.jar.error2={0}\u306B\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 java.launcher.jar.error3={0}\u306B\u30E1\u30A4\u30F3\u30FB\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +java.launcher.jar.error4={0}\u306B\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +java.launcher.jar.error5={1}\u306B\u5FC5\u8981\u306A\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB{0}\u306F\u3053\u306E\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 java.launcher.init.error=\u521D\u671F\u5316\u30A8\u30E9\u30FC java.launcher.javafx.error1=\u30A8\u30E9\u30FC: JavaFX launchApplication\u30E1\u30BD\u30C3\u30C9\u306B\u8AA4\u3063\u305F\u30B7\u30B0\u30CD\u30C1\u30E3\u304C\u3042\u308A\u3001\nstatic\u3092\u5BA3\u8A00\u3057\u3066void\u578B\u306E\u5024\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties index 0a052d0fde7..a4c3d800c2d 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_ko.properties @@ -34,7 +34,7 @@ java.launcher.ergo.message1 =\ \uAE30\uBCF8 VM\uC740 {0}\uC785 java.launcher.ergo.message2 =\ \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp \n\\ -classpath \n\\ \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n\\ JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n\\ -D=\n\\ \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -verbose:[class|gc|jni]\n\\ \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n\\ -version:\n\\ \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\n\\ -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\\ -jre-restrict-search | -no-jre-restrict-search\n\\ \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\n\\ -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\\ -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n\\ -ea[:...|:]\n\\ -enableassertions[:...|:]\n\\ \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -da[:...|:]\n\\ -disableassertions[:...|:]\n\\ \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -esa | -enablesystemassertions\n\\ \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -dsa | -disablesystemassertions\n\\ \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\\ -agentlib:[=]\n\\ \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\n\\ -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\\ -agentpath:[=]\n\\ \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n\\ -javaagent:[=]\n\\ Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n\\ -splash:\n\\ \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. +java.launcher.opt.footer =\ -cp \\n -classpath \\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\\n -D=\\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\\n -verbose:[class|gc|jni]\\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\\n -version:\\n \uC2E4\uD589\uD560 \uBC84\uC804\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.\\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\\n -jre-restrict-search | -no-jre-restrict-search\\n \uBC84\uC804 \uAC80\uC0C9\uC5D0\uC11C \uC0AC\uC6A9\uC790 \uC804\uC6A9 JRE\uB97C \uD3EC\uD568/\uC81C\uC678\uD569\uB2C8\uB2E4.\\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\\n -ea[:...|:]\\n -enableassertions[:...|:]\\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\\n -da[:...|:]\\n -disableassertions[:...|:]\\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\\n -esa | -enablesystemassertions\\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\\n -dsa | -disablesystemassertions\\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\\n -agentlib:[=]\\n \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:hprof).\\n -agentlib:jdwp=help \uBC0F -agentlib:hprof=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\\n -agentpath:[=]\\n \uC804\uCCB4 \uACBD\uB85C\uBA85\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\\n -javaagent:[=]\\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\\n -splash:\\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\\n\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xbootclasspath:\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uBC0F \uB9AC\uC18C\uC2A4\uC5D0 \uB300\uD55C \uAC80\uC0C9 \uACBD\uB85C\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xbootclasspath/p:\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uC55E\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xincgc \uC99D\uBD84\uC801\uC778 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xloggc: \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xss Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=\uC624\uB958: \uC774 \uC751\uC6A9 \uD504\uB85C\uADF8\uB java.launcher.jar.error1=\uC624\uB958: {0} \uD30C\uC77C\uC744 \uC5F4\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC608\uC0C1\uCE58 \uC54A\uC740 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. java.launcher.jar.error2={0}\uC5D0\uC11C Manifest\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. java.launcher.jar.error3={0}\uC5D0 \uAE30\uBCF8 Manifest \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. +java.launcher.jar.error4={0}\uC5D0 Profile manifest \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. +java.launcher.jar.error5={1}\uC5D0 \uD544\uC694\uD55C {0} \uD504\uB85C\uD30C\uC77C\uC740 \uC774 \uB7F0\uD0C0\uC784\uC5D0\uC11C \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. java.launcher.init.error=\uCD08\uAE30\uD654 \uC624\uB958 java.launcher.javafx.error1=\uC624\uB958: JavaFX launchApplication \uBA54\uC18C\uB4DC\uC5D0 \uC798\uBABB\uB41C \uC11C\uBA85\uC774 \uC788\uC2B5\uB2C8\uB2E4.\\n\uB530\uB77C\uC11C static\uC73C\uB85C \uC120\uC5B8\uD558\uACE0 void \uC720\uD615\uC758 \uAC12\uC744 \uBC18\uD658\uD574\uC57C \uD569\uB2C8\uB2E4. diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties index 83654350691..00425f64412 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_pt_BR.properties @@ -50,5 +50,7 @@ java.launcher.cls.error5=Erro: os componentes de runtime do JavaFX n\u00E3o fora java.launcher.jar.error1=Erro: ocorreu um erro inesperado ao tentar abrir o arquivo {0} java.launcher.jar.error2=manifesto n\u00E3o encontrado em {0} java.launcher.jar.error3=nenhum atributo de manifesto principal em {0} +java.launcher.jar.error4=nenhum atributo de manifesto de Perfil em {0} +java.launcher.jar.error5=O perfil {0} exigido por {1} n\u00E3o \u00E9 suportado por este runtime java.launcher.init.error=erro de inicializa\u00E7\u00E3o java.launcher.javafx.error1=Erro: O m\u00E9todo launchApplication do JavaFX tem a assinatura errada. Ele\\ndeve ser declarado como est\u00E1tico e retornar um valor do tipo void diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties index d64c3f6f347..9577f39477a 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_sv.properties @@ -50,5 +50,7 @@ java.launcher.cls.error5=Fel: JavaFX-k\u00F6rningskomponenter saknas, och de kr\ java.launcher.jar.error1=Fel: Ett ov\u00E4ntat fel intr\u00E4ffade n\u00E4r filen {0} skulle \u00F6ppnas java.launcher.jar.error2=manifest finns inte i {0} java.launcher.jar.error3=inget huvudmanifestattribut i {0} +java.launcher.jar.error4=inget profilmanifestattribut i {0} +java.launcher.jar.error5=Profil {0} som kr\u00E4vs av {1} kan inte anv\u00E4ndas av den h\u00E4r k\u00F6rningen java.launcher.init.error=initieringsfel java.launcher.javafx.error1=Fel: JavaFX launchApplication-metoden har fel signatur, den \nm\u00E5ste ha deklarerats som statisk och returnera ett v\u00E4rde av typen void diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties index abb16a2e25f..a536e68bfbc 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_CN.properties @@ -34,7 +34,7 @@ java.launcher.ergo.message1 =\ \u9ED8\u8BA4 VM \u662F {0} java.launcher.ergo.message2 =\ \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n # Translators please note do not translate the options themselves -java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\\ -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n\\ \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n\\ \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n\\ -D<\u540D\u79F0>=<\u503C>\n\\ \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n\\ -verbose:[class|gc|jni]\n\\ \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\\ -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n\\ -version:<\u503C>\n\\ \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n\\ -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n\\ -jre-restrict-search | -no-jre-restrict-search\n\\ \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n\\ -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n\\ -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n\\ -ea[:...|:]\n\\ -enableassertions[:...|:]\n\\ \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n\\ -da[:...|:]\n\\ -disableassertions[:...|:]\n\\ \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n\\ -esa | -enablesystemassertions\n\\ \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n\\ -dsa | -disablesystemassertions\n\\ \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n\\ -agentlib:[=<\u9009\u9879>]\n\\ \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 , \u4F8B\u5982 -agentlib:hprof\n\\ \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n\\ -agentpath:[=<\u9009\u9879>]\n\\ \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n\\ -javaagent:[=<\u9009\u9879>]\n\\ \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n\\ -splash:\n\\ \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002 +java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u5217\u8868, \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -version:<\u503C>\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u8FD0\u884C\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u7D22\u4E2D\u5305\u62EC/\u6392\u9664\u7528\u6237\u4E13\u7528 JRE\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:...|:]\n -enableassertions[:...|:]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:...|:]\n -disableassertions[:...|:]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 , \u4F8B\u5982 -agentlib:hprof\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help \u548C -agentlib:hprof=help\n -agentpath:[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002 # Translators please note do not translate the options themselves java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4)\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xbootclasspath:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u8BBE\u7F6E\u641C\u7D22\u8DEF\u5F84\u4EE5\u5F15\u5BFC\u7C7B\u548C\u8D44\u6E90\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xbootclasspath/p:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u7F6E\u4E8E\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E4B\u524D\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xincgc \u542F\u7528\u589E\u91CF\u5783\u573E\u6536\u96C6\n -Xloggc: \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xms \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xss \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4)\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=\u9519\u8BEF: \u7F3A\u5C11 JavaFX \u8FD0\u884C\u65F6\u7 java.launcher.jar.error1=\u9519\u8BEF: \u5C1D\u8BD5\u6253\u5F00\u6587\u4EF6{0}\u65F6\u51FA\u73B0\u610F\u5916\u9519\u8BEF java.launcher.jar.error2=\u5728{0}\u4E2D\u627E\u4E0D\u5230\u6E05\u5355 java.launcher.jar.error3={0}\u4E2D\u6CA1\u6709\u4E3B\u6E05\u5355\u5C5E\u6027 +java.launcher.jar.error4={0}\u4E2D\u6CA1\u6709\u914D\u7F6E\u6587\u4EF6\u6E05\u5355\u5C5E\u6027 +java.launcher.jar.error5=\u6B64\u8FD0\u884C\u65F6\u4E0D\u652F\u6301{1}\u6240\u9700\u7684\u914D\u7F6E\u6587\u4EF6{0} java.launcher.init.error=\u521D\u59CB\u5316\u9519\u8BEF java.launcher.javafx.error1=\u9519\u8BEF: JavaFX launchApplication \u65B9\u6CD5\u5177\u6709\u9519\u8BEF\u7684\u7B7E\u540D, \u5FC5\u987B\n\u5C06\u65B9\u6CD5\u58F0\u660E\u4E3A\u9759\u6001\u65B9\u6CD5\u5E76\u8FD4\u56DE\u7A7A\u7C7B\u578B\u7684\u503C diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties index 49f536b2eae..9fd5ff272a7 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher_zh_TW.properties @@ -37,7 +37,7 @@ java.launcher.ergo.message2 =\ \u56E0\u70BA\u60A8\u6B63\u5728\ java.launcher.opt.footer =\ -cp \n -classpath \n \u4F7F\u7528 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA\n ZIP \u5B58\u6A94\u6E05\u55AE\u4F86\u641C\u5C0B\u985E\u5225\u6A94\u6848\u3002\n -D=\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -version:\n \u9700\u8981\u6307\u5B9A\u7684\u7248\u672C\u624D\u80FD\u57F7\u884C\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -jre-restrict-search | -no-jre-restrict-search\n \u5728\u7248\u672C\u641C\u5C0B\u4E2D\u5305\u62EC/\u6392\u9664\u4F7F\u7528\u8005\u5C08\u7528 JRE\n -? -help \u5217\u5370\u6B64\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:...|:]\n -enableassertions[:...|:]\n \u555F\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:...|:]\n -disableassertions[:...|:]\n \u505C\u7528\u542B\u6307\u5B9A\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:[=]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB \uFF0C\u4F8B\u5982 -agentlib:hprof\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help \u8207 -agentlib:hprof=help\n -agentpath:[=]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:[=]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:\n \u986F\u793A\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n\u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002 # Translators please note do not translate the options themselves -java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n -Xdiag \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xincgc \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n -Xloggc: \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xms \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xss \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xprof \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u505A\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:auto \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n +java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xbootclasspath:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u8A2D\u5B9A\u555F\u52D5\u5B89\u88DD\u985E\u5225\u548C\u8CC7\u6E90\u7684\u641C\u5C0B\u8DEF\u5F91\n -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xbootclasspath/p:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u524D\u9762\n -Xdiag \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xincgc \u555F\u7528\u6F38\u9032\u8CC7\u6E90\u56DE\u6536\n -Xloggc: \u5229\u7528\u6642\u6233\u5C07 GC \u72C0\u614B\u8A18\u9304\u81F3\u6A94\u6848\u4E2D\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xms \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xss \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xprof \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:auto \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n\n -X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n # Translators please note do not translate the options themselves java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n -XstartOnFirstThread\n \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n -Xdock:name="\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n -Xdock:icon=\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n @@ -50,5 +50,7 @@ java.launcher.cls.error5=\u932F\u8AA4: \u907A\u6F0F\u57F7\u884C\u6B64\u61C9\u752 java.launcher.jar.error1=\u932F\u8AA4: \u5617\u8A66\u958B\u555F\u6A94\u6848 {0} \u6642\u767C\u751F\u672A\u9810\u671F\u7684\u932F\u8AA4 java.launcher.jar.error2=\u5728 {0} \u4E2D\u627E\u4E0D\u5230\u8CC7\u8A0A\u6E05\u55AE java.launcher.jar.error3={0} \u4E2D\u6C92\u6709\u4E3B\u8981\u8CC7\u8A0A\u6E05\u55AE\u5C6C\u6027 +java.launcher.jar.error4={0} \u4E2D\u6C92\u6709 Profile \u8CC7\u8A0A\u6E05\u55AE\u5C6C\u6027 +java.launcher.jar.error5=\u6B64\u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u4E0D\u652F\u63F4 {1} \u6240\u9700\u7684\u8A2D\u5B9A\u6A94 {0} java.launcher.init.error=\u521D\u59CB\u5316\u932F\u8AA4 java.launcher.javafx.error1=\u932F\u8AA4: JavaFX launchApplication \u65B9\u6CD5\u7684\u7C3D\u7AE0\u932F\u8AA4\uFF0C\u5B83\n\u5FC5\u9808\u5BA3\u544A\u70BA\u975C\u614B\u4E26\u50B3\u56DE void \u985E\u578B\u7684\u503C diff --git a/jdk/src/share/classes/sun/misc/FDBigInteger.java b/jdk/src/share/classes/sun/misc/FDBigInteger.java new file mode 100644 index 00000000000..77d6fbc08b6 --- /dev/null +++ b/jdk/src/share/classes/sun/misc/FDBigInteger.java @@ -0,0 +1,1508 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.misc; + +import java.math.BigInteger; +import java.util.Arrays; +//@ model import org.jmlspecs.models.JMLMath; + +/** + * A simple big integer package specifically for floating point base conversion. + */ +public /*@ spec_bigint_math @*/ class FDBigInteger { + + // + // This class contains many comments that start with "/*@" mark. + // They are behavourial specification in + // the Java Modelling Language (JML): + // http://www.eecs.ucf.edu/~leavens/JML//index.shtml + // + + /*@ + @ public pure model static \bigint UNSIGNED(int v) { + @ return v >= 0 ? v : v + (((\bigint)1) << 32); + @ } + @ + @ public pure model static \bigint UNSIGNED(long v) { + @ return v >= 0 ? v : v + (((\bigint)1) << 64); + @ } + @ + @ public pure model static \bigint AP(int[] data, int len) { + @ return (\sum int i; 0 <= 0 && i < len; UNSIGNED(data[i]) << (i*32)); + @ } + @ + @ public pure model static \bigint pow52(int p5, int p2) { + @ ghost \bigint v = 1; + @ for (int i = 0; i < p5; i++) v *= 5; + @ return v << p2; + @ } + @ + @ public pure model static \bigint pow10(int p10) { + @ return pow52(p10, p10); + @ } + @*/ + + static final int[] SMALL_5_POW = { + 1, + 5, + 5 * 5, + 5 * 5 * 5, + 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 + }; + + static final long[] LONG_5_POW = { + 1L, + 5L, + 5L * 5, + 5L * 5 * 5, + 5L * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5L * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + }; + + // Maximum size of cache of powers of 5 as FDBigIntegers. + private static final int MAX_FIVE_POW = 340; + + // Cache of big powers of 5 as FDBigIntegers. + private static final FDBigInteger POW_5_CACHE[]; + + // Initialize FDBigInteger cache of powers of 5. + static { + POW_5_CACHE = new FDBigInteger[MAX_FIVE_POW]; + int i = 0; + while (i < SMALL_5_POW.length) { + FDBigInteger pow5 = new FDBigInteger(new int[]{SMALL_5_POW[i]}, 0); + pow5.makeImmutable(); + POW_5_CACHE[i] = pow5; + i++; + } + FDBigInteger prev = POW_5_CACHE[i - 1]; + while (i < MAX_FIVE_POW) { + POW_5_CACHE[i] = prev = prev.mult(5); + prev.makeImmutable(); + i++; + } + } + + // Zero as an FDBigInteger. + public static final FDBigInteger ZERO = new FDBigInteger(new int[0], 0); + + // Ensure ZERO is immutable. + static { + ZERO.makeImmutable(); + } + + // Constant for casting an int to a long via bitwise AND. + private final static long LONG_MASK = 0xffffffffL; + + //@ spec_public non_null; + private int data[]; // value: data[0] is least significant + //@ spec_public; + private int offset; // number of least significant zero padding ints + //@ spec_public; + private int nWords; // data[nWords-1]!=0, all values above are zero + // if nWords==0 -> this FDBigInteger is zero + //@ spec_public; + private boolean isImmutable = false; + + /*@ + @ public invariant 0 <= nWords && nWords <= data.length && offset >= 0; + @ public invariant nWords == 0 ==> offset == 0; + @ public invariant nWords > 0 ==> data[nWords - 1] != 0; + @ public invariant (\forall int i; nWords <= i && i < data.length; data[i] == 0); + @ public pure model \bigint value() { + @ return AP(data, nWords) << (offset*32); + @ } + @*/ + + /** + * Constructs an FDBigInteger from data and padding. The + * data parameter has the least significant int at + * the zeroth index. The offset parameter gives the number of + * zero ints to be inferred below the least significant element + * of data. + * + * @param data An array containing all non-zero ints of the value. + * @param offset An offset indicating the number of zero ints to pad + * below the least significant element of data. + */ + /*@ + @ requires data != null && offset >= 0; + @ ensures this.value() == \old(AP(data, data.length) << (offset*32)); + @ ensures this.data == \old(data); + @*/ + private FDBigInteger(int[] data, int offset) { + this.data = data; + this.offset = offset; + this.nWords = data.length; + trimLeadingZeros(); + } + + /** + * Constructs an FDBigInteger from a starting value and some + * decimal digits. + * + * @param lValue The starting value. + * @param digits The decimal digits. + * @param kDigits The initial index into digits. + * @param nDigits The final index into digits. + */ + /*@ + @ requires digits != null; + @ requires 0 <= kDigits && kDigits <= nDigits && nDigits <= digits.length; + @ requires (\forall int i; 0 <= i && i < nDigits; '0' <= digits[i] && digits[i] <= '9'); + @ ensures this.value() == \old(lValue * pow10(nDigits - kDigits) + (\sum int i; kDigits <= i && i < nDigits; (digits[i] - '0') * pow10(nDigits - i - 1))); + @*/ + public FDBigInteger(long lValue, char[] digits, int kDigits, int nDigits) { + int n = Math.max((nDigits + 8) / 9, 2); // estimate size needed. + data = new int[n]; // allocate enough space + data[0] = (int) lValue; // starting value + data[1] = (int) (lValue >>> 32); + offset = 0; + nWords = 2; + int i = kDigits; + int limit = nDigits - 5; // slurp digits 5 at a time. + int v; + while (i < limit) { + int ilim = i + 5; + v = (int) digits[i++] - (int) '0'; + while (i < ilim) { + v = 10 * v + (int) digits[i++] - (int) '0'; + } + multAddMe(100000, v); // ... where 100000 is 10^5. + } + int factor = 1; + v = 0; + while (i < nDigits) { + v = 10 * v + (int) digits[i++] - (int) '0'; + factor *= 10; + } + if (factor != 1) { + multAddMe(factor, v); + } + trimLeadingZeros(); + } + + /** + * Returns an FDBigInteger with the numerical value + * 5p5 * 2p2. + * + * @param p5 The exponent of the power-of-five factor. + * @param p2 The exponent of the power-of-two factor. + * @return 5p5 * 2p2 + */ + /*@ + @ requires p5 >= 0 && p2 >= 0; + @ assignable \nothing; + @ ensures \result.value() == \old(pow52(p5, p2)); + @*/ + public static FDBigInteger valueOfPow52(int p5, int p2) { + if (p5 != 0) { + if (p2 == 0) { + return big5pow(p5); + } else if (p5 < SMALL_5_POW.length) { + int pow5 = SMALL_5_POW[p5]; + int wordcount = p2 >> 5; + int bitcount = p2 & 0x1f; + if (bitcount == 0) { + return new FDBigInteger(new int[]{pow5}, wordcount); + } else { + return new FDBigInteger(new int[]{ + pow5 << bitcount, + pow5 >>> (32 - bitcount) + }, wordcount); + } + } else { + return big5pow(p5).leftShift(p2); + } + } else { + return valueOfPow2(p2); + } + } + + /** + * Returns an FDBigInteger with the numerical value + * value * 5p5 * 2p2. + * + * @param value The constant factor. + * @param p5 The exponent of the power-of-five factor. + * @param p2 The exponent of the power-of-two factor. + * @return value * 5p5 * 2p2 + */ + /*@ + @ requires p5 >= 0 && p2 >= 0; + @ assignable \nothing; + @ ensures \result.value() == \old(UNSIGNED(value) * pow52(p5, p2)); + @*/ + public static FDBigInteger valueOfMulPow52(long value, int p5, int p2) { + assert p5 >= 0 : p5; + assert p2 >= 0 : p2; + int v0 = (int) value; + int v1 = (int) (value >>> 32); + int wordcount = p2 >> 5; + int bitcount = p2 & 0x1f; + if (p5 != 0) { + if (p5 < SMALL_5_POW.length) { + long pow5 = SMALL_5_POW[p5] & LONG_MASK; + long carry = (v0 & LONG_MASK) * pow5; + v0 = (int) carry; + carry >>>= 32; + carry = (v1 & LONG_MASK) * pow5 + carry; + v1 = (int) carry; + int v2 = (int) (carry >>> 32); + if (bitcount == 0) { + return new FDBigInteger(new int[]{v0, v1, v2}, wordcount); + } else { + return new FDBigInteger(new int[]{ + v0 << bitcount, + (v1 << bitcount) | (v0 >>> (32 - bitcount)), + (v2 << bitcount) | (v1 >>> (32 - bitcount)), + v2 >>> (32 - bitcount) + }, wordcount); + } + } else { + FDBigInteger pow5 = big5pow(p5); + int[] r; + if (v1 == 0) { + r = new int[pow5.nWords + 1 + ((p2 != 0) ? 1 : 0)]; + mult(pow5.data, pow5.nWords, v0, r); + } else { + r = new int[pow5.nWords + 2 + ((p2 != 0) ? 1 : 0)]; + mult(pow5.data, pow5.nWords, v0, v1, r); + } + return (new FDBigInteger(r, pow5.offset)).leftShift(p2); + } + } else if (p2 != 0) { + if (bitcount == 0) { + return new FDBigInteger(new int[]{v0, v1}, wordcount); + } else { + return new FDBigInteger(new int[]{ + v0 << bitcount, + (v1 << bitcount) | (v0 >>> (32 - bitcount)), + v1 >>> (32 - bitcount) + }, wordcount); + } + } + return new FDBigInteger(new int[]{v0, v1}, 0); + } + + /** + * Returns an FDBigInteger with the numerical value + * 2p2. + * + * @param p2 The exponent of 2. + * @return 2p2 + */ + /*@ + @ requires p2 >= 0; + @ assignable \nothing; + @ ensures \result.value() == pow52(0, p2); + @*/ + private static FDBigInteger valueOfPow2(int p2) { + int wordcount = p2 >> 5; + int bitcount = p2 & 0x1f; + return new FDBigInteger(new int[]{1 << bitcount}, wordcount); + } + + /** + * Removes all leading zeros from this FDBigInteger adjusting + * the offset and number of non-zero leading words accordingly. + */ + /*@ + @ requires data != null; + @ requires 0 <= nWords && nWords <= data.length && offset >= 0; + @ requires nWords == 0 ==> offset == 0; + @ ensures nWords == 0 ==> offset == 0; + @ ensures nWords > 0 ==> data[nWords - 1] != 0; + @*/ + private /*@ helper @*/ void trimLeadingZeros() { + int i = nWords; + if (i > 0 && (data[--i] == 0)) { + //for (; i > 0 && data[i - 1] == 0; i--) ; + while(i > 0 && data[i - 1] == 0) { + i--; + } + this.nWords = i; + if (i == 0) { // all words are zero + this.offset = 0; + } + } + } + + /** + * Retrieves the normalization bias of the FDBigIntger. The + * normalization bias is a left shift such that after it the highest word + * of the value will have the 4 highest bits equal to zero: + * (highestWord & 0xf0000000) == 0, but the next bit should be 1 + * (highestWord & 0x08000000) != 0. + * + * @return The normalization bias. + */ + /*@ + @ requires this.value() > 0; + @*/ + public /*@ pure @*/ int getNormalizationBias() { + if (nWords == 0) { + throw new IllegalArgumentException("Zero value cannot be normalized"); + } + int zeros = Integer.numberOfLeadingZeros(data[nWords - 1]); + return (zeros < 4) ? 28 + zeros : zeros - 4; + } + + // TODO: Why is anticount param needed if it is always 32 - bitcount? + /** + * Left shifts the contents of one int array into another. + * + * @param src The source array. + * @param idx The initial index of the source array. + * @param result The destination array. + * @param bitcount The left shift. + * @param anticount The left anti-shift, e.g., 32-bitcount. + * @param prev The prior source value. + */ + /*@ + @ requires 0 < bitcount && bitcount < 32 && anticount == 32 - bitcount; + @ requires src.length >= idx && result.length > idx; + @ assignable result[*]; + @ ensures AP(result, \old(idx + 1)) == \old((AP(src, idx) + UNSIGNED(prev) << (idx*32)) << bitcount); + @*/ + private static void leftShift(int[] src, int idx, int result[], int bitcount, int anticount, int prev){ + for (; idx > 0; idx--) { + int v = (prev << bitcount); + prev = src[idx - 1]; + v |= (prev >>> anticount); + result[idx] = v; + } + int v = prev << bitcount; + result[0] = v; + } + + /** + * Shifts this FDBigInteger to the left. The shift is performed + * in-place unless the FDBigInteger is immutable in which case + * a new instance of FDBigInteger is returned. + * + * @param shift The number of bits to shift left. + * @return The shifted FDBigInteger. + */ + /*@ + @ requires this.value() == 0 || shift == 0; + @ assignable \nothing; + @ ensures \result == this; + @ + @ also + @ + @ requires this.value() > 0 && shift > 0 && this.isImmutable; + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() << shift); + @ + @ also + @ + @ requires this.value() > 0 && shift > 0 && this.isImmutable; + @ assignable \nothing; + @ ensures \result == this; + @ ensures \result.value() == \old(this.value() << shift); + @*/ + public FDBigInteger leftShift(int shift) { + if (shift == 0 || nWords == 0) { + return this; + } + int wordcount = shift >> 5; + int bitcount = shift & 0x1f; + if (this.isImmutable) { + if (bitcount == 0) { + return new FDBigInteger(Arrays.copyOf(data, nWords), offset + wordcount); + } else { + int anticount = 32 - bitcount; + int idx = nWords - 1; + int prev = data[idx]; + int hi = prev >>> anticount; + int[] result; + if (hi != 0) { + result = new int[nWords + 1]; + result[nWords] = hi; + } else { + result = new int[nWords]; + } + leftShift(data,idx,result,bitcount,anticount,prev); + return new FDBigInteger(result, offset + wordcount); + } + } else { + if (bitcount != 0) { + int anticount = 32 - bitcount; + if ((data[0] << bitcount) == 0) { + int idx = 0; + int prev = data[idx]; + for (; idx < nWords - 1; idx++) { + int v = (prev >>> anticount); + prev = data[idx + 1]; + v |= (prev << bitcount); + data[idx] = v; + } + int v = prev >>> anticount; + data[idx] = v; + if(v==0) { + nWords--; + } + offset++; + } else { + int idx = nWords - 1; + int prev = data[idx]; + int hi = prev >>> anticount; + int[] result = data; + int[] src = data; + if (hi != 0) { + if(nWords == data.length) { + data = result = new int[nWords + 1]; + } + result[nWords++] = hi; + } + leftShift(src,idx,result,bitcount,anticount,prev); + } + } + offset += wordcount; + return this; + } + } + + /** + * Returns the number of ints this FDBigInteger represents. + * + * @return Number of ints required to represent this FDBigInteger. + */ + /*@ + @ requires this.value() == 0; + @ ensures \result == 0; + @ + @ also + @ + @ requires this.value() > 0; + @ ensures ((\bigint)1) << (\result - 1) <= this.value() && this.value() <= ((\bigint)1) << \result; + @*/ + private /*@ pure @*/ int size() { + return nWords + offset; + } + + + /** + * Computes + *
        +     * q = (int)( this / S )
        +     * this = 10 * ( this mod S )
        +     * Return q.
        +     * 
        + * This is the iteration step of digit development for output. + * We assume that S has been normalized, as above, and that + * "this" has been left-shifted accordingly. + * Also assumed, of course, is that the result, q, can be expressed + * as an integer, 0 <= q < 10. + * + * @param The divisor of this FDBigInteger. + * @return q = (int)(this / S). + */ + /*@ + @ requires !this.isImmutable; + @ requires this.size() <= S.size(); + @ requires this.data.length + this.offset >= S.size(); + @ requires S.value() >= ((\bigint)1) << (S.size()*32 - 4); + @ assignable this.nWords, this.offset, this.data, this.data[*]; + @ ensures \result == \old(this.value() / S.value()); + @ ensures this.value() == \old(10 * (this.value() % S.value())); + @*/ + public int quoRemIteration(FDBigInteger S) throws IllegalArgumentException { + assert !this.isImmutable : "cannot modify immutable value"; + // ensure that this and S have the same number of + // digits. If S is properly normalized and q < 10 then + // this must be so. + int thSize = this.size(); + int sSize = S.size(); + if (thSize < sSize) { + // this value is significantly less than S, result of division is zero. + // just mult this by 10. + int p = multAndCarryBy10(this.data, this.nWords, this.data); + if(p!=0) { + this.data[nWords++] = p; + } else { + trimLeadingZeros(); + } + return 0; + } else if (thSize > sSize) { + throw new IllegalArgumentException("disparate values"); + } + // estimate q the obvious way. We will usually be + // right. If not, then we're only off by a little and + // will re-add. + long q = (this.data[this.nWords - 1] & LONG_MASK) / (S.data[S.nWords - 1] & LONG_MASK); + long diff = multDiffMe(q, S); + if (diff != 0L) { + //@ assert q != 0; + //@ assert this.offset == \old(Math.min(this.offset, S.offset)); + //@ assert this.offset <= S.offset; + + // q is too big. + // add S back in until this turns +. This should + // not be very many times! + long sum = 0L; + int tStart = S.offset - this.offset; + //@ assert tStart >= 0; + int[] sd = S.data; + int[] td = this.data; + while (sum == 0L) { + for (int sIndex = 0, tIndex = tStart; tIndex < this.nWords; sIndex++, tIndex++) { + sum += (td[tIndex] & LONG_MASK) + (sd[sIndex] & LONG_MASK); + td[tIndex] = (int) sum; + sum >>>= 32; // Signed or unsigned, answer is 0 or 1 + } + // + // Originally the following line read + // "if ( sum !=0 && sum != -1 )" + // but that would be wrong, because of the + // treatment of the two values as entirely unsigned, + // it would be impossible for a carry-out to be interpreted + // as -1 -- it would have to be a single-bit carry-out, or +1. + // + assert sum == 0 || sum == 1 : sum; // carry out of division correction + q -= 1; + } + } + // finally, we can multiply this by 10. + // it cannot overflow, right, as the high-order word has + // at least 4 high-order zeros! + int p = multAndCarryBy10(this.data, this.nWords, this.data); + assert p == 0 : p; // Carry out of *10 + trimLeadingZeros(); + return (int) q; + } + + /** + * Multiplies this FDBigInteger by 10. The operation will be + * performed in place unless the FDBigInteger is immutable in + * which case a new FDBigInteger will be returned. + * + * @return The FDBigInteger multiplied by 10. + */ + /*@ + @ requires this.value() == 0; + @ assignable \nothing; + @ ensures \result == this; + @ + @ also + @ + @ requires this.value() > 0 && this.isImmutable; + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() * 10); + @ + @ also + @ + @ requires this.value() > 0 && !this.isImmutable; + @ assignable this.nWords, this.data, this.data[*]; + @ ensures \result == this; + @ ensures \result.value() == \old(this.value() * 10); + @*/ + public FDBigInteger multBy10() { + if (nWords == 0) { + return this; + } + if (isImmutable) { + int[] res = new int[nWords + 1]; + res[nWords] = multAndCarryBy10(data, nWords, res); + return new FDBigInteger(res, offset); + } else { + int p = multAndCarryBy10(this.data, this.nWords, this.data); + if (p != 0) { + if (nWords == data.length) { + if (data[0] == 0) { + System.arraycopy(data, 1, data, 0, --nWords); + offset++; + } else { + data = Arrays.copyOf(data, data.length + 1); + } + } + data[nWords++] = p; + } else { + trimLeadingZeros(); + } + return this; + } + } + + /** + * Multiplies this FDBigInteger by + * 5p5 * 2p2. The operation will be + * performed in place if possible, otherwise a new FDBigInteger + * will be returned. + * + * @param p5 The exponent of the power-of-five factor. + * @param p2 The exponent of the power-of-two factor. + * @return + */ + /*@ + @ requires this.value() == 0 || p5 == 0 && p2 == 0; + @ assignable \nothing; + @ ensures \result == this; + @ + @ also + @ + @ requires this.value() > 0 && (p5 > 0 && p2 >= 0 || p5 == 0 && p2 > 0 && this.isImmutable); + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() * pow52(p5, p2)); + @ + @ also + @ + @ requires this.value() > 0 && p5 == 0 && p2 > 0 && !this.isImmutable; + @ assignable this.nWords, this.data, this.data[*]; + @ ensures \result == this; + @ ensures \result.value() == \old(this.value() * pow52(p5, p2)); + @*/ + public FDBigInteger multByPow52(int p5, int p2) { + if (this.nWords == 0) { + return this; + } + FDBigInteger res = this; + if (p5 != 0) { + int[] r; + int extraSize = (p2 != 0) ? 1 : 0; + if (p5 < SMALL_5_POW.length) { + r = new int[this.nWords + 1 + extraSize]; + mult(this.data, this.nWords, SMALL_5_POW[p5], r); + res = new FDBigInteger(r, this.offset); + } else { + FDBigInteger pow5 = big5pow(p5); + r = new int[this.nWords + pow5.size() + extraSize]; + mult(this.data, this.nWords, pow5.data, pow5.nWords, r); + res = new FDBigInteger(r, this.offset + pow5.offset); + } + } + return res.leftShift(p2); + } + + /** + * Multiplies two big integers represented as int arrays. + * + * @param s1 The first array factor. + * @param s1Len The number of elements of s1 to use. + * @param s2 The second array factor. + * @param s2Len The number of elements of s2 to use. + * @param dst The product array. + */ + /*@ + @ requires s1 != dst && s2 != dst; + @ requires s1.length >= s1Len && s2.length >= s2Len && dst.length >= s1Len + s2Len; + @ assignable dst[0 .. s1Len + s2Len - 1]; + @ ensures AP(dst, s1Len + s2Len) == \old(AP(s1, s1Len) * AP(s2, s2Len)); + @*/ + private static void mult(int[] s1, int s1Len, int[] s2, int s2Len, int[] dst) { + for (int i = 0; i < s1Len; i++) { + long v = s1[i] & LONG_MASK; + long p = 0L; + for (int j = 0; j < s2Len; j++) { + p += (dst[i + j] & LONG_MASK) + v * (s2[j] & LONG_MASK); + dst[i + j] = (int) p; + p >>>= 32; + } + dst[i + s2Len] = (int) p; + } + } + + /** + * Subtracts the supplied FDBigInteger subtrahend from this + * FDBigInteger. Assert that the result is positive. + * If the subtrahend is immutable, store the result in this(minuend). + * If this(minuend) is immutable a new FDBigInteger is created. + * + * @param subtrahend The FDBigInteger to be subtracted. + * @return This FDBigInteger less the subtrahend. + */ + /*@ + @ requires this.isImmutable; + @ requires this.value() >= subtrahend.value(); + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() - subtrahend.value()); + @ + @ also + @ + @ requires !subtrahend.isImmutable; + @ requires this.value() >= subtrahend.value(); + @ assignable this.nWords, this.offset, this.data, this.data[*]; + @ ensures \result == this; + @ ensures \result.value() == \old(this.value() - subtrahend.value()); + @*/ + public FDBigInteger leftInplaceSub(FDBigInteger subtrahend) { + assert this.size() >= subtrahend.size() : "result should be positive"; + FDBigInteger minuend; + if (this.isImmutable) { + minuend = new FDBigInteger(this.data.clone(), this.offset); + } else { + minuend = this; + } + int offsetDiff = subtrahend.offset - minuend.offset; + int[] sData = subtrahend.data; + int[] mData = minuend.data; + int subLen = subtrahend.nWords; + int minLen = minuend.nWords; + if (offsetDiff < 0) { + // need to expand minuend + int rLen = minLen - offsetDiff; + if (rLen < mData.length) { + System.arraycopy(mData, 0, mData, -offsetDiff, minLen); + Arrays.fill(mData, 0, -offsetDiff, 0); + } else { + int[] r = new int[rLen]; + System.arraycopy(mData, 0, r, -offsetDiff, minLen); + minuend.data = mData = r; + } + minuend.offset = subtrahend.offset; + minuend.nWords = minLen = rLen; + offsetDiff = 0; + } + long borrow = 0L; + int mIndex = offsetDiff; + for (int sIndex = 0; sIndex < subLen && mIndex < minLen; sIndex++, mIndex++) { + long diff = (mData[mIndex] & LONG_MASK) - (sData[sIndex] & LONG_MASK) + borrow; + mData[mIndex] = (int) diff; + borrow = diff >> 32; // signed shift + } + for (; borrow != 0 && mIndex < minLen; mIndex++) { + long diff = (mData[mIndex] & LONG_MASK) + borrow; + mData[mIndex] = (int) diff; + borrow = diff >> 32; // signed shift + } + assert borrow == 0L : borrow; // borrow out of subtract, + // result should be positive + minuend.trimLeadingZeros(); + return minuend; + } + + /** + * Subtracts the supplied FDBigInteger subtrahend from this + * FDBigInteger. Assert that the result is positive. + * If the this(minuend) is immutable, store the result in subtrahend. + * If subtrahend is immutable a new FDBigInteger is created. + * + * @param subtrahend The FDBigInteger to be subtracted. + * @return This FDBigInteger less the subtrahend. + */ + /*@ + @ requires subtrahend.isImmutable; + @ requires this.value() >= subtrahend.value(); + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() - subtrahend.value()); + @ + @ also + @ + @ requires !subtrahend.isImmutable; + @ requires this.value() >= subtrahend.value(); + @ assignable subtrahend.nWords, subtrahend.offset, subtrahend.data, subtrahend.data[*]; + @ ensures \result == subtrahend; + @ ensures \result.value() == \old(this.value() - subtrahend.value()); + @*/ + public FDBigInteger rightInplaceSub(FDBigInteger subtrahend) { + assert this.size() >= subtrahend.size() : "result should be positive"; + FDBigInteger minuend = this; + if (subtrahend.isImmutable) { + subtrahend = new FDBigInteger(subtrahend.data.clone(), subtrahend.offset); + } + int offsetDiff = minuend.offset - subtrahend.offset; + int[] sData = subtrahend.data; + int[] mData = minuend.data; + int subLen = subtrahend.nWords; + int minLen = minuend.nWords; + if (offsetDiff < 0) { + int rLen = minLen; + if (rLen < sData.length) { + System.arraycopy(sData, 0, sData, -offsetDiff, subLen); + Arrays.fill(sData, 0, -offsetDiff, 0); + } else { + int[] r = new int[rLen]; + System.arraycopy(sData, 0, r, -offsetDiff, subLen); + subtrahend.data = sData = r; + } + subtrahend.offset = minuend.offset; + subLen -= offsetDiff; + offsetDiff = 0; + } else { + int rLen = minLen + offsetDiff; + if (rLen >= sData.length) { + subtrahend.data = sData = Arrays.copyOf(sData, rLen); + } + } + //@ assert minuend == this && minuend.value() == \old(this.value()); + //@ assert mData == minuend.data && minLen == minuend.nWords; + //@ assert subtrahend.offset + subtrahend.data.length >= minuend.size(); + //@ assert sData == subtrahend.data; + //@ assert AP(subtrahend.data, subtrahend.data.length) << subtrahend.offset == \old(subtrahend.value()); + //@ assert subtrahend.offset == Math.min(\old(this.offset), minuend.offset); + //@ assert offsetDiff == minuend.offset - subtrahend.offset; + //@ assert 0 <= offsetDiff && offsetDiff + minLen <= sData.length; + int sIndex = 0; + long borrow = 0L; + for (; sIndex < offsetDiff; sIndex++) { + long diff = 0L - (sData[sIndex] & LONG_MASK) + borrow; + sData[sIndex] = (int) diff; + borrow = diff >> 32; // signed shift + } + //@ assert sIndex == offsetDiff; + for (int mIndex = 0; mIndex < minLen; sIndex++, mIndex++) { + //@ assert sIndex == offsetDiff + mIndex; + long diff = (mData[mIndex] & LONG_MASK) - (sData[sIndex] & LONG_MASK) + borrow; + sData[sIndex] = (int) diff; + borrow = diff >> 32; // signed shift + } + assert borrow == 0L : borrow; // borrow out of subtract, + // result should be positive + subtrahend.nWords = sIndex; + subtrahend.trimLeadingZeros(); + return subtrahend; + + } + + /** + * Determines whether all elements of an array are zero for all indices less + * than a given index. + * + * @param a The array to be examined. + * @param from The index strictly below which elements are to be examined. + * @return Zero if all elements in range are zero, 1 otherwise. + */ + /*@ + @ requires 0 <= from && from <= a.length; + @ ensures \result == (AP(a, from) == 0 ? 0 : 1); + @*/ + private /*@ pure @*/ static int checkZeroTail(int[] a, int from) { + while (from > 0) { + if (a[--from] != 0) { + return 1; + } + } + return 0; + } + + /** + * Compares the parameter with this FDBigInteger. Returns an + * integer accordingly as: + *
        +     * >0: this > other
        +     *  0: this == other
        +     * <0: this < other
        +     * 
        + * + * @param other The FDBigInteger to compare. + * @return A negative value, zero, or a positive value according to the + * result of the comparison. + */ + /*@ + @ ensures \result == (this.value() < other.value() ? -1 : this.value() > other.value() ? +1 : 0); + @*/ + public /*@ pure @*/ int cmp(FDBigInteger other) { + int aSize = nWords + offset; + int bSize = other.nWords + other.offset; + if (aSize > bSize) { + return 1; + } else if (aSize < bSize) { + return -1; + } + int aLen = nWords; + int bLen = other.nWords; + while (aLen > 0 && bLen > 0) { + int a = data[--aLen]; + int b = other.data[--bLen]; + if (a != b) { + return ((a & LONG_MASK) < (b & LONG_MASK)) ? -1 : 1; + } + } + if (aLen > 0) { + return checkZeroTail(data, aLen); + } + if (bLen > 0) { + return -checkZeroTail(other.data, bLen); + } + return 0; + } + + /** + * Compares this FDBigInteger with + * 5p5 * 2p2. + * Returns an integer accordingly as: + *
        +     * >0: this > other
        +     *  0: this == other
        +     * <0: this < other
        +     * 
        + * @param p5 The exponent of the power-of-five factor. + * @param p2 The exponent of the power-of-two factor. + * @return A negative value, zero, or a positive value according to the + * result of the comparison. + */ + /*@ + @ requires p5 >= 0 && p2 >= 0; + @ ensures \result == (this.value() < pow52(p5, p2) ? -1 : this.value() > pow52(p5, p2) ? +1 : 0); + @*/ + public /*@ pure @*/ int cmpPow52(int p5, int p2) { + if (p5 == 0) { + int wordcount = p2 >> 5; + int bitcount = p2 & 0x1f; + int size = this.nWords + this.offset; + if (size > wordcount + 1) { + return 1; + } else if (size < wordcount + 1) { + return -1; + } + int a = this.data[this.nWords -1]; + int b = 1 << bitcount; + if (a != b) { + return ( (a & LONG_MASK) < (b & LONG_MASK)) ? -1 : 1; + } + return checkZeroTail(this.data, this.nWords - 1); + } + return this.cmp(big5pow(p5).leftShift(p2)); + } + + /** + * Compares this FDBigInteger with x + y. Returns a + * value according to the comparison as: + *
        +     * -1: this <  x + y
        +     *  0: this == x + y
        +     *  1: this >  x + y
        +     * 
        + * @param x The first addend of the sum to compare. + * @param y The second addend of the sum to compare. + * @return -1, 0, or 1 according to the result of the comparison. + */ + /*@ + @ ensures \result == (this.value() < x.value() + y.value() ? -1 : this.value() > x.value() + y.value() ? +1 : 0); + @*/ + public /*@ pure @*/ int addAndCmp(FDBigInteger x, FDBigInteger y) { + FDBigInteger big; + FDBigInteger small; + int xSize = x.size(); + int ySize = y.size(); + int bSize; + int sSize; + if (xSize >= ySize) { + big = x; + small = y; + bSize = xSize; + sSize = ySize; + } else { + big = y; + small = x; + bSize = ySize; + sSize = xSize; + } + int thSize = this.size(); + if (bSize == 0) { + return thSize == 0 ? 0 : 1; + } + if (sSize == 0) { + return this.cmp(big); + } + if (bSize > thSize) { + return -1; + } + if (bSize + 1 < thSize) { + return 1; + } + long top = (big.data[big.nWords - 1] & LONG_MASK); + if (sSize == bSize) { + top += (small.data[small.nWords - 1] & LONG_MASK); + } + if ((top >>> 32) == 0) { + if (((top + 1) >>> 32) == 0) { + // good case - no carry extension + if (bSize < thSize) { + return 1; + } + // here sum.nWords == this.nWords + long v = (this.data[this.nWords - 1] & LONG_MASK); + if (v < top) { + return -1; + } + if (v > top + 1) { + return 1; + } + } + } else { // (top>>>32)!=0 guaranteed carry extension + if (bSize + 1 > thSize) { + return -1; + } + // here sum.nWords == this.nWords + top >>>= 32; + long v = (this.data[this.nWords - 1] & LONG_MASK); + if (v < top) { + return -1; + } + if (v > top + 1) { + return 1; + } + } + return this.cmp(big.add(small)); + } + + /** + * Makes this FDBigInteger immutable. + */ + /*@ + @ assignable this.isImmutable; + @ ensures this.isImmutable; + @*/ + public void makeImmutable() { + this.isImmutable = true; + } + + /** + * Multiplies this FDBigInteger by an integer. + * + * @param i The factor by which to multiply this FDBigInteger. + * @return This FDBigInteger multiplied by an integer. + */ + /*@ + @ requires this.value() == 0; + @ assignable \nothing; + @ ensures \result == this; + @ + @ also + @ + @ requires this.value() != 0; + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() * UNSIGNED(i)); + @*/ + private FDBigInteger mult(int i) { + if (this.nWords == 0) { + return this; + } + int[] r = new int[nWords + 1]; + mult(data, nWords, i, r); + return new FDBigInteger(r, offset); + } + + /** + * Multiplies this FDBigInteger by another FDBigInteger. + * + * @param other The FDBigInteger factor by which to multiply. + * @return The product of this and the parameter FDBigIntegers. + */ + /*@ + @ requires this.value() == 0; + @ assignable \nothing; + @ ensures \result == this; + @ + @ also + @ + @ requires this.value() != 0 && other.value() == 0; + @ assignable \nothing; + @ ensures \result == other; + @ + @ also + @ + @ requires this.value() != 0 && other.value() != 0; + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() * other.value()); + @*/ + private FDBigInteger mult(FDBigInteger other) { + if (this.nWords == 0) { + return this; + } + if (this.size() == 1) { + return other.mult(data[0]); + } + if (other.nWords == 0) { + return other; + } + if (other.size() == 1) { + return this.mult(other.data[0]); + } + int[] r = new int[nWords + other.nWords]; + mult(this.data, this.nWords, other.data, other.nWords, r); + return new FDBigInteger(r, this.offset + other.offset); + } + + /** + * Adds another FDBigInteger to this FDBigInteger. + * + * @param other The FDBigInteger to add. + * @return The sum of the FDBigIntegers. + */ + /*@ + @ assignable \nothing; + @ ensures \result.value() == \old(this.value() + other.value()); + @*/ + private FDBigInteger add(FDBigInteger other) { + FDBigInteger big, small; + int bigLen, smallLen; + int tSize = this.size(); + int oSize = other.size(); + if (tSize >= oSize) { + big = this; + bigLen = tSize; + small = other; + smallLen = oSize; + } else { + big = other; + bigLen = oSize; + small = this; + smallLen = tSize; + } + int[] r = new int[bigLen + 1]; + int i = 0; + long carry = 0L; + for (; i < smallLen; i++) { + carry += (i < big.offset ? 0L : (big.data[i - big.offset] & LONG_MASK) ) + + ((i < small.offset ? 0L : (small.data[i - small.offset] & LONG_MASK))); + r[i] = (int) carry; + carry >>= 32; // signed shift. + } + for (; i < bigLen; i++) { + carry += (i < big.offset ? 0L : (big.data[i - big.offset] & LONG_MASK) ); + r[i] = (int) carry; + carry >>= 32; // signed shift. + } + r[bigLen] = (int) carry; + return new FDBigInteger(r, 0); + } + + + /** + * Multiplies a FDBigInteger by an int and adds another int. The + * result is computed in place. This method is intended only to be invoked + * from + * + * FDBigInteger(long lValue, char[] digits, int kDigits, int nDigits) + * . + * + * @param iv The factor by which to multiply this FDBigInteger. + * @param addend The value to add to the product of this + * FDBigInteger and iv. + */ + /*@ + @ requires this.value()*UNSIGNED(iv) + UNSIGNED(addend) < ((\bigint)1) << ((this.data.length + this.offset)*32); + @ assignable this.data[*]; + @ ensures this.value() == \old(this.value()*UNSIGNED(iv) + UNSIGNED(addend)); + @*/ + private /*@ helper @*/ void multAddMe(int iv, int addend) { + long v = iv & LONG_MASK; + // unroll 0th iteration, doing addition. + long p = v * (data[0] & LONG_MASK) + (addend & LONG_MASK); + data[0] = (int) p; + p >>>= 32; + for (int i = 1; i < nWords; i++) { + p += v * (data[i] & LONG_MASK); + data[i] = (int) p; + p >>>= 32; + } + if (p != 0L) { + data[nWords++] = (int) p; // will fail noisily if illegal! + } + } + + // + // original doc: + // + // do this -=q*S + // returns borrow + // + /** + * Multiplies the parameters and subtracts them from this + * FDBigInteger. + * + * @param q The integer parameter. + * @param S The FDBigInteger parameter. + * @return this - q*S. + */ + /*@ + @ ensures nWords == 0 ==> offset == 0; + @ ensures nWords > 0 ==> data[nWords - 1] != 0; + @*/ + /*@ + @ requires 0 < q && q <= (1L << 31); + @ requires data != null; + @ requires 0 <= nWords && nWords <= data.length && offset >= 0; + @ requires !this.isImmutable; + @ requires this.size() == S.size(); + @ requires this != S; + @ assignable this.nWords, this.offset, this.data, this.data[*]; + @ ensures -q <= \result && \result <= 0; + @ ensures this.size() == \old(this.size()); + @ ensures this.value() + (\result << (this.size()*32)) == \old(this.value() - q*S.value()); + @ ensures this.offset == \old(Math.min(this.offset, S.offset)); + @ ensures \old(this.offset <= S.offset) ==> this.nWords == \old(this.nWords); + @ ensures \old(this.offset <= S.offset) ==> this.offset == \old(this.offset); + @ ensures \old(this.offset <= S.offset) ==> this.data == \old(this.data); + @ + @ also + @ + @ requires q == 0; + @ assignable \nothing; + @ ensures \result == 0; + @*/ + private /*@ helper @*/ long multDiffMe(long q, FDBigInteger S) { + long diff = 0L; + if (q != 0) { + int deltaSize = S.offset - this.offset; + if (deltaSize >= 0) { + int[] sd = S.data; + int[] td = this.data; + for (int sIndex = 0, tIndex = deltaSize; sIndex < S.nWords; sIndex++, tIndex++) { + diff += (td[tIndex] & LONG_MASK) - q * (sd[sIndex] & LONG_MASK); + td[tIndex] = (int) diff; + diff >>= 32; // N.B. SIGNED shift. + } + } else { + deltaSize = -deltaSize; + int[] rd = new int[nWords + deltaSize]; + int sIndex = 0; + int rIndex = 0; + int[] sd = S.data; + for (; rIndex < deltaSize && sIndex < S.nWords; sIndex++, rIndex++) { + diff -= q * (sd[sIndex] & LONG_MASK); + rd[rIndex] = (int) diff; + diff >>= 32; // N.B. SIGNED shift. + } + int tIndex = 0; + int[] td = this.data; + for (; sIndex < S.nWords; sIndex++, tIndex++, rIndex++) { + diff += (td[tIndex] & LONG_MASK) - q * (sd[sIndex] & LONG_MASK); + rd[rIndex] = (int) diff; + diff >>= 32; // N.B. SIGNED shift. + } + this.nWords += deltaSize; + this.offset -= deltaSize; + this.data = rd; + } + } + return diff; + } + + + /** + * Multiplies by 10 a big integer represented as an array. The final carry + * is returned. + * + * @param src The array representation of the big integer. + * @param srcLen The number of elements of src to use. + * @param dst The product array. + * @return The final carry of the multiplication. + */ + /*@ + @ requires src.length >= srcLen && dst.length >= srcLen; + @ assignable dst[0 .. srcLen - 1]; + @ ensures 0 <= \result && \result < 10; + @ ensures AP(dst, srcLen) + (\result << (srcLen*32)) == \old(AP(src, srcLen) * 10); + @*/ + private static int multAndCarryBy10(int[] src, int srcLen, int[] dst) { + long carry = 0; + for (int i = 0; i < srcLen; i++) { + long product = (src[i] & LONG_MASK) * 10L + carry; + dst[i] = (int) product; + carry = product >>> 32; + } + return (int) carry; + } + + /** + * Multiplies by a constant value a big integer represented as an array. + * The constant factor is an int. + * + * @param src The array representation of the big integer. + * @param srcLen The number of elements of src to use. + * @param value The constant factor by which to multiply. + * @param dst The product array. + */ + /*@ + @ requires src.length >= srcLen && dst.length >= srcLen + 1; + @ assignable dst[0 .. srcLen]; + @ ensures AP(dst, srcLen + 1) == \old(AP(src, srcLen) * UNSIGNED(value)); + @*/ + private static void mult(int[] src, int srcLen, int value, int[] dst) { + long val = value & LONG_MASK; + long carry = 0; + for (int i = 0; i < srcLen; i++) { + long product = (src[i] & LONG_MASK) * val + carry; + dst[i] = (int) product; + carry = product >>> 32; + } + dst[srcLen] = (int) carry; + } + + /** + * Multiplies by a constant value a big integer represented as an array. + * The constant factor is a long represent as two ints. + * + * @param src The array representation of the big integer. + * @param srcLen The number of elements of src to use. + * @param v0 The lower 32 bits of the long factor. + * @param v1 The upper 32 bits of the long factor. + * @param dst The product array. + */ + /*@ + @ requires src != dst; + @ requires src.length >= srcLen && dst.length >= srcLen + 2; + @ assignable dst[0 .. srcLen + 1]; + @ ensures AP(dst, srcLen + 2) == \old(AP(src, srcLen) * (UNSIGNED(v0) + (UNSIGNED(v1) << 32))); + @*/ + private static void mult(int[] src, int srcLen, int v0, int v1, int[] dst) { + long v = v0 & LONG_MASK; + long carry = 0; + for (int j = 0; j < srcLen; j++) { + long product = v * (src[j] & LONG_MASK) + carry; + dst[j] = (int) product; + carry = product >>> 32; + } + dst[srcLen] = (int) carry; + v = v1 & LONG_MASK; + carry = 0; + for (int j = 0; j < srcLen; j++) { + long product = (dst[j + 1] & LONG_MASK) + v * (src[j] & LONG_MASK) + carry; + dst[j + 1] = (int) product; + carry = product >>> 32; + } + dst[srcLen + 1] = (int) carry; + } + + // Fails assertion for negative exponent. + /** + * Computes 5 raised to a given power. + * + * @param p The exponent of 5. + * @return 5p. + */ + private static FDBigInteger big5pow(int p) { + assert p >= 0 : p; // negative power of 5 + if (p < MAX_FIVE_POW) { + return POW_5_CACHE[p]; + } + return big5powRec(p); + } + + // slow path + /** + * Computes 5 raised to a given power. + * + * @param p The exponent of 5. + * @return 5p. + */ + private static FDBigInteger big5powRec(int p) { + if (p < MAX_FIVE_POW) { + return POW_5_CACHE[p]; + } + // construct the value. + // recursively. + int q, r; + // in order to compute 5^p, + // compute its square root, 5^(p/2) and square. + // or, let q = p / 2, r = p -q, then + // 5^p = 5^(q+r) = 5^q * 5^r + q = p >> 1; + r = p - q; + FDBigInteger bigq = big5powRec(q); + if (r < SMALL_5_POW.length) { + return bigq.mult(SMALL_5_POW[r]); + } else { + return bigq.mult(big5powRec(r)); + } + } + + // for debugging ... + /** + * Converts this FDBigInteger to a hexadecimal string. + * + * @return The hexadecimal string representation. + */ + public String toHexString(){ + if(nWords ==0) { + return "0"; + } + StringBuilder sb = new StringBuilder((nWords +offset)*8); + for(int i= nWords -1; i>=0; i--) { + String subStr = Integer.toHexString(data[i]); + for(int j = subStr.length(); j<8; j++) { + sb.append('0'); + } + sb.append(subStr); + } + for(int i=offset; i>0; i--) { + sb.append("00000000"); + } + return sb.toString(); + } + + // for debugging ... + /** + * Converts this FDBigInteger to a BigInteger. + * + * @return The BigInteger representation. + */ + public BigInteger toBigInteger() { + byte[] magnitude = new byte[nWords * 4 + 1]; + for (int i = 0; i < nWords; i++) { + int w = data[i]; + magnitude[magnitude.length - 4 * i - 1] = (byte) w; + magnitude[magnitude.length - 4 * i - 2] = (byte) (w >> 8); + magnitude[magnitude.length - 4 * i - 3] = (byte) (w >> 16); + magnitude[magnitude.length - 4 * i - 4] = (byte) (w >> 24); + } + return new BigInteger(magnitude).shiftLeft(offset * 32); + } + + // for debugging ... + /** + * Converts this FDBigInteger to a string. + * + * @return The string representation. + */ + @Override + public String toString(){ + return toBigInteger().toString(); + } +} diff --git a/jdk/src/share/classes/sun/misc/FloatingDecimal.java b/jdk/src/share/classes/sun/misc/FloatingDecimal.java index 2db646d2cc1..ddd8790bc14 100644 --- a/jdk/src/share/classes/sun/misc/FloatingDecimal.java +++ b/jdk/src/share/classes/sun/misc/FloatingDecimal.java @@ -25,602 +25,787 @@ package sun.misc; -import sun.misc.DoubleConsts; -import sun.misc.FloatConsts; +import java.util.Arrays; import java.util.regex.*; +/** + * A class for converting between ASCII and decimal representations of a single + * or double precision floating point number. Most conversions are provided via + * static convenience methods, although a BinaryToASCIIConverter + * instance may be obtained and reused. + */ public class FloatingDecimal{ - boolean isExceptional; - boolean isNegative; - int decExponent; - char digits[]; - int nDigits; - int bigIntExp; - int bigIntNBits; - boolean mustSetRoundDir = false; - boolean fromHex = false; - int roundDir = 0; // set by doubleValue - - /* - * The fields below provides additional information about the result of - * the binary to decimal digits conversion done in dtoa() and roundup() - * methods. They are changed if needed by those two methods. - */ - - // True if the dtoa() binary to decimal conversion was exact. - boolean exactDecimalConversion = false; - - // True if the result of the binary to decimal conversion was rounded-up - // at the end of the conversion process, i.e. roundUp() method was called. - boolean decimalDigitsRoundedUp = false; - - private FloatingDecimal( boolean negSign, int decExponent, char []digits, int n, boolean e ) - { - isNegative = negSign; - isExceptional = e; - this.decExponent = decExponent; - this.digits = digits; - this.nDigits = n; - } - - /* - * Constants of the implementation - * Most are IEEE-754 related. - * (There are more really boring constants at the end.) - */ - static final long signMask = 0x8000000000000000L; - static final long expMask = 0x7ff0000000000000L; - static final long fractMask= ~(signMask|expMask); - static final int expShift = 52; - static final int expBias = 1023; - static final long fractHOB = ( 1L< 0L ) { // i.e. while ((v&highbit) == 0L ) - v <<= 1; - } - - int n = 0; - while (( v & lowbytes ) != 0L ){ - v <<= 8; - n += 8; - } - while ( v != 0L ){ - v <<= 1; - n += 1; - } - return n; - } - - /* - * Keep big powers of 5 handy for future reference. - */ - private static FDBigInt b5p[]; - - private static synchronized FDBigInt - big5pow( int p ){ - assert p >= 0 : p; // negative power of 5 - if ( b5p == null ){ - b5p = new FDBigInt[ p+1 ]; - }else if (b5p.length <= p ){ - FDBigInt t[] = new FDBigInt[ p+1 ]; - System.arraycopy( b5p, 0, t, 0, b5p.length ); - b5p = t; - } - if ( b5p[p] != null ) - return b5p[p]; - else if ( p < small5pow.length ) - return b5p[p] = new FDBigInt( small5pow[p] ); - else if ( p < long5pow.length ) - return b5p[p] = new FDBigInt( long5pow[p] ); - else { - // construct the value. - // recursively. - int q, r; - // in order to compute 5^p, - // compute its square root, 5^(p/2) and square. - // or, let q = p / 2, r = p -q, then - // 5^p = 5^(q+r) = 5^q * 5^r - q = p >> 1; - r = p - q; - FDBigInt bigq = b5p[q]; - if ( bigq == null ) - bigq = big5pow ( q ); - if ( r < small5pow.length ){ - return (b5p[p] = bigq.mult( small5pow[r] ) ); - }else{ - FDBigInt bigr = b5p[ r ]; - if ( bigr == null ) - bigr = big5pow( r ); - return (b5p[p] = bigq.mult( bigr ) ); - } - } - } - // - // a common operation + // Constants of the implementation; + // most are IEEE-754 related. + // (There are more really boring constants at the end.) // - private static FDBigInt - multPow52( FDBigInt v, int p5, int p2 ){ - if ( p5 != 0 ){ - if ( p5 < small5pow.length ){ - v = v.mult( small5pow[p5] ); - } else { - v = v.mult( big5pow( p5 ) ); - } - } - if ( p2 != 0 ){ - v.lshiftMe( p2 ); - } - return v; - } + static final int EXP_SHIFT = DoubleConsts.SIGNIFICAND_WIDTH - 1; + static final long FRACT_HOB = ( 1L<String. * + * @param d The double precision value. + * @return The value converted to a String. */ - private FDBigInt - doubleToBigInt( double dval ){ - long lbits = Double.doubleToLongBits( dval ) & ~signMask; - int binexp = (int)(lbits >>> expShift); - lbits &= fractMask; - if ( binexp > 0 ){ - lbits |= fractHOB; - } else { - assert lbits != 0L : lbits; // doubleToBigInt(0.0) - binexp +=1; - while ( (lbits & fractHOB ) == 0L){ - lbits <<= 1; - binexp -= 1; - } - } - binexp -= expBias; - int nbits = countBits( lbits ); - /* - * We now know where the high-order 1 bit is, - * and we know how many there are. + public static String toJavaFormatString(double d) { + return getBinaryToASCIIConverter(d).toJavaFormatString(); + } + + /** + * Converts a single precision floating point value to a String. + * + * @param f The single precision value. + * @return The value converted to a String. + */ + public static String toJavaFormatString(float f) { + return getBinaryToASCIIConverter(f).toJavaFormatString(); + } + + /** + * Appends a double precision floating point value to an Appendable. + * @param d The double precision value. + * @param buf The Appendable with the value appended. + */ + public static void appendTo(double d, Appendable buf) { + getBinaryToASCIIConverter(d).appendTo(buf); + } + + /** + * Appends a single precision floating point value to an Appendable. + * @param f The single precision value. + * @param buf The Appendable with the value appended. + */ + public static void appendTo(float f, Appendable buf) { + getBinaryToASCIIConverter(f).appendTo(buf); + } + + /** + * Converts a String to a double precision floating point value. + * + * @param s The String to convert. + * @return The double precision value. + * @throws NumberFormatException If the String does not + * represent a properly formatted double precision value. + */ + public static double parseDouble(String s) throws NumberFormatException { + return readJavaFormatString(s).doubleValue(); + } + + /** + * Converts a String to a single precision floating point value. + * + * @param s The String to convert. + * @return The single precision value. + * @throws NumberFormatException If the String does not + * represent a properly formatted single precision value. + */ + public static float parseFloat(String s) throws NumberFormatException { + return readJavaFormatString(s).floatValue(); + } + + /** + * A converter which can process single or double precision floating point + * values into an ASCII String representation. + */ + public interface BinaryToASCIIConverter { + /** + * Converts a floating point value into an ASCII String. + * @return The value converted to a String. */ - int lowOrderZeros = expShift+1-nbits; - lbits >>>= lowOrderZeros; + public String toJavaFormatString(); - bigIntExp = binexp+1-nbits; - bigIntNBits = nbits; - return new FDBigInt( lbits ); + /** + * Appends a floating point value to an Appendable. + * @param buf The Appendable to receive the value. + */ + public void appendTo(Appendable buf); + + /** + * Retrieves the decimal exponent most closely corresponding to this value. + * @return The decimal exponent. + */ + public int getDecimalExponent(); + + /** + * Retrieves the value as an array of digits. + * @param digits The digit array. + * @return The number of valid digits copied into the array. + */ + public int getDigits(char[] digits); + + /** + * Indicates the sign of the value. + * @return value < 0.0. + */ + public boolean isNegative(); + + /** + * Indicates whether the value is either infinite or not a number. + * + * @return true if and only if the value is NaN + * or infinite. + */ + public boolean isExceptional(); + + /** + * Indicates whether the value was rounded up during the binary to ASCII + * conversion. + * + * @return true if and only if the value was rounded up. + */ + public boolean digitsRoundedUp(); + + /** + * Indicates whether the binary to ASCII conversion was exact. + * + * @return true if any only if the conversion was exact. + */ + public boolean decimalDigitsExact(); } - /* - * Compute a number that is the ULP of the given value, - * for purposes of addition/subtraction. Generally easy. - * More difficult if subtracting and the argument - * is a normalized a power of 2, as the ULP changes at these points. + /** + * A BinaryToASCIIConverter which represents NaN + * and infinite values. */ - private static double ulp( double dval, boolean subtracting ){ - long lbits = Double.doubleToLongBits( dval ) & ~signMask; - int binexp = (int)(lbits >>> expShift); - double ulpval; - if ( subtracting && ( binexp >= expShift ) && ((lbits&fractMask) == 0L) ){ - // for subtraction from normalized, powers of 2, - // use next-smaller exponent - binexp -= 1; - } - if ( binexp > expShift ){ - ulpval = Double.longBitsToDouble( ((long)(binexp-expShift))< 0L (not zero, nor negative). - * - * The only reason that we develop the digits here, rather than - * calling on Long.toString() is that we can do it a little faster, - * and besides want to treat trailing 0s specially. If Long.toString - * changes, we should re-evaluate this strategy! + /** + * A buffered implementation of BinaryToASCIIConverter. */ - private void - developLongDigits( int decExponent, long lvalue, long insignificant ){ - char digits[]; - int ndigits; - int digitno; - int c; + static class BinaryToASCIIBuffer implements BinaryToASCIIConverter { + private boolean isNegative; + private int decExponent; + private int firstDigitIndex; + private int nDigits; + private final char[] digits; + private final char[] buffer = new char[26]; + // - // Discard non-significant low-order bits, while rounding, - // up to insignificant value. - int i; - for ( i = 0; insignificant >= 10L; i++ ) - insignificant /= 10L; - if ( i != 0 ){ - long pow10 = long5pow[i] << i; // 10^i == 5^i * 2^i; - long residue = lvalue % pow10; - lvalue /= pow10; - decExponent += i; - if ( residue >= (pow10>>1) ){ - // round up based on the low-order bits we're discarding - lvalue++; + // The fields below provide additional information about the result of + // the binary to decimal digits conversion done in dtoa() and roundup() + // methods. They are changed if needed by those two methods. + // + + // True if the dtoa() binary to decimal conversion was exact. + private boolean exactDecimalConversion = false; + + // True if the result of the binary to decimal conversion was rounded-up + // at the end of the conversion process, i.e. roundUp() method was called. + private boolean decimalDigitsRoundedUp = false; + + /** + * Default constructor; used for non-zero values, + * BinaryToASCIIBuffer may be thread-local and reused + */ + BinaryToASCIIBuffer(){ + this.digits = new char[20]; + } + + /** + * Creates a specialized value (positive and negative zeros). + */ + BinaryToASCIIBuffer(boolean isNegative, char[] digits){ + this.isNegative = isNegative; + this.decExponent = 0; + this.digits = digits; + this.firstDigitIndex = 0; + this.nDigits = digits.length; + } + + @Override + public String toJavaFormatString() { + int len = getChars(buffer); + return new String(buffer, 0, len); + } + + @Override + public void appendTo(Appendable buf) { + int len = getChars(buffer); + if (buf instanceof StringBuilder) { + ((StringBuilder) buf).append(buffer, 0, len); + } else if (buf instanceof StringBuffer) { + ((StringBuffer) buf).append(buffer, 0, len); + } else { + assert false; } } - if ( lvalue <= Integer.MAX_VALUE ){ - assert lvalue > 0L : lvalue; // lvalue <= 0 - // even easier subcase! - // can do int arithmetic rather than long! - int ivalue = (int)lvalue; - ndigits = 10; - digits = perThreadBuffer.get(); - digitno = ndigits-1; - c = ivalue%10; - ivalue /= 10; - while ( c == 0 ){ - decExponent++; + + @Override + public int getDecimalExponent() { + return decExponent; + } + + @Override + public int getDigits(char[] digits) { + System.arraycopy(this.digits,firstDigitIndex,digits,0,this.nDigits); + return this.nDigits; + } + + @Override + public boolean isNegative() { + return isNegative; + } + + @Override + public boolean isExceptional() { + return false; + } + + @Override + public boolean digitsRoundedUp() { + return decimalDigitsRoundedUp; + } + + @Override + public boolean decimalDigitsExact() { + return exactDecimalConversion; + } + + private void setSign(boolean isNegative) { + this.isNegative = isNegative; + } + + /** + * This is the easy subcase -- + * all the significant bits, after scaling, are held in lvalue. + * negSign and decExponent tell us what processing and scaling + * has already been done. Exceptional cases have already been + * stripped out. + * In particular: + * lvalue is a finite number (not Inf, nor NaN) + * lvalue > 0L (not zero, nor negative). + * + * The only reason that we develop the digits here, rather than + * calling on Long.toString() is that we can do it a little faster, + * and besides want to treat trailing 0s specially. If Long.toString + * changes, we should re-evaluate this strategy! + */ + private void developLongDigits( int decExponent, long lvalue, int insignificantDigits ){ + if ( insignificantDigits != 0 ){ + // Discard non-significant low-order bits, while rounding, + // up to insignificant value. + long pow10 = FDBigInteger.LONG_5_POW[insignificantDigits] << insignificantDigits; // 10^i == 5^i * 2^i; + long residue = lvalue % pow10; + lvalue /= pow10; + decExponent += insignificantDigits; + if ( residue >= (pow10>>1) ){ + // round up based on the low-order bits we're discarding + lvalue++; + } + } + int digitno = digits.length -1; + int c; + if ( lvalue <= Integer.MAX_VALUE ){ + assert lvalue > 0L : lvalue; // lvalue <= 0 + // even easier subcase! + // can do int arithmetic rather than long! + int ivalue = (int)lvalue; c = ivalue%10; ivalue /= 10; - } - while ( ivalue != 0){ - digits[digitno--] = (char)(c+'0'); - decExponent++; - c = ivalue%10; - ivalue /= 10; - } - digits[digitno] = (char)(c+'0'); - } else { - // same algorithm as above (same bugs, too ) - // but using long arithmetic. - ndigits = 20; - digits = perThreadBuffer.get(); - digitno = ndigits-1; - c = (int)(lvalue%10L); - lvalue /= 10L; - while ( c == 0 ){ - decExponent++; + while ( c == 0 ){ + decExponent++; + c = ivalue%10; + ivalue /= 10; + } + while ( ivalue != 0){ + digits[digitno--] = (char)(c+'0'); + decExponent++; + c = ivalue%10; + ivalue /= 10; + } + digits[digitno] = (char)(c+'0'); + } else { + // same algorithm as above (same bugs, too ) + // but using long arithmetic. c = (int)(lvalue%10L); lvalue /= 10L; + while ( c == 0 ){ + decExponent++; + c = (int)(lvalue%10L); + lvalue /= 10L; + } + while ( lvalue != 0L ){ + digits[digitno--] = (char)(c+'0'); + decExponent++; + c = (int)(lvalue%10L); + lvalue /= 10; + } + digits[digitno] = (char)(c+'0'); } - while ( lvalue != 0L ){ - digits[digitno--] = (char)(c+'0'); - decExponent++; - c = (int)(lvalue%10L); - lvalue /= 10; - } - digits[digitno] = (char)(c+'0'); + this.decExponent = decExponent+1; + this.firstDigitIndex = digitno; + this.nDigits = this.digits.length - digitno; } - char result []; - ndigits -= digitno; - result = new char[ ndigits ]; - System.arraycopy( digits, digitno, result, 0, ndigits ); - this.digits = result; - this.decExponent = decExponent+1; - this.nDigits = ndigits; - } - // - // add one to the least significant digit. - // in the unlikely event there is a carry out, - // deal with it. - // assert that this will only happen where there - // is only one digit, e.g. (float)1e-44 seems to do it. - // - private void - roundup(){ - int i; - int q = digits[ i = (nDigits-1)]; - if ( q == '9' ){ - while ( q == '9' && i > 0 ){ - digits[i] = '0'; - q = digits[--i]; - } - if ( q == '9' ){ - // carryout! High-order 1, rest 0s, larger exp. - decExponent += 1; - digits[0] = '1'; - return; - } - // else fall through. - } - digits[i] = (char)(q+1); - decimalDigitsRoundedUp = true; - } + private void dtoa( int binExp, long fractBits, int nSignificantBits, boolean isCompatibleFormat) + { + assert fractBits > 0 ; // fractBits here can't be zero or negative + assert (fractBits & FRACT_HOB)!=0 ; // Hi-order bit should be set + // Examine number. Determine if it is an easy case, + // which we can do pretty trivially using float/long conversion, + // or whether we must do real work. + final int tailZeros = Long.numberOfTrailingZeros(fractBits); - public boolean digitsRoundedUp() { - return decimalDigitsRoundedUp; - } + // number of significant bits of fractBits; + final int nFractBits = EXP_SHIFT+1-tailZeros; - /* - * FIRST IMPORTANT CONSTRUCTOR: DOUBLE - */ - public FloatingDecimal( double d ) - { - long dBits = Double.doubleToLongBits( d ); - long fractBits; - int binExp; - int nSignificantBits; + // reset flags to default values as dtoa() does not always set these + // flags and a prior call to dtoa() might have set them to incorrect + // values with respect to the current state. + decimalDigitsRoundedUp = false; + exactDecimalConversion = false; - // discover and delete sign - if ( (dBits&signMask) != 0 ){ - isNegative = true; - dBits ^= signMask; - } else { - isNegative = false; - } - // Begin to unpack - // Discover obvious special cases of NaN and Infinity. - binExp = (int)( (dBits&expMask) >> expShift ); - fractBits = dBits&fractMask; - if ( binExp == (int)(expMask>>expShift) ) { - isExceptional = true; - if ( fractBits == 0L ){ - digits = infinity; - } else { - digits = notANumber; - isNegative = false; // NaN has no sign! - } - nDigits = digits.length; - return; - } - isExceptional = false; - // Finish unpacking - // Normalize denormalized numbers. - // Insert assumed high-order bit for normalized numbers. - // Subtract exponent bias. - if ( binExp == 0 ){ - if ( fractBits == 0L ){ - // not a denorm, just a 0! - decExponent = 0; - digits = zero; - nDigits = 1; - return; - } - while ( (fractBits&fractHOB) == 0L ){ - fractBits <<= 1; - binExp -= 1; - } - nSignificantBits = expShift + binExp +1; // recall binExp is - shift count. - binExp += 1; - } else { - fractBits |= fractHOB; - nSignificantBits = expShift+1; - } - binExp -= expBias; - // call the routine that actually does all the hard work. - dtoa( binExp, fractBits, nSignificantBits ); - } - - /* - * SECOND IMPORTANT CONSTRUCTOR: SINGLE - */ - public FloatingDecimal( float f ) - { - int fBits = Float.floatToIntBits( f ); - int fractBits; - int binExp; - int nSignificantBits; - - // discover and delete sign - if ( (fBits&singleSignMask) != 0 ){ - isNegative = true; - fBits ^= singleSignMask; - } else { - isNegative = false; - } - // Begin to unpack - // Discover obvious special cases of NaN and Infinity. - binExp = (fBits&singleExpMask) >> singleExpShift; - fractBits = fBits&singleFractMask; - if ( binExp == (singleExpMask>>singleExpShift) ) { - isExceptional = true; - if ( fractBits == 0L ){ - digits = infinity; - } else { - digits = notANumber; - isNegative = false; // NaN has no sign! - } - nDigits = digits.length; - return; - } - isExceptional = false; - // Finish unpacking - // Normalize denormalized numbers. - // Insert assumed high-order bit for normalized numbers. - // Subtract exponent bias. - if ( binExp == 0 ){ - if ( fractBits == 0 ){ - // not a denorm, just a 0! - decExponent = 0; - digits = zero; - nDigits = 1; - return; - } - while ( (fractBits&singleFractHOB) == 0 ){ - fractBits <<= 1; - binExp -= 1; - } - nSignificantBits = singleExpShift + binExp +1; // recall binExp is - shift count. - binExp += 1; - } else { - fractBits |= singleFractHOB; - nSignificantBits = singleExpShift+1; - } - binExp -= singleExpBias; - // call the routine that actually does all the hard work. - dtoa( binExp, ((long)fractBits)<<(expShift-singleExpShift), nSignificantBits ); - } - - private void - dtoa( int binExp, long fractBits, int nSignificantBits ) - { - int nFractBits; // number of significant bits of fractBits; - int nTinyBits; // number of these to the right of the point. - int decExp; - - // Examine number. Determine if it is an easy case, - // which we can do pretty trivially using float/long conversion, - // or whether we must do real work. - nFractBits = countBits( fractBits ); - nTinyBits = Math.max( 0, nFractBits - binExp - 1 ); - if ( binExp <= maxSmallBinExp && binExp >= minSmallBinExp ){ - // Look more closely at the number to decide if, - // with scaling by 10^nTinyBits, the result will fit in - // a long. - if ( (nTinyBits < long5pow.length) && ((nFractBits + n5bits[nTinyBits]) < 64 ) ){ - /* - * We can do this: - * take the fraction bits, which are normalized. - * (a) nTinyBits == 0: Shift left or right appropriately - * to align the binary point at the extreme right, i.e. - * where a long int point is expected to be. The integer - * result is easily converted to a string. - * (b) nTinyBits > 0: Shift right by expShift-nFractBits, - * which effectively converts to long and scales by - * 2^nTinyBits. Then multiply by 5^nTinyBits to - * complete the scaling. We know this won't overflow - * because we just counted the number of bits necessary - * in the result. The integer you get from this can - * then be converted to a string pretty easily. - */ - long halfULP; - if ( nTinyBits == 0 ) { - if ( binExp > nSignificantBits ){ - halfULP = 1L << ( binExp-nSignificantBits-1); - } else { - halfULP = 0L; + // number of significant bits to the right of the point. + int nTinyBits = Math.max( 0, nFractBits - binExp - 1 ); + if ( binExp <= MAX_SMALL_BIN_EXP && binExp >= MIN_SMALL_BIN_EXP ){ + // Look more closely at the number to decide if, + // with scaling by 10^nTinyBits, the result will fit in + // a long. + if ( (nTinyBits < FDBigInteger.LONG_5_POW.length) && ((nFractBits + N_5_BITS[nTinyBits]) < 64 ) ){ + // + // We can do this: + // take the fraction bits, which are normalized. + // (a) nTinyBits == 0: Shift left or right appropriately + // to align the binary point at the extreme right, i.e. + // where a long int point is expected to be. The integer + // result is easily converted to a string. + // (b) nTinyBits > 0: Shift right by EXP_SHIFT-nFractBits, + // which effectively converts to long and scales by + // 2^nTinyBits. Then multiply by 5^nTinyBits to + // complete the scaling. We know this won't overflow + // because we just counted the number of bits necessary + // in the result. The integer you get from this can + // then be converted to a string pretty easily. + // + if ( nTinyBits == 0 ) { + int insignificant; + if ( binExp > nSignificantBits ){ + insignificant = insignificantDigitsForPow2(binExp-nSignificantBits-1); + } else { + insignificant = 0; + } + if ( binExp >= EXP_SHIFT ){ + fractBits <<= (binExp-EXP_SHIFT); + } else { + fractBits >>>= (EXP_SHIFT-binExp) ; + } + developLongDigits( 0, fractBits, insignificant ); + return; } - if ( binExp >= expShift ){ - fractBits <<= (binExp-expShift); + // + // The following causes excess digits to be printed + // out in the single-float case. Our manipulation of + // halfULP here is apparently not correct. If we + // better understand how this works, perhaps we can + // use this special case again. But for the time being, + // we do not. + // else { + // fractBits >>>= EXP_SHIFT+1-nFractBits; + // fractBits//= long5pow[ nTinyBits ]; + // halfULP = long5pow[ nTinyBits ] >> (1+nSignificantBits-nFractBits); + // developLongDigits( -nTinyBits, fractBits, insignificantDigits(halfULP) ); + // return; + // } + // + } + } + // + // This is the hard case. We are going to compute large positive + // integers B and S and integer decExp, s.t. + // d = ( B / S )// 10^decExp + // 1 <= B / S < 10 + // Obvious choices are: + // decExp = floor( log10(d) ) + // B = d// 2^nTinyBits// 10^max( 0, -decExp ) + // S = 10^max( 0, decExp)// 2^nTinyBits + // (noting that nTinyBits has already been forced to non-negative) + // I am also going to compute a large positive integer + // M = (1/2^nSignificantBits)// 2^nTinyBits// 10^max( 0, -decExp ) + // i.e. M is (1/2) of the ULP of d, scaled like B. + // When we iterate through dividing B/S and picking off the + // quotient bits, we will know when to stop when the remainder + // is <= M. + // + // We keep track of powers of 2 and powers of 5. + // + int decExp = estimateDecExp(fractBits,binExp); + int B2, B5; // powers of 2 and powers of 5, respectively, in B + int S2, S5; // powers of 2 and powers of 5, respectively, in S + int M2, M5; // powers of 2 and powers of 5, respectively, in M + + B5 = Math.max( 0, -decExp ); + B2 = B5 + nTinyBits + binExp; + + S5 = Math.max( 0, decExp ); + S2 = S5 + nTinyBits; + + M5 = B5; + M2 = B2 - nSignificantBits; + + // + // the long integer fractBits contains the (nFractBits) interesting + // bits from the mantissa of d ( hidden 1 added if necessary) followed + // by (EXP_SHIFT+1-nFractBits) zeros. In the interest of compactness, + // I will shift out those zeros before turning fractBits into a + // FDBigInteger. The resulting whole number will be + // d * 2^(nFractBits-1-binExp). + // + fractBits >>>= tailZeros; + B2 -= nFractBits-1; + int common2factor = Math.min( B2, S2 ); + B2 -= common2factor; + S2 -= common2factor; + M2 -= common2factor; + + // + // HACK!! For exact powers of two, the next smallest number + // is only half as far away as we think (because the meaning of + // ULP changes at power-of-two bounds) for this reason, we + // hack M2. Hope this works. + // + if ( nFractBits == 1 ) { + M2 -= 1; + } + + if ( M2 < 0 ){ + // oops. + // since we cannot scale M down far enough, + // we must scale the other values up. + B2 -= M2; + S2 -= M2; + M2 = 0; + } + // + // Construct, Scale, iterate. + // Some day, we'll write a stopping test that takes + // account of the asymmetry of the spacing of floating-point + // numbers below perfect powers of 2 + // 26 Sept 96 is not that day. + // So we use a symmetric test. + // + int ndigit = 0; + boolean low, high; + long lowDigitDifference; + int q; + + // + // Detect the special cases where all the numbers we are about + // to compute will fit in int or long integers. + // In these cases, we will avoid doing FDBigInteger arithmetic. + // We use the same algorithms, except that we "normalize" + // our FDBigIntegers before iterating. This is to make division easier, + // as it makes our fist guess (quotient of high-order words) + // more accurate! + // + // Some day, we'll write a stopping test that takes + // account of the asymmetry of the spacing of floating-point + // numbers below perfect powers of 2 + // 26 Sept 96 is not that day. + // So we use a symmetric test. + // + // binary digits needed to represent B, approx. + int Bbits = nFractBits + B2 + (( B5 < N_5_BITS.length )? N_5_BITS[B5] : ( B5*3 )); + + // binary digits needed to represent 10*S, approx. + int tenSbits = S2+1 + (( (S5+1) < N_5_BITS.length )? N_5_BITS[(S5+1)] : ( (S5+1)*3 )); + if ( Bbits < 64 && tenSbits < 64){ + if ( Bbits < 32 && tenSbits < 32){ + // wa-hoo! They're all ints! + int b = ((int)fractBits * FDBigInteger.SMALL_5_POW[B5] ) << B2; + int s = FDBigInteger.SMALL_5_POW[S5] << S2; + int m = FDBigInteger.SMALL_5_POW[M5] << M2; + int tens = s * 10; + // + // Unroll the first iteration. If our decExp estimate + // was too high, our first quotient will be zero. In this + // case, we discard it and decrement decExp. + // + ndigit = 0; + q = b / s; + b = 10 * ( b % s ); + m *= 10; + low = (b < m ); + high = (b+m > tens ); + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; } else { - fractBits >>>= (expShift-binExp) ; + digits[ndigit++] = (char)('0' + q); } - developLongDigits( 0, fractBits, halfULP ); + // + // HACK! Java spec sez that we always have at least + // one digit after the . in either F- or E-form output. + // Thus we will need more than one digit if we're using + // E-form + // + if ( !isCompatibleFormat ||decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = b / s; + b = 10 * ( b % s ); + m *= 10; + assert q < 10 : q; // excessively large digit + if ( m > 0L ){ + low = (b < m ); + high = (b+m > tens ); + } else { + // hack -- m might overflow! + // in this case, it is certainly > b, + // which won't + // and b+m > tens, too, since that has overflowed + // either! + low = true; + high = true; + } + digits[ndigit++] = (char)('0' + q); + } + lowDigitDifference = (b<<1) - tens; + exactDecimalConversion = (b == 0); + } else { + // still good! they're all longs! + long b = (fractBits * FDBigInteger.LONG_5_POW[B5] ) << B2; + long s = FDBigInteger.LONG_5_POW[S5] << S2; + long m = FDBigInteger.LONG_5_POW[M5] << M2; + long tens = s * 10L; + // + // Unroll the first iteration. If our decExp estimate + // was too high, our first quotient will be zero. In this + // case, we discard it and decrement decExp. + // + ndigit = 0; + q = (int) ( b / s ); + b = 10L * ( b % s ); + m *= 10L; + low = (b < m ); + high = (b+m > tens ); + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; + } else { + digits[ndigit++] = (char)('0' + q); + } + // + // HACK! Java spec sez that we always have at least + // one digit after the . in either F- or E-form output. + // Thus we will need more than one digit if we're using + // E-form + // + if ( !isCompatibleFormat || decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = (int) ( b / s ); + b = 10 * ( b % s ); + m *= 10; + assert q < 10 : q; // excessively large digit + if ( m > 0L ){ + low = (b < m ); + high = (b+m > tens ); + } else { + // hack -- m might overflow! + // in this case, it is certainly > b, + // which won't + // and b+m > tens, too, since that has overflowed + // either! + low = true; + high = true; + } + digits[ndigit++] = (char)('0' + q); + } + lowDigitDifference = (b<<1) - tens; + exactDecimalConversion = (b == 0); + } + } else { + // + // We really must do FDBigInteger arithmetic. + // Fist, construct our FDBigInteger initial values. + // + FDBigInteger Sval = FDBigInteger.valueOfPow52(S5, S2); + int shiftBias = Sval.getNormalizationBias(); + Sval = Sval.leftShift(shiftBias); // normalize so that division works better + + FDBigInteger Bval = FDBigInteger.valueOfMulPow52(fractBits, B5, B2 + shiftBias); + FDBigInteger Mval = FDBigInteger.valueOfPow52(M5 + 1, M2 + shiftBias + 1); + + FDBigInteger tenSval = FDBigInteger.valueOfPow52(S5 + 1, S2 + shiftBias + 1); //Sval.mult( 10 ); + // + // Unroll the first iteration. If our decExp estimate + // was too high, our first quotient will be zero. In this + // case, we discard it and decrement decExp. + // + ndigit = 0; + q = Bval.quoRemIteration( Sval ); + low = (Bval.cmp( Mval ) < 0); + high = tenSval.addAndCmp(Bval,Mval)<=0; + + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; + } else { + digits[ndigit++] = (char)('0' + q); + } + // + // HACK! Java spec sez that we always have at least + // one digit after the . in either F- or E-form output. + // Thus we will need more than one digit if we're using + // E-form + // + if (!isCompatibleFormat || decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = Bval.quoRemIteration( Sval ); + assert q < 10 : q; // excessively large digit + Mval = Mval.multBy10(); //Mval = Mval.mult( 10 ); + low = (Bval.cmp( Mval ) < 0); + high = tenSval.addAndCmp(Bval,Mval)<=0; + digits[ndigit++] = (char)('0' + q); + } + if ( high && low ){ + Bval = Bval.leftShift(1); + lowDigitDifference = Bval.cmp(tenSval); + } else { + lowDigitDifference = 0L; // this here only for flow analysis! + } + exactDecimalConversion = (Bval.cmp( FDBigInteger.ZERO ) == 0); + } + this.decExponent = decExp+1; + this.firstDigitIndex = 0; + this.nDigits = ndigit; + // + // Last digit gets rounded based on stopping condition. + // + if ( high ){ + if ( low ){ + if ( lowDigitDifference == 0L ){ + // it's a tie! + // choose based on which digits we like. + if ( (digits[firstDigitIndex+nDigits-1]&1) != 0 ) { + roundup(); + } + } else if ( lowDigitDifference > 0 ){ + roundup(); + } + } else { + roundup(); + } + } + } + + // add one to the least significant digit. + // in the unlikely event there is a carry out, deal with it. + // assert that this will only happen where there + // is only one digit, e.g. (float)1e-44 seems to do it. + // + private void roundup() { + int i = (firstDigitIndex + nDigits - 1); + int q = digits[i]; + if (q == '9') { + while (q == '9' && i > firstDigitIndex) { + digits[i] = '0'; + q = digits[--i]; + } + if (q == '9') { + // carryout! High-order 1, rest 0s, larger exp. + decExponent += 1; + digits[firstDigitIndex] = '1'; return; } - /* - * The following causes excess digits to be printed - * out in the single-float case. Our manipulation of - * halfULP here is apparently not correct. If we - * better understand how this works, perhaps we can - * use this special case again. But for the time being, - * we do not. - * else { - * fractBits >>>= expShift+1-nFractBits; - * fractBits *= long5pow[ nTinyBits ]; - * halfULP = long5pow[ nTinyBits ] >> (1+nSignificantBits-nFractBits); - * developLongDigits( -nTinyBits, fractBits, halfULP ); - * return; - * } - */ + // else fall through. } + digits[i] = (char) (q + 1); + decimalDigitsRoundedUp = true; } - /* - * This is the hard case. We are going to compute large positive - * integers B and S and integer decExp, s.t. - * d = ( B / S ) * 10^decExp - * 1 <= B / S < 10 - * Obvious choices are: - * decExp = floor( log10(d) ) - * B = d * 2^nTinyBits * 10^max( 0, -decExp ) - * S = 10^max( 0, decExp) * 2^nTinyBits - * (noting that nTinyBits has already been forced to non-negative) - * I am also going to compute a large positive integer - * M = (1/2^nSignificantBits) * 2^nTinyBits * 10^max( 0, -decExp ) - * i.e. M is (1/2) of the ULP of d, scaled like B. - * When we iterate through dividing B/S and picking off the - * quotient bits, we will know when to stop when the remainder - * is <= M. - * - * We keep track of powers of 2 and powers of 5. - */ - /* + /** * Estimate decimal exponent. (If it is small-ish, * we could double-check.) * @@ -630,324 +815,108 @@ public class FloatingDecimal{ * and so we can estimate * log10(d) ~=~ log10(d2) + binExp * log10(2) * take the floor and call it decExp. - * FIXME -- use more precise constants here. It costs no more. */ - double d2 = Double.longBitsToDouble( - expOne | ( fractBits &~ fractHOB ) ); - decExp = (int)Math.floor( - (d2-1.5D)*0.289529654D + 0.176091259 + (double)binExp * 0.301029995663981 ); - int B2, B5; // powers of 2 and powers of 5, respectively, in B - int S2, S5; // powers of 2 and powers of 5, respectively, in S - int M2, M5; // powers of 2 and powers of 5, respectively, in M - int Bbits; // binary digits needed to represent B, approx. - int tenSbits; // binary digits needed to represent 10*S, approx. - FDBigInt Sval, Bval, Mval; - - B5 = Math.max( 0, -decExp ); - B2 = B5 + nTinyBits + binExp; - - S5 = Math.max( 0, decExp ); - S2 = S5 + nTinyBits; - - M5 = B5; - M2 = B2 - nSignificantBits; - - /* - * the long integer fractBits contains the (nFractBits) interesting - * bits from the mantissa of d ( hidden 1 added if necessary) followed - * by (expShift+1-nFractBits) zeros. In the interest of compactness, - * I will shift out those zeros before turning fractBits into a - * FDBigInt. The resulting whole number will be - * d * 2^(nFractBits-1-binExp). - */ - fractBits >>>= (expShift+1-nFractBits); - B2 -= nFractBits-1; - int common2factor = Math.min( B2, S2 ); - B2 -= common2factor; - S2 -= common2factor; - M2 -= common2factor; - - /* - * HACK!! For exact powers of two, the next smallest number - * is only half as far away as we think (because the meaning of - * ULP changes at power-of-two bounds) for this reason, we - * hack M2. Hope this works. - */ - if ( nFractBits == 1 ) - M2 -= 1; - - if ( M2 < 0 ){ - // oops. - // since we cannot scale M down far enough, - // we must scale the other values up. - B2 -= M2; - S2 -= M2; - M2 = 0; - } - /* - * Construct, Scale, iterate. - * Some day, we'll write a stopping test that takes - * account of the asymmetry of the spacing of floating-point - * numbers below perfect powers of 2 - * 26 Sept 96 is not that day. - * So we use a symmetric test. - */ - char digits[] = this.digits = new char[18]; - int ndigit = 0; - boolean low, high; - long lowDigitDifference; - int q; - - /* - * Detect the special cases where all the numbers we are about - * to compute will fit in int or long integers. - * In these cases, we will avoid doing FDBigInt arithmetic. - * We use the same algorithms, except that we "normalize" - * our FDBigInts before iterating. This is to make division easier, - * as it makes our fist guess (quotient of high-order words) - * more accurate! - * - * Some day, we'll write a stopping test that takes - * account of the asymmetry of the spacing of floating-point - * numbers below perfect powers of 2 - * 26 Sept 96 is not that day. - * So we use a symmetric test. - */ - Bbits = nFractBits + B2 + (( B5 < n5bits.length )? n5bits[B5] : ( B5*3 )); - tenSbits = S2+1 + (( (S5+1) < n5bits.length )? n5bits[(S5+1)] : ( (S5+1)*3 )); - if ( Bbits < 64 && tenSbits < 64){ - if ( Bbits < 32 && tenSbits < 32){ - // wa-hoo! They're all ints! - int b = ((int)fractBits * small5pow[B5] ) << B2; - int s = small5pow[S5] << S2; - int m = small5pow[M5] << M2; - int tens = s * 10; - /* - * Unroll the first iteration. If our decExp estimate - * was too high, our first quotient will be zero. In this - * case, we discard it and decrement decExp. - */ - ndigit = 0; - q = b / s; - b = 10 * ( b % s ); - m *= 10; - low = (b < m ); - high = (b+m > tens ); - assert q < 10 : q; // excessively large digit - if ( (q == 0) && ! high ){ - // oops. Usually ignore leading zero. - decExp--; - } else { - digits[ndigit++] = (char)('0' + q); - } - /* - * HACK! Java spec sez that we always have at least - * one digit after the . in either F- or E-form output. - * Thus we will need more than one digit if we're using - * E-form - */ - if ( decExp < -3 || decExp >= 8 ){ - high = low = false; - } - while( ! low && ! high ){ - q = b / s; - b = 10 * ( b % s ); - m *= 10; - assert q < 10 : q; // excessively large digit - if ( m > 0L ){ - low = (b < m ); - high = (b+m > tens ); - } else { - // hack -- m might overflow! - // in this case, it is certainly > b, - // which won't - // and b+m > tens, too, since that has overflowed - // either! - low = true; - high = true; - } - digits[ndigit++] = (char)('0' + q); - } - lowDigitDifference = (b<<1) - tens; - exactDecimalConversion = (b == 0); - } else { - // still good! they're all longs! - long b = (fractBits * long5pow[B5] ) << B2; - long s = long5pow[S5] << S2; - long m = long5pow[M5] << M2; - long tens = s * 10L; - /* - * Unroll the first iteration. If our decExp estimate - * was too high, our first quotient will be zero. In this - * case, we discard it and decrement decExp. - */ - ndigit = 0; - q = (int) ( b / s ); - b = 10L * ( b % s ); - m *= 10L; - low = (b < m ); - high = (b+m > tens ); - assert q < 10 : q; // excessively large digit - if ( (q == 0) && ! high ){ - // oops. Usually ignore leading zero. - decExp--; - } else { - digits[ndigit++] = (char)('0' + q); - } - /* - * HACK! Java spec sez that we always have at least - * one digit after the . in either F- or E-form output. - * Thus we will need more than one digit if we're using - * E-form - */ - if ( decExp < -3 || decExp >= 8 ){ - high = low = false; - } - while( ! low && ! high ){ - q = (int) ( b / s ); - b = 10 * ( b % s ); - m *= 10; - assert q < 10 : q; // excessively large digit - if ( m > 0L ){ - low = (b < m ); - high = (b+m > tens ); - } else { - // hack -- m might overflow! - // in this case, it is certainly > b, - // which won't - // and b+m > tens, too, since that has overflowed - // either! - low = true; - high = true; - } - digits[ndigit++] = (char)('0' + q); - } - lowDigitDifference = (b<<1) - tens; - exactDecimalConversion = (b == 0); - } - } else { - FDBigInt ZeroVal = new FDBigInt(0); - FDBigInt tenSval; - int shiftBias; - - /* - * We really must do FDBigInt arithmetic. - * Fist, construct our FDBigInt initial values. - */ - Bval = multPow52( new FDBigInt( fractBits ), B5, B2 ); - Sval = constructPow52( S5, S2 ); - Mval = constructPow52( M5, M2 ); - - - // normalize so that division works better - Bval.lshiftMe( shiftBias = Sval.normalizeMe() ); - Mval.lshiftMe( shiftBias ); - tenSval = Sval.mult( 10 ); - /* - * Unroll the first iteration. If our decExp estimate - * was too high, our first quotient will be zero. In this - * case, we discard it and decrement decExp. - */ - ndigit = 0; - q = Bval.quoRemIteration( Sval ); - Mval = Mval.mult( 10 ); - low = (Bval.cmp( Mval ) < 0); - high = (Bval.add( Mval ).cmp( tenSval ) > 0 ); - assert q < 10 : q; // excessively large digit - if ( (q == 0) && ! high ){ - // oops. Usually ignore leading zero. - decExp--; - } else { - digits[ndigit++] = (char)('0' + q); - } - /* - * HACK! Java spec sez that we always have at least - * one digit after the . in either F- or E-form output. - * Thus we will need more than one digit if we're using - * E-form - */ - if ( decExp < -3 || decExp >= 8 ){ - high = low = false; - } - while( ! low && ! high ){ - q = Bval.quoRemIteration( Sval ); - Mval = Mval.mult( 10 ); - assert q < 10 : q; // excessively large digit - low = (Bval.cmp( Mval ) < 0); - high = (Bval.add( Mval ).cmp( tenSval ) > 0 ); - digits[ndigit++] = (char)('0' + q); - } - if ( high && low ){ - Bval.lshiftMe(1); - lowDigitDifference = Bval.cmp(tenSval); - } else { - lowDigitDifference = 0L; // this here only for flow analysis! - } - exactDecimalConversion = (Bval.cmp( ZeroVal ) == 0); - } - this.decExponent = decExp+1; - this.digits = digits; - this.nDigits = ndigit; - /* - * Last digit gets rounded based on stopping condition. - */ - if ( high ){ - if ( low ){ - if ( lowDigitDifference == 0L ){ - // it's a tie! - // choose based on which digits we like. - if ( (digits[nDigits-1]&1) != 0 ) roundup(); - } else if ( lowDigitDifference > 0 ){ - roundup(); - } - } else { - roundup(); + static int estimateDecExp(long fractBits, int binExp) { + double d2 = Double.longBitsToDouble( EXP_ONE | ( fractBits & DoubleConsts.SIGNIF_BIT_MASK ) ); + double d = (d2-1.5D)*0.289529654D + 0.176091259 + (double)binExp * 0.301029995663981; + long dBits = Double.doubleToRawLongBits(d); //can't be NaN here so use raw + int exponent = (int)((dBits & DoubleConsts.EXP_BIT_MASK) >> EXP_SHIFT) - DoubleConsts.EXP_BIAS; + boolean isNegative = (dBits & DoubleConsts.SIGN_BIT_MASK) != 0; // discover sign + if(exponent>=0 && exponent<52) { // hot path + long mask = DoubleConsts.SIGNIF_BIT_MASK >> exponent; + int r = (int)(( (dBits&DoubleConsts.SIGNIF_BIT_MASK) | FRACT_HOB )>>(EXP_SHIFT-exponent)); + return isNegative ? (((mask & dBits) == 0L ) ? -r : -r-1 ) : r; + } else if (exponent < 0) { + return (((dBits&~DoubleConsts.SIGN_BIT_MASK) == 0) ? 0 : + ( (isNegative) ? -1 : 0) ); + } else { //if (exponent >= 52) + return (int)d; } } - } - public boolean decimalDigitsExact() { - return exactDecimalConversion; - } - - public String - toString(){ - // most brain-dead version - StringBuffer result = new StringBuffer( nDigits+8 ); - if ( isNegative ){ result.append( '-' ); } - if ( isExceptional ){ - result.append( digits, 0, nDigits ); - } else { - result.append( "0."); - result.append( digits, 0, nDigits ); - result.append('e'); - result.append( decExponent ); + private static int insignificantDigits(int insignificant) { + int i; + for ( i = 0; insignificant >= 10L; i++ ) { + insignificant /= 10L; + } + return i; } - return new String(result); - } - public String toJavaFormatString() { - char result[] = perThreadBuffer.get(); - int i = getChars(result); - return new String(result, 0, i); - } + /** + * Calculates + *
        +         * insignificantDigitsForPow2(v) == insignificantDigits(1L<
        +         */
        +        private static int insignificantDigitsForPow2(int p2) {
        +            if(p2>1 && p2 < insignificantDigitsNumber.length) {
        +                return insignificantDigitsNumber[p2];
        +            }
        +            return 0;
        +        }
         
        -    private int getChars(char[] result) {
        -        assert nDigits <= 19 : nDigits; // generous bound on size of nDigits
        -        int i = 0;
        -        if (isNegative) { result[0] = '-'; i = 1; }
        -        if (isExceptional) {
        -            System.arraycopy(digits, 0, result, i, nDigits);
        -            i += nDigits;
        -        } else {
        +        /**
        +         *  If insignificant==(1L << ixd)
        +         *  i = insignificantDigitsNumber[idx] is the same as:
        +         *  int i;
        +         *  for ( i = 0; insignificant >= 10L; i++ )
        +         *         insignificant /= 10L;
        +         */
        +        private static int[] insignificantDigitsNumber = {
        +            0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3,
        +            4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
        +            8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11,
        +            12, 12, 12, 12, 13, 13, 13, 14, 14, 14,
        +            15, 15, 15, 15, 16, 16, 16, 17, 17, 17,
        +            18, 18, 18, 19
        +        };
        +
        +        // approximately ceil( log2( long5pow[i] ) )
        +        private static final int[] N_5_BITS = {
        +                0,
        +                3,
        +                5,
        +                7,
        +                10,
        +                12,
        +                14,
        +                17,
        +                19,
        +                21,
        +                24,
        +                26,
        +                28,
        +                31,
        +                33,
        +                35,
        +                38,
        +                40,
        +                42,
        +                45,
        +                47,
        +                49,
        +                52,
        +                54,
        +                56,
        +                59,
        +                61,
        +        };
        +
        +        private int getChars(char[] result) {
        +            assert nDigits <= 19 : nDigits; // generous bound on size of nDigits
        +            int i = 0;
        +            if (isNegative) {
        +                result[0] = '-';
        +                i = 1;
        +            }
                     if (decExponent > 0 && decExponent < 8) {
                         // print digits.digits.
                         int charLength = Math.min(nDigits, decExponent);
        -                System.arraycopy(digits, 0, result, i, charLength);
        +                System.arraycopy(digits, firstDigitIndex, result, i, charLength);
                         i += charLength;
                         if (charLength < decExponent) {
        -                    charLength = decExponent-charLength;
        -                    System.arraycopy(zero, 0, result, i, charLength);
        +                    charLength = decExponent - charLength;
        +                    Arrays.fill(result,i,i+charLength,'0');
                             i += charLength;
                             result[i++] = '.';
                             result[i++] = '0';
        @@ -955,27 +924,27 @@ public class FloatingDecimal{
                             result[i++] = '.';
                             if (charLength < nDigits) {
                                 int t = nDigits - charLength;
        -                        System.arraycopy(digits, charLength, result, i, t);
        +                        System.arraycopy(digits, firstDigitIndex+charLength, result, i, t);
                                 i += t;
                             } else {
                                 result[i++] = '0';
                             }
                         }
        -            } else if (decExponent <=0 && decExponent > -3) {
        +            } else if (decExponent <= 0 && decExponent > -3) {
                         result[i++] = '0';
                         result[i++] = '.';
                         if (decExponent != 0) {
        -                    System.arraycopy(zero, 0, result, i, -decExponent);
        +                    Arrays.fill(result, i, i-decExponent, '0');
                             i -= decExponent;
                         }
        -                System.arraycopy(digits, 0, result, i, nDigits);
        +                System.arraycopy(digits, firstDigitIndex, result, i, nDigits);
                         i += nDigits;
                     } else {
        -                result[i++] = digits[0];
        +                result[i++] = digits[firstDigitIndex];
                         result[i++] = '.';
                         if (nDigits > 1) {
        -                    System.arraycopy(digits, 1, result, i, nDigits-1);
        -                    i += nDigits-1;
        +                    System.arraycopy(digits, firstDigitIndex+1, result, i, nDigits - 1);
        +                    i += nDigits - 1;
                         } else {
                             result[i++] = '0';
                         }
        @@ -983,48 +952,882 @@ public class FloatingDecimal{
                         int e;
                         if (decExponent <= 0) {
                             result[i++] = '-';
        -                    e = -decExponent+1;
        +                    e = -decExponent + 1;
                         } else {
        -                    e = decExponent-1;
        +                    e = decExponent - 1;
                         }
                         // decExponent has 1, 2, or 3, digits
                         if (e <= 9) {
        -                    result[i++] = (char)(e+'0');
        +                    result[i++] = (char) (e + '0');
                         } else if (e <= 99) {
        -                    result[i++] = (char)(e/10 +'0');
        -                    result[i++] = (char)(e%10 + '0');
        +                    result[i++] = (char) (e / 10 + '0');
        +                    result[i++] = (char) (e % 10 + '0');
                         } else {
        -                    result[i++] = (char)(e/100+'0');
        +                    result[i++] = (char) (e / 100 + '0');
                             e %= 100;
        -                    result[i++] = (char)(e/10+'0');
        -                    result[i++] = (char)(e%10 + '0');
        +                    result[i++] = (char) (e / 10 + '0');
        +                    result[i++] = (char) (e % 10 + '0');
                         }
                     }
        +            return i;
                 }
        -        return i;
        +
             }
         
        -    // Per-thread buffer for string/stringbuffer conversion
        -    private static ThreadLocal perThreadBuffer = new ThreadLocal() {
        -            protected synchronized char[] initialValue() {
        -                return new char[26];
        +    private static final ThreadLocal threadLocalBinaryToASCIIBuffer =
        +            new ThreadLocal() {
        +                @Override
        +                protected BinaryToASCIIBuffer initialValue() {
        +                    return new BinaryToASCIIBuffer();
        +                }
        +            };
        +
        +    private static BinaryToASCIIBuffer getBinaryToASCIIBuffer() {
        +        return threadLocalBinaryToASCIIBuffer.get();
        +    }
        +
        +    /**
        +     * A converter which can process an ASCII String representation
        +     * of a single or double precision floating point value into a
        +     * float or a double.
        +     */
        +    interface ASCIIToBinaryConverter {
        +
        +        double doubleValue();
        +
        +        float floatValue();
        +
        +    }
        +
        +    /**
        +     * A ASCIIToBinaryConverter container for a double.
        +     */
        +    static class PreparedASCIIToBinaryBuffer implements ASCIIToBinaryConverter {
        +        final private double doubleVal;
        +        final private float floatVal;
        +
        +        public PreparedASCIIToBinaryBuffer(double doubleVal, float floatVal) {
        +            this.doubleVal = doubleVal;
        +            this.floatVal = floatVal;
        +        }
        +
        +        @Override
        +        public double doubleValue() {
        +            return doubleVal;
        +        }
        +
        +        @Override
        +        public float floatValue() {
        +            return floatVal;
        +        }
        +    }
        +
        +    static final ASCIIToBinaryConverter A2BC_POSITIVE_INFINITY = new PreparedASCIIToBinaryBuffer(Double.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
        +    static final ASCIIToBinaryConverter A2BC_NEGATIVE_INFINITY = new PreparedASCIIToBinaryBuffer(Double.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY);
        +    static final ASCIIToBinaryConverter A2BC_NOT_A_NUMBER  = new PreparedASCIIToBinaryBuffer(Double.NaN, Float.NaN);
        +    static final ASCIIToBinaryConverter A2BC_POSITIVE_ZERO = new PreparedASCIIToBinaryBuffer(0.0d, 0.0f);
        +    static final ASCIIToBinaryConverter A2BC_NEGATIVE_ZERO = new PreparedASCIIToBinaryBuffer(-0.0d, -0.0f);
        +
        +    /**
        +     * A buffered implementation of ASCIIToBinaryConverter.
        +     */
        +    static class ASCIIToBinaryBuffer implements ASCIIToBinaryConverter {
        +        boolean     isNegative;
        +        int         decExponent;
        +        char        digits[];
        +        int         nDigits;
        +
        +        ASCIIToBinaryBuffer( boolean negSign, int decExponent, char[] digits, int n)
        +        {
        +            this.isNegative = negSign;
        +            this.decExponent = decExponent;
        +            this.digits = digits;
        +            this.nDigits = n;
        +        }
        +
        +        /**
        +         * Takes a FloatingDecimal, which we presumably just scanned in,
        +         * and finds out what its value is, as a double.
        +         *
        +         * AS A SIDE EFFECT, SET roundDir TO INDICATE PREFERRED
        +         * ROUNDING DIRECTION in case the result is really destined
        +         * for a single-precision float.
        +         */
        +        @Override
        +        public double doubleValue() {
        +            int kDigits = Math.min(nDigits, MAX_DECIMAL_DIGITS + 1);
        +            //
        +            // convert the lead kDigits to a long integer.
        +            //
        +            // (special performance hack: start to do it using int)
        +            int iValue = (int) digits[0] - (int) '0';
        +            int iDigits = Math.min(kDigits, INT_DECIMAL_DIGITS);
        +            for (int i = 1; i < iDigits; i++) {
        +                iValue = iValue * 10 + (int) digits[i] - (int) '0';
                     }
        +            long lValue = (long) iValue;
        +            for (int i = iDigits; i < kDigits; i++) {
        +                lValue = lValue * 10L + (long) ((int) digits[i] - (int) '0');
        +            }
        +            double dValue = (double) lValue;
        +            int exp = decExponent - kDigits;
        +            //
        +            // lValue now contains a long integer with the value of
        +            // the first kDigits digits of the number.
        +            // dValue contains the (double) of the same.
        +            //
        +
        +            if (nDigits <= MAX_DECIMAL_DIGITS) {
        +                //
        +                // possibly an easy case.
        +                // We know that the digits can be represented
        +                // exactly. And if the exponent isn't too outrageous,
        +                // the whole thing can be done with one operation,
        +                // thus one rounding error.
        +                // Note that all our constructors trim all leading and
        +                // trailing zeros, so simple values (including zero)
        +                // will always end up here
        +                //
        +                if (exp == 0 || dValue == 0.0) {
        +                    return (isNegative) ? -dValue : dValue; // small floating integer
        +                }
        +                else if (exp >= 0) {
        +                    if (exp <= MAX_SMALL_TEN) {
        +                        //
        +                        // Can get the answer with one operation,
        +                        // thus one roundoff.
        +                        //
        +                        double rValue = dValue * SMALL_10_POW[exp];
        +                        return (isNegative) ? -rValue : rValue;
        +                    }
        +                    int slop = MAX_DECIMAL_DIGITS - kDigits;
        +                    if (exp <= MAX_SMALL_TEN + slop) {
        +                        //
        +                        // We can multiply dValue by 10^(slop)
        +                        // and it is still "small" and exact.
        +                        // Then we can multiply by 10^(exp-slop)
        +                        // with one rounding.
        +                        //
        +                        dValue *= SMALL_10_POW[slop];
        +                        double rValue = dValue * SMALL_10_POW[exp - slop];
        +                        return (isNegative) ? -rValue : rValue;
        +                    }
        +                    //
        +                    // Else we have a hard case with a positive exp.
        +                    //
        +                } else {
        +                    if (exp >= -MAX_SMALL_TEN) {
        +                        //
        +                        // Can get the answer in one division.
        +                        //
        +                        double rValue = dValue / SMALL_10_POW[-exp];
        +                        return (isNegative) ? -rValue : rValue;
        +                    }
        +                    //
        +                    // Else we have a hard case with a negative exp.
        +                    //
        +                }
        +            }
        +
        +            //
        +            // Harder cases:
        +            // The sum of digits plus exponent is greater than
        +            // what we think we can do with one error.
        +            //
        +            // Start by approximating the right answer by,
        +            // naively, scaling by powers of 10.
        +            //
        +            if (exp > 0) {
        +                if (decExponent > MAX_DECIMAL_EXPONENT + 1) {
        +                    //
        +                    // Lets face it. This is going to be
        +                    // Infinity. Cut to the chase.
        +                    //
        +                    return (isNegative) ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        +                }
        +                if ((exp & 15) != 0) {
        +                    dValue *= SMALL_10_POW[exp & 15];
        +                }
        +                if ((exp >>= 4) != 0) {
        +                    int j;
        +                    for (j = 0; exp > 1; j++, exp >>= 1) {
        +                        if ((exp & 1) != 0) {
        +                            dValue *= BIG_10_POW[j];
        +                        }
        +                    }
        +                    //
        +                    // The reason for the weird exp > 1 condition
        +                    // in the above loop was so that the last multiply
        +                    // would get unrolled. We handle it here.
        +                    // It could overflow.
        +                    //
        +                    double t = dValue * BIG_10_POW[j];
        +                    if (Double.isInfinite(t)) {
        +                        //
        +                        // It did overflow.
        +                        // Look more closely at the result.
        +                        // If the exponent is just one too large,
        +                        // then use the maximum finite as our estimate
        +                        // value. Else call the result infinity
        +                        // and punt it.
        +                        // ( I presume this could happen because
        +                        // rounding forces the result here to be
        +                        // an ULP or two larger than
        +                        // Double.MAX_VALUE ).
        +                        //
        +                        t = dValue / 2.0;
        +                        t *= BIG_10_POW[j];
        +                        if (Double.isInfinite(t)) {
        +                            return (isNegative) ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        +                        }
        +                        t = Double.MAX_VALUE;
        +                    }
        +                    dValue = t;
        +                }
        +            } else if (exp < 0) {
        +                exp = -exp;
        +                if (decExponent < MIN_DECIMAL_EXPONENT - 1) {
        +                    //
        +                    // Lets face it. This is going to be
        +                    // zero. Cut to the chase.
        +                    //
        +                    return (isNegative) ? -0.0 : 0.0;
        +                }
        +                if ((exp & 15) != 0) {
        +                    dValue /= SMALL_10_POW[exp & 15];
        +                }
        +                if ((exp >>= 4) != 0) {
        +                    int j;
        +                    for (j = 0; exp > 1; j++, exp >>= 1) {
        +                        if ((exp & 1) != 0) {
        +                            dValue *= TINY_10_POW[j];
        +                        }
        +                    }
        +                    //
        +                    // The reason for the weird exp > 1 condition
        +                    // in the above loop was so that the last multiply
        +                    // would get unrolled. We handle it here.
        +                    // It could underflow.
        +                    //
        +                    double t = dValue * TINY_10_POW[j];
        +                    if (t == 0.0) {
        +                        //
        +                        // It did underflow.
        +                        // Look more closely at the result.
        +                        // If the exponent is just one too small,
        +                        // then use the minimum finite as our estimate
        +                        // value. Else call the result 0.0
        +                        // and punt it.
        +                        // ( I presume this could happen because
        +                        // rounding forces the result here to be
        +                        // an ULP or two less than
        +                        // Double.MIN_VALUE ).
        +                        //
        +                        t = dValue * 2.0;
        +                        t *= TINY_10_POW[j];
        +                        if (t == 0.0) {
        +                            return (isNegative) ? -0.0 : 0.0;
        +                        }
        +                        t = Double.MIN_VALUE;
        +                    }
        +                    dValue = t;
        +                }
        +            }
        +
        +            //
        +            // dValue is now approximately the result.
        +            // The hard part is adjusting it, by comparison
        +            // with FDBigInteger arithmetic.
        +            // Formulate the EXACT big-number result as
        +            // bigD0 * 10^exp
        +            //
        +            if (nDigits > MAX_NDIGITS) {
        +                nDigits = MAX_NDIGITS + 1;
        +                digits[MAX_NDIGITS] = '1';
        +            }
        +            FDBigInteger bigD0 = new FDBigInteger(lValue, digits, kDigits, nDigits);
        +            exp = decExponent - nDigits;
        +
        +            long ieeeBits = Double.doubleToRawLongBits(dValue); // IEEE-754 bits of double candidate
        +            final int B5 = Math.max(0, -exp); // powers of 5 in bigB, value is not modified inside correctionLoop
        +            final int D5 = Math.max(0, exp); // powers of 5 in bigD, value is not modified inside correctionLoop
        +            bigD0 = bigD0.multByPow52(D5, 0);
        +            bigD0.makeImmutable();   // prevent bigD0 modification inside correctionLoop
        +            FDBigInteger bigD = null;
        +            int prevD2 = 0;
        +
        +            correctionLoop:
        +            while (true) {
        +                // here ieeeBits can't be NaN, Infinity or zero
        +                int binexp = (int) (ieeeBits >>> EXP_SHIFT);
        +                long bigBbits = ieeeBits & DoubleConsts.SIGNIF_BIT_MASK;
        +                if (binexp > 0) {
        +                    bigBbits |= FRACT_HOB;
        +                } else { // Normalize denormalized numbers.
        +                    assert bigBbits != 0L : bigBbits; // doubleToBigInt(0.0)
        +                    int leadingZeros = Long.numberOfLeadingZeros(bigBbits);
        +                    int shift = leadingZeros - (63 - EXP_SHIFT);
        +                    bigBbits <<= shift;
        +                    binexp = 1 - shift;
        +                }
        +                binexp -= DoubleConsts.EXP_BIAS;
        +                int lowOrderZeros = Long.numberOfTrailingZeros(bigBbits);
        +                bigBbits >>>= lowOrderZeros;
        +                final int bigIntExp = binexp - EXP_SHIFT + lowOrderZeros;
        +                final int bigIntNBits = EXP_SHIFT + 1 - lowOrderZeros;
        +
        +                //
        +                // Scale bigD, bigB appropriately for
        +                // big-integer operations.
        +                // Naively, we multiply by powers of ten
        +                // and powers of two. What we actually do
        +                // is keep track of the powers of 5 and
        +                // powers of 2 we would use, then factor out
        +                // common divisors before doing the work.
        +                //
        +                int B2 = B5; // powers of 2 in bigB
        +                int D2 = D5; // powers of 2 in bigD
        +                int Ulp2;   // powers of 2 in halfUlp.
        +                if (bigIntExp >= 0) {
        +                    B2 += bigIntExp;
        +                } else {
        +                    D2 -= bigIntExp;
        +                }
        +                Ulp2 = B2;
        +                // shift bigB and bigD left by a number s. t.
        +                // halfUlp is still an integer.
        +                int hulpbias;
        +                if (binexp <= -DoubleConsts.EXP_BIAS) {
        +                    // This is going to be a denormalized number
        +                    // (if not actually zero).
        +                    // half an ULP is at 2^-(DoubleConsts.EXP_BIAS+EXP_SHIFT+1)
        +                    hulpbias = binexp + lowOrderZeros + DoubleConsts.EXP_BIAS;
        +                } else {
        +                    hulpbias = 1 + lowOrderZeros;
        +                }
        +                B2 += hulpbias;
        +                D2 += hulpbias;
        +                // if there are common factors of 2, we might just as well
        +                // factor them out, as they add nothing useful.
        +                int common2 = Math.min(B2, Math.min(D2, Ulp2));
        +                B2 -= common2;
        +                D2 -= common2;
        +                Ulp2 -= common2;
        +                // do multiplications by powers of 5 and 2
        +                FDBigInteger bigB = FDBigInteger.valueOfMulPow52(bigBbits, B5, B2);
        +                if (bigD == null || prevD2 != D2) {
        +                    bigD = bigD0.leftShift(D2);
        +                    prevD2 = D2;
        +                }
        +                //
        +                // to recap:
        +                // bigB is the scaled-big-int version of our floating-point
        +                // candidate.
        +                // bigD is the scaled-big-int version of the exact value
        +                // as we understand it.
        +                // halfUlp is 1/2 an ulp of bigB, except for special cases
        +                // of exact powers of 2
        +                //
        +                // the plan is to compare bigB with bigD, and if the difference
        +                // is less than halfUlp, then we're satisfied. Otherwise,
        +                // use the ratio of difference to halfUlp to calculate a fudge
        +                // factor to add to the floating value, then go 'round again.
        +                //
        +                FDBigInteger diff;
        +                int cmpResult;
        +                boolean overvalue;
        +                if ((cmpResult = bigB.cmp(bigD)) > 0) {
        +                    overvalue = true; // our candidate is too big.
        +                    diff = bigB.leftInplaceSub(bigD); // bigB is not user further - reuse
        +                    if ((bigIntNBits == 1) && (bigIntExp > -DoubleConsts.EXP_BIAS + 1)) {
        +                        // candidate is a normalized exact power of 2 and
        +                        // is too big (larger than Double.MIN_NORMAL). We will be subtracting.
        +                        // For our purposes, ulp is the ulp of the
        +                        // next smaller range.
        +                        Ulp2 -= 1;
        +                        if (Ulp2 < 0) {
        +                            // rats. Cannot de-scale ulp this far.
        +                            // must scale diff in other direction.
        +                            Ulp2 = 0;
        +                            diff = diff.leftShift(1);
        +                        }
        +                    }
        +                } else if (cmpResult < 0) {
        +                    overvalue = false; // our candidate is too small.
        +                    diff = bigD.rightInplaceSub(bigB); // bigB is not user further - reuse
        +                } else {
        +                    // the candidate is exactly right!
        +                    // this happens with surprising frequency
        +                    break correctionLoop;
        +                }
        +                cmpResult = diff.cmpPow52(B5, Ulp2);
        +                if ((cmpResult) < 0) {
        +                    // difference is small.
        +                    // this is close enough
        +                    break correctionLoop;
        +                } else if (cmpResult == 0) {
        +                    // difference is exactly half an ULP
        +                    // round to some other value maybe, then finish
        +                    if ((ieeeBits & 1) != 0) { // half ties to even
        +                        ieeeBits += overvalue ? -1 : 1; // nextDown or nextUp
        +                    }
        +                    break correctionLoop;
        +                } else {
        +                    // difference is non-trivial.
        +                    // could scale addend by ratio of difference to
        +                    // halfUlp here, if we bothered to compute that difference.
        +                    // Most of the time ( I hope ) it is about 1 anyway.
        +                    ieeeBits += overvalue ? -1 : 1; // nextDown or nextUp
        +                    if (ieeeBits == 0 || ieeeBits == DoubleConsts.EXP_BIT_MASK) { // 0.0 or Double.POSITIVE_INFINITY
        +                        break correctionLoop; // oops. Fell off end of range.
        +                    }
        +                    continue; // try again.
        +                }
        +
        +            }
        +            if (isNegative) {
        +                ieeeBits |= DoubleConsts.SIGN_BIT_MASK;
        +            }
        +            return Double.longBitsToDouble(ieeeBits);
        +        }
        +
        +        /**
        +         * Takes a FloatingDecimal, which we presumably just scanned in,
        +         * and finds out what its value is, as a float.
        +         * This is distinct from doubleValue() to avoid the extremely
        +         * unlikely case of a double rounding error, wherein the conversion
        +         * to double has one rounding error, and the conversion of that double
        +         * to a float has another rounding error, IN THE WRONG DIRECTION,
        +         * ( because of the preference to a zero low-order bit ).
        +         */
        +        @Override
        +        public float floatValue() {
        +            int kDigits = Math.min(nDigits, SINGLE_MAX_DECIMAL_DIGITS + 1);
        +            //
        +            // convert the lead kDigits to an integer.
        +            //
        +            int iValue = (int) digits[0] - (int) '0';
        +            for (int i = 1; i < kDigits; i++) {
        +                iValue = iValue * 10 + (int) digits[i] - (int) '0';
        +            }
        +            float fValue = (float) iValue;
        +            int exp = decExponent - kDigits;
        +            //
        +            // iValue now contains an integer with the value of
        +            // the first kDigits digits of the number.
        +            // fValue contains the (float) of the same.
        +            //
        +
        +            if (nDigits <= SINGLE_MAX_DECIMAL_DIGITS) {
        +                //
        +                // possibly an easy case.
        +                // We know that the digits can be represented
        +                // exactly. And if the exponent isn't too outrageous,
        +                // the whole thing can be done with one operation,
        +                // thus one rounding error.
        +                // Note that all our constructors trim all leading and
        +                // trailing zeros, so simple values (including zero)
        +                // will always end up here.
        +                //
        +                if (exp == 0 || fValue == 0.0f) {
        +                    return (isNegative) ? -fValue : fValue; // small floating integer
        +                } else if (exp >= 0) {
        +                    if (exp <= SINGLE_MAX_SMALL_TEN) {
        +                        //
        +                        // Can get the answer with one operation,
        +                        // thus one roundoff.
        +                        //
        +                        fValue *= SINGLE_SMALL_10_POW[exp];
        +                        return (isNegative) ? -fValue : fValue;
        +                    }
        +                    int slop = SINGLE_MAX_DECIMAL_DIGITS - kDigits;
        +                    if (exp <= SINGLE_MAX_SMALL_TEN + slop) {
        +                        //
        +                        // We can multiply fValue by 10^(slop)
        +                        // and it is still "small" and exact.
        +                        // Then we can multiply by 10^(exp-slop)
        +                        // with one rounding.
        +                        //
        +                        fValue *= SINGLE_SMALL_10_POW[slop];
        +                        fValue *= SINGLE_SMALL_10_POW[exp - slop];
        +                        return (isNegative) ? -fValue : fValue;
        +                    }
        +                    //
        +                    // Else we have a hard case with a positive exp.
        +                    //
        +                } else {
        +                    if (exp >= -SINGLE_MAX_SMALL_TEN) {
        +                        //
        +                        // Can get the answer in one division.
        +                        //
        +                        fValue /= SINGLE_SMALL_10_POW[-exp];
        +                        return (isNegative) ? -fValue : fValue;
        +                    }
        +                    //
        +                    // Else we have a hard case with a negative exp.
        +                    //
        +                }
        +            } else if ((decExponent >= nDigits) && (nDigits + decExponent <= MAX_DECIMAL_DIGITS)) {
        +                //
        +                // In double-precision, this is an exact floating integer.
        +                // So we can compute to double, then shorten to float
        +                // with one round, and get the right answer.
        +                //
        +                // First, finish accumulating digits.
        +                // Then convert that integer to a double, multiply
        +                // by the appropriate power of ten, and convert to float.
        +                //
        +                long lValue = (long) iValue;
        +                for (int i = kDigits; i < nDigits; i++) {
        +                    lValue = lValue * 10L + (long) ((int) digits[i] - (int) '0');
        +                }
        +                double dValue = (double) lValue;
        +                exp = decExponent - nDigits;
        +                dValue *= SMALL_10_POW[exp];
        +                fValue = (float) dValue;
        +                return (isNegative) ? -fValue : fValue;
        +
        +            }
        +            //
        +            // Harder cases:
        +            // The sum of digits plus exponent is greater than
        +            // what we think we can do with one error.
        +            //
        +            // Start by approximating the right answer by,
        +            // naively, scaling by powers of 10.
        +            // Scaling uses doubles to avoid overflow/underflow.
        +            //
        +            double dValue = fValue;
        +            if (exp > 0) {
        +                if (decExponent > SINGLE_MAX_DECIMAL_EXPONENT + 1) {
        +                    //
        +                    // Lets face it. This is going to be
        +                    // Infinity. Cut to the chase.
        +                    //
        +                    return (isNegative) ? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
        +                }
        +                if ((exp & 15) != 0) {
        +                    dValue *= SMALL_10_POW[exp & 15];
        +                }
        +                if ((exp >>= 4) != 0) {
        +                    int j;
        +                    for (j = 0; exp > 0; j++, exp >>= 1) {
        +                        if ((exp & 1) != 0) {
        +                            dValue *= BIG_10_POW[j];
        +                        }
        +                    }
        +                }
        +            } else if (exp < 0) {
        +                exp = -exp;
        +                if (decExponent < SINGLE_MIN_DECIMAL_EXPONENT - 1) {
        +                    //
        +                    // Lets face it. This is going to be
        +                    // zero. Cut to the chase.
        +                    //
        +                    return (isNegative) ? -0.0f : 0.0f;
        +                }
        +                if ((exp & 15) != 0) {
        +                    dValue /= SMALL_10_POW[exp & 15];
        +                }
        +                if ((exp >>= 4) != 0) {
        +                    int j;
        +                    for (j = 0; exp > 0; j++, exp >>= 1) {
        +                        if ((exp & 1) != 0) {
        +                            dValue *= TINY_10_POW[j];
        +                        }
        +                    }
        +                }
        +            }
        +            fValue = Math.max(Float.MIN_VALUE, Math.min(Float.MAX_VALUE, (float) dValue));
        +
        +            //
        +            // fValue is now approximately the result.
        +            // The hard part is adjusting it, by comparison
        +            // with FDBigInteger arithmetic.
        +            // Formulate the EXACT big-number result as
        +            // bigD0 * 10^exp
        +            //
        +            if (nDigits > SINGLE_MAX_NDIGITS) {
        +                nDigits = SINGLE_MAX_NDIGITS + 1;
        +                digits[SINGLE_MAX_NDIGITS] = '1';
        +            }
        +            FDBigInteger bigD0 = new FDBigInteger(iValue, digits, kDigits, nDigits);
        +            exp = decExponent - nDigits;
        +
        +            int ieeeBits = Float.floatToRawIntBits(fValue); // IEEE-754 bits of float candidate
        +            final int B5 = Math.max(0, -exp); // powers of 5 in bigB, value is not modified inside correctionLoop
        +            final int D5 = Math.max(0, exp); // powers of 5 in bigD, value is not modified inside correctionLoop
        +            bigD0 = bigD0.multByPow52(D5, 0);
        +            bigD0.makeImmutable();   // prevent bigD0 modification inside correctionLoop
        +            FDBigInteger bigD = null;
        +            int prevD2 = 0;
        +
        +            correctionLoop:
        +            while (true) {
        +                // here ieeeBits can't be NaN, Infinity or zero
        +                int binexp = ieeeBits >>> SINGLE_EXP_SHIFT;
        +                int bigBbits = ieeeBits & FloatConsts.SIGNIF_BIT_MASK;
        +                if (binexp > 0) {
        +                    bigBbits |= SINGLE_FRACT_HOB;
        +                } else { // Normalize denormalized numbers.
        +                    assert bigBbits != 0 : bigBbits; // floatToBigInt(0.0)
        +                    int leadingZeros = Integer.numberOfLeadingZeros(bigBbits);
        +                    int shift = leadingZeros - (31 - SINGLE_EXP_SHIFT);
        +                    bigBbits <<= shift;
        +                    binexp = 1 - shift;
        +                }
        +                binexp -= FloatConsts.EXP_BIAS;
        +                int lowOrderZeros = Integer.numberOfTrailingZeros(bigBbits);
        +                bigBbits >>>= lowOrderZeros;
        +                final int bigIntExp = binexp - SINGLE_EXP_SHIFT + lowOrderZeros;
        +                final int bigIntNBits = SINGLE_EXP_SHIFT + 1 - lowOrderZeros;
        +
        +                //
        +                // Scale bigD, bigB appropriately for
        +                // big-integer operations.
        +                // Naively, we multiply by powers of ten
        +                // and powers of two. What we actually do
        +                // is keep track of the powers of 5 and
        +                // powers of 2 we would use, then factor out
        +                // common divisors before doing the work.
        +                //
        +                int B2 = B5; // powers of 2 in bigB
        +                int D2 = D5; // powers of 2 in bigD
        +                int Ulp2;   // powers of 2 in halfUlp.
        +                if (bigIntExp >= 0) {
        +                    B2 += bigIntExp;
        +                } else {
        +                    D2 -= bigIntExp;
        +                }
        +                Ulp2 = B2;
        +                // shift bigB and bigD left by a number s. t.
        +                // halfUlp is still an integer.
        +                int hulpbias;
        +                if (binexp <= -FloatConsts.EXP_BIAS) {
        +                    // This is going to be a denormalized number
        +                    // (if not actually zero).
        +                    // half an ULP is at 2^-(FloatConsts.EXP_BIAS+SINGLE_EXP_SHIFT+1)
        +                    hulpbias = binexp + lowOrderZeros + FloatConsts.EXP_BIAS;
        +                } else {
        +                    hulpbias = 1 + lowOrderZeros;
        +                }
        +                B2 += hulpbias;
        +                D2 += hulpbias;
        +                // if there are common factors of 2, we might just as well
        +                // factor them out, as they add nothing useful.
        +                int common2 = Math.min(B2, Math.min(D2, Ulp2));
        +                B2 -= common2;
        +                D2 -= common2;
        +                Ulp2 -= common2;
        +                // do multiplications by powers of 5 and 2
        +                FDBigInteger bigB = FDBigInteger.valueOfMulPow52(bigBbits, B5, B2);
        +                if (bigD == null || prevD2 != D2) {
        +                    bigD = bigD0.leftShift(D2);
        +                    prevD2 = D2;
        +                }
        +                //
        +                // to recap:
        +                // bigB is the scaled-big-int version of our floating-point
        +                // candidate.
        +                // bigD is the scaled-big-int version of the exact value
        +                // as we understand it.
        +                // halfUlp is 1/2 an ulp of bigB, except for special cases
        +                // of exact powers of 2
        +                //
        +                // the plan is to compare bigB with bigD, and if the difference
        +                // is less than halfUlp, then we're satisfied. Otherwise,
        +                // use the ratio of difference to halfUlp to calculate a fudge
        +                // factor to add to the floating value, then go 'round again.
        +                //
        +                FDBigInteger diff;
        +                int cmpResult;
        +                boolean overvalue;
        +                if ((cmpResult = bigB.cmp(bigD)) > 0) {
        +                    overvalue = true; // our candidate is too big.
        +                    diff = bigB.leftInplaceSub(bigD); // bigB is not user further - reuse
        +                    if ((bigIntNBits == 1) && (bigIntExp > -FloatConsts.EXP_BIAS + 1)) {
        +                        // candidate is a normalized exact power of 2 and
        +                        // is too big (larger than Float.MIN_NORMAL). We will be subtracting.
        +                        // For our purposes, ulp is the ulp of the
        +                        // next smaller range.
        +                        Ulp2 -= 1;
        +                        if (Ulp2 < 0) {
        +                            // rats. Cannot de-scale ulp this far.
        +                            // must scale diff in other direction.
        +                            Ulp2 = 0;
        +                            diff = diff.leftShift(1);
        +                        }
        +                    }
        +                } else if (cmpResult < 0) {
        +                    overvalue = false; // our candidate is too small.
        +                    diff = bigD.rightInplaceSub(bigB); // bigB is not user further - reuse
        +                } else {
        +                    // the candidate is exactly right!
        +                    // this happens with surprising frequency
        +                    break correctionLoop;
        +                }
        +                cmpResult = diff.cmpPow52(B5, Ulp2);
        +                if ((cmpResult) < 0) {
        +                    // difference is small.
        +                    // this is close enough
        +                    break correctionLoop;
        +                } else if (cmpResult == 0) {
        +                    // difference is exactly half an ULP
        +                    // round to some other value maybe, then finish
        +                    if ((ieeeBits & 1) != 0) { // half ties to even
        +                        ieeeBits += overvalue ? -1 : 1; // nextDown or nextUp
        +                    }
        +                    break correctionLoop;
        +                } else {
        +                    // difference is non-trivial.
        +                    // could scale addend by ratio of difference to
        +                    // halfUlp here, if we bothered to compute that difference.
        +                    // Most of the time ( I hope ) it is about 1 anyway.
        +                    ieeeBits += overvalue ? -1 : 1; // nextDown or nextUp
        +                    if (ieeeBits == 0 || ieeeBits == FloatConsts.EXP_BIT_MASK) { // 0.0 or Float.POSITIVE_INFINITY
        +                        break correctionLoop; // oops. Fell off end of range.
        +                    }
        +                    continue; // try again.
        +                }
        +
        +            }
        +            if (isNegative) {
        +                ieeeBits |= FloatConsts.SIGN_BIT_MASK;
        +            }
        +            return Float.intBitsToFloat(ieeeBits);
        +        }
        +
        +
        +        /**
        +         * All the positive powers of 10 that can be
        +         * represented exactly in double/float.
        +         */
        +        private static final double[] SMALL_10_POW = {
        +            1.0e0,
        +            1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5,
        +            1.0e6, 1.0e7, 1.0e8, 1.0e9, 1.0e10,
        +            1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15,
        +            1.0e16, 1.0e17, 1.0e18, 1.0e19, 1.0e20,
        +            1.0e21, 1.0e22
                 };
         
        -    public void appendTo(Appendable buf) {
        -          char result[] = perThreadBuffer.get();
        -          int i = getChars(result);
        -        if (buf instanceof StringBuilder)
        -            ((StringBuilder) buf).append(result, 0, i);
        -        else if (buf instanceof StringBuffer)
        -            ((StringBuffer) buf).append(result, 0, i);
        -        else
        -            assert false;
        +        private static final float[] SINGLE_SMALL_10_POW = {
        +            1.0e0f,
        +            1.0e1f, 1.0e2f, 1.0e3f, 1.0e4f, 1.0e5f,
        +            1.0e6f, 1.0e7f, 1.0e8f, 1.0e9f, 1.0e10f
        +        };
        +
        +        private static final double[] BIG_10_POW = {
        +            1e16, 1e32, 1e64, 1e128, 1e256 };
        +        private static final double[] TINY_10_POW = {
        +            1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
        +
        +        private static final int MAX_SMALL_TEN = SMALL_10_POW.length-1;
        +        private static final int SINGLE_MAX_SMALL_TEN = SINGLE_SMALL_10_POW.length-1;
        +
        +    }
        +
        +    /**
        +     * Returns a BinaryToASCIIConverter for a double.
        +     * The returned object is a ThreadLocal variable of this class.
        +     *
        +     * @param d The double precision value to convert.
        +     * @return The converter.
        +     */
        +    public static BinaryToASCIIConverter getBinaryToASCIIConverter(double d) {
        +        return getBinaryToASCIIConverter(d, true);
        +    }
        +
        +    /**
        +     * Returns a BinaryToASCIIConverter for a double.
        +     * The returned object is a ThreadLocal variable of this class.
        +     *
        +     * @param d The double precision value to convert.
        +     * @param isCompatibleFormat
        +     * @return The converter.
        +     */
        +    static BinaryToASCIIConverter getBinaryToASCIIConverter(double d, boolean isCompatibleFormat) {
        +        long dBits = Double.doubleToRawLongBits(d);
        +        boolean isNegative = (dBits&DoubleConsts.SIGN_BIT_MASK) != 0; // discover sign
        +        long fractBits = dBits & DoubleConsts.SIGNIF_BIT_MASK;
        +        int  binExp = (int)( (dBits&DoubleConsts.EXP_BIT_MASK) >> EXP_SHIFT );
        +        // Discover obvious special cases of NaN and Infinity.
        +        if ( binExp == (int)(DoubleConsts.EXP_BIT_MASK>>EXP_SHIFT) ) {
        +            if ( fractBits == 0L ){
        +                return isNegative ? B2AC_NEGATIVE_INFINITY : B2AC_POSITIVE_INFINITY;
        +            } else {
        +                return B2AC_NOT_A_NUMBER;
        +            }
        +        }
        +        // Finish unpacking
        +        // Normalize denormalized numbers.
        +        // Insert assumed high-order bit for normalized numbers.
        +        // Subtract exponent bias.
        +        int  nSignificantBits;
        +        if ( binExp == 0 ){
        +            if ( fractBits == 0L ){
        +                // not a denorm, just a 0!
        +                return isNegative ? B2AC_NEGATIVE_ZERO : B2AC_POSITIVE_ZERO;
        +            }
        +            int leadingZeros = Long.numberOfLeadingZeros(fractBits);
        +            int shift = leadingZeros-(63-EXP_SHIFT);
        +            fractBits <<= shift;
        +            binExp = 1 - shift;
        +            nSignificantBits =  64-leadingZeros; // recall binExp is  - shift count.
        +        } else {
        +            fractBits |= FRACT_HOB;
        +            nSignificantBits = EXP_SHIFT+1;
        +        }
        +        binExp -= DoubleConsts.EXP_BIAS;
        +        BinaryToASCIIBuffer buf = getBinaryToASCIIBuffer();
        +        buf.setSign(isNegative);
        +        // call the routine that actually does all the hard work.
        +        buf.dtoa(binExp, fractBits, nSignificantBits, isCompatibleFormat);
        +        return buf;
        +    }
        +
        +    private static BinaryToASCIIConverter getBinaryToASCIIConverter(float f) {
        +        int fBits = Float.floatToRawIntBits( f );
        +        boolean isNegative = (fBits&FloatConsts.SIGN_BIT_MASK) != 0;
        +        int fractBits = fBits&FloatConsts.SIGNIF_BIT_MASK;
        +        int binExp = (fBits&FloatConsts.EXP_BIT_MASK) >> SINGLE_EXP_SHIFT;
        +        // Discover obvious special cases of NaN and Infinity.
        +        if ( binExp == (FloatConsts.EXP_BIT_MASK>>SINGLE_EXP_SHIFT) ) {
        +            if ( fractBits == 0L ){
        +                return isNegative ? B2AC_NEGATIVE_INFINITY : B2AC_POSITIVE_INFINITY;
        +            } else {
        +                return B2AC_NOT_A_NUMBER;
        +            }
        +        }
        +        // Finish unpacking
        +        // Normalize denormalized numbers.
        +        // Insert assumed high-order bit for normalized numbers.
        +        // Subtract exponent bias.
        +        int  nSignificantBits;
        +        if ( binExp == 0 ){
        +            if ( fractBits == 0 ){
        +                // not a denorm, just a 0!
        +                return isNegative ? B2AC_NEGATIVE_ZERO : B2AC_POSITIVE_ZERO;
        +            }
        +            int leadingZeros = Integer.numberOfLeadingZeros(fractBits);
        +            int shift = leadingZeros-(31-SINGLE_EXP_SHIFT);
        +            fractBits <<= shift;
        +            binExp = 1 - shift;
        +            nSignificantBits =  32 - leadingZeros; // recall binExp is  - shift count.
        +        } else {
        +            fractBits |= SINGLE_FRACT_HOB;
        +            nSignificantBits = SINGLE_EXP_SHIFT+1;
        +        }
        +        binExp -= FloatConsts.EXP_BIAS;
        +        BinaryToASCIIBuffer buf = getBinaryToASCIIBuffer();
        +        buf.setSign(isNegative);
        +        // call the routine that actually does all the hard work.
        +        buf.dtoa(binExp, ((long)fractBits)<<(EXP_SHIFT-SINGLE_EXP_SHIFT), nSignificantBits, true);
        +        return buf;
             }
         
             @SuppressWarnings("fallthrough")
        -    public static FloatingDecimal
        -    readJavaFormatString( String in ) throws NumberFormatException {
        +    static ASCIIToBinaryConverter readJavaFormatString( String in ) throws NumberFormatException {
                 boolean isNegative = false;
                 boolean signSeen   = false;
                 int     decExp;
        @@ -1034,10 +1837,12 @@ public class FloatingDecimal{
                 try{
                     in = in.trim(); // don't fool around with white space.
                                     // throws NullPointerException if null
        -            int l = in.length();
        -            if ( l == 0 ) throw new NumberFormatException("empty String");
        +            int len = in.length();
        +            if ( len == 0 ) {
        +                throw new NumberFormatException("empty String");
        +            }
                     int i = 0;
        -            switch ( c = in.charAt( i ) ){
        +            switch (in.charAt(i)){
                     case '-':
                         isNegative = true;
                         //FALLTHROUGH
        @@ -1045,144 +1850,121 @@ public class FloatingDecimal{
                         i++;
                         signSeen = true;
                     }
        -
        -            // Check for NaN and Infinity strings
                     c = in.charAt(i);
        -            if(c == 'N' || c == 'I') { // possible NaN or infinity
        -                boolean potentialNaN = false;
        -                char targetChars[] = null;  // char array of "NaN" or "Infinity"
        -
        -                if(c == 'N') {
        -                    targetChars = notANumber;
        -                    potentialNaN = true;
        -                } else {
        -                    targetChars = infinity;
        +            if(c == 'N') { // Check for NaN
        +                if((len-i)==NAN_LENGTH && in.indexOf(NAN_REP,i)==i) {
        +                    return A2BC_NOT_A_NUMBER;
                         }
        -
        -                // compare Input string to "NaN" or "Infinity"
        -                int j = 0;
        -                while(i < l && j < targetChars.length) {
        -                    if(in.charAt(i) == targetChars[j]) {
        -                        i++; j++;
        -                    }
        -                    else // something is amiss, throw exception
        -                        break parseNumber;
        +                // something went wrong, throw exception
        +                break parseNumber;
        +            } else if(c == 'I') { // Check for Infinity strings
        +                if((len-i)==INFINITY_LENGTH && in.indexOf(INFINITY_REP,i)==i) {
        +                    return isNegative? A2BC_NEGATIVE_INFINITY : A2BC_POSITIVE_INFINITY;
                         }
        -
        -                // For the candidate string to be a NaN or infinity,
        -                // all characters in input string and target char[]
        -                // must be matched ==> j must equal targetChars.length
        -                // and i must equal l
        -                if( (j == targetChars.length) && (i == l) ) { // return NaN or infinity
        -                    return (potentialNaN ? new FloatingDecimal(Double.NaN) // NaN has no sign
        -                            : new FloatingDecimal(isNegative?
        -                                                  Double.NEGATIVE_INFINITY:
        -                                                  Double.POSITIVE_INFINITY)) ;
        -                }
        -                else { // something went wrong, throw exception
        -                    break parseNumber;
        -                }
        -
        +                // something went wrong, throw exception
        +                break parseNumber;
                     } else if (c == '0')  { // check for hexadecimal floating-point number
        -                if (l > i+1 ) {
        +                if (len > i+1 ) {
                             char ch = in.charAt(i+1);
        -                    if (ch == 'x' || ch == 'X' ) // possible hex string
        +                    if (ch == 'x' || ch == 'X' ) { // possible hex string
                                 return parseHexString(in);
        +                    }
                         }
                     }  // look for and process decimal floating-point string
         
        -            char[] digits = new char[ l ];
        +            char[] digits = new char[ len ];
                     int    nDigits= 0;
                     boolean decSeen = false;
                     int decPt = 0;
                     int nLeadZero = 0;
                     int nTrailZero= 0;
        -        digitLoop:
        -            while ( i < l ){
        -                switch ( c = in.charAt( i ) ){
        -                case '0':
        -                    if ( nDigits > 0 ){
        -                        nTrailZero += 1;
        -                    } else {
        -                        nLeadZero += 1;
        -                    }
        -                    break; // out of switch.
        -                case '1':
        -                case '2':
        -                case '3':
        -                case '4':
        -                case '5':
        -                case '6':
        -                case '7':
        -                case '8':
        -                case '9':
        -                    while ( nTrailZero > 0 ){
        -                        digits[nDigits++] = '0';
        -                        nTrailZero -= 1;
        -                    }
        -                    digits[nDigits++] = c;
        -                    break; // out of switch.
        -                case '.':
        -                    if ( decSeen ){
        +
        +        skipLeadingZerosLoop:
        +            while (i < len) {
        +                c = in.charAt(i);
        +                if (c == '0') {
        +                    nLeadZero++;
        +                } else if (c == '.') {
        +                    if (decSeen) {
                                 // already saw one ., this is the 2nd.
                                 throw new NumberFormatException("multiple points");
                             }
                             decPt = i;
        -                    if ( signSeen ){
        +                    if (signSeen) {
                                 decPt -= 1;
                             }
                             decSeen = true;
        -                    break; // out of switch.
        -                default:
        +                } else {
        +                    break skipLeadingZerosLoop;
        +                }
        +                i++;
        +            }
        +        digitLoop:
        +            while (i < len) {
        +                c = in.charAt(i);
        +                if (c >= '1' && c <= '9') {
        +                    digits[nDigits++] = c;
        +                    nTrailZero = 0;
        +                } else if (c == '0') {
        +                    digits[nDigits++] = c;
        +                    nTrailZero++;
        +                } else if (c == '.') {
        +                    if (decSeen) {
        +                        // already saw one ., this is the 2nd.
        +                        throw new NumberFormatException("multiple points");
        +                    }
        +                    decPt = i;
        +                    if (signSeen) {
        +                        decPt -= 1;
        +                    }
        +                    decSeen = true;
        +                } else {
                             break digitLoop;
                         }
                         i++;
                     }
        -            /*
        -             * At this point, we've scanned all the digits and decimal
        -             * point we're going to see. Trim off leading and trailing
        -             * zeros, which will just confuse us later, and adjust
        -             * our initial decimal exponent accordingly.
        -             * To review:
        -             * we have seen i total characters.
        -             * nLeadZero of them were zeros before any other digits.
        -             * nTrailZero of them were zeros after any other digits.
        -             * if ( decSeen ), then a . was seen after decPt characters
        -             * ( including leading zeros which have been discarded )
        -             * nDigits characters were neither lead nor trailing
        -             * zeros, nor point
        -             */
        -            /*
        -             * special hack: if we saw no non-zero digits, then the
        -             * answer is zero!
        -             * Unfortunately, we feel honor-bound to keep parsing!
        -             */
        -            if ( nDigits == 0 ){
        -                digits = zero;
        -                nDigits = 1;
        -                if ( nLeadZero == 0 ){
        -                    // we saw NO DIGITS AT ALL,
        -                    // not even a crummy 0!
        -                    // this is not allowed.
        -                    break parseNumber; // go throw exception
        -                }
        -
        +            nDigits -=nTrailZero;
        +            //
        +            // At this point, we've scanned all the digits and decimal
        +            // point we're going to see. Trim off leading and trailing
        +            // zeros, which will just confuse us later, and adjust
        +            // our initial decimal exponent accordingly.
        +            // To review:
        +            // we have seen i total characters.
        +            // nLeadZero of them were zeros before any other digits.
        +            // nTrailZero of them were zeros after any other digits.
        +            // if ( decSeen ), then a . was seen after decPt characters
        +            // ( including leading zeros which have been discarded )
        +            // nDigits characters were neither lead nor trailing
        +            // zeros, nor point
        +            //
        +            //
        +            // special hack: if we saw no non-zero digits, then the
        +            // answer is zero!
        +            // Unfortunately, we feel honor-bound to keep parsing!
        +            //
        +            boolean isZero = (nDigits == 0);
        +            if ( isZero &&  nLeadZero == 0 ){
        +                // we saw NO DIGITS AT ALL,
        +                // not even a crummy 0!
        +                // this is not allowed.
        +                break parseNumber; // go throw exception
                     }
        -
        -            /* Our initial exponent is decPt, adjusted by the number of
        -             * discarded zeros. Or, if there was no decPt,
        -             * then its just nDigits adjusted by discarded trailing zeros.
        -             */
        +            //
        +            // Our initial exponent is decPt, adjusted by the number of
        +            // discarded zeros. Or, if there was no decPt,
        +            // then its just nDigits adjusted by discarded trailing zeros.
        +            //
                     if ( decSeen ){
                         decExp = decPt - nLeadZero;
                     } else {
        -                decExp = nDigits+nTrailZero;
        +                decExp = nDigits + nTrailZero;
                     }
         
        -            /*
        -             * Look for 'e' or 'E' and an optionally signed integer.
        -             */
        -            if ( (i < l) &&  (((c = in.charAt(i) )=='e') || (c == 'E') ) ){
        +            //
        +            // Look for 'e' or 'E' and an optionally signed integer.
        +            //
        +            if ( (i < len) &&  (((c = in.charAt(i) )=='e') || (c == 'E') ) ){
                         int expSign = 1;
                         int expVal  = 0;
                         int reallyBig = Integer.MAX_VALUE / 10;
        @@ -1196,31 +1978,21 @@ public class FloatingDecimal{
                         }
                         int expAt = i;
                     expLoop:
        -                while ( i < l  ){
        +                while ( i < len  ){
                             if ( expVal >= reallyBig ){
                                 // the next character will cause integer
                                 // overflow.
                                 expOverflow = true;
                             }
        -                    switch ( c = in.charAt(i++) ){
        -                    case '0':
        -                    case '1':
        -                    case '2':
        -                    case '3':
        -                    case '4':
        -                    case '5':
        -                    case '6':
        -                    case '7':
        -                    case '8':
        -                    case '9':
        +                    c = in.charAt(i++);
        +                    if(c>='0' && c<='9') {
                                 expVal = expVal*10 + ( (int)c - (int)'0' );
        -                        continue;
        -                    default:
        +                    } else {
                                 i--;           // back up.
                                 break expLoop; // stop parsing exponent.
                             }
                         }
        -                int expLimit = bigDecimalExponent+nDigits+nTrailZero;
        +                int expLimit = BIG_DECIMAL_EXPONENT+nDigits+nTrailZero;
                         if ( expOverflow || ( expVal > expLimit ) ){
                             //
                             // The intent here is to end up with
        @@ -1247,1182 +2019,515 @@ public class FloatingDecimal{
                         // but then some trailing garbage, that might be ok.
                         // so we just fall through in that case.
                         // HUMBUG
        -                if ( i == expAt )
        +                if ( i == expAt ) {
                             break parseNumber; // certainly bad
        +                }
                     }
        -            /*
        -             * We parsed everything we could.
        -             * If there are leftovers, then this is not good input!
        -             */
        -            if ( i < l &&
        -                ((i != l - 1) ||
        +            //
        +            // We parsed everything we could.
        +            // If there are leftovers, then this is not good input!
        +            //
        +            if ( i < len &&
        +                ((i != len - 1) ||
                         (in.charAt(i) != 'f' &&
                          in.charAt(i) != 'F' &&
                          in.charAt(i) != 'd' &&
                          in.charAt(i) != 'D'))) {
                         break parseNumber; // go throw exception
                     }
        -
        -            return new FloatingDecimal( isNegative, decExp, digits, nDigits,  false );
        +            if(isZero) {
        +                return isNegative ? A2BC_NEGATIVE_ZERO : A2BC_POSITIVE_ZERO;
        +            }
        +            return new ASCIIToBinaryBuffer(isNegative, decExp, digits, nDigits);
                 } catch ( StringIndexOutOfBoundsException e ){ }
                 throw new NumberFormatException("For input string: \"" + in + "\"");
             }
         
        -    /*
        -     * Take a FloatingDecimal, which we presumably just scanned in,
        -     * and find out what its value is, as a double.
        -     *
        -     * AS A SIDE EFFECT, SET roundDir TO INDICATE PREFERRED
        -     * ROUNDING DIRECTION in case the result is really destined
        -     * for a single-precision float.
        -     */
        -
        -    public strictfp double doubleValue(){
        -        int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
        -        long    lValue;
        -        double  dValue;
        -        double  rValue, tValue;
        -
        -        // First, check for NaN and Infinity values
        -        if(digits == infinity || digits == notANumber) {
        -            if(digits == notANumber)
        -                return Double.NaN;
        -            else
        -                return (isNegative?Double.NEGATIVE_INFINITY:Double.POSITIVE_INFINITY);
        -        }
        -        else {
        -            if (mustSetRoundDir) {
        -                roundDir = 0;
        -            }
        -            /*
        -             * convert the lead kDigits to a long integer.
        -             */
        -            // (special performance hack: start to do it using int)
        -            int iValue = (int)digits[0]-(int)'0';
        -            int iDigits = Math.min( kDigits, intDecimalDigits );
        -            for ( int i=1; i < iDigits; i++ ){
        -                iValue = iValue*10 + (int)digits[i]-(int)'0';
        -            }
        -            lValue = (long)iValue;
        -            for ( int i=iDigits; i < kDigits; i++ ){
        -                lValue = lValue*10L + (long)((int)digits[i]-(int)'0');
        -            }
        -            dValue = (double)lValue;
        -            int exp = decExponent-kDigits;
        -            /*
        -             * lValue now contains a long integer with the value of
        -             * the first kDigits digits of the number.
        -             * dValue contains the (double) of the same.
        -             */
        -
        -            if ( nDigits <= maxDecimalDigits ){
        -                /*
        -                 * possibly an easy case.
        -                 * We know that the digits can be represented
        -                 * exactly. And if the exponent isn't too outrageous,
        -                 * the whole thing can be done with one operation,
        -                 * thus one rounding error.
        -                 * Note that all our constructors trim all leading and
        -                 * trailing zeros, so simple values (including zero)
        -                 * will always end up here
        -                 */
        -                if (exp == 0 || dValue == 0.0)
        -                    return (isNegative)? -dValue : dValue; // small floating integer
        -                else if ( exp >= 0 ){
        -                    if ( exp <= maxSmallTen ){
        -                        /*
        -                         * Can get the answer with one operation,
        -                         * thus one roundoff.
        -                         */
        -                        rValue = dValue * small10pow[exp];
        -                        if ( mustSetRoundDir ){
        -                            tValue = rValue / small10pow[exp];
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    int slop = maxDecimalDigits - kDigits;
        -                    if ( exp <= maxSmallTen+slop ){
        -                        /*
        -                         * We can multiply dValue by 10^(slop)
        -                         * and it is still "small" and exact.
        -                         * Then we can multiply by 10^(exp-slop)
        -                         * with one rounding.
        -                         */
        -                        dValue *= small10pow[slop];
        -                        rValue = dValue * small10pow[exp-slop];
        -
        -                        if ( mustSetRoundDir ){
        -                            tValue = rValue / small10pow[exp-slop];
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a positive exp.
        -                     */
        -                } else {
        -                    if ( exp >= -maxSmallTen ){
        -                        /*
        -                         * Can get the answer in one division.
        -                         */
        -                        rValue = dValue / small10pow[-exp];
        -                        tValue = rValue * small10pow[-exp];
        -                        if ( mustSetRoundDir ){
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a negative exp.
        -                     */
        -                }
        -            }
        -
        -            /*
        -             * Harder cases:
        -             * The sum of digits plus exponent is greater than
        -             * what we think we can do with one error.
        -             *
        -             * Start by approximating the right answer by,
        -             * naively, scaling by powers of 10.
        -             */
        -            if ( exp > 0 ){
        -                if ( decExponent > maxDecimalExponent+1 ){
        -                    /*
        -                     * Lets face it. This is going to be
        -                     * Infinity. Cut to the chase.
        -                     */
        -                    return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        -                }
        -                if ( (exp&15) != 0 ){
        -                    dValue *= small10pow[exp&15];
        -                }
        -                if ( (exp>>=4) != 0 ){
        -                    int j;
        -                    for( j = 0; exp > 1; j++, exp>>=1 ){
        -                        if ( (exp&1)!=0)
        -                            dValue *= big10pow[j];
        -                    }
        -                    /*
        -                     * The reason for the weird exp > 1 condition
        -                     * in the above loop was so that the last multiply
        -                     * would get unrolled. We handle it here.
        -                     * It could overflow.
        -                     */
        -                    double t = dValue * big10pow[j];
        -                    if ( Double.isInfinite( t ) ){
        -                        /*
        -                         * It did overflow.
        -                         * Look more closely at the result.
        -                         * If the exponent is just one too large,
        -                         * then use the maximum finite as our estimate
        -                         * value. Else call the result infinity
        -                         * and punt it.
        -                         * ( I presume this could happen because
        -                         * rounding forces the result here to be
        -                         * an ULP or two larger than
        -                         * Double.MAX_VALUE ).
        -                         */
        -                        t = dValue / 2.0;
        -                        t *= big10pow[j];
        -                        if ( Double.isInfinite( t ) ){
        -                            return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        -                        }
        -                        t = Double.MAX_VALUE;
        -                    }
        -                    dValue = t;
        -                }
        -            } else if ( exp < 0 ){
        -                exp = -exp;
        -                if ( decExponent < minDecimalExponent-1 ){
        -                    /*
        -                     * Lets face it. This is going to be
        -                     * zero. Cut to the chase.
        -                     */
        -                    return (isNegative)? -0.0 : 0.0;
        -                }
        -                if ( (exp&15) != 0 ){
        -                    dValue /= small10pow[exp&15];
        -                }
        -                if ( (exp>>=4) != 0 ){
        -                    int j;
        -                    for( j = 0; exp > 1; j++, exp>>=1 ){
        -                        if ( (exp&1)!=0)
        -                            dValue *= tiny10pow[j];
        -                    }
        -                    /*
        -                     * The reason for the weird exp > 1 condition
        -                     * in the above loop was so that the last multiply
        -                     * would get unrolled. We handle it here.
        -                     * It could underflow.
        -                     */
        -                    double t = dValue * tiny10pow[j];
        -                    if ( t == 0.0 ){
        -                        /*
        -                         * It did underflow.
        -                         * Look more closely at the result.
        -                         * If the exponent is just one too small,
        -                         * then use the minimum finite as our estimate
        -                         * value. Else call the result 0.0
        -                         * and punt it.
        -                         * ( I presume this could happen because
        -                         * rounding forces the result here to be
        -                         * an ULP or two less than
        -                         * Double.MIN_VALUE ).
        -                         */
        -                        t = dValue * 2.0;
        -                        t *= tiny10pow[j];
        -                        if ( t == 0.0 ){
        -                            return (isNegative)? -0.0 : 0.0;
        -                        }
        -                        t = Double.MIN_VALUE;
        -                    }
        -                    dValue = t;
        -                }
        -            }
        -
        -            /*
        -             * dValue is now approximately the result.
        -             * The hard part is adjusting it, by comparison
        -             * with FDBigInt arithmetic.
        -             * Formulate the EXACT big-number result as
        -             * bigD0 * 10^exp
        -             */
        -            FDBigInt bigD0 = new FDBigInt( lValue, digits, kDigits, nDigits );
        -            exp   = decExponent - nDigits;
        -
        -            correctionLoop:
        -            while(true){
        -                /* AS A SIDE EFFECT, THIS METHOD WILL SET THE INSTANCE VARIABLES
        -                 * bigIntExp and bigIntNBits
        -                 */
        -                FDBigInt bigB = doubleToBigInt( dValue );
        -
        -                /*
        -                 * Scale bigD, bigB appropriately for
        -                 * big-integer operations.
        -                 * Naively, we multiply by powers of ten
        -                 * and powers of two. What we actually do
        -                 * is keep track of the powers of 5 and
        -                 * powers of 2 we would use, then factor out
        -                 * common divisors before doing the work.
        -                 */
        -                int B2, B5; // powers of 2, 5 in bigB
        -                int     D2, D5; // powers of 2, 5 in bigD
        -                int Ulp2;   // powers of 2 in halfUlp.
        -                if ( exp >= 0 ){
        -                    B2 = B5 = 0;
        -                    D2 = D5 = exp;
        -                } else {
        -                    B2 = B5 = -exp;
        -                    D2 = D5 = 0;
        -                }
        -                if ( bigIntExp >= 0 ){
        -                    B2 += bigIntExp;
        -                } else {
        -                    D2 -= bigIntExp;
        -                }
        -                Ulp2 = B2;
        -                // shift bigB and bigD left by a number s. t.
        -                // halfUlp is still an integer.
        -                int hulpbias;
        -                if ( bigIntExp+bigIntNBits <= -expBias+1 ){
        -                    // This is going to be a denormalized number
        -                    // (if not actually zero).
        -                    // half an ULP is at 2^-(expBias+expShift+1)
        -                    hulpbias = bigIntExp+ expBias + expShift;
        -                } else {
        -                    hulpbias = expShift + 2 - bigIntNBits;
        -                }
        -                B2 += hulpbias;
        -                D2 += hulpbias;
        -                // if there are common factors of 2, we might just as well
        -                // factor them out, as they add nothing useful.
        -                int common2 = Math.min( B2, Math.min( D2, Ulp2 ) );
        -                B2 -= common2;
        -                D2 -= common2;
        -                Ulp2 -= common2;
        -                // do multiplications by powers of 5 and 2
        -                bigB = multPow52( bigB, B5, B2 );
        -                FDBigInt bigD = multPow52( new FDBigInt( bigD0 ), D5, D2 );
        -                //
        -                // to recap:
        -                // bigB is the scaled-big-int version of our floating-point
        -                // candidate.
        -                // bigD is the scaled-big-int version of the exact value
        -                // as we understand it.
        -                // halfUlp is 1/2 an ulp of bigB, except for special cases
        -                // of exact powers of 2
        -                //
        -                // the plan is to compare bigB with bigD, and if the difference
        -                // is less than halfUlp, then we're satisfied. Otherwise,
        -                // use the ratio of difference to halfUlp to calculate a fudge
        -                // factor to add to the floating value, then go 'round again.
        -                //
        -                FDBigInt diff;
        -                int cmpResult;
        -                boolean overvalue;
        -                if ( (cmpResult = bigB.cmp( bigD ) ) > 0 ){
        -                    overvalue = true; // our candidate is too big.
        -                    diff = bigB.sub( bigD );
        -                    if ( (bigIntNBits == 1) && (bigIntExp > -expBias+1) ){
        -                        // candidate is a normalized exact power of 2 and
        -                        // is too big. We will be subtracting.
        -                        // For our purposes, ulp is the ulp of the
        -                        // next smaller range.
        -                        Ulp2 -= 1;
        -                        if ( Ulp2 < 0 ){
        -                            // rats. Cannot de-scale ulp this far.
        -                            // must scale diff in other direction.
        -                            Ulp2 = 0;
        -                            diff.lshiftMe( 1 );
        -                        }
        -                    }
        -                } else if ( cmpResult < 0 ){
        -                    overvalue = false; // our candidate is too small.
        -                    diff = bigD.sub( bigB );
        -                } else {
        -                    // the candidate is exactly right!
        -                    // this happens with surprising frequency
        -                    break correctionLoop;
        -                }
        -                FDBigInt halfUlp = constructPow52( B5, Ulp2 );
        -                if ( (cmpResult = diff.cmp( halfUlp ) ) < 0 ){
        -                    // difference is small.
        -                    // this is close enough
        -                    if (mustSetRoundDir) {
        -                        roundDir = overvalue ? -1 : 1;
        -                    }
        -                    break correctionLoop;
        -                } else if ( cmpResult == 0 ){
        -                    // difference is exactly half an ULP
        -                    // round to some other value maybe, then finish
        -                    dValue += 0.5*ulp( dValue, overvalue );
        -                    // should check for bigIntNBits == 1 here??
        -                    if (mustSetRoundDir) {
        -                        roundDir = overvalue ? -1 : 1;
        -                    }
        -                    break correctionLoop;
        -                } else {
        -                    // difference is non-trivial.
        -                    // could scale addend by ratio of difference to
        -                    // halfUlp here, if we bothered to compute that difference.
        -                    // Most of the time ( I hope ) it is about 1 anyway.
        -                    dValue += ulp( dValue, overvalue );
        -                    if ( dValue == 0.0 || dValue == Double.POSITIVE_INFINITY )
        -                        break correctionLoop; // oops. Fell off end of range.
        -                    continue; // try again.
        -                }
        -
        -            }
        -            return (isNegative)? -dValue : dValue;
        -        }
        -    }
        -
        -    /*
        -     * Take a FloatingDecimal, which we presumably just scanned in,
        -     * and find out what its value is, as a float.
        -     * This is distinct from doubleValue() to avoid the extremely
        -     * unlikely case of a double rounding error, wherein the conversion
        -     * to double has one rounding error, and the conversion of that double
        -     * to a float has another rounding error, IN THE WRONG DIRECTION,
        -     * ( because of the preference to a zero low-order bit ).
        -     */
        -
        -    public strictfp float floatValue(){
        -        int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
        -        int     iValue;
        -        float   fValue;
        -
        -        // First, check for NaN and Infinity values
        -        if(digits == infinity || digits == notANumber) {
        -            if(digits == notANumber)
        -                return Float.NaN;
        -            else
        -                return (isNegative?Float.NEGATIVE_INFINITY:Float.POSITIVE_INFINITY);
        -        }
        -        else {
        -            /*
        -             * convert the lead kDigits to an integer.
        -             */
        -            iValue = (int)digits[0]-(int)'0';
        -            for ( int i=1; i < kDigits; i++ ){
        -                iValue = iValue*10 + (int)digits[i]-(int)'0';
        -            }
        -            fValue = (float)iValue;
        -            int exp = decExponent-kDigits;
        -            /*
        -             * iValue now contains an integer with the value of
        -             * the first kDigits digits of the number.
        -             * fValue contains the (float) of the same.
        -             */
        -
        -            if ( nDigits <= singleMaxDecimalDigits ){
        -                /*
        -                 * possibly an easy case.
        -                 * We know that the digits can be represented
        -                 * exactly. And if the exponent isn't too outrageous,
        -                 * the whole thing can be done with one operation,
        -                 * thus one rounding error.
        -                 * Note that all our constructors trim all leading and
        -                 * trailing zeros, so simple values (including zero)
        -                 * will always end up here.
        -                 */
        -                if (exp == 0 || fValue == 0.0f)
        -                    return (isNegative)? -fValue : fValue; // small floating integer
        -                else if ( exp >= 0 ){
        -                    if ( exp <= singleMaxSmallTen ){
        -                        /*
        -                         * Can get the answer with one operation,
        -                         * thus one roundoff.
        -                         */
        -                        fValue *= singleSmall10pow[exp];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    int slop = singleMaxDecimalDigits - kDigits;
        -                    if ( exp <= singleMaxSmallTen+slop ){
        -                        /*
        -                         * We can multiply dValue by 10^(slop)
        -                         * and it is still "small" and exact.
        -                         * Then we can multiply by 10^(exp-slop)
        -                         * with one rounding.
        -                         */
        -                        fValue *= singleSmall10pow[slop];
        -                        fValue *= singleSmall10pow[exp-slop];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a positive exp.
        -                     */
        -                } else {
        -                    if ( exp >= -singleMaxSmallTen ){
        -                        /*
        -                         * Can get the answer in one division.
        -                         */
        -                        fValue /= singleSmall10pow[-exp];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a negative exp.
        -                     */
        -                }
        -            } else if ( (decExponent >= nDigits) && (nDigits+decExponent <= maxDecimalDigits) ){
        -                /*
        -                 * In double-precision, this is an exact floating integer.
        -                 * So we can compute to double, then shorten to float
        -                 * with one round, and get the right answer.
        -                 *
        -                 * First, finish accumulating digits.
        -                 * Then convert that integer to a double, multiply
        -                 * by the appropriate power of ten, and convert to float.
        -                 */
        -                long lValue = (long)iValue;
        -                for ( int i=kDigits; i < nDigits; i++ ){
        -                    lValue = lValue*10L + (long)((int)digits[i]-(int)'0');
        -                }
        -                double dValue = (double)lValue;
        -                exp = decExponent-nDigits;
        -                dValue *= small10pow[exp];
        -                fValue = (float)dValue;
        -                return (isNegative)? -fValue : fValue;
        -
        -            }
        -            /*
        -             * Harder cases:
        -             * The sum of digits plus exponent is greater than
        -             * what we think we can do with one error.
        -             *
        -             * Start by weeding out obviously out-of-range
        -             * results, then convert to double and go to
        -             * common hard-case code.
        -             */
        -            if ( decExponent > singleMaxDecimalExponent+1 ){
        -                /*
        -                 * Lets face it. This is going to be
        -                 * Infinity. Cut to the chase.
        -                 */
        -                return (isNegative)? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
        -            } else if ( decExponent < singleMinDecimalExponent-1 ){
        -                /*
        -                 * Lets face it. This is going to be
        -                 * zero. Cut to the chase.
        -                 */
        -                return (isNegative)? -0.0f : 0.0f;
        -            }
        -
        -            /*
        -             * Here, we do 'way too much work, but throwing away
        -             * our partial results, and going and doing the whole
        -             * thing as double, then throwing away half the bits that computes
        -             * when we convert back to float.
        -             *
        -             * The alternative is to reproduce the whole multiple-precision
        -             * algorithm for float precision, or to try to parameterize it
        -             * for common usage. The former will take about 400 lines of code,
        -             * and the latter I tried without success. Thus the semi-hack
        -             * answer here.
        -             */
        -            mustSetRoundDir = !fromHex;
        -            double dValue = doubleValue();
        -            return stickyRound( dValue );
        -        }
        -    }
        -
        -
        -    /*
        -     * All the positive powers of 10 that can be
        -     * represented exactly in double/float.
        -     */
        -    private static final double small10pow[] = {
        -        1.0e0,
        -        1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5,
        -        1.0e6, 1.0e7, 1.0e8, 1.0e9, 1.0e10,
        -        1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15,
        -        1.0e16, 1.0e17, 1.0e18, 1.0e19, 1.0e20,
        -        1.0e21, 1.0e22
        -    };
        -
        -    private static final float singleSmall10pow[] = {
        -        1.0e0f,
        -        1.0e1f, 1.0e2f, 1.0e3f, 1.0e4f, 1.0e5f,
        -        1.0e6f, 1.0e7f, 1.0e8f, 1.0e9f, 1.0e10f
        -    };
        -
        -    private static final double big10pow[] = {
        -        1e16, 1e32, 1e64, 1e128, 1e256 };
        -    private static final double tiny10pow[] = {
        -        1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
        -
        -    private static final int maxSmallTen = small10pow.length-1;
        -    private static final int singleMaxSmallTen = singleSmall10pow.length-1;
        -
        -    private static final int small5pow[] = {
        -        1,
        -        5,
        -        5*5,
        -        5*5*5,
        -        5*5*5*5,
        -        5*5*5*5*5,
        -        5*5*5*5*5*5,
        -        5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5*5*5
        -    };
        -
        -
        -    private static final long long5pow[] = {
        -        1L,
        -        5L,
        -        5L*5,
        -        5L*5*5,
        -        5L*5*5*5,
        -        5L*5*5*5*5,
        -        5L*5*5*5*5*5,
        -        5L*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -    };
        -
        -    // approximately ceil( log2( long5pow[i] ) )
        -    private static final int n5bits[] = {
        -        0,
        -        3,
        -        5,
        -        7,
        -        10,
        -        12,
        -        14,
        -        17,
        -        19,
        -        21,
        -        24,
        -        26,
        -        28,
        -        31,
        -        33,
        -        35,
        -        38,
        -        40,
        -        42,
        -        45,
        -        47,
        -        49,
        -        52,
        -        54,
        -        56,
        -        59,
        -        61,
        -    };
        -
        -    private static final char infinity[] = { 'I', 'n', 'f', 'i', 'n', 'i', 't', 'y' };
        -    private static final char notANumber[] = { 'N', 'a', 'N' };
        -    private static final char zero[] = { '0', '0', '0', '0', '0', '0', '0', '0' };
        -
        -
        -    /*
        -     * Grammar is compatible with hexadecimal floating-point constants
        -     * described in section 6.4.4.2 of the C99 specification.
        -     */
        -    private static Pattern hexFloatPattern = null;
        -    private static synchronized Pattern getHexFloatPattern() {
        -        if (hexFloatPattern == null) {
        -           hexFloatPattern = Pattern.compile(
        +    private static class HexFloatPattern {
        +        /**
        +         * Grammar is compatible with hexadecimal floating-point constants
        +         * described in section 6.4.4.2 of the C99 specification.
        +         */
        +        private static final Pattern VALUE = Pattern.compile(
                            //1           234                   56                7                   8      9
                             "([-+])?0[xX](((\\p{XDigit}+)\\.?)|((\\p{XDigit}*)\\.(\\p{XDigit}+)))[pP]([-+])?(\\p{Digit}+)[fFdD]?"
                             );
        -        }
        -        return hexFloatPattern;
        -    }
        -
        -    /*
        -     * Convert string s to a suitable floating decimal; uses the
        -     * double constructor and set the roundDir variable appropriately
        -     * in case the value is later converted to a float.
        -     */
        -   static FloatingDecimal parseHexString(String s) {
        -        // Verify string is a member of the hexadecimal floating-point
        -        // string language.
        -        Matcher m = getHexFloatPattern().matcher(s);
        -        boolean validInput = m.matches();
        -
        -        if (!validInput) {
        -            // Input does not match pattern
        -            throw new NumberFormatException("For input string: \"" + s + "\"");
        -        } else { // validInput
        -            /*
        -             * We must isolate the sign, significand, and exponent
        -             * fields.  The sign value is straightforward.  Since
        -             * floating-point numbers are stored with a normalized
        -             * representation, the significand and exponent are
        -             * interrelated.
        -             *
        -             * After extracting the sign, we normalized the
        -             * significand as a hexadecimal value, calculating an
        -             * exponent adjust for any shifts made during
        -             * normalization.  If the significand is zero, the
        -             * exponent doesn't need to be examined since the output
        -             * will be zero.
        -             *
        -             * Next the exponent in the input string is extracted.
        -             * Afterwards, the significand is normalized as a *binary*
        -             * value and the input value's normalized exponent can be
        -             * computed.  The significand bits are copied into a
        -             * double significand; if the string has more logical bits
        -             * than can fit in a double, the extra bits affect the
        -             * round and sticky bits which are used to round the final
        -             * value.
        -             */
        -
        -            //  Extract significand sign
        -            String group1 = m.group(1);
        -            double sign = (( group1 == null ) || group1.equals("+"))? 1.0 : -1.0;
        -
        -
        -            //  Extract Significand magnitude
        -            /*
        -             * Based on the form of the significand, calculate how the
        -             * binary exponent needs to be adjusted to create a
        -             * normalized *hexadecimal* floating-point number; that
        -             * is, a number where there is one nonzero hex digit to
        -             * the left of the (hexa)decimal point.  Since we are
        -             * adjusting a binary, not hexadecimal exponent, the
        -             * exponent is adjusted by a multiple of 4.
        -             *
        -             * There are a number of significand scenarios to consider;
        -             * letters are used in indicate nonzero digits:
        -             *
        -             * 1. 000xxxx       =>      x.xxx   normalized
        -             *    increase exponent by (number of x's - 1)*4
        -             *
        -             * 2. 000xxx.yyyy =>        x.xxyyyy        normalized
        -             *    increase exponent by (number of x's - 1)*4
        -             *
        -             * 3. .000yyy  =>   y.yy    normalized
        -             *    decrease exponent by (number of zeros + 1)*4
        -             *
        -             * 4. 000.00000yyy => y.yy normalized
        -             *    decrease exponent by (number of zeros to right of point + 1)*4
        -             *
        -             * If the significand is exactly zero, return a properly
        -             * signed zero.
        -             */
        -
        -            String significandString =null;
        -            int signifLength = 0;
        -            int exponentAdjust = 0;
        -            {
        -                int leftDigits  = 0; // number of meaningful digits to
        -                                     // left of "decimal" point
        -                                     // (leading zeros stripped)
        -                int rightDigits = 0; // number of digits to right of
        -                                     // "decimal" point; leading zeros
        -                                     // must always be accounted for
        -                /*
        -                 * The significand is made up of either
        -                 *
        -                 * 1. group 4 entirely (integer portion only)
        -                 *
        -                 * OR
        -                 *
        -                 * 2. the fractional portion from group 7 plus any
        -                 * (optional) integer portions from group 6.
        -                 */
        -                String group4;
        -                if( (group4 = m.group(4)) != null) {  // Integer-only significand
        -                    // Leading zeros never matter on the integer portion
        -                    significandString = stripLeadingZeros(group4);
        -                    leftDigits = significandString.length();
        -                }
        -                else {
        -                    // Group 6 is the optional integer; leading zeros
        -                    // never matter on the integer portion
        -                    String group6 = stripLeadingZeros(m.group(6));
        -                    leftDigits = group6.length();
        -
        -                    // fraction
        -                    String group7 = m.group(7);
        -                    rightDigits = group7.length();
        -
        -                    // Turn "integer.fraction" into "integer"+"fraction"
        -                    significandString =
        -                        ((group6 == null)?"":group6) + // is the null
        -                        // check necessary?
        -                        group7;
        -                }
        -
        -                significandString = stripLeadingZeros(significandString);
        -                signifLength  = significandString.length();
        -
        -                /*
        -                 * Adjust exponent as described above
        -                 */
        -                if (leftDigits >= 1) {  // Cases 1 and 2
        -                    exponentAdjust = 4*(leftDigits - 1);
        -                } else {                // Cases 3 and 4
        -                    exponentAdjust = -4*( rightDigits - signifLength + 1);
        -                }
        -
        -                // If the significand is zero, the exponent doesn't
        -                // matter; return a properly signed zero.
        -
        -                if (signifLength == 0) { // Only zeros in input
        -                    return new FloatingDecimal(sign * 0.0);
        -                }
        -            }
        -
        -            //  Extract Exponent
        -            /*
        -             * Use an int to read in the exponent value; this should
        -             * provide more than sufficient range for non-contrived
        -             * inputs.  If reading the exponent in as an int does
        -             * overflow, examine the sign of the exponent and
        -             * significand to determine what to do.
        -             */
        -            String group8 = m.group(8);
        -            boolean positiveExponent = ( group8 == null ) || group8.equals("+");
        -            long unsignedRawExponent;
        -            try {
        -                unsignedRawExponent = Integer.parseInt(m.group(9));
        -            }
        -            catch (NumberFormatException e) {
        -                // At this point, we know the exponent is
        -                // syntactically well-formed as a sequence of
        -                // digits.  Therefore, if an NumberFormatException
        -                // is thrown, it must be due to overflowing int's
        -                // range.  Also, at this point, we have already
        -                // checked for a zero significand.  Thus the signs
        -                // of the exponent and significand determine the
        -                // final result:
        -                //
        -                //                      significand
        -                //                      +               -
        -                // exponent     +       +infinity       -infinity
        -                //              -       +0.0            -0.0
        -                return new FloatingDecimal(sign * (positiveExponent ?
        -                                                   Double.POSITIVE_INFINITY : 0.0));
        -            }
        -
        -            long rawExponent =
        -                (positiveExponent ? 1L : -1L) * // exponent sign
        -                unsignedRawExponent;            // exponent magnitude
        -
        -            // Calculate partially adjusted exponent
        -            long exponent = rawExponent + exponentAdjust ;
        -
        -            // Starting copying non-zero bits into proper position in
        -            // a long; copy explicit bit too; this will be masked
        -            // later for normal values.
        -
        -            boolean round = false;
        -            boolean sticky = false;
        -            int bitsCopied=0;
        -            int nextShift=0;
        -            long significand=0L;
        -            // First iteration is different, since we only copy
        -            // from the leading significand bit; one more exponent
        -            // adjust will be needed...
        -
        -            // IMPORTANT: make leadingDigit a long to avoid
        -            // surprising shift semantics!
        -            long leadingDigit = getHexDigit(significandString, 0);
        -
        -            /*
        -             * Left shift the leading digit (53 - (bit position of
        -             * leading 1 in digit)); this sets the top bit of the
        -             * significand to 1.  The nextShift value is adjusted
        -             * to take into account the number of bit positions of
        -             * the leadingDigit actually used.  Finally, the
        -             * exponent is adjusted to normalize the significand
        -             * as a binary value, not just a hex value.
        -             */
        -            if (leadingDigit == 1) {
        -                significand |= leadingDigit << 52;
        -                nextShift = 52 - 4;
        -                /* exponent += 0 */     }
        -            else if (leadingDigit <= 3) { // [2, 3]
        -                significand |= leadingDigit << 51;
        -                nextShift = 52 - 5;
        -                exponent += 1;
        -            }
        -            else if (leadingDigit <= 7) { // [4, 7]
        -                significand |= leadingDigit << 50;
        -                nextShift = 52 - 6;
        -                exponent += 2;
        -            }
        -            else if (leadingDigit <= 15) { // [8, f]
        -                significand |= leadingDigit << 49;
        -                nextShift = 52 - 7;
        -                exponent += 3;
        -            } else {
        -                throw new AssertionError("Result from digit conversion too large!");
        -            }
        -            // The preceding if-else could be replaced by a single
        -            // code block based on the high-order bit set in
        -            // leadingDigit.  Given leadingOnePosition,
        -
        -            // significand |= leadingDigit << (SIGNIFICAND_WIDTH - leadingOnePosition);
        -            // nextShift = 52 - (3 + leadingOnePosition);
        -            // exponent += (leadingOnePosition-1);
        -
        -
        -            /*
        -             * Now the exponent variable is equal to the normalized
        -             * binary exponent.  Code below will make representation
        -             * adjustments if the exponent is incremented after
        -             * rounding (includes overflows to infinity) or if the
        -             * result is subnormal.
        -             */
        -
        -            // Copy digit into significand until the significand can't
        -            // hold another full hex digit or there are no more input
        -            // hex digits.
        -            int i = 0;
        -            for(i = 1;
        -                i < signifLength && nextShift >= 0;
        -                i++) {
        -                long currentDigit = getHexDigit(significandString, i);
        -                significand |= (currentDigit << nextShift);
        -                nextShift-=4;
        -            }
        -
        -            // After the above loop, the bulk of the string is copied.
        -            // Now, we must copy any partial hex digits into the
        -            // significand AND compute the round bit and start computing
        -            // sticky bit.
        -
        -            if ( i < signifLength ) { // at least one hex input digit exists
        -                long currentDigit = getHexDigit(significandString, i);
        -
        -                // from nextShift, figure out how many bits need
        -                // to be copied, if any
        -                switch(nextShift) { // must be negative
        -                case -1:
        -                    // three bits need to be copied in; can
        -                    // set round bit
        -                    significand |= ((currentDigit & 0xEL) >> 1);
        -                    round = (currentDigit & 0x1L)  != 0L;
        -                    break;
        -
        -                case -2:
        -                    // two bits need to be copied in; can
        -                    // set round and start sticky
        -                    significand |= ((currentDigit & 0xCL) >> 2);
        -                    round = (currentDigit &0x2L)  != 0L;
        -                    sticky = (currentDigit & 0x1L) != 0;
        -                    break;
        -
        -                case -3:
        -                    // one bit needs to be copied in
        -                    significand |= ((currentDigit & 0x8L)>>3);
        -                    // Now set round and start sticky, if possible
        -                    round = (currentDigit &0x4L)  != 0L;
        -                    sticky = (currentDigit & 0x3L) != 0;
        -                    break;
        -
        -                case -4:
        -                    // all bits copied into significand; set
        -                    // round and start sticky
        -                    round = ((currentDigit & 0x8L) != 0);  // is top bit set?
        -                    // nonzeros in three low order bits?
        -                    sticky = (currentDigit & 0x7L) != 0;
        -                    break;
        -
        -                default:
        -                    throw new AssertionError("Unexpected shift distance remainder.");
        -                    // break;
        -                }
        -
        -                // Round is set; sticky might be set.
        -
        -                // For the sticky bit, it suffices to check the
        -                // current digit and test for any nonzero digits in
        -                // the remaining unprocessed input.
        -                i++;
        -                while(i < signifLength && !sticky) {
        -                    currentDigit =  getHexDigit(significandString,i);
        -                    sticky = sticky || (currentDigit != 0);
        -                    i++;
        -                }
        -
        -            }
        -            // else all of string was seen, round and sticky are
        -            // correct as false.
        -
        -
        -            // Check for overflow and update exponent accordingly.
        -
        -            if (exponent > DoubleConsts.MAX_EXPONENT) {         // Infinite result
        -                // overflow to properly signed infinity
        -                return new FloatingDecimal(sign * Double.POSITIVE_INFINITY);
        -            } else {  // Finite return value
        -                if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result
        -                    exponent >= DoubleConsts.MIN_EXPONENT) {
        -
        -                    // The result returned in this block cannot be a
        -                    // zero or subnormal; however after the
        -                    // significand is adjusted from rounding, we could
        -                    // still overflow in infinity.
        -
        -                    // AND exponent bits into significand; if the
        -                    // significand is incremented and overflows from
        -                    // rounding, this combination will update the
        -                    // exponent correctly, even in the case of
        -                    // Double.MAX_VALUE overflowing to infinity.
        -
        -                    significand = (( (exponent +
        -                                     (long)DoubleConsts.EXP_BIAS) <<
        -                                     (DoubleConsts.SIGNIFICAND_WIDTH-1))
        -                                   & DoubleConsts.EXP_BIT_MASK) |
        -                        (DoubleConsts.SIGNIF_BIT_MASK & significand);
        -
        -                }  else  {  // Subnormal or zero
        -                    // (exponent < DoubleConsts.MIN_EXPONENT)
        -
        -                    if (exponent < (DoubleConsts.MIN_SUB_EXPONENT -1 )) {
        -                        // No way to round back to nonzero value
        -                        // regardless of significand if the exponent is
        -                        // less than -1075.
        -                        return new FloatingDecimal(sign * 0.0);
        -                    } else { //  -1075 <= exponent <= MIN_EXPONENT -1 = -1023
        -                        /*
        -                         * Find bit position to round to; recompute
        -                         * round and sticky bits, and shift
        -                         * significand right appropriately.
        -                         */
        -
        -                        sticky = sticky || round;
        -                        round = false;
        -
        -                        // Number of bits of significand to preserve is
        -                        // exponent - abs_min_exp +1
        -                        // check:
        -                        // -1075 +1074 + 1 = 0
        -                        // -1023 +1074 + 1 = 52
        -
        -                        int bitsDiscarded = 53 -
        -                            ((int)exponent - DoubleConsts.MIN_SUB_EXPONENT + 1);
        -                        assert bitsDiscarded >= 1 && bitsDiscarded <= 53;
        -
        -                        // What to do here:
        -                        // First, isolate the new round bit
        -                        round = (significand & (1L << (bitsDiscarded -1))) != 0L;
        -                        if (bitsDiscarded > 1) {
        -                            // create mask to update sticky bits; low
        -                            // order bitsDiscarded bits should be 1
        -                            long mask = ~((~0L) << (bitsDiscarded -1));
        -                            sticky = sticky || ((significand & mask) != 0L ) ;
        -                        }
        -
        -                        // Now, discard the bits
        -                        significand = significand >> bitsDiscarded;
        -
        -                        significand = (( ((long)(DoubleConsts.MIN_EXPONENT -1) + // subnorm exp.
        -                                          (long)DoubleConsts.EXP_BIAS) <<
        -                                         (DoubleConsts.SIGNIFICAND_WIDTH-1))
        -                                       & DoubleConsts.EXP_BIT_MASK) |
        -                            (DoubleConsts.SIGNIF_BIT_MASK & significand);
        -                    }
        -                }
        -
        -                // The significand variable now contains the currently
        -                // appropriate exponent bits too.
        -
        -                /*
        -                 * Determine if significand should be incremented;
        -                 * making this determination depends on the least
        -                 * significant bit and the round and sticky bits.
        -                 *
        -                 * Round to nearest even rounding table, adapted from
        -                 * table 4.7 in "Computer Arithmetic" by IsraelKoren.
        -                 * The digit to the left of the "decimal" point is the
        -                 * least significant bit, the digits to the right of
        -                 * the point are the round and sticky bits
        -                 *
        -                 * Number       Round(x)
        -                 * x0.00        x0.
        -                 * x0.01        x0.
        -                 * x0.10        x0.
        -                 * x0.11        x1. = x0. +1
        -                 * x1.00        x1.
        -                 * x1.01        x1.
        -                 * x1.10        x1. + 1
        -                 * x1.11        x1. + 1
        -                 */
        -                boolean incremented = false;
        -                boolean leastZero  = ((significand & 1L) == 0L);
        -                if( (  leastZero  && round && sticky ) ||
        -                    ((!leastZero) && round )) {
        -                    incremented = true;
        -                    significand++;
        -                }
        -
        -                FloatingDecimal fd = new FloatingDecimal(Math.copySign(
        -                                                              Double.longBitsToDouble(significand),
        -                                                              sign));
        -
        -                /*
        -                 * Set roundingDir variable field of fd properly so
        -                 * that the input string can be properly rounded to a
        -                 * float value.  There are two cases to consider:
        -                 *
        -                 * 1. rounding to double discards sticky bit
        -                 * information that would change the result of a float
        -                 * rounding (near halfway case between two floats)
        -                 *
        -                 * 2. rounding to double rounds up when rounding up
        -                 * would not occur when rounding to float.
        -                 *
        -                 * For former case only needs to be considered when
        -                 * the bits rounded away when casting to float are all
        -                 * zero; otherwise, float round bit is properly set
        -                 * and sticky will already be true.
        -                 *
        -                 * The lower exponent bound for the code below is the
        -                 * minimum (normalized) subnormal exponent - 1 since a
        -                 * value with that exponent can round up to the
        -                 * minimum subnormal value and the sticky bit
        -                 * information must be preserved (i.e. case 1).
        -                 */
        -                if ((exponent >= FloatConsts.MIN_SUB_EXPONENT-1) &&
        -                    (exponent <= FloatConsts.MAX_EXPONENT ) ){
        -                    // Outside above exponent range, the float value
        -                    // will be zero or infinity.
        -
        -                    /*
        -                     * If the low-order 28 bits of a rounded double
        -                     * significand are 0, the double could be a
        -                     * half-way case for a rounding to float.  If the
        -                     * double value is a half-way case, the double
        -                     * significand may have to be modified to round
        -                     * the the right float value (see the stickyRound
        -                     * method).  If the rounding to double has lost
        -                     * what would be float sticky bit information, the
        -                     * double significand must be incremented.  If the
        -                     * double value's significand was itself
        -                     * incremented, the float value may end up too
        -                     * large so the increment should be undone.
        -                     */
        -                    if ((significand & 0xfffffffL) ==  0x0L) {
        -                        // For negative values, the sign of the
        -                        // roundDir is the same as for positive values
        -                        // since adding 1 increasing the significand's
        -                        // magnitude and subtracting 1 decreases the
        -                        // significand's magnitude.  If neither round
        -                        // nor sticky is true, the double value is
        -                        // exact and no adjustment is required for a
        -                        // proper float rounding.
        -                        if( round || sticky) {
        -                            if (leastZero) { // prerounding lsb is 0
        -                                // If round and sticky were both true,
        -                                // and the least significant
        -                                // significand bit were 0, the rounded
        -                                // significand would not have its
        -                                // low-order bits be zero.  Therefore,
        -                                // we only need to adjust the
        -                                // significand if round XOR sticky is
        -                                // true.
        -                                if (round ^ sticky) {
        -                                    fd.roundDir =  1;
        -                                }
        -                            }
        -                            else { // prerounding lsb is 1
        -                                // If the prerounding lsb is 1 and the
        -                                // resulting significand has its
        -                                // low-order bits zero, the significand
        -                                // was incremented.  Here, we undo the
        -                                // increment, which will ensure the
        -                                // right guard and sticky bits for the
        -                                // float rounding.
        -                                if (round)
        -                                    fd.roundDir =  -1;
        -                            }
        -                        }
        -                    }
        -                }
        -
        -                fd.fromHex = true;
        -                return fd;
        -            }
        -        }
             }
         
             /**
        -     * Return s with any leading zeros removed.
        +     * Converts string s to a suitable floating decimal; uses the
        +     * double constructor and sets the roundDir variable appropriately
        +     * in case the value is later converted to a float.
        +     *
        +     * @param s The String to parse.
        +     */
        +   static ASCIIToBinaryConverter parseHexString(String s) {
        +            // Verify string is a member of the hexadecimal floating-point
        +            // string language.
        +            Matcher m = HexFloatPattern.VALUE.matcher(s);
        +            boolean validInput = m.matches();
        +            if (!validInput) {
        +                // Input does not match pattern
        +                throw new NumberFormatException("For input string: \"" + s + "\"");
        +            } else { // validInput
        +                //
        +                // We must isolate the sign, significand, and exponent
        +                // fields.  The sign value is straightforward.  Since
        +                // floating-point numbers are stored with a normalized
        +                // representation, the significand and exponent are
        +                // interrelated.
        +                //
        +                // After extracting the sign, we normalized the
        +                // significand as a hexadecimal value, calculating an
        +                // exponent adjust for any shifts made during
        +                // normalization.  If the significand is zero, the
        +                // exponent doesn't need to be examined since the output
        +                // will be zero.
        +                //
        +                // Next the exponent in the input string is extracted.
        +                // Afterwards, the significand is normalized as a *binary*
        +                // value and the input value's normalized exponent can be
        +                // computed.  The significand bits are copied into a
        +                // double significand; if the string has more logical bits
        +                // than can fit in a double, the extra bits affect the
        +                // round and sticky bits which are used to round the final
        +                // value.
        +                //
        +                //  Extract significand sign
        +                String group1 = m.group(1);
        +                boolean isNegative = ((group1 != null) && group1.equals("-"));
        +
        +                //  Extract Significand magnitude
        +                //
        +                // Based on the form of the significand, calculate how the
        +                // binary exponent needs to be adjusted to create a
        +                // normalized//hexadecimal* floating-point number; that
        +                // is, a number where there is one nonzero hex digit to
        +                // the left of the (hexa)decimal point.  Since we are
        +                // adjusting a binary, not hexadecimal exponent, the
        +                // exponent is adjusted by a multiple of 4.
        +                //
        +                // There are a number of significand scenarios to consider;
        +                // letters are used in indicate nonzero digits:
        +                //
        +                // 1. 000xxxx       =>      x.xxx   normalized
        +                //    increase exponent by (number of x's - 1)*4
        +                //
        +                // 2. 000xxx.yyyy =>        x.xxyyyy        normalized
        +                //    increase exponent by (number of x's - 1)*4
        +                //
        +                // 3. .000yyy  =>   y.yy    normalized
        +                //    decrease exponent by (number of zeros + 1)*4
        +                //
        +                // 4. 000.00000yyy => y.yy normalized
        +                //    decrease exponent by (number of zeros to right of point + 1)*4
        +                //
        +                // If the significand is exactly zero, return a properly
        +                // signed zero.
        +                //
        +
        +                String significandString = null;
        +                int signifLength = 0;
        +                int exponentAdjust = 0;
        +                {
        +                    int leftDigits = 0; // number of meaningful digits to
        +                    // left of "decimal" point
        +                    // (leading zeros stripped)
        +                    int rightDigits = 0; // number of digits to right of
        +                    // "decimal" point; leading zeros
        +                    // must always be accounted for
        +                    //
        +                    // The significand is made up of either
        +                    //
        +                    // 1. group 4 entirely (integer portion only)
        +                    //
        +                    // OR
        +                    //
        +                    // 2. the fractional portion from group 7 plus any
        +                    // (optional) integer portions from group 6.
        +                    //
        +                    String group4;
        +                    if ((group4 = m.group(4)) != null) {  // Integer-only significand
        +                        // Leading zeros never matter on the integer portion
        +                        significandString = stripLeadingZeros(group4);
        +                        leftDigits = significandString.length();
        +                    } else {
        +                        // Group 6 is the optional integer; leading zeros
        +                        // never matter on the integer portion
        +                        String group6 = stripLeadingZeros(m.group(6));
        +                        leftDigits = group6.length();
        +
        +                        // fraction
        +                        String group7 = m.group(7);
        +                        rightDigits = group7.length();
        +
        +                        // Turn "integer.fraction" into "integer"+"fraction"
        +                        significandString =
        +                                ((group6 == null) ? "" : group6) + // is the null
        +                                        // check necessary?
        +                                        group7;
        +                    }
        +
        +                    significandString = stripLeadingZeros(significandString);
        +                    signifLength = significandString.length();
        +
        +                    //
        +                    // Adjust exponent as described above
        +                    //
        +                    if (leftDigits >= 1) {  // Cases 1 and 2
        +                        exponentAdjust = 4 * (leftDigits - 1);
        +                    } else {                // Cases 3 and 4
        +                        exponentAdjust = -4 * (rightDigits - signifLength + 1);
        +                    }
        +
        +                    // If the significand is zero, the exponent doesn't
        +                    // matter; return a properly signed zero.
        +
        +                    if (signifLength == 0) { // Only zeros in input
        +                        return isNegative ? A2BC_NEGATIVE_ZERO : A2BC_POSITIVE_ZERO;
        +                    }
        +                }
        +
        +                //  Extract Exponent
        +                //
        +                // Use an int to read in the exponent value; this should
        +                // provide more than sufficient range for non-contrived
        +                // inputs.  If reading the exponent in as an int does
        +                // overflow, examine the sign of the exponent and
        +                // significand to determine what to do.
        +                //
        +                String group8 = m.group(8);
        +                boolean positiveExponent = (group8 == null) || group8.equals("+");
        +                long unsignedRawExponent;
        +                try {
        +                    unsignedRawExponent = Integer.parseInt(m.group(9));
        +                }
        +                catch (NumberFormatException e) {
        +                    // At this point, we know the exponent is
        +                    // syntactically well-formed as a sequence of
        +                    // digits.  Therefore, if an NumberFormatException
        +                    // is thrown, it must be due to overflowing int's
        +                    // range.  Also, at this point, we have already
        +                    // checked for a zero significand.  Thus the signs
        +                    // of the exponent and significand determine the
        +                    // final result:
        +                    //
        +                    //                      significand
        +                    //                      +               -
        +                    // exponent     +       +infinity       -infinity
        +                    //              -       +0.0            -0.0
        +                    return isNegative ?
        +                              (positiveExponent ? A2BC_NEGATIVE_INFINITY : A2BC_NEGATIVE_ZERO)
        +                            : (positiveExponent ? A2BC_POSITIVE_INFINITY : A2BC_POSITIVE_ZERO);
        +
        +                }
        +
        +                long rawExponent =
        +                        (positiveExponent ? 1L : -1L) * // exponent sign
        +                                unsignedRawExponent;            // exponent magnitude
        +
        +                // Calculate partially adjusted exponent
        +                long exponent = rawExponent + exponentAdjust;
        +
        +                // Starting copying non-zero bits into proper position in
        +                // a long; copy explicit bit too; this will be masked
        +                // later for normal values.
        +
        +                boolean round = false;
        +                boolean sticky = false;
        +                int nextShift = 0;
        +                long significand = 0L;
        +                // First iteration is different, since we only copy
        +                // from the leading significand bit; one more exponent
        +                // adjust will be needed...
        +
        +                // IMPORTANT: make leadingDigit a long to avoid
        +                // surprising shift semantics!
        +                long leadingDigit = getHexDigit(significandString, 0);
        +
        +                //
        +                // Left shift the leading digit (53 - (bit position of
        +                // leading 1 in digit)); this sets the top bit of the
        +                // significand to 1.  The nextShift value is adjusted
        +                // to take into account the number of bit positions of
        +                // the leadingDigit actually used.  Finally, the
        +                // exponent is adjusted to normalize the significand
        +                // as a binary value, not just a hex value.
        +                //
        +                if (leadingDigit == 1) {
        +                    significand |= leadingDigit << 52;
        +                    nextShift = 52 - 4;
        +                    // exponent += 0
        +                } else if (leadingDigit <= 3) { // [2, 3]
        +                    significand |= leadingDigit << 51;
        +                    nextShift = 52 - 5;
        +                    exponent += 1;
        +                } else if (leadingDigit <= 7) { // [4, 7]
        +                    significand |= leadingDigit << 50;
        +                    nextShift = 52 - 6;
        +                    exponent += 2;
        +                } else if (leadingDigit <= 15) { // [8, f]
        +                    significand |= leadingDigit << 49;
        +                    nextShift = 52 - 7;
        +                    exponent += 3;
        +                } else {
        +                    throw new AssertionError("Result from digit conversion too large!");
        +                }
        +                // The preceding if-else could be replaced by a single
        +                // code block based on the high-order bit set in
        +                // leadingDigit.  Given leadingOnePosition,
        +
        +                // significand |= leadingDigit << (SIGNIFICAND_WIDTH - leadingOnePosition);
        +                // nextShift = 52 - (3 + leadingOnePosition);
        +                // exponent += (leadingOnePosition-1);
        +
        +                //
        +                // Now the exponent variable is equal to the normalized
        +                // binary exponent.  Code below will make representation
        +                // adjustments if the exponent is incremented after
        +                // rounding (includes overflows to infinity) or if the
        +                // result is subnormal.
        +                //
        +
        +                // Copy digit into significand until the significand can't
        +                // hold another full hex digit or there are no more input
        +                // hex digits.
        +                int i = 0;
        +                for (i = 1;
        +                     i < signifLength && nextShift >= 0;
        +                     i++) {
        +                    long currentDigit = getHexDigit(significandString, i);
        +                    significand |= (currentDigit << nextShift);
        +                    nextShift -= 4;
        +                }
        +
        +                // After the above loop, the bulk of the string is copied.
        +                // Now, we must copy any partial hex digits into the
        +                // significand AND compute the round bit and start computing
        +                // sticky bit.
        +
        +                if (i < signifLength) { // at least one hex input digit exists
        +                    long currentDigit = getHexDigit(significandString, i);
        +
        +                    // from nextShift, figure out how many bits need
        +                    // to be copied, if any
        +                    switch (nextShift) { // must be negative
        +                        case -1:
        +                            // three bits need to be copied in; can
        +                            // set round bit
        +                            significand |= ((currentDigit & 0xEL) >> 1);
        +                            round = (currentDigit & 0x1L) != 0L;
        +                            break;
        +
        +                        case -2:
        +                            // two bits need to be copied in; can
        +                            // set round and start sticky
        +                            significand |= ((currentDigit & 0xCL) >> 2);
        +                            round = (currentDigit & 0x2L) != 0L;
        +                            sticky = (currentDigit & 0x1L) != 0;
        +                            break;
        +
        +                        case -3:
        +                            // one bit needs to be copied in
        +                            significand |= ((currentDigit & 0x8L) >> 3);
        +                            // Now set round and start sticky, if possible
        +                            round = (currentDigit & 0x4L) != 0L;
        +                            sticky = (currentDigit & 0x3L) != 0;
        +                            break;
        +
        +                        case -4:
        +                            // all bits copied into significand; set
        +                            // round and start sticky
        +                            round = ((currentDigit & 0x8L) != 0);  // is top bit set?
        +                            // nonzeros in three low order bits?
        +                            sticky = (currentDigit & 0x7L) != 0;
        +                            break;
        +
        +                        default:
        +                            throw new AssertionError("Unexpected shift distance remainder.");
        +                            // break;
        +                    }
        +
        +                    // Round is set; sticky might be set.
        +
        +                    // For the sticky bit, it suffices to check the
        +                    // current digit and test for any nonzero digits in
        +                    // the remaining unprocessed input.
        +                    i++;
        +                    while (i < signifLength && !sticky) {
        +                        currentDigit = getHexDigit(significandString, i);
        +                        sticky = sticky || (currentDigit != 0);
        +                        i++;
        +                    }
        +
        +                }
        +                // else all of string was seen, round and sticky are
        +                // correct as false.
        +
        +                // Float calculations
        +                int floatBits = isNegative ? FloatConsts.SIGN_BIT_MASK : 0;
        +                if (exponent >= FloatConsts.MIN_EXPONENT) {
        +                    if (exponent > FloatConsts.MAX_EXPONENT) {
        +                        // Float.POSITIVE_INFINITY
        +                        floatBits |= FloatConsts.EXP_BIT_MASK;
        +                    } else {
        +                        int threshShift = DoubleConsts.SIGNIFICAND_WIDTH - FloatConsts.SIGNIFICAND_WIDTH - 1;
        +                        boolean floatSticky = (significand & ((1L << threshShift) - 1)) != 0 || round || sticky;
        +                        int iValue = (int) (significand >>> threshShift);
        +                        if ((iValue & 3) != 1 || floatSticky) {
        +                            iValue++;
        +                        }
        +                        floatBits |= (((((int) exponent) + (FloatConsts.EXP_BIAS - 1))) << SINGLE_EXP_SHIFT) + (iValue >> 1);
        +                    }
        +                } else {
        +                    if (exponent < FloatConsts.MIN_SUB_EXPONENT - 1) {
        +                        // 0
        +                    } else {
        +                        // exponent == -127 ==> threshShift = 53 - 2 + (-149) - (-127) = 53 - 24
        +                        int threshShift = (int) ((DoubleConsts.SIGNIFICAND_WIDTH - 2 + FloatConsts.MIN_SUB_EXPONENT) - exponent);
        +                        assert threshShift >= DoubleConsts.SIGNIFICAND_WIDTH - FloatConsts.SIGNIFICAND_WIDTH;
        +                        assert threshShift < DoubleConsts.SIGNIFICAND_WIDTH;
        +                        boolean floatSticky = (significand & ((1L << threshShift) - 1)) != 0 || round || sticky;
        +                        int iValue = (int) (significand >>> threshShift);
        +                        if ((iValue & 3) != 1 || floatSticky) {
        +                            iValue++;
        +                        }
        +                        floatBits |= iValue >> 1;
        +                    }
        +                }
        +                float fValue = Float.intBitsToFloat(floatBits);
        +
        +                // Check for overflow and update exponent accordingly.
        +                if (exponent > DoubleConsts.MAX_EXPONENT) {         // Infinite result
        +                    // overflow to properly signed infinity
        +                    return isNegative ? A2BC_NEGATIVE_INFINITY : A2BC_POSITIVE_INFINITY;
        +                } else {  // Finite return value
        +                    if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result
        +                            exponent >= DoubleConsts.MIN_EXPONENT) {
        +
        +                        // The result returned in this block cannot be a
        +                        // zero or subnormal; however after the
        +                        // significand is adjusted from rounding, we could
        +                        // still overflow in infinity.
        +
        +                        // AND exponent bits into significand; if the
        +                        // significand is incremented and overflows from
        +                        // rounding, this combination will update the
        +                        // exponent correctly, even in the case of
        +                        // Double.MAX_VALUE overflowing to infinity.
        +
        +                        significand = ((( exponent +
        +                                (long) DoubleConsts.EXP_BIAS) <<
        +                                (DoubleConsts.SIGNIFICAND_WIDTH - 1))
        +                                & DoubleConsts.EXP_BIT_MASK) |
        +                                (DoubleConsts.SIGNIF_BIT_MASK & significand);
        +
        +                    } else {  // Subnormal or zero
        +                        // (exponent < DoubleConsts.MIN_EXPONENT)
        +
        +                        if (exponent < (DoubleConsts.MIN_SUB_EXPONENT - 1)) {
        +                            // No way to round back to nonzero value
        +                            // regardless of significand if the exponent is
        +                            // less than -1075.
        +                            return isNegative ? A2BC_NEGATIVE_ZERO : A2BC_POSITIVE_ZERO;
        +                        } else { //  -1075 <= exponent <= MIN_EXPONENT -1 = -1023
        +                            //
        +                            // Find bit position to round to; recompute
        +                            // round and sticky bits, and shift
        +                            // significand right appropriately.
        +                            //
        +
        +                            sticky = sticky || round;
        +                            round = false;
        +
        +                            // Number of bits of significand to preserve is
        +                            // exponent - abs_min_exp +1
        +                            // check:
        +                            // -1075 +1074 + 1 = 0
        +                            // -1023 +1074 + 1 = 52
        +
        +                            int bitsDiscarded = 53 -
        +                                    ((int) exponent - DoubleConsts.MIN_SUB_EXPONENT + 1);
        +                            assert bitsDiscarded >= 1 && bitsDiscarded <= 53;
        +
        +                            // What to do here:
        +                            // First, isolate the new round bit
        +                            round = (significand & (1L << (bitsDiscarded - 1))) != 0L;
        +                            if (bitsDiscarded > 1) {
        +                                // create mask to update sticky bits; low
        +                                // order bitsDiscarded bits should be 1
        +                                long mask = ~((~0L) << (bitsDiscarded - 1));
        +                                sticky = sticky || ((significand & mask) != 0L);
        +                            }
        +
        +                            // Now, discard the bits
        +                            significand = significand >> bitsDiscarded;
        +
        +                            significand = ((((long) (DoubleConsts.MIN_EXPONENT - 1) + // subnorm exp.
        +                                    (long) DoubleConsts.EXP_BIAS) <<
        +                                    (DoubleConsts.SIGNIFICAND_WIDTH - 1))
        +                                    & DoubleConsts.EXP_BIT_MASK) |
        +                                    (DoubleConsts.SIGNIF_BIT_MASK & significand);
        +                        }
        +                    }
        +
        +                    // The significand variable now contains the currently
        +                    // appropriate exponent bits too.
        +
        +                    //
        +                    // Determine if significand should be incremented;
        +                    // making this determination depends on the least
        +                    // significant bit and the round and sticky bits.
        +                    //
        +                    // Round to nearest even rounding table, adapted from
        +                    // table 4.7 in "Computer Arithmetic" by IsraelKoren.
        +                    // The digit to the left of the "decimal" point is the
        +                    // least significant bit, the digits to the right of
        +                    // the point are the round and sticky bits
        +                    //
        +                    // Number       Round(x)
        +                    // x0.00        x0.
        +                    // x0.01        x0.
        +                    // x0.10        x0.
        +                    // x0.11        x1. = x0. +1
        +                    // x1.00        x1.
        +                    // x1.01        x1.
        +                    // x1.10        x1. + 1
        +                    // x1.11        x1. + 1
        +                    //
        +                    boolean leastZero = ((significand & 1L) == 0L);
        +                    if ((leastZero && round && sticky) ||
        +                            ((!leastZero) && round)) {
        +                        significand++;
        +                    }
        +
        +                    double value = isNegative ?
        +                            Double.longBitsToDouble(significand | DoubleConsts.SIGN_BIT_MASK) :
        +                            Double.longBitsToDouble(significand );
        +
        +                    return new PreparedASCIIToBinaryBuffer(value, fValue);
        +                }
        +            }
        +    }
        +
        +    /**
        +     * Returns s with any leading zeros removed.
              */
             static String stripLeadingZeros(String s) {
        -        return  s.replaceFirst("^0+", "");
        +//        return  s.replaceFirst("^0+", "");
        +        if(!s.isEmpty() && s.charAt(0)=='0') {
        +            for(int i=1; iposition
        +     * Extracts a hexadecimal digit from position position
              * of string s.
              */
             static int getHexDigit(String s, int position) {
        @@ -2433,6 +2538,4 @@ public class FloatingDecimal{
                 }
                 return value;
             }
        -
        -
         }
        diff --git a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java
        index 5532b92c3ea..fc53920e398 100644
        --- a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java
        +++ b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -25,960 +25,80 @@
         
         package sun.misc;
         
        -import sun.misc.DoubleConsts;
        -import sun.misc.FloatConsts;
        -import java.util.regex.*;
        +import java.util.Arrays;
         
         public class FormattedFloatingDecimal{
        -    boolean     isExceptional;
        -    boolean     isNegative;
        -    int         decExponent;  // value set at construction, then immutable
        -    int         decExponentRounded;
        -    char        digits[];
        -    int         nDigits;
        -    int         bigIntExp;
        -    int         bigIntNBits;
        -    boolean     mustSetRoundDir = false;
        -    boolean     fromHex = false;
        -    int         roundDir = 0; // set by doubleValue
        -    int         precision;    // number of digits to the right of decimal
         
             public enum Form { SCIENTIFIC, COMPATIBLE, DECIMAL_FLOAT, GENERAL };
         
        -    private Form form;
         
        -    private     FormattedFloatingDecimal( boolean negSign, int decExponent, char []digits, int n, boolean e, int precision, Form form )
        -    {
        -        isNegative = negSign;
        -        isExceptional = e;
        -        this.decExponent = decExponent;
        -        this.digits = digits;
        -        this.nDigits = n;
        -        this.precision = precision;
        -        this.form = form;
        +    public static FormattedFloatingDecimal valueOf(double d, int precision, Form form){
        +        FloatingDecimal.BinaryToASCIIConverter fdConverter =
        +                FloatingDecimal.getBinaryToASCIIConverter(d, form == Form.COMPATIBLE);
        +        return new FormattedFloatingDecimal(precision,form, fdConverter);
             }
         
        -    /*
        -     * Constants of the implementation
        -     * Most are IEEE-754 related.
        -     * (There are more really boring constants at the end.)
        -     */
        -    static final long   signMask = 0x8000000000000000L;
        -    static final long   expMask  = 0x7ff0000000000000L;
        -    static final long   fractMask= ~(signMask|expMask);
        -    static final int    expShift = 52;
        -    static final int    expBias  = 1023;
        -    static final long   fractHOB = ( 1L< 0L ) { // i.e. while ((v&highbit) == 0L )
        -            v <<= 1;
        -        }
        -
        -        int n = 0;
        -        while (( v & lowbytes ) != 0L ){
        -            v <<= 8;
        -            n += 8;
        -        }
        -        while ( v != 0L ){
        -            v <<= 1;
        -            n += 1;
        -        }
        -        return n;
        -    }
        -
        -    /*
        -     * Keep big powers of 5 handy for future reference.
        -     */
        -    private static FDBigInt b5p[];
        -
        -    private static synchronized FDBigInt
        -    big5pow( int p ){
        -        assert p >= 0 : p; // negative power of 5
        -        if ( b5p == null ){
        -            b5p = new FDBigInt[ p+1 ];
        -        }else if (b5p.length <= p ){
        -            FDBigInt t[] = new FDBigInt[ p+1 ];
        -            System.arraycopy( b5p, 0, t, 0, b5p.length );
        -            b5p = t;
        -        }
        -        if ( b5p[p] != null )
        -            return b5p[p];
        -        else if ( p < small5pow.length )
        -            return b5p[p] = new FDBigInt( small5pow[p] );
        -        else if ( p < long5pow.length )
        -            return b5p[p] = new FDBigInt( long5pow[p] );
        -        else {
        -            // construct the value.
        -            // recursively.
        -            int q, r;
        -            // in order to compute 5^p,
        -            // compute its square root, 5^(p/2) and square.
        -            // or, let q = p / 2, r = p -q, then
        -            // 5^p = 5^(q+r) = 5^q * 5^r
        -            q = p >> 1;
        -            r = p - q;
        -            FDBigInt bigq =  b5p[q];
        -            if ( bigq == null )
        -                bigq = big5pow ( q );
        -            if ( r < small5pow.length ){
        -                return (b5p[p] = bigq.mult( small5pow[r] ) );
        -            }else{
        -                FDBigInt bigr = b5p[ r ];
        -                if ( bigr == null )
        -                    bigr = big5pow( r );
        -                return (b5p[p] = bigq.mult( bigr ) );
        -            }
        -        }
        -    }
        -
        -    //
        -    // a common operation
        -    //
        -    private static FDBigInt
        -    multPow52( FDBigInt v, int p5, int p2 ){
        -        if ( p5 != 0 ){
        -            if ( p5 < small5pow.length ){
        -                v = v.mult( small5pow[p5] );
        -            } else {
        -                v = v.mult( big5pow( p5 ) );
        -            }
        -        }
        -        if ( p2 != 0 ){
        -            v.lshiftMe( p2 );
        -        }
        -        return v;
        -    }
        -
        -    //
        -    // another common operation
        -    //
        -    private static FDBigInt
        -    constructPow52( int p5, int p2 ){
        -        FDBigInt v = new FDBigInt( big5pow( p5 ) );
        -        if ( p2 != 0 ){
        -            v.lshiftMe( p2 );
        -        }
        -        return v;
        -    }
        -
        -    /*
        -     * Make a floating double into a FDBigInt.
        -     * This could also be structured as a FDBigInt
        -     * constructor, but we'd have to build a lot of knowledge
        -     * about floating-point representation into it, and we don't want to.
        -     *
        -     * AS A SIDE EFFECT, THIS METHOD WILL SET THE INSTANCE VARIABLES
        -     * bigIntExp and bigIntNBits
        -     *
        -     */
        -    private FDBigInt
        -    doubleToBigInt( double dval ){
        -        long lbits = Double.doubleToLongBits( dval ) & ~signMask;
        -        int binexp = (int)(lbits >>> expShift);
        -        lbits &= fractMask;
        -        if ( binexp > 0 ){
        -            lbits |= fractHOB;
        -        } else {
        -            assert lbits != 0L : lbits; // doubleToBigInt(0.0)
        -            binexp +=1;
        -            while ( (lbits & fractHOB ) == 0L){
        -                lbits <<= 1;
        -                binexp -= 1;
        -            }
        -        }
        -        binexp -= expBias;
        -        int nbits = countBits( lbits );
        -        /*
        -         * We now know where the high-order 1 bit is,
        -         * and we know how many there are.
        -         */
        -        int lowOrderZeros = expShift+1-nbits;
        -        lbits >>>= lowOrderZeros;
        -
        -        bigIntExp = binexp+1-nbits;
        -        bigIntNBits = nbits;
        -        return new FDBigInt( lbits );
        -    }
        -
        -    /*
        -     * Compute a number that is the ULP of the given value,
        -     * for purposes of addition/subtraction. Generally easy.
        -     * More difficult if subtracting and the argument
        -     * is a normalized a power of 2, as the ULP changes at these points.
        -     */
        -    private static double ulp( double dval, boolean subtracting ){
        -        long lbits = Double.doubleToLongBits( dval ) & ~signMask;
        -        int binexp = (int)(lbits >>> expShift);
        -        double ulpval;
        -        if ( subtracting && ( binexp >= expShift ) && ((lbits&fractMask) == 0L) ){
        -            // for subtraction from normalized, powers of 2,
        -            // use next-smaller exponent
        -            binexp -= 1;
        -        }
        -        if ( binexp > expShift ){
        -            ulpval = Double.longBitsToDouble( ((long)(binexp-expShift))< 0L (not zero, nor negative).
        -     *
        -     * The only reason that we develop the digits here, rather than
        -     * calling on Long.toString() is that we can do it a little faster,
        -     * and besides want to treat trailing 0s specially. If Long.toString
        -     * changes, we should re-evaluate this strategy!
        -     */
        -    private void
        -    developLongDigits( int decExponent, long lvalue, long insignificant ){
        -        char digits[];
        -        int  ndigits;
        -        int  digitno;
        -        int  c;
        -        //
        -        // Discard non-significant low-order bits, while rounding,
        -        // up to insignificant value.
        -        int i;
        -        for ( i = 0; insignificant >= 10L; i++ )
        -            insignificant /= 10L;
        -        if ( i != 0 ){
        -            long pow10 = long5pow[i] << i; // 10^i == 5^i * 2^i;
        -            long residue = lvalue % pow10;
        -            lvalue /= pow10;
        -            decExponent += i;
        -            if ( residue >= (pow10>>1) ){
        -                // round up based on the low-order bits we're discarding
        -                lvalue++;
        -            }
        -        }
        -        if ( lvalue <= Integer.MAX_VALUE ){
        -            assert lvalue > 0L : lvalue; // lvalue <= 0
        -            // even easier subcase!
        -            // can do int arithmetic rather than long!
        -            int  ivalue = (int)lvalue;
        -            ndigits = 10;
        -            digits = perThreadBuffer.get();
        -            digitno = ndigits-1;
        -            c = ivalue%10;
        -            ivalue /= 10;
        -            while ( c == 0 ){
        -                decExponent++;
        -                c = ivalue%10;
        -                ivalue /= 10;
        -            }
        -            while ( ivalue != 0){
        -                digits[digitno--] = (char)(c+'0');
        -                decExponent++;
        -                c = ivalue%10;
        -                ivalue /= 10;
        -            }
        -            digits[digitno] = (char)(c+'0');
        -        } else {
        -            // same algorithm as above (same bugs, too )
        -            // but using long arithmetic.
        -            ndigits = 20;
        -            digits = perThreadBuffer.get();
        -            digitno = ndigits-1;
        -            c = (int)(lvalue%10L);
        -            lvalue /= 10L;
        -            while ( c == 0 ){
        -                decExponent++;
        -                c = (int)(lvalue%10L);
        -                lvalue /= 10L;
        -            }
        -            while ( lvalue != 0L ){
        -                digits[digitno--] = (char)(c+'0');
        -                decExponent++;
        -                c = (int)(lvalue%10L);
        -                lvalue /= 10;
        -            }
        -            digits[digitno] = (char)(c+'0');
        -        }
        -        char result [];
        -        ndigits -= digitno;
        -        result = new char[ ndigits ];
        -        System.arraycopy( digits, digitno, result, 0, ndigits );
        -        this.digits = result;
        -        this.decExponent = decExponent+1;
        -        this.nDigits = ndigits;
        -    }
        -
        -    //
        -    // add one to the least significant digit.
        -    // in the unlikely event there is a carry out,
        -    // deal with it.
        -    // assert that this will only happen where there
        -    // is only one digit, e.g. (float)1e-44 seems to do it.
        -    //
        -    private void
        -    roundup(){
        -        int i;
        -        int q = digits[ i = (nDigits-1)];
        -        if ( q == '9' ){
        -            while ( q == '9' && i > 0 ){
        -                digits[i] = '0';
        -                q = digits[--i];
        -            }
        -            if ( q == '9' ){
        -                // carryout! High-order 1, rest 0s, larger exp.
        -                decExponent += 1;
        -                digits[0] = '1';
        -                return;
        -            }
        -            // else fall through.
        -        }
        -        digits[i] = (char)(q+1);
        -    }
        -
        -    // Given the desired number of digits predict the result's exponent.
        -    private int checkExponent(int length) {
        -        if (length >= nDigits || length < 0)
        -            return decExponent;
        -
        -        for (int i = 0; i < length; i++)
        -            if (digits[i] != '9')
        -                // a '9' anywhere in digits will absorb the round
        -                return decExponent;
        -        return decExponent + (digits[length] >= '5' ? 1 : 0);
        -    }
        -
        -    // Unlike roundup(), this method does not modify digits.  It also
        -    // rounds at a particular precision.
        -    private char [] applyPrecision(int length) {
        -        char [] result = new char[nDigits];
        -        for (int i = 0; i < result.length; i++) result[i] = '0';
        -
        -        if (length >= nDigits || length < 0) {
        -            // no rounding necessary
        -            System.arraycopy(digits, 0, result, 0, nDigits);
        -            return result;
        -        }
        -        if (length == 0) {
        -            // only one digit (0 or 1) is returned because the precision
        -            // excludes all significant digits
        -            if (digits[0] >= '5') {
        -                result[0] = '1';
        -            }
        -            return result;
        -        }
        -
        -        int i = length;
        -        int q = digits[i];
        -        if (q >= '5' && i > 0) {
        -            q = digits[--i];
        -            if ( q == '9' ) {
        -                while ( q == '9' && i > 0 ){
        -                    q = digits[--i];
        +    private static final ThreadLocal threadLocalCharBuffer =
        +            new ThreadLocal() {
        +                @Override
        +                protected Object initialValue() {
        +                    return new char[20];
                         }
        -                if ( q == '9' ){
        -                    // carryout! High-order 1, rest 0s, larger exp.
        -                    result[0] = '1';
        -                    return result;
        -                }
        -            }
        -            result[i] = (char)(q + 1);
        -        }
        -        while (--i >= 0) {
        -            result[i] = digits[i];
        -        }
        -        return result;
        +            };
        +
        +    private static char[] getBuffer(){
        +        return (char[]) threadLocalCharBuffer.get();
             }
         
        -    /*
        -     * FIRST IMPORTANT CONSTRUCTOR: DOUBLE
        -     */
        -    public FormattedFloatingDecimal( double d )
        -    {
        -        this(d, Integer.MAX_VALUE, Form.COMPATIBLE);
        -    }
        -
        -    public FormattedFloatingDecimal( double d, int precision, Form form )
        -    {
        -        long    dBits = Double.doubleToLongBits( d );
        -        long    fractBits;
        -        int     binExp;
        -        int     nSignificantBits;
        -
        -        this.precision = precision;
        -        this.form      = form;
        -
        -        // discover and delete sign
        -        if ( (dBits&signMask) != 0 ){
        -            isNegative = true;
        -            dBits ^= signMask;
        -        } else {
        -            isNegative = false;
        -        }
        -        // Begin to unpack
        -        // Discover obvious special cases of NaN and Infinity.
        -        binExp = (int)( (dBits&expMask) >> expShift );
        -        fractBits = dBits&fractMask;
        -        if ( binExp == (int)(expMask>>expShift) ) {
        -            isExceptional = true;
        -            if ( fractBits == 0L ){
        -                digits =  infinity;
        -            } else {
        -                digits = notANumber;
        -                isNegative = false; // NaN has no sign!
        -            }
        -            nDigits = digits.length;
        +    private FormattedFloatingDecimal(int precision, Form form, FloatingDecimal.BinaryToASCIIConverter fdConverter) {
        +        if (fdConverter.isExceptional()) {
        +            this.mantissa = fdConverter.toJavaFormatString().toCharArray();
        +            this.exponent = null;
                     return;
                 }
        -        isExceptional = false;
        -        // Finish unpacking
        -        // Normalize denormalized numbers.
        -        // Insert assumed high-order bit for normalized numbers.
        -        // Subtract exponent bias.
        -        if ( binExp == 0 ){
        -            if ( fractBits == 0L ){
        -                // not a denorm, just a 0!
        -                decExponent = 0;
        -                digits = zero;
        -                nDigits = 1;
        -                return;
        -            }
        -            while ( (fractBits&fractHOB) == 0L ){
        -                fractBits <<= 1;
        -                binExp -= 1;
        -            }
        -            nSignificantBits = expShift + binExp +1; // recall binExp is  - shift count.
        -            binExp += 1;
        -        } else {
        -            fractBits |= fractHOB;
        -            nSignificantBits = expShift+1;
        -        }
        -        binExp -= expBias;
        -        // call the routine that actually does all the hard work.
        -        dtoa( binExp, fractBits, nSignificantBits );
        -    }
        -
        -    /*
        -     * SECOND IMPORTANT CONSTRUCTOR: SINGLE
        -     */
        -    public FormattedFloatingDecimal( float f )
        -    {
        -        this(f, Integer.MAX_VALUE, Form.COMPATIBLE);
        -    }
        -    public FormattedFloatingDecimal( float f, int precision, Form form )
        -    {
        -        int     fBits = Float.floatToIntBits( f );
        -        int     fractBits;
        -        int     binExp;
        -        int     nSignificantBits;
        -
        -        this.precision = precision;
        -        this.form      = form;
        -
        -        // discover and delete sign
        -        if ( (fBits&singleSignMask) != 0 ){
        -            isNegative = true;
        -            fBits ^= singleSignMask;
        -        } else {
        -            isNegative = false;
        -        }
        -        // Begin to unpack
        -        // Discover obvious special cases of NaN and Infinity.
        -        binExp = (fBits&singleExpMask) >> singleExpShift;
        -        fractBits = fBits&singleFractMask;
        -        if ( binExp == (singleExpMask>>singleExpShift) ) {
        -            isExceptional = true;
        -            if ( fractBits == 0L ){
        -                digits =  infinity;
        -            } else {
        -                digits = notANumber;
        -                isNegative = false; // NaN has no sign!
        -            }
        -            nDigits = digits.length;
        -            return;
        -        }
        -        isExceptional = false;
        -        // Finish unpacking
        -        // Normalize denormalized numbers.
        -        // Insert assumed high-order bit for normalized numbers.
        -        // Subtract exponent bias.
        -        if ( binExp == 0 ){
        -            if ( fractBits == 0 ){
        -                // not a denorm, just a 0!
        -                decExponent = 0;
        -                digits = zero;
        -                nDigits = 1;
        -                return;
        -            }
        -            while ( (fractBits&singleFractHOB) == 0 ){
        -                fractBits <<= 1;
        -                binExp -= 1;
        -            }
        -            nSignificantBits = singleExpShift + binExp +1; // recall binExp is  - shift count.
        -            binExp += 1;
        -        } else {
        -            fractBits |= singleFractHOB;
        -            nSignificantBits = singleExpShift+1;
        -        }
        -        binExp -= singleExpBias;
        -        // call the routine that actually does all the hard work.
        -        dtoa( binExp, ((long)fractBits)<<(expShift-singleExpShift), nSignificantBits );
        -    }
        -
        -    private void
        -    dtoa( int binExp, long fractBits, int nSignificantBits )
        -    {
        -        int     nFractBits; // number of significant bits of fractBits;
        -        int     nTinyBits;  // number of these to the right of the point.
        -        int     decExp;
        -
        -        // Examine number. Determine if it is an easy case,
        -        // which we can do pretty trivially using float/long conversion,
        -        // or whether we must do real work.
        -        nFractBits = countBits( fractBits );
        -        nTinyBits = Math.max( 0, nFractBits - binExp - 1 );
        -        if ( binExp <= maxSmallBinExp && binExp >= minSmallBinExp ){
        -            // Look more closely at the number to decide if,
        -            // with scaling by 10^nTinyBits, the result will fit in
        -            // a long.
        -            if ( (nTinyBits < long5pow.length) && ((nFractBits + n5bits[nTinyBits]) < 64 ) ){
        -                /*
        -                 * We can do this:
        -                 * take the fraction bits, which are normalized.
        -                 * (a) nTinyBits == 0: Shift left or right appropriately
        -                 *     to align the binary point at the extreme right, i.e.
        -                 *     where a long int point is expected to be. The integer
        -                 *     result is easily converted to a string.
        -                 * (b) nTinyBits > 0: Shift right by expShift-nFractBits,
        -                 *     which effectively converts to long and scales by
        -                 *     2^nTinyBits. Then multiply by 5^nTinyBits to
        -                 *     complete the scaling. We know this won't overflow
        -                 *     because we just counted the number of bits necessary
        -                 *     in the result. The integer you get from this can
        -                 *     then be converted to a string pretty easily.
        -                 */
        -                long halfULP;
        -                if ( nTinyBits == 0 ) {
        -                    if ( binExp > nSignificantBits ){
        -                        halfULP = 1L << ( binExp-nSignificantBits-1);
        -                    } else {
        -                        halfULP = 0L;
        -                    }
        -                    if ( binExp >= expShift ){
        -                        fractBits <<= (binExp-expShift);
        -                    } else {
        -                        fractBits >>>= (expShift-binExp) ;
        -                    }
        -                    developLongDigits( 0, fractBits, halfULP );
        -                    return;
        -                }
        -                /*
        -                 * The following causes excess digits to be printed
        -                 * out in the single-float case. Our manipulation of
        -                 * halfULP here is apparently not correct. If we
        -                 * better understand how this works, perhaps we can
        -                 * use this special case again. But for the time being,
        -                 * we do not.
        -                 * else {
        -                 *     fractBits >>>= expShift+1-nFractBits;
        -                 *     fractBits *= long5pow[ nTinyBits ];
        -                 *     halfULP = long5pow[ nTinyBits ] >> (1+nSignificantBits-nFractBits);
        -                 *     developLongDigits( -nTinyBits, fractBits, halfULP );
        -                 *     return;
        -                 * }
        -                 */
        -            }
        -        }
        -        /*
        -         * This is the hard case. We are going to compute large positive
        -         * integers B and S and integer decExp, s.t.
        -         *      d = ( B / S ) * 10^decExp
        -         *      1 <= B / S < 10
        -         * Obvious choices are:
        -         *      decExp = floor( log10(d) )
        -         *      B      = d * 2^nTinyBits * 10^max( 0, -decExp )
        -         *      S      = 10^max( 0, decExp) * 2^nTinyBits
        -         * (noting that nTinyBits has already been forced to non-negative)
        -         * I am also going to compute a large positive integer
        -         *      M      = (1/2^nSignificantBits) * 2^nTinyBits * 10^max( 0, -decExp )
        -         * i.e. M is (1/2) of the ULP of d, scaled like B.
        -         * When we iterate through dividing B/S and picking off the
        -         * quotient bits, we will know when to stop when the remainder
        -         * is <= M.
        -         *
        -         * We keep track of powers of 2 and powers of 5.
        -         */
        -
        -        /*
        -         * Estimate decimal exponent. (If it is small-ish,
        -         * we could double-check.)
        -         *
        -         * First, scale the mantissa bits such that 1 <= d2 < 2.
        -         * We are then going to estimate
        -         *          log10(d2) ~=~  (d2-1.5)/1.5 + log(1.5)
        -         * and so we can estimate
        -         *      log10(d) ~=~ log10(d2) + binExp * log10(2)
        -         * take the floor and call it decExp.
        -         * FIXME -- use more precise constants here. It costs no more.
        -         */
        -        double d2 = Double.longBitsToDouble(
        -            expOne | ( fractBits &~ fractHOB ) );
        -        decExp = (int)Math.floor(
        -            (d2-1.5D)*0.289529654D + 0.176091259 + (double)binExp * 0.301029995663981 );
        -        int B2, B5; // powers of 2 and powers of 5, respectively, in B
        -        int S2, S5; // powers of 2 and powers of 5, respectively, in S
        -        int M2, M5; // powers of 2 and powers of 5, respectively, in M
        -        int Bbits; // binary digits needed to represent B, approx.
        -        int tenSbits; // binary digits needed to represent 10*S, approx.
        -        FDBigInt Sval, Bval, Mval;
        -
        -        B5 = Math.max( 0, -decExp );
        -        B2 = B5 + nTinyBits + binExp;
        -
        -        S5 = Math.max( 0, decExp );
        -        S2 = S5 + nTinyBits;
        -
        -        M5 = B5;
        -        M2 = B2 - nSignificantBits;
        -
        -        /*
        -         * the long integer fractBits contains the (nFractBits) interesting
        -         * bits from the mantissa of d ( hidden 1 added if necessary) followed
        -         * by (expShift+1-nFractBits) zeros. In the interest of compactness,
        -         * I will shift out those zeros before turning fractBits into a
        -         * FDBigInt. The resulting whole number will be
        -         *      d * 2^(nFractBits-1-binExp).
        -         */
        -        fractBits >>>= (expShift+1-nFractBits);
        -        B2 -= nFractBits-1;
        -        int common2factor = Math.min( B2, S2 );
        -        B2 -= common2factor;
        -        S2 -= common2factor;
        -        M2 -= common2factor;
        -
        -        /*
        -         * HACK!! For exact powers of two, the next smallest number
        -         * is only half as far away as we think (because the meaning of
        -         * ULP changes at power-of-two bounds) for this reason, we
        -         * hack M2. Hope this works.
        -         */
        -        if ( nFractBits == 1 )
        -            M2 -= 1;
        -
        -        if ( M2 < 0 ){
        -            // oops.
        -            // since we cannot scale M down far enough,
        -            // we must scale the other values up.
        -            B2 -= M2;
        -            S2 -= M2;
        -            M2 =  0;
        -        }
        -        /*
        -         * Construct, Scale, iterate.
        -         * Some day, we'll write a stopping test that takes
        -         * account of the assymetry of the spacing of floating-point
        -         * numbers below perfect powers of 2
        -         * 26 Sept 96 is not that day.
        -         * So we use a symmetric test.
        -         */
        -        char digits[] = this.digits = new char[18];
        -        int  ndigit = 0;
        -        boolean low, high;
        -        long lowDigitDifference;
        -        int  q;
        -
        -        /*
        -         * Detect the special cases where all the numbers we are about
        -         * to compute will fit in int or long integers.
        -         * In these cases, we will avoid doing FDBigInt arithmetic.
        -         * We use the same algorithms, except that we "normalize"
        -         * our FDBigInts before iterating. This is to make division easier,
        -         * as it makes our fist guess (quotient of high-order words)
        -         * more accurate!
        -         *
        -         * Some day, we'll write a stopping test that takes
        -         * account of the assymetry of the spacing of floating-point
        -         * numbers below perfect powers of 2
        -         * 26 Sept 96 is not that day.
        -         * So we use a symmetric test.
        -         */
        -        Bbits = nFractBits + B2 + (( B5 < n5bits.length )? n5bits[B5] : ( B5*3 ));
        -        tenSbits = S2+1 + (( (S5+1) < n5bits.length )? n5bits[(S5+1)] : ( (S5+1)*3 ));
        -        if ( Bbits < 64 && tenSbits < 64){
        -            if ( Bbits < 32 && tenSbits < 32){
        -                // wa-hoo! They're all ints!
        -                int b = ((int)fractBits * small5pow[B5] ) << B2;
        -                int s = small5pow[S5] << S2;
        -                int m = small5pow[M5] << M2;
        -                int tens = s * 10;
        -                /*
        -                 * Unroll the first iteration. If our decExp estimate
        -                 * was too high, our first quotient will be zero. In this
        -                 * case, we discard it and decrement decExp.
        -                 */
        -                ndigit = 0;
        -                q = b / s;
        -                b = 10 * ( b % s );
        -                m *= 10;
        -                low  = (b <  m );
        -                high = (b+m > tens );
        -                assert q < 10 : q; // excessively large digit
        -                if ( (q == 0) && ! high ){
        -                    // oops. Usually ignore leading zero.
        -                    decExp--;
        +        char[] digits = getBuffer();
        +        int nDigits = fdConverter.getDigits(digits);
        +        int decExp = fdConverter.getDecimalExponent();
        +        int exp;
        +        boolean isNegative = fdConverter.isNegative();
        +        switch (form) {
        +            case COMPATIBLE:
        +                exp = decExp;
        +                this.decExponentRounded = exp;
        +                fillCompatible(precision, digits, nDigits, exp, isNegative);
        +                break;
        +            case DECIMAL_FLOAT:
        +                exp = applyPrecision(decExp, digits, nDigits, decExp + precision);
        +                fillDecimal(precision, digits, nDigits, exp, isNegative);
        +                this.decExponentRounded = exp;
        +                break;
        +            case SCIENTIFIC:
        +                exp = applyPrecision(decExp, digits, nDigits, precision + 1);
        +                fillScientific(precision, digits, nDigits, exp, isNegative);
        +                this.decExponentRounded = exp;
        +                break;
        +            case GENERAL:
        +                exp = applyPrecision(decExp, digits, nDigits, precision);
        +                // adjust precision to be the number of digits to right of decimal
        +                // the real exponent to be output is actually exp - 1, not exp
        +                if (exp - 1 < -4 || exp - 1 >= precision) {
        +                    // form = Form.SCIENTIFIC;
        +                    precision--;
        +                    fillScientific(precision, digits, nDigits, exp, isNegative);
                         } else {
        -                    digits[ndigit++] = (char)('0' + q);
        +                    // form = Form.DECIMAL_FLOAT;
        +                    precision = precision - exp;
        +                    fillDecimal(precision, digits, nDigits, exp, isNegative);
                         }
        -                /*
        -                 * HACK! Java spec sez that we always have at least
        -                 * one digit after the . in either F- or E-form output.
        -                 * Thus we will need more than one digit if we're using
        -                 * E-form
        -                 */
        -                if (! (form == Form.COMPATIBLE && -3 < decExp && decExp < 8)) {
        -                    high = low = false;
        -                }
        -                while( ! low && ! high ){
        -                    q = b / s;
        -                    b = 10 * ( b % s );
        -                    m *= 10;
        -                    assert q < 10 : q; // excessively large digit
        -                    if ( m > 0L ){
        -                        low  = (b <  m );
        -                        high = (b+m > tens );
        -                    } else {
        -                        // hack -- m might overflow!
        -                        // in this case, it is certainly > b,
        -                        // which won't
        -                        // and b+m > tens, too, since that has overflowed
        -                        // either!
        -                        low = true;
        -                        high = true;
        -                    }
        -                    digits[ndigit++] = (char)('0' + q);
        -                }
        -                lowDigitDifference = (b<<1) - tens;
        -            } else {
        -                // still good! they're all longs!
        -                long b = (fractBits * long5pow[B5] ) << B2;
        -                long s = long5pow[S5] << S2;
        -                long m = long5pow[M5] << M2;
        -                long tens = s * 10L;
        -                /*
        -                 * Unroll the first iteration. If our decExp estimate
        -                 * was too high, our first quotient will be zero. In this
        -                 * case, we discard it and decrement decExp.
        -                 */
        -                ndigit = 0;
        -                q = (int) ( b / s );
        -                b = 10L * ( b % s );
        -                m *= 10L;
        -                low  = (b <  m );
        -                high = (b+m > tens );
        -                assert q < 10 : q; // excessively large digit
        -                if ( (q == 0) && ! high ){
        -                    // oops. Usually ignore leading zero.
        -                    decExp--;
        -                } else {
        -                    digits[ndigit++] = (char)('0' + q);
        -                }
        -                /*
        -                 * HACK! Java spec sez that we always have at least
        -                 * one digit after the . in either F- or E-form output.
        -                 * Thus we will need more than one digit if we're using
        -                 * E-form
        -                 */
        -                if (! (form == Form.COMPATIBLE && -3 < decExp && decExp < 8)) {
        -                    high = low = false;
        -                }
        -                while( ! low && ! high ){
        -                    q = (int) ( b / s );
        -                    b = 10 * ( b % s );
        -                    m *= 10;
        -                    assert q < 10 : q;  // excessively large digit
        -                    if ( m > 0L ){
        -                        low  = (b <  m );
        -                        high = (b+m > tens );
        -                    } else {
        -                        // hack -- m might overflow!
        -                        // in this case, it is certainly > b,
        -                        // which won't
        -                        // and b+m > tens, too, since that has overflowed
        -                        // either!
        -                        low = true;
        -                        high = true;
        -                    }
        -                    digits[ndigit++] = (char)('0' + q);
        -                }
        -                lowDigitDifference = (b<<1) - tens;
        -            }
        -        } else {
        -            FDBigInt tenSval;
        -            int  shiftBias;
        -
        -            /*
        -             * We really must do FDBigInt arithmetic.
        -             * Fist, construct our FDBigInt initial values.
        -             */
        -            Bval = multPow52( new FDBigInt( fractBits  ), B5, B2 );
        -            Sval = constructPow52( S5, S2 );
        -            Mval = constructPow52( M5, M2 );
        -
        -
        -            // normalize so that division works better
        -            Bval.lshiftMe( shiftBias = Sval.normalizeMe() );
        -            Mval.lshiftMe( shiftBias );
        -            tenSval = Sval.mult( 10 );
        -            /*
        -             * Unroll the first iteration. If our decExp estimate
        -             * was too high, our first quotient will be zero. In this
        -             * case, we discard it and decrement decExp.
        -             */
        -            ndigit = 0;
        -            q = Bval.quoRemIteration( Sval );
        -            Mval = Mval.mult( 10 );
        -            low  = (Bval.cmp( Mval ) < 0);
        -            high = (Bval.add( Mval ).cmp( tenSval ) > 0 );
        -            assert q < 10 : q; // excessively large digit
        -            if ( (q == 0) && ! high ){
        -                // oops. Usually ignore leading zero.
        -                decExp--;
        -            } else {
        -                digits[ndigit++] = (char)('0' + q);
        -            }
        -            /*
        -             * HACK! Java spec sez that we always have at least
        -             * one digit after the . in either F- or E-form output.
        -             * Thus we will need more than one digit if we're using
        -             * E-form
        -             */
        -            if (! (form == Form.COMPATIBLE && -3 < decExp && decExp < 8)) {
        -                high = low = false;
        -            }
        -            while( ! low && ! high ){
        -                q = Bval.quoRemIteration( Sval );
        -                Mval = Mval.mult( 10 );
        -                assert q < 10 : q;  // excessively large digit
        -                low  = (Bval.cmp( Mval ) < 0);
        -                high = (Bval.add( Mval ).cmp( tenSval ) > 0 );
        -                digits[ndigit++] = (char)('0' + q);
        -            }
        -            if ( high && low ){
        -                Bval.lshiftMe(1);
        -                lowDigitDifference = Bval.cmp(tenSval);
        -            } else
        -                lowDigitDifference = 0L; // this here only for flow analysis!
        +                this.decExponentRounded = exp;
        +                break;
        +            default:
        +                assert false;
                 }
        -        this.decExponent = decExp+1;
        -        this.digits = digits;
        -        this.nDigits = ndigit;
        -        /*
        -         * Last digit gets rounded based on stopping condition.
        -         */
        -        if ( high ){
        -            if ( low ){
        -                if ( lowDigitDifference == 0L ){
        -                    // it's a tie!
        -                    // choose based on which digits we like.
        -                    if ( (digits[nDigits-1]&1) != 0 ) roundup();
        -                } else if ( lowDigitDifference > 0 ){
        -                    roundup();
        -                }
        -            } else {
        -                roundup();
        -            }
        -        }
        -    }
        -
        -    public String
        -    toString(){
        -        // most brain-dead version
        -        StringBuffer result = new StringBuffer( nDigits+8 );
        -        if ( isNegative ){ result.append( '-' ); }
        -        if ( isExceptional ){
        -            result.append( digits, 0, nDigits );
        -        } else {
        -            result.append( "0.");
        -            result.append( digits, 0, nDigits );
        -            result.append('e');
        -            result.append( decExponent );
        -        }
        -        return new String(result);
        -    }
        -
        -    // returns the exponent before rounding
        -    public int getExponent() {
        -        return decExponent - 1;
             }
         
             // returns the exponent after rounding has been done by applyPrecision
        @@ -986,781 +106,244 @@ public class FormattedFloatingDecimal{
                 return decExponentRounded - 1;
             }
         
        -    public int getChars(char[] result) {
        -        assert nDigits <= 19 : nDigits; // generous bound on size of nDigits
        -        int i = 0;
        -        if (isNegative) { result[0] = '-'; i = 1; }
        -        if (isExceptional) {
        -            System.arraycopy(digits, 0, result, i, nDigits);
        -            i += nDigits;
        -        } else {
        -            char digits [] = this.digits;
        -            int exp = decExponent;
        -            switch (form) {
        -            case COMPATIBLE:
        -                break;
        -            case DECIMAL_FLOAT:
        -                exp = checkExponent(decExponent + precision);
        -                digits = applyPrecision(decExponent + precision);
        -                break;
        -            case SCIENTIFIC:
        -                exp = checkExponent(precision + 1);
        -                digits = applyPrecision(precision + 1);
        -                break;
        -            case GENERAL:
        -                exp = checkExponent(precision);
        -                digits = applyPrecision(precision);
        -                // adjust precision to be the number of digits to right of decimal
        -                // the real exponent to be output is actually exp - 1, not exp
        -                if (exp - 1 < -4 || exp - 1 >= precision) {
        -                    form = Form.SCIENTIFIC;
        -                    precision--;
        -                } else {
        -                    form = Form.DECIMAL_FLOAT;
        -                    precision = precision - exp;
        -                }
        -                break;
        -            default:
        -                assert false;
        -            }
        -            decExponentRounded = exp;
        +    public char[] getMantissa(){
        +        return mantissa;
        +    }
         
        -            if (exp > 0
        -                && ((form == Form.COMPATIBLE && (exp < 8))
        -                    || (form == Form.DECIMAL_FLOAT)))
        -            {
        -                // print digits.digits.
        -                int charLength = Math.min(nDigits, exp);
        -                System.arraycopy(digits, 0, result, i, charLength);
        -                i += charLength;
        -                if (charLength < exp) {
        -                    charLength = exp-charLength;
        -                    for (int nz = 0; nz < charLength; nz++)
        -                        result[i++] = '0';
        -                    // Do not append ".0" for formatted floats since the user
        -                    // may request that it be omitted. It is added as necessary
        -                    // by the Formatter.
        -                    if (form == Form.COMPATIBLE) {
        -                        result[i++] = '.';
        -                        result[i++] = '0';
        -                    }
        -                } else {
        -                    // Do not append ".0" for formatted floats since the user
        -                    // may request that it be omitted. It is added as necessary
        -                    // by the Formatter.
        -                    if (form == Form.COMPATIBLE) {
        -                        result[i++] = '.';
        -                        if (charLength < nDigits) {
        -                            int t = Math.min(nDigits - charLength, precision);
        -                            System.arraycopy(digits, charLength, result, i, t);
        -                            i += t;
        -                        } else {
        -                            result[i++] = '0';
        -                        }
        -                    } else {
        -                        int t = Math.min(nDigits - charLength, precision);
        -                        if (t > 0) {
        -                            result[i++] = '.';
        -                            System.arraycopy(digits, charLength, result, i, t);
        -                            i += t;
        -                        }
        -                    }
        -                }
        -            } else if (exp <= 0
        -                       && ((form == Form.COMPATIBLE && exp > -3)
        -                       || (form == Form.DECIMAL_FLOAT)))
        -            {
        -                // print 0.0* digits
        -                result[i++] = '0';
        -                if (exp != 0) {
        -                    // write '0' s before the significant digits
        -                    int t = Math.min(-exp, precision);
        -                    if (t > 0) {
        -                        result[i++] = '.';
        -                        for (int nz = 0; nz < t; nz++)
        -                            result[i++] = '0';
        -                    }
        -                }
        -                int t = Math.min(digits.length, precision + exp);
        -                if (t > 0) {
        -                    if (i == 1)
        -                        result[i++] = '.';
        -                    // copy only when significant digits are within the precision
        -                    System.arraycopy(digits, 0, result, i, t);
        -                    i += t;
        -                }
        +    public char[] getExponent(){
        +        return exponent;
        +    }
        +
        +    /**
        +     * Returns new decExp in case of overflow.
        +     */
        +    private static int applyPrecision(int decExp, char[] digits, int nDigits, int prec) {
        +        if (prec >= nDigits || prec < 0) {
        +            // no rounding necessary
        +            return decExp;
        +        }
        +        if (prec == 0) {
        +            // only one digit (0 or 1) is returned because the precision
        +            // excludes all significant digits
        +            if (digits[0] >= '5') {
        +                digits[0] = '1';
        +                Arrays.fill(digits, 1, nDigits, '0');
        +                return decExp + 1;
                     } else {
        -                result[i++] = digits[0];
        -                if (form == Form.COMPATIBLE) {
        -                    result[i++] = '.';
        -                    if (nDigits > 1) {
        -                        System.arraycopy(digits, 1, result, i, nDigits-1);
        -                        i += nDigits-1;
        -                    } else {
        -                        result[i++] = '0';
        -                    }
        -                    result[i++] = 'E';
        -                } else {
        -                    if (nDigits > 1) {
        -                        int t = Math.min(nDigits -1, precision);
        -                        if (t > 0) {
        -                            result[i++] = '.';
        -                            System.arraycopy(digits, 1, result, i, t);
        -                            i += t;
        -                        }
        -                    }
        -                    result[i++] = 'e';
        -                }
        -                int e;
        -                if (exp <= 0) {
        -                    result[i++] = '-';
        -                    e = -exp+1;
        -                } else {
        -                    if (form != Form.COMPATIBLE)
        -                        result[i++] = '+';
        -                    e = exp-1;
        -                }
        -                // decExponent has 1, 2, or 3, digits
        -                if (e <= 9) {
        -                    if (form != Form.COMPATIBLE)
        -                        result[i++] = '0';
        -                    result[i++] = (char)(e+'0');
        -                } else if (e <= 99) {
        -                    result[i++] = (char)(e/10 +'0');
        -                    result[i++] = (char)(e%10 + '0');
        -                } else {
        -                    result[i++] = (char)(e/100+'0');
        -                    e %= 100;
        -                    result[i++] = (char)(e/10+'0');
        -                    result[i++] = (char)(e%10 + '0');
        -                }
        +                Arrays.fill(digits, 0, nDigits, '0');
        +                return decExp;
                     }
                 }
        -        return i;
        +        int q = digits[prec];
        +        if (q >= '5') {
        +            int i = prec;
        +            q = digits[--i];
        +            if ( q == '9' ) {
        +                while ( q == '9' && i > 0 ){
        +                    q = digits[--i];
        +                }
        +                if ( q == '9' ){
        +                    // carryout! High-order 1, rest 0s, larger exp.
        +                    digits[0] = '1';
        +                    Arrays.fill(digits, 1, nDigits, '0');
        +                    return decExp+1;
        +                }
        +            }
        +            digits[i] = (char)(q + 1);
        +            Arrays.fill(digits, i+1, nDigits, '0');
        +        } else {
        +            Arrays.fill(digits, prec, nDigits, '0');
        +        }
        +        return decExp;
             }
         
        -    // Per-thread buffer for string/stringbuffer conversion
        -    private static ThreadLocal perThreadBuffer = new ThreadLocal() {
        -            protected synchronized char[] initialValue() {
        -                return new char[26];
        -            }
        -        };
        -
        -    /*
        -     * Take a FormattedFloatingDecimal, which we presumably just scanned in,
        -     * and find out what its value is, as a double.
        -     *
        -     * AS A SIDE EFFECT, SET roundDir TO INDICATE PREFERRED
        -     * ROUNDING DIRECTION in case the result is really destined
        -     * for a single-precision float.
        +    /**
        +     * Fills mantissa and exponent char arrays for compatible format.
              */
        -
        -    public strictfp double doubleValue(){
        -        int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
        -        long    lValue;
        -        double  dValue;
        -        double  rValue, tValue;
        -
        -        // First, check for NaN and Infinity values
        -        if(digits == infinity || digits == notANumber) {
        -            if(digits == notANumber)
        -                return Double.NaN;
        -            else
        -                return (isNegative?Double.NEGATIVE_INFINITY:Double.POSITIVE_INFINITY);
        +    private void fillCompatible(int precision, char[] digits, int nDigits, int exp, boolean isNegative) {
        +        int startIndex = isNegative ? 1 : 0;
        +        if (exp > 0 && exp < 8) {
        +            // print digits.digits.
        +            if (nDigits < exp) {
        +                int extraZeros = exp - nDigits;
        +                mantissa = create(isNegative, nDigits + extraZeros + 2);
        +                System.arraycopy(digits, 0, mantissa, startIndex, nDigits);
        +                Arrays.fill(mantissa, startIndex + nDigits, startIndex + nDigits + extraZeros, '0');
        +                mantissa[startIndex + nDigits + extraZeros] = '.';
        +                mantissa[startIndex + nDigits + extraZeros+1] = '0';
        +            } else if (exp < nDigits) {
        +                int t = Math.min(nDigits - exp, precision);
        +                mantissa = create(isNegative, exp + 1 + t);
        +                System.arraycopy(digits, 0, mantissa, startIndex, exp);
        +                mantissa[startIndex + exp ] = '.';
        +                System.arraycopy(digits, exp, mantissa, startIndex+exp+1, t);
        +            } else { // exp == digits.length
        +                mantissa = create(isNegative, nDigits + 2);
        +                System.arraycopy(digits, 0, mantissa, startIndex, nDigits);
        +                mantissa[startIndex + nDigits ] = '.';
        +                mantissa[startIndex + nDigits +1] = '0';
        +            }
        +        } else if (exp <= 0 && exp > -3) {
        +            int zeros = Math.max(0, Math.min(-exp, precision));
        +            int t = Math.max(0, Math.min(nDigits, precision + exp));
        +            // write '0' s before the significant digits
        +            if (zeros > 0) {
        +                mantissa = create(isNegative, zeros + 2 + t);
        +                mantissa[startIndex] = '0';
        +                mantissa[startIndex+1] = '.';
        +                Arrays.fill(mantissa, startIndex + 2, startIndex + 2 + zeros, '0');
        +                if (t > 0) {
        +                    // copy only when significant digits are within the precision
        +                    System.arraycopy(digits, 0, mantissa, startIndex + 2 + zeros, t);
        +                }
        +            } else if (t > 0) {
        +                mantissa = create(isNegative, zeros + 2 + t);
        +                mantissa[startIndex] = '0';
        +                mantissa[startIndex + 1] = '.';
        +                // copy only when significant digits are within the precision
        +                System.arraycopy(digits, 0, mantissa, startIndex + 2, t);
        +            } else {
        +                this.mantissa = create(isNegative, 1);
        +                this.mantissa[startIndex] = '0';
        +            }
        +        } else {
        +            if (nDigits > 1) {
        +                mantissa = create(isNegative, nDigits + 1);
        +                mantissa[startIndex] = digits[0];
        +                mantissa[startIndex + 1] = '.';
        +                System.arraycopy(digits, 1, mantissa, startIndex + 2, nDigits - 1);
        +            } else {
        +                mantissa = create(isNegative, 3);
        +                mantissa[startIndex] = digits[0];
        +                mantissa[startIndex + 1] = '.';
        +                mantissa[startIndex + 2] = '0';
        +            }
        +            int e, expStartIntex;
        +            boolean isNegExp = (exp <= 0);
        +            if (isNegExp) {
        +                e = -exp + 1;
        +                expStartIntex = 1;
        +            } else {
        +                e = exp - 1;
        +                expStartIntex = 0;
        +            }
        +            // decExponent has 1, 2, or 3, digits
        +            if (e <= 9) {
        +                exponent = create(isNegExp,1);
        +                exponent[expStartIntex] = (char) (e + '0');
        +            } else if (e <= 99) {
        +                exponent = create(isNegExp,2);
        +                exponent[expStartIntex] = (char) (e / 10 + '0');
        +                exponent[expStartIntex+1] = (char) (e % 10 + '0');
        +            } else {
        +                exponent = create(isNegExp,3);
        +                exponent[expStartIntex] = (char) (e / 100 + '0');
        +                e %= 100;
        +                exponent[expStartIntex+1] = (char) (e / 10 + '0');
        +                exponent[expStartIntex+2] = (char) (e % 10 + '0');
        +            }
                 }
        -        else {
        -            if (mustSetRoundDir) {
        -                roundDir = 0;
        -            }
        -            /*
        -             * convert the lead kDigits to a long integer.
        -             */
        -            // (special performance hack: start to do it using int)
        -            int iValue = (int)digits[0]-(int)'0';
        -            int iDigits = Math.min( kDigits, intDecimalDigits );
        -            for ( int i=1; i < iDigits; i++ ){
        -                iValue = iValue*10 + (int)digits[i]-(int)'0';
        -            }
        -            lValue = (long)iValue;
        -            for ( int i=iDigits; i < kDigits; i++ ){
        -                lValue = lValue*10L + (long)((int)digits[i]-(int)'0');
        -            }
        -            dValue = (double)lValue;
        -            int exp = decExponent-kDigits;
        -            /*
        -             * lValue now contains a long integer with the value of
        -             * the first kDigits digits of the number.
        -             * dValue contains the (double) of the same.
        -             */
        +    }
         
        -            if ( nDigits <= maxDecimalDigits ){
        -                /*
        -                 * possibly an easy case.
        -                 * We know that the digits can be represented
        -                 * exactly. And if the exponent isn't too outrageous,
        -                 * the whole thing can be done with one operation,
        -                 * thus one rounding error.
        -                 * Note that all our constructors trim all leading and
        -                 * trailing zeros, so simple values (including zero)
        -                 * will always end up here
        -                 */
        -                if (exp == 0 || dValue == 0.0)
        -                    return (isNegative)? -dValue : dValue; // small floating integer
        -                else if ( exp >= 0 ){
        -                    if ( exp <= maxSmallTen ){
        -                        /*
        -                         * Can get the answer with one operation,
        -                         * thus one roundoff.
        -                         */
        -                        rValue = dValue * small10pow[exp];
        -                        if ( mustSetRoundDir ){
        -                            tValue = rValue / small10pow[exp];
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    int slop = maxDecimalDigits - kDigits;
        -                    if ( exp <= maxSmallTen+slop ){
        -                        /*
        -                         * We can multiply dValue by 10^(slop)
        -                         * and it is still "small" and exact.
        -                         * Then we can multiply by 10^(exp-slop)
        -                         * with one rounding.
        -                         */
        -                        dValue *= small10pow[slop];
        -                        rValue = dValue * small10pow[exp-slop];
        -
        -                        if ( mustSetRoundDir ){
        -                            tValue = rValue / small10pow[exp-slop];
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a positive exp.
        -                     */
        -                } else {
        -                    if ( exp >= -maxSmallTen ){
        -                        /*
        -                         * Can get the answer in one division.
        -                         */
        -                        rValue = dValue / small10pow[-exp];
        -                        tValue = rValue * small10pow[-exp];
        -                        if ( mustSetRoundDir ){
        -                            roundDir = ( tValue ==  dValue ) ? 0
        -                                :( tValue < dValue ) ? 1
        -                                : -1;
        -                        }
        -                        return (isNegative)? -rValue : rValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a negative exp.
        -                     */
        -                }
        -            }
        -
        -            /*
        -             * Harder cases:
        -             * The sum of digits plus exponent is greater than
        -             * what we think we can do with one error.
        -             *
        -             * Start by approximating the right answer by,
        -             * naively, scaling by powers of 10.
        -             */
        -            if ( exp > 0 ){
        -                if ( decExponent > maxDecimalExponent+1 ){
        -                    /*
        -                     * Lets face it. This is going to be
        -                     * Infinity. Cut to the chase.
        -                     */
        -                    return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        -                }
        -                if ( (exp&15) != 0 ){
        -                    dValue *= small10pow[exp&15];
        -                }
        -                if ( (exp>>=4) != 0 ){
        -                    int j;
        -                    for( j = 0; exp > 1; j++, exp>>=1 ){
        -                        if ( (exp&1)!=0)
        -                            dValue *= big10pow[j];
        -                    }
        -                    /*
        -                     * The reason for the weird exp > 1 condition
        -                     * in the above loop was so that the last multiply
        -                     * would get unrolled. We handle it here.
        -                     * It could overflow.
        -                     */
        -                    double t = dValue * big10pow[j];
        -                    if ( Double.isInfinite( t ) ){
        -                        /*
        -                         * It did overflow.
        -                         * Look more closely at the result.
        -                         * If the exponent is just one too large,
        -                         * then use the maximum finite as our estimate
        -                         * value. Else call the result infinity
        -                         * and punt it.
        -                         * ( I presume this could happen because
        -                         * rounding forces the result here to be
        -                         * an ULP or two larger than
        -                         * Double.MAX_VALUE ).
        -                         */
        -                        t = dValue / 2.0;
        -                        t *= big10pow[j];
        -                        if ( Double.isInfinite( t ) ){
        -                            return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
        -                        }
        -                        t = Double.MAX_VALUE;
        -                    }
        -                    dValue = t;
        -                }
        -            } else if ( exp < 0 ){
        -                exp = -exp;
        -                if ( decExponent < minDecimalExponent-1 ){
        -                    /*
        -                     * Lets face it. This is going to be
        -                     * zero. Cut to the chase.
        -                     */
        -                    return (isNegative)? -0.0 : 0.0;
        -                }
        -                if ( (exp&15) != 0 ){
        -                    dValue /= small10pow[exp&15];
        -                }
        -                if ( (exp>>=4) != 0 ){
        -                    int j;
        -                    for( j = 0; exp > 1; j++, exp>>=1 ){
        -                        if ( (exp&1)!=0)
        -                            dValue *= tiny10pow[j];
        -                    }
        -                    /*
        -                     * The reason for the weird exp > 1 condition
        -                     * in the above loop was so that the last multiply
        -                     * would get unrolled. We handle it here.
        -                     * It could underflow.
        -                     */
        -                    double t = dValue * tiny10pow[j];
        -                    if ( t == 0.0 ){
        -                        /*
        -                         * It did underflow.
        -                         * Look more closely at the result.
        -                         * If the exponent is just one too small,
        -                         * then use the minimum finite as our estimate
        -                         * value. Else call the result 0.0
        -                         * and punt it.
        -                         * ( I presume this could happen because
        -                         * rounding forces the result here to be
        -                         * an ULP or two less than
        -                         * Double.MIN_VALUE ).
        -                         */
        -                        t = dValue * 2.0;
        -                        t *= tiny10pow[j];
        -                        if ( t == 0.0 ){
        -                            return (isNegative)? -0.0 : 0.0;
        -                        }
        -                        t = Double.MIN_VALUE;
        -                    }
        -                    dValue = t;
        -                }
        -            }
        -
        -            /*
        -             * dValue is now approximately the result.
        -             * The hard part is adjusting it, by comparison
        -             * with FDBigInt arithmetic.
        -             * Formulate the EXACT big-number result as
        -             * bigD0 * 10^exp
        -             */
        -            FDBigInt bigD0 = new FDBigInt( lValue, digits, kDigits, nDigits );
        -            exp   = decExponent - nDigits;
        -
        -            correctionLoop:
        -            while(true){
        -                /* AS A SIDE EFFECT, THIS METHOD WILL SET THE INSTANCE VARIABLES
        -                 * bigIntExp and bigIntNBits
        -                 */
        -                FDBigInt bigB = doubleToBigInt( dValue );
        -
        -                /*
        -                 * Scale bigD, bigB appropriately for
        -                 * big-integer operations.
        -                 * Naively, we multipy by powers of ten
        -                 * and powers of two. What we actually do
        -                 * is keep track of the powers of 5 and
        -                 * powers of 2 we would use, then factor out
        -                 * common divisors before doing the work.
        -                 */
        -                int B2, B5; // powers of 2, 5 in bigB
        -                int     D2, D5; // powers of 2, 5 in bigD
        -                int Ulp2;   // powers of 2 in halfUlp.
        -                if ( exp >= 0 ){
        -                    B2 = B5 = 0;
        -                    D2 = D5 = exp;
        -                } else {
        -                    B2 = B5 = -exp;
        -                    D2 = D5 = 0;
        -                }
        -                if ( bigIntExp >= 0 ){
        -                    B2 += bigIntExp;
        -                } else {
        -                    D2 -= bigIntExp;
        -                }
        -                Ulp2 = B2;
        -                // shift bigB and bigD left by a number s. t.
        -                // halfUlp is still an integer.
        -                int hulpbias;
        -                if ( bigIntExp+bigIntNBits <= -expBias+1 ){
        -                    // This is going to be a denormalized number
        -                    // (if not actually zero).
        -                    // half an ULP is at 2^-(expBias+expShift+1)
        -                    hulpbias = bigIntExp+ expBias + expShift;
        -                } else {
        -                    hulpbias = expShift + 2 - bigIntNBits;
        -                }
        -                B2 += hulpbias;
        -                D2 += hulpbias;
        -                // if there are common factors of 2, we might just as well
        -                // factor them out, as they add nothing useful.
        -                int common2 = Math.min( B2, Math.min( D2, Ulp2 ) );
        -                B2 -= common2;
        -                D2 -= common2;
        -                Ulp2 -= common2;
        -                // do multiplications by powers of 5 and 2
        -                bigB = multPow52( bigB, B5, B2 );
        -                FDBigInt bigD = multPow52( new FDBigInt( bigD0 ), D5, D2 );
        -                //
        -                // to recap:
        -                // bigB is the scaled-big-int version of our floating-point
        -                // candidate.
        -                // bigD is the scaled-big-int version of the exact value
        -                // as we understand it.
        -                // halfUlp is 1/2 an ulp of bigB, except for special cases
        -                // of exact powers of 2
        -                //
        -                // the plan is to compare bigB with bigD, and if the difference
        -                // is less than halfUlp, then we're satisfied. Otherwise,
        -                // use the ratio of difference to halfUlp to calculate a fudge
        -                // factor to add to the floating value, then go 'round again.
        -                //
        -                FDBigInt diff;
        -                int cmpResult;
        -                boolean overvalue;
        -                if ( (cmpResult = bigB.cmp( bigD ) ) > 0 ){
        -                    overvalue = true; // our candidate is too big.
        -                    diff = bigB.sub( bigD );
        -                    if ( (bigIntNBits == 1) && (bigIntExp > -expBias) ){
        -                        // candidate is a normalized exact power of 2 and
        -                        // is too big. We will be subtracting.
        -                        // For our purposes, ulp is the ulp of the
        -                        // next smaller range.
        -                        Ulp2 -= 1;
        -                        if ( Ulp2 < 0 ){
        -                            // rats. Cannot de-scale ulp this far.
        -                            // must scale diff in other direction.
        -                            Ulp2 = 0;
        -                            diff.lshiftMe( 1 );
        -                        }
        -                    }
        -                } else if ( cmpResult < 0 ){
        -                    overvalue = false; // our candidate is too small.
        -                    diff = bigD.sub( bigB );
        -                } else {
        -                    // the candidate is exactly right!
        -                    // this happens with surprising fequency
        -                    break correctionLoop;
        -                }
        -                FDBigInt halfUlp = constructPow52( B5, Ulp2 );
        -                if ( (cmpResult = diff.cmp( halfUlp ) ) < 0 ){
        -                    // difference is small.
        -                    // this is close enough
        -                    if (mustSetRoundDir) {
        -                        roundDir = overvalue ? -1 : 1;
        -                    }
        -                    break correctionLoop;
        -                } else if ( cmpResult == 0 ){
        -                    // difference is exactly half an ULP
        -                    // round to some other value maybe, then finish
        -                    dValue += 0.5*ulp( dValue, overvalue );
        -                    // should check for bigIntNBits == 1 here??
        -                    if (mustSetRoundDir) {
        -                        roundDir = overvalue ? -1 : 1;
        -                    }
        -                    break correctionLoop;
        -                } else {
        -                    // difference is non-trivial.
        -                    // could scale addend by ratio of difference to
        -                    // halfUlp here, if we bothered to compute that difference.
        -                    // Most of the time ( I hope ) it is about 1 anyway.
        -                    dValue += ulp( dValue, overvalue );
        -                    if ( dValue == 0.0 || dValue == Double.POSITIVE_INFINITY )
        -                        break correctionLoop; // oops. Fell off end of range.
        -                    continue; // try again.
        -                }
        -
        -            }
        -            return (isNegative)? -dValue : dValue;
        +    private static char[] create(boolean isNegative, int size) {
        +        if(isNegative) {
        +            char[] r = new char[size +1];
        +            r[0] = '-';
        +            return r;
        +        } else {
        +            return new char[size];
                 }
             }
         
             /*
        -     * Take a FormattedFloatingDecimal, which we presumably just scanned in,
        -     * and find out what its value is, as a float.
        -     * This is distinct from doubleValue() to avoid the extremely
        -     * unlikely case of a double rounding error, wherein the converstion
        -     * to double has one rounding error, and the conversion of that double
        -     * to a float has another rounding error, IN THE WRONG DIRECTION,
        -     * ( because of the preference to a zero low-order bit ).
        +     * Fills mantissa char arrays for DECIMAL_FLOAT format.
        +     * Exponent should be equal to null.
              */
        -
        -    public strictfp float floatValue(){
        -        int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
        -        int     iValue;
        -        float   fValue;
        -
        -        // First, check for NaN and Infinity values
        -        if(digits == infinity || digits == notANumber) {
        -            if(digits == notANumber)
        -                return Float.NaN;
        -            else
        -                return (isNegative?Float.NEGATIVE_INFINITY:Float.POSITIVE_INFINITY);
        -        }
        -        else {
        -            /*
        -             * convert the lead kDigits to an integer.
        -             */
        -            iValue = (int)digits[0]-(int)'0';
        -            for ( int i=1; i < kDigits; i++ ){
        -                iValue = iValue*10 + (int)digits[i]-(int)'0';
        -            }
        -            fValue = (float)iValue;
        -            int exp = decExponent-kDigits;
        -            /*
        -             * iValue now contains an integer with the value of
        -             * the first kDigits digits of the number.
        -             * fValue contains the (float) of the same.
        -             */
        -
        -            if ( nDigits <= singleMaxDecimalDigits ){
        -                /*
        -                 * possibly an easy case.
        -                 * We know that the digits can be represented
        -                 * exactly. And if the exponent isn't too outrageous,
        -                 * the whole thing can be done with one operation,
        -                 * thus one rounding error.
        -                 * Note that all our constructors trim all leading and
        -                 * trailing zeros, so simple values (including zero)
        -                 * will always end up here.
        -                 */
        -                if (exp == 0 || fValue == 0.0f)
        -                    return (isNegative)? -fValue : fValue; // small floating integer
        -                else if ( exp >= 0 ){
        -                    if ( exp <= singleMaxSmallTen ){
        -                        /*
        -                         * Can get the answer with one operation,
        -                         * thus one roundoff.
        -                         */
        -                        fValue *= singleSmall10pow[exp];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    int slop = singleMaxDecimalDigits - kDigits;
        -                    if ( exp <= singleMaxSmallTen+slop ){
        -                        /*
        -                         * We can multiply dValue by 10^(slop)
        -                         * and it is still "small" and exact.
        -                         * Then we can multiply by 10^(exp-slop)
        -                         * with one rounding.
        -                         */
        -                        fValue *= singleSmall10pow[slop];
        -                        fValue *= singleSmall10pow[exp-slop];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a positive exp.
        -                     */
        -                } else {
        -                    if ( exp >= -singleMaxSmallTen ){
        -                        /*
        -                         * Can get the answer in one division.
        -                         */
        -                        fValue /= singleSmall10pow[-exp];
        -                        return (isNegative)? -fValue : fValue;
        -                    }
        -                    /*
        -                     * Else we have a hard case with a negative exp.
        -                     */
        +    private void fillDecimal(int precision, char[] digits, int nDigits, int exp, boolean isNegative) {
        +        int startIndex = isNegative ? 1 : 0;
        +        if (exp > 0) {
        +            // print digits.digits.
        +            if (nDigits < exp) {
        +                mantissa = create(isNegative,exp);
        +                System.arraycopy(digits, 0, mantissa, startIndex, nDigits);
        +                Arrays.fill(mantissa, startIndex + nDigits, startIndex + exp, '0');
        +                // Do not append ".0" for formatted floats since the user
        +                // may request that it be omitted. It is added as necessary
        +                // by the Formatter.
        +            } else {
        +                int t = Math.min(nDigits - exp, precision);
        +                mantissa = create(isNegative, exp + (t > 0 ? (t + 1) : 0));
        +                System.arraycopy(digits, 0, mantissa, startIndex, exp);
        +                // Do not append ".0" for formatted floats since the user
        +                // may request that it be omitted. It is added as necessary
        +                // by the Formatter.
        +                if (t > 0) {
        +                    mantissa[startIndex + exp] = '.';
        +                    System.arraycopy(digits, exp, mantissa, startIndex + exp + 1, t);
                         }
        -            } else if ( (decExponent >= nDigits) && (nDigits+decExponent <= maxDecimalDigits) ){
        -                /*
        -                 * In double-precision, this is an exact floating integer.
        -                 * So we can compute to double, then shorten to float
        -                 * with one round, and get the right answer.
        -                 *
        -                 * First, finish accumulating digits.
        -                 * Then convert that integer to a double, multiply
        -                 * by the appropriate power of ten, and convert to float.
        -                 */
        -                long lValue = (long)iValue;
        -                for ( int i=kDigits; i < nDigits; i++ ){
        -                    lValue = lValue*10L + (long)((int)digits[i]-(int)'0');
        +            }
        +        } else if (exp <= 0) {
        +            int zeros = Math.max(0, Math.min(-exp, precision));
        +            int t = Math.max(0, Math.min(nDigits, precision + exp));
        +            // write '0' s before the significant digits
        +            if (zeros > 0) {
        +                mantissa = create(isNegative, zeros + 2 + t);
        +                mantissa[startIndex] = '0';
        +                mantissa[startIndex+1] = '.';
        +                Arrays.fill(mantissa, startIndex + 2, startIndex + 2 + zeros, '0');
        +                if (t > 0) {
        +                    // copy only when significant digits are within the precision
        +                    System.arraycopy(digits, 0, mantissa, startIndex + 2 + zeros, t);
                         }
        -                double dValue = (double)lValue;
        -                exp = decExponent-nDigits;
        -                dValue *= small10pow[exp];
        -                fValue = (float)dValue;
        -                return (isNegative)? -fValue : fValue;
        -
        +            } else if (t > 0) {
        +                mantissa = create(isNegative, zeros + 2 + t);
        +                mantissa[startIndex] = '0';
        +                mantissa[startIndex + 1] = '.';
        +                // copy only when significant digits are within the precision
        +                System.arraycopy(digits, 0, mantissa, startIndex + 2, t);
        +            } else {
        +                this.mantissa = create(isNegative, 1);
        +                this.mantissa[startIndex] = '0';
                     }
        -            /*
        -             * Harder cases:
        -             * The sum of digits plus exponent is greater than
        -             * what we think we can do with one error.
        -             *
        -             * Start by weeding out obviously out-of-range
        -             * results, then convert to double and go to
        -             * common hard-case code.
        -             */
        -            if ( decExponent > singleMaxDecimalExponent+1 ){
        -                /*
        -                 * Lets face it. This is going to be
        -                 * Infinity. Cut to the chase.
        -                 */
        -                return (isNegative)? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
        -            } else if ( decExponent < singleMinDecimalExponent-1 ){
        -                /*
        -                 * Lets face it. This is going to be
        -                 * zero. Cut to the chase.
        -                 */
        -                return (isNegative)? -0.0f : 0.0f;
        -            }
        -
        -            /*
        -             * Here, we do 'way too much work, but throwing away
        -             * our partial results, and going and doing the whole
        -             * thing as double, then throwing away half the bits that computes
        -             * when we convert back to float.
        -             *
        -             * The alternative is to reproduce the whole multiple-precision
        -             * algorythm for float precision, or to try to parameterize it
        -             * for common usage. The former will take about 400 lines of code,
        -             * and the latter I tried without success. Thus the semi-hack
        -             * answer here.
        -             */
        -            mustSetRoundDir = !fromHex;
        -            double dValue = doubleValue();
        -            return stickyRound( dValue );
                 }
             }
         
        -
        -    /*
        -     * All the positive powers of 10 that can be
        -     * represented exactly in double/float.
        +    /**
        +     * Fills mantissa and exponent char arrays for SCIENTIFIC format.
              */
        -    private static final double small10pow[] = {
        -        1.0e0,
        -        1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5,
        -        1.0e6, 1.0e7, 1.0e8, 1.0e9, 1.0e10,
        -        1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15,
        -        1.0e16, 1.0e17, 1.0e18, 1.0e19, 1.0e20,
        -        1.0e21, 1.0e22
        -    };
        -
        -    private static final float singleSmall10pow[] = {
        -        1.0e0f,
        -        1.0e1f, 1.0e2f, 1.0e3f, 1.0e4f, 1.0e5f,
        -        1.0e6f, 1.0e7f, 1.0e8f, 1.0e9f, 1.0e10f
        -    };
        -
        -    private static final double big10pow[] = {
        -        1e16, 1e32, 1e64, 1e128, 1e256 };
        -    private static final double tiny10pow[] = {
        -        1e-16, 1e-32, 1e-64, 1e-128, 1e-256 };
        -
        -    private static final int maxSmallTen = small10pow.length-1;
        -    private static final int singleMaxSmallTen = singleSmall10pow.length-1;
        -
        -    private static final int small5pow[] = {
        -        1,
        -        5,
        -        5*5,
        -        5*5*5,
        -        5*5*5*5,
        -        5*5*5*5*5,
        -        5*5*5*5*5*5,
        -        5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5*5,
        -        5*5*5*5*5*5*5*5*5*5*5*5*5
        -    };
        -
        -
        -    private static final long long5pow[] = {
        -        1L,
        -        5L,
        -        5L*5,
        -        5L*5*5,
        -        5L*5*5*5,
        -        5L*5*5*5*5,
        -        5L*5*5*5*5*5,
        -        5L*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -        5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5,
        -    };
        -
        -    // approximately ceil( log2( long5pow[i] ) )
        -    private static final int n5bits[] = {
        -        0,
        -        3,
        -        5,
        -        7,
        -        10,
        -        12,
        -        14,
        -        17,
        -        19,
        -        21,
        -        24,
        -        26,
        -        28,
        -        31,
        -        33,
        -        35,
        -        38,
        -        40,
        -        42,
        -        45,
        -        47,
        -        49,
        -        52,
        -        54,
        -        56,
        -        59,
        -        61,
        -    };
        -
        -    private static final char infinity[] = { 'I', 'n', 'f', 'i', 'n', 'i', 't', 'y' };
        -    private static final char notANumber[] = { 'N', 'a', 'N' };
        -    private static final char zero[] = { '0', '0', '0', '0', '0', '0', '0', '0' };
        +    private void fillScientific(int precision, char[] digits, int nDigits, int exp, boolean isNegative) {
        +        int startIndex = isNegative ? 1 : 0;
        +        int t = Math.max(0, Math.min(nDigits - 1, precision));
        +        if (t > 0) {
        +            mantissa = create(isNegative, t + 2);
        +            mantissa[startIndex] = digits[0];
        +            mantissa[startIndex + 1] = '.';
        +            System.arraycopy(digits, 1, mantissa, startIndex + 2, t);
        +        } else {
        +            mantissa = create(isNegative, 1);
        +            mantissa[startIndex] = digits[0];
        +        }
        +        char expSign;
        +        int e;
        +        if (exp <= 0) {
        +            expSign = '-';
        +            e = -exp + 1;
        +        } else {
        +            expSign = '+' ;
        +            e = exp - 1;
        +        }
        +        // decExponent has 1, 2, or 3, digits
        +        if (e <= 9) {
        +            exponent = new char[] { expSign,
        +                    '0', (char) (e + '0') };
        +        } else if (e <= 99) {
        +            exponent = new char[] { expSign,
        +                    (char) (e / 10 + '0'), (char) (e % 10 + '0') };
        +        } else {
        +            char hiExpChar = (char) (e / 100 + '0');
        +            e %= 100;
        +            exponent = new char[] { expSign,
        +                    hiExpChar, (char) (e / 10 + '0'), (char) (e % 10 + '0') };
        +        }
        +    }
         }
        diff --git a/jdk/src/share/classes/sun/misc/Hashing.java b/jdk/src/share/classes/sun/misc/Hashing.java
        deleted file mode 100644
        index 39ed201da3e..00000000000
        --- a/jdk/src/share/classes/sun/misc/Hashing.java
        +++ /dev/null
        @@ -1,239 +0,0 @@
        -/*
        - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
        - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        - *
        - * This code is free software; you can redistribute it and/or modify it
        - * under the terms of the GNU General Public License version 2 only, as
        - * published by the Free Software Foundation.  Oracle designates this
        - * particular file as subject to the "Classpath" exception as provided
        - * by Oracle in the LICENSE file that accompanied this code.
        - *
        - * This code is distributed in the hope that it will be useful, but WITHOUT
        - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        - * version 2 for more details (a copy is included in the LICENSE file that
        - * accompanied this code).
        - *
        - * You should have received a copy of the GNU General Public License version
        - * 2 along with this work; if not, write to the Free Software Foundation,
        - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
        - *
        - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
        - * or visit www.oracle.com if you need additional information or have any
        - * questions.
        - */
        -package sun.misc;
        -
        -import java.util.concurrent.ThreadLocalRandom;
        -
        -/**
        - * Hashing utilities.
        - *
        - * Little endian implementations of Murmur3 hashing.
        - */
        -public class Hashing {
        -
        -    /**
        -     * Static utility methods only.
        -     */
        -    private Hashing() {
        -        throw new Error("No instances");
        -    }
        -
        -    public static int murmur3_32(byte[] data) {
        -        return murmur3_32(0, data, 0, data.length);
        -    }
        -
        -    public static int murmur3_32(int seed, byte[] data) {
        -        return murmur3_32(seed, data, 0, data.length);
        -    }
        -
        -    @SuppressWarnings("fallthrough")
        -    public static int murmur3_32(int seed, byte[] data, int offset, int len) {
        -        int h1 = seed;
        -        int count = len;
        -
        -        // body
        -        while (count >= 4) {
        -            int k1 = (data[offset] & 0x0FF)
        -                    | (data[offset + 1] & 0x0FF) << 8
        -                    | (data[offset + 2] & 0x0FF) << 16
        -                    | data[offset + 3] << 24;
        -
        -            count -= 4;
        -            offset += 4;
        -
        -            k1 *= 0xcc9e2d51;
        -            k1 = Integer.rotateLeft(k1, 15);
        -            k1 *= 0x1b873593;
        -
        -            h1 ^= k1;
        -            h1 = Integer.rotateLeft(h1, 13);
        -            h1 = h1 * 5 + 0xe6546b64;
        -        }
        -
        -        // tail
        -
        -        if (count > 0) {
        -            int k1 = 0;
        -
        -            switch (count) {
        -                case 3:
        -                    k1 ^= (data[offset + 2] & 0xff) << 16;
        -                // fall through
        -                case 2:
        -                    k1 ^= (data[offset + 1] & 0xff) << 8;
        -                // fall through
        -                case 1:
        -                    k1 ^= (data[offset] & 0xff);
        -                // fall through
        -                default:
        -                    k1 *= 0xcc9e2d51;
        -                    k1 = Integer.rotateLeft(k1, 15);
        -                    k1 *= 0x1b873593;
        -                    h1 ^= k1;
        -            }
        -        }
        -
        -        // finalization
        -
        -        h1 ^= len;
        -
        -        // finalization mix force all bits of a hash block to avalanche
        -        h1 ^= h1 >>> 16;
        -        h1 *= 0x85ebca6b;
        -        h1 ^= h1 >>> 13;
        -        h1 *= 0xc2b2ae35;
        -        h1 ^= h1 >>> 16;
        -
        -        return h1;
        -    }
        -
        -    public static int murmur3_32(char[] data) {
        -        return murmur3_32(0, data, 0, data.length);
        -    }
        -
        -    public static int murmur3_32(int seed, char[] data) {
        -        return murmur3_32(seed, data, 0, data.length);
        -    }
        -
        -    public static int murmur3_32(int seed, char[] data, int offset, int len) {
        -        int h1 = seed;
        -
        -        int off = offset;
        -        int count = len;
        -
        -        // body
        -        while (count >= 2) {
        -            int k1 = (data[off++] & 0xFFFF) | (data[off++] << 16);
        -
        -            count -= 2;
        -
        -            k1 *= 0xcc9e2d51;
        -            k1 = Integer.rotateLeft(k1, 15);
        -            k1 *= 0x1b873593;
        -
        -            h1 ^= k1;
        -            h1 = Integer.rotateLeft(h1, 13);
        -            h1 = h1 * 5 + 0xe6546b64;
        -        }
        -
        -        // tail
        -
        -        if (count > 0) {
        -            int k1 = data[off];
        -
        -            k1 *= 0xcc9e2d51;
        -            k1 = Integer.rotateLeft(k1, 15);
        -            k1 *= 0x1b873593;
        -            h1 ^= k1;
        -        }
        -
        -        // finalization
        -
        -        h1 ^= len * (Character.SIZE / Byte.SIZE);
        -
        -        // finalization mix force all bits of a hash block to avalanche
        -        h1 ^= h1 >>> 16;
        -        h1 *= 0x85ebca6b;
        -        h1 ^= h1 >>> 13;
        -        h1 *= 0xc2b2ae35;
        -        h1 ^= h1 >>> 16;
        -
        -        return h1;
        -    }
        -
        -    public static int murmur3_32(int[] data) {
        -        return murmur3_32(0, data, 0, data.length);
        -    }
        -
        -    public static int murmur3_32(int seed, int[] data) {
        -        return murmur3_32(seed, data, 0, data.length);
        -    }
        -
        -    public static int murmur3_32(int seed, int[] data, int offset, int len) {
        -        int h1 = seed;
        -
        -        int off = offset;
        -        int end = offset + len;
        -
        -        // body
        -        while (off < end) {
        -            int k1 = data[off++];
        -
        -            k1 *= 0xcc9e2d51;
        -            k1 = Integer.rotateLeft(k1, 15);
        -            k1 *= 0x1b873593;
        -
        -            h1 ^= k1;
        -            h1 = Integer.rotateLeft(h1, 13);
        -            h1 = h1 * 5 + 0xe6546b64;
        -        }
        -
        -        // tail (always empty, as body is always 32-bit chunks)
        -
        -        // finalization
        -
        -        h1 ^= len * (Integer.SIZE / Byte.SIZE);
        -
        -        // finalization mix force all bits of a hash block to avalanche
        -        h1 ^= h1 >>> 16;
        -        h1 *= 0x85ebca6b;
        -        h1 ^= h1 >>> 13;
        -        h1 *= 0xc2b2ae35;
        -        h1 ^= h1 >>> 16;
        -
        -        return h1;
        -    }
        -
        -    /**
        -     * Return a non-zero 32-bit pseudo random value. The {@code instance} object
        -     * may be used as part of the value.
        -     *
        -     * @param instance an object to use if desired in choosing value.
        -     * @return a non-zero 32-bit pseudo random value.
        -     */
        -    public static int randomHashSeed(Object instance) {
        -        int seed;
        -        if (sun.misc.VM.isBooted()) {
        -            seed = ThreadLocalRandom.current().nextInt();
        -        } else {
        -            // lower quality "random" seed value--still better than zero and not
        -            // not practically reversible.
        -            int hashing_seed[] = {
        -                System.identityHashCode(Hashing.class),
        -                System.identityHashCode(instance),
        -                System.identityHashCode(Thread.currentThread()),
        -                (int) Thread.currentThread().getId(),
        -                (int) (System.currentTimeMillis() >>> 2), // resolution is poor
        -                (int) (System.nanoTime() >>> 5), // resolution is poor
        -                (int) (Runtime.getRuntime().freeMemory() >>> 4) // alloc min
        -            };
        -
        -            seed = murmur3_32(hashing_seed);
        -        }
        -
        -        // force to non-zero.
        -        return (0 != seed) ? seed : 1;
        -    }
        -}
        diff --git a/jdk/src/share/classes/sun/misc/JavaUtilZipFileAccess.java b/jdk/src/share/classes/sun/misc/JavaUtilZipFileAccess.java
        new file mode 100644
        index 00000000000..0534f3400af
        --- /dev/null
        +++ b/jdk/src/share/classes/sun/misc/JavaUtilZipFileAccess.java
        @@ -0,0 +1,33 @@
        +/*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
        + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        + *
        + * This code is free software; you can redistribute it and/or modify it
        + * under the terms of the GNU General Public License version 2 only, as
        + * published by the Free Software Foundation.  Oracle designates this
        + * particular file as subject to the "Classpath" exception as provided
        + * by Oracle in the LICENSE file that accompanied this code.
        + *
        + * This code is distributed in the hope that it will be useful, but WITHOUT
        + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        + * version 2 for more details (a copy is included in the LICENSE file that
        + * accompanied this code).
        + *
        + * You should have received a copy of the GNU General Public License version
        + * 2 along with this work; if not, write to the Free Software Foundation,
        + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
        + *
        + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
        + * or visit www.oracle.com if you need additional information or have any
        + * questions.
        + */
        +
        +package sun.misc;
        +
        +import java.util.zip.ZipFile;
        +
        +public interface JavaUtilZipFileAccess {
        +    public boolean startsWithLocHeader(ZipFile zip);
        +}
        +
        diff --git a/jdk/src/share/classes/sun/misc/SharedSecrets.java b/jdk/src/share/classes/sun/misc/SharedSecrets.java
        index 42ac25a0b5d..9248afa5ed3 100644
        --- a/jdk/src/share/classes/sun/misc/SharedSecrets.java
        +++ b/jdk/src/share/classes/sun/misc/SharedSecrets.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -52,6 +52,7 @@ public class SharedSecrets {
             private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
             private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
             private static JavaSecurityAccess javaSecurityAccess;
        +    private static JavaUtilZipFileAccess javaUtilZipFileAccess;
             private static JavaAWTAccess javaAWTAccess;
         
             public static JavaUtilJarAccess javaUtilJarAccess() {
        @@ -152,6 +153,16 @@ public class SharedSecrets {
                 return javaSecurityAccess;
             }
         
        +    public static JavaUtilZipFileAccess getJavaUtilZipFileAccess() {
        +        if (javaUtilZipFileAccess == null)
        +            unsafe.ensureClassInitialized(java.util.zip.ZipFile.class);
        +        return javaUtilZipFileAccess;
        +    }
        +
        +    public static void setJavaUtilZipFileAccess(JavaUtilZipFileAccess access) {
        +        javaUtilZipFileAccess = access;
        +    }
        +
             public static void setJavaAWTAccess(JavaAWTAccess jaa) {
                 javaAWTAccess = jaa;
             }
        @@ -159,6 +170,9 @@ public class SharedSecrets {
             public static JavaAWTAccess getJavaAWTAccess() {
                 // this may return null in which case calling code needs to
                 // provision for.
        +        if (javaAWTAccess == null || javaAWTAccess.getContext() == null) {
        +            return null;
        +        }
                 return javaAWTAccess;
             }
         }
        diff --git a/jdk/src/share/classes/sun/misc/URLClassPath.java b/jdk/src/share/classes/sun/misc/URLClassPath.java
        index 068bd72897c..993d96ecb8c 100644
        --- a/jdk/src/share/classes/sun/misc/URLClassPath.java
        +++ b/jdk/src/share/classes/sun/misc/URLClassPath.java
        @@ -64,6 +64,7 @@ public class URLClassPath {
             final static String USER_AGENT_JAVA_VERSION = "UA-Java-Version";
             final static String JAVA_VERSION;
             private static final boolean DEBUG;
        +    private static final boolean DISABLE_JAR_CHECKING;
         
             /**
              * Used by launcher to indicate that checking of the JAR file "Profile"
        @@ -76,6 +77,9 @@ public class URLClassPath {
                     new sun.security.action.GetPropertyAction("java.version"));
                 DEBUG        = (java.security.AccessController.doPrivileged(
                     new sun.security.action.GetPropertyAction("sun.misc.URLClassPath.debug")) != null);
        +        String p = java.security.AccessController.doPrivileged(
        +            new sun.security.action.GetPropertyAction("sun.misc.URLClassPath.disableJarChecking"));
        +        DISABLE_JAR_CHECKING = p != null ? p.equals("true") || p.equals("") : false;
             }
         
             /* The original search path of URLs. */
        @@ -544,7 +548,7 @@ public class URLClassPath {
                              * in a hurry.
                              */
                             JarURLConnection juc = (JarURLConnection)uc;
        -                    jarfile = juc.getJarFile();
        +                    jarfile = JarLoader.checkJar(juc.getJarFile());
                         }
                     } catch (Exception e) {
                         return null;
        @@ -609,6 +613,8 @@ public class URLClassPath {
                 private URLStreamHandler handler;
                 private HashMap lmap;
                 private boolean closed = false;
        +        private static final sun.misc.JavaUtilZipFileAccess zipAccess =
        +                sun.misc.SharedSecrets.getJavaUtilZipFileAccess();
         
                 /*
                  * Creates a new JarLoader for the specified URL referring to
        @@ -713,6 +719,22 @@ public class URLClassPath {
                     }
                 }
         
        +        /* Throws if the given jar file is does not start with the correct LOC */
        +        static JarFile checkJar(JarFile jar) throws IOException {
        +            if (System.getSecurityManager() != null && !DISABLE_JAR_CHECKING
        +                && !zipAccess.startsWithLocHeader(jar)) {
        +                IOException x = new IOException("Invalid Jar file");
        +                try {
        +                    jar.close();
        +                } catch (IOException ex) {
        +                    x.addSuppressed(ex);
        +                }
        +                throw x;
        +            }
        +
        +            return jar;
        +        }
        +
                 private JarFile getJarFile(URL url) throws IOException {
                     // Optimize case where url refers to a local jar file
                     if (isOptimizable(url)) {
        @@ -720,11 +742,12 @@ public class URLClassPath {
                         if (!p.exists()) {
                             throw new FileNotFoundException(p.getPath());
                         }
        -                return new JarFile (p.getPath());
        +                return checkJar(new JarFile(p.getPath()));
                     }
                     URLConnection uc = getBaseURL().openConnection();
                     uc.setRequestProperty(USER_AGENT_JAVA_VERSION, JAVA_VERSION);
        -            return ((JarURLConnection)uc).getJarFile();
        +            JarFile jarFile = ((JarURLConnection)uc).getJarFile();
        +            return checkJar(jarFile);
                 }
         
                 /*
        diff --git a/jdk/src/share/classes/sun/net/NetworkClient.java b/jdk/src/share/classes/sun/net/NetworkClient.java
        index dc4d12b6d4d..87f18c4f74a 100644
        --- a/jdk/src/share/classes/sun/net/NetworkClient.java
        +++ b/jdk/src/share/classes/sun/net/NetworkClient.java
        @@ -200,7 +200,13 @@ public class NetworkClient {
             protected InetAddress getLocalAddress() throws IOException {
                 if (serverSocket == null)
                     throw new IOException("not connected");
        -        return serverSocket.getLocalAddress();
        +        return  AccessController.doPrivileged(
        +                        new PrivilegedAction() {
        +                            public InetAddress run() {
        +                                return serverSocket.getLocalAddress();
        +
        +                            }
        +                        });
             }
         
             /** Close an open connection to the server. */
        diff --git a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
        index babb9f599da..db130d600a3 100644
        --- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
        +++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
        @@ -76,7 +76,10 @@ public class FtpClient extends sun.net.ftp.FtpClient {
             private FtpReplyCode lastReplyCode = null;
             /** Welcome message from the server, if any. */
             private String welcomeMsg;
        -    private boolean passiveMode = true;
        +    /**
        +     * Only passive mode used in JDK. See Bug 8010784.
        +     */
        +    private final boolean passiveMode = true;
             private TransferType type = TransferType.BINARY;
             private long restartOffset = 0;
             private long lastTransSize = -1; // -1 means 'unknown size'
        @@ -427,7 +430,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
                     }
                     response = replyBuf.toString();
                     replyBuf.setLength(0);
        -            if (logger.isLoggable(PlatformLogger.FINEST)) {
        +            if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                         logger.finest("Server [" + serverAddr + "] --> " + response);
                     }
         
        @@ -469,7 +472,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
             /** Sends command cmd to the server. */
             private void sendServer(String cmd) {
                 out.print(cmd);
        -        if (logger.isLoggable(PlatformLogger.FINEST)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                     logger.finest("Server [" + serverAddr + "] <-- " + cmd);
                 }
             }
        @@ -645,9 +648,18 @@ public class FtpClient extends sun.net.ftp.FtpClient {
                 } else {
                     s = new Socket();
                 }
        +
        +        InetAddress serverAddress = AccessController.doPrivileged(
        +                new PrivilegedAction() {
        +                    @Override
        +                    public InetAddress run() {
        +                        return server.getLocalAddress();
        +                    }
        +                });
        +
                 // Bind the socket to the same address as the control channel. This
                 // is needed in case of multi-homed systems.
        -        s.bind(new InetSocketAddress(server.getLocalAddress(), 0));
        +        s.bind(new InetSocketAddress(serverAddress, 0));
                 if (connectTimeout >= 0) {
                     s.connect(dest, connectTimeout);
                 } else {
        @@ -816,7 +828,9 @@ public class FtpClient extends sun.net.ftp.FtpClient {
              * @see #setActiveMode()
              */
             public sun.net.ftp.FtpClient enablePassiveMode(boolean passive) {
        -        passiveMode = passive;
        +
        +        // Only passive mode used in JDK. See Bug 8010784.
        +        // passiveMode = passive;
                 return this;
             }
         
        diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
        index c53eede4869..fa54e6bb1b1 100644
        --- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
        +++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
        @@ -34,6 +34,8 @@ import java.util.logging.Logger;
         import java.util.logging.Level;
         import javax.net.ssl.*;
         import com.sun.net.httpserver.*;
        +import java.security.AccessController;
        +import java.security.PrivilegedAction;
         import sun.net.httpserver.HttpConnection.State;
         
         /**
        @@ -244,7 +246,14 @@ class ServerImpl implements TimeSource {
             }
         
             public InetSocketAddress getAddress() {
        -        return (InetSocketAddress)schan.socket().getLocalSocketAddress();
        +        return AccessController.doPrivileged(
        +                new PrivilegedAction() {
        +                    public InetSocketAddress run() {
        +                        return
        +                            (InetSocketAddress)schan.socket()
        +                                .getLocalSocketAddress();
        +                    }
        +                });
             }
         
             Selector getSelector () {
        diff --git a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
        index 96f5d8d3ae7..fc23ac683be 100644
        --- a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
        +++ b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
        @@ -125,7 +125,7 @@ public class ChunkedOutputStream extends PrintStream {
                 completeHeader = getHeader(preferredChunkDataSize);
         
                 /* start with an initial buffer */
        -        buf = new byte[preferredChunkDataSize + 32];
        +        buf = new byte[preferredChunkGrossSize];
                 reset();
             }
         
        diff --git a/jdk/src/share/classes/sun/net/www/http/HttpClient.java b/jdk/src/share/classes/sun/net/www/http/HttpClient.java
        index 9f6b80afe9b..e8d77975aa1 100644
        --- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java
        +++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java
        @@ -125,7 +125,7 @@ public class HttpClient extends NetworkClient {
         
             private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
             private static void logFinest(String msg) {
        -        if (logger.isLoggable(PlatformLogger.FINEST)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                     logger.finest(msg);
                 }
             }
        @@ -549,9 +549,7 @@ public class HttpClient extends NetworkClient {
         
             public String getURLFile() throws IOException {
         
        -        String fileName = url.getFile();
        -        if ((fileName == null) || (fileName.length() == 0))
        -            fileName = "/";
        +        String fileName;
         
                 /**
                  * proxyDisabled is set by subclass HttpsClient!
        @@ -575,8 +573,24 @@ public class HttpClient extends NetworkClient {
                         result.append(url.getQuery());
                     }
         
        -            fileName =  result.toString();
        +            fileName = result.toString();
        +        } else {
        +            fileName = url.getFile();
        +
        +            if ((fileName == null) || (fileName.length() == 0)) {
        +                fileName = "/";
        +            } else if (fileName.charAt(0) == '?') {
        +                /* HTTP/1.1 spec says in 5.1.2. about Request-URI:
        +                 * "Note that the absolute path cannot be empty; if
        +                 * none is present in the original URI, it MUST be
        +                 * given as "/" (the server root)."  So if the file
        +                 * name here has only a query string, the path is
        +                 * empty and we also have to add a "/".
        +                 */
        +                fileName = "/" + fileName;
        +            }
                 }
        +
                 if (fileName.indexOf('\n') == -1)
                     return fileName;
                 else
        diff --git a/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java b/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java
        index eedd77ec193..df2dc8efc87 100644
        --- a/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java
        +++ b/jdk/src/share/classes/sun/net/www/http/PosterOutputStream.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -30,7 +30,7 @@ import java.net.*;
         
         /**
          * Instances of this class are returned to applications for the purpose of
        - * sending user data for a HTTP POST or PUT request. This class is used
        + * sending user data for a HTTP request (excluding TRACE). This class is used
          * when the content-length will be specified in the header of the request.
          * The semantics of ByteArrayOutputStream are extended so that
          * when close() is called, it is no longer possible to write
        diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
        index 5d06ede46cd..1efb3e1657d 100644
        --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
        +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
        @@ -413,13 +413,13 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                 return java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedAction() {
                         public PasswordAuthentication run() {
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Requesting Authentication: host =" + host + " url = " + url);
                             }
                             PasswordAuthentication pass = Authenticator.requestPasswordAuthentication(
                                 host, addr, port, protocol,
                                 prompt, scheme, url, authType);
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Authentication returned: " + (pass != null ? pass.toString() : "null"));
                             }
                             return pass;
        @@ -632,7 +632,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                     if (!chunked) {
                         if (requests.findValue("Transfer-Encoding") != null) {
                             requests.remove("Transfer-Encoding");
        -                    if (logger.isLoggable(PlatformLogger.WARNING)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.WARNING)) {
                                 logger.warning(
                                     "use streaming mode for chunked encoding");
                             }
        @@ -645,7 +645,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
         
                     setRequests=true;
                 }
        -        if (logger.isLoggable(PlatformLogger.FINE)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                     logger.fine(requests.toString());
                 }
                 http.writeRequests(requests, poster, streaming());
        @@ -991,7 +991,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                                 && !(cachedResponse instanceof SecureCacheResponse)) {
                                 cachedResponse = null;
                             }
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Cache Request for " + uri + " / " + getRequestMethod());
                                 logger.finest("From cache: " + (cachedResponse != null ? cachedResponse.toString() : "null"));
                             }
        @@ -1032,7 +1032,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                                      });
                         if (sel != null) {
                             URI uri = sun.net.www.ParseUtil.toURI(url);
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("ProxySelector Request for " + uri);
                             }
                             Iterator it = sel.select(uri).iterator();
        @@ -1049,7 +1049,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                                         http = getNewHttpClient(url, p, connectTimeout, false);
                                         http.setReadTimeout(readTimeout);
                                     }
        -                            if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                            if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                         if (p != null) {
                                             logger.finest("Proxy used: " + p.toString());
                                         }
        @@ -1167,7 +1167,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
         
             /*
              * Allowable input/output sequences:
        -     * [interpreted as POST/PUT]
        +     * [interpreted as request entity]
              * - get output, [write output,] get input, [read input]
              * - get output, [write output]
              * [interpreted as GET]
        @@ -1209,9 +1209,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                     if (method.equals("GET")) {
                         method = "POST"; // Backward compatibility
                     }
        -            if (!"POST".equals(method) && !"PUT".equals(method) &&
        -                "http".equals(url.getProtocol())) {
        -                throw new ProtocolException("HTTP method " + method +
        +            if ("TRACE".equals(method) && "http".equals(url.getProtocol())) {
        +                throw new ProtocolException("HTTP method TRACE" +
                                                     " doesn't support output");
                     }
         
        @@ -1308,14 +1307,14 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
         
                     URI uri = ParseUtil.toURI(url);
                     if (uri != null) {
        -                if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                             logger.finest("CookieHandler request for " + uri);
                         }
                         Map> cookies
                             = cookieHandler.get(
                                 uri, requests.getHeaders(EXCLUDE_HEADERS));
                         if (!cookies.isEmpty()) {
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Cookies retrieved: " + cookies.toString());
                             }
                             for (Map.Entry> entry :
        @@ -1476,14 +1475,14 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                             writeRequests();
                         }
                         http.parseHTTP(responses, pi, this);
        -                if (logger.isLoggable(PlatformLogger.FINE)) {
        +                if (logger.isLoggable(PlatformLogger.Level.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)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                                 logger.fine(">>>> Headers are filtered");
                                 logger.fine(responses.toString());
                             }
        @@ -1943,12 +1942,12 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                         http.parseHTTP(responses, null, this);
         
                         /* Log the response to the CONNECT */
        -                if (logger.isLoggable(PlatformLogger.FINE)) {
        +                if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                             logger.fine(responses.toString());
                         }
         
                         if (responses.filterNTLMResponses("Proxy-Authenticate")) {
        -                    if (logger.isLoggable(PlatformLogger.FINE)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                                 logger.fine(">>>> Headers are filtered");
                                 logger.fine(responses.toString());
                             }
        @@ -2075,7 +2074,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                 setPreemptiveProxyAuthentication(requests);
         
                  /* Log the CONNECT request */
        -        if (logger.isLoggable(PlatformLogger.FINE)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                     logger.fine(requests.toString());
                 }
         
        @@ -2218,7 +2217,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                             ret = new NegotiateAuthentication(new HttpCallerInfo(authhdr.getHttpCallerInfo(), "Kerberos"));
                             break;
                         case UNKNOWN:
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
                             }
                         /*fall through*/
        @@ -2247,7 +2246,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                         }
                     }
                 }
        -        if (logger.isLoggable(PlatformLogger.FINER)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINER)) {
                     logger.finer("Proxy Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null"));
                 }
                 return ret;
        @@ -2377,7 +2376,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                             }
                             break;
                         case UNKNOWN:
        -                    if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                    if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                 logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
                             }
                         /*fall through*/
        @@ -2404,7 +2403,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                         }
                     }
                 }
        -        if (logger.isLoggable(PlatformLogger.FINER)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINER)) {
                     logger.finer("Server Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null"));
                 }
                 return ret;
        @@ -2532,7 +2531,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
                 if (streaming()) {
                     throw new HttpRetryException (RETRY_MSG3, stat, loc);
                 }
        -        if (logger.isLoggable(PlatformLogger.FINE)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINE)) {
                     logger.fine("Redirected from " + url + " to " + locUrl);
                 }
         
        @@ -2807,9 +2806,10 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
         
                 if (SET_COOKIE.equalsIgnoreCase(name) ||
                     SET_COOKIE2.equalsIgnoreCase(name)) {
        +
                     // Filtering only if there is a cookie handler. [Assumption: the
                     // cookie handler will store/retrieve the HttpOnly cookies]
        -            if (cookieHandler == null)
        +            if (cookieHandler == null || value.length() == 0)
                         return value;
         
                     sun.misc.JavaNetHttpCookieAccess access =
        diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java b/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java
        index 96ede3e67f8..41618ca075c 100644
        --- a/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java
        +++ b/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java
        @@ -142,7 +142,7 @@ class NTLMAuthenticationProxy {
         
             static void finest(Exception e) {
                 PlatformLogger logger = HttpURLConnection.getHttpLogger();
        -        if (logger.isLoggable(PlatformLogger.FINEST)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                     logger.finest("NTLMAuthenticationProxy: " + e);
                 }
             }
        diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java b/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java
        index bd1c826c4c9..5674371ec5b 100644
        --- a/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java
        +++ b/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java
        @@ -76,7 +76,7 @@ public abstract class Negotiator {
         
             private static void finest(Exception e) {
                 PlatformLogger logger = HttpURLConnection.getHttpLogger();
        -        if (logger.isLoggable(PlatformLogger.FINEST)) {
        +        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                     logger.finest("NegotiateAuthentication: " + e);
                 }
             }
        diff --git a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java
        index bf4c2b412ca..9bcbe8720ea 100644
        --- a/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java
        +++ b/jdk/src/share/classes/sun/net/www/protocol/https/HttpsClient.java
        @@ -350,7 +350,7 @@ final class HttpsClient extends HttpClient
                                 if (httpuc != null && ret.needsTunneling())
                                     httpuc.setTunnelState(TUNNELING);
                                 PlatformLogger logger = HttpURLConnection.getHttpLogger();
        -                        if (logger.isLoggable(PlatformLogger.FINEST)) {
        +                        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                                     logger.finest("KeepAlive stream retrieved from the cache, " + ret);
                                 }
                             }
        diff --git a/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
        index 729faf8d1b8..9699c829690 100644
        --- a/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
        +++ b/jdk/src/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
        @@ -51,7 +51,7 @@ abstract class AsynchronousServerSocketChannelImpl
             protected final FileDescriptor fd;
         
             // the local address to which the channel's socket is bound
        -    protected volatile SocketAddress localAddress = null;
        +    protected volatile InetSocketAddress localAddress = null;
         
             // need this lock to set local address
             private final Object stateLock = new Object();
        @@ -63,6 +63,8 @@ abstract class AsynchronousServerSocketChannelImpl
             // set true when accept operation is cancelled
             private volatile boolean acceptKilled;
         
        +    // set true when exclusive binding is on and SO_REUSEADDR is emulated
        +    private boolean isReuseAddress;
         
             AsynchronousServerSocketChannelImpl(AsynchronousChannelGroupImpl group) {
                 super(group.provider());
        @@ -171,7 +173,7 @@ abstract class AsynchronousServerSocketChannelImpl
             public final SocketAddress getLocalAddress() throws IOException {
                 if (!isOpen())
                     throw new ClosedChannelException();
        -        return localAddress;
        +        return Net.getRevealedLocalAddress(localAddress);
             }
         
             @Override
        @@ -186,7 +188,14 @@ abstract class AsynchronousServerSocketChannelImpl
         
                 try {
                     begin();
        -            Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                isReuseAddress = (Boolean)value;
        +            } else {
        +                Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            }
                     return this;
                 } finally {
                     end();
        @@ -203,6 +212,12 @@ abstract class AsynchronousServerSocketChannelImpl
         
                 try {
                     begin();
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                return (T)Boolean.valueOf(isReuseAddress);
        +            }
                     return (T) Net.getSocketOption(fd, Net.UNSPEC, name);
                 } finally {
                     end();
        @@ -236,7 +251,7 @@ abstract class AsynchronousServerSocketChannelImpl
                     if (localAddress == null) {
                         sb.append("unbound");
                     } else {
        -                sb.append(localAddress.toString());
        +                sb.append(Net.getRevealedLocalAddressAsString(localAddress));
                     }
                 }
                 sb.append(']');
        diff --git a/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java
        index 6ba52273a6d..273f9def315 100644
        --- a/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java
        +++ b/jdk/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java
        @@ -53,8 +53,8 @@ abstract class AsynchronousSocketChannelImpl
             // protects state, localAddress, and remoteAddress
             protected final Object stateLock = new Object();
         
        -    protected volatile SocketAddress localAddress = null;
        -    protected volatile SocketAddress remoteAddress = null;
        +    protected volatile InetSocketAddress localAddress = null;
        +    protected volatile InetSocketAddress remoteAddress = null;
         
             // State, increases monotonically
             static final int ST_UNINITIALIZED = -1;
        @@ -79,6 +79,9 @@ abstract class AsynchronousSocketChannelImpl
             private final ReadWriteLock closeLock = new ReentrantReadWriteLock();
             private volatile boolean open = true;
         
        +    // set true when exclusive binding is on and SO_REUSEADDR is emulated
        +    private boolean isReuseAddress;
        +
             AsynchronousSocketChannelImpl(AsynchronousChannelGroupImpl group)
                 throws IOException
             {
        @@ -439,7 +442,7 @@ abstract class AsynchronousSocketChannelImpl
             public final SocketAddress getLocalAddress() throws IOException {
                 if (!isOpen())
                     throw new ClosedChannelException();
        -        return localAddress;
        +         return Net.getRevealedLocalAddress(localAddress);
             }
         
             @Override
        @@ -455,7 +458,14 @@ abstract class AsynchronousSocketChannelImpl
                     begin();
                     if (writeShutdown)
                         throw new IOException("Connection has been shutdown for writing");
        -            Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                isReuseAddress = (Boolean)value;
        +            } else {
        +                Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            }
                     return this;
                 } finally {
                     end();
        @@ -472,6 +482,12 @@ abstract class AsynchronousSocketChannelImpl
         
                 try {
                     begin();
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                return (T)Boolean.valueOf(isReuseAddress);
        +            }
                     return (T) Net.getSocketOption(fd, Net.UNSPEC, name);
                 } finally {
                     end();
        @@ -566,7 +582,8 @@ abstract class AsynchronousSocketChannelImpl
                         }
                         if (localAddress != null) {
                             sb.append(" local=");
        -                    sb.append(localAddress.toString());
        +                    sb.append(
        +                            Net.getRevealedLocalAddressAsString(localAddress));
                         }
                         if (remoteAddress != null) {
                             sb.append(" remote=");
        diff --git a/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
        index 4e41a9aa1b8..b99750c4c37 100644
        --- a/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
        +++ b/jdk/src/share/classes/sun/nio/ch/DatagramChannelImpl.java
        @@ -85,8 +85,8 @@ class DatagramChannelImpl
             private int state = ST_UNINITIALIZED;
         
             // Binding
        -    private SocketAddress localAddress;
        -    private SocketAddress remoteAddress;
        +    private InetSocketAddress localAddress;
        +    private InetSocketAddress remoteAddress;
         
             // Our socket adaptor, if any
             private DatagramSocket socket;
        @@ -94,6 +94,12 @@ class DatagramChannelImpl
             // Multicast support
             private MembershipRegistry registry;
         
        +    // set true when socket is bound and SO_REUSEADDRESS is emulated
        +    private boolean reuseAddressEmulated;
        +
        +    // set true/false when socket is already bound and SO_REUSEADDR is emulated
        +    private boolean isReuseAddress;
        +
             // -- End of fields protected by stateLock
         
         
        @@ -162,7 +168,8 @@ class DatagramChannelImpl
                 synchronized (stateLock) {
                     if (!isOpen())
                         throw new ClosedChannelException();
        -            return localAddress;
        +            // Perform security check before returning address
        +            return Net.getRevealedLocalAddress(localAddress);
                 }
             }
         
        @@ -222,6 +229,12 @@ class DatagramChannelImpl
                         }
                         return this;
                     }
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind() && localAddress != null)
        +            {
        +                reuseAddressEmulated = true;
        +                this.isReuseAddress = (Boolean)value;
        +            }
         
                     // remaining options don't need any special handling
                     Net.setSocketOption(fd, Net.UNSPEC, name, value);
        @@ -280,6 +293,12 @@ class DatagramChannelImpl
                         }
                     }
         
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    reuseAddressEmulated)
        +            {
        +                return (T)Boolean.valueOf(isReuseAddress);
        +            }
        +
                     // no special handling
                     return (T) Net.getSocketOption(fd, Net.UNSPEC, name);
                 }
        @@ -703,6 +722,7 @@ class DatagramChannelImpl
                 }
             }
         
        +    @Override
             public DatagramChannel connect(SocketAddress sa) throws IOException {
                 int localPort = 0;
         
        @@ -724,7 +744,7 @@ class DatagramChannelImpl
         
                             // Connection succeeded; disallow further invocation
                             state = ST_CONNECTED;
        -                    remoteAddress = sa;
        +                    remoteAddress = isa;
                             sender = isa;
                             cachedSenderInetAddress = isa.getAddress();
                             cachedSenderPort = isa.getPort();
        @@ -743,7 +763,7 @@ class DatagramChannelImpl
                         synchronized (stateLock) {
                             if (!isConnected() || !isOpen())
                                 return this;
        -                    InetSocketAddress isa = (InetSocketAddress)remoteAddress;
        +                    InetSocketAddress isa = remoteAddress;
                             SecurityManager sm = System.getSecurityManager();
                             if (sm != null)
                                 sm.checkConnect(isa.getAddress().getHostAddress(),
        diff --git a/jdk/src/share/classes/sun/nio/ch/Net.java b/jdk/src/share/classes/sun/nio/ch/Net.java
        index 486cc838deb..2b68f963ff5 100644
        --- a/jdk/src/share/classes/sun/nio/ch/Net.java
        +++ b/jdk/src/share/classes/sun/nio/ch/Net.java
        @@ -31,6 +31,7 @@ import java.nio.channels.*;
         import java.util.*;
         import java.security.AccessController;
         import java.security.PrivilegedAction;
        +import java.security.PrivilegedExceptionAction;
         
         
         public class Net {
        @@ -44,6 +45,34 @@ public class Net {
                 }
             };
         
        +    // set to true if exclusive binding is on for Windows
        +    private static final boolean exclusiveBind;
        +
        +    static {
        +        int availLevel = isExclusiveBindAvailable();
        +        if (availLevel >= 0) {
        +            String exclBindProp =
        +                java.security.AccessController.doPrivileged(
        +                    new PrivilegedAction() {
        +                        @Override
        +                        public String run() {
        +                            return System.getProperty(
        +                                    "sun.net.useExclusiveBind");
        +                        }
        +                    });
        +            if (exclBindProp != null) {
        +                exclusiveBind = exclBindProp.length() == 0 ?
        +                        true : Boolean.parseBoolean(exclBindProp);
        +            } else if (availLevel == 1) {
        +                exclusiveBind = true;
        +            } else {
        +                exclusiveBind = false;
        +            }
        +        } else {
        +            exclusiveBind = false;
        +        }
        +    }
        +
             // -- Miscellaneous utilities --
         
             private static volatile boolean checkedIPv6 = false;
        @@ -60,6 +89,13 @@ public class Net {
                 return isIPv6Available;
             }
         
        +    /**
        +     * Returns true if exclusive binding is on
        +     */
        +    static boolean useExclusiveBind() {
        +        return exclusiveBind;
        +    }
        +
             /**
              * Tells whether IPv6 sockets can join IPv4 multicast groups
              */
        @@ -147,6 +183,34 @@ public class Net {
                 translateException(x, false);
             }
         
        +    /**
        +     * Returns the local address after performing a SecurityManager#checkConnect.
        +     */
        +    static InetSocketAddress getRevealedLocalAddress(InetSocketAddress addr) {
        +        SecurityManager sm = System.getSecurityManager();
        +        if (addr == null || sm == null)
        +            return addr;
        +
        +        try{
        +            sm.checkConnect(addr.getAddress().getHostAddress(), -1);
        +            // Security check passed
        +        } catch (SecurityException e) {
        +            // Return loopback address only if security check fails
        +            addr = getLoopbackAddress(addr.getPort());
        +        }
        +        return addr;
        +    }
        +
        +    static String getRevealedLocalAddressAsString(InetSocketAddress addr) {
        +        return System.getSecurityManager() == null ? addr.toString() :
        +                getLoopbackAddress(addr.getPort()).toString();
        +    }
        +
        +    private static InetSocketAddress getLoopbackAddress(int port) {
        +        return new InetSocketAddress(InetAddress.getLoopbackAddress(),
        +                                     port);
        +    }
        +
             /**
              * Returns any IPv4 address of the given network interface, or
              * null if the interface does not have any IPv4 addresses.
        @@ -308,6 +372,12 @@ public class Net {
         
             private static native boolean isIPv6Available0();
         
        +    /*
        +     * Returns 1 for Windows versions that support exclusive binding by default, 0
        +     * for those that do not, and -1 for Solaris/Linux/Mac OS
        +     */
        +    private static native int isExclusiveBindAvailable();
        +
             private static native boolean canIPv6SocketJoinIPv4Group0();
         
             private static native boolean canJoin6WithIPv4Group0();
        @@ -341,11 +411,12 @@ public class Net {
             {
                 boolean preferIPv6 = isIPv6Available() &&
                     (family != StandardProtocolFamily.INET);
        -        bind0(preferIPv6, fd, addr, port);
        +        bind0(fd, preferIPv6, exclusiveBind, addr, port);
             }
         
        -    private static native void bind0(boolean preferIPv6, FileDescriptor fd,
        -                                     InetAddress addr, int port)
        +    private static native void bind0(FileDescriptor fd, boolean preferIPv6,
        +                                     boolean useExclBind, InetAddress addr,
        +                                     int port)
                 throws IOException;
         
             static native void listen(FileDescriptor fd, int backlog) throws IOException;
        diff --git a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java
        index d88982e636a..776592db412 100644
        --- a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java
        +++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java
        @@ -80,7 +80,8 @@ public class ServerSocketAdaptor                        // package-private
             public InetAddress getInetAddress() {
                 if (!ssc.isBound())
                     return null;
        -        return Net.asInetSocketAddress(ssc.localAddress()).getAddress();
        +        return Net.getRevealedLocalAddress(ssc.localAddress()).getAddress();
        +
             }
         
             public int getLocalPort() {
        diff --git a/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
        index 728d865b878..3b3969cc158 100644
        --- a/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
        +++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
        @@ -72,7 +72,10 @@ class ServerSocketChannelImpl
             private int state = ST_UNINITIALIZED;
         
             // Binding
        -    private SocketAddress localAddress; // null => unbound
        +    private InetSocketAddress localAddress; // null => unbound
        +
        +    // set true when exclusive binding is on and SO_REUSEADDR is emulated
        +    private boolean isReuseAddress;
         
             // Our socket adaptor, if any
             ServerSocket socket;
        @@ -113,7 +116,9 @@ class ServerSocketChannelImpl
                 synchronized (stateLock) {
                     if (!isOpen())
                         throw new ClosedChannelException();
        -            return localAddress;
        +            return localAddress == null ? localAddress
        +                    : Net.getRevealedLocalAddress(
        +                          Net.asInetSocketAddress(localAddress));
                 }
             }
         
        @@ -125,13 +130,18 @@ class ServerSocketChannelImpl
                     throw new NullPointerException();
                 if (!supportedOptions().contains(name))
                     throw new UnsupportedOperationException("'" + name + "' not supported");
        -
                 synchronized (stateLock) {
                     if (!isOpen())
                         throw new ClosedChannelException();
        -
        -            // no options that require special handling
        -            Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                isReuseAddress = (Boolean)value;
        +            } else {
        +                // no options that require special handling
        +                Net.setSocketOption(fd, Net.UNSPEC, name, value);
        +            }
                     return this;
                 }
             }
        @@ -149,7 +159,12 @@ class ServerSocketChannelImpl
                 synchronized (stateLock) {
                     if (!isOpen())
                         throw new ClosedChannelException();
        -
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                return (T)Boolean.valueOf(isReuseAddress);
        +            }
                     // no options that require special handling
                     return (T) Net.getSocketOption(fd, Net.UNSPEC, name);
                 }
        @@ -177,7 +192,7 @@ class ServerSocketChannelImpl
                 }
             }
         
        -    public SocketAddress localAddress() {
        +    public InetSocketAddress localAddress() {
                 synchronized (stateLock) {
                     return localAddress;
                 }
        @@ -371,14 +386,15 @@ class ServerSocketChannelImpl
                 StringBuffer sb = new StringBuffer();
                 sb.append(this.getClass().getName());
                 sb.append('[');
        -        if (!isOpen())
        +        if (!isOpen()) {
                     sb.append("closed");
        -        else {
        +        } else {
                     synchronized (stateLock) {
        -                if (localAddress() == null) {
        +                InetSocketAddress addr = localAddress();
        +                if (addr == null) {
                             sb.append("unbound");
                         } else {
        -                    sb.append(localAddress().toString());
        +                    sb.append(Net.getRevealedLocalAddressAsString(addr));
                         }
                     }
                 }
        diff --git a/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java b/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java
        index ad1240f4855..2fd00ca2222 100644
        --- a/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java
        +++ b/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java
        @@ -149,9 +149,10 @@ public class SocketAdaptor
         
             public InetAddress getLocalAddress() {
                 if (sc.isOpen()) {
        -            SocketAddress local = sc.localAddress();
        -            if (local != null)
        -                return ((InetSocketAddress)local).getAddress();
        +            InetSocketAddress local = sc.localAddress();
        +            if (local != null) {
        +                return Net.getRevealedLocalAddress(local).getAddress();
        +            }
                 }
                 return new InetSocketAddress(0).getAddress();
             }
        diff --git a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java
        index 22be8fb6efd..6959c17780d 100644
        --- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java
        +++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java
        @@ -70,6 +70,9 @@ class SocketChannelImpl
         
             // -- The following fields are protected by stateLock
         
        +    // set true when exclusive binding is on and SO_REUSEADDR is emulated
        +    private boolean isReuseAddress;
        +
             // State, increases monotonically
             private static final int ST_UNINITIALIZED = -1;
             private static final int ST_UNCONNECTED = 0;
        @@ -80,8 +83,8 @@ class SocketChannelImpl
             private int state = ST_UNINITIALIZED;
         
             // Binding
        -    private SocketAddress localAddress;
        -    private SocketAddress remoteAddress;
        +    private InetSocketAddress localAddress;
        +    private InetSocketAddress remoteAddress;
         
             // Input/Output open
             private boolean isInputOpen = true;
        @@ -143,7 +146,7 @@ class SocketChannelImpl
                 synchronized (stateLock) {
                     if (!isOpen())
                         throw new ClosedChannelException();
        -            return localAddress;
        +            return  Net.getRevealedLocalAddress(localAddress);
                 }
             }
         
        @@ -174,6 +177,12 @@ class SocketChannelImpl
                         if (!Net.isIPv6Available())
                             Net.setSocketOption(fd, StandardProtocolFamily.INET, name, value);
                         return this;
        +            } else if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                           Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                isReuseAddress = (Boolean)value;
        +                return this;
                     }
         
                     // no options that require special handling
        @@ -196,6 +205,13 @@ class SocketChannelImpl
                     if (!isOpen())
                         throw new ClosedChannelException();
         
        +            if (name == StandardSocketOptions.SO_REUSEADDR &&
        +                    Net.useExclusiveBind())
        +            {
        +                // SO_REUSEADDR emulated when using exclusive bind
        +                return (T)Boolean.valueOf(isReuseAddress);
        +            }
        +
                     // special handling for IP_TOS: always return 0 when IPv6
                     if (name == StandardSocketOptions.IP_TOS) {
                         return (Net.isIPv6Available()) ? (T) Integer.valueOf(0) :
        @@ -531,7 +547,7 @@ class SocketChannelImpl
                 IOUtil.configureBlocking(fd, block);
             }
         
        -    public SocketAddress localAddress() {
        +    public InetSocketAddress localAddress() {
                 synchronized (stateLock) {
                     return localAddress;
                 }
        @@ -958,6 +974,7 @@ class SocketChannelImpl
                 return fdVal;
             }
         
        +    @Override
             public String toString() {
                 StringBuffer sb = new StringBuffer();
                 sb.append(this.getClass().getSuperclass().getName());
        @@ -981,9 +998,10 @@ class SocketChannelImpl
                                 sb.append(" oshut");
                             break;
                         }
        -                if (localAddress() != null) {
        +                InetSocketAddress addr = localAddress();
        +                if (addr != null) {
                             sb.append(" local=");
        -                    sb.append(localAddress().toString());
        +                    sb.append(Net.getRevealedLocalAddressAsString(addr));
                         }
                         if (remoteAddress() != null) {
                             sb.append(" remote=");
        diff --git a/jdk/src/share/classes/sun/reflect/CallerSensitive.java b/jdk/src/share/classes/sun/reflect/CallerSensitive.java
        index 19e47cdd5ea..1822fbe66dd 100644
        --- a/jdk/src/share/classes/sun/reflect/CallerSensitive.java
        +++ b/jdk/src/share/classes/sun/reflect/CallerSensitive.java
        @@ -36,6 +36,6 @@ import static java.lang.annotation.ElementType.*;
          * @author John R. Rose
          */
         @Retention(RetentionPolicy.RUNTIME)
        -@Target({CONSTRUCTOR, METHOD})
        +@Target({METHOD})
         public @interface CallerSensitive {
         }
        diff --git a/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java b/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
        index d3cff5716ef..6e73de70d52 100644
        --- a/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
        +++ b/jdk/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -337,12 +337,15 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
                 try {
                     annotationType = AnnotationType.getInstance(type);
                 } catch(IllegalArgumentException e) {
        -            // Class is no longer an annotation type; all bets are off
        -            return;
        +            // Class is no longer an annotation type; time to punch out
        +            throw new java.io.InvalidObjectException("Non-annotation type in annotation serial stream");
                 }
         
                 Map> memberTypes = annotationType.memberTypes();
         
        +
        +        // If there are annotation members without values, that
        +        // situation is handled by the invoke method.
                 for (Map.Entry memberValue : memberValues.entrySet()) {
                     String name = memberValue.getKey();
                     Class memberType = memberTypes.get(name);
        diff --git a/jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java b/jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java
        index a9648233319..6fae146e228 100644
        --- a/jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java
        +++ b/jdk/src/share/classes/sun/reflect/generics/repository/ClassRepository.java
        @@ -40,6 +40,8 @@ import java.lang.reflect.Type;
          */
         public class ClassRepository extends GenericDeclRepository {
         
        +    public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
        +
             private Type superclass; // caches the generic superclass info
             private Type[] superInterfaces; // caches the generic superinterface info
         
        diff --git a/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java b/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java
        index 0640d92e5d0..efd85fca9cb 100644
        --- a/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java
        +++ b/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java
        @@ -27,6 +27,7 @@
         package sun.reflect.misc;
         
         import java.lang.reflect.Modifier;
        +import java.lang.reflect.Proxy;
         import sun.reflect.Reflection;
         
         public final class ReflectUtil {
        @@ -114,11 +115,26 @@ public final class ReflectUtil {
                 return false;
             }
         
        -
        +    /**
        +     * Checks package access on the given class.
        +     *
        +     * If it is a {@link Proxy#isProxyClass(java.lang.Class)} that implements
        +     * a non-public interface (i.e. may be in a non-restricted package),
        +     * also check the package access on the proxy interfaces.
        +     */
             public static void checkPackageAccess(Class clazz) {
                 checkPackageAccess(clazz.getName());
        +        if (isNonPublicProxyClass(clazz)) {
        +            checkProxyPackageAccess(clazz);
        +        }
             }
         
        +    /**
        +     * Checks package access on the given classname.
        +     * This method is typically called when the Class instance is not
        +     * available and the caller attempts to load a class on behalf
        +     * the true caller (application).
        +     */
             public static void checkPackageAccess(String name) {
                 SecurityManager s = System.getSecurityManager();
                 if (s != null) {
        @@ -179,14 +195,31 @@ public final class ReflectUtil {
                 return !isAncestor(from, to);
             }
         
        +    /**
        +     * Check package access on the proxy interfaces that the given proxy class
        +     * implements.
        +     *
        +     * @param clazz Proxy class object
        +     */
        +    public static void checkProxyPackageAccess(Class clazz) {
        +        SecurityManager s = System.getSecurityManager();
        +        if (s != null) {
        +            // check proxy interfaces if the given class is a proxy class
        +            if (Proxy.isProxyClass(clazz)) {
        +                for (Class intf : clazz.getInterfaces()) {
        +                    checkPackageAccess(intf);
        +                }
        +            }
        +        }
        +    }
        +
             /**
              * Access check on the interfaces that a proxy class implements and throw
        -     * {@code SecurityException} if it accesses a restricted package.
        +     * {@code SecurityException} if it accesses a restricted package from
        +     * the caller's class loader.
              *
              * @param ccl the caller's class loader
              * @param interfaces the list of interfaces that a proxy class implements
        -     *
        -     * @see Proxy#checkProxyAccess
              */
             public static void checkProxyPackageAccess(ClassLoader ccl,
                                                        Class... interfaces)
        @@ -205,4 +238,16 @@ public final class ReflectUtil {
             // Note that bytecode instrumentation tools may exclude 'sun.*'
             // classes but not generated proxy classes and so keep it in com.sun.*
             public static final String PROXY_PACKAGE = "com.sun.proxy";
        +
        +    /**
        +     * Test if the given class is a proxy class that implements
        +     * non-public interface.  Such proxy class may be in a non-restricted
        +     * package that bypasses checkPackageAccess.
        +     */
        +    public static boolean isNonPublicProxyClass(Class cls) {
        +        String name = cls.getName();
        +        int i = name.lastIndexOf('.');
        +        String pkg = (i != -1) ? name.substring(0, i) : "";
        +        return Proxy.isProxyClass(cls) && !pkg.equals(PROXY_PACKAGE);
        +    }
         }
        diff --git a/jdk/src/share/classes/sun/rmi/rmic/Main.java b/jdk/src/share/classes/sun/rmi/rmic/Main.java
        index 2f9c8c8ff2b..8e0eb3a9a62 100644
        --- a/jdk/src/share/classes/sun/rmi/rmic/Main.java
        +++ b/jdk/src/share/classes/sun/rmi/rmic/Main.java
        @@ -879,9 +879,9 @@ public class Main implements sun.rmi.rmic.Constants {
                 }
         
                 String[] args = new String[3];
        -        args[0] = (arg0 != null ? arg0.toString() : "null");
        -        args[1] = (arg1 != null ? arg1.toString() : "null");
        -        args[2] = (arg2 != null ? arg2.toString() : "null");
        +        args[0] = (arg0 != null ? arg0 : "null");
        +        args[1] = (arg1 != null ? arg1 : "null");
        +        args[2] = (arg2 != null ? arg2 : "null");
         
                 return java.text.MessageFormat.format(format, (Object[]) args);
             }
        diff --git a/jdk/src/share/classes/sun/rmi/server/Activation.java b/jdk/src/share/classes/sun/rmi/server/Activation.java
        index d1946fafc2f..55bc0ecc74a 100644
        --- a/jdk/src/share/classes/sun/rmi/server/Activation.java
        +++ b/jdk/src/share/classes/sun/rmi/server/Activation.java
        @@ -2230,7 +2230,13 @@ public class Activation implements Serializable {
                 }
         
                 public InetAddress getInetAddress() {
        -            return serverSocket.getInetAddress();
        +            return AccessController.doPrivileged(
        +                new PrivilegedAction() {
        +                    @Override
        +                    public InetAddress run() {
        +                        return serverSocket.getInetAddress();
        +                    }
        +                });
                 }
         
                 public int getLocalPort() {
        @@ -2238,7 +2244,13 @@ public class Activation implements Serializable {
                 }
         
                 public SocketAddress getLocalSocketAddress() {
        -            return serverSocket.getLocalSocketAddress();
        +            return AccessController.doPrivileged(
        +                new PrivilegedAction() {
        +                    @Override
        +                    public SocketAddress run() {
        +                        return serverSocket.getLocalSocketAddress();
        +                    }
        +                });
                 }
         
                 /**
        diff --git a/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java b/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java
        index 2e9d4552b13..7830ed354bb 100644
        --- a/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java
        +++ b/jdk/src/share/classes/sun/rmi/server/LoaderHandler.java
        @@ -55,6 +55,7 @@ import java.util.IdentityHashMap;
         import java.util.Map;
         import java.util.StringTokenizer;
         import java.util.WeakHashMap;
        +import sun.reflect.misc.ReflectUtil;
         import sun.rmi.runtime.Log;
         import sun.security.action.GetPropertyAction;
         
        @@ -170,7 +171,7 @@ public final class LoaderHandler {
         
                 if (defaultLoader != null) {
                     try {
        -                Class c = Class.forName(name, false, defaultLoader);
        +                Class c = loadClassForName(name, false, defaultLoader);
                         if (loaderLog.isLoggable(Log.VERBOSE)) {
                             loaderLog.log(Log.VERBOSE,
                                 "class \"" + name + "\" found via defaultLoader, " +
        @@ -422,7 +423,7 @@ public final class LoaderHandler {
                          * resolved without the security-offending codebase anyway;
                          * if so, return successfully (see bugids 4191926 & 4349670).
                          */
        -                Class c = Class.forName(name, false, parent);
        +                Class c = loadClassForName(name, false, parent);
                         if (loaderLog.isLoggable(Log.VERBOSE)) {
                             loaderLog.log(Log.VERBOSE,
                                 "class \"" + name + "\" found via " +
        @@ -448,7 +449,7 @@ public final class LoaderHandler {
                 }
         
                 try {
        -            Class c = Class.forName(name, false, loader);
        +            Class c = loadClassForName(name, false, loader);
                     if (loaderLog.isLoggable(Log.VERBOSE)) {
                         loaderLog.log(Log.VERBOSE,
                             "class \"" + name + "\" " + "found via codebase, " +
        @@ -726,7 +727,7 @@ public final class LoaderHandler {
         
                 for (int i = 0; i < interfaces.length; i++) {
                     Class cl =
        -                (classObjs[i] = Class.forName(interfaces[i], false, loader));
        +                (classObjs[i] = loadClassForName(interfaces[i], false, loader));
         
                     if (!Modifier.isPublic(cl.getModifiers())) {
                         ClassLoader current = cl.getClassLoader();
        @@ -1195,5 +1196,28 @@ public final class LoaderHandler {
                 public String toString() {
                     return super.toString() + "[\"" + annotation + "\"]";
                 }
        +
        +        @Override
        +        protected Class loadClass(String name, boolean resolve)
        +                throws ClassNotFoundException {
        +            if (parent == null) {
        +                ReflectUtil.checkPackageAccess(name);
        +            }
        +            return super.loadClass(name, resolve);
        +        }
        +
        +
             }
        +
        +    private static Class loadClassForName(String name,
        +                                              boolean initialize,
        +                                              ClassLoader loader)
        +            throws ClassNotFoundException
        +    {
        +        if (loader == null) {
        +            ReflectUtil.checkPackageAccess(name);
        +        }
        +        return Class.forName(name, initialize, loader);
        +    }
        +
         }
        diff --git a/jdk/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java b/jdk/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
        index a60b23864af..657683cd6f8 100644
        --- a/jdk/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
        +++ b/jdk/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
        @@ -38,6 +38,10 @@ class CGIClientException extends Exception {
             public CGIClientException(String s) {
                 super(s);
             }
        +
        +    public CGIClientException(String s, Throwable cause) {
        +        super(s, cause);
        +    }
         }
         
         /**
        @@ -50,6 +54,10 @@ class CGIServerException extends Exception {
             public CGIServerException(String s) {
                 super(s);
             }
        +
        +    public CGIServerException(String s, Throwable cause) {
        +        super(s, cause);
        +    }
         }
         
         /**
        @@ -148,13 +156,16 @@ public final class CGIHandler {
                         try {
                             handler.execute(param);
                         } catch (CGIClientException e) {
        +                    e.printStackTrace();
                             returnClientError(e.getMessage());
                         } catch (CGIServerException e) {
        +                    e.printStackTrace();
                             returnServerError(e.getMessage());
                         }
                     else
                         returnClientError("invalid command.");
                 } catch (Exception e) {
        +            e.printStackTrace();
                     returnServerError("internal error: " + e.getMessage());
                 }
                 System.exit(0);
        @@ -225,7 +236,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                 try {
                     port = Integer.parseInt(param);
                 } catch (NumberFormatException e) {
        -            throw new CGIClientException("invalid port number.");
        +            throw new CGIClientException("invalid port number.", e);
                 }
                 if (port <= 0 || port > 0xFFFF)
                     throw new CGIClientException("invalid port: " + port);
        @@ -238,7 +249,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                 try {
                     socket = new Socket(InetAddress.getLocalHost(), port);
                 } catch (IOException e) {
        -            throw new CGIServerException("could not connect to local port");
        +            throw new CGIServerException("could not connect to local port", e);
                 }
         
                 /*
        @@ -249,9 +260,9 @@ final class CGIForwardCommand implements CGICommandHandler {
                 try {
                     clientIn.readFully(buffer);
                 } catch (EOFException e) {
        -            throw new CGIClientException("unexpected EOF reading request body");
        +            throw new CGIClientException("unexpected EOF reading request body", e);
                 } catch (IOException e) {
        -            throw new CGIClientException("error reading request body");
        +            throw new CGIClientException("error reading request body", e);
                 }
         
                 /*
        @@ -266,7 +277,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                     socketOut.write(buffer);
                     socketOut.flush();
                 } catch (IOException e) {
        -            throw new CGIServerException("error writing to server");
        +            throw new CGIServerException("error writing to server", e);
                 }
         
                 /*
        @@ -276,7 +287,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                 try {
                     socketIn = new DataInputStream(socket.getInputStream());
                 } catch (IOException e) {
        -            throw new CGIServerException("error reading from server");
        +            throw new CGIServerException("error reading from server", e);
                 }
                 String key = "Content-length:".toLowerCase();
                 boolean contentLengthFound = false;
        @@ -286,7 +297,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                     try {
                         line = getLine(socketIn);
                     } catch (IOException e) {
        -                throw new CGIServerException("error reading from server");
        +                throw new CGIServerException("error reading from server", e);
                     }
                     if (line == null)
                         throw new CGIServerException(
        @@ -313,9 +324,9 @@ final class CGIForwardCommand implements CGICommandHandler {
                     socketIn.readFully(buffer);
                 } catch (EOFException e) {
                     throw new CGIServerException(
        -                "unexpected EOF reading server response");
        +                "unexpected EOF reading server response", e);
                 } catch (IOException e) {
        -            throw new CGIServerException("error reading from server");
        +            throw new CGIServerException("error reading from server", e);
                 }
         
                 /*
        @@ -327,7 +338,7 @@ final class CGIForwardCommand implements CGICommandHandler {
                 try {
                     System.out.write(buffer);
                 } catch (IOException e) {
        -            throw new CGIServerException("error writing response");
        +            throw new CGIServerException("error writing response", e);
                 }
                 System.out.flush();
             }
        diff --git a/jdk/src/share/classes/sun/rmi/transport/proxy/WrappedSocket.java b/jdk/src/share/classes/sun/rmi/transport/proxy/WrappedSocket.java
        index 96ff38cc3e5..67f8fe65510 100644
        --- a/jdk/src/share/classes/sun/rmi/transport/proxy/WrappedSocket.java
        +++ b/jdk/src/share/classes/sun/rmi/transport/proxy/WrappedSocket.java
        @@ -28,6 +28,8 @@ import java.io.*;
         import java.net.InetAddress;
         import java.net.Socket;
         import java.net.SocketException;
        +import java.security.AccessController;
        +import java.security.PrivilegedAction;
         
         /**
          * The WrappedSocket class provides a general wrapper for providing an
        @@ -78,7 +80,14 @@ class WrappedSocket extends Socket {
              * Get the local address to which the socket is bound.
              */
             public InetAddress getLocalAddress() {
        -        return socket.getLocalAddress();
        +        return  AccessController.doPrivileged(
        +                        new PrivilegedAction() {
        +                            @Override
        +                            public InetAddress run() {
        +                                return socket.getLocalAddress();
        +
        +                            }
        +                        });
             }
         
             /**
        diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java b/jdk/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java
        index 80da88eadb5..35882bc3fdc 100644
        --- a/jdk/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java
        +++ b/jdk/src/share/classes/sun/security/jgss/krb5/AcceptSecContextToken.java
        @@ -27,9 +27,10 @@ package sun.security.jgss.krb5;
         
         import org.ietf.jgss.*;
         import java.io.InputStream;
        -import java.io.OutputStream;
         import java.io.IOException;
        -import java.io.ByteArrayInputStream;
        +import java.security.AccessController;
        +
        +import sun.security.action.GetBooleanAction;
         import sun.security.krb5.*;
         
         class AcceptSecContextToken extends InitialToken {
        @@ -42,23 +43,19 @@ class AcceptSecContextToken extends InitialToken {
              */
             public AcceptSecContextToken(Krb5Context context,
                                          KrbApReq apReq)
        -        throws KrbException, IOException {
        +        throws KrbException, IOException, GSSException {
         
        -        /*
        -         * RFC 1964, section 1.2 states:
        -         *  (1) context key: uses Kerberos session key (or subkey, if
        -         *  present in authenticator emitted by context initiator) directly
        -         *
        -         * This does not mention context acceptor. Hence we will not
        -         * generate a subkey on the acceptor side. Note: Our initiator will
        -         * still allow another acceptor to generate a subkey, even though
        -         * our acceptor does not do so.
        -         */
        -        boolean useSubkey = false;
        +        boolean useSubkey = AccessController.doPrivileged(
        +                new GetBooleanAction("sun.security.krb5.acceptor.subkey"));
         
                 boolean useSequenceNumber = true;
         
        -        apRep = new KrbApRep(apReq, useSequenceNumber, useSubkey);
        +        EncryptionKey subKey = null;
        +        if (useSubkey) {
        +            subKey = new EncryptionKey(apReq.getCreds().getSessionKey());
        +            context.setKey(Krb5Context.ACCEPTOR_SUBKEY, subKey);
        +        }
        +        apRep = new KrbApRep(apReq, useSequenceNumber, subKey);
         
                 context.resetMySequenceNumber(apRep.getSeqNumber().intValue());
         
        diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java
        index 1b63cd60295..5771886023c 100644
        --- a/jdk/src/share/classes/sun/security/krb5/Config.java
        +++ b/jdk/src/share/classes/sun/security/krb5/Config.java
        @@ -761,22 +761,23 @@ public class Config {
             }
         
             /**
        -     * Returns the default encryption types.
        -     *
        +     * Returns all etypes specified in krb5.conf for the given configName,
        +     * or all the builtin defaults. This result is always non-empty.
        +     * If no etypes are found, an exception is thrown.
              */
        -    public int[] defaultEtype(String enctypes) {
        +    public int[] defaultEtype(String configName) throws KrbException {
                 String default_enctypes;
        -        default_enctypes = get("libdefaults", enctypes);
        -        String delim = " ";
        -        StringTokenizer st;
        +        default_enctypes = get("libdefaults", configName);
                 int[] etype;
                 if (default_enctypes == null) {
                     if (DEBUG) {
                         System.out.println("Using builtin default etypes for " +
        -                    enctypes);
        +                    configName);
                     }
                     etype = EType.getBuiltInDefaults();
                 } else {
        +            String delim = " ";
        +            StringTokenizer st;
                     for (int j = 0; j < default_enctypes.length(); j++) {
                         if (default_enctypes.substring(j, j + 1).equals(",")) {
                             // only two delimiters are allowed to use
        @@ -791,17 +792,13 @@ public class Config {
                     int type;
                     for (int i = 0; i < len; i++) {
                         type = Config.getType(st.nextToken());
        -                if ((type != -1) &&
        -                    (EType.isSupported(type))) {
        +                if (type != -1 && EType.isSupported(type)) {
                             ls.add(type);
                         }
                     }
                     if (ls.isEmpty()) {
        -                if (DEBUG) {
        -                    System.out.println(
        -                        "no supported default etypes for " + enctypes);
        -                }
        -                return null;
        +                throw new KrbException("no supported default etypes for "
        +                        + configName);
                     } else {
                         etype = new int[ls.size()];
                         for (int i = 0; i < etype.length; i++) {
        @@ -811,7 +808,7 @@ public class Config {
                 }
         
                 if (DEBUG) {
        -            System.out.print("default etypes for " + enctypes + ":");
        +            System.out.print("default etypes for " + configName + ":");
                     for (int i = 0; i < etype.length; i++) {
                         System.out.print(" " + etype[i]);
                     }
        diff --git a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
        index ba27220f66f..08fd9d2675e 100644
        --- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
        +++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
        @@ -97,36 +97,6 @@ public class EncryptionKey
                 return new EncryptionKey(keyValue, keyType, kvno);
             }
         
        -    /**
        -     * Obtains the latest version of the secret key of
        -     * the principal from a keytab.
        -     *
        -     * @param princ the principal whose secret key is desired
        -     * @param keytab the path to the keytab file. A value of null
        -     * will be accepted to indicate that the default path should be
        -     * searched.
        -     * @returns the secret key or null if none was found.
        -     */
        -    /*
        -    // Replaced by acquireSecretKeys
        -    public static EncryptionKey acquireSecretKey(PrincipalName princ,
        -                                                 String keytab)
        -        throws KrbException, IOException {
        -
        -        if (princ == null) {
        -            throw new IllegalArgumentException(
        -                "Cannot have null pricipal name to look in keytab.");
        -        }
        -
        -        KeyTab ktab = KeyTab.getInstance(keytab);
        -
        -        if (ktab == null)
        -            return null;
        -
        -        return ktab.readServiceKey(princ);
        -    }
        -    */
        -
             /**
              * Obtains all versions of the secret key of the principal from a
              * keytab.
        @@ -208,9 +178,6 @@ public class EncryptionKey
                     String salt) throws KrbException {
         
                 int[] etypes = EType.getDefaults("default_tkt_enctypes");
        -        if (etypes == null) {
        -            etypes = EType.getBuiltInDefaults();
        -        }
         
                 EncryptionKey[] encKeys = new EncryptionKey[etypes.length];
                 for (int i = 0; i < etypes.length; i++) {
        @@ -330,9 +297,11 @@ public class EncryptionKey
         
             /**
              * Generates a sub-sessionkey from a given session key.
        +     *
        +     * Used in AcceptSecContextToken and KrbApReq by acceptor- and initiator-
        +     * side respectively.
              */
        -     // Used in KrbApRep, KrbApReq
        -    EncryptionKey(EncryptionKey key) throws KrbCryptoException {
        +    public EncryptionKey(EncryptionKey key) throws KrbCryptoException {
                 // generate random sub-session key
                 keyValue = Confounder.bytes(key.keyValue.length);
                 for (int i = 0; i < keyValue.length; i++) {
        diff --git a/jdk/src/share/classes/sun/security/krb5/KdcComm.java b/jdk/src/share/classes/sun/security/krb5/KdcComm.java
        index 80c0af48e00..141592f11c3 100644
        --- a/jdk/src/share/classes/sun/security/krb5/KdcComm.java
        +++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java
        @@ -46,6 +46,7 @@ import java.util.ArrayList;
         import java.util.List;
         import java.util.Set;
         import java.util.HashSet;
        +import java.util.Iterator;
         import sun.security.krb5.internal.KRBError;
         
         /**
        @@ -203,7 +204,6 @@ public final class KdcComm {
         
                 if (obuf == null)
                     return null;
        -        Exception savedException = null;
                 Config cfg = Config.getInstance();
         
                 if (realm == null) {
        @@ -218,42 +218,51 @@ public final class KdcComm {
                 if (kdcList == null) {
                     throw new KrbException("Cannot get kdc for realm " + realm);
                 }
        -        String tempKdc = null; // may include the port number also
        -        byte[] ibuf = null;
        -        for (String tmp: KdcAccessibility.list(kdcList)) {
        -            tempKdc = tmp;
        -            try {
        -                ibuf = send(obuf,tempKdc,useTCP);
        -                KRBError ke = null;
        +        // tempKdc may include the port number also
        +        Iterator tempKdc = KdcAccessibility.list(kdcList).iterator();
        +        if (!tempKdc.hasNext()) {
        +            throw new KrbException("Cannot get kdc for realm " + realm);
        +        }
        +        try {
        +            return sendIfPossible(obuf, tempKdc.next(), useTCP);
        +        } catch(Exception first) {
        +            while(tempKdc.hasNext()) {
                         try {
        -                    ke = new KRBError(ibuf);
        -                } catch (Exception e) {
        -                    // OK
        -                }
        -                if (ke != null && ke.getErrorCode() ==
        -                        Krb5.KRB_ERR_RESPONSE_TOO_BIG) {
        -                    ibuf = send(obuf, tempKdc, true);
        -                }
        -                KdcAccessibility.removeBad(tempKdc);
        -                break;
        +                    return sendIfPossible(obuf, tempKdc.next(), useTCP);
        +                } catch(Exception ignore) {}
        +            }
        +            throw first;
        +        }
        +    }
        +
        +    // send the AS Request to the specified KDC
        +    // failover to using TCP if useTCP is not set and response is too big
        +    private byte[] sendIfPossible(byte[] obuf, String tempKdc, boolean useTCP)
        +        throws IOException, KrbException {
        +
        +        try {
        +            byte[] ibuf = send(obuf, tempKdc, useTCP);
        +            KRBError ke = null;
        +            try {
        +                ke = new KRBError(ibuf);
                     } catch (Exception e) {
        -                if (DEBUG) {
        -                    System.out.println(">>> KrbKdcReq send: error trying " +
        -                            tempKdc);
        -                    e.printStackTrace(System.out);
        -                }
        -                KdcAccessibility.addBad(tempKdc);
        -                savedException = e;
        +                // OK
                     }
        -        }
        -        if (ibuf == null && savedException != null) {
        -            if (savedException instanceof IOException) {
        -                throw (IOException) savedException;
        -            } else {
        -                throw (KrbException) savedException;
        +            if (ke != null && ke.getErrorCode() ==
        +                    Krb5.KRB_ERR_RESPONSE_TOO_BIG) {
        +                ibuf = send(obuf, tempKdc, true);
                     }
        +            KdcAccessibility.removeBad(tempKdc);
        +            return ibuf;
        +        } catch(Exception e) {
        +            if (DEBUG) {
        +                System.out.println(">>> KrbKdcReq send: error trying " +
        +                        tempKdc);
        +                e.printStackTrace(System.out);
        +            }
        +            KdcAccessibility.addBad(tempKdc);
        +            throw e;
                 }
        -        return ibuf;
             }
         
             // send the AS Request to the specified KDC
        @@ -496,7 +505,7 @@ public final class KdcComm {
                 }
         
                 // Returns a preferred KDC list by putting the bad ones at the end
        -        private static synchronized String[] list(String kdcList) {
        +        private static synchronized List list(String kdcList) {
                     StringTokenizer st = new StringTokenizer(kdcList);
                     List list = new ArrayList<>();
                     if (badPolicy == BpType.TRY_LAST) {
        @@ -515,7 +524,7 @@ public final class KdcComm {
                             list.add(st.nextToken());
                         }
                     }
        -            return list.toArray(new String[list.size()]);
        +            return list;
                 }
             }
         }
        diff --git a/jdk/src/share/classes/sun/security/krb5/KrbApRep.java b/jdk/src/share/classes/sun/security/krb5/KrbApRep.java
        index 2b994f7ea3a..792e5ae7659 100644
        --- a/jdk/src/share/classes/sun/security/krb5/KrbApRep.java
        +++ b/jdk/src/share/classes/sun/security/krb5/KrbApRep.java
        @@ -53,12 +53,10 @@ public class KrbApRep {
              */
              // Used in AcceptSecContextToken
             public KrbApRep(KrbApReq incomingReq,
        -                    boolean useSeqNumber,
        -        boolean useSubKey) throws KrbException, IOException {
        +                     boolean useSeqNumber,
        +                     EncryptionKey subKey)
        +            throws KrbException, IOException {
         
        -        EncryptionKey subKey =
        -            (useSubKey?
        -             new EncryptionKey(incomingReq.getCreds().getSessionKey()):null);
                 SeqNumber seqNum = new LocalSeqNumber();
         
                 init(incomingReq, subKey, seqNum);
        diff --git a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
        index 2bc01f693f5..d05ee69c44e 100644
        --- a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
        +++ b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
        @@ -33,12 +33,14 @@ package sun.security.krb5;
         
         import sun.security.krb5.internal.*;
         import sun.security.krb5.internal.crypto.*;
        -import sun.security.krb5.internal.rcache.*;
         import sun.security.jgss.krb5.Krb5AcceptCredential;
         import java.net.InetAddress;
         import sun.security.util.*;
         import java.io.IOException;
         import java.util.Arrays;
        +import java.security.MessageDigest;
        +import java.security.NoSuchAlgorithmException;
        +import sun.security.krb5.internal.rcache.AuthTimeWithHash;
         
         /**
          * This class encapsulates a KRB-AP-REQ that a client sends to a
        @@ -53,11 +55,23 @@ public class KrbApReq {
             private Credentials creds;
             private APReq apReqMessg;
         
        -    private static CacheTable table = new CacheTable();
        +    // Used by acceptor side
        +    private static ReplayCache rcache = ReplayCache.getInstance();
             private static boolean DEBUG = Krb5.DEBUG;
        +    private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
        +
        +    private static final MessageDigest md;
        +
        +    static {
        +        try {
        +            md = MessageDigest.getInstance("MD5");
        +        } catch (NoSuchAlgorithmException ex) {
        +            throw new RuntimeException("Impossible");
        +        }
        +    }
         
             /**
        -     * Contructs a AP-REQ message to send to the peer.
        +     * Constructs an AP-REQ message to send to the peer.
              * @param tgsCred the Credentials to be used to construct the
              *          AP Request  protocol message.
              * @param mutualRequired Whether mutual authentication is required
        @@ -81,7 +95,7 @@ public class KrbApReq {
         */
         
             /**
        -     * Contructs a AP-REQ message to send to the peer.
        +     * Constructs an AP-REQ message to send to the peer.
              * @param tgsCred the Credentials to be used to construct the
              *          AP Request  protocol message.
              * @param mutualRequired Whether mutual authentication is required
        @@ -125,7 +139,7 @@ public class KrbApReq {
             }
         
             /**
        -     * Contructs a AP-REQ message from the bytes received from the
        +     * Constructs an AP-REQ message from the bytes received from the
              * peer.
              * @param message The message received from the peer
              * @param keys EncrtyptionKeys to decrypt the message;
        @@ -146,7 +160,7 @@ public class KrbApReq {
             }
         
             /**
        -     * Contructs a AP-REQ message from the bytes received from the
        +     * Constructs an AP-REQ message from the bytes received from the
              * peer.
              * @param value The DerValue that contains the
              *              DER enoded AP-REQ protocol message
        @@ -297,15 +311,19 @@ public class KrbApReq {
                 if (!authenticator.ctime.inClockSkew())
                     throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
         
        -        // start to check if it is a replay attack.
        -        AuthTime time =
        -            new AuthTime(authenticator.ctime.getTime(), authenticator.cusec);
        -        String client = authenticator.cname.toString();
        -        if (table.get(time, authenticator.cname.toString()) != null) {
        -            throw new KrbApErrException(Krb5.KRB_AP_ERR_REPEAT);
        -        } else {
        -            table.put(client, time, System.currentTimeMillis());
        +        byte[] hash = md.digest(apReqMessg.authenticator.cipher);
        +        char[] h = new char[hash.length * 2];
        +        for (int i=0; i>4];
        +            h[2*i+1] = hexConst[hash[i]&0xf];
                 }
        +        AuthTimeWithHash time = new AuthTimeWithHash(
        +                authenticator.cname.toString(),
        +                apReqMessg.ticket.sname.toString(),
        +                authenticator.ctime.getSeconds(),
        +                authenticator.cusec,
        +                new String(h));
        +        rcache.checkAndStore(KerberosTime.now(), time);
         
                 if (initiator != null) {
                     // sender host address
        @@ -490,10 +508,6 @@ public class KrbApReq {
              // Check that key is one of the permitted types
              private static void checkPermittedEType(int target) throws KrbException {
                 int[] etypes = EType.getDefaults("permitted_enctypes");
        -        if (etypes == null) {
        -            throw new KrbException(
        -                "No supported encryption types listed in permitted_enctypes");
        -        }
                 if (!EType.isSupported(target, etypes)) {
                     throw new KrbException(EType.toString(target) +
                         " encryption type not in permitted_enctypes list");
        diff --git a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
        index 32263b53770..fa599e47892 100644
        --- a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
        +++ b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
        @@ -291,8 +291,7 @@ public class KrbTgsReq {
                                  Ticket[] additionalTickets,
                                  EncryptionKey subKey,
                                  PAData extraPA)
        -        throws Asn1Exception, IOException, KdcErrException, KrbApErrException,
        -               UnknownHostException, KrbCryptoException {
        +        throws IOException, KrbException, UnknownHostException {
                 KerberosTime req_till = null;
                 if (till == null) {
                     req_till = new KerberosTime(0);
        @@ -314,10 +313,6 @@ public class KrbTgsReq {
                 int[] req_eTypes = null;
                 if (eTypes == null) {
                     req_eTypes = EType.getDefaults("default_tgs_enctypes");
        -            if (req_eTypes == null) {
        -                throw new KrbCryptoException(
        -            "No supported encryption types listed in default_tgs_enctypes");
        -            }
                 } else {
                     req_eTypes = eTypes;
                 }
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ReplayCache.java b/jdk/src/share/classes/sun/security/krb5/internal/ReplayCache.java
        new file mode 100644
        index 00000000000..f6dc5702c47
        --- /dev/null
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/ReplayCache.java
        @@ -0,0 +1,72 @@
        +/*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
        + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        + *
        + * This code is free software; you can redistribute it and/or modify it
        + * under the terms of the GNU General Public License version 2 only, as
        + * published by the Free Software Foundation.  Oracle designates this
        + * particular file as subject to the "Classpath" exception as provided
        + * by Oracle in the LICENSE file that accompanied this code.
        + *
        + * This code is distributed in the hope that it will be useful, but WITHOUT
        + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        + * version 2 for more details (a copy is included in the LICENSE file that
        + * accompanied this code).
        + *
        + * You should have received a copy of the GNU General Public License version
        + * 2 along with this work; if not, write to the Free Software Foundation,
        + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
        + *
        + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
        + * or visit www.oracle.com if you need additional information or have any
        + * questions.
        + */
        +
        +package sun.security.krb5.internal;
        +
        +import sun.security.action.GetPropertyAction;
        +import sun.security.krb5.internal.rcache.AuthTimeWithHash;
        +import sun.security.krb5.internal.rcache.MemoryCache;
        +import sun.security.krb5.internal.rcache.DflCache;
        +
        +import java.security.AccessController;
        +
        +/**
        + * Models the replay cache of an acceptor as described in
        + * RFC 4120 3.2.3.
        + * @since 1.8
        + */
        +public abstract class ReplayCache {
        +    public static ReplayCache getInstance(String type) {
        +        if (type == null) {
        +            return new MemoryCache();
        +        } else if (type.equals("dfl") || type.startsWith("dfl:")) {
        +            return new DflCache(type);
        +        } else if (type.equals("none")) {
        +            return new ReplayCache() {
        +                @Override
        +                public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        +                        throws KrbApErrException {
        +                    // no check at all
        +                }
        +            };
        +        } else {
        +            throw new IllegalArgumentException("Unknown type: " + type);
        +        }
        +    }
        +    public static ReplayCache getInstance() {
        +        String type = AccessController.doPrivileged(
        +                new GetPropertyAction("sun.security.krb5.rcache"));
        +        return getInstance(type);
        +    }
        +
        +    /**
        +     * Accepts or rejects an AuthTime.
        +     * @param currTime the current time
        +     * @param time AuthTimeWithHash object calculated from authenticator
        +     * @throws KrbApErrException if the authenticator is a replay
        +     */
        +    public abstract void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        +            throws KrbApErrException;
        +}
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
        index 91d0c2faada..534bc8fcfbc 100644
        --- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
        @@ -230,11 +230,14 @@ public abstract class EType {
             /**
              * Retrieves the default etypes from the configuration file, or
              * if that's not available, return the built-in list of default etypes.
        +     * This result is always non-empty. If no etypes are found,
        +     * an exception is thrown.
              */
        -    // used in KrbAsReq, KeyTab
        -    public static int[] getDefaults(String configName) {
        +    public static int[] getDefaults(String configName)
        +            throws KrbException {
        +        Config config = null;
                 try {
        -            return Config.getInstance().defaultEtype(configName);
        +            config = Config.getInstance();
                 } catch (KrbException exc) {
                     if (DEBUG) {
                         System.out.println("Exception while getting " +
        @@ -243,6 +246,7 @@ public abstract class EType {
                     }
                     return getBuiltInDefaults();
                 }
        +        return config.defaultEtype(configName);
             }
         
             /**
        @@ -254,12 +258,8 @@ public abstract class EType {
              * we have keys.
              */
             public static int[] getDefaults(String configName, EncryptionKey[] keys)
        -        throws KrbException {
        +            throws KrbException {
                 int[] answer = getDefaults(configName);
        -        if (answer == null) {
        -            throw new KrbException("No supported encryption types listed in "
        -                + configName);
        -        }
         
                 List list = new ArrayList<>(answer.length);
                 for (int i = 0; i < answer.length; i++) {
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
        index c1372ff35f4..4d08539fde0 100644
        --- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
        @@ -279,8 +279,7 @@ public class KeyTab implements KeyTabConstants {
         
             /**
              * Reads all keys for a service from the keytab file that have
        -     * etypes that have been configured for use. If there are multiple
        -     * keys with same etype, the one with the highest kvno is returned.
        +     * etypes that have been configured for use.
              * @param service the PrincipalName of the requested service
              * @return an array containing all the service keys, never null
              */
        @@ -313,35 +312,12 @@ public class KeyTab implements KeyTabConstants {
                 size = keys.size();
                 EncryptionKey[] retVal = keys.toArray(new EncryptionKey[size]);
         
        -        // Sort keys according to default_tkt_enctypes
        -        if (DEBUG) {
        -            System.out.println("Ordering keys wrt default_tkt_enctypes list");
        -        }
        -
        -        final int[] etypes = EType.getDefaults("default_tkt_enctypes");
        -
        -        // Sort the keys, k1 is preferred than k2 if:
        -        // 1. k1's etype appears earlier in etypes than k2's
        -        // 2. If same, k1's KVNO is higher
        +        // Sort the keys by kvno. Sometimes we must choose a single key (say,
        +        // generate encrypted timestamp in AS-REQ). A key with a higher KVNO
        +        // sounds like a newer one.
                 Arrays.sort(retVal, new Comparator() {
                     @Override
                     public int compare(EncryptionKey o1, EncryptionKey o2) {
        -                if (etypes != null) {
        -                    int o1EType = o1.getEType();
        -                    int o2EType = o2.getEType();
        -                    if (o1EType != o2EType) {
        -                        for (int i=0; i entries;
        +    private final int lifespan;
        +
        +    /**
        +     * Constructs a AuthList.
        +     */
        +    public AuthList(int lifespan) {
        +        this.lifespan = lifespan;
        +        entries = new LinkedList<>();
        +    }
        +
        +    /**
        +     * Puts the authenticator timestamp into the cache in descending order,
        +     * and throw an exception if it's already there.
        +     */
        +    public void put(AuthTimeWithHash t, KerberosTime currentTime)
        +            throws KrbApErrException {
        +
        +        if (entries.isEmpty()) {
        +            entries.addFirst(t);
        +        } else {
        +            AuthTimeWithHash temp = entries.getFirst();
        +            int cmp = temp.compareTo(t);
        +            if (cmp < 0) {
        +                // This is the most common case, newly received authenticator
        +                // has larger timestamp.
        +                entries.addFirst(t);
        +            } else if (cmp == 0) {
        +                throw new KrbApErrException(Krb5.KRB_AP_ERR_REPEAT);
        +            } else {
        +                //unless client clock being re-adjusted.
        +                ListIterator it = entries.listIterator(1);
        +                boolean found = false;
        +                while (it.hasNext()) {
        +                    temp = it.next();
        +                    cmp = temp.compareTo(t);
        +                    if (cmp < 0) {
        +                        // Find an older one, put in front of it
        +                        entries.add(entries.indexOf(temp), t);
        +                        found = true;
        +                        break;
        +                    } else if (cmp == 0) {
        +                        throw new KrbApErrException(Krb5.KRB_AP_ERR_REPEAT);
        +                    }
        +                }
        +                if (!found) {
        +                    // All is newer than the newcomer. Sigh.
        +                    entries.addLast(t);
        +                }
        +            }
        +        }
        +
        +        // let us cleanup while we are here
        +        long timeLimit = currentTime.getSeconds() - lifespan;
        +        ListIterator it = entries.listIterator(0);
        +        AuthTimeWithHash temp = null;
        +        int index = -1;
        +        while (it.hasNext()) {
        +            // search expired timestamps.
        +            temp = it.next();
        +            if (temp.ctime < timeLimit) {
        +                index = entries.indexOf(temp);
        +                break;
        +            }
        +        }
        +        // It would be nice if LinkedList has a method called truncate(index).
        +        if (index > -1) {
        +            do {
        +                // remove expired timestamps from the list.
        +                entries.removeLast();
        +            } while(entries.size() > index);
        +        }
        +    }
        +
        +    public boolean isEmpty() {
        +        return entries.isEmpty();
        +    }
        +
        +    public String toString() {
        +        StringBuilder sb = new StringBuilder();
        +        Iterator iter = entries.descendingIterator();
        +        int pos = entries.size();
        +        while (iter.hasNext()) {
        +            AuthTimeWithHash at = iter.next();
        +            sb.append('#').append(pos--).append(": ")
        +                    .append(at.toString()).append('\n');
        +        }
        +        return sb.toString();
        +    }
        +}
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTime.java b/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTime.java
        index e7ebb7e08ec..7183d7d5c05 100644
        --- a/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTime.java
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTime.java
        @@ -1,4 +1,5 @@
         /*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -30,54 +31,126 @@
         
         package sun.security.krb5.internal.rcache;
         
        -import sun.security.krb5.internal.KerberosTime;
        +import java.io.IOException;
        +import java.nio.BufferUnderflowException;
        +import java.nio.ByteBuffer;
        +import java.nio.ByteOrder;
        +import java.nio.channels.SeekableByteChannel;
        +import java.nio.charset.StandardCharsets;
        +import java.util.StringTokenizer;
         
         /**
        - * The class represents the timestamp in authenticator.
        + * The class represents an old style replay cache entry. It is only used in
        + * a dfl file.
          *
        + * @author Sun/Oracle
          * @author Yanni Zhang
          */
         public class AuthTime {
        -    long kerberosTime;
        -    int cusec;
        +    final int ctime;
        +    final int cusec;
        +    final String client;
        +    final String server;
         
             /**
        -     * Constructs a new AuthTime.
        -     * @param time time from the Authenticator.
        -     * @param cusec microsecond field from the Authenticator.
        +     * Constructs an AuthTime.
              */
        -    public AuthTime(long time, int c) {
        -        kerberosTime = time;
        -        cusec = c;
        +    public AuthTime(String client, String server,
        +            int ctime, int cusec) {
        +        this.ctime = ctime;
        +        this.cusec = cusec;
        +        this.client = client;
        +        this.server = server;
             }
         
        +    @Override
        +    public String toString() {
        +        return String.format("%d/%06d/----/%s", ctime, cusec, client);
        +    }
        +
        +    // Methods used when saved in a dfl file. See DflCache.java
        +
             /**
        -     * Compares if an object equals to an AuthTime object.
        -     * @param o an object.
        -     * @return true if two objects are equivalent, otherwise, return false.
        +     * Reads an LC style string from a channel, which is a int32 length
        +     * plus a UTF-8 encoded string possibly ends with \0.
        +     * @throws IOException if there is a format error
        +     * @throws BufferUnderflowException if goes beyond the end
              */
        -    public boolean equals(Object o) {
        -        if (o instanceof AuthTime) {
        -            if ((((AuthTime)o).kerberosTime == kerberosTime)
        -                && (((AuthTime)o).cusec == cusec)) {
        -                return true;
        -            }
        +    private static String readStringWithLength(SeekableByteChannel chan)
        +            throws IOException {
        +        ByteBuffer bb = ByteBuffer.allocate(4);
        +        bb.order(ByteOrder.nativeOrder());
        +        chan.read(bb);
        +        bb.flip();
        +        int len = bb.getInt();
        +        if (len > 1024) {
        +            // Memory attack? The string should be fairly short.
        +            throw new IOException("Invalid string length");
                 }
        -        return false;
        +        bb = ByteBuffer.allocate(len);
        +        if (chan.read(bb) != len) {
        +            throw new IOException("Not enough string");
        +        }
        +        byte[] data = bb.array();
        +        return (data[len-1] == 0)?
        +                new String(data, 0, len-1, StandardCharsets.UTF_8):
        +                new String(data, StandardCharsets.UTF_8);
             }
         
             /**
        -     * Returns a hash code for this AuthTime object.
        -     *
        -     * @return  a hash code value for this object.
        +     * Reads an AuthTime or AuthTimeWithHash object from a channel.
        +     * @throws IOException if there is a format error
        +     * @throws BufferUnderflowException if goes beyond the end
              */
        -    public int hashCode() {
        -        int result = 17;
        -
        -        result = 37 * result + (int)(kerberosTime ^ (kerberosTime >>> 32));
        -        result = 37 * result + cusec;
        -
        -        return result;
        +    public static AuthTime readFrom(SeekableByteChannel chan)
        +            throws IOException {
        +        String client = readStringWithLength(chan);
        +        String server = readStringWithLength(chan);
        +        ByteBuffer bb = ByteBuffer.allocate(8);
        +        chan.read(bb);
        +        bb.order(ByteOrder.nativeOrder());
        +        int cusec = bb.getInt(0);
        +        int ctime = bb.getInt(4);
        +        if (client.isEmpty()) {
        +            StringTokenizer st = new StringTokenizer(server, " :");
        +            if (st.countTokens() != 6) {
        +                throw new IOException("Incorrect rcache style");
        +            }
        +            st.nextToken();
        +            String hash = st.nextToken();
        +            st.nextToken();
        +            client = st.nextToken();
        +            st.nextToken();
        +            server = st.nextToken();
        +            return new AuthTimeWithHash(
        +                    client, server, ctime, cusec, hash);
        +        } else {
        +            return new AuthTime(
        +                    client, server, ctime, cusec);
        +        }
             }
         
        +    /**
        +     * Encodes to be used in a dfl file
        +     */
        +    protected byte[] encode0(String cstring, String sstring) {
        +        byte[] c = cstring.getBytes(StandardCharsets.UTF_8);;
        +        byte[] s = sstring.getBytes(StandardCharsets.UTF_8);;
        +        byte[] zero = new byte[1];
        +        int len = 4 + c.length + 1 + 4 + s.length + 1 + 4 + 4;
        +        ByteBuffer bb = ByteBuffer.allocate(len)
        +                .order(ByteOrder.nativeOrder());
        +        bb.putInt(c.length+1).put(c).put(zero)
        +                .putInt(s.length+1).put(s).put(zero)
        +                .putInt(cusec).putInt(ctime);
        +        return bb.array();
        +    }
        +
        +    /**
        +     * Encodes to be used in a dfl file
        +     * @param withHash useless here
        +     */
        +    public byte[] encode(boolean withHash) {
        +        return encode0(client, server);
        +    }
         }
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTimeWithHash.java b/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTimeWithHash.java
        new file mode 100644
        index 00000000000..52bc8a8260b
        --- /dev/null
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/AuthTimeWithHash.java
        @@ -0,0 +1,124 @@
        +/*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
        + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        + *
        + * This code is free software; you can redistribute it and/or modify it
        + * under the terms of the GNU General Public License version 2 only, as
        + * published by the Free Software Foundation.  Oracle designates this
        + * particular file as subject to the "Classpath" exception as provided
        + * by Oracle in the LICENSE file that accompanied this code.
        + *
        + * This code is distributed in the hope that it will be useful, but WITHOUT
        + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        + * version 2 for more details (a copy is included in the LICENSE file that
        + * accompanied this code).
        + *
        + * You should have received a copy of the GNU General Public License version
        + * 2 along with this work; if not, write to the Free Software Foundation,
        + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
        + *
        + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
        + * or visit www.oracle.com if you need additional information or have any
        + * questions.
        + */
        +
        +package sun.security.krb5.internal.rcache;
        +
        +import java.util.Objects;
        +
        +/**
        + * The class represents a new style replay cache entry. It can be either used
        + * inside memory or in a dfl file.
        + */
        +public class AuthTimeWithHash extends AuthTime
        +        implements Comparable {
        +
        +    final String hash;
        +
        +    /**
        +     * Constructs a new AuthTimeWithHash.
        +     */
        +    public AuthTimeWithHash(String client, String server,
        +            int ctime, int cusec, String hash) {
        +        super(client, server, ctime, cusec);
        +        this.hash = hash;
        +    }
        +
        +    /**
        +     * Compares if an object equals to an AuthTimeWithHash object.
        +     * @param o an object.
        +     * @return true if two objects are equivalent, otherwise, return false.
        +     */
        +    @Override
        +    public boolean equals(Object o) {
        +        if (this == o) return true;
        +        if (!(o instanceof AuthTimeWithHash)) return false;
        +        AuthTimeWithHash that = (AuthTimeWithHash)o;
        +        return Objects.equals(hash, that.hash)
        +                && Objects.equals(client, that.client)
        +                && Objects.equals(server, that.server)
        +                && ctime == that.ctime
        +                && cusec == that.cusec;
        +    }
        +
        +    /**
        +     * Returns a hash code for this AuthTimeWithHash object.
        +     */
        +    @Override
        +    public int hashCode() {
        +        return Objects.hash(hash);
        +    }
        +
        +    @Override
        +    public String toString() {
        +        return String.format("%d/%06d/%s/%s", ctime, cusec, hash, client);
        +    }
        +
        +    @Override
        +    public int compareTo(AuthTimeWithHash other) {
        +        int cmp = 0;
        +        if (ctime != other.ctime) {
        +            cmp = Integer.compare(ctime, other.ctime);
        +        } else if (cusec != other.cusec) {
        +            cmp = Integer.compare(cusec, other.cusec);
        +        } else {
        +            cmp = hash.compareTo(other.hash);
        +        }
        +        return cmp;
        +    }
        +
        +    /**
        +     * Compares with a possibly old style object. Used
        +     * in DflCache$Storage#loadAndCheck.
        +     * @return true if all AuthTime fields are the same
        +     */
        +    public boolean isSameIgnoresHash(AuthTime old) {
        +        return  client.equals(old.client) &&
        +                server.equals(old.server) &&
        +                ctime == old.ctime &&
        +                cusec == old.cusec;
        +    }
        +
        +    // Methods used when saved in a dfl file. See DflCache.java
        +
        +    /**
        +     * Encodes to be used in a dfl file
        +     * @param withHash write new style if true
        +     */
        +    @Override
        +    public byte[] encode(boolean withHash) {
        +        String cstring;
        +        String sstring;
        +        if (withHash) {
        +            cstring = "";
        +            sstring = String.format("HASH:%s %d:%s %d:%s", hash,
        +                    client.length(), client,
        +                    server.length(), server);
        +        } else {
        +            cstring = client;
        +            sstring = server;
        +        }
        +        return encode0(cstring, sstring);
        +    }
        +}
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java b/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java
        new file mode 100644
        index 00000000000..6c5d124f0cb
        --- /dev/null
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/DflCache.java
        @@ -0,0 +1,365 @@
        +/*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
        + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        + *
        + * This code is free software; you can redistribute it and/or modify it
        + * under the terms of the GNU General Public License version 2 only, as
        + * published by the Free Software Foundation.  Oracle designates this
        + * particular file as subject to the "Classpath" exception as provided
        + * by Oracle in the LICENSE file that accompanied this code.
        + *
        + * This code is distributed in the hope that it will be useful, but WITHOUT
        + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
        + * version 2 for more details (a copy is included in the LICENSE file that
        + * accompanied this code).
        + *
        + * You should have received a copy of the GNU General Public License version
        + * 2 along with this work; if not, write to the Free Software Foundation,
        + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
        + *
        + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
        + * or visit www.oracle.com if you need additional information or have any
        + * questions.
        + */
        +
        +
        +package sun.security.krb5.internal.rcache;
        +
        +import java.io.*;
        +import java.nio.BufferUnderflowException;
        +import java.nio.ByteBuffer;
        +import java.nio.ByteOrder;
        +import java.nio.channels.SeekableByteChannel;
        +import java.nio.file.Files;
        +import java.nio.file.Path;
        +import java.nio.file.StandardCopyOption;
        +import java.nio.file.StandardOpenOption;
        +import java.nio.file.attribute.PosixFilePermission;
        +import java.security.AccessController;
        +import java.util.*;
        +
        +import sun.security.action.GetPropertyAction;
        +import sun.security.krb5.internal.KerberosTime;
        +import sun.security.krb5.internal.Krb5;
        +import sun.security.krb5.internal.KrbApErrException;
        +import sun.security.krb5.internal.ReplayCache;
        +
        +
        +/**
        + * A dfl file is used to sustores AuthTime entries when the system property
        + * sun.security.krb5.rcache is set to
        + *
        + *    dfl(|:path/|:path/name|:name)
        + *
        + * The file will be path/name. If path is not given, it will be
        + *
        + *    System.getProperty("java.io.tmpdir")
        + *
        + * If name is not given, it will be
        + *
        + *    service_euid
        + *
        + * Java does not have a method to get euid, so uid is used instead. This
        + * should normally to be since a Java program is seldom used as a setuid app.
        + *
        + * The file has a header:
        + *
        + *    i16 0x0501 (KRB5_RC_VNO) in network order
        + *    i32 number of seconds for lifespan (in native order, same below)
        + *
        + * followed by cache entries concatenated, which can be encoded in
        + * 2 styles:
        + *
        + * The traditional style is:
        + *
        + *    LC of client principal
        + *    LC of server principal
        + *    i32 cusec of Authenticator
        + *    i32 ctime of Authenticator
        + *
        + * The new style has a hash:
        + *
        + *    LC of ""
        + *    LC of "HASH:%s %lu:%s %lu:%s" of (hash, clientlen, client, serverlen,
        + *          server) where msghash is 32 char (lower case) text mode md5sum
        + *          of the ciphertext of authenticator.
        + *    i32 cusec of Authenticator
        + *    i32 ctime of Authenticator
        + *
        + * where LC of a string means
        + *
        + *    i32 strlen(string) + 1
        + *    octets of string, with the \0x00 ending
        + *
        + * The old style block is always created by MIT krb5 used even if a new style
        + * is available, which means there can be 2 entries for a single Authenticator.
        + * Java also does this way.
        + *
        + * See src/lib/krb5/rcache/rc_io.c and src/lib/krb5/rcache/rc_dfl.c.
        + */
        +public class DflCache extends ReplayCache {
        +
        +    private static final int KRB5_RV_VNO = 0x501;
        +    private static final int EXCESSREPS = 30;   // if missed-hit>this, recreate
        +
        +    private final String source;
        +
        +    private static int uid;
        +    static {
        +        try {
        +            // Available on Solaris, Linux and Mac. Otherwise, no _euid suffix
        +            Class clazz = Class.forName("com.sun.security.auth.module.UnixSystem");
        +            uid = (int)(long)(Long)
        +                    clazz.getMethod("getUid").invoke(clazz.newInstance());
        +        } catch (Exception e) {
        +            uid = -1;
        +        }
        +    }
        +
        +    public DflCache (String source) {
        +        this.source = source;
        +    }
        +
        +    private static String defaultPath() {
        +        return AccessController.doPrivileged(
        +                new GetPropertyAction("java.io.tmpdir"));
        +    }
        +
        +    private static String defaultFile(String server) {
        +        // service/host@REALM -> service
        +        int slash = server.indexOf('/');
        +        if (slash == -1) {
        +            // A normal principal? say, dummy@REALM
        +            slash = server.indexOf('@');
        +        }
        +        if (slash != -1) {
        +            // Should not happen, but be careful
        +            server= server.substring(0, slash);
        +        }
        +        if (uid != -1) {
        +            server += "_" + uid;
        +        }
        +        return server;
        +    }
        +
        +    private static Path getFileName(String source, String server) {
        +        String path, file;
        +        if (source.equals("dfl")) {
        +            path = defaultPath();
        +            file = defaultFile(server);
        +        } else if (source.startsWith("dfl:")) {
        +            source = source.substring(4);
        +            int pos = source.lastIndexOf('/');
        +            int pos1 = source.lastIndexOf('\\');
        +            if (pos1 > pos) pos = pos1;
        +            if (pos == -1) {
        +                // Only file name
        +                path = defaultPath();
        +                file = source;
        +            } else if (new File(source).isDirectory()) {
        +                // Only path
        +                path = source;
        +                file = defaultFile(server);
        +            } else {
        +                // Full pathname
        +                path = null;
        +                file = source;
        +            }
        +        } else {
        +            throw new IllegalArgumentException();
        +        }
        +        return new File(path, file).toPath();
        +    }
        +
        +    @Override
        +    public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        +            throws KrbApErrException {
        +        try {
        +            checkAndStore0(currTime, time);
        +        } catch (IOException ioe) {
        +            KrbApErrException ke = new KrbApErrException(Krb5.KRB_ERR_GENERIC);
        +            ke.initCause(ioe);
        +            throw ke;
        +        }
        +    }
        +
        +    private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time)
        +            throws IOException, KrbApErrException {
        +        Path p = getFileName(source, time.server);
        +        int missed = 0;
        +        try (Storage s = new Storage()) {
        +            try {
        +                missed = s.loadAndCheck(p, time, currTime);
        +            } catch (IOException ioe) {
        +                // Non-existing or invalid file
        +                Storage.create(p);
        +                missed = s.loadAndCheck(p, time, currTime);
        +            }
        +            s.append(time);
        +        }
        +        if (missed > EXCESSREPS) {
        +            Storage.expunge(p, currTime);
        +        }
        +    }
        +
        +
        +    private static class Storage implements Closeable {
        +        // Static methods
        +        @SuppressWarnings("try")
        +        private static void create(Path p) throws IOException {
        +            try (SeekableByteChannel newChan = createNoClose(p)) {
        +                // Do nothing, wait for close
        +            }
        +            makeMine(p);
        +        }
        +
        +        private static void makeMine(Path p) throws IOException {
        +            // chmod to owner-rw only, otherwise MIT krb5 rejects
        +            try {
        +                Set attrs = new HashSet<>();
        +                attrs.add(PosixFilePermission.OWNER_READ);
        +                attrs.add(PosixFilePermission.OWNER_WRITE);
        +                Files.setPosixFilePermissions(p, attrs);
        +            } catch (UnsupportedOperationException uoe) {
        +                // No POSIX permission. That's OK.
        +            }
        +        }
        +
        +        private static SeekableByteChannel createNoClose(Path p)
        +                throws IOException {
        +            SeekableByteChannel newChan = Files.newByteChannel(
        +                    p, StandardOpenOption.CREATE,
        +                        StandardOpenOption.TRUNCATE_EXISTING,
        +                        StandardOpenOption.WRITE);
        +            ByteBuffer buffer = ByteBuffer.allocate(6);
        +            buffer.putShort((short)KRB5_RV_VNO);
        +            buffer.order(ByteOrder.nativeOrder());
        +            buffer.putInt(KerberosTime.getDefaultSkew());
        +            buffer.flip();
        +            newChan.write(buffer);
        +            return newChan;
        +        }
        +
        +        private static void expunge(Path p, KerberosTime currTime)
        +                throws IOException {
        +            Path p2 = Files.createTempFile(p.getParent(), "rcache", null);
        +            try (SeekableByteChannel oldChan = Files.newByteChannel(p);
        +                    SeekableByteChannel newChan = createNoClose(p2)) {
        +                long timeLimit = currTime.getSeconds() - readHeader(oldChan);
        +                while (true) {
        +                    try {
        +                        AuthTime at = AuthTime.readFrom(oldChan);
        +                        if (at.ctime > timeLimit) {
        +                            ByteBuffer bb = ByteBuffer.wrap(at.encode(true));
        +                            newChan.write(bb);
        +                        }
        +                    } catch (BufferUnderflowException e) {
        +                        break;
        +                    }
        +                }
        +            }
        +            makeMine(p2);
        +            Files.move(p2, p,
        +                    StandardCopyOption.REPLACE_EXISTING,
        +                    StandardCopyOption.ATOMIC_MOVE);
        +        }
        +
        +        // Instance methods
        +        SeekableByteChannel chan;
        +        private int loadAndCheck(Path p, AuthTimeWithHash time,
        +                KerberosTime currTime)
        +                throws IOException, KrbApErrException {
        +            int missed = 0;
        +            if (Files.isSymbolicLink(p)) {
        +                throw new IOException("Symlink not accepted");
        +            }
        +            try {
        +                Set perms =
        +                        Files.getPosixFilePermissions(p);
        +                if (uid != -1 &&
        +                        (Integer)Files.getAttribute(p, "unix:uid") != uid) {
        +                    throw new IOException("Not mine");
        +                }
        +                if (perms.contains(PosixFilePermission.GROUP_READ) ||
        +                        perms.contains(PosixFilePermission.GROUP_WRITE) ||
        +                        perms.contains(PosixFilePermission.GROUP_EXECUTE) ||
        +                        perms.contains(PosixFilePermission.OTHERS_READ) ||
        +                        perms.contains(PosixFilePermission.OTHERS_WRITE) ||
        +                        perms.contains(PosixFilePermission.OTHERS_EXECUTE)) {
        +                    throw new IOException("Accessible by someone else");
        +                }
        +            } catch (UnsupportedOperationException uoe) {
        +                // No POSIX permissions? Ignore it.
        +            }
        +            chan = Files.newByteChannel(p, StandardOpenOption.WRITE,
        +                    StandardOpenOption.READ);
        +
        +            long timeLimit = currTime.getSeconds() - readHeader(chan);
        +
        +            long pos = 0;
        +            boolean seeNewButNotSame = false;
        +            while (true) {
        +                try {
        +                    pos = chan.position();
        +                    AuthTime a = AuthTime.readFrom(chan);
        +                    if (a instanceof AuthTimeWithHash) {
        +                        if (time.equals(a)) {
        +                            // Exact match, must be a replay
        +                            throw new KrbApErrException(Krb5.KRB_AP_ERR_REPEAT);
        +                        } else if (time.isSameIgnoresHash(a)) {
        +                            // Two different authenticators in the same second.
        +                            // Remember it
        +                            seeNewButNotSame = true;
        +                        }
        +                    } else {
        +                        if (time.isSameIgnoresHash(a)) {
        +                            // Two authenticators in the same second. Considered
        +                            // same if we haven't seen a new style version of it
        +                            if (!seeNewButNotSame) {
        +                                throw new KrbApErrException(Krb5.KRB_AP_ERR_REPEAT);
        +                            }
        +                        }
        +                    }
        +                    if (a.ctime < timeLimit) {
        +                        missed++;
        +                    } else {
        +                        missed--;
        +                    }
        +                } catch (BufferUnderflowException e) {
        +                    // Half-written file?
        +                    chan.position(pos);
        +                    break;
        +                }
        +            }
        +            return missed;
        +        }
        +
        +        private static int readHeader(SeekableByteChannel chan)
        +                throws IOException {
        +            ByteBuffer bb = ByteBuffer.allocate(6);
        +            chan.read(bb);
        +            if (bb.getShort(0) != KRB5_RV_VNO) {
        +                throw new IOException("Not correct rcache version");
        +            }
        +            bb.order(ByteOrder.nativeOrder());
        +            return bb.getInt(2);
        +        }
        +
        +        private void append(AuthTimeWithHash at) throws IOException {
        +            // Write an entry with hash, to be followed by one without it,
        +            // for the benefit of old implementations.
        +            ByteBuffer bb;
        +            bb = ByteBuffer.wrap(at.encode(true));
        +            chan.write(bb);
        +            bb = ByteBuffer.wrap(at.encode(false));
        +            chan.write(bb);
        +        }
        +
        +        @Override
        +        public void close() throws IOException {
        +            if (chan != null) chan.close();
        +            chan = null;
        +        }
        +    }
        +}
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java b/jdk/src/share/classes/sun/security/krb5/internal/rcache/MemoryCache.java
        similarity index 51%
        rename from jdk/src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java
        rename to jdk/src/share/classes/sun/security/krb5/internal/rcache/MemoryCache.java
        index ac1879adba7..403d97f8319 100644
        --- a/jdk/src/share/classes/sun/security/krb5/internal/rcache/CacheTable.java
        +++ b/jdk/src/share/classes/sun/security/krb5/internal/rcache/MemoryCache.java
        @@ -1,4 +1,5 @@
         /*
        + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -30,62 +31,55 @@
         
         package sun.security.krb5.internal.rcache;
         
        -import java.util.Hashtable;
        +import java.util.*;
        +import sun.security.krb5.internal.KerberosTime;
        +import sun.security.krb5.internal.KrbApErrException;
        +import sun.security.krb5.internal.ReplayCache;
         
         /**
        - * This class implements Hashtable to store the replay caches.
        + * This class stores replay caches. AuthTimeWithHash objects are categorized
        + * into AuthLists keyed by the names of client and server.
          *
          * @author Yanni Zhang
          */
        -public class CacheTable extends Hashtable {
        +public class MemoryCache extends ReplayCache {
         
        -    private static final long serialVersionUID = -4695501354546664910L;
        +    // TODO: One day we'll need to read dynamic krb5.conf.
        +    private static final int lifespan = KerberosTime.getDefaultSkew();
        +    private static final boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG;
         
        -    private boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG;
        -    public CacheTable () {
        -    }
        +    private final Map content = new HashMap<>();
         
        -    /**
        -     * Puts the client timestamp in replay cache.
        -     * @params principal the client's principal name.
        -     * @params time authenticator timestamp.
        -     */
        -    public synchronized void put(String principal, AuthTime time, long currTime) {
        -        ReplayCache rc = super.get(principal);
        +    @Override
        +    public synchronized void checkAndStore(KerberosTime currTime, AuthTimeWithHash time)
        +            throws KrbApErrException {
        +        String key = time.client + "|" + time.server;
        +        AuthList rc = content.get(key);
        +        if (DEBUG) {
        +            System.out.println("MemoryCache: add " + time + " to " + key);
        +        }
                 if (rc == null) {
        -            if (DEBUG) {
        -                System.out.println("replay cache for " + principal + " is null.");
        -            }
        -            rc = new ReplayCache(principal, this);
        +            rc = new AuthList(lifespan);
                     rc.put(time, currTime);
                     if (!rc.isEmpty()) {
        -                super.put(principal, rc);
        +                content.put(key, rc);
        +            }
        +        } else {
        +            if (DEBUG) {
        +                System.out.println("MemoryCache: Existing AuthList:\n" + rc);
                     }
        -        }
        -        else {
                     rc.put(time, currTime);
                     if (rc.isEmpty()) {
        -                super.remove(rc);
        -            }
        -            if (DEBUG) {
        -                System.out.println("replay cache found.");
        +                content.remove(key);
                     }
                 }
        -
             }
         
        -    /**
        -     * This method tests if replay cache keeps a record of the authenticator's time stamp.
        -     * If there is a record (replay attack detected), the server should reject the client request.
        -     * @params principal the client's principal name.
        -     * @params time authenticator timestamp.
        -     * @return null if no record found, else return an AuthTime object.
        -     */
        -    public Object get(AuthTime time, String principal) {
        -        ReplayCache rc = super.get(principal);
        -        if ((rc != null) && (rc.contains(time))) {
        -            return time;
        +    public String toString() {
        +        StringBuilder sb = new StringBuilder();
        +        for (AuthList rc: content.values()) {
        +            sb.append(rc.toString());
                 }
        -        return null;
        +        return sb.toString();
             }
         }
        diff --git a/jdk/src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java b/jdk/src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java
        deleted file mode 100644
        index 6993c186230..00000000000
        --- a/jdk/src/share/classes/sun/security/krb5/internal/rcache/ReplayCache.java
        +++ /dev/null
        @@ -1,143 +0,0 @@
        -/*
        - * 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
        - * 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.
        - */
        -
        -/*
        - *
        - *  (C) Copyright IBM Corp. 1999 All Rights Reserved.
        - *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
        - */
        -
        -package sun.security.krb5.internal.rcache;
        -
        -import sun.security.krb5.internal.Krb5;
        -import java.util.LinkedList;
        -import java.util.ListIterator;
        -import sun.security.krb5.internal.KerberosTime;
        -
        -/**
        - * This class provides an efficient caching mechanism to store the timestamp of client authenticators.
        - * The cache minimizes the memory usage by doing self-cleanup of expired items in the cache.
        - *
        - * @author Yanni Zhang
        - */
        -public class ReplayCache extends LinkedList {
        -
        -    private static final long serialVersionUID = 2997933194993803994L;
        -
        -    // These 3 fields are now useless, keep for serialization compatibility
        -    private String principal;
        -    private CacheTable table;
        -    private int nap = 10 * 60 * 1000; //10 minutes break
        -
        -    private boolean DEBUG = Krb5.DEBUG;
        -
        -    /**
        -     * Constructs a ReplayCache for a client principal in specified CacheTable.
        -     * @param p client principal name.
        -     * @param ct CacheTable.
        -     */
        -    public ReplayCache (String p, CacheTable ct) {
        -        principal = p;
        -        table = ct;
        -    }
        -
        -    /**
        -     * Puts the authenticator timestamp into the cache in descending order.
        -     * @param t AuthTime
        -     */
        -    public synchronized void put(AuthTime t, long currentTime) {
        -
        -        if (this.size() == 0) {
        -            addFirst(t);
        -        }
        -        else {
        -            AuthTime temp = getFirst();
        -            if (temp.kerberosTime < t.kerberosTime) {
        -                // in most cases, newly received authenticator has
        -                // larger timestamp.
        -                addFirst(t);
        -            }
        -            else if (temp.kerberosTime == t.kerberosTime) {
        -                if (temp.cusec < t.cusec) {
        -                    addFirst(t);
        -                }
        -            }
        -            else {
        -                //unless client clock being re-adjusted.
        -                ListIterator it = listIterator(1);
        -                while (it.hasNext()) {
        -                    temp = it.next();
        -                    if (temp.kerberosTime < t.kerberosTime) {
        -                        add(indexOf(temp), t);
        -                        break;
        -                        //we always put the bigger timestamp at the front.
        -                    }
        -                    else if (temp.kerberosTime == t.kerberosTime) {
        -                        if (temp.cusec < t.cusec) {
        -                            add(indexOf(temp), t);
        -                            break;
        -                        }
        -                    }
        -                }
        -            }
        -        }
        -
        -        // let us cleanup while we are here
        -        long timeLimit = currentTime - KerberosTime.getDefaultSkew() * 1000L;
        -        ListIterator it = listIterator(0);
        -        AuthTime temp = null;
        -        int index = -1;
        -        while (it.hasNext()) {
        -            //search expired timestamps.
        -            temp = it.next();
        -            if (temp.kerberosTime < timeLimit) {
        -                index = indexOf(temp);
        -                break;
        -            }
        -        }
        -        if (index > -1) {
        -            do {
        -                //remove expired timestamps from the list.
        -                removeLast();
        -            } while(size() > index);
        -        }
        -        if (DEBUG) {
        -            printList();
        -        }
        -    }
        -
        -
        -    /**
        -     * Prints out the debug message.
        -     */
        -    private void printList() {
        -        Object[] total = toArray();
        -        for (int i = 0; i < total.length; i++) {
        -            System.out.println("object " + i + ": " + ((AuthTime)total[i]).kerberosTime + "/"
        -                               + ((AuthTime)total[i]).cusec);
        -        }
        -    }
        -
        -}
        diff --git a/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java b/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java
        index 1d327706d78..43c5ac7b87d 100644
        --- a/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java
        +++ b/jdk/src/share/classes/sun/security/pkcs/SignerInfo.java
        @@ -34,6 +34,7 @@ import java.security.cert.CertPath;
         import java.security.cert.X509Certificate;
         import java.security.*;
         import java.util.ArrayList;
        +import java.util.Arrays;
         
         import sun.security.timestamp.TimestampToken;
         import sun.security.util.*;
        @@ -57,6 +58,7 @@ public class SignerInfo implements DerEncoder {
             byte[] encryptedDigest;
             Timestamp timestamp;
             private boolean hasTimestamp = true;
        +    private static final Debug debug = Debug.getInstance("jar");
         
             PKCS9Attributes authenticatedAttributes;
             PKCS9Attributes unauthenticatedAttributes;
        @@ -499,11 +501,40 @@ public class SignerInfo implements DerEncoder {
                 CertPath tsaChain = cf.generateCertPath(chain);
                 // Create a timestamp token info object
                 TimestampToken tsTokenInfo = new TimestampToken(encTsTokenInfo);
        +        // Check that the signature timestamp applies to this signature
        +        verifyTimestamp(tsTokenInfo);
                 // Create a timestamp object
                 timestamp = new Timestamp(tsTokenInfo.getDate(), tsaChain);
                 return timestamp;
             }
         
        +    /*
        +     * Check that the signature timestamp applies to this signature.
        +     * Match the hash present in the signature timestamp token against the hash
        +     * of this signature.
        +     */
        +    private void verifyTimestamp(TimestampToken token)
        +        throws NoSuchAlgorithmException, SignatureException {
        +
        +        MessageDigest md =
        +            MessageDigest.getInstance(token.getHashAlgorithm().getName());
        +
        +        if (!Arrays.equals(token.getHashedMessage(),
        +            md.digest(encryptedDigest))) {
        +
        +            throw new SignatureException("Signature timestamp (#" +
        +                token.getSerialNumber() + ") generated on " + token.getDate() +
        +                " is inapplicable");
        +        }
        +
        +        if (debug != null) {
        +            debug.println();
        +            debug.println("Detected signature timestamp (#" +
        +                token.getSerialNumber() + ") generated on " + token.getDate());
        +            debug.println();
        +        }
        +    }
        +
             public String toString() {
                 HexDumpEncoder hexDump = new HexDumpEncoder();
         
        diff --git a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
        index 98d8a9d2272..05b517892fe 100644
        --- a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
        +++ b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
        @@ -675,8 +675,12 @@ class RevocationChecker extends PKIXRevocationChecker {
                                               responderURI, respCert, params.date(),
                                               ocspExtensions);
                     }
        -        } catch (IOException e) {
        -            throw new CertPathValidatorException(e);
        +        } catch (Exception e) {
        +            if (e instanceof CertPathValidatorException) {
        +                throw (CertPathValidatorException) e;
        +            } else {
        +                throw new CertPathValidatorException(e);
        +            }
                 }
         
                 RevocationStatus rs =
        diff --git a/jdk/src/share/classes/sun/security/ssl/Handshaker.java b/jdk/src/share/classes/sun/security/ssl/Handshaker.java
        index 5b1cd0f593a..17b1f92ac74 100644
        --- a/jdk/src/share/classes/sun/security/ssl/Handshaker.java
        +++ b/jdk/src/share/classes/sun/security/ssl/Handshaker.java
        @@ -186,6 +186,16 @@ abstract class Handshaker {
             static final boolean allowLegacyHelloMessages = Debug.getBooleanProperty(
                             "sun.security.ssl.allowLegacyHelloMessages", true);
         
        +    // To prevent the TLS renegotiation issues, by setting system property
        +    // "jdk.tls.rejectClientInitiatedRenegotiation" to true, applications in
        +    // server side can disable all client initiated SSL renegotiations
        +    // regardless of the support of TLS protocols.
        +    //
        +    // By default, allow client initiated renegotiations.
        +    static final boolean rejectClientInitiatedRenego =
        +            Debug.getBooleanProperty(
        +                "jdk.tls.rejectClientInitiatedRenegotiation", false);
        +
             // need to dispose the object when it is invalidated
             boolean invalidated;
         
        diff --git a/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java b/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java
        index 0baaed5f265..e317e1f18c5 100644
        --- a/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java
        +++ b/jdk/src/share/classes/sun/security/ssl/ServerHandshaker.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -279,6 +279,23 @@ final class ServerHandshaker extends Handshaker {
                     mesg.print(System.out);
                 }
         
        +        // Reject client initiated renegotiation?
        +        //
        +        // If server side should reject client-initiated renegotiation,
        +        // send an alert_handshake_failure fatal alert, not a no_renegotiation
        +        // warning alert (no_renegotiation must be a warning: RFC 2246).
        +        // no_renegotiation might seem more natural at first, but warnings
        +        // are not appropriate because the sending party does not know how
        +        // the receiving party will behave.  This state must be treated as
        +        // a fatal server condition.
        +        //
        +        // This will not have any impact on server initiated renegotiation.
        +        if (rejectClientInitiatedRenego && !isInitialHandshake &&
        +                state != HandshakeMessage.ht_hello_request) {
        +            fatalSE(Alerts.alert_handshake_failure,
        +                "Client initiated renegotiation is not allowed");
        +        }
        +
                 // check the server name indication if required
                 ServerNameExtension clientHelloSNIExt = (ServerNameExtension)
                             mesg.extensions.get(ExtensionType.EXT_SERVER_NAME);
        @@ -369,7 +386,7 @@ final class ServerHandshaker extends Handshaker {
                     } else if (!allowUnsafeRenegotiation) {
                         // abort the handshake
                         if (activeProtocolVersion.v >= ProtocolVersion.TLS10.v) {
        -                    // response with a no_renegotiation warning,
        +                    // respond with a no_renegotiation warning
                             warningSE(Alerts.alert_no_renegotiation);
         
                             // invalidate the handshake so that the caller can
        diff --git a/jdk/src/share/classes/sun/security/timestamp/TimestampToken.java b/jdk/src/share/classes/sun/security/timestamp/TimestampToken.java
        index ff9ab6cfc30..9df8f1c0bd0 100644
        --- a/jdk/src/share/classes/sun/security/timestamp/TimestampToken.java
        +++ b/jdk/src/share/classes/sun/security/timestamp/TimestampToken.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
        + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
          * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          *
          * This code is free software; you can redistribute it and/or modify it
        @@ -119,6 +119,10 @@ public class TimestampToken {
                 return policy.toString();
             }
         
        +    public BigInteger getSerialNumber() {
        +        return serialNumber;
        +    }
        +
             /*
              * Parses the timestamp token info.
              *
        diff --git a/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java b/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java
        index e98e78fe902..61600e87d2c 100644
        --- a/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java
        +++ b/jdk/src/share/classes/sun/security/util/AuthResources_zh_CN.java
        @@ -99,7 +99,7 @@ public class AuthResources_zh_CN extends java.util.ListResourceBundle {
                 /***    EVERYTHING BELOW IS DEPRECATED  ***/
         
                 // com.sun.security.auth.PolicyFile
        -        {".error.parsing.", ": \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u51FA\u9519 "},
        +        {".error.parsing.", ": \u89E3\u6790\u65F6\u51FA\u9519 "},
                 {"COLON", ": "},
                 {".error.adding.Permission.", ": \u6DFB\u52A0\u6743\u9650\u65F6\u51FA\u9519 "},
                 {"SPACE", " "},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_de.java b/jdk/src/share/classes/sun/security/util/Resources_de.java
        index 34a7d6dbd43..628a40c16af 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_de.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_de.java
        @@ -127,6 +127,8 @@ public class Resources_de extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "mehrere Codebase-Ausdr\u00FCcke"},
                 {"multiple.SignedBy.expressions","mehrere SignedBy-Ausdr\u00FCcke"},
        +        {"duplicate.keystore.domain.name","Keystore-Domainname doppelt vorhanden: {0}"},
        +        {"duplicate.keystore.name","Keystore-Name doppelt vorhanden: {0}"},
                 {"SignedBy.has.empty.alias","Leerer Alias in SignedBy"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "Principal kann nicht mit einer Platzhalterklasse ohne Platzhalternamen angegeben werden"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_es.java b/jdk/src/share/classes/sun/security/util/Resources_es.java
        index 8a866668e12..0f6d129b31d 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_es.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_es.java
        @@ -127,6 +127,8 @@ public class Resources_es extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "expresiones m\u00FAltiples de CodeBase"},
                 {"multiple.SignedBy.expressions","expresiones m\u00FAltiples de SignedBy"},
        +        {"duplicate.keystore.domain.name","nombre de dominio de almac\u00E9n de claves duplicado: {0}"},
        +        {"duplicate.keystore.name","nombre de almac\u00E9n de claves duplicado: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy tiene un alias vac\u00EDo"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "no se puede especificar Principal con una clase de comod\u00EDn sin un nombre de comod\u00EDn"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_fr.java b/jdk/src/share/classes/sun/security/util/Resources_fr.java
        index a82a2e49420..44a6d5f9e79 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_fr.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_fr.java
        @@ -127,6 +127,8 @@ public class Resources_fr extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "expressions Codebase multiples"},
                 {"multiple.SignedBy.expressions","expressions SignedBy multiples"},
        +        {"duplicate.keystore.domain.name","nom de domaine de fichier de cl\u00E9s en double : {0}"},
        +        {"duplicate.keystore.name","nom de fichier de cl\u00E9s en double : {0}"},
                 {"SignedBy.has.empty.alias","SignedBy poss\u00E8de un alias vide"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "impossible de sp\u00E9cifier le principal avec une classe g\u00E9n\u00E9rique sans nom g\u00E9n\u00E9rique"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_it.java b/jdk/src/share/classes/sun/security/util/Resources_it.java
        index e942f64463c..bcb1acbe7c1 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_it.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_it.java
        @@ -127,6 +127,8 @@ public class Resources_it extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "espressioni Codebase multiple"},
                 {"multiple.SignedBy.expressions","espressioni SignedBy multiple"},
        +        {"duplicate.keystore.domain.name","nome dominio keystore duplicato: {0}"},
        +        {"duplicate.keystore.name","nome keystore duplicato: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy presenta un alias vuoto"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "impossibile specificare un principal con una classe carattere jolly senza un nome carattere jolly"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_ja.java b/jdk/src/share/classes/sun/security/util/Resources_ja.java
        index 65d9289b161..7c9e9286f7c 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_ja.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_ja.java
        @@ -127,6 +127,8 @@ public class Resources_ja extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "\u8907\u6570\u306ECodebase\u5F0F"},
                 {"multiple.SignedBy.expressions","\u8907\u6570\u306ESignedBy\u5F0F"},
        +        {"duplicate.keystore.domain.name","\u91CD\u8907\u3059\u308B\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30C9\u30E1\u30A4\u30F3\u540D: {0}"},
        +        {"duplicate.keystore.name","\u91CD\u8907\u3059\u308B\u30AD\u30FC\u30B9\u30C8\u30A2\u540D: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy\u306F\u7A7A\u306E\u5225\u540D\u3092\u4FDD\u6301\u3057\u307E\u3059"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u540D\u306E\u306A\u3044\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u30FB\u30AF\u30E9\u30B9\u3092\u4F7F\u7528\u3057\u3066\u3001\u30D7\u30EA\u30F3\u30B7\u30D1\u30EB\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_ko.java b/jdk/src/share/classes/sun/security/util/Resources_ko.java
        index 3968919ce7a..f3f7df17d40 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_ko.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_ko.java
        @@ -127,6 +127,8 @@ public class Resources_ko extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "Codebase \uD45C\uD604\uC2DD\uC774 \uC5EC\uB7EC \uAC1C\uC785\uB2C8\uB2E4."},
                 {"multiple.SignedBy.expressions","SignedBy \uD45C\uD604\uC2DD\uC774 \uC5EC\uB7EC \uAC1C\uC785\uB2C8\uB2E4."},
        +        {"duplicate.keystore.domain.name","\uC911\uBCF5\uB41C \uD0A4 \uC800\uC7A5\uC18C \uB3C4\uBA54\uC778 \uC774\uB984: {0}"},
        +        {"duplicate.keystore.name","\uC911\uBCF5\uB41C \uD0A4 \uC800\uC7A5\uC18C \uC774\uB984: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy\uC758 \uBCC4\uCE6D\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "\uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uC774\uB984 \uC5C6\uC774 \uC640\uC77C\uB4DC \uCE74\uB4DC \uBB38\uC790 \uD074\uB798\uC2A4\uB97C \uC0AC\uC6A9\uD558\uB294 \uC8FC\uCCB4\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java b/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java
        index 8bac548724d..ed8d6587990 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_pt_BR.java
        @@ -127,6 +127,8 @@ public class Resources_pt_BR extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "v\u00E1rias express\u00F5es CodeBase"},
                 {"multiple.SignedBy.expressions","v\u00E1rias express\u00F5es SignedBy"},
        +        {"duplicate.keystore.domain.name","nome do dom\u00EDnio da \u00E1rea de armazenamento de teclas duplicado: {0}"},
        +        {"duplicate.keystore.name","nome da \u00E1rea de armazenamento de chaves duplicado: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy tem alias vazio"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "n\u00E3o \u00E9 poss\u00EDvel especificar um principal com uma classe curinga sem um nome curinga"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_sv.java b/jdk/src/share/classes/sun/security/util/Resources_sv.java
        index e16c1f77f72..fda06ab80a8 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_sv.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_sv.java
        @@ -127,6 +127,8 @@ public class Resources_sv extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "flera CodeBase-uttryck"},
                 {"multiple.SignedBy.expressions","flera SignedBy-uttryck"},
        +        {"duplicate.keystore.domain.name","dom\u00E4nnamn f\u00F6r dubbelt nyckellager: {0}"},
        +        {"duplicate.keystore.name","namn f\u00F6r dubbelt nyckellager: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy har ett tomt alias"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "kan inte ange identitetshavare med en jokerteckenklass utan ett jokerteckennamn"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_zh_CN.java b/jdk/src/share/classes/sun/security/util/Resources_zh_CN.java
        index 80b8763c15f..6e9e24a3555 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_zh_CN.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_zh_CN.java
        @@ -105,7 +105,7 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
                 // sun.security.provider.PolicyFile
         
                 {"java.security.policy.error.parsing.policy.message",
        -                "java.security.policy: \u5BF9{0}\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u51FA\u9519:\n\t{1}"},
        +                "java.security.policy: \u89E3\u6790{0}\u65F6\u51FA\u9519:\n\t{1}"},
                 {"java.security.policy.error.adding.Permission.perm.message",
                         "java.security.policy: \u6DFB\u52A0\u6743\u9650{0}\u65F6\u51FA\u9519:\n\t{1}"},
                 {"java.security.policy.error.adding.Entry.message",
        @@ -127,6 +127,8 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "\u591A\u4E2A\u4EE3\u7801\u5E93\u8868\u8FBE\u5F0F"},
                 {"multiple.SignedBy.expressions","\u591A\u4E2A SignedBy \u8868\u8FBE\u5F0F"},
        +        {"duplicate.keystore.domain.name","\u5BC6\u94A5\u5E93\u57DF\u540D\u91CD\u590D: {0}"},
        +        {"duplicate.keystore.name","\u5BC6\u94A5\u5E93\u540D\u79F0\u91CD\u590D: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy \u6709\u7A7A\u522B\u540D"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "\u6CA1\u6709\u901A\u914D\u7B26\u540D\u79F0, \u65E0\u6CD5\u4F7F\u7528\u901A\u914D\u7B26\u7C7B\u6307\u5B9A\u4E3B\u7528\u6237"},
        diff --git a/jdk/src/share/classes/sun/security/util/Resources_zh_TW.java b/jdk/src/share/classes/sun/security/util/Resources_zh_TW.java
        index b95647a0c4e..d7444a635fb 100644
        --- a/jdk/src/share/classes/sun/security/util/Resources_zh_TW.java
        +++ b/jdk/src/share/classes/sun/security/util/Resources_zh_TW.java
        @@ -127,6 +127,8 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
                 {"multiple.Codebase.expressions",
                         "\u591A\u91CD Codebase \u8868\u793A\u5F0F"},
                 {"multiple.SignedBy.expressions","\u591A\u91CD SignedBy \u8868\u793A\u5F0F"},
        +        {"duplicate.keystore.domain.name","\u91CD\u8907\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u7DB2\u57DF\u540D\u7A31: {0}"},
        +        {"duplicate.keystore.name","\u91CD\u8907\u7684\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31: {0}"},
                 {"SignedBy.has.empty.alias","SignedBy \u6709\u7A7A\u5225\u540D"},
                 {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name",
                         "\u6C92\u6709\u842C\u7528\u5B57\u5143\u540D\u7A31\uFF0C\u7121\u6CD5\u6307\u5B9A\u542B\u6709\u842C\u7528\u5B57\u5143\u985E\u5225\u7684 Principal"},
        diff --git a/jdk/src/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/share/classes/sun/swing/SwingUtilities2.java
        index c6134885adf..a1903f2bdd2 100644
        --- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java
        +++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java
        @@ -33,18 +33,19 @@ import java.awt.event.*;
         import java.awt.font.*;
         import java.awt.geom.*;
         import java.awt.print.PrinterGraphics;
        -import java.text.Bidi;
         import java.text.AttributedCharacterIterator;
         import java.text.AttributedString;
         
         import javax.swing.*;
        -import javax.swing.plaf.*;
        +import javax.swing.event.TreeModelEvent;
         import javax.swing.text.Highlighter;
         import javax.swing.text.JTextComponent;
         import javax.swing.text.DefaultHighlighter;
         import javax.swing.text.DefaultCaret;
         import javax.swing.table.TableCellRenderer;
         import javax.swing.table.TableColumnModel;
        +import javax.swing.tree.TreeModel;
        +import javax.swing.tree.TreePath;
         
         import sun.swing.PrintColorUIResource;
         import sun.swing.ImageIconUIResource;
        @@ -1887,4 +1888,22 @@ public class SwingUtilities2 {
                 }
                 return InputEvent.ALT_MASK;
             }
        +
        +    /**
        +     * Returns the {@link TreePath} that identifies the changed nodes.
        +     *
        +     * @param event  changes in a tree model
        +     * @param model  corresponing tree model
        +     * @return  the path to the changed nodes
        +     */
        +    public static TreePath getTreePath(TreeModelEvent event, TreeModel model) {
        +        TreePath path = event.getTreePath();
        +        if ((path == null) && (model != null)) {
        +            Object root = model.getRoot();
        +            if (root != null) {
        +                path = new TreePath(root);
        +            }
        +        }
        +        return path;
        +    }
         }
        diff --git a/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java b/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java
        index ec36c0c7045..32e6c1e14b2 100644
        --- a/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java
        +++ b/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java
        @@ -103,18 +103,18 @@ public class FormatData_pt extends ParallelListResourceBundle {
                     },
                     { "MonthAbbreviations",
                         new String[] {
        -                    "Jan", // abb january
        -                    "Fev", // abb february
        -                    "Mar", // abb march
        -                    "Abr", // abb april
        -                    "Mai", // abb may
        -                    "Jun", // abb june
        -                    "Jul", // abb july
        -                    "Ago", // abb august
        -                    "Set", // abb september
        -                    "Out", // abb october
        -                    "Nov", // abb november
        -                    "Dez", // abb december
        +                    "jan", // abb january
        +                    "fev", // abb february
        +                    "mar", // abb march
        +                    "abr", // abb april
        +                    "mai", // abb may
        +                    "jun", // abb june
        +                    "jul", // abb july
        +                    "ago", // abb august
        +                    "set", // abb september
        +                    "out", // abb october
        +                    "nov", // abb november
        +                    "dez", // abb december
                             "" // abb month 13 if applicable
                         }
                     },
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
        index 4c1e565f995..678d292b4f2 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties
        @@ -29,6 +29,7 @@ error.bad.option=Eine der Optionen -{ctxu} muss angegeben werden.
         error.bad.cflag=Kennzeichen "c" erfordert Angabe von Manifest oder Eingabedateien.
         error.bad.uflag=Kennzeichen "u" erfordert Angabe von Manifest, Kennzeichen "e" oder Eingabedateien.
         error.bad.eflag=Kennzeichen "e" und Manifest mit dem Attribut "Main-Class" k\u00F6nnen nicht zusammen angegeben\nwerden.
        +error.bad.pvalue=ung\u00FCltiger Wert f\u00FCr Attribut "Profil": {0}
         error.nosuch.fileordir={0}: Datei oder Verzeichnis nicht vorhanden
         error.write.file=Fehler beim Schreiben in vorhandener JAR-Datei
         error.create.dir={0}: Verzeichnis konnte nicht erstellt werden
        @@ -44,4 +45,4 @@ out.extracted=extrahiert: {0}
         out.inflated=\ \\vergr\u00F6\u00DFert: {0}
         out.size=(ein = {0}) (aus = {1})
         
        -usage=Verwendung: jar-Dateien {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOptionen:\n    -c  Neues Archiv erstellen\n    -t  Inhaltsverzeichnis f\u00FCr Archiv auflisten\n    -x  Genannte (oder alle) Dateien aus Archiv extrahieren\n    -u  Vorhandenes Archiv aktualisieren\n    -v  Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n    -f  Namen der Archivdatei angeben\n    -m  Manifest-Informationen von angegebener Manifest-Datei einschlie\u00DFen\n    -e  Anwendungs-Einstiegspunkt f\u00FCr die \n        in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n    -0  Nur speichern (keine ZIP-Komprimierung)\n    -M  Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n    -i  Indexinformationen f\u00FCr angegebenen JAR-Dateien erstellen\n    -C  zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifest-Datei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n       jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifest-Datei "mymanifest", und archivieren Sie\n           alle Dateien im Verzeichnis foo/ in "classes.jar": \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=Verwendung: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien...\nOptionen:\n    -c  Neues Archiv erstellen\n    -t  Inhaltsverzeichnis f\u00FCr Archiv auflisten\n    -x  Genannte (oder alle) Dateien aus Archiv extrahieren\n    -u  Vorhandenes Archiv aktualisieren\n    -v  Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n    -f  Namen der Archivdatei angeben\n    -m  Manifestinformationen von angegebener Manifestdatei einschlie\u00DFen\n    -e  Anwendungseinstiegspunkt f\u00FCr die \n        in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n    -p  Profilnamen angeben\n    -0  Nur speichern (keine ZIP-Komprimierung)\n    -M  Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n    -i  Indexinformationen f\u00FCr angegebene JAR-Dateien erstellen\n    -C  zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifestdatei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit dem Namen "classes.jar": \n       jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifestdatei "mymanifest", und archivieren Sie\n           alle Dateien im Verzeichnis foo/ in "classes.jar": \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
        index 2a16e1f7eb2..ff24bed068d 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties
        @@ -29,6 +29,7 @@ error.bad.option=Se debe especificar una de las opciones -{ctxu}.
         error.bad.cflag=El indicador 'c' necesita la especificaci\u00F3n de archivos de manifiesto o de entrada.
         error.bad.uflag=El indicador 'u' necesita la especificaci\u00F3n de archivos de manifiesto, de entrada o indicador 'e'.
         error.bad.eflag=El indicador 'e' y el manifiesto con el atributo 'Main-Class' no pueden especificarse \na la vez.
        +error.bad.pvalue=valor err\u00F3neo para el atributo ''Profile'': {0}
         error.nosuch.fileordir={0} : no existe tal archivo o directorio
         error.write.file=Error al escribir un archivo jar existente
         error.create.dir={0} : no se ha podido crear el directorio
        @@ -44,4 +45,4 @@ out.extracted=extra\u00EDdo: {0}
         out.inflated=\ \\inflado: {0}
         out.size=(entrada = {0}) (salida = {1})
         
        -usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n    -c  crear nuevo archivo\n    -t  crear la tabla de contenido del archivo\n    -x extraer el archive mencionado (o todos) del archivo\n    -u  actualizar archive existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archive de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archive jar ejecutable\n    -0  s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archive de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n           archivos del directorio foo/ en 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=Sintaxis: archivos jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOpciones:\n    -c  crear nuevo archivo\n    -t  mostrar la tabla de contenido del archivo\n    -x  extraer los archivos mencionados (o todos) del archivo\n    -u  actualizar archivo existente\n    -v  generar salida detallada de los datos de salida est\u00E1ndar\n    -f  especificar nombre de archivo de almacenamiento\n    -m  incluir informaci\u00F3n de manifiesto del archivo de manifiesto especificado\n    -e  especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n        que se incluye dentro de un archivo jar ejecutable\n    -p  especificar nombre de perfil\n    -0  solo almacenar; no utilizar compresi\u00F3n ZIP\n    -M  no crear un archivo de manifiesto para las entradas\n    -i  generar informaci\u00F3n de \u00EDndice para los archivos jar especificados\n    -C  cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\narchivos del directorio foo/ en'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
        index 6b71b3a8f53..f26335287fb 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties
        @@ -29,6 +29,7 @@ error.bad.option=Une des options -{ctxu} doit \u00EAtre sp\u00E9cifi\u00E9e.
         error.bad.cflag=L'indicateur c requiert la sp\u00E9cification d'un fichier manifeste ou d'un fichier d'entr\u00E9e.
         error.bad.uflag=L'indicateur u requiert la sp\u00E9cification d'un fichier manifeste, d'un fichier d'entr\u00E9e ou d'un indicateur e.
         error.bad.eflag=L'indicateur e et le fichier manifeste portant l'attribut Main-Class ne peuvent pas \u00EAtre sp\u00E9cifi\u00E9s \nensemble.
        +error.bad.pvalue=valeur incorrecte pour l''attribut ''Profile'' : {0}
         error.nosuch.fileordir={0} : fichier ou r\u00E9pertoire introuvable
         error.write.file=Erreur lors de l'\u00E9criture d'un fichier JAR existant
         error.create.dir={0} : impossible de cr\u00E9er le r\u00E9pertoire
        @@ -44,4 +45,4 @@ out.extracted=extrait : {0}
         out.inflated=\ \\d\u00E9compress\u00E9 : {0}
         out.size=(entr\u00E9e = {0}) (sortie = {1})
         
        -usage=Syntaxe : jar {ctxui}[vfm0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n    -c  cr\u00E9e une archive\n    -t  affiche la table des mati\u00E8res de l'archive\n    -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n    -u  met \u00E0 jour l'archive existante\n    -v  g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n    -f  sp\u00E9cifie le nom du fichier archive\n    -m  inclut les informations de manifeste \u00E0 partir du fichier de manifeste sp\u00E9cifi\u00E9\n    -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n        int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n    -0  stockage uniquement, pas de compression ZIP\n    -M  ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n    -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n    -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n       jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n           fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n       jar cvfm classes.jar monmanifeste -C foo/ .\n
        +usage=Syntaxe : jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\nOptions :\n    -c  cr\u00E9e une archive\n    -t  affiche la table des mati\u00E8res de l'archive\n    -x  extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n    -u  met \u00E0 jour l'archive existante\n    -v  g\u00E9n\u00E8re une sortie en mode verbose d'une sortie standard\n    -f  sp\u00E9cifie le nom du fichier d'archive\n    -m  inclut les informations de manifest \u00E0 partir du fichier manifest sp\u00E9cifi\u00E9\n    -e  sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n        int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n    -p  indique le nom de profil\n    -0  stockage uniquement, pas de compression ZIP\n    -M  ne cr\u00E9e pas de fichier manifest pour les entr\u00E9es\n    -i  g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n    -C  passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifest, du fichier d'archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n       jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifest existant 'mymanifest', puis archiver tous les\n           fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
        index aca0fb6ab23..313169c83b0 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties
        @@ -29,6 +29,7 @@ error.bad.option=\u00C8 necessario specificare una delle opzioni -{ctxu}.
         error.bad.cflag=Per il flag 'c' \u00E8 necessario specificare file manifest o di input.
         error.bad.uflag=Per il flag 'u' \u00E8 necessario specificare il flag 'e' oppure file manifest o di input.
         error.bad.eflag=Il flag 'e' e il manifest con l'attributo 'Main-Class' non possono essere specificati\ninsieme.
        +error.bad.pvalue=valore non valido per l''attributo ''Profile'': {0}
         error.nosuch.fileordir={0} : file o directory inesistente
         error.write.file=Errore durante la scrittura del file jar esistente
         error.create.dir={0} : impossibile creare la directory
        @@ -44,4 +45,4 @@ out.extracted=estratto: {0}
         out.inflated=\ \\decompresso: {0}
         out.size=(in = {0}) (out = {1})
         
        -usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza l'indice dell'archivio\n    -x  estrae i file con nome (o tutti i file) dall'archivio\n    -u  aggiorna l'archivio esistente\n    -v  genera output commentato dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include informazioni manifest dal file manifest specificato\n    -e  specifica il punto di ingresso per l'applicazione stand-alone \n        inclusa nel file jar eseguibile\n    -0  solo memorizzazione; senza compressione ZIP\n    -M  consente di non creare un file manifest per le voci\n    -i  genera informazioni sull'indice per i file jar specificati\n    -C  imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/.\n
        +usage=Uso: jar {ctxui}[vfm0Me] [jar-file] [file manifest] [punto di accesso] [-C dir] file ...\nOpzioni:\n    -c  crea un nuovo archivio\n    -t  visualizza il sommario dell'archivio\n    -x  estrae i file specificati (o tutti i file) dall'archivio\n    -u  aggiorna un archivio esistente\n    -v  genera un output descrittivo dall'output standard\n    -f  specifica il nome file dell'archivio\n    -m  include le informazioni manifest dal file manifest specificato\n    -e  specifica il punto di accesso per l'applicazione standalone \n        inclusa in un file JAR eseguibile\n    -p  specifica il nome del profilo\n    -0  esegue solo la memorizzazione; non utilizza la compressione ZIP\n    -M  non crea un file manifest per le voci\n    -i  genera le informazioni di indice per i file JAR specificati\n    -C  passa alla directory specificata e include il file seguente\nSe un file qualsiasi \u00E8 una directory, viene elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di accesso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' e 'e'.\n\nEsempio 1: archiviazione di due file di classe nell'archivio denominato classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nEsempio 2: uso del file manifest esistente 'mymanifest' e archiviazione di tutti i\n           file della directory foo/ in 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/.\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
        index f6d3950fd28..b909c46d04a 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties
        @@ -29,6 +29,7 @@ error.bad.option=\u30AA\u30D7\u30B7\u30E7\u30F3-{ctxu}\u306E\u3046\u3061\u306E1\
         error.bad.cflag=\u30D5\u30E9\u30B0'c'\u3067\u306F\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u307E\u305F\u306F\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002
         error.bad.uflag=\u30D5\u30E9\u30B0'u'\u3067\u306F\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304B'e'\u30D5\u30E9\u30B0\u3001\u307E\u305F\u306F\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u6307\u5B9A\u304C\u5FC5\u8981\u3067\u3059\u3002
         error.bad.eflag='e'\u30D5\u30E9\u30B0\u3068'Main-Class'\u5C5E\u6027\u3092\u6301\u3064\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u306F\u540C\u6642\u306B\n\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002
        +error.bad.pvalue=''Profile''\u5C5E\u6027\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0}
         error.nosuch.fileordir={0}\u3068\u3044\u3046\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u3042\u308A\u307E\u305B\u3093
         error.write.file=\u65E2\u5B58jar\u30D5\u30A1\u30A4\u30EB\u306E\u66F8\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
         error.create.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F
        @@ -44,4 +45,4 @@ out.extracted={0}\u304C\u62BD\u51FA\u3055\u308C\u307E\u3057\u305F
         out.inflated=\ \\{0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F
         out.size=(\u5165={0})(\u51FA={1})
         
        -usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n    \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ \n
        +usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n   -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n   -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n   -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n   -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n   -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n   -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n   -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n      \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n   -p  \u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n   -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n   -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n   -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n   -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u3068\u540C\u3058\u9806\u5E8F\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n     jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n    \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n     jar cvfm classes.jar mymanifest -C foo/ \n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
        index 7123b8cadd5..472d2d94dc2 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties
        @@ -29,6 +29,7 @@ error.bad.option=\uC635\uC158 -{ctxu} \uC911 \uD558\uB098\uB97C \uC9C0\uC815\uD5
         error.bad.cflag='c' \uD50C\uB798\uADF8\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74 Manifest \uB610\uB294 \uC785\uB825 \uD30C\uC77C\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4!
         error.bad.uflag='u' \uD50C\uB798\uADF8\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74 Manifest, 'e' \uD50C\uB798\uADF8 \uB610\uB294 \uC785\uB825 \uD30C\uC77C\uC744 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4!
         error.bad.eflag='e' \uD50C\uB798\uADF8 \uBC0F Manifest\uB97C 'Main-Class' \uC18D\uC131\uACFC \uD568\uAED8 \uC9C0\uC815\uD560 \uC218\n\uC5C6\uC2B5\uB2C8\uB2E4!
        +error.bad.pvalue=''Profile'' \uC18D\uC131\uC5D0 \uB300\uD574 \uC798\uBABB\uB41C \uAC12: {0}
         error.nosuch.fileordir={0}: \uD574\uB2F9 \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.
         error.write.file=\uAE30\uC874 jar \uD30C\uC77C\uC5D0 \uC4F0\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
         error.create.dir={0}: \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
        @@ -44,4 +45,4 @@ out.extracted=\uCD94\uCD9C\uB428: {0}
         out.inflated=\ \\\uC99D\uAC00\uB428: {0}
         out.size=(\uC785\uB825 = {0}) (\uCD9C\uB825 = {1})
         
        -usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n    -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n    -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n    -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uAC31\uC2E0\uD569\uB2C8\uB2E4.\n    -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n    -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n        \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n           foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n    -c  \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -t  \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n    -x  \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n    -u  \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n    -v  \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -f  \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -m  \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n    -e  jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n        \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -p  \uD504\uB85C\uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n    -0  \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -M  \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n    -i  \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n    -C  \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n           foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n       jar cvfm classes.jar mymanifest -C foo/\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
        index 640ea31f41e..4c4c9f89e21 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties
        @@ -29,6 +29,7 @@ error.bad.option=Uma das op\u00E7\u00F5es -{ctxu} deve ser especificada.
         error.bad.cflag=flag 'c' requer que os arquivos de manifesto ou entrada sejam especificados!
         error.bad.uflag=o flag 'u' requer que arquivos de manifesto, o flag 'e' ou arquivos de entrada sejam especificados!
         error.bad.eflag=o flag 'e' e manifesto com o atributo 'Main-Class' n\u00E3o podem ser especificados \njuntos!
        +error.bad.pvalue=valor inv\u00E1lido do atributo de ''Perfil'': {0}
         error.nosuch.fileordir={0} : n\u00E3o h\u00E1 tal arquivo ou diret\u00F3rio
         error.write.file=Erro ao gravar o arquivo jar existente
         error.create.dir={0} : n\u00E3o foi poss\u00EDvel criar o diret\u00F3rio
        @@ -44,4 +45,4 @@ out.extracted=extra\u00EDdo: {0}
         out.inflated=\ \\cheio: {0}
         out.size=(dentro = {0}) (fora= {1})
         
        -usage=Uso: arquivos jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOp\u00E7\u00F5es:\n    -c  cria novo arquivo compactado\n    -t  lista o sum\u00E1rio do arquivo compactado\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualizar o arquivo compactado existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do arquivo do arquivo compactado\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n        empacotando em um arquivo jar execut\u00E1vel\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n    -C  altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags  'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ na 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=Uso: arquivos jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] ...\nOp\u00E7\u00F5es:\n    -c  cria novo arquivo compactado\n    -t  lista o sum\u00E1rio do arquivo compactado\n    -x  extrai arquivos com o nome (ou todos) do arquivo compactado\n    -u  atualizar o arquivo compactado existente\n    -v  gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n    -f  especifica o nome do arquivo do arquivo compactado\n    -m  inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n    -e  especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n        empacotado em um arquivo jar execut\u00E1vel\n    -p  especifca o nome do perfil\n    -0  armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n    -M  n\u00E3o cria um arquivo de manifesto para as entradas\n    -i  gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n    -C  altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags  'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n           arquivos no diret\u00F3rio foo/ na 'classes.jar': \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
        index 83c51d64556..e91207a7151 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties
        @@ -29,6 +29,7 @@ error.bad.option=Ett av alternativen -{ctxu} m\u00E5ste anges.
         error.bad.cflag=f\u00F6r c-flaggan m\u00E5ste manifest- eller indatafiler anges.
         error.bad.uflag=f\u00F6r u-flaggan m\u00E5ste manifest-, e-flagg- eller indatafiler anges.
         error.bad.eflag=e-flaggan och manifest med attributet Main-Class kan inte anges \ntillsammans.
        +error.bad.pvalue=felaktigt v\u00E4rde f\u00F6r ''Profile''-attribut: {0}
         error.nosuch.fileordir={0} : det finns ingen s\u00E5dan fil eller katalog
         error.write.file=Det uppstod ett fel vid skrivning till befintlig jar-fil.
         error.create.dir={0} : kunde inte skapa n\u00E5gon katalog
        @@ -44,4 +45,4 @@ out.extracted=extraherat: {0}
         out.inflated=\ uppackat: {0}
         out.size=(in = {0}) (ut = {1})
         
        -usage=Syntax: jar-filer {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C-katalog] ...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=Syntax: jar {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer ...\nAlternativ:\n    -c  skapa nytt arkiv\n    -t  lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n    -x  extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n    -u  uppdatera befintligt arkiv\n    -v  generera utf\u00F6rliga utdata vid standardutmatning\n    -f  ange arkivfilens namn\n    -m  inkludera manifestinformation fr\u00E5n angivet manifest\n    -e  ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n        som medf\u00F6ljer i en jar-programfil\n    -p  ange profilnamn\n    -0  endast lagra  (ingen zip-komprimering)\n    -M  skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n    -i  generera indexinformation f\u00F6r de angivna jar-filerna\n    -C  \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges\ni samma ordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n       jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n           filer fr\u00E5n katalogen foo/ i classes.jar: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
        index 2ee8e568ffa..250bf2b783e 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties
        @@ -29,6 +29,7 @@ error.bad.option=\u5FC5\u987B\u6307\u5B9A {ctxu} \u4E2D\u7684\u4EFB\u4E00\u9009\
         error.bad.cflag='c' \u6807\u8BB0\u8981\u6C42\u6307\u5B9A\u6E05\u5355\u6216\u8F93\u5165\u6587\u4EF6!
         error.bad.uflag='u' \u6807\u8BB0\u8981\u6C42\u6307\u5B9A\u6E05\u5355, 'e' \u6807\u8BB0\u6216\u8F93\u5165\u6587\u4EF6!
         error.bad.eflag=\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A 'e' \u6807\u8BB0\u548C\u5177\u6709 'Main-Class' \u5C5E\u6027\u7684\n\u6E05\u5355!
        +error.bad.pvalue=''Profile'' \u5C5E\u6027\u7684\u503C\u9519\u8BEF: {0}
         error.nosuch.fileordir={0}: \u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\u6216\u76EE\u5F55
         error.write.file=\u5199\u5165\u73B0\u6709\u7684 jar \u6587\u4EF6\u65F6\u51FA\u9519
         error.create.dir={0}: \u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55
        @@ -44,4 +45,4 @@ out.extracted=\u5DF2\u63D0\u53D6: {0}
         out.inflated=\  \u5DF2\u89E3\u538B: {0}
         out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1})
         
        -usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n    -c  \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n    -t  \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/\u3002\n
        +usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879:\n    -c  \u521B\u5EFA\u65B0\u6863\u6848\n    -t  \u5217\u51FA\u6863\u6848\u76EE\u5F55\n    -x  \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n    -u  \u66F4\u65B0\u73B0\u6709\u6863\u6848\n    -v  \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n    -f  \u6307\u5B9A\u6863\u6848\u6587\u4EF6\u540D\n    -m  \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n    -e  \u4E3A\u7ED1\u5B9A\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n        \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n    -p  \u6307\u5B9A\u914D\u7F6E\u6587\u4EF6\u540D\u79F0\n    -0  \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u4EFB\u4F55 ZIP \u538B\u7F29\n    -M  \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n    -i  \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n    -C  \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u4EE5\u4E0B\u6587\u4EF6\n\u5982\u679C\u6587\u4EF6\u4E3A\u76EE\u5F55, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u6863\u6848\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u6863\u6848\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n           \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/\u3002\n
        diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
        index 31d603dd65a..ff5eedccaa8 100644
        --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
        +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties
        @@ -29,6 +29,7 @@ error.bad.option=\u5176\u4E2D\u4E00\u500B\u9078\u9805 -{ctxu} \u5FC5\u9808\u52A0
         error.bad.cflag='c' \u65D7\u6A19\u8981\u6C42\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u6216\u8F38\u5165\u6A94\u6848\uFF01
         error.bad.uflag='u' \u65D7\u6A19\u8981\u6C42\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u3001'e' \u65D7\u6A19\u6216\u8F38\u5165\u6A94\u6848\uFF01
         error.bad.eflag=\u7121\u6CD5\u540C\u6642\u6307\u5B9A 'e' \u65D7\u6A19\u548C\u5177\u6709 'Main-Class' \u5C6C\u6027\u7684\n\u8CC7\u8A0A\u6E05\u55AE\uFF01
        +error.bad.pvalue=''Profile'' \u5C6C\u6027\u503C\u7121\u6548: {0}
         error.nosuch.fileordir={0} : \u6C92\u6709\u9019\u985E\u6A94\u6848\u6216\u76EE\u9304
         error.write.file=\u5BEB\u5165\u73FE\u6709\u7684 jar \u6A94\u6848\u6642\u767C\u751F\u932F\u8AA4
         error.create.dir={0} : \u7121\u6CD5\u5EFA\u7ACB\u76EE\u9304
        @@ -44,4 +45,4 @@ out.extracted=\u64F7\u53D6: {0}
         out.inflated=\ \\\u64F4\u5C55: {0}
         out.size=\ (\u8B80={0})(\u5BEB={1})
         
        -usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n    -c  \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n    -t  \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n    -x  \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n    -u  \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n    -v  \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n    -f  \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n    -m  \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n    -e  \u70BA\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n        \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n    -0  \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n    -M  \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n    -i  \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n    -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n           foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ .\n
        +usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9078\u9805:\n    -c  \u5EFA\u7ACB\u65B0\u7684\u5B58\u6A94\n    -t  \u5217\u51FA\u5B58\u6A94\u7684\u76EE\u9304\n    -x  \u5F9E\u5B58\u6A94\u4E2D\u64F7\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n    -u  \u66F4\u65B0\u73FE\u6709\u5B58\u6A94\n    -v  \u5728\u6A19\u6E96\u8F38\u51FA\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n    -f  \u6307\u5B9A\u5B58\u6A94\u6A94\u6848\u540D\u7A31\n    -m  \u5305\u542B\u6307\u5B9A\u4E4B\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n    -e  \u6307\u5B9A\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u7684\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE \n        \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n    -p  \u6307\u5B9A\u8A2D\u5B9A\u6A94\u540D\u7A31\n    -0  \u53EA\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n    -M  \u4E0D\u66FF\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n    -i  \u7522\u751F\u6307\u5B9A\u4E4B jar \u6A94\u6848\u7684\u7D22\u5F15\u8CC7\u8A0A\n    -C  \u8B8A\u66F4\u81F3\u6307\u5B9A\u7684\u76EE\u9304\u4E26\u5305\u542B\u4E0B\u5217\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u905E\u8FF4\u5730\u8655\u7406\u6A94\u6848\u3002\n\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u5B58\u6A94\u6A94\u6848\u540D\u7A31\u4EE5\u53CA\u9032\u5165\u9EDE\u540D\u7A31\u7684\n\u6307\u5B9A\u9806\u5E8F\u8207 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u5B58\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u5B58\u6A94\u4E2D: \n       jar cvf classes.jar Foo.class Bar.class \n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest'\uFF0C\u5C07 foo/ \u76EE\u9304\n           \u4E2D\u7684\u6240\u6709\u6A94\u6848\u5B58\u6A94\u81F3 'classes.jar' \u4E2D: \n       jar cvfm classes.jar mymanifest -C foo/ \n
        diff --git a/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java b/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java
        index c13d1e287b2..7bc48414d5d 100644
        --- a/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java
        +++ b/jdk/src/share/classes/sun/tools/java/ClassDeclaration.java
        @@ -230,12 +230,17 @@ class ClassDeclaration implements Constants {
              * Equality
              */
             public boolean equals(Object obj) {
        -        if ((obj != null) && (obj instanceof ClassDeclaration)) {
        +        if (obj instanceof ClassDeclaration) {
                     return type.equals(((ClassDeclaration)obj).type);
                 }
                 return false;
             }
         
        +    @Override
        +    public int hashCode() {
        +        return type.hashCode();
        +    }
        +
             /**
              * toString
              */
        diff --git a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
        index c750f1bb612..c970137edae 100644
        --- a/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
        +++ b/jdk/src/share/classes/sun/tools/java/MemberDefinition.java
        @@ -256,8 +256,8 @@ class MemberDefinition implements Constants {
                 }
                 String name = this.name.toString();
                 return name.startsWith(prefixVal)
        -            || name.toString().startsWith(prefixLoc)
        -            || name.toString().startsWith(prefixThis);
        +            || name.startsWith(prefixLoc)
        +            || name.startsWith(prefixThis);
             }
         
             public boolean isAccessMethod() {
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/Messages.java b/jdk/src/share/classes/sun/tools/jconsole/Messages.java
        index 27001f27ccc..c566a444749 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/Messages.java
        +++ b/jdk/src/share/classes/sun/tools/jconsole/Messages.java
        @@ -156,6 +156,7 @@ final public class Messages {
             public static String IMPACT;
             public static String INFO;
             public static String INFO_CAPITALIZED;
        +    public static String INSECURE;
             public static String INVALID_PLUGIN_PATH;
             public static String INVALID_URL;
             public static String IS;
        @@ -303,6 +304,8 @@ final public class Messages {
             public static String WRITABLE;
             public static String CONNECTION_FAILED1;
             public static String CONNECTION_FAILED2;
        +    public static String CONNECTION_FAILED_SSL1;
        +    public static String CONNECTION_FAILED_SSL2;
             public static String CONNECTION_LOST1;
             public static String CONNECTING_TO1;
             public static String CONNECTING_TO2;
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java b/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
        index af7b4267f0b..301eae167c9 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
        +++ b/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
        @@ -307,10 +307,10 @@ public class ProxyClient implements JConsoleContext {
                 }
             }
         
        -    void connect() {
        +    void connect(boolean requireSSL) {
                 setConnectionState(ConnectionState.CONNECTING);
                 try {
        -            tryConnect();
        +            tryConnect(requireSSL);
                     setConnectionState(ConnectionState.CONNECTED);
                 } catch (Exception e) {
                     if (JConsole.isDebug()) {
        @@ -320,7 +320,7 @@ public class ProxyClient implements JConsoleContext {
                 }
             }
         
        -    private void tryConnect() throws IOException {
        +    private void tryConnect(boolean requireRemoteSSL) throws IOException {
                 if (jmxUrl == null && "localhost".equals(hostName) && port == 0) {
                     // Monitor self
                     this.jmxc = null;
        @@ -340,6 +340,10 @@ public class ProxyClient implements JConsoleContext {
                             this.jmxUrl = new JMXServiceURL(lvm.connectorAddress());
                         }
                     }
        +            Map env = new HashMap();
        +            if (requireRemoteSSL) {
        +                env.put("jmx.remote.x.check.stub", "true");
        +            }
                     // Need to pass in credentials ?
                     if (userName == null && password == null) {
                         if (isVmConnector()) {
        @@ -348,12 +352,11 @@ public class ProxyClient implements JConsoleContext {
                                 checkSslConfig();
                             }
                             this.jmxc = new RMIConnector(stub, null);
        -                    jmxc.connect();
        +                    jmxc.connect(env);
                         } else {
        -                    this.jmxc = JMXConnectorFactory.connect(jmxUrl);
        +                    this.jmxc = JMXConnectorFactory.connect(jmxUrl, env);
                         }
                     } else {
        -                Map env = new HashMap();
                         env.put(JMXConnector.CREDENTIALS,
                                 new String[] {userName, password});
                         if (isVmConnector()) {
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/VMPanel.java b/jdk/src/share/classes/sun/tools/jconsole/VMPanel.java
        index 86d2fc5d10b..f72f1e20315 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/VMPanel.java
        +++ b/jdk/src/share/classes/sun/tools/jconsole/VMPanel.java
        @@ -56,6 +56,7 @@ public class VMPanel extends JTabbedPane implements PropertyChangeListener {
             private static ArrayList tabInfos = new ArrayList();
             private boolean wasConnected = false;
             private boolean userDisconnected = false;
        +    private boolean shouldUseSSL = true;
         
             // The everConnected flag keeps track of whether the window can be
             // closed if the user clicks Cancel after a failed connection attempt.
        @@ -288,7 +289,7 @@ public class VMPanel extends JTabbedPane implements PropertyChangeListener {
                     new Thread("VMPanel.connect") {
         
                         public void run() {
        -                    proxyClient.connect();
        +                    proxyClient.connect(shouldUseSSL);
                         }
                     }.start();
                 }
        @@ -467,8 +468,12 @@ public class VMPanel extends JTabbedPane implements PropertyChangeListener {
                     msgTitle = Messages.CONNECTION_LOST1;
                     msgExplanation = Resources.format(Messages.CONNECTING_TO2, getConnectionName());
                     buttonStr = Messages.RECONNECT;
        +        } else if (shouldUseSSL) {
        +            msgTitle = Messages.CONNECTION_FAILED_SSL1;
        +            msgExplanation = Resources.format(Messages.CONNECTION_FAILED_SSL2, getConnectionName());
        +            buttonStr = Messages.INSECURE;
                 } else {
        -            msgTitle =Messages.CONNECTION_FAILED1;
        +            msgTitle = Messages.CONNECTION_FAILED1;
                     msgExplanation = Resources.format(Messages.CONNECTION_FAILED2, getConnectionName());
                     buttonStr = Messages.CONNECT;
                 }
        @@ -490,6 +495,9 @@ public class VMPanel extends JTabbedPane implements PropertyChangeListener {
         
                             if (value == Messages.RECONNECT || value == Messages.CONNECT) {
                                 connect();
        +                    } else if (value == Messages.INSECURE) {
        +                        shouldUseSSL = false;
        +                        connect();
                             } else if (!everConnected) {
                                 try {
                                     getFrame().setClosed(true);
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/inspector/Utils.java b/jdk/src/share/classes/sun/tools/jconsole/inspector/Utils.java
        index 0ff44bd6002..01279d98aff 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/inspector/Utils.java
        +++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/Utils.java
        @@ -352,7 +352,7 @@ public class Utils {
                     result = new Character(value.charAt(0));
                 } else if (Number.class.isAssignableFrom(Utils.getClass(type))) {
                     result = createNumberFromStringValue(value);
        -        } else if (value == null || value.toString().equals("null")) {
        +        } else if (value == null || value.equals("null")) {
                     // hack for null value
                     result = null;
                 } else {
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/inspector/XObject.java b/jdk/src/share/classes/sun/tools/jconsole/inspector/XObject.java
        index d0b5617a2c4..95db93802ef 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/inspector/XObject.java
        +++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/XObject.java
        @@ -27,6 +27,7 @@ package sun.tools.jconsole.inspector;
         
         // java import
         import javax.swing.*;
        +import java.util.Objects;
         
         /**
          * This provides a wrapper to the Object class to allow it to be
        @@ -48,18 +49,17 @@ public class XObject extends JLabel {
             }
         
             public boolean equals(Object o) {
        -        try {
        -            if (o instanceof XObject) {
        -                return object.equals(((XObject)o).getObject());
        -            }
        -        }
        -        catch (Throwable t) {
        -            System.out.println("Error comparing XObjects"+
        -                               t.getMessage());
        +        if (o instanceof XObject) {
        +            return Objects.equals(object, ((XObject)o).getObject());
                 }
                 return false;
             }
         
        +    @Override
        +    public int hashCode() {
        +        return object.hashCode();
        +    }
        +
         
             public Object getObject() {
                 return object;
        diff --git a/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties b/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties
        index cf906c06174..03d705f9888 100644
        --- a/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties
        +++ b/jdk/src/share/classes/sun/tools/jconsole/resources/messages.properties
        @@ -114,6 +114,7 @@ HOTSPOT_MBEANS_DIALOG_ACCESSIBLE_DESCRIPTION=Dialog for managing Hotspot MBeans
         IMPACT=Impact
         INFO=Info
         INFO_CAPITALIZED=INFO
        +INSECURE=Insecure connection
         INVALID_PLUGIN_PATH=Warning: Invalid plugin path: {0}
         INVALID_URL=Invalid URL: {0}
         IS=Is
        @@ -261,6 +262,8 @@ WINDOWS=Windows
         WRITABLE=Writable
         CONNECTION_FAILED1=Connection Failed: Retry?
         CONNECTION_FAILED2=The connection to {0} did not succeed.
        Would you like to try again? +CONNECTION_FAILED_SSL1=Secure connection failed. Retry insecurely? +CONNECTION_FAILED_SSL2=The connection to {0} could not be made using SSL.
        Would you like to try without SSL?
        (Username and password will be sent in plain text.) CONNECTION_LOST1=Connection Lost: Reconnect? CONNECTING_TO1=Connecting to {0} CONNECTING_TO2=You are currently being connected to {0}.
        This will take a few moments. diff --git a/jdk/src/share/classes/sun/tools/serialver/serialver_zh_CN.properties b/jdk/src/share/classes/sun/tools/serialver/serialver_zh_CN.properties index 978e29a69ca..526a1e3bb98 100644 --- a/jdk/src/share/classes/sun/tools/serialver/serialver_zh_CN.properties +++ b/jdk/src/share/classes/sun/tools/serialver/serialver_zh_CN.properties @@ -6,7 +6,7 @@ FullClassName=\u5B8C\u6574\u7684\u7C7B\u540D: SerialVersion=\u5E8F\u5217\u7248\u672C: NotSerializable=\u7C7B{0}\u65E0\u6CD5\u5E8F\u5217\u5316\u3002 ClassNotFound=\u627E\u4E0D\u5230\u7C7B{0}\u3002 -error.parsing.classpath=\u5BF9\u7C7B\u8DEF\u5F84 {0} \u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u51FA\u9519\u3002 +error.parsing.classpath=\u89E3\u6790\u7C7B\u8DEF\u5F84 {0} \u65F6\u51FA\u9519\u3002 error.missing.classpath=\u7F3A\u5C11 -classpath \u9009\u9879\u7684\u53C2\u6570 invalid.flag=\u65E0\u6548\u6807\u8BB0{0}\u3002 ignoring.classes=\u65E0\u6CD5\u4F7F\u7528 -show \u9009\u9879\u6307\u5B9A\u7C7B\u53C2\u6570 diff --git a/jdk/src/share/classes/sun/tracing/ProviderSkeleton.java b/jdk/src/share/classes/sun/tracing/ProviderSkeleton.java index ca5e58fbc6c..2a5bc360430 100644 --- a/jdk/src/share/classes/sun/tracing/ProviderSkeleton.java +++ b/jdk/src/share/classes/sun/tracing/ProviderSkeleton.java @@ -154,20 +154,25 @@ public abstract class ProviderSkeleton implements InvocationHandler, Provider { * @return always null, if the method is a user-defined probe */ public Object invoke(Object proxy, Method method, Object[] args) { - if (method.getDeclaringClass() != providerType) { + Class declaringClass = method.getDeclaringClass(); + // not a provider subtype's own method + if (declaringClass != providerType) { try { - return method.invoke(this, args); + // delegate only to methods declared by + // com.sun.tracing.Provider or java.lang.Object + if (declaringClass == Provider.class || + declaringClass == Object.class) { + return method.invoke(this, args); + } else { + assert false; + } } catch (IllegalAccessException e) { assert false; } catch (InvocationTargetException e) { assert false; } - } else if (active) { - ProbeSkeleton p = probes.get(method); - if (p != null) { - // Skips argument check -- already done by javac - p.uncheckedTrigger(args); - } + } else { + triggerProbe(method, args); } return null; } @@ -252,4 +257,14 @@ public abstract class ProviderSkeleton implements InvocationHandler, Provider { } return ret; } + + protected void triggerProbe(Method method, Object[] args) { + if (active) { + ProbeSkeleton p = probes.get(method); + if (p != null) { + // Skips argument check -- already done by javac + p.uncheckedTrigger(args); + } + } + } } diff --git a/jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java b/jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java index 4a9eb2888d6..fdc447dbd15 100644 --- a/jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java +++ b/jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java @@ -151,19 +151,8 @@ class DTraceProvider extends ProviderSkeleton { // directly. So this method should never get invoked. We also wire up the // DTraceProbe.uncheckedTrigger() method to call the proxy method instead // of doing the work itself. - public Object invoke(Object proxy, Method method, Object[] args) { - if (method.getDeclaringClass() != providerType) { - try { - return method.invoke(this, args); - } catch (IllegalAccessException e) { - assert false; - } catch (InvocationTargetException e) { - assert false; - } - } else if (active) { - assert false : "This method should have been overridden by the JVM"; - } - return null; + protected void triggerProbe(Method method, Object[] args) { + assert false : "This method should have been overridden by the JVM"; } public String getProviderName() { diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_de.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_de.properties index 1aa8ef4e22c..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_de.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_de.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Alle +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=Schwerwiegend +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Warnung +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Information +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Konfiguration +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Fein +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Feiner +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=Am feinsten +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=Deaktiviert +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_es.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_es.properties index 90de2e88238..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_es.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_es.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Todo +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=Grave +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Advertencia +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Informaci\u00F3n +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Configurar +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Detallado +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Muy Detallado +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=M\u00E1s Detallado +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=Desactivado +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_fr.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_fr.properties index af34d6fa414..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_fr.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_fr.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Tout +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=Grave +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Avertissement +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Infos +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Config +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Pr\u00E9cis +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Plus pr\u00E9cis +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=Le plus pr\u00E9cis +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=D\u00E9sactiv\u00E9 +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_it.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_it.properties index 73a3b5c59cf..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_it.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_it.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Tutto +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=Grave +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Avvertenza +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Informazioni +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Configurazione +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Buono +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Migliore +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=Ottimale +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=Non attivo +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_ja.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_ja.properties index 60358d1c86e..980c33549c5 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_ja.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_ja.properties @@ -29,18 +29,18 @@ # The following ALL CAPS words should be translated. ALL=\u3059\u3079\u3066 # The following ALL CAPS words should be translated. -SEVERE=\u91CD\u5927 +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=\u8B66\u544A +WARNING=WARNING # The following ALL CAPS words should be translated. INFO=\u60C5\u5831 # The following ALL CAPS words should be translated. -CONFIG= \u69CB\u6210 +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=\u666E\u901A +FINE=\u8A73\u7D30\u30EC\u30D9\u30EB(\u4F4E) # The following ALL CAPS words should be translated. -FINER=\u8A73\u7D30 +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=\u6700\u3082\u8A73\u7D30 +FINEST=FINEST # The following ALL CAPS words should be translated. OFF=\u30AA\u30D5 diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_ko.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_ko.properties index 6d5dc551e67..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_ko.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_ko.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=\uBAA8\uB450 +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=\uC2EC\uAC01 +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=\uACBD\uACE0 +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=\uC815\uBCF4 +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= \uAD6C\uC131 +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=\uBBF8\uC138 +FINE=FINE # The following ALL CAPS words should be translated. -FINER=\uBCF4\uB2E4 \uBBF8\uC138 +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=\uAC00\uC7A5 \uBBF8\uC138 +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=\uD574\uC81C +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties index 29229f2c7c1..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_pt_BR.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Tudo +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=Grave +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Advert\u00EAncia +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Informa\u00E7\u00F5es +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Configura\u00E7\u00E3o +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Detalhado +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Mais Detalhado +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=O Mais Detalhado +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=Desativado +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_sv.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_sv.properties index b7607863ffb..4c8dd1d2dcb 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_sv.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_sv.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=Alla +ALL=ALLA # The following ALL CAPS words should be translated. -SEVERE=Allvarlig +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=Varning +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=Info +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= Konfig +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=Fin +FINE=FINE # The following ALL CAPS words should be translated. -FINER=Finare +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=Finaste +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=Av +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties index 67dd2b8b50a..da17c47f8fd 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_zh_CN.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=\u5168\u90E8 +ALL=ALL # The following ALL CAPS words should be translated. -SEVERE=\u4E25\u91CD +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=\u8B66\u544A +WARNING=WARNING # The following ALL CAPS words should be translated. -INFO=\u4FE1\u606F +INFO=INFO # The following ALL CAPS words should be translated. -CONFIG= \u914D\u7F6E +CONFIG= CONFIG # The following ALL CAPS words should be translated. -FINE=\u8BE6\u7EC6 +FINE=FINE # The following ALL CAPS words should be translated. -FINER=\u8F83\u8BE6\u7EC6 +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=\u975E\u5E38\u8BE6\u7EC6 +FINEST=FINEST # The following ALL CAPS words should be translated. -OFF=\u7981\u7528 +OFF=OFF diff --git a/jdk/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties b/jdk/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties index 4875bc825c1..d7ad070a69e 100644 --- a/jdk/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties +++ b/jdk/src/share/classes/sun/util/logging/resources/logging_zh_TW.properties @@ -27,20 +27,20 @@ # these are the same as the non-localized level name. # The following ALL CAPS words should be translated. -ALL=\u5168\u90E8 +ALL=\u6240\u6709 # The following ALL CAPS words should be translated. -SEVERE=\u56B4\u91CD +SEVERE=SEVERE # The following ALL CAPS words should be translated. -WARNING=\u8B66\u544A +WARNING=WARNING # The following ALL CAPS words should be translated. INFO=\u8CC7\u8A0A # The following ALL CAPS words should be translated. -CONFIG= \u7D44\u614B +CONFIG= CONFIG # The following ALL CAPS words should be translated. FINE=\u8A73\u7D30 # The following ALL CAPS words should be translated. -FINER=\u8F03\u8A73\u7D30 +FINER=FINER # The following ALL CAPS words should be translated. -FINEST=\u6700\u8A73\u7D30 +FINEST=FINEST # The following ALL CAPS words should be translated. OFF=\u95DC\u9589 diff --git a/jdk/src/share/classes/sun/util/resources/pt/CalendarData_pt_BR.properties b/jdk/src/share/classes/sun/util/resources/pt/CalendarData_pt_BR.properties new file mode 100644 index 00000000000..ea543b258e8 --- /dev/null +++ b/jdk/src/share/classes/sun/util/resources/pt/CalendarData_pt_BR.properties @@ -0,0 +1,40 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved +# (C) Copyright IBM Corp. 1996 - 1999 - All Rights Reserved +# +# The original version of this source code and documentation +# is copyrighted and owned by Taligent, Inc., a wholly-owned +# subsidiary of IBM. These materials are provided under terms +# of a License Agreement between Taligent and Sun. This technology +# is protected by multiple US and International patents. +# +# This notice and attribution to Taligent may not be removed. +# Taligent is a registered trademark of Taligent, Inc. + + +firstDayOfWeek=1 +minimalDaysInFirstWeek=1 diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index dc5ccfc2d14..e9fb82abf5a 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -1940,7 +1940,6 @@ public class ZipFileSystem extends FileSystem { if (elen64 != 0) { elen64 += 4; // header and data sz 4 bytes } - while (eoff + 4 < elen) { int tag = SH(extra, eoff); int sz = SH(extra, eoff + 2); @@ -1995,7 +1994,6 @@ public class ZipFileSystem extends FileSystem { writeLong(os, locoff); } if (elenNTFS != 0) { - // System.out.println("writing NTFS:" + elenNTFS); writeShort(os, EXTID_NTFS); writeShort(os, elenNTFS - 4); writeInt(os, 0); // reserved @@ -2197,7 +2195,7 @@ public class ZipFileSystem extends FileSystem { if (extra != null) { writeBytes(os, extra); } - return LOCHDR + name.length + elen + elen64 + elenEXTT; + return LOCHDR + name.length + elen + elen64 + elenNTFS + elenEXTT; } // Data Descriptior diff --git a/jdk/src/share/javavm/export/jvm.h b/jdk/src/share/javavm/export/jvm.h index f10019a92ec..48181c06bce 100644 --- a/jdk/src/share/javavm/export/jvm.h +++ b/jdk/src/share/javavm/export/jvm.h @@ -441,9 +441,6 @@ JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers); JNIEXPORT jobject JNICALL JVM_GetProtectionDomain(JNIEnv *env, jclass cls); -JNIEXPORT void JNICALL -JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain); - JNIEXPORT jboolean JNICALL JVM_IsArrayClass(JNIEnv *env, jclass cls); diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux index 253df1fe974..c456ad932ca 100644 --- a/jdk/src/share/lib/security/java.security-linux +++ b/jdk/src/share/lib/security/java.security-linux @@ -177,6 +177,7 @@ keystore.type=jks # corresponding RuntimePermission ("accessClassInPackage."+package) has # been granted. package.access=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -197,12 +198,14 @@ package.access=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools. @@ -219,6 +222,7 @@ package.access=sun.,\ # checkPackageDefinition. # package.definition=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -239,12 +243,14 @@ package.definition=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools. diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx index 7363d77ee04..e1604347c9a 100644 --- a/jdk/src/share/lib/security/java.security-macosx +++ b/jdk/src/share/lib/security/java.security-macosx @@ -178,6 +178,7 @@ keystore.type=jks # corresponding RuntimePermission ("accessClassInPackage."+package) has # been granted. package.access=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -198,11 +199,13 @@ package.access=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ @@ -220,6 +223,7 @@ package.access=sun.,\ # checkPackageDefinition. # package.definition=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -240,11 +244,13 @@ package.definition=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris index a641ca56483..ddb0eb4916c 100644 --- a/jdk/src/share/lib/security/java.security-solaris +++ b/jdk/src/share/lib/security/java.security-solaris @@ -179,6 +179,7 @@ keystore.type=jks # corresponding RuntimePermission ("accessClassInPackage."+package) has # been granted. package.access=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -199,12 +200,14 @@ package.access=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools. @@ -220,6 +223,7 @@ package.access=sun.,\ # checkPackageDefinition. # package.definition=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -240,12 +244,14 @@ package.definition=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools. diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows index 29bb4d2c782..24cb22a9d4c 100644 --- a/jdk/src/share/lib/security/java.security-windows +++ b/jdk/src/share/lib/security/java.security-windows @@ -178,6 +178,7 @@ keystore.type=jks # corresponding RuntimePermission ("accessClassInPackage."+package) has # been granted. package.access=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -198,12 +199,14 @@ package.access=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ @@ -220,6 +223,7 @@ package.access=sun.,\ # checkPackageDefinition. # package.definition=sun.,\ + com.sun.corba.se.impl.,\ com.sun.xml.internal.,\ com.sun.imageio.,\ com.sun.istack.internal.,\ @@ -240,12 +244,14 @@ package.definition=sun.,\ com.sun.org.apache.xalan.internal.xsltc.trax.,\ com.sun.org.apache.xalan.internal.xsltc.util.,\ com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.security.,\ com.sun.org.apache.xml.internal.serializer.utils.,\ com.sun.org.apache.xml.internal.utils.,\ com.sun.org.glassfish.,\ com.oracle.xmlns.internal.,\ com.oracle.webservices.internal.,\ oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ jdk.internal.,\ jdk.nashorn.internal.,\ jdk.nashorn.tools.,\ diff --git a/jdk/src/share/native/common/sizecalc.h b/jdk/src/share/native/common/sizecalc.h new file mode 100644 index 00000000000..675750e8a46 --- /dev/null +++ b/jdk/src/share/native/common/sizecalc.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef SIZECALC_H +#define SIZECALC_H + +/* + * A machinery for safe calculation of sizes used when allocating memory. + * + * All size checks are performed against the SIZE_MAX (the maximum value for + * size_t). All numerical arguments as well as the result of calculation must + * be non-negative integers less than or equal to SIZE_MAX, otherwise the + * calculated size is considered unsafe. + * + * If the SIZECALC_ALLOC_THROWING_BAD_ALLOC macro is defined, then _ALLOC_ + * helper macros throw the std::bad_alloc instead of returning NULL. + */ + +#include /* SIZE_MAX for C99+ */ +/* http://stackoverflow.com/questions/3472311/what-is-a-portable-method-to-find-the-maximum-value-of-size-t */ +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t)-1) +#endif + +#define IS_SAFE_SIZE_T(x) ((x) >= 0 && (unsigned long long)(x) <= SIZE_MAX) + +#define IS_SAFE_SIZE_MUL(m, n) \ + (IS_SAFE_SIZE_T(m) && IS_SAFE_SIZE_T(n) && ((m) == 0 || (n) == 0 || (size_t)(n) <= (SIZE_MAX / (size_t)(m)))) + +#define IS_SAFE_SIZE_ADD(a, b) \ + (IS_SAFE_SIZE_T(a) && IS_SAFE_SIZE_T(b) && (size_t)(b) <= (SIZE_MAX - (size_t)(a))) + + + +/* Helper macros */ + +#ifdef SIZECALC_ALLOC_THROWING_BAD_ALLOC +#define FAILURE_RESULT throw std::bad_alloc() +#else +#define FAILURE_RESULT NULL +#endif + +/* + * A helper macro to safely allocate an array of size m*n. + * Example usage: + * int* p = (int*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(int), n); + * if (!p) throw OutOfMemory; + * // Use the allocated array... + */ +#define SAFE_SIZE_ARRAY_ALLOC(func, m, n) \ + (IS_SAFE_SIZE_MUL((m), (n)) ? ((func)((m) * (n))) : FAILURE_RESULT) + +#define SAFE_SIZE_ARRAY_REALLOC(func, p, m, n) \ + (IS_SAFE_SIZE_MUL((m), (n)) ? ((func)((p), (m) * (n))) : FAILURE_RESULT) + +/* + * A helper macro to safely allocate an array of type 'type' with 'n' items + * using the C++ new[] operator. + * Example usage: + * MyClass* p = SAFE_SIZE_NEW_ARRAY(MyClass, n); + * // Use the pointer. + * This macro throws the std::bad_alloc C++ exception to indicate + * a failure. + * NOTE: if 'n' is calculated, the calling code is responsible for using the + * IS_SAFE_... macros to check if the calculations are safe. + */ +#define SAFE_SIZE_NEW_ARRAY(type, n) \ + (IS_SAFE_SIZE_MUL(sizeof(type), (n)) ? (new type[(n)]) : throw std::bad_alloc()) + +#define SAFE_SIZE_NEW_ARRAY2(type, n, m) \ + (IS_SAFE_SIZE_MUL((m), (n)) && IS_SAFE_SIZE_MUL(sizeof(type), (n) * (m)) ? \ + (new type[(n) * (m)]) : throw std::bad_alloc()) + +/* + * Checks if a data structure of size (a + m*n) can be safely allocated + * w/o producing an integer overflow when calculating its size. + */ +#define IS_SAFE_STRUCT_SIZE(a, m, n) \ + ( \ + IS_SAFE_SIZE_MUL((m), (n)) && IS_SAFE_SIZE_ADD((m) * (n), (a)) \ + ) + +/* + * A helper macro for implementing safe memory allocation for a data structure + * of size (a + m * n). + * Example usage: + * void * p = SAFE_SIZE_ALLOC(malloc, header, num, itemSize); + * if (!p) throw OutOfMemory; + * // Use the allocated memory... + */ +#define SAFE_SIZE_STRUCT_ALLOC(func, a, m, n) \ + (IS_SAFE_STRUCT_SIZE((a), (m), (n)) ? ((func)((a) + (m) * (n))) : FAILURE_RESULT) + + +#endif /* SIZECALC_H */ + diff --git a/jdk/src/share/native/java/lang/Class.c b/jdk/src/share/native/java/lang/Class.c index 20d03060101..e53d3f73b79 100644 --- a/jdk/src/share/native/java/lang/Class.c +++ b/jdk/src/share/native/java/lang/Class.c @@ -55,7 +55,7 @@ extern jboolean VerifyFixClassname(char *utf_name); static JNINativeMethod methods[] = { {"getName0", "()" STR, (void *)&JVM_GetClassName}, {"getSuperclass", "()" CLS, NULL}, - {"getInterfaces", "()[" CLS, (void *)&JVM_GetClassInterfaces}, + {"getInterfaces0", "()[" CLS, (void *)&JVM_GetClassInterfaces}, {"getClassLoader0", "()" JCL, (void *)&JVM_GetClassLoader}, {"isInterface", "()Z", (void *)&JVM_IsInterface}, {"getSigners", "()[" OBJ, (void *)&JVM_GetClassSigners}, @@ -68,10 +68,9 @@ static JNINativeMethod methods[] = { {"getDeclaredMethods0","(Z)[" MHD, (void *)&JVM_GetClassDeclaredMethods}, {"getDeclaredConstructors0","(Z)[" CTR, (void *)&JVM_GetClassDeclaredConstructors}, {"getProtectionDomain0", "()" PD, (void *)&JVM_GetProtectionDomain}, - {"setProtectionDomain0", "(" PD ")V", (void *)&JVM_SetProtectionDomain}, {"getDeclaredClasses0", "()[" CLS, (void *)&JVM_GetDeclaredClasses}, {"getDeclaringClass", "()" CLS, (void *)&JVM_GetDeclaringClass}, - {"getGenericSignature", "()" STR, (void *)&JVM_GetClassSignature}, + {"getGenericSignature0", "()" STR, (void *)&JVM_GetClassSignature}, {"getRawAnnotations", "()" BA, (void *)&JVM_GetClassAnnotations}, {"getConstantPool", "()" CPL, (void *)&JVM_GetClassConstantPool}, {"desiredAssertionStatus0","("CLS")Z",(void *)&JVM_DesiredAssertionStatus}, diff --git a/jdk/src/share/native/java/util/zip/ZipFile.c b/jdk/src/share/native/java/util/zip/ZipFile.c index 5c2c442c6b9..d66cccb747a 100644 --- a/jdk/src/share/native/java/util/zip/ZipFile.c +++ b/jdk/src/share/native/java/util/zip/ZipFile.c @@ -137,6 +137,14 @@ Java_java_util_zip_ZipFile_getTotal(JNIEnv *env, jclass cls, jlong zfile) return zip->total; } +JNIEXPORT jboolean JNICALL +Java_java_util_zip_ZipFile_startsWithLOC(JNIEnv *env, jclass cls, jlong zfile) +{ + jzfile *zip = jlong_to_ptr(zfile); + + return zip->locsig; +} + JNIEXPORT void JNICALL Java_java_util_zip_ZipFile_close(JNIEnv *env, jclass cls, jlong zfile) { diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c index 99bf07cd9f8..079244161a0 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.c +++ b/jdk/src/share/native/java/util/zip/zip_util.c @@ -831,6 +831,14 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, return NULL; } + // Assumption, zfd refers to start of file. Trivially, reuse errbuf. + if (readFully(zfd, errbuf, 4) != -1) { // errors will be handled later + if (GETSIG(errbuf) == LOCSIG) + zip->locsig = JNI_TRUE; + else + zip->locsig = JNI_FALSE; + } + len = zip->len = IO_Lseek(zfd, 0, SEEK_END); if (len <= 0) { if (len == 0) { /* zip file is empty */ diff --git a/jdk/src/share/native/java/util/zip/zip_util.h b/jdk/src/share/native/java/util/zip/zip_util.h index 5782eaacf40..124e3f77e2e 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.h +++ b/jdk/src/share/native/java/util/zip/zip_util.h @@ -210,6 +210,7 @@ typedef struct jzfile { /* Zip file */ start of the file. */ jboolean usemmap; /* if mmap is used. */ #endif + jboolean locsig; /* if zip file starts with LOCSIG */ cencache cencache; /* CEN header cache */ ZFILE zfd; /* open file descriptor */ void *lock; /* read lock */ diff --git a/jdk/src/share/native/sun/awt/image/awt_parseImage.c b/jdk/src/share/native/sun/awt/image/awt_parseImage.c index 310866acba3..e11a8dbee8c 100644 --- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c +++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c @@ -396,10 +396,39 @@ int awt_parseRaster(JNIEnv *env, jobject jraster, RasterS_t *rasterP) { return 1; } +static int getColorModelType(JNIEnv *env, jobject jcmodel) { + int type = UNKNOWN_CM_TYPE; + + if ((*env)->IsInstanceOf(env, jcmodel, + (*env)->FindClass(env, "java/awt/image/IndexColorModel"))) + { + type = INDEX_CM_TYPE; + } else if ((*env)->IsInstanceOf(env, jcmodel, + (*env)->FindClass(env, "java/awt/image/PackedColorModel"))) + { + if ((*env)->IsInstanceOf(env, jcmodel, + (*env)->FindClass(env, "java/awt/image/DirectColorModel"))) { + type = DIRECT_CM_TYPE; + } + else { + type = PACKED_CM_TYPE; + } + } + else if ((*env)->IsInstanceOf(env, jcmodel, + (*env)->FindClass(env, "java/awt/image/ComponentColorModel"))) + { + type = COMPONENT_CM_TYPE; + } + + return type; +} + int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType, ColorModelS_t *cmP) { /*jmethodID jID; */ jobject jnBits; + jsize nBitsLength; + int i; static jobject s_jdefCM = NULL; @@ -421,15 +450,55 @@ int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType, cmP->transparency = (*env)->GetIntField(env, jcmodel, g_CMtransparencyID); + jnBits = (*env)->GetObjectField(env, jcmodel, g_CMnBitsID); + if (jnBits == NULL) { + JNU_ThrowNullPointerException(env, "null nBits structure in CModel"); + return -1; + } + + nBitsLength = (*env)->GetArrayLength(env, jnBits); + if (nBitsLength != cmP->numComponents) { + // invalid number of components? + return -1; + } + + cmP->nBits = NULL; + if (SAFE_TO_ALLOC_2(cmP->numComponents, sizeof(jint))) { + cmP->nBits = (jint *)malloc(cmP->numComponents * sizeof(jint)); + } + + if (cmP->nBits == NULL){ + JNU_ThrowOutOfMemoryError(env, "Out of memory"); + return -1; + } + (*env)->GetIntArrayRegion(env, jnBits, 0, cmP->numComponents, + cmP->nBits); + cmP->maxNbits = 0; + for (i=0; i < cmP->numComponents; i++) { + if (cmP->maxNbits < cmP->nBits[i]) { + cmP->maxNbits = cmP->nBits[i]; + } + } + + cmP->is_sRGB = (*env)->GetBooleanField(env, cmP->jcmodel, g_CMis_sRGBID); + + cmP->csType = (*env)->GetIntField(env, cmP->jcmodel, g_CMcsTypeID); + + cmP->cmType = getColorModelType(env, jcmodel); + + cmP->isDefaultCM = FALSE; + cmP->isDefaultCompatCM = FALSE; + + /* look for standard cases */ if (imageType == java_awt_image_BufferedImage_TYPE_INT_ARGB) { cmP->isDefaultCM = TRUE; cmP->isDefaultCompatCM = TRUE; } else if (imageType == java_awt_image_BufferedImage_TYPE_INT_ARGB_PRE || - imageType == java_awt_image_BufferedImage_TYPE_INT_RGB) { - cmP->isDefaultCompatCM = TRUE; - } else if (imageType == java_awt_image_BufferedImage_TYPE_INT_BGR || + imageType == java_awt_image_BufferedImage_TYPE_INT_RGB || + imageType == java_awt_image_BufferedImage_TYPE_INT_BGR || imageType == java_awt_image_BufferedImage_TYPE_4BYTE_ABGR || - imageType == java_awt_image_BufferedImage_TYPE_4BYTE_ABGR_PRE){ + imageType == java_awt_image_BufferedImage_TYPE_4BYTE_ABGR_PRE) + { cmP->isDefaultCompatCM = TRUE; } else { @@ -450,50 +519,25 @@ int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType, cmP->isDefaultCompatCM = cmP->isDefaultCM; } + /* check whether image attributes correspond to default cm */ if (cmP->isDefaultCompatCM) { - cmP->cmType = DIRECT_CM_TYPE; - cmP->nBits = (jint *) malloc(sizeof(jint)*4); - cmP->nBits[0] = cmP->nBits[1] = cmP->nBits[2] = cmP->nBits[3] = 8; - cmP->maxNbits = 8; - cmP->is_sRGB = TRUE; - cmP->csType = java_awt_color_ColorSpace_TYPE_RGB; + if (cmP->csType != java_awt_color_ColorSpace_TYPE_RGB || + !cmP->is_sRGB) + { + return -1; + } - return 1; - } - - jnBits = (*env)->GetObjectField(env, jcmodel, g_CMnBitsID); - if (jnBits == NULL) { - JNU_ThrowNullPointerException(env, "null nBits structure in CModel"); - return -1; - } - - cmP->nBits = NULL; - if (SAFE_TO_ALLOC_2(cmP->numComponents, sizeof(jint))) { - cmP->nBits = (jint *)malloc(cmP->numComponents * sizeof(jint)); - } - if (cmP->nBits == NULL){ - JNU_ThrowOutOfMemoryError(env, "Out of memory"); - return -1; - } - (*env)->GetIntArrayRegion(env, jnBits, 0, cmP->numComponents, - cmP->nBits); - cmP->maxNbits = 0; - for (i=0; i < cmP->numComponents; i++) { - if (cmP->maxNbits < cmP->nBits[i]) { - cmP->maxNbits = cmP->nBits[i]; + for (i = 0; i < cmP->numComponents; i++) { + if (cmP->nBits[i] != 8) { + return -1; + } } } - cmP->is_sRGB = (*env)->GetBooleanField(env, cmP->jcmodel, g_CMis_sRGBID); - - cmP->csType = (*env)->GetIntField(env, cmP->jcmodel, g_CMcsTypeID); - - /* Find out what type of colol model */ + /* Get index color model attributes */ if (imageType == java_awt_image_BufferedImage_TYPE_BYTE_INDEXED || - (*env)->IsInstanceOf(env, jcmodel, - (*env)->FindClass(env, "java/awt/image/IndexColorModel"))) + cmP->cmType == INDEX_CM_TYPE) { - cmP->cmType = INDEX_CM_TYPE; cmP->transIdx = (*env)->GetIntField(env, jcmodel, g_ICMtransIdxID); cmP->mapSize = (*env)->GetIntField(env, jcmodel, g_ICMmapSizeID); cmP->jrgb = (*env)->GetObjectField(env, jcmodel, g_ICMrgbID); @@ -519,31 +563,6 @@ int awt_parseColorModel (JNIEnv *env, jobject jcmodel, int imageType, } } } - else if ((*env)->IsInstanceOf(env, jcmodel, - (*env)->FindClass(env, "java/awt/image/PackedColorModel"))) - { - if ((*env)->IsInstanceOf(env, jcmodel, - (*env)->FindClass(env, "java/awt/image/DirectColorModel"))){ - cmP->cmType = DIRECT_CM_TYPE; - } - else { - cmP->cmType = PACKED_CM_TYPE; - } - } - else if ((*env)->IsInstanceOf(env, jcmodel, - (*env)->FindClass(env, "java/awt/image/ComponentColorModel"))) - { - cmP->cmType = COMPONENT_CM_TYPE; - } - else if ((*env)->IsInstanceOf(env, jcmodel, - (*env)->FindClass(env, "java/awt/image/PackedColorModel"))) - { - cmP->cmType = PACKED_CM_TYPE; - } - else { - cmP->cmType = UNKNOWN_CM_TYPE; - } - return 1; } @@ -648,6 +667,13 @@ setHints(JNIEnv *env, BufImageS_t *imageP) { ColorModelS_t *cmodelP = &imageP->cmodel; int imageType = imageP->imageType; + // check whether raster and color model are compatible + if (cmodelP->numComponents != rasterP->numBands) { + if (cmodelP->cmType != INDEX_CM_TYPE) { + return -1; + } + } + hintP->numChans = imageP->cmodel.numComponents; hintP->colorOrder = NULL; if (SAFE_TO_ALLOC_2(hintP->numChans, sizeof(int))) { @@ -1139,6 +1165,10 @@ int awt_setPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, jsm = (*env)->GetObjectField(env, rasterP->jraster, g_RasterSampleModelID); jdatabuffer = (*env)->GetObjectField(env, rasterP->jraster, g_RasterDataBufferID); + if (band >= numBands) { + JNU_ThrowInternalError(env, "Band out of range."); + return -1; + } /* Here is the generic code */ jdata = (*env)->NewIntArray(env, maxBytes*rasterP->numBands*maxLines); if (JNU_IsNull(env, jdata)) { @@ -1147,11 +1177,6 @@ int awt_setPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, } if (band >= 0) { int dOff; - if (band >= numBands) { - (*env)->DeleteLocalRef(env, jdata); - JNU_ThrowInternalError(env, "Band out of range."); - return -1; - } off = 0; for (y=0; y < h; y+=maxLines) { if (y+maxLines > h) { diff --git a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c index 5730734cefa..25764213888 100644 --- a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +++ b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c @@ -1152,22 +1152,131 @@ fprintf(stderr,"Flags : %d\n",dst->flags); return retStatus; } +typedef struct { + jobject jArray; + jsize length; + unsigned char *table; +} LookupArrayInfo; + +#define NLUT 8 + +#ifdef _LITTLE_ENDIAN +#define INDEXES { 3, 2, 1, 0, 7, 6, 5, 4 } +#else +#define INDEXES { 0, 1, 2, 3, 4, 5, 6, 7 } +#endif + +static int lookupShortData(mlib_image* src, mlib_image* dst, + LookupArrayInfo* lookup) +{ + int x, y; + unsigned int mask = NLUT-1; + + unsigned short* srcLine = (unsigned short*)src->data; + unsigned char* dstLine = (unsigned char*)dst->data; + + static int indexes[NLUT] = INDEXES; + + if (src->width != dst->width || src->height != dst->height) { + return 0; + } + + for (y=0; y < src->height; y++) { + int nloop, nx; + int npix = src->width; + + unsigned short* srcPixel = srcLine; + unsigned char* dstPixel = dstLine; + +#ifdef SIMPLE_LOOKUP_LOOP + for (x=0; status && x < width; x++) { + unsigned short s = *srcPixel++; + if (s >= lookup->length) { + /* we can not handle source image using + * byte lookup table. Fall back to processing + * images in java + */ + return 0; + } + *dstPixel++ = lookup->table[s]; + } +#else + /* Get to 32 bit-aligned point */ + while(((uintptr_t)dstPixel & 0x3) != 0 && npix>0) { + unsigned short s = *srcPixel++; + if (s >= lookup->length) { + return 0; + } + *dstPixel++ = lookup->table[s]; + npix--; + } + + /* + * Do NLUT pixels per loop iteration. + * Pack into ints and write out 2 at a time. + */ + nloop = npix/NLUT; + nx = npix%NLUT; + + for(x=nloop; x!=0; x--) { + int i = 0; + int* dstP = (int*)dstPixel; + + for (i = 0; i < NLUT; i++) { + if (srcPixel[i] >= lookup->length) { + return 0; + } + } + + dstP[0] = (int) + ((lookup->table[srcPixel[indexes[0]]] << 24) | + (lookup->table[srcPixel[indexes[1]]] << 16) | + (lookup->table[srcPixel[indexes[2]]] << 8) | + lookup->table[srcPixel[indexes[3]]]); + dstP[1] = (int) + ((lookup->table[srcPixel[indexes[4]]] << 24) | + (lookup->table[srcPixel[indexes[5]]] << 16) | + (lookup->table[srcPixel[indexes[6]]] << 8) | + lookup->table[srcPixel[indexes[7]]]); + + + dstPixel += NLUT; + srcPixel += NLUT; + } + + /* + * Complete any remaining pixels + */ + for(x=nx; x!=0; x--) { + unsigned short s = *srcPixel++; + if (s >= lookup->length) { + return 0; + } + *dstPixel++ = lookup->table[s]; + } +#endif + + dstLine += dst->stride; // array of bytes, scan stride in bytes + srcLine += src->stride / 2; // array of shorts, scan stride in bytes + } + return 1; +} + JNIEXPORT jint JNICALL -Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, +Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject thisLib, jobject jsrc, jobject jdst, jobjectArray jtableArrays) { mlib_image *src; mlib_image *dst; void *sdata, *ddata; - unsigned char **table; unsigned char **tbl; unsigned char lut[256]; int retStatus = 1; int i; mlib_status status; - int jlen; - jobject *jtable; + int lut_nbands; + LookupArrayInfo *jtable; BufImageS_t *srcImageP, *dstImageP; int nbands; int ncomponents; @@ -1193,12 +1302,39 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, return 0; } - jlen = (*env)->GetArrayLength(env, jtableArrays); + nbands = setImageHints(env, srcImageP, dstImageP, FALSE, TRUE, + FALSE, &hint); + + if (nbands < 1 || nbands > srcImageP->cmodel.numComponents) { + /* Can't handle any custom images */ + awt_freeParsedImage(srcImageP, TRUE); + awt_freeParsedImage(dstImageP, TRUE); + return 0; + } ncomponents = srcImageP->cmodel.isDefaultCompatCM ? 4 : srcImageP->cmodel.numComponents; + /* Make sure that color order can be used for + * re-ordering of lookup arrays. + */ + for (i = 0; i < nbands; i++) { + int idx = srcImageP->hints.colorOrder[i]; + + if (idx < 0 || idx >= ncomponents) { + awt_freeParsedImage(srcImageP, TRUE); + awt_freeParsedImage(dstImageP, TRUE); + return 0; + } + } + + lut_nbands = (*env)->GetArrayLength(env, jtableArrays); + + if (lut_nbands > ncomponents) { + lut_nbands = ncomponents; + } + tbl = NULL; if (SAFE_TO_ALLOC_2(ncomponents, sizeof(unsigned char *))) { tbl = (unsigned char **) @@ -1206,18 +1342,12 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, } jtable = NULL; - if (SAFE_TO_ALLOC_2(jlen, sizeof(jobject *))) { - jtable = (jobject *)malloc(jlen * sizeof (jobject *)); + if (SAFE_TO_ALLOC_2(lut_nbands, sizeof(LookupArrayInfo))) { + jtable = (LookupArrayInfo *)malloc(lut_nbands * sizeof (LookupArrayInfo)); } - table = NULL; - if (SAFE_TO_ALLOC_2(jlen, sizeof(unsigned char *))) { - table = (unsigned char **)malloc(jlen * sizeof(unsigned char *)); - } - - if (tbl == NULL || table == NULL || jtable == NULL) { + if (tbl == NULL || jtable == NULL) { if (tbl != NULL) free(tbl); - if (table != NULL) free(table); if (jtable != NULL) free(jtable); awt_freeParsedImage(srcImageP, TRUE); awt_freeParsedImage(dstImageP, TRUE); @@ -1225,11 +1355,21 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, return 0; } /* Need to grab these pointers before we lock down arrays */ - for (i=0; i < jlen; i++) { - jtable[i] = (*env)->GetObjectArrayElement(env, jtableArrays, i); - if (jtable[i] == NULL) { + for (i=0; i < lut_nbands; i++) { + jtable[i].jArray = (*env)->GetObjectArrayElement(env, jtableArrays, i); + + if (jtable[i].jArray != NULL) { + jtable[i].length = (*env)->GetArrayLength(env, jtable[i].jArray); + jtable[i].table = NULL; + + if (jtable[i].length < 256) { + /* we may read outside the table during lookup */ + jtable[i].jArray = NULL; + jtable[i].length = 0; + } + } + if (jtable[i].jArray == NULL) { free(tbl); - free(table); free(jtable); awt_freeParsedImage(srcImageP, TRUE); awt_freeParsedImage(dstImageP, TRUE); @@ -1237,23 +1377,10 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, } } - nbands = setImageHints(env, srcImageP, dstImageP, FALSE, TRUE, - FALSE, &hint); - if (nbands < 1) { - /* Can't handle any custom images */ - free(tbl); - free(table); - free(jtable); - awt_freeParsedImage(srcImageP, TRUE); - awt_freeParsedImage(dstImageP, TRUE); - return 0; - } - /* Allocate the arrays */ if (allocateArray(env, srcImageP, &src, &sdata, TRUE, FALSE, FALSE) < 0) { /* Must be some problem */ free(tbl); - free(table); free(jtable); awt_freeParsedImage(srcImageP, TRUE); awt_freeParsedImage(dstImageP, TRUE); @@ -1262,7 +1389,6 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, if (allocateArray(env, dstImageP, &dst, &ddata, FALSE, FALSE, FALSE) < 0) { /* Must be some problem */ free(tbl); - free(table); free(jtable); freeArray(env, srcImageP, src, sdata, NULL, NULL, NULL); awt_freeParsedImage(srcImageP, TRUE); @@ -1278,7 +1404,7 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, * sufficient number of lookup arrays we add references to identity * lookup array to make medialib happier. */ - if (jlen < ncomponents) { + if (lut_nbands < ncomponents) { int j; /* REMIND: This should be the size of the input lut!! */ for (j=0; j < 256; j++) { @@ -1287,65 +1413,45 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, for (j=0; j < ncomponents; j++) { tbl[j] = lut; } - } - for (i=0; i < jlen; i++) { - table[i] = (unsigned char *) - (*env)->GetPrimitiveArrayCritical(env, jtable[i], NULL); - if (table[i] == NULL) { + for (i=0; i < lut_nbands; i++) { + jtable[i].table = (unsigned char *) + (*env)->GetPrimitiveArrayCritical(env, jtable[i].jArray, NULL); + if (jtable[i].table == NULL) { /* Free what we've got so far. */ int j; for (j = 0; j < i; j++) { (*env)->ReleasePrimitiveArrayCritical(env, - jtable[j], - (jbyte *) table[j], + jtable[j].jArray, + (jbyte *) jtable[j].table, JNI_ABORT); } free(tbl); - free(table); free(jtable); freeArray(env, srcImageP, src, sdata, NULL, NULL, NULL); awt_freeParsedImage(srcImageP, TRUE); awt_freeParsedImage(dstImageP, TRUE); return 0; } - tbl[srcImageP->hints.colorOrder[i]] = table[i]; + tbl[srcImageP->hints.colorOrder[i]] = jtable[i].table; } - if (jlen == 1) { + if (lut_nbands == 1) { for (i=1; i < nbands - srcImageP->cmodel.supportsAlpha; i++) { - tbl[srcImageP->hints.colorOrder[i]] = table[0]; + tbl[srcImageP->hints.colorOrder[i]] = jtable[0].table; } } /* Mlib needs 16bit lookuptable and must be signed! */ if (src->type == MLIB_SHORT) { - unsigned short *sdataP = (unsigned short *) src->data; - unsigned short *sP; if (dst->type == MLIB_BYTE) { - unsigned char *cdataP = (unsigned char *) dst->data; - unsigned char *cP; if (nbands > 1) { retStatus = 0; } else { - int x, y; - for (y=0; y < src->height; y++) { - cP = cdataP; - sP = sdataP; - for (x=0; x < src->width; x++) { - *cP++ = table[0][*sP++]; - } - - /* - * 4554571: increment pointers using the scanline stride - * in pixel units (not byte units) - */ - cdataP += dstImageP->raster.scanlineStride; - sdataP += srcImageP->raster.scanlineStride; - } + retStatus = lookupShortData(src, dst, &jtable[0]); } } /* How about ddata == null? */ @@ -1370,12 +1476,11 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, } /* Release the LUT */ - for (i=0; i < jlen; i++) { - (*env)->ReleasePrimitiveArrayCritical(env, jtable[i], - (jbyte *) table[i], JNI_ABORT); + for (i=0; i < lut_nbands; i++) { + (*env)->ReleasePrimitiveArrayCritical(env, jtable[i].jArray, + (jbyte *) jtable[i].table, JNI_ABORT); } free ((void *) jtable); - free ((void *) table); free ((void *) tbl); /* Release the pinned memory */ @@ -1389,7 +1494,6 @@ Java_sun_awt_image_ImagingLib_lookupByteBI(JNIEnv *env, jobject this, return retStatus; } - JNIEXPORT jint JNICALL Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, jobject this, @@ -1403,8 +1507,8 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, mlib_image* dst; void* sdata; void* ddata; - jobject jtable[4]; - unsigned char* table[4]; + LookupArrayInfo jtable[4]; + unsigned char* mlib_lookupTable[4]; int i; int retStatus = 1; mlib_status status; @@ -1452,6 +1556,11 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, src_nbands = srcRasterP->numBands; dst_nbands = dstRasterP->numBands; + /* adjust number of lookup bands */ + if (lut_nbands > src_nbands) { + lut_nbands = src_nbands; + } + /* MediaLib can't do more than 4 bands */ if (src_nbands <= 0 || src_nbands > 4 || dst_nbands <= 0 || dst_nbands > 4 || @@ -1516,22 +1625,37 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, /* Get references to the lookup table arrays */ /* Need to grab these pointers before we lock down arrays */ for (i=0; i < lut_nbands; i++) { - jtable[i] = (*env)->GetObjectArrayElement(env, jtableArrays, i); - if (jtable[i] == NULL) { + jtable[i].jArray = (*env)->GetObjectArrayElement(env, jtableArrays, i); + jtable[i].table = NULL; + if (jtable[i].jArray != NULL) { + jtable[i].length = (*env)->GetArrayLength(env, jtable[i].jArray); + if (jtable[i].length < 256) { + /* we may read outside the table during lookup */ + jtable[i].jArray = NULL; + } + } + + if (jtable[i].jArray == NULL) + { + freeDataArray(env, srcRasterP->jdata, src, sdata, + dstRasterP->jdata, dst, ddata); + + awt_freeParsedRaster(srcRasterP, TRUE); + awt_freeParsedRaster(dstRasterP, TRUE); return 0; } } for (i=0; i < lut_nbands; i++) { - table[i] = (unsigned char *) - (*env)->GetPrimitiveArrayCritical(env, jtable[i], NULL); - if (table[i] == NULL) { + jtable[i].table = (unsigned char *) + (*env)->GetPrimitiveArrayCritical(env, jtable[i].jArray, NULL); + if (jtable[i].table == NULL) { /* Free what we've got so far. */ int j; for (j = 0; j < i; j++) { (*env)->ReleasePrimitiveArrayCritical(env, - jtable[j], - (jbyte *) table[j], + jtable[j].jArray, + (jbyte *) jtable[j].table, JNI_ABORT); } freeDataArray(env, srcRasterP->jdata, src, sdata, @@ -1540,6 +1664,7 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, awt_freeParsedRaster(dstRasterP, TRUE); return 0; } + mlib_lookupTable[i] = jtable[i].table; } /* @@ -1548,107 +1673,28 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, * contains single lookup array. */ for (i = lut_nbands; i < src_nbands; i++) { - table[i] = table[0]; + mlib_lookupTable[i] = jtable[0].table; } /* * Setup lookup array for "extra" channels */ for ( ; i < src->channels; i++) { - table[i] = ilut; + mlib_lookupTable[i] = ilut; } -#define NLUT 8 /* Mlib needs 16bit lookuptable and must be signed! */ if (src->type == MLIB_SHORT) { - unsigned short *sdataP = (unsigned short *) src->data; - unsigned short *sP; if (dst->type == MLIB_BYTE) { - unsigned char *cdataP = (unsigned char *) dst->data; - unsigned char *cP; if (lut_nbands > 1) { retStatus = 0; } else { - int x, y; - unsigned int mask = NLUT-1; - unsigned char* pLut = table[0]; - unsigned int endianTest = 0xff000000; - for (y=0; y < src->height; y++) { - int nloop, nx; - unsigned short* srcP; - int* dstP; - int npix = src->width; - cP = cdataP; - sP = sdataP; - /* Get to 32 bit-aligned point */ - while(((uintptr_t)cP & 0x3) != 0 && npix>0) { - *cP++ = pLut[*sP++]; - npix--; - } - - /* - * Do NLUT pixels per loop iteration. - * Pack into ints and write out 2 at a time. - */ - nloop = npix/NLUT; - nx = npix%NLUT; - srcP = sP; - dstP = (int*)cP; - - if(((char*)(&endianTest))[0] != 0) { - /* Big endian loop */ - for(x=nloop; x!=0; x--) { - dstP[0] = (int) - ((pLut[srcP[0]] << 24) | - (pLut[srcP[1]] << 16) | - (pLut[srcP[2]] << 8) | - pLut[srcP[3]]); - dstP[1] = (int) - ((pLut[srcP[4]] << 24) | - (pLut[srcP[5]] << 16) | - (pLut[srcP[6]] << 8) | - pLut[srcP[7]]); - dstP += NLUT/4; - srcP += NLUT; - } - } else { - /* Little endian loop */ - for(x=nloop; x!=0; x--) { - dstP[0] = (int) - ((pLut[srcP[3]] << 24) | - (pLut[srcP[2]] << 16) | - (pLut[srcP[1]] << 8) | - pLut[srcP[0]]); - dstP[1] = (int) - ((pLut[srcP[7]] << 24) | - (pLut[srcP[6]] << 16) | - (pLut[srcP[5]] << 8) | - pLut[srcP[4]]); - dstP += NLUT/4; - srcP += NLUT; - } - } - /* - * Complete any remaining pixels - */ - cP = cP + NLUT * nloop; - sP = sP + NLUT * nloop; - for(x=nx; x!=0; x--) { - *cP++ = pLut[*sP++]; - } - - /* - * 4554571: increment pointers using the scanline stride - * in pixel units (not byte units) - */ - cdataP += dstRasterP->scanlineStride; - sdataP += srcRasterP->scanlineStride; - } + retStatus = lookupShortData(src, dst, &jtable[0]); } } /* How about ddata == null? */ } else if ((status = (*sMlibFns[MLIB_LOOKUP].fptr)(dst, src, - (void **)table) != MLIB_SUCCESS)) { + (void **)mlib_lookupTable) != MLIB_SUCCESS)) { printMedialibError(status); retStatus = 0; } @@ -1677,8 +1723,8 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, /* Release the LUT */ for (i=0; i < lut_nbands; i++) { - (*env)->ReleasePrimitiveArrayCritical(env, jtable[i], - (jbyte *) table[i], JNI_ABORT); + (*env)->ReleasePrimitiveArrayCritical(env, jtable[i].jArray, + (jbyte *) jtable[i].table, JNI_ABORT); } /* Release the pinned memory */ @@ -2558,6 +2604,41 @@ storeDstArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, return 0; } +#define ERR_BAD_IMAGE_LAYOUT (-2) + +#define CHECK_DST_ARRAY(start_offset, elements_per_pixel) \ + do { \ + int offset = (start_offset); \ + int lastScanOffset; \ + \ + if (!SAFE_TO_MULT(rasterP->scanlineStride, \ + (rasterP->height - 1))) \ + { \ + return ERR_BAD_IMAGE_LAYOUT; \ + } \ + lastScanOffset = rasterP->scanlineStride * \ + (rasterP->height - 1); \ + \ + if (!SAFE_TO_ADD(offset, lastScanOffset)) { \ + return ERR_BAD_IMAGE_LAYOUT; \ + } \ + lastScanOffset += offset; \ + \ + if (!SAFE_TO_MULT((elements_per_pixel), rasterP->width)) { \ + return ERR_BAD_IMAGE_LAYOUT; \ + } \ + offset = (elements_per_pixel) * rasterP->width; \ + \ + if (!SAFE_TO_ADD(offset, lastScanOffset)) { \ + return ERR_BAD_IMAGE_LAYOUT; \ + } \ + lastScanOffset += offset; \ + \ + if (dataArrayLength < lastScanOffset) { \ + return ERR_BAD_IMAGE_LAYOUT; \ + } \ + } while(0); \ + static int storeImageArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, mlib_image *mlibImP) { @@ -2565,6 +2646,7 @@ storeImageArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, unsigned char *cmDataP, *dataP, *cDataP; HintS_t *hintP = &dstP->hints; RasterS_t *rasterP = &dstP->raster; + jsize dataArrayLength = (*env)->GetArrayLength(env, rasterP->jdata); int y; /* REMIND: Store mlib data type? */ @@ -2583,14 +2665,15 @@ storeImageArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, if (hintP->packing == BYTE_INTERLEAVED) { /* Write it back to the destination */ + CHECK_DST_ARRAY(hintP->channelOffset, hintP->numChans); cmDataP = (unsigned char *) mlib_ImageGetData(mlibImP); mStride = mlib_ImageGetStride(mlibImP); dataP = (unsigned char *)(*env)->GetPrimitiveArrayCritical(env, rasterP->jdata, NULL); if (dataP == NULL) return 0; - cDataP = dataP + hintP->dataOffset; + cDataP = dataP + hintP->channelOffset; for (y=0; y < rasterP->height; - y++, cmDataP += mStride, cDataP += hintP->sStride) + y++, cmDataP += mStride, cDataP += rasterP->scanlineStride) { memcpy(cDataP, cmDataP, rasterP->width*hintP->numChans); } @@ -2601,13 +2684,14 @@ storeImageArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, /* Write it back to the destination */ unsigned short *sdataP, *sDataP; unsigned short *smDataP = (unsigned short *)mlib_ImageGetData(mlibImP); + CHECK_DST_ARRAY(hintP->channelOffset, hintP->numChans); mStride = mlib_ImageGetStride(mlibImP); sdataP = (unsigned short *)(*env)->GetPrimitiveArrayCritical(env, rasterP->jdata, NULL); if (sdataP == NULL) return -1; - sDataP = sdataP + hintP->dataOffset; + sDataP = sdataP + hintP->channelOffset; for (y=0; y < rasterP->height; - y++, smDataP += mStride, sDataP += hintP->sStride) + y++, smDataP += mStride, sDataP += rasterP->scanlineStride) { memcpy(sDataP, smDataP, rasterP->width*hintP->numChans); } @@ -3400,7 +3484,8 @@ static int setPackedBCR(JNIEnv *env, RasterS_t *rasterP, int component, unsigned char *inP = inDataP; unsigned char *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned char *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; if (rasterP->numBands > MAX_NUMBANDS) { @@ -3409,11 +3494,18 @@ static int setPackedBCR(JNIEnv *env, RasterS_t *rasterP, int component, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_BCRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned char *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { @@ -3468,7 +3560,8 @@ static int setPackedSCR(JNIEnv *env, RasterS_t *rasterP, int component, unsigned char *inP = inDataP; unsigned short *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned short *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; if (rasterP->numBands > MAX_NUMBANDS) { @@ -3477,11 +3570,18 @@ static int setPackedSCR(JNIEnv *env, RasterS_t *rasterP, int component, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_SCRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned short *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { @@ -3536,7 +3636,8 @@ static int setPackedICR(JNIEnv *env, RasterS_t *rasterP, int component, unsigned char *inP = inDataP; unsigned int *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned int *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; if (rasterP->numBands > MAX_NUMBANDS) { @@ -3545,11 +3646,18 @@ static int setPackedICR(JNIEnv *env, RasterS_t *rasterP, int component, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_ICRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned int *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { @@ -3606,7 +3714,8 @@ static int setPackedBCRdefault(JNIEnv *env, RasterS_t *rasterP, unsigned char *inP = inDataP; unsigned char *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned char *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; int a = rasterP->numBands - 1; @@ -3616,11 +3725,18 @@ static int setPackedBCRdefault(JNIEnv *env, RasterS_t *rasterP, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_BCRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned char *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { @@ -3696,7 +3812,8 @@ static int setPackedSCRdefault(JNIEnv *env, RasterS_t *rasterP, unsigned char *inP = inDataP; unsigned short *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned short *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; int a = rasterP->numBands - 1; @@ -3706,11 +3823,17 @@ static int setPackedSCRdefault(JNIEnv *env, RasterS_t *rasterP, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_SCRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned short *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { @@ -3786,7 +3909,8 @@ static int setPackedICRdefault(JNIEnv *env, RasterS_t *rasterP, unsigned char *inP = inDataP; unsigned int *lineOutP, *outP; jarray jOutDataP; - jint *outDataP; + jsize dataArrayLength; + unsigned int *outDataP; int loff[MAX_NUMBANDS], roff[MAX_NUMBANDS]; int a = rasterP->numBands - 1; @@ -3796,11 +3920,18 @@ static int setPackedICRdefault(JNIEnv *env, RasterS_t *rasterP, /* Grab data ptr, strides, offsets from raster */ jOutDataP = (*env)->GetObjectField(env, rasterP->jraster, g_ICRdataID); + if (JNU_IsNull(env, jOutDataP)) { + return -1; + } + + dataArrayLength = (*env)->GetArrayLength(env, jOutDataP); + CHECK_DST_ARRAY(rasterP->chanOffsets[0], 1); + outDataP = (*env)->GetPrimitiveArrayCritical(env, jOutDataP, 0); if (outDataP == NULL) { return -1; } - lineOutP = (unsigned int *)outDataP + rasterP->chanOffsets[0]; + lineOutP = outDataP + rasterP->chanOffsets[0]; if (component < 0) { for (c=0; c < rasterP->numBands; c++) { diff --git a/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c b/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c index 97caaa4bf43..8c067cc3e94 100644 --- a/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c +++ b/jdk/src/share/native/sun/awt/medialib/mlib_ImageCreate.c @@ -160,27 +160,46 @@ mlib_image* mlib_ImageSet(mlib_image *image, /* Check if stride == width * If it is then image can be treated as a 1-D vector */ + + if (!SAFE_TO_MULT(width, channels)) { + return NULL; + } + + wb = width * channels; + switch (type) { case MLIB_DOUBLE: - wb = width * channels * 8; + if (!SAFE_TO_MULT(wb, 8)) { + return NULL; + } + wb *= 8; mask = 7; break; case MLIB_FLOAT: case MLIB_INT: - wb = width * channels * 4; + if (!SAFE_TO_MULT(wb, 4)) { + return NULL; + } + wb *= 4; mask = 3; break; case MLIB_USHORT: case MLIB_SHORT: - wb = width * channels * 2; + if (!SAFE_TO_MULT(wb, 2)) { + return NULL; + } + wb *= 2; mask = 1; break; case MLIB_BYTE: - wb = width * channels; + // wb is ready mask = 0; break; case MLIB_BIT: - wb = (width * channels + 7) / 8; + if (!SAFE_TO_ADD(7, wb)) { + return NULL; + } + wb = (wb + 7) / 8; mask = 0; break; default: @@ -270,7 +289,7 @@ mlib_image *mlib_ImageCreate(mlib_type type, break; case MLIB_USHORT: case MLIB_SHORT: - if (!SAFE_TO_MULT(wb, 4)) { + if (!SAFE_TO_MULT(wb, 2)) { return NULL; } wb *= 2; diff --git a/jdk/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c b/jdk/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c index 2d5cdc1c509..f6cc52c0396 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c +++ b/jdk/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c @@ -26,6 +26,7 @@ #include "splashscreen_impl.h" #include #include +#include JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM * vm, void *reserved) @@ -57,7 +58,7 @@ Java_java_awt_SplashScreen__1update(JNIEnv * env, jclass thisClass, if (splash->overlayData) { free(splash->overlayData); } - splash->overlayData = malloc(dataSize * sizeof(rgbquad_t)); + splash->overlayData = SAFE_SIZE_ARRAY_ALLOC(malloc, dataSize, sizeof(rgbquad_t)); if (splash->overlayData) { /* we need a copy anyway, so we'll be using GetIntArrayRegion */ (*env)->GetIntArrayRegion(env, data, 0, dataSize, diff --git a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c index 1fc081e6d72..e986bac6f33 100644 --- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c +++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_gif.c @@ -28,6 +28,8 @@ #include +#include "sizecalc.h" + #define GIF_TRANSPARENT 0x01 #define GIF_USER_INPUT 0x02 #define GIF_DISPOSE_MASK 0x07 @@ -120,7 +122,7 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) splash->height = gif->SHeight; splash->frameCount = gif->ImageCount; splash->frames = (SplashImage *) - malloc(sizeof(SplashImage) * gif->ImageCount); + SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(SplashImage), gif->ImageCount); if (!splash->frames) { free(pBitmapBits); free(pOldBitmapBits); @@ -254,7 +256,7 @@ SplashDecodeGif(Splash * splash, GifFileType * gif) // now dispose of the previous frame correctly splash->frames[imageIndex].bitmapBits = - (rgbquad_t *) malloc(bufferSize); + (rgbquad_t *) malloc(bufferSize); // bufferSize is safe (checked above) if (!splash->frames[imageIndex].bitmapBits) { free(pBitmapBits); free(pOldBitmapBits); diff --git a/jdk/src/share/native/sun/font/freetypeScaler.c b/jdk/src/share/native/sun/font/freetypeScaler.c index 591bb382f9b..e84e77c4207 100644 --- a/jdk/src/share/native/sun/font/freetypeScaler.c +++ b/jdk/src/share/native/sun/font/freetypeScaler.c @@ -1351,17 +1351,22 @@ Java_sun_font_FreetypeFontScaler_getGlyphVectorOutlineNative( FTScalerInfo *scalerInfo = (FTScalerInfo*) jlong_to_ptr(pScaler); - glyphs = (jint*) malloc(numGlyphs*sizeof(jint)); + glyphs = NULL; + if (numGlyphs > 0 && 0xffffffffu / sizeof(jint) >= numGlyphs) { + glyphs = (jint*) malloc(numGlyphs*sizeof(jint)); + } if (glyphs == NULL) { + // We reach here if: + // 1. numGlyphs <= 0, + // 2. overflow check failed, or + // 3. malloc failed. gp = (*env)->NewObject(env, sunFontIDs.gpClass, sunFontIDs.gpCtrEmpty); - if (!isNullScalerContext(context) && scalerInfo != NULL) { - invalidateJavaScaler(env, scaler, scalerInfo); - } return gp; } (*env)->GetIntArrayRegion(env, glyphArray, 0, numGlyphs, glyphs); + gpdata.numCoords = 0; for (i=0; i= INVISIBLE_GLYPHS) { continue; diff --git a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp index 5446f9bebac..8711f63483f 100644 --- a/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp @@ -218,6 +218,9 @@ le_uint32 ContextualSubstitutionFormat1Subtable::process(const LookupProcessor * LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { le_uint16 srSetCount = SWAPW(subRuleSetCount); @@ -267,6 +270,9 @@ le_uint32 ContextualSubstitutionFormat2Subtable::process(const LookupProcessor * LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { const ClassDefinitionTable *classDefinitionTable = @@ -395,6 +401,9 @@ le_uint32 ChainingContextualSubstitutionFormat1Subtable::process(const LookupPro LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { le_uint16 srSetCount = SWAPW(chainSubRuleSetCount); @@ -466,6 +475,9 @@ le_uint32 ChainingContextualSubstitutionFormat2Subtable::process(const LookupPro LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { const ClassDefinitionTable *backtrackClassDefinitionTable = diff --git a/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp b/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp index ff8ac3bed76..5d338e85fd2 100644 --- a/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp @@ -45,7 +45,7 @@ le_uint32 CursiveAttachmentSubtable::process(const LEReferenceTo= eeCount) { + if (coverageIndex < 0 || coverageIndex >= eeCount || LE_FAILURE(success)) { glyphIterator->setCursiveGlyph(); return 0; } diff --git a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp index 76d945d02d0..81056db9c91 100644 --- a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp @@ -44,10 +44,10 @@ U_NAMESPACE_BEGIN #define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1))) // FIXME: should look at the format too... maybe have a sub-class for it? -le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, +le_uint32 ExtensionSubtable::process(const LEReferenceTo &thisRef, + const LookupProcessor *lookupProcessor, le_uint16 lookupType, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const { - const LEReferenceTo thisRef(lookupProcessor->getReference(), success); // create a reference to this if (LE_FAILURE(success)) { return 0; @@ -57,7 +57,7 @@ le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_ if (elt != lookupType) { le_uint32 extOffset = READ_LONG(extensionOffset); - LEReferenceTo subtable(thisRef, success, extOffset); + LEReferenceTo subtable(thisRef, success, extOffset); if(LE_SUCCESS(success)) { return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success); diff --git a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h index 47476fc984b..d629ade7afa 100644 --- a/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h +++ b/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h @@ -52,7 +52,8 @@ struct ExtensionSubtable //: GlyphSubstitutionSubtable le_uint16 extensionLookupType; le_uint32 extensionOffset; - le_uint32 process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, + le_uint32 process(const LEReferenceTo &extRef, + const LookupProcessor *lookupProcessor, le_uint16 lookupType, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; }; diff --git a/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp b/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp index d0cd46732ed..3ccf66fdc60 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphIterator.cpp @@ -66,6 +66,7 @@ GlyphIterator::GlyphIterator(LEGlyphStorage &theGlyphStorage, GlyphPositionAdjus nextLimit = -1; prevLimit = glyphCount; } + filterResetCache(); } GlyphIterator::GlyphIterator(GlyphIterator &that) @@ -84,6 +85,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that) glyphGroup = that.glyphGroup; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; + filterResetCache(); } GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask) @@ -102,6 +104,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that, FeatureMask newFeatureMask) glyphGroup = 0; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; + filterResetCache(); } GlyphIterator::GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags) @@ -120,6 +123,7 @@ GlyphIterator::GlyphIterator(GlyphIterator &that, le_uint16 newLookupFlags) glyphGroup = that.glyphGroup; glyphClassDefinitionTable = that.glyphClassDefinitionTable; markAttachClassDefinitionTable = that.markAttachClassDefinitionTable; + filterResetCache(); } GlyphIterator::~GlyphIterator() @@ -133,6 +137,7 @@ void GlyphIterator::reset(le_uint16 newLookupFlags, FeatureMask newFeatureMask) featureMask = newFeatureMask; glyphGroup = 0; lookupFlags = newLookupFlags; + filterResetCache(); } LEGlyphID *GlyphIterator::insertGlyphs(le_int32 count, LEErrorCode& success) @@ -381,53 +386,68 @@ void GlyphIterator::setCursiveGlyph() glyphPositionAdjustments->setCursiveGlyph(position, baselineIsLogicalEnd()); } -le_bool GlyphIterator::filterGlyph(le_uint32 index) const -{ - LEErrorCode success = LE_NO_ERROR; - LEGlyphID glyphID = glyphStorage[index]; - le_int32 glyphClass = gcdNoGlyphClass; - - if (LE_GET_GLYPH(glyphID) >= 0xFFFE) { - return TRUE; +void GlyphIterator::filterResetCache(void) { + filterCacheValid = FALSE; } +le_bool GlyphIterator::filterGlyph(le_uint32 index) +{ + LEGlyphID glyphID = glyphStorage[index]; + + if (!filterCacheValid || filterCache.id != glyphID) { + filterCache.id = glyphID; + + le_bool &filterResult = filterCache.result; // NB: Making this a reference to accept the updated value, in case + // we want more fancy cacheing in the future. + if (LE_GET_GLYPH(glyphID) >= 0xFFFE) { + filterResult = TRUE; + } else { + LEErrorCode success = LE_NO_ERROR; + le_int32 glyphClass = gcdNoGlyphClass; if (glyphClassDefinitionTable.isValid()) { glyphClass = glyphClassDefinitionTable->getGlyphClass(glyphClassDefinitionTable, glyphID, success); } - - switch (glyphClass) - { + switch (glyphClass) { case gcdNoGlyphClass: - return FALSE; + filterResult = FALSE; + break; case gcdSimpleGlyph: - return (lookupFlags & lfIgnoreBaseGlyphs) != 0; + filterResult = (lookupFlags & lfIgnoreBaseGlyphs) != 0; + break; case gcdLigatureGlyph: - return (lookupFlags & lfIgnoreLigatures) != 0; + filterResult = (lookupFlags & lfIgnoreLigatures) != 0; + break; case gcdMarkGlyph: - { if ((lookupFlags & lfIgnoreMarks) != 0) { - return TRUE; - } - + filterResult = TRUE; + } else { le_uint16 markAttachType = (lookupFlags & lfMarkAttachTypeMask) >> lfMarkAttachTypeShift; if ((markAttachType != 0) && (markAttachClassDefinitionTable.isValid())) { - return markAttachClassDefinitionTable - -> getGlyphClass(markAttachClassDefinitionTable, glyphID, success) != markAttachType; + filterResult = (markAttachClassDefinitionTable + -> getGlyphClass(markAttachClassDefinitionTable, glyphID, success) != markAttachType); + } else { + filterResult = FALSE; } - - return FALSE; } + break; case gcdComponentGlyph: - return (lookupFlags & lfIgnoreBaseGlyphs) != 0; + filterResult = ((lookupFlags & lfIgnoreBaseGlyphs) != 0); + break; default: - return FALSE; + filterResult = FALSE; + break; } + } + filterCacheValid = TRUE; + } + + return filterCache.result; } le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup) const diff --git a/jdk/src/share/native/sun/font/layout/GlyphIterator.h b/jdk/src/share/native/sun/font/layout/GlyphIterator.h index d8db62a1298..666b94dbcf3 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphIterator.h +++ b/jdk/src/share/native/sun/font/layout/GlyphIterator.h @@ -98,7 +98,7 @@ public: le_int32 applyInsertions(); private: - le_bool filterGlyph(le_uint32 index) const; + le_bool filterGlyph(le_uint32 index); le_bool hasFeatureTag(le_bool matchGroup) const; le_bool nextInternal(le_uint32 delta = 1); le_bool prevInternal(le_uint32 delta = 1); @@ -121,6 +121,14 @@ private: LEReferenceTo markAttachClassDefinitionTable; GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class + + struct { + LEGlyphID id; + le_bool result; + } filterCache; + le_bool filterCacheValid; + + void filterResetCache(void); }; U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp index 08b6c048e91..9c6666d47a9 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp @@ -168,7 +168,7 @@ le_uint32 GlyphPositioningLookupProcessor::applySubtable(const LEReferenceTo subtable(lookupSubtable, success); - delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); + delta = subtable->process(subtable, this, lookupType, glyphIterator, fontInstance, success); break; } diff --git a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp index d7b65aa8660..d4fe59075fa 100644 --- a/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp +++ b/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp @@ -139,7 +139,7 @@ le_uint32 GlyphSubstitutionLookupProcessor::applySubtable(const LEReferenceTo subtable(lookupSubtable, success); - delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); + delta = subtable->process(subtable, this, lookupType, glyphIterator, fontInstance, success); break; } diff --git a/jdk/src/share/native/sun/font/layout/KernTable.cpp b/jdk/src/share/native/sun/font/layout/KernTable.cpp index 13ddd0f3b32..2d946513fb8 100644 --- a/jdk/src/share/native/sun/font/layout/KernTable.cpp +++ b/jdk/src/share/native/sun/font/layout/KernTable.cpp @@ -96,7 +96,7 @@ LE_CORRECT_SIZE(KernTableHeader, KERN_TABLE_HEADER_SIZE) * TODO: respect header flags */ KernTable::KernTable(const LETableReference& base, LEErrorCode &success) - : pairs(), pairsSwapped(NULL), fTable(base) + : pairsSwapped(NULL), fTable(base) { if(LE_FAILURE(success) || (fTable.isEmpty())) { #if DEBUG @@ -143,32 +143,36 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success) #endif if(LE_SUCCESS(success) && nPairs>0) { - // pairs is an instance member, and table is on the stack. - // set 'pairs' based on table.getAlias(). This will range check it. + // pairsSwapped is an instance member, and table is on the stack. + // set 'pairsSwapped' based on table.getAlias(). This will range check it. - pairs = LEReferenceToArrayOf(fTable, // based on overall table - success, - (const PairInfo*)table.getAlias(), // subtable 0 + .. - KERN_SUBTABLE_0_HEADER_SIZE, // .. offset of header size - nPairs); // count - } - if (LE_SUCCESS(success) && pairs.isValid()) { - pairsSwapped = (PairInfo*)(malloc(nPairs*sizeof(PairInfo))); - PairInfo *p = (PairInfo*)pairsSwapped; - for (int i = 0; LE_SUCCESS(success) && i < nPairs; i++, p++) { - memcpy(p, pairs.getAlias(i,success), KERN_PAIRINFO_SIZE); - p->key = SWAPL(p->key); + pairsSwapped = (PairInfo*)(fTable.getFont()->getKernPairs()); + if (pairsSwapped == NULL) { + LEReferenceToArrayOfpairs = + LEReferenceToArrayOf(fTable, // based on overall table + success, + (const PairInfo*)table.getAlias(), // subtable 0 + .. + KERN_SUBTABLE_0_HEADER_SIZE, // .. offset of header size + nPairs); // count + if (LE_SUCCESS(success) && pairs.isValid()) { + pairsSwapped = (PairInfo*)(malloc(nPairs*sizeof(PairInfo))); + PairInfo *p = (PairInfo*)pairsSwapped; + for (int i = 0; LE_SUCCESS(success) && i < nPairs; i++, p++) { + memcpy(p, pairs.getAlias(i,success), KERN_PAIRINFO_SIZE); + p->key = SWAPL(p->key); + } + fTable.getFont()->setKernPairs((void*)pairsSwapped); // store it } - fTable.getFont()->setKernPairs((void*)pairsSwapped); // store it + } } #if 0 - fprintf(stderr, "coverage: %0.4x nPairs: %d pairs %p\n", coverage, nPairs, pairs.getAlias()); + fprintf(stderr, "coverage: %0.4x nPairs: %d pairs %p\n", coverage, nPairs, pairsSwapped); fprintf(stderr, " searchRange: %d entrySelector: %d rangeShift: %d\n", searchRange, entrySelector, rangeShift); fprintf(stderr, "[[ ignored font table entries: range %d selector %d shift %d ]]\n", SWAPW(table->searchRange), SWAPW(table->entrySelector), SWAPW(table->rangeShift)); #endif #if DEBUG - fprintf(stderr, "coverage: %0.4x nPairs: %d pairs 0x%x\n", coverage, nPairs, pairs); + fprintf(stderr, "coverage: %0.4x nPairs: %d pairs 0x%x\n", coverage, nPairs, pairsSwapped); fprintf(stderr, " searchRange(pairs): %d entrySelector: %d rangeShift(pairs): %d\n", searchRange, entrySelector, rangeShift); @@ -182,7 +186,7 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success) ids[id] = (char)i; } } - PairInfo *p = pairs; + PairInfo *p = pairsSwapped; for (int i = 0; i < nPairs; ++i, p++) { le_uint32 k = p->key; le_uint16 left = (k >> 16) & 0xffff; diff --git a/jdk/src/share/native/sun/font/layout/KernTable.h b/jdk/src/share/native/sun/font/layout/KernTable.h index 1cc4f872d3b..c667a18c056 100644 --- a/jdk/src/share/native/sun/font/layout/KernTable.h +++ b/jdk/src/share/native/sun/font/layout/KernTable.h @@ -57,7 +57,6 @@ class U_LAYOUT_API KernTable private: le_uint16 coverage; le_uint16 nPairs; - LEReferenceToArrayOf pairs; PairInfo *pairsSwapped; const LETableReference &fTable; le_uint16 searchRange; diff --git a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp index be5f0831b8e..e9172f2150f 100644 --- a/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp +++ b/jdk/src/share/native/sun/font/layout/LEGlyphStorage.cpp @@ -584,7 +584,7 @@ le_int32 LEGlyphStorage::applyInsertions() { le_int32 growAmount = fInsertionList->getGrowAmount(); - if (growAmount == 0) { + if (growAmount <= 0) { return fGlyphCount; } @@ -613,7 +613,9 @@ le_int32 LEGlyphStorage::applyInsertions() fAuxData = (le_uint32 *)newAuxData; } - fSrcIndex = fGlyphCount - 1; + if (fGlyphCount > 0) { + fSrcIndex = fGlyphCount - 1; + } fDestIndex = newGlyphCount - 1; #if 0 @@ -653,6 +655,10 @@ le_bool LEGlyphStorage::applyInsertion(le_int32 atPosition, le_int32 count, LEGl } #endif + if (atPosition < 0 || fSrcIndex < 0 || fDestIndex < 0) { + return FALSE; + } + if (fAuxData != NULL) { le_int32 src = fSrcIndex, dest = fDestIndex; @@ -665,7 +671,7 @@ le_bool LEGlyphStorage::applyInsertion(le_int32 atPosition, le_int32 count, LEGl } } - while (fSrcIndex > atPosition) { + while (fSrcIndex > atPosition && fSrcIndex >= 0 && fDestIndex >= 0) { fGlyphs[fDestIndex] = fGlyphs[fSrcIndex]; fCharIndices[fDestIndex] = fCharIndices[fSrcIndex]; @@ -673,7 +679,7 @@ le_bool LEGlyphStorage::applyInsertion(le_int32 atPosition, le_int32 count, LEGl fSrcIndex -= 1; } - for (le_int32 i = count - 1; i >= 0; i -= 1) { + for (le_int32 i = count - 1; i >= 0 && fDestIndex >= 0; i -= 1) { fGlyphs[fDestIndex] = newGlyphs[i]; fCharIndices[fDestIndex] = fCharIndices[atPosition]; @@ -682,7 +688,7 @@ le_bool LEGlyphStorage::applyInsertion(le_int32 atPosition, le_int32 count, LEGl // the source glyph we're pointing at // just got replaced by the insertion - fSrcIndex -= 1; + fSrcIndex -= 1; return FALSE; } diff --git a/jdk/src/share/native/sun/font/layout/LETableReference.h b/jdk/src/share/native/sun/font/layout/LETableReference.h index dab52b664a8..dbee61fba7f 100644 --- a/jdk/src/share/native/sun/font/layout/LETableReference.h +++ b/jdk/src/share/native/sun/font/layout/LETableReference.h @@ -376,7 +376,7 @@ public: * @param success error status * @param atPtr location of reference - if NULL, will be at offset zero (i.e. downcast of parent). Otherwise must be a pointer within parent's bounds. */ - LEReferenceTo(const LETableReference &parent, LEErrorCode &success, const void* atPtr) + inline LEReferenceTo(const LETableReference &parent, LEErrorCode &success, const void* atPtr) : LETableReference(parent, parent.ptrToOffset(atPtr, success), LE_UINTPTR_MAX, success) { verifyLength(0, LETableVarSizer::getSize(), success); if(LE_FAILURE(success)) clear(); @@ -384,31 +384,31 @@ public: /** * ptr plus offset */ - LEReferenceTo(const LETableReference &parent, LEErrorCode &success, const void* atPtr, size_t offset) + inline LEReferenceTo(const LETableReference &parent, LEErrorCode &success, const void* atPtr, size_t offset) : LETableReference(parent, parent.ptrToOffset(atPtr, success)+offset, LE_UINTPTR_MAX, success) { verifyLength(0, LETableVarSizer::getSize(), success); if(LE_FAILURE(success)) clear(); } - LEReferenceTo(const LETableReference &parent, LEErrorCode &success, size_t offset) + inline LEReferenceTo(const LETableReference &parent, LEErrorCode &success, size_t offset) : LETableReference(parent, offset, LE_UINTPTR_MAX, success) { verifyLength(0, LETableVarSizer::getSize(), success); if(LE_FAILURE(success)) clear(); } - LEReferenceTo(const LETableReference &parent, LEErrorCode &success) + inline LEReferenceTo(const LETableReference &parent, LEErrorCode &success) : LETableReference(parent, 0, LE_UINTPTR_MAX, success) { verifyLength(0, LETableVarSizer::getSize(), success); if(LE_FAILURE(success)) clear(); } - LEReferenceTo(const LEFontInstance *font, LETag tableTag, LEErrorCode &success) + inline LEReferenceTo(const LEFontInstance *font, LETag tableTag, LEErrorCode &success) : LETableReference(font, tableTag, success) { verifyLength(0, LETableVarSizer::getSize(), success); if(LE_FAILURE(success)) clear(); } - LEReferenceTo(const le_uint8 *data, size_t length = LE_UINTPTR_MAX) : LETableReference(data, length) {} - LEReferenceTo(const T *data, size_t length = LE_UINTPTR_MAX) : LETableReference((const le_uint8*)data, length) {} - LEReferenceTo() : LETableReference(NULL) {} + inline LEReferenceTo(const le_uint8 *data, size_t length = LE_UINTPTR_MAX) : LETableReference(data, length) {} + inline LEReferenceTo(const T *data, size_t length = LE_UINTPTR_MAX) : LETableReference((const le_uint8*)data, length) {} + inline LEReferenceTo() : LETableReference(NULL) {} - LEReferenceTo& operator=(const T* other) { + inline LEReferenceTo& operator=(const T* other) { setRaw(other); return *this; } diff --git a/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp index 6690316f32d..30fb0bbede5 100644 --- a/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/LayoutEngine.cpp @@ -569,7 +569,6 @@ void LayoutEngine::reset() { if(fGlyphStorage!=NULL) { fGlyphStorage->reset(); - fGlyphStorage = NULL; } } diff --git a/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp index 46e808f2b6e..3a036c50772 100644 --- a/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp @@ -45,6 +45,10 @@ le_uint32 LigatureSubstitutionSubtable::process(const LETableReference &base, Gl LEGlyphID glyph = glyphIterator->getCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + if (LE_FAILURE(success)) { + return 0; + } + if (coverageIndex >= 0) { Offset ligSetTableOffset = SWAPW(ligSetTableOffsetArray[coverageIndex]); const LigatureSetTable *ligSetTable = (const LigatureSetTable *) ((char *) this + ligSetTableOffset); diff --git a/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp b/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp index fe7477db730..29bedfa352c 100644 --- a/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp +++ b/jdk/src/share/native/sun/font/layout/LookupProcessor.cpp @@ -61,7 +61,7 @@ le_uint32 LookupProcessor::applyLookupTable(const LEReferenceTo &lo delta = applySubtable(lookupSubtable, lookupType, glyphIterator, fontInstance, success); - if (delta > 0 && LE_FAILURE(success)) { + if (delta > 0 || LE_FAILURE(success)) { return 1; } diff --git a/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp b/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp index 2878981b6be..50df2704a88 100644 --- a/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp @@ -56,6 +56,10 @@ le_int32 MarkToBasePositioningSubtable::process(const LETableReference &base, Gl LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + if (LE_FAILURE(success)) { + return 0; + } + if (markCoverage < 0) { // markGlyph isn't a covered mark glyph return 0; diff --git a/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp b/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp index 8e93e079a79..ab21f86d1c5 100644 --- a/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp @@ -55,6 +55,10 @@ le_int32 MarkToLigaturePositioningSubtable::process(const LETableReference &base LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + if (LE_FAILURE(success)) { + return 0; + } + if (markCoverage < 0) { // markGlyph isn't a covered mark glyph return 0; diff --git a/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp b/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp index aa0bcd43c7c..b06a287e5d9 100644 --- a/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp @@ -56,6 +56,10 @@ le_int32 MarkToMarkPositioningSubtable::process(const LETableReference &base, Gl LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + if (LE_FAILURE(success)) { + return 0; + } + if (markCoverage < 0) { // markGlyph isn't a covered mark glyph return 0; diff --git a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp index 9d72ca8a16c..af94e623bab 100644 --- a/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp @@ -61,6 +61,10 @@ le_uint32 MultipleSubstitutionSubtable::process(const LETableReference &base, Gl le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); le_uint16 seqCount = SWAPW(sequenceCount); + if (LE_FAILURE(success)) { + return 0; + } + if (coverageIndex >= 0 && coverageIndex < seqCount) { Offset sequenceTableOffset = SWAPW(sequenceTableOffsetArray[coverageIndex]); const SequenceTable *sequenceTable = (const SequenceTable *) ((char *) this + sequenceTableOffset); diff --git a/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp b/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp index f234e9484e2..4d810df69f8 100644 --- a/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp +++ b/jdk/src/share/native/sun/font/layout/OpenTypeUtilities.cpp @@ -79,6 +79,7 @@ le_int8 OpenTypeUtilities::highBit(le_int32 value) Offset OpenTypeUtilities::getTagOffset(LETag tag, const LEReferenceToArrayOf &records, LEErrorCode &success) { + const TagAndOffsetRecord *r0 = (const TagAndOffsetRecord*)records.getAlias(); if(LE_FAILURE(success)) return 0; le_uint32 recordCount = records.getCount(); @@ -89,17 +90,17 @@ Offset OpenTypeUtilities::getTagOffset(LETag tag, const LEReferenceToArrayOftag; + const ATag &aTag = (r0+extra)->tag; if (SWAPT(aTag) <= tag) { index = extra; } } - while (probe > (1 << 0) && LE_SUCCESS(success)) { + while (probe > (1 << 0)) { probe >>= 1; { - const ATag &aTag = records.getAlias(index+probe,success)->tag; + const ATag &aTag = (r0+index+probe)->tag; if (SWAPT(aTag) <= tag) { index += probe; } @@ -107,9 +108,9 @@ Offset OpenTypeUtilities::getTagOffset(LETag tag, const LEReferenceToArrayOftag; + const ATag &aTag = (r0+index)->tag; if (SWAPT(aTag) == tag) { - return SWAPW(records.getAlias(index,success)->offset); + return SWAPW((r0+index)->offset); } } diff --git a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp index f46c8f1028b..bba2b8707ad 100644 --- a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp @@ -76,23 +76,30 @@ le_uint32 PairPositioningFormat1Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success); + + if (LE_FAILURE(success)) { + return 0; + } GlyphIterator tempIterator(*glyphIterator); if (coverageIndex >= 0 && glyphIterator->next()) { Offset pairSetTableOffset = SWAPW(pairSetTableOffsetArray[coverageIndex]); - PairSetTable *pairSetTable = (PairSetTable *) ((char *) this + pairSetTableOffset); + LEReferenceTo pairSetTable(base, success, ((char *) this + pairSetTableOffset)); + if (LE_FAILURE(success)) { + return 0; + } le_uint16 pairValueCount = SWAPW(pairSetTable->pairValueCount); le_int16 valueRecord1Size = ValueRecord::getSize(SWAPW(valueFormat1)); le_int16 valueRecord2Size = ValueRecord::getSize(SWAPW(valueFormat2)); le_int16 recordSize = sizeof(PairValueRecord) - sizeof(ValueRecord) + valueRecord1Size + valueRecord2Size; LEGlyphID secondGlyph = glyphIterator->getCurrGlyphID(); - const PairValueRecord *pairValueRecord = NULL; + LEReferenceTo pairValueRecord; if (pairValueCount != 0) { - pairValueRecord = findPairValueRecord((TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize); + pairValueRecord = findPairValueRecord(base, (TTGlyphID) LE_GET_GLYPH(secondGlyph), pairSetTable->pairValueRecordArray, pairValueCount, recordSize, success); } - if (pairValueRecord == NULL) { + if (pairValueRecord.isEmpty()) { return 0; } @@ -119,6 +126,11 @@ le_uint32 PairPositioningFormat2Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success); + + if (LE_FAILURE(success)) { + return 0; + } + GlyphIterator tempIterator(*glyphIterator); if (coverageIndex >= 0 && glyphIterator->next()) { @@ -154,22 +166,26 @@ le_uint32 PairPositioningFormat2Subtable::process(const LEReferenceTo PairPositioningFormat1Subtable::findPairValueRecord(const LETableReference &base, TTGlyphID glyphID, const PairValueRecord *records, le_uint16 recordCount, le_uint16 recordSize, LEErrorCode &success) const { #if 1 // The OpenType spec. says that the ValueRecord table is // sorted by secondGlyph. Unfortunately, there are fonts // around that have an unsorted ValueRecord table. - const PairValueRecord *record = records; + LEReferenceTo record(base, success, records); + record.verifyLength(0, recordSize, success); for(le_int32 r = 0; r < recordCount; r += 1) { + if (LE_FAILURE(success)) return (const PairValueRecord*)NULL; if (SWAPW(record->secondGlyph) == glyphID) { return record; } - record = (const PairValueRecord *) ((char *) record + recordSize); + record = LEReferenceTo(base, success, ((const char*)record.getAlias())+ recordSize); + record.verifyLength(0, recordSize, success); } #else + #error dead code - not updated. le_uint8 bit = OpenTypeUtilities::highBit(recordCount); le_uint16 power = 1 << bit; le_uint16 extra = (recordCount - power) * recordSize; @@ -195,7 +211,7 @@ const PairValueRecord *PairPositioningFormat1Subtable::findPairValueRecord(TTGly } #endif - return NULL; + return (const PairValueRecord*)NULL; } U_NAMESPACE_END diff --git a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h index 0c66ce61dc5..755dd819713 100644 --- a/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h +++ b/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.h @@ -77,8 +77,9 @@ struct PairPositioningFormat1Subtable : PairPositioningSubtable le_uint32 process(const LEReferenceTo &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const; private: - const PairValueRecord *findPairValueRecord(TTGlyphID glyphID, const PairValueRecord *records, - le_uint16 recordCount, le_uint16 recordSize) const; + LEReferenceTo findPairValueRecord(const LETableReference &base, TTGlyphID glyphID, const PairValueRecord *records, + le_uint16 recordCount, le_uint16 recordSize, LEErrorCode &success) const; + }; LE_VAR_ARRAY(PairPositioningFormat1Subtable, pairSetTableOffsetArray) diff --git a/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp b/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp index 1e2d257a6f8..2d2fe342cfe 100644 --- a/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp @@ -70,6 +70,9 @@ le_uint32 SinglePositioningFormat1Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); @@ -84,6 +87,9 @@ le_uint32 SinglePositioningFormat2Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int16 coverageIndex = (le_int16) getGlyphCoverage(base, glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); diff --git a/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp b/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp index 681958cf5ea..c32377d5071 100644 --- a/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp +++ b/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp @@ -69,6 +69,9 @@ le_uint32 SingleSubstitutionFormat1Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { TTGlyphID substitute = ((TTGlyphID) LE_GET_GLYPH(glyph)) + SWAPW(deltaGlyphID); @@ -87,6 +90,9 @@ le_uint32 SingleSubstitutionFormat2Subtable::process(const LEReferenceTogetCurrGlyphID(); le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + if (LE_FAILURE(success)) { + return 0; + } if (coverageIndex >= 0) { TTGlyphID substitute = SWAPW(substituteArray[coverageIndex]); diff --git a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp index c7db94829f4..b32f2601b4d 100644 --- a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp @@ -203,16 +203,19 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout getFloat(env, pt, x, y); jboolean rtl = (typo_flags & TYPO_RTL) != 0; int glyphCount = engine->layoutChars(chars, start - min, limit - start, len, rtl, x, y, success); - // fprintf(stderr, "sle nl len %d -> gc: %d\n", len, glyphCount); fflush(stderr); + // fprintf(stderr, "sle nl len %d -> gc: %d\n", len, glyphCount); fflush(stderr); engine->getGlyphPosition(glyphCount, x, y, success); - // fprintf(stderr, "layout glyphs: %d x: %g y: %g\n", glyphCount, x, y); fflush(stderr); - - if (putGV(env, gmask, baseIndex, gvdata, engine, glyphCount)) { - // !!! hmmm, could use current value in positions array of GVData... - putFloat(env, pt, x, y); - } + // fprintf(stderr, "layout glyphs: %d x: %g y: %g\n", glyphCount, x, y); fflush(stderr); + if (LE_FAILURE(success)) { + env->SetIntField(gvdata, gvdCountFID, -1); // flag failure + } else { + if (putGV(env, gmask, baseIndex, gvdata, engine, glyphCount)) { + // !!! hmmm, could use current value in positions array of GVData... + putFloat(env, pt, x, y); + } + } if (chars != buffer) { free(chars); diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c index 6fc76a8b919..8cc1479495c 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c @@ -1021,7 +1021,7 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID) mpe = cmsStageAllocToneCurves(ContextID, 3, LabTable); cmsFreeToneCurveTriple(LabTable); - if (mpe == NULL) return NULL; + if (mpe == NULL) return mpe; mpe ->Implements = cmsSigLabV2toV4; return mpe; @@ -1426,6 +1426,8 @@ cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* lut) if (lut == NULL) return NULL; NewLUT = cmsPipelineAlloc(lut ->ContextID, lut ->InputChannels, lut ->OutputChannels); + if (NewLUT == NULL) return NULL; + for (mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next) { diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c index 93a574e6654..de4a0fd1f06 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c @@ -517,9 +517,9 @@ cmsNAMEDCOLORLIST* CMSEXPORT cmsAllocNamedColorList(cmsContext ContextID, cmsUIn while (v -> Allocated < n) GrowNamedColorList(v); - strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix)); - strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix)); - v->Prefix[32] = v->Suffix[32] = 0; + strncpy(v ->Prefix, Prefix, sizeof(v ->Prefix) - 1); + strncpy(v ->Suffix, Suffix, sizeof(v ->Suffix) - 1); + v->Prefix[sizeof(v ->Prefix) - 1] = v->Suffix[sizeof(v ->Suffix) - 1] = 0; v -> ColorantCount = ColorantCount; @@ -577,9 +577,10 @@ cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* NamedColorList, if (Name != NULL) { strncpy(NamedColorList ->List[NamedColorList ->nColors].Name, Name, - sizeof(NamedColorList ->List[NamedColorList ->nColors].Name)); + sizeof(NamedColorList ->List[NamedColorList ->nColors].Name) - 1); - NamedColorList ->List[NamedColorList ->nColors].Name[cmsMAX_PATH-1] = 0; + NamedColorList ->List[NamedColorList ->nColors]. + Name[sizeof(NamedColorList ->List[NamedColorList ->nColors].Name) - 1] = 0; } else @@ -734,6 +735,10 @@ cmsSEQ* CMSEXPORT cmsAllocProfileSequenceDescription(cmsContext ContextID, cmsUI Seq -> seq = (cmsPSEQDESC*) _cmsCalloc(ContextID, n, sizeof(cmsPSEQDESC)); Seq -> n = n; + if (Seq -> seq == NULL) { + _cmsFree(ContextID, Seq); + return NULL; + } for (i=0; i < n; i++) { Seq -> seq[i].Manufacturer = NULL; diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c index 808e03c0c98..7086109cecb 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c @@ -1201,6 +1201,15 @@ Curves16Data* CurvesAlloc(cmsContext ContextID, int nCurves, int nElements, cmsT for (i=0; i < nCurves; i++) { c16->Curves[i] = _cmsCalloc(ContextID, nElements, sizeof(cmsUInt16Number)); + if (c16->Curves[i] == NULL) { + for (j=0; j < i; j++) { + _cmsFree(ContextID, c16->Curves[j]); + } + _cmsFree(ContextID, c16->Curves); + _cmsFree(ContextID, c16); + + return NULL; + } if (nElements == 256) { diff --git a/jdk/src/share/native/sun/java2d/opengl/OGLContext.c b/jdk/src/share/native/sun/java2d/opengl/OGLContext.c index b9c60046070..d1484f73e37 100644 --- a/jdk/src/share/native/sun/java2d/opengl/OGLContext.c +++ b/jdk/src/share/native/sun/java2d/opengl/OGLContext.c @@ -662,6 +662,13 @@ OGLContext_IsFBObjectExtensionAvailable(JNIEnv *env, return JNI_FALSE; } + // next see if the depth texture extension is available + if (!OGLContext_IsExtensionAvailable(extString, + "GL_ARB_depth_texture")) + { + return JNI_FALSE; + } + // next see if the fbobject system property has been enabled isFBObjectEnabled = JNU_GetStaticFieldByName(env, NULL, diff --git a/jdk/src/share/native/sun/java2d/pipe/Region.c b/jdk/src/share/native/sun/java2d/pipe/Region.c index 0a7a07a2e72..97c682cf0e3 100644 --- a/jdk/src/share/native/sun/java2d/pipe/Region.c +++ b/jdk/src/share/native/sun/java2d/pipe/Region.c @@ -28,6 +28,7 @@ #include "jni_util.h" #include "Region.h" +#include "sizecalc.h" static jfieldID endIndexID; static jfieldID bandsID; @@ -260,8 +261,8 @@ RegionToYXBandedRectangles(JNIEnv *env, } Region_StartIteration(env, &clipInfo); numrects = Region_CountIterationRects(&clipInfo); - if (numrects > initialBufferSize) { - *pRect = (RECT_T *) malloc(numrects * sizeof(RECT_T)); + if ((unsigned long)numrects > initialBufferSize) { + *pRect = (RECT_T *) SAFE_SIZE_ARRAY_ALLOC(malloc, numrects, sizeof(RECT_T)); if (*pRect == NULL) { Region_EndIteration(env, &clipInfo); JNU_ThrowOutOfMemoryError(env, diff --git a/jdk/src/share/native/sun/management/DiagnosticCommandImpl.c b/jdk/src/share/native/sun/management/DiagnosticCommandImpl.c index 4f601ed55a7..4ca0315abc3 100644 --- a/jdk/src/share/native/sun/management/DiagnosticCommandImpl.c +++ b/jdk/src/share/native/sun/management/DiagnosticCommandImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c b/jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c index 541a1d3edc2..e0da98aab74 100644 --- a/jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c +++ b/jdk/src/share/native/sun/security/jgss/wrapper/GSSLibStub.c @@ -329,6 +329,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_importName(JNIEnv *env, initGSSBuffer(env, jnameVal, &nameVal); nameType = newGSSOID(env, jnameType); if ((*env)->ExceptionCheck(env)) { + deleteGSSOID(nameType); + resetGSSBuffer(env, jnameVal, &nameVal); return jlong_zero; } @@ -823,6 +825,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_initContext(JNIEnv *env, FID_NativeGSSContext_lifetime)); cb = getGSSCB(env, jcb); if ((*env)->ExceptionCheck(env)) { + free(cb); return NULL; } @@ -927,6 +930,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env, initGSSBuffer(env, jinToken, &inToken); cb = getGSSCB(env, jcb); if ((*env)->ExceptionCheck(env)) { + free(cb); + resetGSSBuffer(env, jinToken, &inToken); return NULL; } srcName = GSS_C_NO_NAME; @@ -979,6 +984,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env, /* return immediately if an exception has occurred */ if ((*env)->ExceptionCheck(env)) { + resetGSSBuffer(env, jinToken, &inToken); return NULL; } sprintf(debugBuf, "[GSSLibStub_acceptContext] set targetName=%ld", @@ -993,6 +999,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env, ptr_to_jlong(srcName), jobj); /* return immediately if an exception has occurred */ if ((*env)->ExceptionCheck(env)) { + resetGSSBuffer(env, jinToken, &inToken); return NULL; } sprintf(debugBuf, "[GSSLibStub_acceptContext] set srcName=%ld", @@ -1019,6 +1026,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env, ptr_to_jlong(delCred), jsrcName, jMech); /* return immediately if an exception has occurred */ if ((*env)->ExceptionCheck(env)) { + resetGSSBuffer(env, jinToken, &inToken); return NULL; } (*env)->SetObjectField(env, jcontextSpi, diff --git a/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java b/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java index 9301eaf6edc..2881501dc7a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/ListHelper.java @@ -261,7 +261,7 @@ public class ListHelper implements XScrollbarClient { } public int y2index(int y) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("y=" + y +", firstIdx=" + firstDisplayedIndex() +", itemHeight=" + getItemHeight() + ",item_margin=" + ITEM_MARGIN); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/UnsafeXDisposerRecord.java b/jdk/src/solaris/classes/sun/awt/X11/UnsafeXDisposerRecord.java index 3295b827f00..8cbae2e040c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/UnsafeXDisposerRecord.java +++ b/jdk/src/solaris/classes/sun/awt/X11/UnsafeXDisposerRecord.java @@ -59,7 +59,7 @@ class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord { XToolkit.awtLock(); try { if (!disposed) { - if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(PlatformLogger.WARNING)) { + if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(PlatformLogger.Level.WARNING)) { if (place != null) { log.warning(name + " object was not disposed before finalization!", place); } else { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java index 4eeca362496..ebdc631df5f 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java @@ -55,7 +55,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { } void initXSettings() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Initializing XAWT XSettings"); } settings = new XMSelection("_XSETTINGS"); @@ -68,27 +68,27 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { } public void ownerDeath(int screen, XMSelection sel, long deadOwner) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen); } } public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen ); } } public void selectionChanged(int screen, XMSelection sel, long owner , XPropertyEvent event) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Selection changed on sel " + sel + " screen = " + screen + " owner = " + owner + " event = " + event); } updateXSettings(screen,owner); } void initPerScreenXSettings() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Updating Per XSettings changes"); } @@ -124,7 +124,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { } private Map getUpdatedSettings(final long owner) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("owner =" + owner); } if (0 == owner) { @@ -140,7 +140,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance()); if (status != XConstants.Success || getter.getData() == 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("OH OH : getter failed status = " + status ); } settings = null; @@ -148,7 +148,7 @@ class XAWTXSettings extends XSettings implements XMSelectionListener { long ptr = getter.getData(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("noItems = " + getter.getNumberOfItems()); } byte array[] = Native.toBytes(ptr,getter.getNumberOfItems()); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java index f0b1aef36cd..783f4acb935 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -330,7 +330,7 @@ abstract public class XBaseMenuWindow extends XWindow { items.add(mp); } } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("WARNING: Attempt to add menu item without a peer"); } } @@ -351,7 +351,7 @@ abstract public class XBaseMenuWindow extends XWindow { if (index < items.size()) { items.remove(index); } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("WARNING: Attempt to remove non-existing menu item, index : " + index + ", item count : " + items.size()); } } @@ -386,7 +386,7 @@ abstract public class XBaseMenuWindow extends XWindow { XMenuPeer showingSubmenu = getShowingSubmenu(); int newSelectedIndex = (item != null) ? items.indexOf(item) : -1; if (this.selectedIndex != newSelectedIndex) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Selected index changed, was : " + this.selectedIndex + ", new : " + newSelectedIndex); } this.selectedIndex = newSelectedIndex; @@ -426,7 +426,7 @@ abstract public class XBaseMenuWindow extends XWindow { try { synchronized(getMenuTreeLock()) { if (showingSubmenu != submenuToShow) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Changing showing submenu"); } if (showingSubmenu != null) { @@ -904,11 +904,12 @@ abstract public class XBaseMenuWindow extends XWindow { */ public void dispose() { setDisposed(true); - EventQueue.invokeLater(new Runnable() { + InvocationEvent ev = new InvocationEvent(target, new Runnable() { public void run() { doDispose(); } }); + super.postEvent(ev); } /** @@ -933,11 +934,12 @@ abstract public class XBaseMenuWindow extends XWindow { * so events can not be processed using standart means */ void postEvent(final AWTEvent event) { - EventQueue.invokeLater(new Runnable() { - public void run() { - handleEvent(event); - } - }); + InvocationEvent ev = new InvocationEvent(event.getSource(), new Runnable() { + public void run() { + handleEvent(event); + } + }); + super.postEvent(ev); } /** @@ -1122,7 +1124,7 @@ abstract public class XBaseMenuWindow extends XWindow { * that grabs input focus */ void doHandleJavaKeyEvent(KeyEvent event) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer(event.toString()); } if (event.getID() != KeyEvent.KEY_PRESSED) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java index b6f9f811c9d..28db82f8a99 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java @@ -160,7 +160,7 @@ public class XBaseWindow { * with class-specific values and perform post-initialization actions. */ void postInit(XCreateWindowParams params) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("WM name is " + getWMName()); } updateWMName(); @@ -362,7 +362,7 @@ public class XBaseWindow { value_mask |= XConstants.CWBitGravity; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Creating window for " + this + " with the following attributes: \n" + params); } window = XlibWrapper.XCreateWindow(XToolkit.getDisplay(), @@ -482,7 +482,7 @@ public class XBaseWindow { } public void setSizeHints(long flags, int x, int y, int width, int height) { - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags)); } XToolkit.awtLock(); @@ -545,7 +545,7 @@ public class XBaseWindow { flags |= XUtilConstants.PWinGravity; hints.set_flags(flags); hints.set_win_gravity((int)XConstants.NorthWestGravity); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) + ", values " + hints); } @@ -599,7 +599,7 @@ public class XBaseWindow { public void xRequestFocus(long time) { XToolkit.awtLock(); try { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()) + " with time " + time); } XlibWrapper.XSetInputFocus2(XToolkit.getDisplay(), getWindow(), time); @@ -610,7 +610,7 @@ public class XBaseWindow { public void xRequestFocus() { XToolkit.awtLock(); try { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow())); } XlibWrapper.XSetInputFocus(XToolkit.getDisplay(), getWindow()); @@ -629,7 +629,7 @@ public class XBaseWindow { } public void xSetVisible(boolean visible) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting visible on " + this + " to " + visible); } XToolkit.awtLock(); @@ -716,7 +716,7 @@ public class XBaseWindow { insLog.warning("Attempt to resize uncreated window"); throw new IllegalStateException("Attempt to resize uncreated window"); } - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting bounds on " + this + " to (" + x + ", " + y + "), " + width + "x" + height); } width = Math.max(MIN_SIZE, width); @@ -834,7 +834,7 @@ public class XBaseWindow { * The active grab overrides activated automatic grab. */ public boolean grabInput() { - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Grab input on {0}", this); } @@ -899,7 +899,7 @@ public class XBaseWindow { XToolkit.awtLock(); try { XBaseWindow grabWindow = XAwtState.getGrabWindow(); - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("UnGrab input on {0}", grabWindow); } if (grabWindow != null) { @@ -943,7 +943,7 @@ public class XBaseWindow { mapped = false; } public void handleReparentNotifyEvent(XEvent xev) { - if (eventLog.isLoggable(PlatformLogger.FINER)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINER)) { XReparentEvent msg = xev.get_xreparent(); eventLog.finer(msg.toString()); } @@ -953,7 +953,7 @@ public class XBaseWindow { if (XPropertyCache.isCachingSupported()) { XPropertyCache.clearCache(window, XAtom.get(msg.get_atom())); } - if (eventLog.isLoggable(PlatformLogger.FINER)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINER)) { eventLog.finer("{0}", msg); } } @@ -983,7 +983,7 @@ public class XBaseWindow { } public void handleClientMessage(XEvent xev) { - if (eventLog.isLoggable(PlatformLogger.FINER)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINER)) { XClientMessageEvent msg = xev.get_xclient(); eventLog.finer(msg.toString()); } @@ -1039,7 +1039,7 @@ public class XBaseWindow { } public void handleConfigureNotifyEvent(XEvent xev) { XConfigureEvent xe = xev.get_xconfigure(); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Configure, {0}", xe); } x = xe.get_x(); @@ -1092,7 +1092,7 @@ public class XBaseWindow { } public void dispatchEvent(XEvent xev) { - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest(xev.toString()); } int type = xev.get_type(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java index 47288116ce0..50ca9310400 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XCheckboxPeer.java @@ -172,7 +172,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer { Checkbox cb = (Checkbox) e.getSource(); if (cb.contains(e.getX(), e.getY())) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("mousePressed() on " + target.getName() + " : armed = " + armed + ", pressed = " + pressed + ", selected = " + selected + ", enabled = " + isEnabled()); } @@ -190,7 +190,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer { } public void mouseReleased(MouseEvent e) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("mouseReleased() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed + ", selected = " + selected + ", enabled = " + isEnabled()); } @@ -215,7 +215,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer { } public void mouseEntered(MouseEvent e) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("mouseEntered() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed + ", selected = " + selected + ", enabled = " + isEnabled()); } @@ -226,7 +226,7 @@ class XCheckboxPeer extends XComponentPeer implements CheckboxPeer { } public void mouseExited(MouseEvent e) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("mouseExited() on " + target.getName() + ": armed = " + armed + ", pressed = " + pressed + ", selected = " + selected + ", enabled = " + isEnabled()); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java index a9fc4969875..561d9a6a1c4 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XChoicePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -892,7 +892,7 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS if (transX > 0 && transX < width && transY > 0 && transY < height) { int newIdx = helper.y2index(transY); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("transX=" + transX + ", transY=" + transY + ",width=" + width + ", height=" + height + ", newIdx=" + newIdx + " on " + target); @@ -1033,15 +1033,17 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS //fix 6252982: PIT: Keyboard FocusTraversal not working when choice's drop-down is visible, on XToolkit if (e instanceof KeyEvent){ // notify XWindow that this event had been already handled and no need to post it again - EventQueue.invokeLater(new Runnable() { - public void run() { - if(target.isFocusable() && - getParentTopLevel().isFocusableWindow() ) - { - handleJavaKeyEvent((KeyEvent)e); - } + InvocationEvent ev = new InvocationEvent(target, new Runnable() { + public void run() { + if(target.isFocusable() && + getParentTopLevel().isFocusableWindow() ) + { + handleJavaKeyEvent((KeyEvent)e); } - }); + } + }); + postEvent(ev); + return true; } else { if (e instanceof MouseEvent){ @@ -1083,11 +1085,13 @@ public class XChoicePeer extends XComponentPeer implements ChoicePeer, ToplevelS //convenient method //do not generate this kind of Events public boolean handleMouseEventByChoice(final MouseEvent me){ - EventQueue.invokeLater(new Runnable() { - public void run() { - handleJavaMouseEvent(me); - } - }); + InvocationEvent ev = new InvocationEvent(target, new Runnable() { + public void run() { + handleJavaMouseEvent(me); + } + }); + postEvent(ev); + return true; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java index ed50b9fe1a4..aa74d923e52 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java @@ -214,7 +214,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * Called when component receives focus */ public void focusGained(FocusEvent e) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("{0}", e); } bHasFocus = true; @@ -224,7 +224,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * Called when component loses focus */ public void focusLost(FocusEvent e) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("{0}", e); } bHasFocus = false; @@ -298,7 +298,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED: // Currently we just generate focus events like we deal with lightweight instead of calling // XSetInputFocus on native window - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target); } @@ -325,7 +325,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget */ boolean res = wpeer.requestWindowFocus(null); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Requested window focus: " + res); } // If parent window can be made focused and has been made focused(synchronously) @@ -347,7 +347,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } private boolean rejectFocusRequestHelper(String logMsg) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(logMsg); } XKeyboardFocusManagerPeer.removeLastFocusRequest(target); @@ -355,7 +355,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } void handleJavaFocusEvent(AWTEvent e) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(e.toString()); } if (e.getID() == FocusEvent.FOCUS_GAINED) { @@ -386,7 +386,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * @see java.awt.peer.ComponentPeer */ public void setEnabled(final boolean value) { - if (enableLog.isLoggable(PlatformLogger.FINE)) { + if (enableLog.isLoggable(PlatformLogger.Level.FINE)) { enableLog.fine("{0}ing {1}", (value ? "Enabl" : "Disabl"), this); } boolean status = value; @@ -467,13 +467,13 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget if (true) { switch(e.getID()) { case PaintEvent.UPDATE: - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("XCP coalescePaintEvent : UPDATE : add : x = " + r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height); } return; case PaintEvent.PAINT: - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("XCP coalescePaintEvent : PAINT : add : x = " + r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height); } @@ -640,7 +640,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } public void setBackground(Color c) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Set background to " + c); } synchronized (getStateLock()) { @@ -651,7 +651,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } public void setForeground(Color c) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Set foreground to " + c); } synchronized (getStateLock()) { @@ -672,7 +672,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * @since JDK1.0 */ public FontMetrics getFontMetrics(Font font) { - if (fontLog.isLoggable(PlatformLogger.FINE)) { + if (fontLog.isLoggable(PlatformLogger.Level.FINE)) { fontLog.fine("Getting font metrics for " + font); } return sun.font.FontDesignMetrics.getMetrics(font); @@ -1158,7 +1158,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException { - if (buffersLog.isLoggable(PlatformLogger.FINE)) { + if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("createBuffers(" + numBuffers + ", " + caps + ")"); } // set the caps first, they're used when creating the bb @@ -1176,7 +1176,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget public void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction) { - if (buffersLog.isLoggable(PlatformLogger.FINE)) { + if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("flip(" + flipAction + ")"); } if (backBuffer == 0) { @@ -1187,7 +1187,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } public Image getBackBuffer() { - if (buffersLog.isLoggable(PlatformLogger.FINE)) { + if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("getBackBuffer()"); } if (backBuffer == 0) { @@ -1197,7 +1197,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } public void destroyBuffers() { - if (buffersLog.isLoggable(PlatformLogger.FINE)) { + if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) { buffersLog.fine("destroyBuffers()"); } graphicsConfig.destroyBackBuffer(backBuffer); @@ -1232,7 +1232,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify */ protected boolean isEventDisabled(XEvent e) { - if (enableLog.isLoggable(PlatformLogger.FINEST)) { + if (enableLog.isLoggable(PlatformLogger.Level.FINEST)) { enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable")); } if (!isEnabled()) { @@ -1244,7 +1244,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget case XConstants.EnterNotify: case XConstants.LeaveNotify: case XConstants.MotionNotify: - if (enableLog.isLoggable(PlatformLogger.FINER)) { + if (enableLog.isLoggable(PlatformLogger.Level.FINER)) { enableLog.finer("Event {0} is disable", e); } return true; @@ -1367,7 +1367,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget */ public void applyShape(Region shape) { if (XlibUtil.isShapingSupported()) { - if (shapeLog.isLoggable(PlatformLogger.FINER)) { + if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer( "*** INFO: Setting shape: PEER: " + this + "; WINDOW: " + getWindow() @@ -1397,7 +1397,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget XToolkit.awtUnlock(); } } else { - if (shapeLog.isLoggable(PlatformLogger.FINER)) { + if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer("*** WARNING: Shaping is NOT supported!"); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java index fa90cf19a49..4eabc229ee8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java @@ -115,7 +115,7 @@ public final class XContentWindow extends XWindow { if (in != null) { newBounds.setLocation(-in.left, -in.top); } - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting content bounds {0}, old bounds {1}", newBounds, getBounds()); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java index feb8e530899..e61273dc4d4 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.awt.event.ComponentEvent; import java.awt.event.InvocationEvent; import java.awt.event.WindowEvent; +import sun.awt.IconInfo; import sun.util.logging.PlatformLogger; import sun.awt.AWTAccessor; @@ -78,7 +79,7 @@ abstract class XDecoratedPeer extends XWindowPeer { Rectangle bounds = (Rectangle)params.get(BOUNDS); dimensions = new WindowDimensions(bounds, getRealInsets(), false); params.put(BOUNDS, dimensions.getClientRect()); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Initial dimensions {0}", dimensions); } @@ -108,7 +109,7 @@ abstract class XDecoratedPeer extends XWindowPeer { focusProxy = createFocusProxy(); } - void setIconHints(java.util.List icons) { + void setIconHints(java.util.List icons) { if (!XWM.getWM().setNetWMIcon(this, icons)) { if (icons.size() > 0) { if (iconWindow == null) { @@ -181,7 +182,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } public void setTitle(String title) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Title is " + title); } winAttr.title = title; @@ -231,7 +232,7 @@ abstract class XDecoratedPeer extends XWindowPeer { // If we somehow received focus events forward it instead to proxy // FIXME: Shouldn't we instead check for inferrior? - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Received focus event on shell: " + xfe); } // focusProxy.xRequestFocus(); @@ -275,7 +276,7 @@ abstract class XDecoratedPeer extends XWindowPeer { wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom); } - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets); } @@ -304,7 +305,7 @@ abstract class XDecoratedPeer extends XWindowPeer { public void handleReparentNotifyEvent(XEvent xev) { XReparentEvent xe = xev.get_xreparent(); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine(xe.toString()); } reparent_serial = xe.get_serial(); @@ -345,7 +346,7 @@ abstract class XDecoratedPeer extends XWindowPeer { // Check if we have insets provided by the WM Insets correctWM = getWMSetInsets(null); if (correctWM != null) { - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("wm-provided insets {0}", correctWM); } // If these insets are equal to our current insets - no actions are necessary @@ -360,7 +361,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } else { correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent()); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { if (correctWM != null) { insLog.finer("correctWM {0}", correctWM); } else { @@ -386,7 +387,7 @@ abstract class XDecoratedPeer extends XWindowPeer { * initial insets were wrong (most likely they were). */ Insets correction = difference(correctWM, currentInsets); - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("Corrention {0}", correction); } if (!isNull(correction)) { @@ -398,7 +399,7 @@ abstract class XDecoratedPeer extends XWindowPeer { //update minimum size hints updateMinSizeHints(); } - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Dimensions before reparent: " + dimensions); } @@ -473,7 +474,7 @@ abstract class XDecoratedPeer extends XWindowPeer { public Insets getInsets() { Insets in = copy(getRealInsets()); in.top += getMenuBarHeight(); - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("Get insets returns {0}", in); } return in; @@ -503,7 +504,7 @@ abstract class XDecoratedPeer extends XWindowPeer { public void reshape(WindowDimensions newDimensions, int op, boolean userReshape) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Reshaping " + this + " to " + newDimensions + " op " + op + " user reshape " + userReshape); } if (userReshape) { @@ -524,7 +525,7 @@ abstract class XDecoratedPeer extends XWindowPeer { XToolkit.awtLock(); try { if (!isReparented() || !isVisible()) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("- not reparented({0}) or not visible({1}), default reshape", Boolean.valueOf(isReparented()), Boolean.valueOf(visible)); } @@ -632,7 +633,7 @@ abstract class XDecoratedPeer extends XWindowPeer { dims.setSize(width, height); break; } - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("For the operation {0} new dimensions are {1}", operationToString(operation), dims); } @@ -665,7 +666,7 @@ abstract class XDecoratedPeer extends XWindowPeer { public void handleConfigureNotifyEvent(XEvent xev) { assert (SunToolkit.isAWTLockHeldByCurrentThread()); XConfigureEvent xe = xev.get_xconfigure(); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Configure notify {0}", xe); } @@ -704,7 +705,7 @@ abstract class XDecoratedPeer extends XWindowPeer { * it!!!! or we wind up in a bogus location. */ int runningWM = XWM.getWMID(); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("reparented={0}, visible={1}, WM={2}, decorations={3}", isReparented(), isVisible(), runningWM, getDecorations()); } @@ -718,7 +719,7 @@ abstract class XDecoratedPeer extends XWindowPeer { if (!insets_corrected && getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) { long parent = XlibUtil.getParentWindow(window); Insets correctWM = (parent != -1) ? XWM.getWM().getInsets(this, window, parent) : null; - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { if (correctWM != null) { insLog.finer("Configure notify - insets : " + correctWM); } else { @@ -758,7 +759,7 @@ abstract class XDecoratedPeer extends XWindowPeer { case XWM.SAWFISH_WM: { Point xlocation = queryXLocation(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("New X location: {0}", xlocation); } if (xlocation != null) { @@ -777,7 +778,7 @@ abstract class XDecoratedPeer extends XWindowPeer { copy(currentInsets), true); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Insets are {0}, new dimensions {1}", currentInsets, newDimensions); } @@ -815,7 +816,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } public void setShellBounds(Rectangle rec) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting shell bounds on " + this + " to " + rec); } XToolkit.awtLock(); @@ -829,7 +830,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } } public void setShellSize(Rectangle rec) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting shell size on " + this + " to " + rec); } XToolkit.awtLock(); @@ -842,7 +843,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } } public void setShellPosition(Rectangle rec) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting shell position on " + this + " to " + rec); } XToolkit.awtLock(); @@ -944,7 +945,7 @@ abstract class XDecoratedPeer extends XWindowPeer { return toGlobal(0,0); } else { Point location = target.getLocation(); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("getLocationOnScreen {0} not reparented: {1} ", this, location); } @@ -984,7 +985,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } public void setVisible(boolean vis) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Setting {0} to visible {1}", this, Boolean.valueOf(vis)); } if (vis && !isVisible()) { @@ -1037,7 +1038,7 @@ abstract class XDecoratedPeer extends XWindowPeer { } private void handleWmTakeFocus(XClientMessageEvent cl) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("WM_TAKE_FOCUS on {0}", this); } requestWindowFocus(cl.get_data(1), true); @@ -1052,11 +1053,11 @@ abstract class XDecoratedPeer extends XWindowPeer { // by "proxy" - invisible mapped window. When we want to set X input focus to // toplevel set it on proxy instead. if (focusProxy == null) { - if (focusLog.isLoggable(PlatformLogger.WARNING)) { + if (focusLog.isLoggable(PlatformLogger.Level.WARNING)) { focusLog.warning("Focus proxy is null for " + this); } } else { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Requesting focus to proxy: " + focusProxy); } if (timeProvided) { @@ -1150,7 +1151,7 @@ abstract class XDecoratedPeer extends XWindowPeer { Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow(); Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Current window is: active={0}, focused={1}", Boolean.valueOf(target == activeWindow), Boolean.valueOf(target == focusedWindow)); @@ -1177,20 +1178,20 @@ abstract class XDecoratedPeer extends XWindowPeer { return true; } Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow(); - if (focusLog.isLoggable(PlatformLogger.FINEST)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) { focusLog.finest("Real native focused window: " + realNativeFocusedWindow + "\nKFM's focused window: " + focusedWindow); } // A workaround for Metacity. See 6522725, 6613426, 7147075. if (target == realNativeFocusedWindow && XWM.getWMID() == XWM.METACITY_WM) { - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("The window is already natively focused."); } return true; } } - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus)); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java index c2da2e69995..8a22f65eba1 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java @@ -395,7 +395,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol { return false; } - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" sourceWindow=" + sourceWindow + " get_window=" + xclient.get_window() + " xclient=" + xclient); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java index 3dc2c96efc9..f0a6622c4bd 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java @@ -993,7 +993,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { if (sourceFormats != null && sourceFormats.length > 3) { data1 |= XDnDConstants.XDND_DATA_TYPES_BIT; } - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" " + " entryVersion=" + version + " sourceProtocolVersion=" + @@ -1052,7 +1052,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { public boolean forwardEventToEmbedded(long embedded, long ctxt, int eventID) { - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" ctxt=" + ctxt + " type=" + (ctxt != 0 ? getMessageType(new @@ -1080,7 +1080,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { long data3 = Native.getLong(ctxt + size + 2 * Native.getLongSize()); long data4 = Native.getLong(ctxt + size + 3 * Native.getLongSize()); - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" 1 " + " embedded=" + embedded + " source=" + xclient.get_data(0) @@ -1114,7 +1114,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { if ((XErrorHandlerUtil.saved_error != null) && (XErrorHandlerUtil.saved_error.get_error_code() != XConstants.Success)) { - if (logger.isLoggable(PlatformLogger.WARNING)) { + if (logger.isLoggable(PlatformLogger.Level.WARNING)) { logger.warning("Cannot set XdndTypeList on the proxy window"); } } @@ -1122,7 +1122,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { XToolkit.awtUnlock(); } } else { - if (logger.isLoggable(PlatformLogger.WARNING)) { + if (logger.isLoggable(PlatformLogger.Level.WARNING)) { logger.warning("Cannot read XdndTypeList from the source window"); } } @@ -1137,7 +1137,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { overXEmbedClient = true; } - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" 2 " + " embedded=" + embedded + " xclient=" + xclient); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java index c4ec7f766a1..e762ae0118e 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java @@ -542,7 +542,7 @@ public final class XDragSourceContextPeer return false; } - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" proxyModeSourceWindow=" + getProxyModeSourceWindow() + " ev=" + ev); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java index 975d710264d..b53e6e9fe0b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetContextPeer.java @@ -199,7 +199,7 @@ final class XDropTargetContextPeer extends SunDropTargetContextPeer { structure. */ long ctxt = getNativeDragContext(); - if (logger.isLoggable(PlatformLogger.FINER)) { + if (logger.isLoggable(PlatformLogger.Level.FINER)) { logger.finer(" processing " + event + " ctxt=" + ctxt + " consumed=" + event.isConsumed()); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java index 831766201a7..8d0b09c1bcd 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java @@ -116,7 +116,7 @@ abstract class XDropTargetProtocol { XClientMessageEvent xclient) { EmbedderRegistryEntry entry = getEmbedderRegistryEntry(toplevel); - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" entry={0}", entry); } // Window not registered as an embedder for this protocol. @@ -124,7 +124,7 @@ abstract class XDropTargetProtocol { return false; } - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" entry.isOverriden()={0}", entry.isOverriden()); } // Window didn't have an associated drop site, so there is no need @@ -137,7 +137,7 @@ abstract class XDropTargetProtocol { long proxy = entry.getProxy(); - if (logger.isLoggable(PlatformLogger.FINEST)) { + if (logger.isLoggable(PlatformLogger.Level.FINEST)) { logger.finest(" proxy={0} toplevel={1}", proxy, toplevel); } if (proxy == 0) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java index f08db55c2b3..8c1dab9a22a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java @@ -614,7 +614,7 @@ final class XDropTargetRegistry { if (info != null && info.getProtocolVersion() >= XDnDConstants.XDND_MIN_PROTOCOL_VERSION) { - if (logger.isLoggable(PlatformLogger.FINE)) { + if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine(" XEmbed drop site will be registered for " + Long.toHexString(clientWindow)); } registerEmbeddedDropSite(canvasWindow, clientWindow); @@ -628,14 +628,14 @@ final class XDropTargetRegistry { dropTargetProtocol.registerEmbeddedDropSite(clientWindow); } - if (logger.isLoggable(PlatformLogger.FINE)) { + if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine(" XEmbed drop site has been registered for " + Long.toHexString(clientWindow)); } } } public void unregisterXEmbedClient(long canvasWindow, long clientWindow) { - if (logger.isLoggable(PlatformLogger.FINE)) { + if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine(" XEmbed drop site will be unregistered for " + Long.toHexString(clientWindow)); } Iterator dropTargetProtocols = @@ -649,7 +649,7 @@ final class XDropTargetRegistry { unregisterEmbeddedDropSite(canvasWindow, clientWindow); - if (logger.isLoggable(PlatformLogger.FINE)) { + if (logger.isLoggable(PlatformLogger.Level.FINE)) { logger.fine(" XEmbed drop site has beed unregistered for " + Long.toHexString(clientWindow)); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java index 194eb8f7511..167c3fe3209 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java @@ -123,7 +123,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } void initDispatching() { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle)); } XToolkit.awtLock(); @@ -142,7 +142,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } void endDispatching() { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("End dispatching for " + Long.toHexString(xembed.handle)); } XToolkit.awtLock(); @@ -164,7 +164,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } void childDestroyed() { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Child " + Long.toHexString(xembed.handle) + " has self-destroyed."); } endDispatching(); @@ -196,10 +196,10 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener switch (ev.get_type()) { case XConstants.CreateNotify: XCreateWindowEvent cr = ev.get_xcreatewindow(); - if (xembedLog.isLoggable(PlatformLogger.FINEST)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINEST)) { xembedLog.finest("Message on embedder: " + cr); } - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Create notify for parent " + Long.toHexString(cr.get_parent()) + ", window " + Long.toHexString(cr.get_window())); } @@ -207,20 +207,20 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener break; case XConstants.DestroyNotify: XDestroyWindowEvent dn = ev.get_xdestroywindow(); - if (xembedLog.isLoggable(PlatformLogger.FINEST)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINEST)) { xembedLog.finest("Message on embedder: " + dn); } - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Destroy notify for parent: " + dn); } childDestroyed(); break; case XConstants.ReparentNotify: XReparentEvent rep = ev.get_xreparent(); - if (xembedLog.isLoggable(PlatformLogger.FINEST)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINEST)) { xembedLog.finest("Message on embedder: " + rep); } - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Reparent notify for parent " + Long.toHexString(rep.get_parent()) + ", window " + Long.toHexString(rep.get_window()) + ", event " + Long.toHexString(rep.get_event())); @@ -323,7 +323,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } void childResized() { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { Rectangle bounds = getClientBounds(); xembedLog.finer("Child resized: " + bounds); // It is not required to update embedder's size when client size changes @@ -388,7 +388,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } void detachChild() { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle)); } /** @@ -471,7 +471,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener try { XKeyEvent ke = new XKeyEvent(data); ke.set_window(xembed.handle); - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Forwarding native key event: " + ke); } XToolkit.awtLock(); @@ -504,7 +504,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener postEvent(new InvocationEvent(target, new Runnable() { public void run() { GrabbedKey grab = new GrabbedKey(keysym, modifiers); - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Grabbing key: " + grab); } synchronized(GRAB_LOCK) { @@ -518,7 +518,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener postEvent(new InvocationEvent(target, new Runnable() { public void run() { GrabbedKey grab = new GrabbedKey(keysym, modifiers); - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("UnGrabbing key: " + grab); } synchronized(GRAB_LOCK) { @@ -533,7 +533,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener public void run() { AWTKeyStroke stroke = xembed.getKeyStrokeForKeySym(keysym, modifiers); if (stroke != null) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Registering accelerator " + accel_id + " for " + stroke); } synchronized(ACCEL_LOCK) { @@ -553,7 +553,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener synchronized(ACCEL_LOCK) { stroke = accelerators.get(accel_id); if (stroke != null) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Unregistering accelerator: " + accel_id); } accelerators.remove(accel_id); @@ -601,7 +601,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener boolean result = false; - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Post-processing event " + e); } @@ -616,7 +616,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } } if (exists) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Activating accelerator " + accel_id); } xembed.sendMessage(xembed.handle, XEMBED_ACTIVATE_ACCELERATOR, accel_id, 0, 0); // FIXME: How about overloaded? @@ -630,7 +630,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener exists = grabbed_keys.contains(key); } if (exists) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Forwarding grabbed key " + e); } forwardKeyEvent(e); @@ -651,11 +651,11 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener public void handleClientMessage(XEvent xev) { super.handleClientMessage(xev); XClientMessageEvent msg = xev.get_xclient(); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Client message to embedder: " + msg); } if (msg.get_message_type() == xembed.XEmbed.getAtom()) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine(xembed.XEmbedMessageToString(msg)); } } @@ -723,7 +723,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } public boolean processXEmbedDnDEvent(long ctxt, int eventID) { - if (xembedLog.isLoggable(PlatformLogger.FINEST)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINEST)) { xembedLog.finest(" Drop target=" + target.getDropTarget()); } if (target.getDropTarget() instanceof XEmbedDropTarget) { @@ -758,7 +758,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener boolean new_mapped = (flags & XEMBED_MAPPED) != 0; boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped; if (new_mapped != currently_mapped) { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped); } if (new_mapped) { @@ -777,7 +777,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener } } } else { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Mapping state didn't change, mapped: " + currently_mapped); } } @@ -790,7 +790,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener public void handlePropertyNotify(XEvent xev) { if (isXEmbedActive()) { XPropertyEvent ev = xev.get_xproperty(); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Property change on client: " + ev); } if (ev.get_atom() == XAtom.XA_WM_NORMAL_HINTS) { @@ -813,7 +813,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener void handleConfigureNotify(XEvent xev) { if (isXEmbedActive()) { XConfigureEvent ev = xev.get_xconfigure(); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Bounds change on client: " + ev); } if (xev.get_xany().get_window() == handle) { @@ -866,7 +866,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener // We recognize only these masks modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask); - if (xembedLog.isLoggable(PlatformLogger.FINEST)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINEST)) { xembedLog.finest("Mapped " + e + " to " + this); } } finally { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java index 434e665ab33..e0ec7e83fe8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java @@ -53,7 +53,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher } void setClient(XEmbeddedFramePeer client) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("XEmbed client: " + client); } if (embedded != null) { @@ -67,7 +67,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher } void install() { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Installing xembedder on " + embedded); } long[] info = new long[] { XEMBED_VERSION, XEMBED_MAPPED }; @@ -95,11 +95,11 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher void handleClientMessage(XEvent xev) { XClientMessageEvent msg = xev.get_xclient(); - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine(msg.toString()); } if (msg.get_message_type() == XEmbed.getAtom()) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Embedded message: " + msgidToString((int)msg.get_data(1))); } switch ((int)msg.get_data(1)) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java index 3109d60d4af..49c7a5dcf04 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java @@ -82,13 +82,13 @@ public class XEmbedHelper { XEmbedHelper() { if (XEmbed == null) { XEmbed = XAtom.get("_XEMBED"); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Created atom " + XEmbed.toString()); } } if (XEmbedInfo == null) { XEmbedInfo = XAtom.get("_XEMBED_INFO"); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Created atom " + XEmbedInfo.toString()); } } @@ -110,7 +110,7 @@ public class XEmbedHelper { msg.set_data(4, data2); XToolkit.awtLock(); try { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Sending " + XEmbedMessageToString(msg)); } XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java index e588f8f5f3a..e21d1d255f4 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java @@ -81,7 +81,7 @@ public class XEmbedServerTester implements XEventDispatcher { throw new RuntimeException("Can't create robot"); } initAccel(); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("XEmbed client(tester), embedder window: " + Long.toHexString(parent)); } } @@ -91,7 +91,7 @@ public class XEmbedServerTester implements XEventDispatcher { } private void dumpReceivedEvents() { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Events received so far:"); int pos = 0; for (Integer event : events) { @@ -395,7 +395,7 @@ public class XEmbedServerTester implements XEventDispatcher { SubstructureNotifyMask | KeyPressMask)}); window = new XBaseWindow(params); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Created tester window: " + window); } @@ -535,7 +535,7 @@ public class XEmbedServerTester implements XEventDispatcher { synchronized(EVENT_LOCK) { // Check for already received events after the request if (checkEventList(position, event) != -1) { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("The event " + XEmbedHelper.msgidToString(event) + " has already been received"); } return; @@ -543,14 +543,14 @@ public class XEmbedServerTester implements XEventDispatcher { if (eventReceived == event) { // Already received - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Already received " + XEmbedHelper.msgidToString(event)); } return; } eventReceived = -1; eventWaited = event; - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Waiting for " + XEmbedHelper.msgidToString(event) + " starting from " + position); } try { @@ -563,7 +563,7 @@ public class XEmbedServerTester implements XEventDispatcher { dumpReceivedEvents(); throw new RuntimeException("Didn't receive event " + XEmbedHelper.msgidToString(event) + " but recevied " + XEmbedHelper.msgidToString(eventReceived)); } else { - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Successfully recevied " + XEmbedHelper.msgidToString(event)); } } @@ -648,7 +648,7 @@ public class XEmbedServerTester implements XEventDispatcher { if (ev.get_type() == ClientMessage) { XClientMessageEvent msg = ev.get_xclient(); if (msg.get_message_type() == xembed.XEmbed.getAtom()) { - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1))); } switch ((int)msg.get_data(1)) { @@ -675,12 +675,12 @@ public class XEmbedServerTester implements XEventDispatcher { synchronized(EVENT_LOCK) { events.add((int)msg.get_data(1)); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Tester is waiting for " + XEmbedHelper.msgidToString(eventWaited)); } if ((int)msg.get_data(1) == eventWaited) { eventReceived = (int)msg.get_data(1); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Notifying waiting object for event " + System.identityHashCode(EVENT_LOCK)); } EVENT_LOCK.notifyAll(); @@ -692,12 +692,12 @@ public class XEmbedServerTester implements XEventDispatcher { int eventID = (int)ev.get_type() | SYSTEM_EVENT_MASK; events.add(eventID); - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Tester is waiting for " + XEmbedHelper.msgidToString(eventWaited) + ", but we received " + ev + "(" + XEmbedHelper.msgidToString(eventID) + ")"); } if (eventID == eventWaited) { eventReceived = eventID; - if (xembedLog.isLoggable(PlatformLogger.FINER)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINER)) { xembedLog.finer("Notifying waiting object" + System.identityHashCode(EVENT_LOCK)); } EVENT_LOCK.notifyAll(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java index dfea40d78d3..be1ebfb334f 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java @@ -139,7 +139,7 @@ public class XEmbeddedFramePeer extends XFramePeer { { assert (SunToolkit.isAWTLockHeldByCurrentThread()); XConfigureEvent xe = xev.get_xconfigure(); - if (xembedLog.isLoggable(PlatformLogger.FINE)) { + if (xembedLog.isLoggable(PlatformLogger.Level.FINE)) { xembedLog.fine(xe.toString()); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java index 500226a0403..e45f67ffde9 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java @@ -119,7 +119,7 @@ public final class XErrorHandlerUtil { // Default XErrorHandler may just terminate the process. Don't call it. // return XlibWrapper.CallErrorHandler(saved_error_handler, display, error.pData); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Unhandled XErrorEvent: " + "id=" + error.get_resourceid() + ", " + "serial=" + error.get_serial() + ", " + diff --git a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index 0842417e713..b1c2b0ed845 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -720,7 +720,7 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe } File fe = new File(dir).getAbsoluteFile(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current directory : " + fe); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java index 9a8212919a6..050e0f20171 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java @@ -75,7 +75,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { winAttr.isResizable = true; // target.isResizable(); winAttr.title = target.getTitle(); winAttr.initialResizability = target.isResizable(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Frame''s initial attributes: decor {0}, resizable {1}, undecorated {2}, initial state {3}", Integer.valueOf(winAttr.decorations), Boolean.valueOf(winAttr.initialResizability), Boolean.valueOf(!winAttr.nativeDecor), Integer.valueOf(winAttr.initialState)); @@ -209,7 +209,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { } public void setMaximizedBounds(Rectangle b) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting maximized bounds to " + b); } if (b == null) return; @@ -228,7 +228,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { } else { hints.set_max_height((int)XlibWrapper.DisplayHeight(XToolkit.getDisplay(), XlibWrapper.DefaultScreen(XToolkit.getDisplay()))); } - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags())); } XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), window, hints.pData); @@ -258,18 +258,18 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { int changed = state ^ newState; int changeIconic = changed & Frame.ICONIFIED; boolean iconic = (newState & Frame.ICONIFIED) != 0; - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})", Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic)); } if (changeIconic != 0 && iconic) { - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber()); } XToolkit.awtLock(); try { int res = XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), getShell(), getScreenNumber()); - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("XIconifyWindow returned " + res); } } @@ -281,7 +281,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { setExtendedState(newState); } if (changeIconic != 0 && !iconic) { - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("DeIconifying " + this); } xSetVisible(true); @@ -296,7 +296,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { super.handlePropertyNotify(xev); XPropertyEvent ev = xev.get_xproperty(); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Property change {0}", ev); } /* @@ -311,7 +311,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { final int newState = XWM.getWM().getState(this); int changed = state ^ newState; if (changed == 0) { - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("State is the same: " + state); } return; @@ -365,7 +365,7 @@ class XFramePeer extends XDecoratedPeer implements FramePeer { XWMHints hints = getWMHints(); hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags()); hints.set_initial_state(wm_state); - if (stateLog.isLoggable(PlatformLogger.FINE)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINE)) { stateLog.fine("Setting initial WM state on " + this + " to " + wm_state); } XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java index 8c14887748e..7c6684bfddc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,8 @@ package sun.awt.X11; import java.awt.*; import java.awt.image.*; -import sun.awt.X11GraphicsConfig; + +import sun.awt.IconInfo; import sun.awt.image.ToolkitImage; import sun.awt.image.ImageRepresentation; @@ -61,7 +62,7 @@ public class XIconWindow extends XBaseWindow { final long screen = adata.get_awt_visInfo().get_screen(); final long display = XToolkit.getDisplay(); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest(adata.toString()); } @@ -73,13 +74,13 @@ public class XIconWindow extends XBaseWindow { } int count = Native.getInt(XlibWrapper.iarg1); long sizes_ptr = Native.getLong(XlibWrapper.larg1); // XIconSize* - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("count = {1}, sizes_ptr = {0}", Long.valueOf(sizes_ptr), Integer.valueOf(count)); } XIconSize[] res = new XIconSize[count]; for (int i = 0; i < count; i++, sizes_ptr += XIconSize.getSize()) { res[i] = new XIconSize(sizes_ptr); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("sizes_ptr[{1}] = {0}", res[i], Integer.valueOf(i)); } } @@ -98,7 +99,7 @@ public class XIconWindow extends XBaseWindow { } XIconSize[] sizeList = getIconSizes(); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Icon sizes: {0}", (Object[]) sizeList); } if (sizeList == null) { @@ -147,11 +148,11 @@ public class XIconWindow extends XBaseWindow { } } } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("found=" + found); } if (!found) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("widthHint=" + widthHint + ", heightHint=" + heightHint + ", saveWidth=" + saveWidth + ", saveHeight=" + saveHeight + ", max_width=" + sizeList[0].get_max_width() @@ -167,7 +168,7 @@ public class XIconWindow extends XBaseWindow { /* determine which way to scale */ int wdiff = widthHint - sizeList[0].get_max_width(); int hdiff = heightHint - sizeList[0].get_max_height(); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("wdiff=" + wdiff + ", hdiff=" + hdiff); } if (wdiff >= hdiff) { /* need to scale width more */ @@ -199,7 +200,7 @@ public class XIconWindow extends XBaseWindow { XToolkit.awtUnlock(); } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("return " + saveWidth + "x" + saveHeight); } return new Dimension(saveWidth, saveHeight); @@ -406,12 +407,12 @@ public class XIconWindow extends XBaseWindow { * Sets icon image by selecting one of the images from the list. * The selected image is the one having the best matching size. */ - void setIconImages(java.util.List icons) { + void setIconImages(java.util.List icons) { if (icons == null || icons.size() == 0) return; int minDiff = Integer.MAX_VALUE; Image min = null; - for (XIconInfo iconInfo : icons) { + for (IconInfo iconInfo : icons) { if (iconInfo.isValid()) { Image image = iconInfo.getImage(); Dimension dim = calcIconSize(image.getWidth(null), image.getHeight(null)); @@ -426,7 +427,7 @@ public class XIconWindow extends XBaseWindow { } } if (min != null) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null)); } setIconImage(min); @@ -454,7 +455,7 @@ public class XIconWindow extends XBaseWindow { } Dimension iconSize = getIconSize(width, height); if (iconSize != null) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Icon size: {0}", iconSize); } iconWidth = iconSize.width; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java b/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java index a616bdf07e2..6392f2cbf8a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java @@ -102,7 +102,7 @@ public class XInputMethod extends X11InputMethod { protected ComponentPeer getPeer(Component client) { XComponentPeer peer; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Client is " + client); } peer = (XComponentPeer)XToolkit.targetToPeer(client); @@ -110,7 +110,7 @@ public class XInputMethod extends X11InputMethod { client = getParent(client); peer = (XComponentPeer)XToolkit.targetToPeer(client); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Peer is {0}, client is {1}", peer, client); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java index 79041cbbb96..31548f90a81 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,11 @@ package sun.awt.X11; import java.awt.Component; import java.awt.Window; -import sun.util.logging.PlatformLogger; + +import sun.awt.AWTAccessor; import sun.awt.CausedFocusEvent; import sun.awt.KeyboardFocusManagerPeerImpl; +import sun.util.logging.PlatformLogger; public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.X11.focus.XKeyboardFocusManagerPeer"); @@ -60,7 +62,7 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { @Override public void setCurrentFocusedWindow(Window win) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Setting current focused window " + win); } @@ -68,13 +70,13 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { synchronized(this) { if (currentFocusedWindow != null) { - from = (XWindowPeer)currentFocusedWindow.getPeer(); + from = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow); } currentFocusedWindow = win; if (currentFocusedWindow != null) { - to = (XWindowPeer)currentFocusedWindow.getPeer(); + to = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java index eeeed3975cd..25cf66d83ef 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -575,12 +575,12 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } void mousePressed(MouseEvent mouseEvent) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis); } if (isEnabled() && mouseEvent.getButton() == MouseEvent.BUTTON1) { if (inWindow(mouseEvent.getX(), mouseEvent.getY())) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mouse press in items area"); } active = WINDOW; @@ -619,7 +619,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { currentIndex = -1; } } else if (inVerticalScrollbar(mouseEvent.getX(), mouseEvent.getY())) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mouse press in vertical scrollbar"); } active = VERSCROLLBAR; @@ -628,7 +628,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { mouseEvent.getX() - (width - SCROLLBAR_WIDTH), mouseEvent.getY()); } else if (inHorizontalScrollbar(mouseEvent.getX(), mouseEvent.getY())) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mouse press in horizontal scrollbar"); } active = HORSCROLLBAR; @@ -813,7 +813,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(e.toString()); } switch(keyCode) { @@ -1000,7 +1000,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { */ public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Notify value changed on " + obj + " to " + v); } int value = obj.getValue(); @@ -1085,7 +1085,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } } } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Adding item '" + item + "' to " + addedIndex); } @@ -1105,7 +1105,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { | ((vsb.needsRepaint())?(PAINT_VSCROLL):0); } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Last visible: " + getLastVisibleItem() + ", hsb changed : " + (hsbWasVis ^ hsbVis) + ", items changed " + repaintItems); } @@ -1123,11 +1123,11 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { boolean vsbWasVisible = vsbVis; int oldLastDisplayed = lastItemDisplayed(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Deleting from " + s + " to " + e); } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() + ", size " + items.size()); } @@ -1197,7 +1197,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { options |= PAINT_FOCUS; } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Multiple selections: " + multipleSelections); } @@ -1452,7 +1452,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { * y is the number of items to scroll */ void scrollVertical(int y) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Scrolling vertically by " + y); } int itemsInWin = itemsInWindow(); @@ -1494,7 +1494,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { * x is the number of pixels to scroll */ void scrollHorizontal(int x) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Scrolling horizontally by " + y); } int w = getListWidth(); @@ -1669,11 +1669,12 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { * Do handleJavaMouseEvent on EDT */ void handleJavaMouseEventOnEDT(final MouseEvent me){ - EventQueue.invokeLater(new Runnable() { - public void run() { - handleJavaMouseEvent(me); - } - }); + InvocationEvent ev = new InvocationEvent(target, new Runnable() { + public void run() { + handleJavaMouseEvent(me); + } + }); + postEvent(ev); } /* @@ -1732,7 +1733,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } if (localBuffer == null) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Creating buffer " + width + "x" + height); } // use GraphicsConfig.cCVI() instead of Component.cVI(), @@ -1771,7 +1772,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { private void paint(Graphics listG, int firstItem, int lastItem, int options, Rectangle source, Point distance) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options); } if (firstItem > lastItem) { @@ -1862,7 +1863,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } private void paintItems(Graphics g, int firstItem, int lastItem, int options) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem()); } @@ -1875,7 +1876,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { firstItem = Math.max(getFirstVisibleItem(), firstItem); lastItem = Math.min(lastItem, items.size()-1); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Actually painting items from " + firstItem + " to " + lastItem + ", items in window " + itemsInWindow()); } @@ -1885,7 +1886,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } private void paintItem(Graphics g, int index) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Painting item " + index); } // 4895367 - only paint items which are visible @@ -1895,7 +1896,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { int h = getItemHeight(); int y = getItemY(index); int x = getItemX(); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2))); } g.setClip(x, y, w - (SPACE*2), h-(SPACE*2)); @@ -1903,14 +1904,14 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { // Always paint the background so that focus is unpainted in // multiselect mode if (isSelected(index)) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Painted item is selected"); } g.setColor(getListForeground()); } else { g.setColor(getListBackground()); } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Filling " + new Rectangle(x, y, w, h)); } g.fillRect(x, y, w, h); @@ -1936,7 +1937,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Painting scrollbar " + scr + " width " + width + " height " + height + ", paintAll " + paintAll); } @@ -1976,19 +1977,19 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { if (paintFocus && !hasFocus()) { paintFocus = false; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " + (isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus); } Shape clip = g.getClip(); g.setClip(0, 0, listWidth, listHeight); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight)); } Rectangle rect = getFocusRect(); if (prevFocusRect != null) { // Erase focus rect - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Erasing previous focus rect " + prevFocusRect); } g.setColor(getListBackground()); @@ -1997,7 +1998,7 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { } if (paintFocus) { // Paint new - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Painting focus rect " + rect); } g.setColor(getListForeground()); // Focus color is always black on Linux diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java index 997fa1c8838..fbe396b62cd 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java @@ -128,7 +128,7 @@ public class XMSelection { long display = XToolkit.getDisplay(); synchronized(this) { setOwner(owner, screen); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("New Selection Owner for screen " + screen + " = " + owner ); } XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask); @@ -150,14 +150,14 @@ public class XMSelection { try { try { long display = XToolkit.getDisplay(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Grabbing XServer"); } XlibWrapper.XGrabServer(display); synchronized(this) { String selection_name = getName()+"_S"+screen; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Screen = " + screen + " selection name = " + selection_name); } XAtom atom = XAtom.get(selection_name); @@ -166,7 +166,7 @@ public class XMSelection { long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom()); if (owner != 0) { setOwner(owner, screen); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Selection Owner for screen " + screen + " = " + owner ); } XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask); @@ -183,7 +183,7 @@ public class XMSelection { e.printStackTrace(); } finally { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("UnGrabbing XServer"); } XlibWrapper.XUngrabServer(XToolkit.getDisplay()); @@ -197,7 +197,7 @@ public class XMSelection { static boolean processClientMessage(XEvent xev, int screen) { XClientMessageEvent xce = xev.get_xclient(); if (xce.get_message_type() == XA_MANAGER.getAtom()) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("client messags = " + xce); } long timestamp = xce.get_data(0); @@ -306,7 +306,7 @@ public class XMSelection { synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Selection Changed : Screen = " + screen + "Event =" + ev); } if (listeners != null) { @@ -319,7 +319,7 @@ public class XMSelection { } synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Owner dead : Screen = " + screen + "Event =" + de); } if (listeners != null) { @@ -333,7 +333,7 @@ public class XMSelection { } void dispatchSelectionEvent(XEvent xev, int screen) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Event =" + xev); } if (xev.get_type() == XConstants.DestroyNotify) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java index 3b04e74fe9d..7cf0cd73123 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java @@ -519,7 +519,7 @@ public class XMenuBarPeer extends XBaseMenuWindow implements MenuBarPeer { */ public void handleKeyPress(XEvent xev) { XKeyEvent xkey = xev.get_xkey(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(xkey.toString()); } if (isEventDisabled(xev)) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java index 5931d8fecb4..d88c0c99725 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java @@ -111,7 +111,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer { * for adding separators */ public void addSeparator() { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("addSeparator is not implemented"); } } @@ -121,7 +121,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer { if (menuWindow != null) { menuWindow.addItem(item); } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Attempt to use XMenuWindowPeer without window"); } } @@ -132,7 +132,7 @@ public class XMenuPeer extends XMenuItemPeer implements MenuPeer { if (menuWindow != null) { menuWindow.delItem(index); } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Attempt to use XMenuWindowPeer without window"); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java index 3d19233c8a3..a524f0d6e38 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuWindow.java @@ -399,7 +399,7 @@ public class XMenuWindow extends XBaseMenuWindow { if (!isCreated()) { return; } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("showing menu window + " + getWindow() + " at " + bounds); } XToolkit.awtLock(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java index da35f123aad..dfd372edabf 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ package sun.awt.X11; import java.awt.Frame; + +import sun.awt.IconInfo; import sun.util.logging.PlatformLogger; final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol @@ -43,7 +45,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } public void setState(XWindowPeer window, int state) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting state of " + window + " to " + state); } if (window.isShowing()) { @@ -55,7 +57,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { @@ -68,7 +70,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); @@ -103,7 +105,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt default: return; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Requesting state on " + window + " for " + state); } req.set_type((int)XConstants.ClientMessage); @@ -187,7 +189,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt req.set_data(1, state.getAtom()); // Fix for 6735584: req.data[2] must be set to 0 when only one property is changed req.set_data(2, 0); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting _NET_STATE atom {0} on {1} for {2}", state, window, Boolean.valueOf(isAdd)); } XToolkit.awtLock(); @@ -214,7 +216,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt * @param reset Indicates operation, 'set' if false, 'reset' if true */ private void setStateHelper(XWindowPeer window, XAtom state, boolean set) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Window visibility is: withdrawn={0}, visible={1}, mapped={2} showing={3}", Boolean.valueOf(window.isWithdrawn()), Boolean.valueOf(window.isVisible()), Boolean.valueOf(window.isMapped()), Boolean.valueOf(window.isShowing())); @@ -223,7 +225,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt requestState(window, state, set); } else { XAtomList net_wm_state = window.getNETWMState(); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Current state on {0} is {1}", window, net_wm_state); } if (!set) { @@ -231,7 +233,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } else { net_wm_state.add(state); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting states on {0} to {1}", window, net_wm_state); } window.setNETWMState(net_wm_state); @@ -290,7 +292,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } NetWindow = checkAnchor(XA_NET_SUPPORTING_WM_CHECK, XAtom.XA_WINDOW); supportChecked = true; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### " + this + " is active: " + (NetWindow != 0)); } } @@ -302,7 +304,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt boolean doStateProtocol() { boolean res = active() && checkProtocol(XA_NET_SUPPORTED, XA_NET_WM_STATE); - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("doStateProtocol() returns " + res); } return res; @@ -331,7 +333,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt if (net_wm_name_string == null) { return false; } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### WM_NAME = " + net_wm_name_string); } return net_wm_name_string.startsWith(name); @@ -372,10 +374,10 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } /** - * Sets _NET_WM_ICON property on the window using the List of XIconInfo + * Sets _NET_WM_ICON property on the window using the List of IconInfo * If icons is null or empty list, removes _NET_WM_ICON property */ - public void setWMIcons(XWindowPeer window, java.util.List icons) { + public void setWMIcons(XWindowPeer window, java.util.List icons) { if (window == null) return; XAtom iconsAtom = XAtom.get("_NET_WM_ICON"); @@ -385,7 +387,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt } int length = 0; - for (XIconInfo ii : icons) { + for (IconInfo ii : icons) { length += ii.getRawLength(); } int cardinalSize = (XlibWrapper.dataModel == 32) ? 4 : 8; @@ -395,7 +397,7 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt long buffer = XlibWrapper.unsafe.allocateMemory(bufferSize); try { long ptr = buffer; - for (XIconInfo ii : icons) { + for (IconInfo ii : icons) { int size = ii.getRawLength() * cardinalSize; if (XlibWrapper.dataModel == 32) { XlibWrapper.copyIntArray(ptr, ii.getIntData(), size); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java index 97afe322b04..cbb71925b50 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java @@ -123,7 +123,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer { * for adding separators */ public void addSeparator() { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("addSeparator is not implemented"); } } @@ -343,7 +343,7 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer { */ public void handleKeyPress(XEvent xev) { XKeyEvent xkey = xev.get_xkey(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(xkey.toString()); } if (isEventDisabled(xev)) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java index 81200b76790..bf3de6ef154 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java @@ -54,7 +54,7 @@ class XProtocol { } finally { if (firstCheck) { firstCheck = false; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("{0}:{1} supports {2}", this, listName, protocols); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java index d8a8aaf8474..6afbac21fed 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java @@ -118,7 +118,7 @@ abstract class XScrollbar { abstract protected void rebuildArrows(); public void setSize(int width, int height) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Setting scroll bar " + this + " size to " + width + "x" + height); } this.width = width; @@ -166,7 +166,7 @@ abstract class XScrollbar { * @param paintAll paint the whole scrollbar if true, just the thumb is false */ void paint(Graphics g, Color colors[], boolean paintAll) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Painting scrollbar " + this); } @@ -339,7 +339,7 @@ abstract class XScrollbar { * Tell the scroller to start scrolling. */ void startScrolling() { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Start scrolling on " + this); } // Make sure that we scroll at least once @@ -361,7 +361,7 @@ abstract class XScrollbar { * See 6243382 for more information */ void startScrollingInstance() { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Start scrolling on " + this); } // Make sure that we scroll at least once @@ -376,7 +376,7 @@ abstract class XScrollbar { * See 6243382 for more information */ void stopScrollingInstance() { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Stop scrolling on " + this); } @@ -464,7 +464,7 @@ abstract class XScrollbar { return; } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { String type; switch (id) { case MouseEvent.MOUSE_PRESSED: diff --git a/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java index f77519c6d3a..2180f2961d0 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java @@ -156,7 +156,7 @@ class XScrollbarPeer extends XComponentPeer implements ScrollbarPeer, XScrollbar public void handleJavaKeyEvent(KeyEvent event) { super.handleJavaKeyEvent(event); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("KeyEvent on scrollbar: " + event); } if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java index 2407ccb174e..eb1774c766f 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java @@ -58,7 +58,7 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener { long selection_owner = selection.getOwner(SCREEN); available = (selection_owner != XConstants.None); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(" check if system tray is available. selection owner: " + selection_owner); } } @@ -108,7 +108,7 @@ public class XSystemTrayPeer implements SystemTrayPeer, XMSelectionListener { void addTrayIcon(XTrayIconPeer tiPeer) throws AWTException { long selection_owner = selection.getOwner(SCREEN); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(" send SYSTEM_TRAY_REQUEST_DOCK message to owner: " + selection_owner); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java index c87d7a1ec28..be948e2a708 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java @@ -258,7 +258,7 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } public void setBackground(Color c) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("target="+ target + ", old=" + background + ", new=" + c); } background = c; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 607537cdaa4..32eceaae3be 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -266,7 +266,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { ((XAWTXSettings)xs).dispose(); } freeXKB(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { dumpPeers(); } } @@ -524,7 +524,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } static void processException(Throwable thr) { - if (log.isLoggable(PlatformLogger.WARNING)) { + if (log.isLoggable(PlatformLogger.Level.WARNING)) { log.warning("Exception on Toolkit thread", thr); } } @@ -586,7 +586,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { continue; } - if (eventLog.isLoggable(PlatformLogger.FINER)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINER)) { eventLog.finer("{0}", ev); } @@ -602,13 +602,13 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } } } - if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) { + if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) { keyEventLog.fine("before XFilterEvent:"+ev); } if (XlibWrapper.XFilterEvent(ev.getPData(), w)) { continue; } - if( keyEventLog.isLoggable(PlatformLogger.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) { + if( keyEventLog.isLoggable(PlatformLogger.Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) { keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT? } @@ -1321,7 +1321,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } static void dumpPeers() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mapped windows:"); Iterator iter = winMap.entrySet().iterator(); while (iter.hasNext()) { @@ -1417,7 +1417,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } } catch (InterruptedException ie) { // Note: the returned timeStamp can be incorrect in this case. - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")"); } } @@ -1584,7 +1584,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { name = "gnome." + name; setDesktopProperty(name, e.getValue()); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("name = " + name + " value = " + e.getValue()); } @@ -1773,7 +1773,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } finally { awtUnlock(); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("metaMask = " + metaMask); log.fine("altMask = " + altMask); log.fine("numLockMask = " + numLockMask); @@ -1795,11 +1795,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } awtLock(); try { - if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) { + if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("Removing task " + task); } if (timeoutTasks == null) { - if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) { + if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("Task is not scheduled"); } return; @@ -1846,7 +1846,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { awtLock(); try { - if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) { + if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("XToolkit.schedule(): current time={0}" + "; interval={1}" + "; task being added={2}" + "; tasks before addition={3}", @@ -1893,7 +1893,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { * Called from run() under awtLock. */ private static void callTimeoutTasks() { - if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) { + if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" + "; tasks={1}", Long.valueOf(System.currentTimeMillis()), timeoutTasks); } @@ -1911,7 +1911,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { for (Iterator iter = tasks.iterator(); iter.hasNext();) { Runnable task = (Runnable)iter.next(); - if (timeoutTaskLog.isLoggable(PlatformLogger.FINER)) { + if (timeoutTaskLog.isLoggable(PlatformLogger.Level.FINER)) { timeoutTaskLog.finer("XToolkit.callTimeoutTasks(): current time={0}" + "; about to run task={1}", Long.valueOf(currentTime), task); } @@ -1986,7 +1986,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { */ long current_time_utc = System.currentTimeMillis(); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("reset_time=" + reset_time_utc + ", current_time=" + current_time_utc + ", server_offset=" + server_offset + ", wrap_time=" + WRAP_TIME_MILLIS); } @@ -1995,7 +1995,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { reset_time_utc = System.currentTimeMillis() - getCurrentServerTime(); } - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("result = " + (reset_time_utc + server_offset)); } return reset_time_utc + server_offset; @@ -2074,14 +2074,14 @@ public final class XToolkit extends UNIXToolkit implements Runnable { if (prop == null) { backingStoreType = XConstants.NotUseful; - if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) { + if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) { backingStoreLog.config("The system property sun.awt.backingStore is not set" + ", by default backingStore=NotUseful"); } return; } - if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) { + if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) { backingStoreLog.config("The system property sun.awt.backingStore is " + prop); } prop = prop.toLowerCase(); @@ -2093,7 +2093,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { backingStoreType = XConstants.NotUseful; } - if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) { + if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) { backingStoreLog.config("backingStore(as provided by the system property)=" + ( backingStoreType == XConstants.NotUseful ? "NotUseful" : backingStoreType == XConstants.WhenMapped ? @@ -2103,7 +2103,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { if (sun.java2d.x11.X11SurfaceData.isDgaAvailable()) { backingStoreType = XConstants.NotUseful; - if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) { + if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) { backingStoreLog.config("DGA is available, backingStore=NotUseful"); } @@ -2118,7 +2118,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { == XConstants.NotUseful) { backingStoreType = XConstants.NotUseful; - if (backingStoreLog.isLoggable(PlatformLogger.CONFIG)) { + if (backingStoreLog.isLoggable(PlatformLogger.Level.CONFIG)) { backingStoreLog.config("Backing store is not available on the screen " + i + ", backingStore=NotUseful"); } @@ -2396,7 +2396,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { // Wait for selection notify for oops on win long event_number = getEventNumber(); XAtom atom = XAtom.get("WM_S0"); - if (eventLog.isLoggable(PlatformLogger.FINER)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINER)) { eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom())); } XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(), diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java index 5ee6b65ec55..24f2656f891 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java @@ -106,7 +106,7 @@ public class XTrayIconPeer implements TrayIconPeer, XConfigureEvent ce = ev.get_xconfigure(); - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})", XTrayIconPeer.this, ce.get_width(), ce.get_height(), ce.get_x(), ce.get_y(), old_x, old_y); @@ -130,7 +130,7 @@ public class XTrayIconPeer implements TrayIconPeer, // If both the height and the width differ from the fixed size then WM // must level at least one side to the fixed size. For some reason it may take // a few hops (even after reparenting) and we have to skip the intermediate ones. - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Skipping as intermediate resizing.", XTrayIconPeer.this); } @@ -138,7 +138,7 @@ public class XTrayIconPeer implements TrayIconPeer, } else if (ce.get_height() > TRAY_ICON_HEIGHT) { - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"Y\".", XTrayIconPeer.this); } @@ -153,7 +153,7 @@ public class XTrayIconPeer implements TrayIconPeer, } else if (ce.get_width() > TRAY_ICON_WIDTH) { - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"X\".", XTrayIconPeer.this); } @@ -173,7 +173,7 @@ public class XTrayIconPeer implements TrayIconPeer, if (ex_height != 0) { - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".", XTrayIconPeer.this); } @@ -184,7 +184,7 @@ public class XTrayIconPeer implements TrayIconPeer, } else if (ex_width != 0) { - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".", XTrayIconPeer.this); } @@ -193,7 +193,7 @@ public class XTrayIconPeer implements TrayIconPeer, ce.get_x() + ex_width/2 - TRAY_ICON_WIDTH/2, ce.get_y()); } else { - if (ctrLog.isLoggable(PlatformLogger.FINE)) { + if (ctrLog.isLoggable(PlatformLogger.Level.FINE)) { ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Skipping.", XTrayIconPeer.this); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java index 35b5cfe703e..f7e4ba1f8ad 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java @@ -63,7 +63,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { req.set_format(32); req.set_data(0, (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT)); req.set_data(1, win_state); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Sending WIN_STATE to root to change the state to " + win_state); } try { @@ -113,7 +113,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { win_state &= ~WIN_STATE_MAXIMIZED_HORIZ; } if ((old_win_state ^ win_state) != 0) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state); } XA_WIN_STATE.setCard32Property(window, win_state); @@ -160,7 +160,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { req.set_data(0, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP); req.set_data(1, 0); req.set_data(2, 0); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting layer " + layer + " by root message : " + req); } XToolkit.awtLock(); @@ -177,7 +177,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { } req.dispose(); } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting layer property to " + layer); } XA_WIN_LAYER.setCard32Property(window, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP); @@ -205,7 +205,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { } WinWindow = checkAnchor(XA_WIN_SUPPORTING_WM_CHECK, XAtom.XA_CARDINAL); supportChecked = true; - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### " + this + " is active: " + (WinWindow != 0)); } } @@ -216,7 +216,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { } boolean doStateProtocol() { boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_STATE); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### " + this + " supports state: " + res); } return res; @@ -224,7 +224,7 @@ class XWINProtocol extends XProtocol implements XStateProtocol, XLayerProtocol { boolean doLayerProtocol() { boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_LAYER); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("### " + this + " supports layer: " + res); } return res; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWM.java b/jdk/src/solaris/classes/sun/awt/X11/XWM.java index 94410519dca..54eaa656232 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java @@ -30,6 +30,7 @@ */ package sun.awt.X11; +import sun.awt.IconInfo; import sun.misc.Unsafe; import java.awt.Insets; import java.awt.Frame; @@ -148,7 +149,7 @@ final class XWM XWM(int WMID) { this.WMID = WMID; initializeProtocols(); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Window manager: " + toString()); } } @@ -254,7 +255,7 @@ final class XWM * having a window manager running. I.e. it does not reparent * top level shells. */ - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("eXcursion means NO_WM"); } return true; @@ -272,7 +273,7 @@ final class XWM long selection_owner = XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(), XAtom.get(selection_name).getAtom()); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("selection owner of " + selection_name + " is " + selection_owner); } @@ -301,7 +302,7 @@ final class XWM XToolkit.getDefaultRootWindow(), XConstants.CWEventMask, substruct.pData); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("It looks like there is no WM thus NO_WM"); } } @@ -345,7 +346,7 @@ final class XWM byte[] bytes = XlibWrapper.getStringBytes(getter.getData()); String id = new String(bytes); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("ENLIGHTENMENT_COMMS is " + id); } @@ -354,15 +355,15 @@ final class XWM try { Matcher match = winIdPat.matcher(id); if (match.matches()) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Match group count: " + match.groupCount()); } String longId = match.group(1); - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("Match group 1 " + longId); } long winid = Long.parseLong(longId, 16); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Enlightenment communication window " + winid); } return winid; @@ -371,7 +372,7 @@ final class XWM return 0; } } catch (Exception e) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { e.printStackTrace(); } return 0; @@ -417,7 +418,7 @@ final class XWM static boolean isCDE() { if (!XA_DT_SM_WINDOW_INFO.isInterned()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("{0} is not interned", XA_DT_SM_WINDOW_INFO); } return false; @@ -450,7 +451,7 @@ final class XWM /* Now check that this window has _DT_SM_STATE_INFO (ignore contents) */ if (!XA_DT_SM_STATE_INFO.isInterned()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("{0} is not interned", XA_DT_SM_STATE_INFO); } return false; @@ -624,7 +625,7 @@ final class XWM */ if (!XA_ICEWM_WINOPTHINT.isInterned()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT); } return false; @@ -660,7 +661,7 @@ final class XWM */ static boolean isIceWM() { if (!XA_ICEWM_WINOPTHINT.isInterned()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT); } return false; @@ -673,7 +674,7 @@ final class XWM try { int status = getter.execute(); boolean res = (status == XConstants.Success && getter.getActualType() != 0); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res); } return !res || isNetWMName("IceWM"); @@ -729,7 +730,7 @@ final class XWM return wm; } static int getWMID() { - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("awt_wmgr = " + awt_wmgr); } /* @@ -753,7 +754,7 @@ final class XWM // Later, WM will initialize its own version of protocol XNETProtocol l_net_protocol = g_net_protocol = new XNETProtocol(); l_net_protocol.detect(); - if (log.isLoggable(PlatformLogger.FINE) && l_net_protocol.active()) { + if (log.isLoggable(PlatformLogger.Level.FINE) && l_net_protocol.active()) { log.fine("_NET_WM_NAME is " + l_net_protocol.getWMName()); } XWINProtocol win = g_win_protocol = new XWINProtocol(); @@ -837,7 +838,7 @@ final class XWM } hints.set_flags(hints.get_flags() & ~mask); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags())); } XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), @@ -896,7 +897,7 @@ final class XWM XAtomList decorDel = new XAtomList(); decorations = normalizeMotifDecor(decorations); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations)); } if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) { @@ -915,7 +916,7 @@ final class XWM insLog.finer("Deleting OL_DECOR"); XA_OL_DECOR_DEL.DeleteProperty(window); } else { - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Setting OL_DECOR to " + decorDel); } XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel); @@ -945,7 +946,7 @@ final class XWM hints.set_functions(functions); hints.set_decorations(decorations); - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("Setting MWM_HINTS to " + hints); } window.setMWMHints(hints); @@ -1009,7 +1010,7 @@ final class XWM * Make specified shell resizable. */ static void setShellResizable(XDecoratedPeer window) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting shell resizable " + window); } XToolkit.awtLock(); @@ -1041,7 +1042,7 @@ final class XWM static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds, boolean justChangeSize) { - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions + ", shellBounds " + shellBounds +", just change size: " + justChangeSize); } @@ -1175,7 +1176,7 @@ final class XWM stateLog.finer("WithdrawnState"); return false; } else { - if (stateLog.isLoggable(PlatformLogger.FINER)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINER)) { stateLog.finer("Window WM_STATE is " + wm_state); } } @@ -1186,7 +1187,7 @@ final class XWM for (XStateProtocol proto : getProtocols(XStateProtocol.class)) { is_state_change |= proto.isStateChange(e); - if (stateLog.isLoggable(PlatformLogger.FINEST)) { + if (stateLog.isLoggable(PlatformLogger.Level.FINEST)) { stateLog.finest(proto + ": is state changed = " + is_state_change); } } @@ -1340,7 +1341,7 @@ final class XWM res = defaultInsets; } } - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("WM guessed insets: " + res); } return res; @@ -1411,7 +1412,7 @@ final class XWM XNETProtocol net_protocol = getWM().getNETProtocol(); if (net_protocol != null && net_protocol.active()) { Insets insets = getInsetsFromProp(window, XA_NET_FRAME_EXTENTS); - if (insLog.isLoggable(PlatformLogger.FINE)) { + if (insLog.isLoggable(PlatformLogger.Level.FINE)) { insLog.fine("_NET_FRAME_EXTENTS: {0}", insets); } @@ -1554,7 +1555,7 @@ final class XWM * [mwm, e!, kwin, fvwm2 ... ] */ Insets correctWM = XWM.getInsetsFromExtents(window); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Got insets from property: {0}", correctWM); } @@ -1617,7 +1618,7 @@ final class XWM } case XWM.OTHER_WM: default: { /* this is very similar to the E! case above */ - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("Getting correct insets for OTHER_WM/default, parent: {0}", parent); } syncTopLevelPos(parent, lwinAttr); @@ -1646,7 +1647,7 @@ final class XWM && lwinAttr.get_width()+2*lwinAttr.get_border_width() == pattr.get_width() && lwinAttr.get_height()+2*lwinAttr.get_border_width() == pattr.get_height()) { - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("Double reparenting detected, pattr({2})={0}, lwinAttr({3})={1}", lwinAttr, pattr, parent, window); } @@ -1676,7 +1677,7 @@ final class XWM * widths and inner/outer distinction, so for the time * being, just ignore it. */ - if (insLog.isLoggable(PlatformLogger.FINEST)) { + if (insLog.isLoggable(PlatformLogger.Level.FINEST)) { insLog.finest("Attrs before calculation: pattr({2})={0}, lwinAttr({3})={1}", lwinAttr, pattr, parent, window); } @@ -1719,7 +1720,7 @@ final class XWM * * @return true if hint was modified successfully, false otherwise */ - public boolean setNetWMIcon(XWindowPeer window, java.util.List icons) { + public boolean setNetWMIcon(XWindowPeer window, java.util.List icons) { if (g_net_protocol != null && g_net_protocol.active()) { g_net_protocol.setWMIcons(window, icons); return getWMID() != ICE_WM; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java index bb235a89e3a..0717dee3479 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,10 @@ package sun.awt.X11; import java.awt.*; -import java.awt.event.*; import java.awt.geom.Point2D; import java.lang.ref.WeakReference; -import sun.java2d.SunGraphics2D; -import sun.java2d.pipe.Region; + +import sun.awt.IconInfo; import sun.awt.AWTAccessor; import sun.awt.SunToolkit; @@ -56,37 +55,37 @@ class XWarningWindow extends XWindow { * 3 - 48x48 */ private int currentSize = -1; - private static XIconInfo[][] icons; - private static XIconInfo getSecurityIconInfo(int size, int num) { + private static IconInfo[][] icons; + private static IconInfo getSecurityIconInfo(int size, int num) { synchronized (XWarningWindow.class) { if (icons == null) { - icons = new XIconInfo[4][3]; + icons = new IconInfo[4][3]; if (XlibWrapper.dataModel == 32) { - icons[0][0] = new XIconInfo(XAWTIcon32_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new XIconInfo(XAWTIcon32_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new XIconInfo(XAWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new XIconInfo(XAWTIcon32_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new XIconInfo(XAWTIcon32_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new XIconInfo(XAWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new XIconInfo(XAWTIcon32_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new XIconInfo(XAWTIcon32_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new XIconInfo(XAWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new XIconInfo(XAWTIcon32_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new XIconInfo(XAWTIcon32_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new XIconInfo(XAWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); + icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); } else { - icons[0][0] = new XIconInfo(XAWTIcon64_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new XIconInfo(XAWTIcon64_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new XIconInfo(XAWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new XIconInfo(XAWTIcon64_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new XIconInfo(XAWTIcon64_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new XIconInfo(XAWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new XIconInfo(XAWTIcon64_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new XIconInfo(XAWTIcon64_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new XIconInfo(XAWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new XIconInfo(XAWTIcon64_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new XIconInfo(XAWTIcon64_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new XIconInfo(XAWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png); + icons[0][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png); } } } @@ -125,7 +124,7 @@ class XWarningWindow extends XWindow { try { if (newSize != currentSize) { currentSize = newSize; - XIconInfo ico = getSecurityIconInfo(currentSize, 0); + IconInfo ico = getSecurityIconInfo(currentSize, 0); XlibWrapper.SetBitmapShape(XToolkit.getDisplay(), getWindow(), ico.getWidth(), ico.getHeight(), ico.getIntData()); AWTAccessor.getWindowAccessor().setSecurityWarningSize( @@ -136,7 +135,7 @@ class XWarningWindow extends XWindow { } } - private XIconInfo getSecurityIconInfo() { + private IconInfo getSecurityIconInfo() { updateIconSize(); return getSecurityIconInfo(currentSize, currentIcon); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java index 3eb4cc87269..1e913e4ba90 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java @@ -402,7 +402,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { ((Component)e.getSource()).dispatchEvent(e); } }, PeerEvent.ULTIMATE_PRIORITY_EVENT); - if (focusLog.isLoggable(PlatformLogger.FINER) && (e instanceof FocusEvent)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER) && (e instanceof FocusEvent)) { focusLog.finer("Sending " + e); } XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), pe); @@ -662,7 +662,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if (isEventDisabled(xev)) { return; } - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine(xbe.toString()); } long when; @@ -698,7 +698,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { /* multiclick checking */ - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest("lastWindow = " + lastWindow + ", lastButton " + lastButton + ", lastTime " + lastTime + ", multiClickTime " + XToolkit.getMultiClickTime()); @@ -891,7 +891,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { super.handleXCrossingEvent(xev); XCrossingEvent xce = xev.get_xcrossing(); - if (eventLog.isLoggable(PlatformLogger.FINEST)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINEST)) { eventLog.finest(xce.toString()); } @@ -995,7 +995,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { Rectangle oldBounds = getBounds(); super.handleConfigureNotifyEvent(xev); - if (insLog.isLoggable(PlatformLogger.FINER)) { + if (insLog.isLoggable(PlatformLogger.Level.FINER)) { insLog.finer("Configure, {0}, event disabled: {1}", xev.get_xconfigure(), isEventDisabled(xev)); } @@ -1017,7 +1017,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { public void handleMapNotifyEvent(XEvent xev) { super.handleMapNotifyEvent(xev); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Mapped {0}", this); } if (isEventDisabled(xev)) { @@ -1041,7 +1041,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { } private void dumpKeysymArray(XKeyEvent ev) { - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine(" "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 0))+ "\n "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 1))+ "\n "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 2))+ @@ -1071,18 +1071,18 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { //return (uni > 0? uni + 0x01000000 : 0); } void logIncomingKeyEvent(XKeyEvent ev) { - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("--XWindow.java:handleKeyEvent:"+ev); } dumpKeysymArray(ev); - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("XXXXXXXXXXXXXX javakeycode will be most probably:0x"+ Integer.toHexString(XKeysym.getJavaKeycodeOnly(ev))); } } public void handleKeyPress(XEvent xev) { super.handleKeyPress(xev); XKeyEvent ev = xev.get_xkey(); - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine(ev.toString()); } if (isEventDisabled(xev)) { @@ -1097,14 +1097,14 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { int unicodeKey = 0; keysym[0] = XConstants.NoSymbol; - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { logIncomingKeyEvent( ev ); } if ( //TODO check if there's an active input method instance // without calling a native method. Is it necessary though? haveCurrentX11InputMethodInstance()) { if (x11inputMethodLookupString(ev.pData, keysym)) { - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("--XWindow.java XIM did process event; return; dec keysym processed:"+(keysym[0])+ "; hex keysym processed:"+Long.toHexString(keysym[0]) ); @@ -1112,7 +1112,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { return; }else { unicodeKey = keysymToUnicode( keysym[0], ev.get_state() ); - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("--XWindow.java XIM did NOT process event, hex keysym:"+Long.toHexString(keysym[0])+"\n"+ " unicode key:"+Integer.toHexString((int)unicodeKey)); } @@ -1122,7 +1122,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { // Produce do-it-yourself keysym and perhaps unicode character. keysym[0] = xkeycodeToKeysym(ev); unicodeKey = keysymToUnicode( keysym[0], ev.get_state() ); - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("--XWindow.java XIM is absent; hex keysym:"+Long.toHexString(keysym[0])+"\n"+ " unicode key:"+Integer.toHexString((int)unicodeKey)); } @@ -1148,7 +1148,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { // is undefined, we still have a guess of what has been engraved on a keytop. int unicodeFromPrimaryKeysym = keysymToUnicode( xkeycodeToPrimaryKeysym(ev) ,0); - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine(">>>Fire Event:"+ (ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+ "jkeycode:decimal="+jkc.getJavaKeycode()+ @@ -1173,7 +1173,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if (unicodeKey > 0 && !isDeadKey) { - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine("fire _TYPED on "+unicodeKey); } postKeyEvent( java.awt.event.KeyEvent.KEY_TYPED, @@ -1193,7 +1193,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { public void handleKeyRelease(XEvent xev) { super.handleKeyRelease(xev); XKeyEvent ev = xev.get_xkey(); - if (eventLog.isLoggable(PlatformLogger.FINE)) { + if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { eventLog.fine(ev.toString()); } if (isEventDisabled(xev)) { @@ -1205,7 +1205,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { private void handleKeyRelease(XKeyEvent ev) { int unicodeKey = 0; - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { logIncomingKeyEvent( ev ); } // Keysym should be converted to Unicode, if possible and necessary, @@ -1220,7 +1220,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if( jkc == null ) { jkc = new XKeysym.Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDEFINED, java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN); } - if (keyEventLog.isLoggable(PlatformLogger.FINE)) { + if (keyEventLog.isLoggable(PlatformLogger.Level.FINE)) { keyEventLog.fine(">>>Fire Event:"+ (ev.get_type() == XConstants.KeyPress ? "KEY_PRESSED; " : "KEY_RELEASED; ")+ "jkeycode:decimal="+jkc.getJavaKeycode()+ @@ -1357,12 +1357,12 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { void updateSizeHints(int x, int y, int width, int height) { long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition)); if (!isResizable()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Window {0} is not resizable", this); } flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize; } else { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Window {0} is resizable", this); } } @@ -1372,12 +1372,12 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { void updateSizeHints(int x, int y) { long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition); if (!isResizable()) { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Window {0} is not resizable", this); } flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize; } else { - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Window {0} is resizable", this); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java index 6b87d3fe12a..9e4270beb30 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,7 @@ * questions. */ package sun.awt.X11; -import java.awt.Image; -import java.util.ArrayList; +import sun.awt.IconInfo; class XWindowAttributesData { static int NORMAL = 0; @@ -51,7 +50,7 @@ class XWindowAttributesData { boolean initialResizability; int visibilityState; // updated by native X11 event handling code. String title; - java.util.List icons; + java.util.List icons; boolean iconsInherited; int decorations; // for future expansion to be able to // specify native decorations diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java index bab9ee11940..e0b1cc47887 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java @@ -30,8 +30,6 @@ import java.awt.event.ComponentEvent; import java.awt.event.FocusEvent; import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; - import java.awt.peer.ComponentPeer; import java.awt.peer.WindowPeer; @@ -55,6 +53,7 @@ import sun.awt.DisplayChangedListener; import sun.awt.SunToolkit; import sun.awt.X11GraphicsDevice; import sun.awt.X11GraphicsEnvironment; +import sun.awt.IconInfo; import sun.java2d.pipe.Region; @@ -226,7 +225,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, Window owner = t_window.getOwner(); if (owner != null) { ownerPeer = (XWindowPeer)owner.getPeer(); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Owner is " + owner); focusLog.finer("Owner peer is " + ownerPeer); focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow())); @@ -239,7 +238,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, XToolkit.awtLock(); try { // Set WM_TRANSIENT_FOR - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Setting transient on " + Long.toHexString(getWindow()) + " for " + Long.toHexString(ownerWindow)); } @@ -294,23 +293,23 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, Window target = (Window)this.target; java.util.List iconImages = ((Window)target).getIconImages(); XWindowPeer ownerPeer = getOwnerPeer(); - winAttr.icons = new ArrayList(); + winAttr.icons = new ArrayList(); if (iconImages.size() != 0) { //read icon images from target winAttr.iconsInherited = false; for (Iterator i = iconImages.iterator(); i.hasNext(); ) { Image image = i.next(); if (image == null) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("XWindowPeer.updateIconImages: Skipping the image passed into Java because it's null."); } continue; } - XIconInfo iconInfo; + IconInfo iconInfo; try { - iconInfo = new XIconInfo(image); + iconInfo = new IconInfo(image); } catch (Exception e){ - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon."); } continue; @@ -346,12 +345,12 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, * It does scale some of these icons to appropriate size * if it's necessary. */ - static java.util.List normalizeIconImages(java.util.List icons) { - java.util.List result = new ArrayList(); + static java.util.List normalizeIconImages(java.util.List icons) { + java.util.List result = new ArrayList(); int totalLength = 0; boolean haveLargeIcon = false; - for (XIconInfo icon : icons) { + for (IconInfo icon : icons) { int width = icon.getWidth(); int height = icon.getHeight(); int length = icon.getRawLength(); @@ -381,7 +380,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } - if (iconLog.isLoggable(PlatformLogger.FINEST)) { + if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) { iconLog.finest(">>> Length_ of buffer of icons data: " + totalLength + ", maximum length: " + MAXIMUM_BUFFER_LENGTH_NET_WM_ICON); } @@ -392,16 +391,16 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, /* * Dumps each icon from the list */ - static void dumpIcons(java.util.List icons) { - if (iconLog.isLoggable(PlatformLogger.FINEST)) { + static void dumpIcons(java.util.List icons) { + if (iconLog.isLoggable(PlatformLogger.Level.FINEST)) { iconLog.finest(">>> Sizes of icon images:"); - for (Iterator i = icons.iterator(); i.hasNext(); ) { + for (Iterator i = icons.iterator(); i.hasNext(); ) { iconLog.finest(" {0}", i.next()); } } } - public void recursivelySetIcon(java.util.List icons) { + public void recursivelySetIcon(java.util.List icons) { dumpIcons(winAttr.icons); setIconHints(icons); Window target = (Window)this.target; @@ -418,28 +417,28 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } - java.util.List getIconInfo() { + java.util.List getIconInfo() { return winAttr.icons; } - void setIconHints(java.util.List icons) { + void setIconHints(java.util.List icons) { //This does nothing for XWindowPeer, //It's overriden in XDecoratedPeer } - private static ArrayList defaultIconInfo; - protected synchronized static java.util.List getDefaultIconInfo() { + private static ArrayList defaultIconInfo; + protected synchronized static java.util.List getDefaultIconInfo() { if (defaultIconInfo == null) { - defaultIconInfo = new ArrayList(); + defaultIconInfo = new ArrayList(); if (XlibWrapper.dataModel == 32) { - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon16_png.java_icon16_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon24_png.java_icon24_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon32_png.java_icon32_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon48_png.java_icon48_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon16_png.java_icon16_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon24_png.java_icon24_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon32_png.java_icon32_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon48_png.java_icon48_png)); } else { - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon16_png.java_icon16_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon24_png.java_icon24_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon32_png.java_icon32_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon48_png.java_icon48_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon16_png.java_icon16_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon24_png.java_icon24_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon32_png.java_icon32_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon48_png.java_icon48_png)); } } return defaultIconInfo; @@ -667,7 +666,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, return; } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode"); } @@ -704,7 +703,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } if (newScreenNum != curScreenNum) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("XWindowPeer: Moved to a new screen"); } executeDisplayChangedOnEDT(newGC); @@ -779,7 +778,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // override_redirect all we can do is check whether our parent // is active. If it is - we can freely synthesize focus transfer. // Luckily, this logic is already implemented in requestWindowFocus. - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Requesting window focus"); } requestWindowFocus(time, timeProvided); @@ -807,7 +806,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, public void handleFocusEvent(XEvent xev) { XFocusChangeEvent xfe = xev.get_xfocus(); FocusEvent fe; - if (focusLog.isLoggable(PlatformLogger.FINE)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("{0}", xfe); } if (isEventDisabled(xev)) { @@ -992,7 +991,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } private void updateAlwaysOnTop() { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop)); } XWM.getWM().setLayer(this, @@ -1174,7 +1173,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, public void dispose() { if (isGrabbed()) { - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this); } postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); @@ -1519,7 +1518,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, synchronized(getStateLock()) { XDialogPeer blockerPeer = (XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(d); if (blocked) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("{0} is blocked by {1}", this, blockerPeer); } modalBlocker = d; @@ -1912,7 +1911,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, @Override public void xSetVisible(boolean visible) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting visible on " + this + " to " + visible); } XToolkit.awtLock(); @@ -2054,7 +2053,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, public void handleXCrossingEvent(XEvent xev) { XCrossingEvent xce = xev.get_xcrossing(); - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("{0}, when grabbed {1}, contains {2}", xce, isGrabbed(), containsGlobal(xce.get_x_root(), xce.get_y_root())); } @@ -2067,7 +2066,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog. // (fix for 6390326) XBaseWindow target = XToolkit.windowToXWindow(xce.get_window()); - if (grabLog.isLoggable(PlatformLogger.FINER)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINER)) { grabLog.finer(" - Grab event target {0}", target); } if (target != null && target != this) { @@ -2080,7 +2079,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, public void handleMotionNotify(XEvent xev) { XMotionEvent xme = xev.get_xmotion(); - if (grabLog.isLoggable(PlatformLogger.FINER)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINER)) { grabLog.finer("{0}, when grabbed {1}, contains {2}", xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root())); } @@ -2111,7 +2110,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, xme.set_x(localCoord.x); xme.set_y(localCoord.y); } - if (grabLog.isLoggable(PlatformLogger.FINER)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINER)) { grabLog.finer(" - Grab event target {0}", target); } if (target != null) { @@ -2145,7 +2144,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, if (xbe.get_button() > SunToolkit.MAX_BUTTONS_SUPPORTED) { return; } - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("{0}, when grabbed {1}, contains {2} ({3}, {4}, {5}x{6})", xbe, isGrabbed(), containsGlobal(xbe.get_x_root(), xbe.get_y_root()), getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight()); } @@ -2156,7 +2155,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // translation) XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window()); try { - if (grabLog.isLoggable(PlatformLogger.FINER)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINER)) { grabLog.finer(" - Grab event target {0} (press target {1})", target, pressTarget); } if (xbe.get_type() == XConstants.ButtonPress @@ -2192,7 +2191,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // According to the specification of UngrabEvent, post it // when press occurs outside of the window and not on its owned windows if (xbe.get_type() == XConstants.ButtonPress) { - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this); } postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); @@ -2213,14 +2212,14 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // toplevel == null - outside of // hierarchy, toplevel is Dialog - should // send ungrab (but shouldn't for Window) - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this); } postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); } } else { // toplevel is null - outside of hierarchy - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this); } postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); @@ -2228,7 +2227,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } else { // target doesn't map to XAWT window - outside of hierarchy - if (grabLog.isLoggable(PlatformLogger.FINE)) { + if (grabLog.isLoggable(PlatformLogger.Level.FINE)) { grabLog.fine("Generating UngrabEvent on because target is null {0}", this); } postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index ffb920b6364..4e1c816fd18 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -324,7 +324,7 @@ public class X11GraphicsEnvironment // pRunningXinerama() simply returns a global boolean variable, // so there is no need to synchronize here xinerState = Boolean.valueOf(pRunningXinerama()); - if (screenLog.isLoggable(PlatformLogger.FINER)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINER)) { screenLog.finer("Running Xinerama: " + xinerState); } } @@ -408,7 +408,7 @@ public class X11GraphicsEnvironment (unionRect.width / 2) + unionRect.x < center.x + 1 && (unionRect.height / 2) + unionRect.y < center.y + 1) { - if (screenLog.isLoggable(PlatformLogger.FINER)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINER)) { screenLog.finer("Video Wall: center point is at center of all displays."); } return unionRect; @@ -416,7 +416,7 @@ public class X11GraphicsEnvironment // next, check if at center of one monitor if (centerMonitorRect != null) { - if (screenLog.isLoggable(PlatformLogger.FINER)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINER)) { screenLog.finer("Center point at center of a particular " + "monitor, but not of the entire virtual display."); } @@ -424,7 +424,7 @@ public class X11GraphicsEnvironment } // otherwise, the center is at some weird spot: return unionRect - if (screenLog.isLoggable(PlatformLogger.FINER)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINER)) { screenLog.finer("Center point is somewhere strange - return union of all bounds."); } return unionRect; diff --git a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java index eb88cbd6cf4..61e98692197 100644 --- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java +++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java @@ -326,7 +326,7 @@ public abstract class X11InputMethod extends InputMethodAdapter { return; if (lastXICFocussedComponent != null){ - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("XICFocused {0}, AWTFocused {1}", lastXICFocussedComponent, awtFocussedComponent); } diff --git a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java index 33859f03529..8b74488f1ac 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java @@ -241,7 +241,7 @@ class UnixAsynchronousSocketChannelImpl synchronized (stateLock) { state = ST_CONNECTED; localAddress = Net.localAddress(fd); - remoteAddress = pendingRemote; + remoteAddress = (InetSocketAddress)pendingRemote; } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java index 8f02de791a8..8cfab7022aa 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java +++ b/jdk/src/solaris/classes/sun/nio/ch/sctp/SctpNet.java @@ -94,18 +94,44 @@ public class SctpNet { static Set getLocalAddresses(int fd) throws IOException { - HashSet set = null; + Set set = null; SocketAddress[] saa = getLocalAddresses0(fd); if (saa != null) { - set = new HashSet(saa.length); - for (SocketAddress sa : saa) - set.add(sa); + set = getRevealedLocalAddressSet(saa); } return set; } + private static Set getRevealedLocalAddressSet( + SocketAddress[] saa) + { + SecurityManager sm = System.getSecurityManager(); + Set set = new HashSet<>(saa.length); + for (SocketAddress sa : saa) { + set.add(getRevealedLocalAddress(sa, sm)); + } + return set; + } + + private static SocketAddress getRevealedLocalAddress(SocketAddress sa, + SecurityManager sm) + { + if (sm == null || sa == null) + return sa; + InetSocketAddress ia = (InetSocketAddress)sa; + try{ + sm.checkConnect(ia.getAddress().getHostAddress(), -1); + // Security check passed + } catch (SecurityException e) { + // Return loopback address + return new InetSocketAddress(InetAddress.getLoopbackAddress(), + ia.getPort()); + } + return sa; + } + static Set getRemoteAddresses(int fd, int assocId) throws IOException { HashSet set = null; diff --git a/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java b/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java index f92a31488f8..af3a47440e8 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java +++ b/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java @@ -67,6 +67,8 @@ public class GnomeFileTypeDetector NativeBuffer buffer = NativeBuffers.asNativeBuffer(path.getByteArrayForSysCalls()); try { if (gioAvailable) { + // GIO may access file so need permission check + path.checkRead(); byte[] type = probeUsingGio(buffer.address()); return (type == null) ? null : new String(type); } else { @@ -76,7 +78,6 @@ public class GnomeFileTypeDetector String s = new String(type); return s.equals(GNOME_VFS_MIME_TYPE_UNKNOWN) ? null : s; } - } finally { buffer.release(); } diff --git a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java index 9fcbb86c756..c682634b7b6 100644 --- a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java +++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java @@ -362,10 +362,33 @@ public class UnixPrintServiceLookup extends PrintServiceLookup */ private PrintService getServiceByName(PrinterName nameAttr) { String name = nameAttr.getValue(); - PrintService printer = null; if (name == null || name.equals("") || !checkPrinterName(name)) { return null; } + /* check is all printers are already available */ + if (printServices != null) { + for (PrintService printService : printServices) { + if (printService.getName().equals(name)) { + return printService; + } + } + } + /* take CUPS into account first */ + if (CUPSPrinter.isCupsRunning()) { + try { + return new IPPPrintService(name, + new URL("http://"+ + CUPSPrinter.getServer()+":"+ + CUPSPrinter.getPort()+"/"+ + name)); + } catch (Exception e) { + IPPPrintService.debug_println(debugPrefix+ + " getServiceByName Exception "+ + e); + } + } + /* fallback if nothing not having a printer at this point */ + PrintService printer = null; if (isMac() || isSysV()) { printer = getNamedPrinterNameSysV(name); } else { diff --git a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c index 27c78f23a42..981bf534a66 100644 --- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c @@ -43,7 +43,14 @@ #ifndef SO_BSDCOMPAT #define SO_BSDCOMPAT 14 #endif +/** + * IP_MULTICAST_ALL has been supported since kernel version 2.6.31 + * but we may be building on a machine that is older than that. + */ +#ifndef IP_MULTICAST_ALL +#define IP_MULTICAST_ALL 49 #endif +#endif // __linux__ #ifndef IPTOS_TOS_MASK #define IPTOS_TOS_MASK 0x1e @@ -980,6 +987,18 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env, setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof(int)); +#if defined(__linux__) + arg = 0; + int level = (domain == AF_INET6) ? IPPROTO_IPV6 : IPPROTO_IP; + if ((setsockopt(fd, level, IP_MULTICAST_ALL, (char*)&arg, sizeof(arg)) < 0) && + (errno != ENOPROTOOPT)) { + JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", + strerror(errno)); + close(fd); + return; + } +#endif + #if defined (__linux__) && defined (AF_INET6) /* * On Linux for IPv6 sockets we must set the hop limit diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c index 0c62dca97a2..cb0b7274bd9 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c @@ -907,6 +907,8 @@ Java_sun_awt_X11GraphicsDevice_getDisplay(JNIEnv *env, jobject this) static jint canUseShmExt = UNSET_MITSHM; static jint canUseShmExtPixmaps = UNSET_MITSHM; +extern int mitShmPermissionMask; + void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps) { XShmSegmentInfo shminfo; int XShmMajor, XShmMinor; @@ -930,7 +932,8 @@ void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps) { * we need to test that we can actually do XShmAttach. */ if (XShmQueryExtension(awt_display)) { - shminfo.shmid = shmget(IPC_PRIVATE, 0x10000, IPC_CREAT|0777); + shminfo.shmid = shmget(IPC_PRIVATE, 0x10000, + IPC_CREAT|mitShmPermissionMask); if (shminfo.shmid < 0) { AWT_UNLOCK(); J2dRlsTraceLn1(J2D_TRACE_ERROR, @@ -1366,12 +1369,18 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen mid = (*env)->GetMethodID(env, clazz, "", "(IIII)V"); if (mid != NULL) { if (usingXinerama) { - bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x, - fbrects[screen].y, - fbrects[screen].width, - fbrects[screen].height); - } - else { + if (0 <= screen && screen < awt_numScreens) { + bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x, + fbrects[screen].y, + fbrects[screen].width, + fbrects[screen].height); + } else { + jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + if (exceptionClass != NULL) { + (*env)->ThrowNew(env, exceptionClass, "Illegal screen index"); + } + } + } else { XWindowAttributes xwa; memset(&xwa, 0, sizeof(xwa)); diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h index cb06ae1bd08..0ca5a329f75 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h @@ -47,6 +47,9 @@ #include #endif +#define MITSHM_PERM_COMMON (0666) +#define MITSHM_PERM_OWNER (0600) + extern int XShmQueryExtension(); void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps); diff --git a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c index faa76460213..dd9fb952da7 100644 --- a/jdk/src/solaris/native/sun/awt/awt_InputMethod.c +++ b/jdk/src/solaris/native/sun/awt/awt_InputMethod.c @@ -447,7 +447,7 @@ setXICWindowFocus(XIC ic, Window w) */ #define INITIAL_LOOKUP_BUF_SIZE 512 -Bool +Boolean awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp) { JNIEnv *env = GetJNIEnv(); @@ -457,8 +457,8 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp) int mblen; jstring javastr; XIC ic; - Bool result = True; - static Bool composing = False; + Boolean result = True; + static Boolean composing = False; /* printf("lookupString: entering...\n"); diff --git a/jdk/src/solaris/native/sun/awt/awt_Robot.c b/jdk/src/solaris/native/sun/awt/awt_Robot.c index 6818b3b5ed9..8387f5edb41 100644 --- a/jdk/src/solaris/native/sun/awt/awt_Robot.c +++ b/jdk/src/solaris/native/sun/awt/awt_Robot.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "robot_common.h" #include "canvas.h" #include "wsutils.h" @@ -174,7 +175,7 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton num_buttons = numberOfButtons; tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, JNI_FALSE); - masks = (jint *)malloc(sizeof(jint) * num_buttons); + masks = (jint *)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), num_buttons); if (masks == (jint *) NULL) { JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL); (*env)->ReleaseIntArrayElements(env, buttonDownMasks, tmp, 0); @@ -231,8 +232,9 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env, image = getWindowImage(awt_display, rootWindow, x, y, width, height); /* Array to use to crunch around the pixel values */ - ary = (jint *) malloc(width * height * sizeof (jint)); - if (ary == NULL) { + if (!IS_SAFE_SIZE_MUL(width, height) || + !(ary = (jint *) SAFE_SIZE_ARRAY_ALLOC(malloc, width * height, sizeof (jint)))) + { JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError"); XDestroyImage(image); AWT_UNLOCK(); diff --git a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c index a5993736b9b..c63698c5e48 100644 --- a/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c +++ b/jdk/src/solaris/native/sun/awt/awt_UNIXToolkit.c @@ -29,6 +29,7 @@ #include #include +#include #include "sun_awt_UNIXToolkit.h" #ifndef HEADLESS @@ -148,7 +149,8 @@ Java_sun_awt_UNIXToolkit_load_1gtk_1icon(JNIEnv *env, jobject this, } len = (*env)->GetStringUTFLength(env, filename); - filename_str = (char *)malloc(sizeof(char) * (len + 1)); + filename_str = (char *)SAFE_SIZE_ARRAY_ALLOC(malloc, + sizeof(char), len + 1); if (filename_str == NULL) { JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError"); return JNI_FALSE; @@ -189,7 +191,8 @@ Java_sun_awt_UNIXToolkit_load_1stock_1icon(JNIEnv *env, jobject this, } len = (*env)->GetStringUTFLength(env, stock_id); - stock_id_str = (char *)malloc(sizeof(char) * (len + 1)); + stock_id_str = (char *)SAFE_SIZE_ARRAY_ALLOC(malloc, + sizeof(char), len + 1); if (stock_id_str == NULL) { JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError"); return JNI_FALSE; @@ -200,7 +203,8 @@ Java_sun_awt_UNIXToolkit_load_1stock_1icon(JNIEnv *env, jobject this, if (detail != NULL) { len = (*env)->GetStringUTFLength(env, detail); - detail_str = (char *)malloc(sizeof(char) * (len + 1)); + detail_str = (char *)SAFE_SIZE_ARRAY_ALLOC(malloc, + sizeof(char), len + 1); if (detail_str == NULL) { JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError"); return JNI_FALSE; diff --git a/jdk/src/solaris/native/sun/awt/fontpath.c b/jdk/src/solaris/native/sun/awt/fontpath.c index 24146b962e4..00d95691169 100644 --- a/jdk/src/solaris/native/sun/awt/fontpath.c +++ b/jdk/src/solaris/native/sun/awt/fontpath.c @@ -41,6 +41,7 @@ #include #include #include +#include #ifndef HEADLESS #include #include @@ -225,7 +226,7 @@ static void AddFontsToX11FontPath ( fDirRecord *fDirP ) if ( fDirP->num == 0 ) return; - appendDirList = malloc ( fDirP->num * sizeof ( int )); + appendDirList = SAFE_SIZE_ARRAY_ALLOC(malloc, fDirP->num, sizeof ( int )); if ( appendDirList == NULL ) { return; /* if it fails we cannot do much */ } @@ -282,7 +283,7 @@ static void AddFontsToX11FontPath ( fDirRecord *fDirP ) } - newFontPath = malloc ( totalDirCount * sizeof ( char **) ); + newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof ( char **) ); /* if it fails free things and get out */ if ( newFontPath == NULL ) { free ( ( void *) appendDirList ); @@ -303,7 +304,12 @@ static void AddFontsToX11FontPath ( fDirRecord *fDirP ) /* printf ( "Appending %s\n", fDirP->name[index] ); */ - onePath = malloc ( ( strlen (fDirP->name[index]) + 2 )* sizeof( char ) ); + onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) ); + if (onePath == NULL) { + free ( ( void *) appendDirList ); + XFreeFontPath ( origFontPath ); + return; + } strcpy ( onePath, fDirP->name[index] ); strcat ( onePath, "/" ); newFontPath[nPaths++] = onePath; diff --git a/jdk/src/solaris/native/sun/awt/gtk2_interface.c b/jdk/src/solaris/native/sun/awt/gtk2_interface.c index daca810e5a5..e1228fc9036 100644 --- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c +++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c @@ -31,6 +31,7 @@ #include "gtk2_interface.h" #include "java_awt_Transparency.h" #include "jvm_md.h" +#include "sizecalc.h" #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0") #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0") @@ -765,7 +766,8 @@ gboolean gtk2_load() gtk_modules_env && strstr (gtk_modules_env, "gail")) { /* the new env will be smaller than the old one */ - gchar *s, *new_env = malloc (sizeof(ENV_PREFIX)+strlen (gtk_modules_env)); + gchar *s, *new_env = SAFE_SIZE_STRUCT_ALLOC(malloc, + sizeof(ENV_PREFIX), 1, strlen (gtk_modules_env)); if (new_env != NULL ) { diff --git a/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c b/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c index 08c5ec7dcf7..e43ebcaf236 100644 --- a/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c +++ b/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c @@ -41,6 +41,7 @@ #include #include #include +#include static Bool shapeSupported; static int shapeEventBase, shapeErrorBase; @@ -76,9 +77,12 @@ char* SplashConvertStringAlloc(const char* in, int* size) { goto done; } inSize = strlen(in); + buf = SAFE_SIZE_ARRAY_ALLOC(malloc, inSize, 2); + if (!buf) { + return NULL; + } bufSize = inSize*2; // need 2 bytes per char for UCS-2, this is // 2 bytes per source byte max - buf = malloc(bufSize); out = buf; outSize = bufSize; /* linux iconv wants char** source and solaris wants const char**... cast to void* */ @@ -114,12 +118,20 @@ SplashInitFrameShape(Splash * splash, int imageIndex) { initRect(&maskRect, 0, 0, splash->width, splash->height, 1, splash->width * splash->imageFormat.depthBytes, splash->frames[imageIndex].bitmapBits, &splash->imageFormat); - rects = - malloc(sizeof(XRectangle) * (splash->width / 2 + 1) * splash->height); + if (!IS_SAFE_SIZE_MUL(splash->width / 2 + 1, splash->height)) { + return; + } + rects = SAFE_SIZE_ARRAY_ALLOC(malloc, + sizeof(XRectangle), (splash->width / 2 + 1) * splash->height); + if (!rects) { + return; + } frame->numRects = BitmapToYXBandedRectangles(&maskRect, rects); - frame->rects = malloc(frame->numRects * sizeof(XRectangle)); - memcpy(frame->rects, rects, frame->numRects * sizeof(XRectangle)); + frame->rects = SAFE_SIZE_ARRAY_ALLOC(malloc, frame->numRects, sizeof(XRectangle)); + if (frame->rects) { // handle the error after the if(){} + memcpy(frame->rects, rects, frame->numRects * sizeof(XRectangle)); + } free(rects); } diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index 57e121701ff..f944cff7ee9 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -88,6 +88,7 @@ static jclass xorCompClass; jint useMitShmExt = CANT_USE_MITSHM; jint useMitShmPixmaps = CANT_USE_MITSHM; jint forceSharedPixmaps = JNI_FALSE; +int mitShmPermissionMask = MITSHM_PERM_OWNER; /* Cached shared image, one for all surface datas. */ static XImage * cachedXImage; @@ -118,6 +119,13 @@ jboolean XShared_initIDs(JNIEnv *env, jboolean allowShmPixmaps) if (getenv("NO_AWT_MITSHM") == NULL && getenv("NO_J2D_MITSHM") == NULL) { char * force; + char * permission = getenv("J2D_MITSHM_PERMISSION"); + if (permission != NULL) { + if (strcmp(permission, "common") == 0) { + mitShmPermissionMask = MITSHM_PERM_COMMON; + } + } + TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps); if(allowShmPixmaps) { @@ -537,7 +545,8 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, return NULL; } shminfo->shmid = - shmget(IPC_PRIVATE, height * img->bytes_per_line, IPC_CREAT|0777); + shmget(IPC_PRIVATE, height * img->bytes_per_line, + IPC_CREAT|mitShmPermissionMask); if (shminfo->shmid < 0) { J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment shmget has failed: %s", diff --git a/jdk/src/solaris/native/sun/nio/ch/Net.c b/jdk/src/solaris/native/sun/nio/ch/Net.c index f37fe88b18e..679a9d8d0da 100644 --- a/jdk/src/solaris/native/sun/nio/ch/Net.c +++ b/jdk/src/solaris/native/sun/nio/ch/Net.c @@ -40,6 +40,17 @@ #include "nio.h" #include "sun_nio_ch_PollArrayWrapper.h" + +/** + * IP_MULTICAST_ALL supported since 2.6.31 but may not be available at + * build time. + */ +#ifdef __linux__ + #ifndef IP_MULTICAST_ALL + #define IP_MULTICAST_ALL 49 + #endif +#endif + #ifdef _ALLBSD_SOURCE #ifndef IP_BLOCK_SOURCE @@ -124,6 +135,11 @@ Java_sun_nio_ch_Net_isIPv6Available0(JNIEnv* env, jclass cl) return (ipv6_available()) ? JNI_TRUE : JNI_FALSE; } +JNIEXPORT jint JNICALL +Java_sun_nio_ch_Net_isExclusiveBindAvailable(JNIEnv *env, jclass clazz) { + return -1; +} + JNIEXPORT jboolean JNICALL Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl) { @@ -170,7 +186,7 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, sizeof(int)) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", - "sun.nio.ch.Net.setIntOption"); + "Unable to set IPV6_V6ONLY"); close(fd); return -1; } @@ -183,11 +199,27 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, sizeof(arg)) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", - "sun.nio.ch.Net.setIntOption"); + "Unable to set SO_REUSEADDR"); close(fd); return -1; } } + +#if defined(__linux__) + if (type == SOCK_DGRAM) { + int arg = 0; + int level = (domain == AF_INET6) ? IPPROTO_IPV6 : IPPROTO_IP; + if ((setsockopt(fd, level, IP_MULTICAST_ALL, (char*)&arg, sizeof(arg)) < 0) && + (errno != ENOPROTOOPT)) { + JNU_ThrowByNameWithLastError(env, + JNU_JAVANETPKG "SocketException", + "Unable to set IP_MULTICAST_ALL"); + close(fd); + return -1; + } + } +#endif + #if defined(__linux__) && defined(AF_INET6) /* By default, Linux uses the route default */ if (domain == AF_INET6 && type == SOCK_DGRAM) { @@ -196,7 +228,7 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, sizeof(arg)) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", - "sun.nio.ch.Net.setIntOption"); + "Unable to set IPV6_MULTICAST_HOPS"); close(fd); return -1; } @@ -206,8 +238,8 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, } JNIEXPORT void JNICALL -Java_sun_nio_ch_Net_bind0(JNIEnv *env, jclass clazz, jboolean preferIPv6, - jobject fdo, jobject iao, int port) +Java_sun_nio_ch_Net_bind0(JNIEnv *env, jclass clazz, jobject fdo, jboolean preferIPv6, + jboolean useExclBind, jobject iao, int port) { SOCKADDR sa; int sa_len = SOCKADDR_LEN; @@ -641,7 +673,7 @@ Java_sun_nio_ch_Net_poll(JNIEnv* env, jclass this, jobject fdo, jint events, jlo return pfd.revents; } else if (errno == EINTR) { return IOS_INTERRUPTED; - } else if (rv < 0) { + } else { handleSocketError(env, errno); return IOS_THROWN; } diff --git a/jdk/src/solaris/native/sun/xawt/XToolkit.c b/jdk/src/solaris/native/sun/xawt/XToolkit.c index 6dfb80d368a..9abacadcb35 100644 --- a/jdk/src/solaris/native/sun/xawt/XToolkit.c +++ b/jdk/src/solaris/native/sun/xawt/XToolkit.c @@ -685,8 +685,7 @@ performPoll(JNIEnv *env, jlong nextTaskTime) { if (result == 0) { /* poll() timed out -- update timeout value */ update_poll_timeout(TIMEOUT_TIMEDOUT); - PRINT2("%s(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n", - performPoll, curPollTimeout); + PRINT2("performPoll(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n", curPollTimeout); } if (pollFds[1].revents) { int count; @@ -695,14 +694,12 @@ performPoll(JNIEnv *env, jlong nextTaskTime) { do { count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE ); } while (count == AWT_POLL_BUFSIZE ); - PRINT2("%s(): data on the AWT pipe: curPollTimeout = %d \n", - performPoll, curPollTimeout); + PRINT2("performPoll(): data on the AWT pipe: curPollTimeout = %d \n", curPollTimeout); } if (pollFds[0].revents) { // Events in X pipe update_poll_timeout(TIMEOUT_EVENTS); - PRINT2("%s(): TIMEOUT_EVENTS curPollTimeout = %ld \n", - performPoll, curPollTimeout); + PRINT2("performPoll(): TIMEOUT_EVENTS curPollTimeout = %ld \n", curPollTimeout); } return; diff --git a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c index 04dd24b17f1..da328719304 100644 --- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -2228,6 +2229,10 @@ Java_sun_awt_X11_XlibWrapper_SetBitmapShape RECT_T * pRect; int numrects; + if (!IS_SAFE_SIZE_MUL(width / 2 + 1, height)) { + return; + } + AWT_CHECK_HAVE_LOCK(); len = (*env)->GetArrayLength(env, bitmap); @@ -2240,7 +2245,10 @@ Java_sun_awt_X11_XlibWrapper_SetBitmapShape return; } - pRect = (RECT_T *)malloc(worstBufferSize * sizeof(RECT_T)); + pRect = (RECT_T *)SAFE_SIZE_ARRAY_ALLOC(malloc, worstBufferSize, sizeof(RECT_T)); + if (!pRect) { + return; + } /* Note: the values[0] and values[1] are supposed to contain the width * and height (see XIconInfo.getIntData() for details). So, we do +2. diff --git a/jdk/src/windows/classes/java/lang/ProcessImpl.java b/jdk/src/windows/classes/java/lang/ProcessImpl.java index de7a9057c54..0cc9680d089 100644 --- a/jdk/src/windows/classes/java/lang/ProcessImpl.java +++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java @@ -170,7 +170,19 @@ final class ProcessImpl extends Process { return matchList.toArray(new String[matchList.size()]); } - private static String createCommandLine(boolean isCmdFile, + private static final int VERIFICATION_CMD_BAT = 0; + private static final int VERIFICATION_WIN32 = 1; + private static final int VERIFICATION_LEGACY = 2; + private static final char ESCAPE_VERIFICATION[][] = { + // We guarantee the only command file execution for implicit [cmd.exe] run. + // http://technet.microsoft.com/en-us/library/bb490954.aspx + {' ', '\t', '<', '>', '&', '|', '^'}, + + {' ', '\t', '<', '>'}, + {' ', '\t'} + }; + + private static String createCommandLine(int verificationType, final String executablePath, final String cmd[]) { @@ -181,9 +193,8 @@ final class ProcessImpl extends Process { for (int i = 1; i < cmd.length; ++i) { cmdbuf.append(' '); String s = cmd[i]; - if (needsEscaping(isCmdFile, s)) { - cmdbuf.append('"'); - cmdbuf.append(s); + if (needsEscaping(verificationType, s)) { + cmdbuf.append('"').append(s); // The code protects the [java.exe] and console command line // parser, that interprets the [\"] combination as an escape @@ -197,7 +208,7 @@ final class ProcessImpl extends Process { // command line parser. The case of the [""] tail escape // sequence could not be realized due to the argument validation // procedure. - if (!isCmdFile && s.endsWith("\\")) { + if ((verificationType != VERIFICATION_CMD_BAT) && s.endsWith("\\")) { cmdbuf.append('\\'); } cmdbuf.append('"'); @@ -208,11 +219,6 @@ final class ProcessImpl extends Process { return cmdbuf.toString(); } - // We guarantee the only command file execution for implicit [cmd.exe] run. - // http://technet.microsoft.com/en-us/library/bb490954.aspx - private static final char CMD_BAT_ESCAPE[] = {' ', '\t', '<', '>', '&', '|', '^'}; - private static final char WIN32_EXECUTABLE_ESCAPE[] = {' ', '\t', '<', '>'}; - private static boolean isQuoted(boolean noQuotesInside, String arg, String errorMessage) { int lastPos = arg.length() - 1; @@ -235,7 +241,7 @@ final class ProcessImpl extends Process { return false; } - private static boolean needsEscaping(boolean isCmdFile, String arg) { + private static boolean needsEscaping(int verificationType, String arg) { // Switch off MS heuristic for internal ["]. // Please, use the explicit [cmd.exe] call // if you need the internal ["]. @@ -243,13 +249,12 @@ final class ProcessImpl extends Process { // For [.exe] or [.com] file the unpaired/internal ["] // in the argument is not a problem. - boolean argIsQuoted = isQuoted(isCmdFile, arg, - "Argument has embedded quote, use the explicit CMD.EXE call."); + boolean argIsQuoted = isQuoted( + (verificationType == VERIFICATION_CMD_BAT), + arg, "Argument has embedded quote, use the explicit CMD.EXE call."); if (!argIsQuoted) { - char testEscape[] = isCmdFile - ? CMD_BAT_ESCAPE - : WIN32_EXECUTABLE_ESCAPE; + char testEscape[] = ESCAPE_VERIFICATION[verificationType]; for (int i = 0; i < testEscape.length; ++i) { if (arg.indexOf(testEscape[i]) >= 0) { return true; @@ -315,24 +320,26 @@ final class ProcessImpl extends Process { { String cmdstr; SecurityManager security = System.getSecurityManager(); - boolean allowAmbigousCommands = false; + boolean allowAmbiguousCommands = false; if (security == null) { - String value = System.getProperty("jdk.lang.Process.allowAmbigousCommands"); + allowAmbiguousCommands = true; + String value = System.getProperty("jdk.lang.Process.allowAmbiguousCommands"); if (value != null) - allowAmbigousCommands = !"false".equalsIgnoreCase(value); + allowAmbiguousCommands = !"false".equalsIgnoreCase(value); } - if (allowAmbigousCommands) { + if (allowAmbiguousCommands) { // Legacy mode. // Normalize path if possible. String executablePath = new File(cmd[0]).getPath(); - // No worry about internal and unpaired ["] . - if (needsEscaping(false, executablePath) ) + // No worry about internal, unpaired ["], and redirection/piping. + if (needsEscaping(VERIFICATION_LEGACY, executablePath) ) executablePath = quoteString(executablePath); cmdstr = createCommandLine( - false, //legacy mode doesn't worry about extended verification + //legacy mode doesn't worry about extended verification + VERIFICATION_LEGACY, executablePath, cmd); } else { @@ -369,7 +376,9 @@ final class ProcessImpl extends Process { // [.exe] extension heuristic. cmdstr = createCommandLine( // We need the extended verification procedure for CMD files. - isShellFile(executablePath), + isShellFile(executablePath) + ? VERIFICATION_CMD_BAT + : VERIFICATION_WIN32, quoteString(executablePath), cmd); } diff --git a/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java b/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java index 43ce6f27744..2d319fa5561 100644 --- a/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java +++ b/jdk/src/windows/classes/java/net/DefaultDatagramSocketImplFactory.java @@ -56,24 +56,45 @@ class DefaultDatagramSocketImplFactory /* If the version supports a dual stack TCP implementation */ private static boolean useDualStackImpl = false; + /* sun.net.useExclusiveBind */ + private static String exclBindProp; + + /* True if exclusive binding is on for Windows */ + private static boolean exclusiveBind = true; + + static { // Determine Windows Version. - java.security.AccessController.doPrivileged( new PrivilegedAction() { - public Object run() { - version = 0; - try { - version = Float.parseFloat(System.getProperties().getProperty("os.version")); - preferIPv4Stack = Boolean.parseBoolean( - System.getProperties().getProperty("java.net.preferIPv4Stack")); - } catch (NumberFormatException e ) { - assert false : e; + java.security.AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + version = 0; + try { + version = Float.parseFloat(System.getProperties() + .getProperty("os.version")); + preferIPv4Stack = Boolean.parseBoolean( + System.getProperties() + .getProperty( + "java.net.preferIPv4Stack")); + exclBindProp = System.getProperty( + "sun.net.useExclusiveBind"); + } catch (NumberFormatException e ) { + assert false : e; + } + return null; // nothing to return } - return null; // nothing to return - } }); + }); // (version >= 6.0) implies Vista or greater. if (version >= 6.0 && !preferIPv4Stack) { - useDualStackImpl = true; + useDualStackImpl = true; + } + if (exclBindProp != null) { + // sun.net.useExclusiveBind is true + exclusiveBind = exclBindProp.length() == 0 ? true + : Boolean.parseBoolean(exclBindProp); + } else if (version < 6.0) { + exclusiveBind = false; } // impl.prefix @@ -105,10 +126,12 @@ class DefaultDatagramSocketImplFactory throw new SocketException("can't instantiate DatagramSocketImpl"); } } else { + if (isMulticast) + exclusiveBind = false; if (useDualStackImpl && !isMulticast) - return new DualStackPlainDatagramSocketImpl(); + return new DualStackPlainDatagramSocketImpl(exclusiveBind); else - return new TwoStacksPlainDatagramSocketImpl(); + return new TwoStacksPlainDatagramSocketImpl(exclusiveBind); } } } diff --git a/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java b/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java index 089278b66c7..f94afd17881 100644 --- a/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java +++ b/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java @@ -45,6 +45,22 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl { static JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess(); + // true if this socket is exclusively bound + private final boolean exclusiveBind; + + /* + * Set to true if SO_REUSEADDR is set after the socket is bound to + * indicate SO_REUSEADDR is being emulated + */ + private boolean reuseAddressEmulated; + + // emulates SO_REUSEADDR when exclusiveBind is true and socket is bound + private boolean isReuseAddress; + + DualStackPlainDatagramSocketImpl(boolean exclBind) { + exclusiveBind = exclBind; + } + protected void datagramSocketCreate() throws SocketException { if (fd == null) throw new SocketException("Socket closed"); @@ -61,7 +77,7 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl if (laddr == null) throw new NullPointerException("argument address"); - socketBind(nativefd, laddr, lport); + socketBind(nativefd, laddr, lport, exclusiveBind); if (lport == 0) { localPort = socketLocalPort(nativefd); } else { @@ -141,6 +157,7 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl fdAccess.set(fd, -1); } + @SuppressWarnings("fallthrough") protected void socketSetOption(int opt, Object val) throws SocketException { int nativefd = checkAndReturnNativeFD(); @@ -153,6 +170,13 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl optionValue = ((Integer)val).intValue(); break; case SO_REUSEADDR : + if (exclusiveBind && localPort != 0) { + // socket already bound, emulate SO_REUSEADDR + reuseAddressEmulated = true; + isReuseAddress = (Boolean)val; + return; + } + //Intentional fallthrough case SO_BROADCAST : optionValue = ((Boolean)val).booleanValue() ? 1 : 0; break; @@ -170,6 +194,8 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl if (opt == SO_BINDADDR) { return socketLocalAddress(nativefd); } + if (opt == SO_REUSEADDR && reuseAddressEmulated) + return isReuseAddress; int value = socketGetIntOption(nativefd, opt); Object returnValue = null; @@ -238,8 +264,8 @@ class DualStackPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl private static native int socketCreate(boolean v6Only); - private static native void socketBind(int fd, InetAddress localAddress, int localport) - throws SocketException; + private static native void socketBind(int fd, InetAddress localAddress, + int localport, boolean exclBind) throws SocketException; private static native void socketConnect(int fd, InetAddress address, int port) throws SocketException; diff --git a/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java b/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java index 54121b46340..aef92a2c287 100644 --- a/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java +++ b/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java @@ -42,10 +42,20 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl { static JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess(); - public DualStackPlainSocketImpl() {} - public DualStackPlainSocketImpl(FileDescriptor fd) { + // true if this socket is exclusively bound + private final boolean exclusiveBind; + + // emulates SO_REUSEADDR when exclusiveBind is true + private boolean isReuseAddress; + + public DualStackPlainSocketImpl(boolean exclBind) { + exclusiveBind = exclBind; + } + + public DualStackPlainSocketImpl(FileDescriptor fd, boolean exclBind) { this.fd = fd; + exclusiveBind = exclBind; } void socketCreate(boolean stream) throws IOException { @@ -93,7 +103,7 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl if (address == null) throw new NullPointerException("inet address argument is null."); - bind0(nativefd, address, port); + bind0(nativefd, address, port, exclusiveBind); if (port == 0) { localport = localPort0(nativefd); } else { @@ -162,6 +172,8 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl shutdown0(nativefd, howto); } + // Intentional fallthrough after SO_REUSEADDR + @SuppressWarnings("fallthrough") void socketSetOption(int opt, boolean on, Object value) throws SocketException { int nativefd = checkAndReturnNativeFD(); @@ -173,10 +185,16 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl int optionValue = 0; switch(opt) { + case SO_REUSEADDR : + if (exclusiveBind) { + // SO_REUSEADDR emulated when using exclusive bind + isReuseAddress = on; + return; + } + // intentional fallthrough case TCP_NODELAY : case SO_OOBINLINE : case SO_KEEPALIVE : - case SO_REUSEADDR : optionValue = on ? 1 : 0; break; case SO_SNDBUF : @@ -207,6 +225,10 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl return 0; // return value doesn't matter. } + // SO_REUSEADDR emulated when using exclusive bind + if (opt == SO_REUSEADDR && exclusiveBind) + return isReuseAddress? 1 : -1; + int value = getIntOption(nativefd, opt); switch (opt) { @@ -243,7 +265,8 @@ class DualStackPlainSocketImpl extends AbstractPlainSocketImpl static native int socket0(boolean stream, boolean v6Only) throws IOException; - static native void bind0(int fd, InetAddress localAddress, int localport) + static native void bind0(int fd, InetAddress localAddress, int localport, + boolean exclBind) throws IOException; static native int connect0(int fd, InetAddress remote, int remotePort) diff --git a/jdk/src/windows/classes/java/net/PlainSocketImpl.java b/jdk/src/windows/classes/java/net/PlainSocketImpl.java index bcb01f1846b..1b6287d47f5 100644 --- a/jdk/src/windows/classes/java/net/PlainSocketImpl.java +++ b/jdk/src/windows/classes/java/net/PlainSocketImpl.java @@ -54,6 +54,12 @@ class PlainSocketImpl extends AbstractPlainSocketImpl /* If the version supports a dual stack TCP implementation */ private static boolean useDualStackImpl = false; + /* sun.net.useExclusiveBind */ + private static String exclBindProp; + + /* True if exclusive binding is on for Windows */ + private static boolean exclusiveBind = true; + static { java.security.AccessController.doPrivileged( new PrivilegedAction() { public Object run() { @@ -62,6 +68,7 @@ class PlainSocketImpl extends AbstractPlainSocketImpl version = Float.parseFloat(System.getProperties().getProperty("os.version")); preferIPv4Stack = Boolean.parseBoolean( System.getProperties().getProperty("java.net.preferIPv4Stack")); + exclBindProp = System.getProperty("sun.net.useExclusiveBind"); } catch (NumberFormatException e ) { assert false : e; } @@ -70,7 +77,15 @@ class PlainSocketImpl extends AbstractPlainSocketImpl // (version >= 6.0) implies Vista or greater. if (version >= 6.0 && !preferIPv4Stack) { - useDualStackImpl = true; + useDualStackImpl = true; + } + + if (exclBindProp != null) { + // sun.net.useExclusiveBind is true + exclusiveBind = exclBindProp.length() == 0 ? true + : Boolean.parseBoolean(exclBindProp); + } else if (version < 6.0) { + exclusiveBind = false; } } @@ -79,9 +94,9 @@ class PlainSocketImpl extends AbstractPlainSocketImpl */ PlainSocketImpl() { if (useDualStackImpl) { - impl = new DualStackPlainSocketImpl(); + impl = new DualStackPlainSocketImpl(exclusiveBind); } else { - impl = new TwoStacksPlainSocketImpl(); + impl = new TwoStacksPlainSocketImpl(exclusiveBind); } } @@ -90,9 +105,9 @@ class PlainSocketImpl extends AbstractPlainSocketImpl */ PlainSocketImpl(FileDescriptor fd) { if (useDualStackImpl) { - impl = new DualStackPlainSocketImpl(fd); + impl = new DualStackPlainSocketImpl(fd, exclusiveBind); } else { - impl = new TwoStacksPlainSocketImpl(fd); + impl = new TwoStacksPlainSocketImpl(fd, exclusiveBind); } } diff --git a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java index 2d89d601869..b1672907dcb 100644 --- a/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java +++ b/jdk/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java @@ -66,6 +66,22 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl init(); } + // true if this socket is exclusively bound + private final boolean exclusiveBind; + + /* + * Set to true if SO_REUSEADDR is set after the socket is bound to + * indicate SO_REUSEADDR is being emulated + */ + private boolean reuseAddressEmulated; + + // emulates SO_REUSEADDR when exclusiveBind is true and socket is bound + private boolean isReuseAddress; + + TwoStacksPlainDatagramSocketImpl(boolean exclBind) { + exclusiveBind = exclBind; + } + protected synchronized void create() throws SocketException { fd1 = new FileDescriptor(); try { @@ -84,6 +100,14 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl } } + @Override + protected synchronized void bind0(int lport, InetAddress laddr) + throws SocketException + { + bind0(lport, laddr, exclusiveBind); + + } + protected synchronized void receive(DatagramPacket p) throws IOException { try { @@ -104,8 +128,24 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl } int family = connectedAddress == null ? -1 : connectedAddress.holder().getFamily(); return socketLocalAddress(family); - } else + } else if (optID == SO_REUSEADDR && reuseAddressEmulated) { + return isReuseAddress; + } else { return super.getOption(optID); + } + } + + protected void socketSetOption(int opt, Object val) + throws SocketException + { + if (opt == SO_REUSEADDR && exclusiveBind && localPort != 0) { + // socket already bound, emulate + reuseAddressEmulated = true; + isReuseAddress = (Boolean)val; + } else { + socketNativeSetOption(opt, val); + } + } protected boolean isClosed() { @@ -123,7 +163,8 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl /* Native methods */ - protected synchronized native void bind0(int lport, InetAddress laddr) + protected synchronized native void bind0(int lport, InetAddress laddr, + boolean exclBind) throws SocketException; protected native void send(DatagramPacket p) throws IOException; @@ -155,7 +196,7 @@ class TwoStacksPlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl protected native void datagramSocketClose(); - protected native void socketSetOption(int opt, Object val) + protected native void socketNativeSetOption(int opt, Object val) throws SocketException; protected native Object socketGetOption(int opt) throws SocketException; diff --git a/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java b/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java index 6ca25ec6021..1f2b68d97f6 100644 --- a/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java +++ b/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java @@ -66,14 +66,23 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl */ private int lastfd = -1; + // true if this socket is exclusively bound + private final boolean exclusiveBind; + + // emulates SO_REUSEADDR when exclusiveBind is true + private boolean isReuseAddress; + static { initProto(); } - public TwoStacksPlainSocketImpl() {} + public TwoStacksPlainSocketImpl(boolean exclBind) { + exclusiveBind = exclBind; + } - public TwoStacksPlainSocketImpl(FileDescriptor fd) { + public TwoStacksPlainSocketImpl(FileDescriptor fd, boolean exclBind) { this.fd = fd; + exclusiveBind = exclBind; } /** @@ -116,13 +125,33 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl InetAddressContainer in = new InetAddressContainer(); socketGetOption(opt, in); return in.addr; + } else if (opt == SO_REUSEADDR && exclusiveBind) { + // SO_REUSEADDR emulated when using exclusive bind + return isReuseAddress; } else return super.getOption(opt); } + @Override + void socketBind(InetAddress address, int port) throws IOException { + socketBind(address, port, exclusiveBind); + } + + @Override + void socketSetOption(int opt, boolean on, Object value) + throws SocketException + { + // SO_REUSEADDR emulated when using exclusive bind + if (opt == SO_REUSEADDR && exclusiveBind) + isReuseAddress = on; + else + socketNativeSetOption(opt, on, value); + } + /** * Closes the socket. */ + @Override protected void close() throws IOException { synchronized(fdLock) { if (fd != null || fd1 != null) { @@ -155,6 +184,7 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl } } + @Override void reset() throws IOException { if (fd != null || fd1 != null) { socketClose(); @@ -167,6 +197,7 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl /* * Return true if already closed or close is pending */ + @Override public boolean isClosedOrPending() { /* * Lock on fdLock to ensure that we wait if a @@ -190,7 +221,7 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl native void socketConnect(InetAddress address, int port, int timeout) throws IOException; - native void socketBind(InetAddress address, int port) + native void socketBind(InetAddress address, int port, boolean exclBind) throws IOException; native void socketListen(int count) throws IOException; @@ -203,7 +234,7 @@ class TwoStacksPlainSocketImpl extends AbstractPlainSocketImpl native void socketShutdown(int howto) throws IOException; - native void socketSetOption(int cmd, boolean on, Object value) + native void socketNativeSetOption(int cmd, boolean on, Object value) throws SocketException; native int socketGetOption(int opt, Object iaContainerObj) throws SocketException; diff --git a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java index f02fe3325e4..db62ab477ed 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -177,7 +177,7 @@ public abstract class WComponentPeer extends WObjectPeer void dynamicallyLayoutContainer() { // If we got the WM_SIZING, this must be a Container, right? // In fact, it must be the top-level Container. - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { Container parent = WToolkit.getNativeContainer((Component)target); if (parent != null) { log.fine("Assertion (parent == null) failed"); @@ -282,7 +282,7 @@ public abstract class WComponentPeer extends WObjectPeer paintArea.add(r, e.getID()); } - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { switch(e.getID()) { case PaintEvent.UPDATE: log.finest("coalescePaintEvent: UPDATE: add: x = " + @@ -360,7 +360,7 @@ public abstract class WComponentPeer extends WObjectPeer } void handleJavaFocusEvent(FocusEvent fe) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(fe.toString()); } setFocus(fe.getID() == FocusEvent.FOCUS_GAINED); @@ -682,7 +682,7 @@ public abstract class WComponentPeer extends WObjectPeer case WKeyboardFocusManagerPeer.SNFH_FAILURE: return false; case WKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED: - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target); } Window parentWindow = SunToolkit.getContainingWindow((Component)target); @@ -695,7 +695,7 @@ public abstract class WComponentPeer extends WObjectPeer } boolean res = wpeer.requestWindowFocus(cause); - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer("Requested window focus: " + res); } // If parent window can be made focused and has been made focused(synchronously) @@ -717,7 +717,7 @@ public abstract class WComponentPeer extends WObjectPeer } private boolean rejectFocusRequestHelper(String logMsg) { - if (focusLog.isLoggable(PlatformLogger.FINER)) { + if (focusLog.isLoggable(PlatformLogger.Level.FINER)) { focusLog.finer(logMsg); } WKeyboardFocusManagerPeer.removeLastFocusRequest((Component)target); @@ -1094,7 +1094,7 @@ public abstract class WComponentPeer extends WObjectPeer */ @SuppressWarnings("deprecation") public void applyShape(Region shape) { - if (shapeLog.isLoggable(PlatformLogger.FINER)) { + if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) { shapeLog.finer("*** INFO: Setting shape: PEER: " + this + "; TARGET: " + target + "; SHAPE: " + shape); diff --git a/jdk/src/windows/classes/sun/awt/windows/WDesktopProperties.java b/jdk/src/windows/classes/sun/awt/windows/WDesktopProperties.java index 3c8f8c0f101..c48d85e0516 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDesktopProperties.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDesktopProperties.java @@ -110,7 +110,7 @@ class WDesktopProperties { */ private synchronized void setBooleanProperty(String key, boolean value) { assert( key != null ); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + String.valueOf(value)); } map.put(key, Boolean.valueOf(value)); @@ -121,7 +121,7 @@ class WDesktopProperties { */ private synchronized void setIntegerProperty(String key, int value) { assert( key != null ); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + String.valueOf(value)); } map.put(key, Integer.valueOf(value)); @@ -132,7 +132,7 @@ class WDesktopProperties { */ private synchronized void setStringProperty(String key, String value) { assert( key != null ); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + value); } map.put(key, value); @@ -144,7 +144,7 @@ class WDesktopProperties { private synchronized void setColorProperty(String key, int r, int g, int b) { assert( key != null && r <= 255 && g <=255 && b <= 255 ); Color color = new Color(r, g, b); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + color); } map.put(key, color); @@ -172,14 +172,14 @@ class WDesktopProperties { name = mappedName; } Font font = new Font(name, style, size); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + font); } map.put(key, font); String sizeKey = key + ".height"; Integer iSize = Integer.valueOf(size); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(sizeKey + "=" + iSize); } map.put(sizeKey, iSize); @@ -192,7 +192,7 @@ class WDesktopProperties { assert( key != null && winEventName != null ); Runnable soundRunnable = new WinPlaySound(winEventName); - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(key + "=" + soundRunnable); } map.put(key, soundRunnable); diff --git a/jdk/src/windows/classes/sun/awt/windows/WMenuItemPeer.java b/jdk/src/windows/classes/sun/awt/windows/WMenuItemPeer.java index 716ab5dd26c..f7fe078021e 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WMenuItemPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WMenuItemPeer.java @@ -165,7 +165,7 @@ class WMenuItemPeer extends WObjectPeer implements MenuItemPeer { ResourceBundle rb = ResourceBundle.getBundle("sun.awt.windows.awtLocalization"); return Font.decode(rb.getString("menuFont")); } catch (MissingResourceException e) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("WMenuItemPeer: " + e.getMessage()+". Using default MenuItem font.", e); } return new Font("SanSerif", Font.PLAIN, 11); diff --git a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java index 250d8c72203..897e8f1baf1 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java @@ -1269,11 +1269,13 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { mLastFontFamily = null; } + private boolean defaultCopies = true; /** * Set the number of copies to be printed. */ public void setCopies(int copies) { super.setCopies(copies); + defaultCopies = false; mAttCopies = copies; setNativeCopies(copies); } @@ -1529,8 +1531,9 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { } /* SheetCollate */ - private final boolean getCollateAttrib() { - return (mAttCollate == 1); + private final int getCollateAttrib() { + // -1 means unset, 0 uncollated, 1 collated. + return mAttCollate; } private void setCollateAttrib(Attribute attr) { @@ -1553,6 +1556,10 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { int orient = PageFormat.PORTRAIT; OrientationRequested orientReq = (attributes == null) ? null : (OrientationRequested)attributes.get(OrientationRequested.class); + if (orientReq == null) { + orientReq = (OrientationRequested) + myService.getDefaultAttributeValue(OrientationRequested.class); + } if (orientReq != null) { if (orientReq == OrientationRequested.REVERSE_LANDSCAPE) { orient = PageFormat.REVERSE_LANDSCAPE; @@ -1573,7 +1580,11 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { /* Copies and Page Range. */ private final int getCopiesAttrib() { - return getCopiesInt(); + if (defaultCopies) { + return 0; + } else { + return getCopiesInt(); + } } private final void setRangeCopiesAttribute(int from, int to, @@ -1584,6 +1595,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { attributes.add(new PageRanges(from, to)); setPageRange(from, to); } + defaultCopies = false; attributes.add(new Copies(copies)); /* Since this is called from native to tell Java to sync * up with native, we don't call this class's own setCopies() diff --git a/jdk/src/windows/classes/sun/awt/windows/WScrollPanePeer.java b/jdk/src/windows/classes/sun/awt/windows/WScrollPanePeer.java index 04735b6fa0f..3e7dd821a61 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WScrollPanePeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WScrollPanePeer.java @@ -161,7 +161,7 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { } public PeerEvent coalesceEvents(PeerEvent newEvent) { - if (log.isLoggable(PlatformLogger.FINEST)) { + if (log.isLoggable(PlatformLogger.Level.FINEST)) { log.finest("ScrollEvent coalesced: " + newEvent); } if (newEvent instanceof ScrollEvent) { @@ -204,7 +204,7 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { } else if (orient == Adjustable.HORIZONTAL) { adj = (ScrollPaneAdjustable)sp.getHAdjustable(); } else { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Assertion failed: unknown orient"); } } @@ -231,7 +231,7 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { newpos = this.pos; break; default: - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Assertion failed: unknown type"); } return; @@ -259,7 +259,7 @@ class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { { hwAncestor = hwAncestor.getParent(); } - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { if (hwAncestor == null) { log.fine("Assertion (hwAncestor != null) failed, " + "couldn't find heavyweight ancestor of scroll pane child"); diff --git a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java index e87b0ad8c08..25b88f384cf 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java @@ -112,7 +112,7 @@ public class WToolkit extends SunToolkit implements Runnable { initIDs(); // Print out which version of Windows is running - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Win version: " + getWindowsVersion()); } @@ -848,7 +848,7 @@ public class WToolkit extends SunToolkit implements Runnable { lazilyInitWProps(); Boolean prop = (Boolean) desktopProperties.get("awt.dynamicLayoutSupported"); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("In WTK.isDynamicLayoutSupported()" + " nativeDynamic == " + nativeDynamic + " wprops.dynamic == " + prop); @@ -886,7 +886,7 @@ public class WToolkit extends SunToolkit implements Runnable { Map props = wprops.getProperties(); for (String propName : props.keySet()) { Object val = props.get(propName); - if (log.isLoggable(PlatformLogger.FINER)) { + if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("changed " + propName + " to " + val); } setDesktopProperty(propName, val); diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java index f36dd2119ce..2087e1663dc 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -460,7 +460,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, public void updateGC() { int scrn = getScreenImOn(); - if (screenLog.isLoggable(PlatformLogger.FINER)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Screen number: " + scrn); } @@ -485,7 +485,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, // is now mostly on. winGraphicsConfig = (Win32GraphicsConfig)newDev .getDefaultConfiguration(); - if (screenLog.isLoggable(PlatformLogger.FINE)) { + if (screenLog.isLoggable(PlatformLogger.Level.FINE)) { if (winGraphicsConfig == null) { screenLog.fine("Assertion (winGraphicsConfig != null) failed"); } @@ -730,7 +730,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, TranslucentWindowPainter currentPainter = painter; if (currentPainter != null) { currentPainter.updateWindow(repaint); - } else if (log.isLoggable(PlatformLogger.FINER)) { + } else if (log.isLoggable(PlatformLogger.Level.FINER)) { log.finer("Translucent window painter is null in updateWindow"); } } @@ -766,7 +766,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, public void propertyChange(PropertyChangeEvent e) { boolean isDisposed = (Boolean)e.getNewValue(); if (isDisposed != true) { - if (log.isLoggable(PlatformLogger.FINE)) { + if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine(" Assertion (newValue != true) failed for AppContext.GUI_DISPOSED "); } } diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java index ff3c3109c69..b76b6828774 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java @@ -137,7 +137,9 @@ class WindowsAsynchronousSocketChannelImpl // invoked by WindowsAsynchronousServerSocketChannelImpl when new connection // accept - void setConnected(SocketAddress localAddress, SocketAddress remoteAddress) { + void setConnected(InetSocketAddress localAddress, + InetSocketAddress remoteAddress) + { synchronized (stateLock) { state = ST_CONNECTED; this.localAddress = localAddress; diff --git a/jdk/src/windows/classes/sun/print/Win32PrintService.java b/jdk/src/windows/classes/sun/print/Win32PrintService.java index bef2213e664..829eaaa3131 100644 --- a/jdk/src/windows/classes/sun/print/Win32PrintService.java +++ b/jdk/src/windows/classes/sun/print/Win32PrintService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,11 +28,8 @@ package sun.print; import java.io.File; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; - -import java.util.Vector; +import java.util.ArrayList; import java.util.HashMap; - import javax.print.DocFlavor; import javax.print.DocPrintJob; import javax.print.PrintService; @@ -69,22 +66,14 @@ import javax.print.attribute.standard.Severity; import javax.print.attribute.standard.Sides; import javax.print.attribute.standard.ColorSupported; import javax.print.attribute.standard.PrintQuality; -import javax.print.attribute.ResolutionSyntax; import javax.print.attribute.standard.PrinterResolution; import javax.print.attribute.standard.SheetCollate; import javax.print.event.PrintServiceAttributeListener; -import java.util.ArrayList; - -import sun.print.SunPrinterJobService; public class Win32PrintService implements PrintService, AttributeUpdater, SunPrinterJobService { - public static MediaSize[] predefMedia; - - static { - Class c = Win32MediaSize.class; - } + public static MediaSize[] predefMedia = Win32MediaSize.getPredefMedia(); private static final DocFlavor[] supportedFlavors = { DocFlavor.BYTE_ARRAY.GIF, @@ -180,6 +169,9 @@ public class Win32PrintService implements PrintService, AttributeUpdater, private static final int DMDUP_VERTICAL = 2; private static final int DMDUP_HORIZONTAL = 3; private static final int DMCOLLATE_TRUE = 1; + private static final int DMCOLOR_MONOCHROME = 1; + private static final int DMCOLOR_COLOR = 2; + // media sizes with indices above dmPaperToPrintService' length private static final int DMPAPER_A2 = 66; @@ -310,7 +302,9 @@ public class Win32PrintService implements PrintService, AttributeUpdater, public MediaSizeName findWin32Media(int dmIndex) { if (dmIndex >= 1 && dmIndex <= dmPaperToPrintService.length) { - switch(dmIndex) { + return dmPaperToPrintService[dmIndex - 1]; + } + switch(dmIndex) { /* matching media sizes with indices beyond dmPaperToPrintService's length */ case DMPAPER_A2: @@ -320,11 +314,8 @@ public class Win32PrintService implements PrintService, AttributeUpdater, case DMPAPER_B6_JIS: return MediaSizeName.JIS_B6; default: - return dmPaperToPrintService[dmIndex - 1]; - } + return null; } - - return null; } private boolean addToUniqueList(ArrayList msnList, MediaSizeName mediaName) { @@ -350,6 +341,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, } ArrayList msnList = new ArrayList(); + ArrayList trailingWmsList = new ArrayList(); ArrayList printableList = new ArrayList(); MediaSizeName mediaName; boolean added; @@ -368,7 +360,8 @@ public class Win32PrintService implements PrintService, AttributeUpdater, idList.add(Integer.valueOf(media[i])); } - mediaSizes = getMediaSizes(idList, media); + ArrayList dmPaperNameList = new ArrayList(); + mediaSizes = getMediaSizes(idList, media, dmPaperNameList); for (int i = 0; i < idList.size(); i++) { // match Win ID with our predefined ID using table @@ -387,6 +380,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, mediaName = null; } } + boolean dmPaperIDMatched = (mediaName != null); // No match found, then we get the MediaSizeName out of the MediaSize // This requires 1-1 correspondence, lengths must be checked. @@ -395,9 +389,32 @@ public class Win32PrintService implements PrintService, AttributeUpdater, } // Add mediaName to the msnList + added = false; if (mediaName != null) { added = addToUniqueList(msnList, mediaName); } + if ((!dmPaperIDMatched || !added) && (idList.size() == dmPaperNameList.size())) { + /* The following block allows to add such media names to the list, whose sizes + * matched with media sizes predefined in JDK, while whose paper IDs did not, + * or whose sizes and paper IDs both did not match with any predefined in JDK. + */ + Win32MediaSize wms = Win32MediaSize.findMediaName(dmPaperNameList.get(i)); + if ((wms == null) && (idList.size() == mediaSizes.length)) { + wms = new Win32MediaSize(dmPaperNameList.get(i), (Integer)idList.get(i)); + mediaSizes[i] = new MediaSize(mediaSizes[i].getX(MediaSize.MM), + mediaSizes[i].getY(MediaSize.MM), MediaSize.MM, wms); + } + if ((wms != null) && (wms != mediaName)) { + if (!added) { + added = addToUniqueList(msnList, mediaName = wms); + } else { + trailingWmsList.add(wms); + } + } + } + } + for (Win32MediaSize wms : trailingWmsList) { + added = addToUniqueList(msnList, wms); } // init mediaSizeNames @@ -588,7 +605,11 @@ public class Win32PrintService implements PrintService, AttributeUpdater, } - private MediaSize[] getMediaSizes(ArrayList idList, int[] media) { + private MediaSize[] getMediaSizes(ArrayList idList, int[] media, ArrayList dmPaperNameList) { + if (dmPaperNameList == null) { + dmPaperNameList = new ArrayList(); + } + String prnPort = getPort(); int[] mediaSz = getAllMediaSizes(printer, prnPort); String[] winMediaNames = getAllMediaNames(printer, prnPort); @@ -607,40 +628,43 @@ public class Win32PrintService implements PrintService, AttributeUpdater, wid = mediaSz[i*2]/10f; ht = mediaSz[i*2+1]/10f; - // Make sure to validate wid & ht. - // HP LJ 4050 (german) causes IAE in Sonderformat paper, wid & ht - // returned is not constant. - if ((wid <= 0) || (ht <= 0)) { - //Remove corresponding ID from list - if (nMedia == media.length) { - Integer remObj = Integer.valueOf(media[i]); - idList.remove(idList.indexOf(remObj)); + // Make sure to validate wid & ht. + // HP LJ 4050 (german) causes IAE in Sonderformat paper, wid & ht + // returned is not constant. + if ((wid <= 0) || (ht <= 0)) { + //Remove corresponding ID from list + if (nMedia == media.length) { + Integer remObj = Integer.valueOf(media[i]); + idList.remove(idList.indexOf(remObj)); + } + continue; } - continue; - } - // Find matching media using dimensions. - // This call matches only with our own predefined sizes. - msn = findMatchingMediaSizeNameMM(wid, ht); - if (msn != null) { - ms = MediaSize.getMediaSizeForName(msn); - } - - if (ms != null) { - msList.add(ms); - } else { - Win32MediaSize wms = - new Win32MediaSize(winMediaNames[i], media[i]); - try { - ms = new MediaSize(wid, ht, MediaSize.MM, wms); - msList.add(ms); - } catch(IllegalArgumentException e) { - if (nMedia == media.length) { - Integer remObj = Integer.valueOf(media[i]); - idList.remove(idList.indexOf(remObj)); - } + // Find matching media using dimensions. + // This call matches only with our own predefined sizes. + msn = findMatchingMediaSizeNameMM(wid, ht); + if (msn != null) { + ms = MediaSize.getMediaSizeForName(msn); } - } + if (ms != null) { + msList.add(ms); + dmPaperNameList.add(winMediaNames[i]); + } else { + Win32MediaSize wms = Win32MediaSize.findMediaName(winMediaNames[i]); + if (wms == null) { + wms = new Win32MediaSize(winMediaNames[i], media[i]); + } + try { + ms = new MediaSize(wid, ht, MediaSize.MM, wms); + msList.add(ms); + dmPaperNameList.add(winMediaNames[i]); + } catch(IllegalArgumentException e) { + if (nMedia == media.length) { + Integer remObj = Integer.valueOf(media[i]); + idList.remove(idList.indexOf(remObj)); + } + } + } } MediaSize[] arr2 = new MediaSize[msList.size()]; @@ -1041,6 +1065,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, int defOrient = defaults[5]; int defSides = defaults[6]; int defCollate = defaults[7]; + int defColor = defaults[8]; if (category == Copies.class) { if (defCopies > 0) { @@ -1049,11 +1074,10 @@ public class Win32PrintService implements PrintService, AttributeUpdater, return new Copies(1); } } else if (category == Chromaticity.class) { - int caps = getPrinterCapabilities(); - if ((caps & DEVCAP_COLOR) == 0) { - return Chromaticity.MONOCHROME; - } else { + if (defColor == DMCOLOR_COLOR) { return Chromaticity.COLOR; + } else { + return Chromaticity.MONOCHROME; } } else if (category == JobName.class) { return new JobName("Java Printing", null); @@ -1614,6 +1638,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater, class Win32MediaSize extends MediaSizeName { private static ArrayList winStringTable = new ArrayList(); private static ArrayList winEnumTable = new ArrayList(); + private static MediaSize[] predefMedia; private int dmPaperID; // driver ID for this paper. @@ -1627,6 +1652,18 @@ class Win32MediaSize extends MediaSizeName { return (winStringTable.size()-1); } + public static synchronized Win32MediaSize findMediaName(String name) { + int nameIndex = winStringTable.indexOf(name); + if (nameIndex != -1) { + return (Win32MediaSize)winEnumTable.get(nameIndex); + } + return null; + } + + public static MediaSize[] getPredefMedia() { + return predefMedia; + } + public Win32MediaSize(String name, int dmPaper) { super(nextValue(name)); dmPaperID = dmPaper; @@ -1638,18 +1675,17 @@ class Win32MediaSize extends MediaSizeName { } static { - /* initialize Win32PrintService.predefMedia */ + /* initialize predefMedia */ { Win32MediaSize winMedia = new Win32MediaSize(-1); // cannot call getSuperEnumTable directly because of static context MediaSizeName[] enumMedia = winMedia.getSuperEnumTable(); if (enumMedia != null) { - Win32PrintService.predefMedia = new MediaSize[enumMedia.length]; + predefMedia = new MediaSize[enumMedia.length]; for (int i=0; iFindClass(env, "java/net/InetSocketAddress"); + CHECK_NULL(cls); isa_class = (*env)->NewGlobalRef(env, cls); isa_ctorID = (*env)->GetMethodID(env, cls, "", "(Ljava/net/InetAddress;I)V"); @@ -82,7 +83,9 @@ JNIEXPORT jint JNICALL Java_java_net_DualStackPlainSocketImpl_socket0 * Signature: (ILjava/net/InetAddress;I)V */ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_bind0 - (JNIEnv *env, jclass clazz, jint fd, jobject iaObj, jint port) { + (JNIEnv *env, jclass clazz, jint fd, jobject iaObj, jint port, + jboolean exclBind) +{ SOCKETADDRESS sa; int rv; int sa_len = sizeof(sa); @@ -92,7 +95,7 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_bind0 return; } - rv = NET_Bind(fd, (struct sockaddr *)&sa, sa_len); + rv = NET_WinBind(fd, (struct sockaddr *)&sa, sa_len, exclBind); if (rv == SOCKET_ERROR) NET_ThrowNew(env, WSAGetLastError(), "JVM_Bind"); diff --git a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c index e92914bf832..5adadd28e0f 100644 --- a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c +++ b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c @@ -421,7 +421,8 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) { JNIEXPORT void JNICALL Java_java_net_TwoStacksPlainDatagramSocketImpl_bind0(JNIEnv *env, jobject this, - jint port, jobject addressObj) { + jint port, jobject addressObj, + jboolean exclBind) { jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); jobject fd1Obj = (*env)->GetObjectField(env, this, pdsi_fd1ID); @@ -464,7 +465,7 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_bind0(JNIEnv *env, jobject this, v6bind.addr = &lcladdr; v6bind.ipv4_fd = fd; v6bind.ipv6_fd = fd1; - if (NET_BindV6(&v6bind) != -1) { + if (NET_BindV6(&v6bind, exclBind) != -1) { /* check if the fds have changed */ if (v6bind.ipv4_fd != fd) { fd = v6bind.ipv4_fd; @@ -491,7 +492,7 @@ Java_java_net_TwoStacksPlainDatagramSocketImpl_bind0(JNIEnv *env, jobject this, return; } } else { - if (bind(fd, (struct sockaddr *)&lcladdr, lcladdrlen) == -1) { + if (NET_WinBind(fd, (struct sockaddr *)&lcladdr, lcladdrlen, exclBind) == -1) { if (WSAGetLastError() == WSAEACCES) { WSASetLastError(WSAEADDRINUSE); } @@ -1782,11 +1783,11 @@ static void setMulticastInterface(JNIEnv *env, jobject this, int fd, int fd1, /* * Class: java_net_TwoStacksPlainDatagramSocketImpl - * Method: socketSetOption + * Method: socketNativeSetOption * Signature: (ILjava/lang/Object;)V */ JNIEXPORT void JNICALL -Java_java_net_TwoStacksPlainDatagramSocketImpl_socketSetOption(JNIEnv *env,jobject this, +Java_java_net_TwoStacksPlainDatagramSocketImpl_socketNativeSetOption(JNIEnv *env,jobject this, jint opt,jobject value) { int fd=-1, fd1=-1; diff --git a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c index 73a799f6055..6823ddc7c7c 100644 --- a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c +++ b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c @@ -394,7 +394,8 @@ Java_java_net_TwoStacksPlainSocketImpl_socketConnect(JNIEnv *env, jobject this, */ JNIEXPORT void JNICALL Java_java_net_TwoStacksPlainSocketImpl_socketBind(JNIEnv *env, jobject this, - jobject iaObj, jint localport) { + jobject iaObj, jint localport, + jboolean exclBind) { /* fdObj is the FileDescriptor field on this */ jobject fdObj, fd1Obj; @@ -438,13 +439,12 @@ Java_java_net_TwoStacksPlainSocketImpl_socketBind(JNIEnv *env, jobject this, (struct sockaddr *)&him, &len, JNI_FALSE) != 0) { return; } - if (ipv6_supported) { struct ipv6bind v6bind; v6bind.addr = &him; v6bind.ipv4_fd = fd; v6bind.ipv6_fd = fd1; - rv = NET_BindV6(&v6bind); + rv = NET_BindV6(&v6bind, exclBind); if (rv != -1) { /* check if the fds have changed */ if (v6bind.ipv4_fd != fd) { @@ -469,7 +469,7 @@ Java_java_net_TwoStacksPlainSocketImpl_socketBind(JNIEnv *env, jobject this, } } } else { - rv = NET_Bind(fd, (struct sockaddr *)&him, len); + rv = NET_WinBind(fd, (struct sockaddr *)&him, len, exclBind); } if (rv == -1) { @@ -835,11 +835,12 @@ Java_java_net_TwoStacksPlainSocketImpl_socketClose0(JNIEnv *env, jobject this, * * * Class: java_net_TwoStacksPlainSocketImpl - * Method: socketSetOption + * Method: socketNativeSetOption * Signature: (IZLjava/lang/Object;)V */ JNIEXPORT void JNICALL -Java_java_net_TwoStacksPlainSocketImpl_socketSetOption(JNIEnv *env, jobject this, +Java_java_net_TwoStacksPlainSocketImpl_socketNativeSetOption(JNIEnv *env, + jobject this, jint cmd, jboolean on, jobject value) { int fd, fd1; diff --git a/jdk/src/windows/native/java/net/net_util_md.c b/jdk/src/windows/native/java/net/net_util_md.c index 99629ba85ac..4e5cb50b0bc 100644 --- a/jdk/src/windows/native/java/net/net_util_md.c +++ b/jdk/src/windows/native/java/net/net_util_md.c @@ -387,12 +387,24 @@ NET_SetSockOpt(int s, int level, int optname, const void *optval, int optlen) { int rv; + int parg; + int plen = sizeof(parg); if (level == IPPROTO_IP && optname == IP_TOS) { int *tos = (int *)optval; *tos &= (IPTOS_TOS_MASK | IPTOS_PREC_MASK); } + if (optname == SO_REUSEADDR) { + /* + * Do not set SO_REUSEADDE if SO_EXCLUSIVEADDUSE is already set + */ + rv = NET_GetSockOpt(s, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *)&parg, &plen); + if (rv == 0 && parg == 1) { + return rv; + } + } + rv = setsockopt(s, level, optname, optval, optlen); if (rv == SOCKET_ERROR) { @@ -455,16 +467,33 @@ NET_GetSockOpt(int s, int level, int optname, void *optval, return rv; } +/* + * Sets SO_ECLUSIVEADDRUSE if SO_REUSEADDR is not already set. + */ +void setExclusiveBind(int fd) { + int parg; + int plen = sizeof(parg); + int rv = 0; + rv = NET_GetSockOpt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&parg, &plen); + if (rv == 0 && parg == 0) { + parg = 1; + rv = NET_SetSockOpt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char*)&parg, plen); + } +} + /* * Wrapper for bind winsock call - transparent converts an * error related to binding to a port that has exclusive access * into an error indicating the port is in use (facilitates * better error reporting). + * + * Should be only called by the wrapper method NET_WinBind */ JNIEXPORT int JNICALL NET_Bind(int s, struct sockaddr *him, int len) { - int rv = bind(s, him, len); + int rv; + rv = bind(s, him, len); if (rv == SOCKET_ERROR) { /* @@ -479,6 +508,18 @@ NET_Bind(int s, struct sockaddr *him, int len) return rv; } +/* + * Wrapper for NET_Bind call. Sets SO_EXCLUSIVEADDRUSE + * if required, and then calls NET_BIND + */ +JNIEXPORT int JNICALL +NET_WinBind(int s, struct sockaddr *him, int len, jboolean exclBind) +{ + if (exclBind == JNI_TRUE) + setExclusiveBind(s); + return NET_Bind(s, him, len); +} + JNIEXPORT int JNICALL NET_SocketClose(int fd) { struct linger l; @@ -625,7 +666,7 @@ void dumpAddr (char *str, void *addr) { */ JNIEXPORT int JNICALL -NET_BindV6(struct ipv6bind* b) { +NET_BindV6(struct ipv6bind* b, jboolean exclBind) { int fd=-1, ofd=-1, rv, len; /* need to defer close until new sockets created */ int close_fd=-1, close_ofd=-1; @@ -638,8 +679,8 @@ NET_BindV6(struct ipv6bind* b) { if (family == AF_INET && (b->addr->him4.sin_addr.s_addr != INADDR_ANY)) { /* bind to v4 only */ int ret; - ret = NET_Bind ((int)b->ipv4_fd, (struct sockaddr *)b->addr, - sizeof (struct sockaddr_in)); + ret = NET_WinBind ((int)b->ipv4_fd, (struct sockaddr *)b->addr, + sizeof (struct sockaddr_in), exclBind); if (ret == SOCKET_ERROR) { CLOSE_SOCKETS_AND_RETURN; } @@ -650,8 +691,8 @@ NET_BindV6(struct ipv6bind* b) { if (family == AF_INET6 && (!IN6_IS_ADDR_ANY(&b->addr->him6.sin6_addr))) { /* bind to v6 only */ int ret; - ret = NET_Bind ((int)b->ipv6_fd, (struct sockaddr *)b->addr, - sizeof (struct SOCKADDR_IN6)); + ret = NET_WinBind ((int)b->ipv6_fd, (struct sockaddr *)b->addr, + sizeof (struct SOCKADDR_IN6), exclBind); if (ret == SOCKET_ERROR) { CLOSE_SOCKETS_AND_RETURN; } @@ -680,7 +721,7 @@ NET_BindV6(struct ipv6bind* b) { oaddr.him4.sin_addr.s_addr = INADDR_ANY; } - rv = NET_Bind (fd, (struct sockaddr *)b->addr, SOCKETADDRESS_LEN(b->addr)); + rv = NET_WinBind(fd, (struct sockaddr *)b->addr, SOCKETADDRESS_LEN(b->addr), exclBind); if (rv == SOCKET_ERROR) { CLOSE_SOCKETS_AND_RETURN; } @@ -692,8 +733,8 @@ NET_BindV6(struct ipv6bind* b) { } bound_port = GET_PORT (b->addr); SET_PORT (&oaddr, bound_port); - if ((rv=NET_Bind (ofd, (struct sockaddr *) &oaddr, - SOCKETADDRESS_LEN (&oaddr))) == SOCKET_ERROR) { + if ((rv=NET_WinBind (ofd, (struct sockaddr *) &oaddr, + SOCKETADDRESS_LEN (&oaddr), exclBind)) == SOCKET_ERROR) { int retries; int sotype, arglen=sizeof(sotype); @@ -729,7 +770,8 @@ NET_BindV6(struct ipv6bind* b) { /* bind random port on first socket */ SET_PORT (&oaddr, 0); - rv = NET_Bind (ofd, (struct sockaddr *)&oaddr, SOCKETADDRESS_LEN(&oaddr)); + rv = NET_WinBind (ofd, (struct sockaddr *)&oaddr, SOCKETADDRESS_LEN(&oaddr), + exclBind); if (rv == SOCKET_ERROR) { CLOSE_SOCKETS_AND_RETURN; } @@ -745,7 +787,8 @@ NET_BindV6(struct ipv6bind* b) { } bound_port = GET_PORT (&oaddr); SET_PORT (b->addr, bound_port); - rv = NET_Bind (fd, (struct sockaddr *)b->addr, SOCKETADDRESS_LEN(b->addr)); + rv = NET_WinBind (fd, (struct sockaddr *)b->addr, SOCKETADDRESS_LEN(b->addr), + exclBind); if (rv != SOCKET_ERROR) { if (family == AF_INET) { diff --git a/jdk/src/windows/native/java/net/net_util_md.h b/jdk/src/windows/native/java/net/net_util_md.h index 50a275534bf..6964d9dc3b5 100644 --- a/jdk/src/windows/native/java/net/net_util_md.h +++ b/jdk/src/windows/native/java/net/net_util_md.h @@ -311,7 +311,7 @@ void NET_ThrowSocketException(JNIEnv *env, char* msg); */ JNIEXPORT int JNICALL NET_Timeout2(int fd, int fd1, long timeout, int *fdret); -JNIEXPORT int JNICALL NET_BindV6(struct ipv6bind* b); +JNIEXPORT int JNICALL NET_BindV6(struct ipv6bind* b, jboolean exclBind); #define NET_WAIT_READ 0x01 #define NET_WAIT_WRITE 0x02 @@ -319,6 +319,9 @@ JNIEXPORT int JNICALL NET_BindV6(struct ipv6bind* b); extern jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout); +JNIEXPORT int JNICALL NET_WinBind(int s, struct sockaddr *him, int len, + jboolean exclBind); + /* XP versions of the native routines */ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByName0_XP diff --git a/jdk/src/windows/native/sun/awt/splashscreen/splashscreen_sys.c b/jdk/src/windows/native/sun/awt/splashscreen/splashscreen_sys.c index 45950ff435f..7ed415d2554 100644 --- a/jdk/src/windows/native/sun/awt/splashscreen/splashscreen_sys.c +++ b/jdk/src/windows/native/sun/awt/splashscreen/splashscreen_sys.c @@ -37,6 +37,7 @@ #include #include #include +#include "sizecalc.h" #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0x80000 @@ -67,7 +68,10 @@ char* SplashConvertStringAlloc(const char* in, int *size) { len = strlen(in); outChars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, in, len, NULL, 0); - buf = malloc(outChars*sizeof(WCHAR)); + buf = (WCHAR*) SAFE_SIZE_ARRAY_ALLOC(malloc, outChars, sizeof(WCHAR)); + if (!buf) { + return NULL; + } rc = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, in, len, buf, outChars); if (rc==0) { @@ -98,8 +102,14 @@ SplashInitFrameShape(Splash * splash, int imageIndex) return; /* reserving memory for the worst case */ - pRgnData = (RGNDATA *) malloc(sizeof(RGNDATAHEADER) + - sizeof(RECT) * (splash->width / 2 + 1) * splash->height); + if (!IS_SAFE_SIZE_MUL(splash->width / 2 + 1, splash->height)) { + return; + } + pRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(malloc, sizeof(RGNDATAHEADER), + sizeof(RECT), (splash->width / 2 + 1) * splash->height); + if (!pRgnData) { + return; + } pRgnHdr = (RGNDATAHEADER *) pRgnData; initRect(&maskRect, 0, 0, splash->width, splash->height, 1, splash->width * splash->imageFormat.depthBytes, @@ -130,7 +140,6 @@ SplashPaint(Splash * splash, HDC hdc) { unsigned numColors = splash->screenFormat.colorMap ? splash->screenFormat.numColors : 0; - unsigned bmiSize; BITMAPV4HEADER *pBmi; HPALETTE hOldPal = NULL; @@ -138,8 +147,11 @@ SplashPaint(Splash * splash, HDC hdc) return; if (splash->currentFrame < 0 || splash->currentFrame >= splash->frameCount) return; - bmiSize = sizeof(BITMAPV4HEADER) + sizeof(RGBQUAD) * numColors; - pBmi = (BITMAPV4HEADER *) alloca(bmiSize); + pBmi = (BITMAPV4HEADER *) SAFE_SIZE_STRUCT_ALLOC(alloca, sizeof(BITMAPV4HEADER), + sizeof(RGBQUAD), numColors); + if (!pBmi) { + return; + } memset(pBmi, 0, sizeof(BITMAPV4HEADER)); if (splash->screenFormat.colorMap) memcpy(((BYTE *) pBmi) + sizeof(BITMAPV4HEADER), @@ -163,8 +175,11 @@ SplashPaint(Splash * splash, HDC hdc) here on demand */ if (!splash->hPalette) { unsigned i; - LOGPALETTE *pLogPal = - malloc(sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * numColors); + LOGPALETTE *pLogPal = (LOGPALETTE *) SAFE_SIZE_STRUCT_ALLOC(malloc, + sizeof(LOGPALETTE), sizeof(PALETTEENTRY), numColors); + if (!pLogPal) { + return; + } pLogPal->palVersion = 0x300; pLogPal->palNumEntries = (WORD) numColors; diff --git a/jdk/src/windows/native/sun/font/lcdglyph.c b/jdk/src/windows/native/sun/font/lcdglyph.c index 4f408d17021..b24a305b816 100644 --- a/jdk/src/windows/native/sun/font/lcdglyph.c +++ b/jdk/src/windows/native/sun/font/lcdglyph.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include "fontscalerdefs.h" @@ -374,11 +375,11 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows bmi.bmiHeader.biBitCount = 24; bmi.bmiHeader.biCompression = BI_RGB; - dibImageSize = dibBytesWidth*height; - dibImage = malloc(dibImageSize); + dibImage = SAFE_SIZE_ARRAY_ALLOC(malloc, dibBytesWidth, height); if (dibImage == NULL) { FREE_AND_RETURN; } + dibImageSize = dibBytesWidth*height; memset(dibImage, 0, dibImageSize); err = GetDIBits(hMemoryDC, hBitmap, 0, height, dibImage, @@ -407,11 +408,12 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows * that extra "1" was added as padding, so the sub-pixel positioning of * fractional metrics could index into it. */ - imageSize = bytesWidth*height; - glyphInfo = (GlyphInfo*)malloc(sizeof(GlyphInfo)+imageSize); + glyphInfo = (GlyphInfo*)SAFE_SIZE_STRUCT_ALLOC(malloc, sizeof(GlyphInfo), + bytesWidth, height); if (glyphInfo == NULL) { FREE_AND_RETURN; } + imageSize = bytesWidth*height; glyphInfo->cellInfo = NULL; glyphInfo->rowBytes = bytesWidth; glyphInfo->width = width; diff --git a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c index cf68feb5f7e..ee553224b25 100644 --- a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c +++ b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c @@ -30,6 +30,7 @@ #include "jni.h" #include "jlong.h" #include "jni_util.h" +#include "sizecalc.h" #include "OGLRenderQueue.h" #include "WGLGraphicsConfig.h" #include "WGLSurfaceData.h" @@ -603,7 +604,7 @@ JNIEXPORT jboolean JNICALL height = h; srcx = srcy = dstx = dsty = 0; - pDst = malloc(height * scanStride); + pDst = SAFE_SIZE_ARRAY_ALLOC(malloc, height, scanStride); if (pDst == NULL) { return JNI_FALSE; } diff --git a/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp b/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp index 5f888977713..271074c55e5 100644 --- a/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp +++ b/jdk/src/windows/native/sun/java2d/windows/GDIBlitLoops.cpp @@ -166,6 +166,7 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit // when using ByteGray surfaces. Eventually, we should use // the new Disposer mechanism to delete this native memory. if (byteGrayPalette == NULL) { + // assert (256 * sizeof(RGBQUAD)) <= SIZE_MAX byteGrayPalette = (RGBQUAD *)safe_Malloc(256 * sizeof(RGBQUAD)); for (int i = 0; i < 256; ++i) { byteGrayPalette[i].rgbRed = i; diff --git a/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp b/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp index 27a6a390f52..33c6205a6ba 100644 --- a/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp +++ b/jdk/src/windows/native/sun/java2d/windows/GDIRenderer.cpp @@ -84,7 +84,7 @@ static POINT *TransformPoly(jint *xpoints, jint *ypoints, *pNpoints = outpoints; } if (outpoints > POLYTEMPSIZE) { - pPoints = (POINT *) safe_Malloc(sizeof(POINT) * outpoints); + pPoints = (POINT *) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(POINT), outpoints); } BOOL isempty = fixend; for (int i = 0; i < npoints; i++) { diff --git a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp index e4473d268e8..2d5532bcdac 100644 --- a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp +++ b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp @@ -1056,8 +1056,9 @@ GDIWinSD_InitDC(JNIEnv *env, GDIWinSDOps *wsdo, ThreadGraphicsInfo *info, int topInset = wsdo->insets.top; Region_StartIteration(env, &clipInfo); jint numrects = Region_CountIterationRects(&clipInfo); - DWORD nCount = sizeof(RGNDATAHEADER) + numrects * sizeof(RECT); - RGNDATA *lpRgnData = (RGNDATA *) safe_Malloc(nCount); + RGNDATA *lpRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(safe_Malloc, + sizeof(RGNDATAHEADER), numrects, sizeof(RECT)); + const DWORD nCount = sizeof(RGNDATAHEADER) + numrects * sizeof(RECT); lpRgnData->rdh.dwSize = sizeof(RGNDATAHEADER); lpRgnData->rdh.iType = RDH_RECTANGLES; lpRgnData->rdh.nCount = numrects; diff --git a/jdk/src/windows/native/sun/nio/ch/Net.c b/jdk/src/windows/native/sun/nio/ch/Net.c index 8d515e88471..733405e6f80 100644 --- a/jdk/src/windows/native/sun/nio/ch/Net.c +++ b/jdk/src/windows/native/sun/nio/ch/Net.c @@ -101,6 +101,18 @@ Java_sun_nio_ch_Net_isIPv6Available0(JNIEnv* env, jclass cl) return JNI_FALSE; } +JNIEXPORT jint JNICALL +Java_sun_nio_ch_Net_isExclusiveBindAvailable(JNIEnv *env, jclass clazz) { + OSVERSIONINFO ver; + int version; + ver.dwOSVersionInfoSize = sizeof(ver); + GetVersionEx(&ver); + version = ver.dwMajorVersion * 10 + ver.dwMinorVersion; + //if os <= xp exclusive binding is off by default + return version >= 60 ? 1 : 0; +} + + JNIEXPORT jboolean JNICALL Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl) { @@ -144,8 +156,8 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, } JNIEXPORT void JNICALL -Java_sun_nio_ch_Net_bind0(JNIEnv *env, jclass clazz, jboolean preferIPv6, - jobject fdo, jobject iao, jint port) +Java_sun_nio_ch_Net_bind0(JNIEnv *env, jclass clazz, jobject fdo, jboolean preferIPv6, + jboolean isExclBind, jobject iao, jint port) { SOCKETADDRESS sa; int rv; @@ -155,7 +167,7 @@ Java_sun_nio_ch_Net_bind0(JNIEnv *env, jclass clazz, jboolean preferIPv6, return; } - rv = NET_Bind(fdval(env, fdo), (struct sockaddr *)&sa, sa_len); + rv = NET_WinBind(fdval(env, fdo), (struct sockaddr *)&sa, sa_len, isExclBind); if (rv == SOCKET_ERROR) NET_ThrowNew(env, WSAGetLastError(), "bind"); } diff --git a/jdk/src/windows/native/sun/windows/CmdIDList.cpp b/jdk/src/windows/native/sun/windows/CmdIDList.cpp index 3a036c8ed49..b829af1e6ca 100644 --- a/jdk/src/windows/native/sun/windows/CmdIDList.cpp +++ b/jdk/src/windows/native/sun/windows/CmdIDList.cpp @@ -39,7 +39,7 @@ AwtCmdIDList::AwtCmdIDList() { m_capacity = ARRAY_INITIAL_SIZE; m_first_free = -1; - m_array = (CmdIDEntry *)safe_Malloc(m_capacity * sizeof(AwtObject*)); + m_array = (CmdIDEntry *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, m_capacity, sizeof(AwtObject*)); BuildFreeList(0); } @@ -80,8 +80,8 @@ UINT AwtCmdIDList::Add(AwtObject* obj) m_capacity += ARRAY_SIZE_INCREMENT; if (m_capacity > ARRAY_MAXIMUM_SIZE) m_capacity = ARRAY_MAXIMUM_SIZE; - m_array = (CmdIDEntry *)safe_Realloc(m_array, - m_capacity * sizeof(CmdIDEntry*)); + m_array = (CmdIDEntry *)SAFE_SIZE_ARRAY_REALLOC(safe_Realloc, m_array, + m_capacity, sizeof(CmdIDEntry*)); BuildFreeList(old_capacity); } } diff --git a/jdk/src/windows/native/sun/windows/Devices.cpp b/jdk/src/windows/native/sun/windows/Devices.cpp index 27299d34a0c..85ac51da33f 100644 --- a/jdk/src/windows/native/sun/windows/Devices.cpp +++ b/jdk/src/windows/native/sun/windows/Devices.cpp @@ -171,8 +171,8 @@ Devices::Devices(int numDevices) J2dTraceLn1(J2D_TRACE_INFO, "Devices::Devices numDevices=%d", numDevices); this->numDevices = numDevices; this->refCount = 0; - devices = (AwtWin32GraphicsDevice**)safe_Malloc - (numDevices * sizeof(AwtWin32GraphicsDevice *)); + devices = (AwtWin32GraphicsDevice**)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, + numDevices, sizeof(AwtWin32GraphicsDevice *)); } /** @@ -188,7 +188,8 @@ BOOL Devices::UpdateInstance(JNIEnv *env) J2dTraceLn(J2D_TRACE_INFO, "Devices::UpdateInstance"); int numScreens = CountMonitors(); - HMONITOR *monHds = (HMONITOR *)safe_Malloc(numScreens * sizeof(HMONITOR)); + HMONITOR *monHds = (HMONITOR *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, + numScreens, sizeof(HMONITOR)); if (numScreens != CollectMonitors(monHds, numScreens)) { J2dRlsTraceLn(J2D_TRACE_ERROR, "Devices::UpdateInstance: Failed to get all "\ diff --git a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp index 7a18213d879..02e7a06818e 100644 --- a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp +++ b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp @@ -393,6 +393,9 @@ JNIEXPORT jlong JNICALL Java_sun_awt_shell_Win32ShellFolder2_copyFirstPIDLEntry if (cb == 0) return 0; + if (!IS_SAFE_SIZE_ADD(cb, sizeof(SHITEMID))) { + return 0; + } // Allocate space for this as well as null-terminating entry. LPITEMIDLIST newPIDL = (LPITEMIDLIST)pMalloc->Alloc(cb + sizeof(SHITEMID)); @@ -433,6 +436,9 @@ JNIEXPORT jlong JNICALL Java_sun_awt_shell_Win32ShellFolder2_combinePIDLs int len1 = pidlLength(parentPIDL); int len2 = pidlLength(relativePIDL); + if (!IS_SAFE_SIZE_ADD(len1, len2) || !IS_SAFE_SIZE_ADD(len1 + len2, sizeof(SHITEMID))) { + return 0; + } LPITEMIDLIST newPIDL = (LPITEMIDLIST)pMalloc->Alloc(len1 + len2 + sizeof(SHITEMID)); memcpy(newPIDL, parentPIDL, len1); memcpy(((LPBYTE) newPIDL) + len1, relativePIDL, len2); diff --git a/jdk/src/windows/native/sun/windows/WPrinterJob.cpp b/jdk/src/windows/native/sun/windows/WPrinterJob.cpp index 37075266d34..4bb49983e8d 100644 --- a/jdk/src/windows/native/sun/windows/WPrinterJob.cpp +++ b/jdk/src/windows/native/sun/windows/WPrinterJob.cpp @@ -750,7 +750,7 @@ Java_sun_print_Win32PrintService_getCapabilities(JNIEnv *env, #define GETDEFAULT_ERROR -50 -#define NDEFAULT 8 +#define NDEFAULT 9 JNIEXPORT jintArray JNICALL Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env, @@ -810,7 +810,7 @@ Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env, int numSizes = ::DeviceCapabilities(printerName, printerPort, DC_PAPERS, NULL, NULL); if (numSizes > 0) { - LPTSTR papers = (LPTSTR)safe_Malloc(numSizes * sizeof(WORD)); + LPTSTR papers = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, numSizes, sizeof(WORD)); if (papers != NULL && ::DeviceCapabilities(printerName, printerPort, DC_PAPERS, papers, NULL) != -1) { @@ -859,6 +859,11 @@ Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env, defIndices[7] = pDevMode->dmCollate; } + if (pDevMode->dmFields & DM_COLOR) { + defIndices[8] = pDevMode->dmColor; + } + + GlobalFree(pDevMode); ::ClosePrinter(hPrinter); diff --git a/jdk/src/windows/native/sun/windows/alloc.h b/jdk/src/windows/native/sun/windows/alloc.h index 527da4227c8..7b497e937d0 100644 --- a/jdk/src/windows/native/sun/windows/alloc.h +++ b/jdk/src/windows/native/sun/windows/alloc.h @@ -40,6 +40,9 @@ namespace std { class bad_alloc {}; } +#define SIZECALC_ALLOC_THROWING_BAD_ALLOC +#include "sizecalc.h" + class awt_toolkit_shutdown {}; // Disable "C++ Exception Specification ignored" warnings. diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index 0ae6511c236..42684be1361 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -326,7 +326,7 @@ public: m_dwSize = cbTCharCount; m_pStr = (0 == m_dwSize) ? NULL - : (LPWSTR)safe_Malloc( (m_dwSize+1)*sizeof(WCHAR) ); + : (LPWSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (m_dwSize+1), sizeof(WCHAR) ); } JavaStringBuffer(JNIEnv *env, jstring text) { @@ -336,7 +336,7 @@ public: if (0 == m_dwSize) { m_pStr = NULL; } else { - m_pStr = (LPWSTR)safe_Malloc( (m_dwSize+1)*sizeof(WCHAR) ); + m_pStr = (LPWSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (m_dwSize+1), sizeof(WCHAR) ); env->GetStringRegion(text, 0, m_dwSize, reinterpret_cast(m_pStr)); m_pStr[m_dwSize] = 0; } @@ -353,7 +353,7 @@ public: //The function is used only for space reservation in staff buffer for //followed data copying process. And that is the reason why we ignore //the special case m_dwSize==0 here. - m_pStr = (LPWSTR)safe_Realloc(m_pStr, (m_dwSize+1)*sizeof(WCHAR) ); + m_pStr = (LPWSTR)SAFE_SIZE_ARRAY_REALLOC(safe_Realloc, m_pStr, m_dwSize+1, sizeof(WCHAR) ); } //we are in UNICODE now, so LPWSTR:=:LPTSTR operator LPWSTR() { return getNonEmptyString(); } diff --git a/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp index 4ca8eb0da32..f75ee904bb0 100644 --- a/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp +++ b/jdk/src/windows/native/sun/windows/awt_BitmapUtil.cpp @@ -39,13 +39,13 @@ HBITMAP BitmapUtil::CreateTransparencyMaskFromARGB(int width, int height, int* imageData) { //Scan lines should be aligned to word boundary - int bufLength = ((width + 15) / 16 * 2) * height;//buf length (bytes) + if (!IS_SAFE_SIZE_ADD(width, 15)) return NULL; + char* buf = SAFE_SIZE_NEW_ARRAY2(char, (width + 15) / 16 * 2, height); + if (buf == NULL) return NULL; int* srcPos = imageData; - char* buf = new char[bufLength]; char* bufPos = buf; int tmp = 0; int cbit = 0x80; - if (buf == NULL) return NULL; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { //cbit is shifted right for every pixel @@ -251,8 +251,12 @@ HRGN BitmapUtil::BitmapToRgn(HBITMAP hBitmap) reinterpret_cast(&bi), DIB_RGB_COLORS); /* reserving memory for the worst case */ - RGNDATA * pRgnData = (RGNDATA *) safe_Malloc(sizeof(RGNDATAHEADER) + - sizeof(RECT) * (width / 2 + 1) * height); + if (!IS_SAFE_SIZE_MUL(width / 2 + 1, height)) { + throw std::bad_alloc(); + } + RGNDATA * pRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(safe_Malloc, + sizeof(RGNDATAHEADER), + sizeof(RECT), (width / 2 + 1) * height); RGNDATAHEADER * pRgnHdr = (RGNDATAHEADER *) pRgnData; pRgnHdr->dwSize = sizeof(RGNDATAHEADER); pRgnHdr->iType = RDH_RECTANGLES; diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp index d6c4e974e0f..6d645e052a8 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp @@ -2186,12 +2186,12 @@ void AwtComponent::PaintUpdateRgn(const RECT *insets) if (insets != NULL) { ::OffsetRgn(rgn, insets->left, insets->top); } - int size = ::GetRegionData(rgn, 0, NULL); + DWORD size = ::GetRegionData(rgn, 0, NULL); if (size == 0) { ::DeleteObject((HGDIOBJ)rgn); return; } - char* buffer = new char[size]; + char* buffer = new char[size]; // safe because sizeof(char)==1 memset(buffer, 0, size); LPRGNDATA rgndata = (LPRGNDATA)buffer; rgndata->rdh.dwSize = sizeof(RGNDATAHEADER); @@ -6134,18 +6134,30 @@ void AwtComponent::_SetRectangularShape(void *param) c = (AwtComponent *)pData; if (::IsWindow(c->GetHWnd())) { HRGN hRgn = NULL; + + // If all the params are zeros, the shape must be simply reset. + // Otherwise, convert it into a region. if (region || x1 || x2 || y1 || y2) { - // If all the params are zeros, the shape must be simply reset. - // Otherwise, convert it into a region. - RGNDATA *pRgnData = NULL; - RGNDATAHEADER *pRgnHdr; + RECT_T rects[256]; + RECT_T *pRect = rects; - /* reserving memory for the worst case */ - size_t worstBufferSize = size_t(((x2 - x1) / 2 + 1) * (y2 - y1)); - pRgnData = (RGNDATA *) safe_Malloc(sizeof(RGNDATAHEADER) + - sizeof(RECT_T) * worstBufferSize); - pRgnHdr = (RGNDATAHEADER *) pRgnData; + const int numrects = RegionToYXBandedRectangles(env, x1, y1, x2, y2, + region, &pRect, sizeof(rects)/sizeof(rects[0])); + if (!pRect) { + // RegionToYXBandedRectangles doesn't use safe_Malloc(), + // so throw the exception explicitly + throw std::bad_alloc(); + } + RGNDATA *pRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(safe_Malloc, + sizeof(RGNDATAHEADER), sizeof(RECT_T), numrects); + memcpy((BYTE*)pRgnData + sizeof(RGNDATAHEADER), pRect, sizeof(RECT_T) * numrects); + if (pRect != rects) { + free(pRect); + } + pRect = NULL; + + RGNDATAHEADER *pRgnHdr = (RGNDATAHEADER *) pRgnData; pRgnHdr->dwSize = sizeof(RGNDATAHEADER); pRgnHdr->iType = RDH_RECTANGLES; pRgnHdr->nRgnSize = 0; @@ -6153,9 +6165,7 @@ void AwtComponent::_SetRectangularShape(void *param) pRgnHdr->rcBound.left = 0; pRgnHdr->rcBound.bottom = LONG(y2 - y1); pRgnHdr->rcBound.right = LONG(x2 - x1); - - RECT_T * pRect = (RECT_T *) (((BYTE *) pRgnData) + sizeof(RGNDATAHEADER)); - pRgnHdr->nCount = RegionToYXBandedRectangles(env, x1, y1, x2, y2, region, &pRect, worstBufferSize); + pRgnHdr->nCount = numrects; hRgn = ::ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + sizeof(RECT_T) * pRgnHdr->nCount, pRgnData); @@ -6297,7 +6307,7 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls) jint * tmp = env->GetIntArrayElements(obj, JNI_FALSE); jsize len = env->GetArrayLength(obj); - AwtComponent::masks = new jint[len]; + AwtComponent::masks = SAFE_SIZE_NEW_ARRAY(jint, len); for (int i = 0; i < len; i++) { AwtComponent::masks[i] = tmp[i]; } @@ -7184,4 +7194,5 @@ void ReleaseDCList(HWND hwnd, DCList &list) { removedDCs = removedDCs->next; delete tmpDCList; } -} \ No newline at end of file +} + diff --git a/jdk/src/windows/native/sun/windows/awt_Cursor.cpp b/jdk/src/windows/native/sun/windows/awt_Cursor.cpp index 64cdef9afc5..477fe80ee93 100644 --- a/jdk/src/windows/native/sun/windows/awt_Cursor.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Cursor.cpp @@ -345,14 +345,14 @@ Java_sun_awt_windows_WCustomCursor_createCursorIndirect( return; } - int length = env->GetArrayLength(andMask); - jbyte *andMaskPtr = new jbyte[length]; + jsize length = env->GetArrayLength(andMask); + jbyte *andMaskPtr = new jbyte[length]; // safe because sizeof(jbyte)==1 env->GetByteArrayRegion(andMask, 0, length, andMaskPtr); HBITMAP hMask = ::CreateBitmap(nW, nH, 1, 1, (BYTE *)andMaskPtr); ::GdiFlush(); - int *cols = new int[nW*nH]; + int *cols = SAFE_SIZE_NEW_ARRAY2(int, nW, nH); jint *intRasterDataPtr = NULL; HBITMAP hColor = NULL; diff --git a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp index 835ccf9af03..91bcad2d7fe 100644 --- a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp @@ -281,13 +281,13 @@ Java_sun_awt_windows_WDataTransferer_dragQueryFile } UINT bufsize = 512; // in characters, not in bytes - buffer = (LPTSTR)safe_Malloc(bufsize*sizeof(TCHAR)); + buffer = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, bufsize, sizeof(TCHAR)); for (UINT i = 0; i < nFilenames; i++) { UINT size = ::DragQueryFile(hdrop, i, NULL, 0); if (size > bufsize) { bufsize = size; - buffer = (LPTSTR)safe_Realloc(buffer, bufsize*sizeof(TCHAR)); + buffer = (LPTSTR)SAFE_SIZE_ARRAY_REALLOC(safe_Realloc, buffer, bufsize, sizeof(TCHAR)); } ::DragQueryFile(hdrop, i, buffer, bufsize); @@ -359,7 +359,7 @@ Java_sun_awt_windows_WDataTransferer_platformImageBytesToImageData( return NULL; } - jbyte* bBytes = (jbyte*)safe_Malloc(size * sizeof(jbyte)); + jbyte* bBytes = (jbyte*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, size, sizeof(jbyte)); try { @@ -771,9 +771,9 @@ Java_sun_awt_windows_WDataTransferer_imageDataToPlatformImageBytes(JNIEnv *env, } else { LPBYTE lpbMfBuffer = NULL; try { - UINT uMfSizeWithHead = uMfSize + sizeof(METAFILEPICT); - - lpbMfBuffer = (LPBYTE)safe_Malloc(uMfSizeWithHead); + lpbMfBuffer = (LPBYTE)SAFE_SIZE_STRUCT_ALLOC(safe_Malloc, + sizeof(METAFILEPICT), uMfSize, 1); + const UINT uMfSizeWithHead = uMfSize + sizeof(METAFILEPICT); VERIFY(::GetMetaFileBitsEx(hmf, uMfSize, lpbMfBuffer + sizeof(METAFILEPICT)) == uMfSize); bytes = env->NewByteArray(uMfSizeWithHead); diff --git a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp index 6b50ec15c09..4c6e1f9bf62 100644 --- a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp @@ -171,7 +171,7 @@ static LPTSTR getWindowsPropFromReg(LPTSTR subKey, LPTSTR valueName, DWORD *valu if (*valueType == REG_EXPAND_SZ) { // Pending: buffer must be null-terminated at this point valueChar = ExpandEnvironmentStrings(buffer, NULL, 0); - LPTSTR buffer2 = (LPTSTR)safe_Malloc(valueChar*sizeof(TCHAR)); + LPTSTR buffer2 = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, valueChar, sizeof(TCHAR)); ExpandEnvironmentStrings(buffer, buffer2, valueChar); free(buffer); return buffer2; @@ -588,11 +588,11 @@ void AwtDesktopProperties::GetOtherParameters() { } LPTSTR valueName = TEXT("PlaceN"); - LPTSTR valueNameBuf = (LPTSTR)safe_Malloc((lstrlen(valueName) + 1) * sizeof(TCHAR)); + LPTSTR valueNameBuf = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (lstrlen(valueName) + 1), sizeof(TCHAR)); lstrcpy(valueNameBuf, valueName); LPTSTR propKey = TEXT("win.comdlg.placesBarPlaceN"); - LPTSTR propKeyBuf = (LPTSTR)safe_Malloc((lstrlen(propKey) + 1) * sizeof(TCHAR)); + LPTSTR propKeyBuf = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (lstrlen(propKey) + 1), sizeof(TCHAR)); lstrcpy(propKeyBuf, propKey); int i = 0; diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp index 734b2efeac1..230baf84c7f 100644 --- a/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp @@ -1037,8 +1037,8 @@ void AwtDropTarget::LoadCache(IDataObject* pDataObj) { if (m_dataObject->QueryGetData(&tmp) != S_OK) continue; if (m_nformats % CACHE_INCR == 0) { - m_formats = (FORMATETC *)safe_Realloc(m_formats, - (CACHE_INCR + m_nformats) * + m_formats = (FORMATETC *)SAFE_SIZE_ARRAY_REALLOC(safe_Realloc, m_formats, + CACHE_INCR + m_nformats, sizeof(FORMATETC)); } diff --git a/jdk/src/windows/native/sun/windows/awt_Frame.cpp b/jdk/src/windows/native/sun/windows/awt_Frame.cpp index 5d344e71474..1195491069f 100644 --- a/jdk/src/windows/native/sun/windows/awt_Frame.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Frame.cpp @@ -380,9 +380,11 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms if (!sm_suppressFocusAndActivation) { if (IsLightweightFrame() || IsEmbeddedFrame()) { - AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL); + HWND oppositeToplevelHWnd = AwtComponent::GetTopLevelParentForWindow((HWND)wParam); + if (oppositeToplevelHWnd != AwtComponent::GetFocusedWindow()) { + AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL); + } } - } else if (sm_restoreFocusAndActivation) { if (AwtComponent::GetFocusedWindow() != NULL) { AwtWindow *focusedWindow = (AwtWindow*)GetComponent(AwtComponent::GetFocusedWindow()); diff --git a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp index b2d12c05aeb..9d81ea6afbb 100644 --- a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp +++ b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp @@ -333,7 +333,7 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WInputMethod_setNativeLocale // list which is returned by GetKeyboardLayoutList ensures to match first when // looking up suitable layout. int layoutCount = ::GetKeyboardLayoutList(0, NULL) + 1; // +1 for user's preferred HKL - HKL FAR * hKLList = (HKL FAR *)safe_Malloc(sizeof(HKL)*layoutCount); + HKL FAR * hKLList = (HKL FAR *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(HKL), layoutCount); DASSERT(!safe_ExceptionOccurred(env)); ::GetKeyboardLayoutList(layoutCount - 1, &(hKLList[1])); hKLList[0] = getDefaultKeyboardLayout(); // put user's preferred layout on top of the list @@ -444,7 +444,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_awt_windows_WInputMethodDescriptor_getNa // get list of available HKLs int layoutCount = ::GetKeyboardLayoutList(0, NULL); - HKL FAR * hKLList = (HKL FAR *)safe_Malloc(sizeof(HKL)*layoutCount); + HKL FAR * hKLList = (HKL FAR *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(HKL), layoutCount); DASSERT(!safe_ExceptionOccurred(env)); ::GetKeyboardLayoutList(layoutCount, hKLList); @@ -453,7 +453,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_awt_windows_WInputMethodDescriptor_getNa int destIndex = 0; int javaLocaleNameCount = 0; int current = 0; - const char ** javaLocaleNames = (const char **)safe_Malloc(sizeof(char *)*layoutCount); + const char ** javaLocaleNames = (const char **)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(char *), layoutCount); DASSERT(!safe_ExceptionOccurred(env)); for (; srcIndex < layoutCount; srcIndex++) { const char * srcLocaleName = getJavaIDFromLangID(LOWORD(hKLList[srcIndex])); @@ -517,7 +517,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WInputMethod_getNativeIMMDescript jstring infojStr = NULL; if ((buffSize = ::ImmGetDescription(hkl, szImmDescription, 0)) > 0) { - szImmDescription = (LPTSTR) safe_Malloc((buffSize+1) * sizeof(TCHAR)); + szImmDescription = (LPTSTR) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, (buffSize+1), sizeof(TCHAR)); if (szImmDescription != NULL) { ImmGetDescription(hkl, szImmDescription, (buffSize+1)); diff --git a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp index 2361497144a..71a08d3df33 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp @@ -252,7 +252,7 @@ void AwtPrintControl::initIDs(JNIEnv *env, jclass cls) AwtPrintControl::getCopiesID = env->GetMethodID(cls, "getCopiesAttrib", "()I"); AwtPrintControl::getCollateID = - env->GetMethodID(cls, "getCollateAttrib","()Z"); + env->GetMethodID(cls, "getCollateAttrib","()I"); AwtPrintControl::getOrientID = env->GetMethodID(cls, "getOrientAttrib", "()I"); AwtPrintControl::getFromPageID = @@ -484,8 +484,8 @@ WORD AwtPrintControl::getNearestMatchingPaper(LPTSTR printer, LPTSTR port, NULL, NULL); if (numPaperSizes > 0) { - papers = (WORD*)safe_Malloc(sizeof(WORD) * numPaperSizes); - paperSizes = (POINT *)safe_Malloc(sizeof(*paperSizes) * + papers = (WORD*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(WORD), numPaperSizes); + paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes); DWORD result1 = DeviceCapabilities(printer, port, @@ -690,12 +690,6 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env, pd.Flags = PD_ENABLEPRINTHOOK | PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE; pd.lpfnPrintHook = (LPPRINTHOOKPROC)PrintDlgHook; - if (env->CallBooleanMethod(printCtrl, AwtPrintControl::getCollateID)) { - pd.Flags |= PD_COLLATE; - } - - pd.nCopies = (WORD)env->CallIntMethod(printCtrl, - AwtPrintControl::getCopiesID); pd.nFromPage = (WORD)env->CallIntMethod(printCtrl, AwtPrintControl::getFromPageID); pd.nToPage = (WORD)env->CallIntMethod(printCtrl, @@ -729,37 +723,52 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env, DEVMODE *devmode = (DEVMODE *)::GlobalLock(pd.hDevMode); DASSERT(!IsBadWritePtr(devmode, sizeof(DEVMODE))); - devmode->dmFields |= DM_COPIES | DM_COLLATE | DM_ORIENTATION | - DM_PAPERSIZE | DM_PRINTQUALITY | DM_COLOR | DM_DUPLEX; - - devmode->dmCopies = pd.nCopies; + WORD copies = (WORD)env->CallIntMethod(printCtrl, + AwtPrintControl::getCopiesID); + if (copies > 0) { + devmode->dmFields |= DM_COPIES; + devmode->dmCopies = copies; + } jint orient = env->CallIntMethod(printCtrl, AwtPrintControl::getOrientID); - if (orient == 0) { + if (orient == 0) { // PageFormat.LANDSCAPE == 0 + devmode->dmFields |= DM_ORIENTATION; devmode->dmOrientation = DMORIENT_LANDSCAPE; - } else if (orient == 1) { + } else if (orient == 1) { // PageFormat.PORTRAIT == 1 + devmode->dmFields |= DM_ORIENTATION; devmode->dmOrientation = DMORIENT_PORTRAIT; } - devmode->dmCollate = (pd.Flags & PD_COLLATE) ? DMCOLLATE_TRUE - : DMCOLLATE_FALSE; + // -1 means unset, so we'll accept the printer default. + int collate = env->CallIntMethod(printCtrl, + AwtPrintControl::getCollateID); + if (collate == 1) { + devmode->dmFields |= DM_COLLATE; + devmode->dmCollate = DMCOLLATE_TRUE; + } else if (collate == 0) { + devmode->dmFields |= DM_COLLATE; + devmode->dmCollate = DMCOLLATE_FALSE; + } int quality = env->CallIntMethod(printCtrl, AwtPrintControl::getQualityID); if (quality) { + devmode->dmFields |= DM_PRINTQUALITY; devmode->dmPrintQuality = quality; } int color = env->CallIntMethod(printCtrl, AwtPrintControl::getColorID); if (color) { + devmode->dmFields |= DM_COLOR; devmode->dmColor = color; } int sides = env->CallIntMethod(printCtrl, AwtPrintControl::getSidesID); if (sides) { + devmode->dmFields |= DM_DUPLEX; devmode->dmDuplex = (int)sides; } @@ -771,6 +780,7 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env, double newWid = 0.0, newHt = 0.0; if (wid_ht != NULL && wid_ht[0] != 0 && wid_ht[1] != 0) { + devmode->dmFields |= DM_PAPERSIZE; devmode->dmPaperSize = AwtPrintControl::getNearestMatchingPaper( printName, portName, diff --git a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp index 0d537474714..a2deb14b58c 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp @@ -433,7 +433,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer) int measure = PSD_INTHOUSANDTHSOFINCHES; int sz = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, NULL, 0); if (sz > 0) { - LPTSTR str = (LPTSTR)safe_Malloc(sizeof(TCHAR) * sz); + LPTSTR str = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(TCHAR), sz); if (str != NULL) { sz = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, str, sz); if (sz > 0) { @@ -645,7 +645,7 @@ Java_sun_awt_windows_WPrinterJob_getDefaultPage(JNIEnv *env, jobject self, int sz = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, NULL, 0); if (sz > 0) { - LPTSTR str = (LPTSTR)safe_Malloc(sizeof(TCHAR) * sz); + LPTSTR str = (LPTSTR)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(TCHAR), sz); if (str != NULL) { sz = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, str, sz); @@ -2302,8 +2302,8 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut * rounded advances will drift away from the true advance. */ if (glyphPos != NULL && strLen > 0) { - xadvances = (int*)safe_Malloc(strLen * sizeof(int)); - xyadvances = (int*)safe_Malloc(strLen * sizeof(int) * 2); + xadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, strLen, sizeof(int)); + xyadvances = (int*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, strLen, sizeof(int) * 2); } if (xadvances != NULL && xyadvances != NULL) { int *inxAdvances = xadvances; @@ -2513,8 +2513,9 @@ static jbyte* reverseDIB(jbyte* imageBits, long srcWidth, long srcHeight, if ((imgWidthByteSz % sizeof(DWORD)) != 0) padBytes = sizeof(DWORD) - (imgWidthByteSz % sizeof(DWORD)); + jbyte* alignedImage = (jbyte*) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, + imgWidthByteSz+padBytes, ROUND_TO_LONG(srcHeight)); long newImgSize = (imgWidthByteSz+padBytes) * ROUND_TO_LONG(srcHeight); - jbyte* alignedImage = (jbyte*) safe_Malloc(newImgSize); if (alignedImage != NULL) { memset(alignedImage, 0xff, newImgSize); @@ -3116,7 +3117,7 @@ static POINT *getPaperSizeList(LPCTSTR deviceName, LPCTSTR portName) { DC_PAPERSIZE, NULL, NULL); if (numPaperSizes > 0) { - paperSizes = (POINT *)safe_Malloc(sizeof(*paperSizes) * numPaperSizes); + paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes); DWORD result = DeviceCapabilities(deviceName, portName, DC_PAPERSIZE, (LPTSTR) paperSizes, @@ -3766,8 +3767,8 @@ static void matchPaperSize(HDC printDC, HGLOBAL hDevMode, HGLOBAL hDevNames, numPaperSizes = (int)DeviceCapabilities(printer, port, DC_PAPERSIZE, NULL, NULL); if (numPaperSizes > 0) { - papers = (WORD*)safe_Malloc(sizeof(WORD) * numPaperSizes); - paperSizes = (POINT *)safe_Malloc(sizeof(*paperSizes) * numPaperSizes); + papers = (WORD*)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(WORD), numPaperSizes); + paperSizes = (POINT *)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(*paperSizes), numPaperSizes); DWORD result1 = DeviceCapabilities(printer, port, DC_PAPERS, (LPTSTR) papers, NULL); diff --git a/jdk/src/windows/native/sun/windows/awt_Robot.cpp b/jdk/src/windows/native/sun/windows/awt_Robot.cpp index 09e12debf38..c2d3726fab3 100644 --- a/jdk/src/windows/native/sun/windows/awt_Robot.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Robot.cpp @@ -234,7 +234,9 @@ void AwtRobot::GetRGBPixels(jint x, jint y, jint width, jint height, jintArray p static const int BITS_PER_PIXEL = 32; static const int BYTES_PER_PIXEL = BITS_PER_PIXEL/8; + if (!IS_SAFE_SIZE_MUL(width, height)) throw std::bad_alloc(); int numPixels = width*height; + if (!IS_SAFE_SIZE_MUL(BYTES_PER_PIXEL, numPixels)) throw std::bad_alloc(); int pixelDataSize = BYTES_PER_PIXEL*numPixels; DASSERT(pixelDataSize > 0 && pixelDataSize % 4 == 0); // allocate memory for BITMAPINFO + pixel data @@ -244,6 +246,9 @@ void AwtRobot::GetRGBPixels(jint x, jint y, jint width, jint height, jintArray p // end of our block of memory. Now we allocate sufficient memory. // See MSDN docs for BITMAPINFOHEADER -bchristi + if (!IS_SAFE_SIZE_ADD(sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD), pixelDataSize)) { + throw std::bad_alloc(); + } BITMAPINFO * pinfo = (BITMAPINFO *)(new BYTE[sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD) + pixelDataSize]); // pixel data starts after 3 RGBQUADS for color masks diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 3707c7f11ee..8a6931cf110 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -137,6 +137,10 @@ java/lang/Class/asSubclass/BasicUnit.java generic-all # 8015780 java/lang/reflect/Method/GenericStringTest.java generic-all +# 8019500 +java/lang/management/MemoryMXBean/MemoryTestAllGC.sh generic-all +java/lang/management/MemoryMXBean/MemoryTest.java generic-all + ############################################################################ # jdk_management @@ -314,6 +318,13 @@ sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.ja ############################################################################ +# jdk_time + +# 8016623 +java/time/test/java/time/format/TestDateTimeTextProvider.java generic-all + +############################################################################ + # jdk_tools # 6461635 diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 1645f6b26da..6bf72964f66 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -1,6 +1,5 @@ # This file identifies the root of the test-suite hierarchy. # It also contains test-suite configuration information. -# DO NOT EDIT without first contacting jdk-regtest@sun.com. # The list of keywords supported in the entire test suite keys=2d dnd i18n @@ -9,4 +8,4 @@ keys=2d dnd i18n othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi # Tests that cannot run concurrently -exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi +exclusiveAccess.dirs=java/rmi/Naming java/util/Currency java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi diff --git a/jdk/test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java b/jdk/test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java new file mode 100644 index 00000000000..60761c00ea7 --- /dev/null +++ b/jdk/test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 4928019 + * @summary Makes sure all the basic classes can be created with GTK. + * @author Scott Violet + */ + +import javax.swing.*; +import javax.swing.plaf.basic.*; + +public class bug4928019 { + public static void main(String[] args) throws Throwable { + try { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + } catch (UnsupportedLookAndFeelException ex) { + System.err.println("GTKLookAndFeel is not supported on this platform." + + " Test is considered passed."); + return; + } catch (ClassNotFoundException ex) { + System.err.println("GTKLookAndFeel class is not found." + + " Test is considered passed."); + return; + } + new JButton() { + public void updateUI() { + setUI(new BasicButtonUI()); + } + }; + new JCheckBox() { + public void updateUI() { + setUI(new BasicCheckBoxUI()); + } + }; + new JCheckBoxMenuItem() { + public void updateUI() { + setUI(new BasicCheckBoxMenuItemUI()); + } + }; + new JColorChooser() { + public void updateUI() { + setUI(new BasicColorChooserUI()); + } + }; + new JComboBox() { + public void updateUI() { + setUI(new BasicComboBoxUI()); + } + }; + new JDesktopPane() { + public void updateUI() { + setUI(new BasicDesktopPaneUI()); + } + }; + new JEditorPane() { + public void updateUI() { + setUI(new BasicEditorPaneUI()); + } + }; + new JFileChooser() { + public void updateUI() { + setUI(new BasicFileChooserUI(null)); + } + }; + new JFormattedTextField() { + public void updateUI() { + setUI(new BasicFormattedTextFieldUI()); + } + }; + new JInternalFrame() { + public void updateUI() { + setUI(new BasicInternalFrameUI(null)); + } + }; + new JLabel() { + public void updateUI() { + setUI(new BasicLabelUI()); + } + }; + new JList() { + public void updateUI() { + setUI(new BasicListUI()); + } + }; + new JMenuBar() { + public void updateUI() { + setUI(new BasicMenuBarUI()); + } + }; + new JMenuItem() { + public void updateUI() { + setUI(new BasicMenuItemUI()); + } + }; + new JMenu() { + public void updateUI() { + setUI(new BasicMenuUI()); + } + }; + new JOptionPane() { + public void updateUI() { + setUI(new BasicOptionPaneUI()); + } + }; + new JPanel() { + public void updateUI() { + setUI(new BasicPanelUI()); + } + }; + new JPasswordField() { + public void updateUI() { + setUI(new BasicPasswordFieldUI()); + } + }; + new JPopupMenu() { + public void updateUI() { + setUI(new BasicPopupMenuUI()); + } + }; + new JProgressBar() { + public void updateUI() { + setUI(new BasicProgressBarUI()); + } + }; + new JRadioButton() { + public void updateUI() { + setUI(new BasicRadioButtonUI()); + } + }; + new JRadioButtonMenuItem() { + public void updateUI() { + setUI(new BasicRadioButtonMenuItemUI()); + } + }; + new JRootPane() { + public void updateUI() { + setUI(new BasicRootPaneUI()); + } + }; + new JScrollBar() { + public void updateUI() { + setUI(new BasicScrollBarUI()); + } + }; + new JScrollPane() { + public void updateUI() { + setUI(new BasicScrollPaneUI()); + } + }; + new JSeparator() { + public void updateUI() { + setUI(new BasicSeparatorUI()); + } + }; + new JSlider() { + public void updateUI() { + setUI(new BasicSliderUI(null)); + } + }; + new JSpinner() { + public void updateUI() { + setUI(new BasicSpinnerUI()); + } + }; + new JSplitPane() { + public void updateUI() { + setUI(new BasicSplitPaneUI()); + } + }; + new JTabbedPane() { + public void updateUI() { + setUI(new BasicTabbedPaneUI()); + } + }; + new JTable() { + public void updateUI() { + setUI(new BasicTableUI()); + } + }; + new JTextArea() { + public void updateUI() { + setUI(new BasicTextAreaUI()); + } + }; + new JTextField() { + public void updateUI() { + setUI(new BasicTextFieldUI()); + } + }; + new JTextPane() { + public void updateUI() { + setUI(new BasicTextPaneUI()); + } + }; + new JToggleButton() { + public void updateUI() { + setUI(new BasicToggleButtonUI()); + } + }; + new JToolBar() { + public void updateUI() { + setUI(new BasicToolBarUI()); + } + }; + new JToolTip() { + public void updateUI() { + setUI(new BasicToolTipUI()); + } + }; + new JTree() { + public void updateUI() { + setUI(new BasicTreeUI()); + } + }; + new JViewport() { + public void updateUI() { + setUI(new BasicViewportUI()); + } + }; + System.out.println("DONE"); + } +} diff --git a/jdk/test/com/sun/org/apache/xml/internal/security/TruncateHMAC.java b/jdk/test/com/sun/org/apache/xml/internal/security/TruncateHMAC.java index 04e272f3f97..f6cd3bcd98a 100644 --- a/jdk/test/com/sun/org/apache/xml/internal/security/TruncateHMAC.java +++ b/jdk/test/com/sun/org/apache/xml/internal/security/TruncateHMAC.java @@ -97,6 +97,7 @@ public class TruncateHMAC { System.out.println("PASSED"); } else { System.out.println("FAILED"); + atLeastOneFailed = true; } } } diff --git a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java index 7d75f34852f..d0a56b6c7b8 100644 --- a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java +++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ /** * @test * @author Sean Mullan - * @bug 6461674 + * @bug 6461674 8009217 * @compile -XDignore.symbol.file ClassLoaderTest.java MyTransform.java * @run main ClassLoaderTest * @summary Ensure Transform.register works with transform implementations @@ -43,13 +43,12 @@ public class ClassLoaderTest { public static void main(String[] args) throws Exception { - Transform.init(); File file = new File(BASE); URL[] urls = new URL[1]; urls[0] = file.toURI().toURL(); URLClassLoader ucl = new URLClassLoader(urls); - Class c = ucl.loadClass("MyTransform"); - Constructor cons = c.getConstructor(); + Class c = ucl.loadClass("MyTransform"); + Constructor cons = c.getConstructor(new Class[] {}); Object o = cons.newInstance(); // Apache code swallows the ClassNotFoundExc, so we need to // check if the Transform has already been registered by registering diff --git a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java index 8c13fa1b90b..8ebaa858672 100644 --- a/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java +++ b/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,13 +21,8 @@ * questions. */ -import java.io.IOException; -import javax.xml.parsers.ParserConfigurationException; -import org.xml.sax.SAXException; -import com.sun.org.apache.xml.internal.security.c14n.*; -import com.sun.org.apache.xml.internal.security.exceptions.*; -import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; -import com.sun.org.apache.xml.internal.security.transforms.*; +import com.sun.org.apache.xml.internal.security.transforms.Transform; +import com.sun.org.apache.xml.internal.security.transforms.TransformSpi; public class MyTransform extends TransformSpi { @@ -37,21 +32,13 @@ public class MyTransform extends TransformSpi { public MyTransform() { try { System.out.println("Registering Transform"); - Transform.init(); Transform.register(URI, "MyTransform"); - } catch (AlgorithmAlreadyRegisteredException e) { - // should not occur, so ignore + } catch (Exception e) { + e.printStackTrace(); } } protected String engineGetURI() { return URI; } - - protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input) - throws IOException, CanonicalizationException, - InvalidCanonicalizerException, TransformationException, - ParserConfigurationException, SAXException { - throw new TransformationException("Unsupported Operation"); - } } diff --git a/jdk/test/demo/zipfs/ZipFSTester.java b/jdk/test/demo/zipfs/ZipFSTester.java index 9d0bb04a098..c6bd389c941 100644 --- a/jdk/test/demo/zipfs/ZipFSTester.java +++ b/jdk/test/demo/zipfs/ZipFSTester.java @@ -341,6 +341,9 @@ public class ZipFSTester { // test file stamp static void testTime(Path src) throws Exception { + BasicFileAttributes attrs = Files + .getFileAttributeView(src, BasicFileAttributeView.class) + .readAttributes(); // create a new filesystem, copy this file into it Map env = new HashMap(); env.put("create", "true"); @@ -352,10 +355,6 @@ public class ZipFSTester { Path dst = getPathWithParents(fs, "me"); Files.copy(src, dst, COPY_ATTRIBUTES); checkEqual(src, dst); - - BasicFileAttributes attrs = Files - .getFileAttributeView(src, BasicFileAttributeView.class) - .readAttributes(); System.out.println("mtime: " + attrs.lastModifiedTime()); System.out.println("ctime: " + attrs.creationTime()); System.out.println("atime: " + attrs.lastAccessTime()); diff --git a/jdk/test/demo/zipfs/basic.sh b/jdk/test/demo/zipfs/basic.sh index c36f286efa5..9dc85215820 100644 --- a/jdk/test/demo/zipfs/basic.sh +++ b/jdk/test/demo/zipfs/basic.sh @@ -22,7 +22,7 @@ # # @test # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596 -# 7157656 8002390 7012868 7012856 +# 7157656 8002390 7012868 7012856 8015728 # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh diff --git a/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html b/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html index 03f470d2dec..21396353d7c 100644 --- a/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html +++ b/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html @@ -1,6 +1,5 @@ + Java 7 on mac os x only provides text clipboard formats diff --git a/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java b/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java index 765457e7ddd..598426f61f0 100644 --- a/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java +++ b/jdk/test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java @@ -22,7 +22,6 @@ */ /* - @test @bug 8005932 @summary Java 7 on mac os x only provides text clipboard formats @author mikhail.cherkasov@oracle.com @@ -30,10 +29,9 @@ @library ../../regtesthelpers/process @build Util @build ProcessResults ProcessCommunicator - - @run applet/othervm MissedHtmlAndRtfBug.html */ + import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.event.*; diff --git a/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java b/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java index a22551bec2c..2edcf9db98a 100644 --- a/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java +++ b/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java @@ -132,6 +132,7 @@ class TestKFM extends DefaultKeyboardFocusManager { } protected synchronized void enqueueKeyEvents(long after, Component untilFocused) { super.enqueueKeyEvents(after, untilFocused); + robot.delay(1); robot.keyPress(KeyEvent.VK_SPACE); robot.delay(50); robot.keyRelease(KeyEvent.VK_SPACE); diff --git a/jdk/test/java/awt/GraphicsDevice/CheckDisplayModes.java b/jdk/test/java/awt/GraphicsDevice/CheckDisplayModes.java index bc8d8a50be6..719ee9b43a7 100644 --- a/jdk/test/java/awt/GraphicsDevice/CheckDisplayModes.java +++ b/jdk/test/java/awt/GraphicsDevice/CheckDisplayModes.java @@ -37,6 +37,10 @@ public class CheckDisplayModes { public static void main(String[] args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice graphicDevice = ge.getDefaultScreenDevice(); + if (!graphicDevice.isDisplayChangeSupported()) { + System.err.println("Display mode change is not supported on this host. Test is considered passed."); + return; + } DisplayMode defaultDisplayMode = graphicDevice.getDisplayMode(); checkDisplayMode(defaultDisplayMode); graphicDevice.setDisplayMode(defaultDisplayMode); diff --git a/jdk/test/java/awt/Mixing/MixingInHwPanel.java b/jdk/test/java/awt/Mixing/MixingInHwPanel.java index 7aceebd0b38..27b2d96715e 100644 --- a/jdk/test/java/awt/Mixing/MixingInHwPanel.java +++ b/jdk/test/java/awt/Mixing/MixingInHwPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* - @test %W% %E% + @test @bug 6829858 @summary Mixing should work inside heavyweight containers @author anthony.petrov@sun.com: area=awt.mixing @@ -104,7 +104,7 @@ public class MixingInHwPanel // And click the part of the button that has been previously hidden Point bLoc = button.getLocationOnScreen(); - robot.mouseMove(bLoc.x + button.getWidth() - 6, bLoc.y + button.getHeight() / 2); + robot.mouseMove(bLoc.x + button.getWidth() - 15, bLoc.y + button.getHeight() / 2); Util.waitForIdle(robot); diff --git a/jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java b/jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java new file mode 100644 index 00000000000..a018b27e3f5 --- /dev/null +++ b/jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* 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 sun.misc.OSEnvironment; +import test.java.awt.regtesthelpers.Util; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/* + * @test + * @bug 8013468 + * @summary Cursor does not update properly when in fullscreen mode on Mac + * The core reason of the issue was the lack of a mouse entered event in fullscreen + * @library ../../regtesthelpers + * @build Util + * @author Petr Pchelko area=awt.event + * @run main FullscreenEnterEventTest + */ +public class FullscreenEnterEventTest { + + private static String OS = System.getProperty("os.name").toLowerCase(); + + private static JFrame frame; + + private static volatile int mouseEnterCount = 0; + + private static volatile boolean windowEnteringFullScreen = false; + private static volatile boolean windowEnteredFullScreen = false; + + public static void main(String[] args) throws Exception { + + if (!OS.contains("mac")) { + System.out.println("The test is applicable only to Mac OS X. Passed"); + return; + } + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + createAndShowGUI(); + } + }); + + //Move the mouse away from the frame and check the View-base full screen mode + Robot r = Util.createRobot(); + Util.waitForIdle(r); + r.mouseMove(500, 500); + Util.waitForIdle(r); + mouseEnterCount = 0; + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame); + } + }); + Util.waitForIdle(r); + if (mouseEnterCount != 1) { + throw new RuntimeException("No MouseEntered event for view-base full screen. Failed."); + } + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(null); + } + }); + + //Test native full screen support + Point fullScreenButtonPos = frame.getLocation(); + fullScreenButtonPos.translate(frame.getWidth() - 10, 10); + r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y); + mouseEnterCount = 0; + + //Cant use waitForIdle for full screen transition. + int waitCount = 0; + while (!windowEnteringFullScreen) { + r.mousePress(InputEvent.BUTTON1_MASK); + r.mouseRelease(InputEvent.BUTTON1_MASK); + Thread.sleep(100); + if (waitCount++ > 10) throw new RuntimeException("Can't enter full screen mode. Failed"); + } + + waitCount = 0; + while (!windowEnteredFullScreen) { + Thread.sleep(200); + if (waitCount++ > 10) throw new RuntimeException("Can't enter full screen mode. Failed"); + } + + if (mouseEnterCount != 1) { + throw new RuntimeException("No MouseEntered event for native full screen. Failed."); + } + } + + private static void createAndShowGUI() { + frame = new JFrame(" Fullscreen OSX Bug "); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + enableFullScreen(frame); + frame.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + mouseEnterCount++; + } + }); + frame.setBounds(100, 100, 100, 100); + frame.pack(); + frame.setVisible(true); + + } + + /* + * Use reflection to make a test compilable on not Mac OS X + */ + private static void enableFullScreen(Window window) { + try { + Class fullScreenUtilities = Class.forName("com.apple.eawt.FullScreenUtilities"); + Method setWindowCanFullScreen = fullScreenUtilities.getMethod("setWindowCanFullScreen", Window.class, boolean.class); + setWindowCanFullScreen.invoke(fullScreenUtilities, window, true); + Class fullScreenListener = Class.forName("com.apple.eawt.FullScreenListener"); + Object listenerObject = Proxy.newProxyInstance(fullScreenListener.getClassLoader(), new Class[]{fullScreenListener}, new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + switch (method.getName()) { + case "windowEnteringFullScreen": + windowEnteringFullScreen = true; + break; + case "windowEnteredFullScreen": + windowEnteredFullScreen = true; + break; + } + return null; + } + }); + Method addFullScreenListener = fullScreenUtilities.getMethod("addFullScreenListenerTo", Window.class, fullScreenListener); + addFullScreenListener.invoke(fullScreenUtilities, window, listenerObject); + } catch (Exception e) { + throw new RuntimeException("FullScreen utilities not available", e); + } + } + +} diff --git a/jdk/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java b/jdk/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java index 71e8994e347..34bcbb531bf 100644 --- a/jdk/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java +++ b/jdk/test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java @@ -39,7 +39,6 @@ import java.lang.Throwable; import java.util.Hashtable; /* -@test @bug 8010009 @summary [macosx] Unable type into online word games on MacOSX @author petr.pchelko : area=awt.keyboard diff --git a/jdk/test/java/awt/font/LineBreakMeasurer/AllFontsLBM.java b/jdk/test/java/awt/font/LineBreakMeasurer/AllFontsLBM.java new file mode 100644 index 00000000000..e319c63db22 --- /dev/null +++ b/jdk/test/java/awt/font/LineBreakMeasurer/AllFontsLBM.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8012617 + * @summary ArrayIndexOutOfBoundsException in LineBreakMeasurer + */ + +import java.awt.*; +import java.awt.image.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.text.*; +import java.util.Hashtable; + +public class AllFontsLBM { + + public static void main(String[] args) { + Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); + for (int i=0;i textAttributes = new HashMap<>(); + textAttributes.put(TextAttribute.FAMILY, "Sans Serif"); + textAttributes.put(TextAttribute.SIZE, 12); + textAttributes.put(TextAttribute.KERNING, TextAttribute.KERNING_ON); + Font font = Font.getFont(textAttributes); + JLabel label = new JLabel(); + int dummy = 0; + for (int i = 0; i < 500; i++) { + if (i % 10 == 0) System.out.println("Starting iter " + (i+1)); + for (int j = 0; j <1000; j++) { + FontMetrics fm = label.getFontMetrics(font); + dummy += SwingUtilities.computeStringWidth(fm, Integer.toString(j)); + } + } + System.out.println("done " + dummy); + } +} diff --git a/jdk/test/java/awt/image/mlib/MlibOpsTest.java b/jdk/test/java/awt/image/mlib/MlibOpsTest.java index aed30d56db2..8f8bf7bd286 100644 --- a/jdk/test/java/awt/image/mlib/MlibOpsTest.java +++ b/jdk/test/java/awt/image/mlib/MlibOpsTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6556332 + * @bug 6556332 8011992 8012112 * @summary Test verifies that on-demnad loading of medialib library does * not break imageing ops based on this library. * @run main MlibOpsTest diff --git a/jdk/test/java/beans/XMLEncoder/Test8016545.java b/jdk/test/java/beans/XMLEncoder/Test8016545.java new file mode 100644 index 00000000000..466d8eb01fa --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/Test8016545.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8016545 + * @summary Tests beans with predefined fields + * @author Sergey Malenkov + */ + +public class Test8016545 extends AbstractTest { + public static void main(String[] args) { + new Test8016545().test(true); + } + + @Override + protected Object getObject() { + Bean bean = new Bean(); + bean.setUndefined(Boolean.FALSE); + Info info = new Info(); + info.setEnabled(Boolean.TRUE); + info.setID(1); + bean.setInfo(info); + return bean; + } + + @Override + protected Object getAnotherObject() { + Bean bean = new Bean(); + bean.setUndefined(Boolean.TRUE); + bean.getInfo().setEnabled(Boolean.FALSE); + bean.getInfo().setID(2); + return bean; + } + + public static class Bean { + private Info info = new Info(); // predefined + private Boolean defined = Boolean.TRUE; + private Boolean undefined; + + public Info getInfo() { + return this.info; + } + + public void setInfo(Info info) { + this.info = info; + } + + public Boolean getDefined() { + return this.defined; + } + + public void setDefined(Boolean defined) { + this.defined = defined; + } + + public Boolean getUndefined() { + return this.undefined; + } + + public void setUndefined(Boolean undefined) { + this.undefined = undefined; + } + } + + public static class Info { + private Integer id; + private Boolean enabled; + + public Integer getID() { + return this.id; + } + + public void setID(Integer id) { + this.id = id; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + } +} diff --git a/jdk/test/java/io/File/CreateNewFile.java b/jdk/test/java/io/File/CreateNewFile.java index fb4f88a7a35..57cd7d1c2a9 100644 --- a/jdk/test/java/io/File/CreateNewFile.java +++ b/jdk/test/java/io/File/CreateNewFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* @test - @bug 4130498 4391178 + @bug 4130498 4391178 6198547 @summary Basic test for createNewFile method */ @@ -51,5 +51,20 @@ public class CreateNewFile { } catch (IOException e) { // Exception expected } + + testCreateExistingDir(); + } + + // Test JDK-6198547 + private static void testCreateExistingDir() throws IOException { + File tmpFile = new File("hugo"); + if (tmpFile.exists() && !tmpFile.delete()) + throw new RuntimeException("Cannot delete " + tmpFile); + if (!tmpFile.mkdir()) + throw new RuntimeException("Cannot create dir " + tmpFile); + if (!tmpFile.exists()) + throw new RuntimeException("Cannot see created dir " + tmpFile); + if (tmpFile.createNewFile()) + throw new RuntimeException("Should fail to create file " + tmpFile); } } diff --git a/jdk/test/java/io/File/NulFile.java b/jdk/test/java/io/File/NulFile.java index 491f7e024a9..c7cff6aa81d 100644 --- a/jdk/test/java/io/File/NulFile.java +++ b/jdk/test/java/io/File/NulFile.java @@ -612,7 +612,7 @@ public class NulFile { try { File.createTempFile(prefix, suffix, directory); } catch (IOException ex) { - if ("Unable to create temporary file".equals(ex.getMessage())) + if (ExceptionMsg.equals(ex.getMessage())) exceptionThrown = true; } } diff --git a/jdk/test/java/io/File/createTempFile/SpecialTempFile.java b/jdk/test/java/io/File/createTempFile/SpecialTempFile.java new file mode 100644 index 00000000000..20d6ed8cd82 --- /dev/null +++ b/jdk/test/java/io/File/createTempFile/SpecialTempFile.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8013827 8011950 + * @summary Check whether File.createTempFile can handle special parameters + * on Windows platforms + * @author Dan Xu + */ + +import java.io.File; +import java.io.IOException; + +public class SpecialTempFile { + + private static void test(String name, String[] prefix, String[] suffix) { + if (prefix == null || suffix == null + || prefix.length != suffix.length) + { + return; + } + + final String exceptionMsg = "Unable to create temporary file"; + final String errMsg = "IOException is expected"; + + for (int i = 0; i < prefix.length; i++) { + boolean exceptionThrown = false; + File f = null; + System.out.println("In test " + name + + ", creating temp file with prefix, " + + prefix[i] + ", suffix, " + suffix[i]); + try { + f = File.createTempFile(prefix[i], suffix[i]); + } catch (IOException e) { + if (exceptionMsg.equals(e.getMessage())) + exceptionThrown = true; + else + System.out.println("Wrong error message:" + e.getMessage()); + } + if (!exceptionThrown || f != null) + throw new RuntimeException(errMsg); + } + } + + public static void main(String[] args) throws Exception { + if (!System.getProperty("os.name").startsWith("Windows")) + return; + + // Test JDK-8013827 + String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" }; + String[] resvSuf = { ".temp", ".temp" }; + test("ReservedName", resvPre, resvSuf); + + // Test JDK-8011950 + String[] slashPre = { "///..///", "temp", "///..///" }; + String[] slashSuf = { ".temp", "///..///..", "///..///.." }; + test("SlashedName", slashPre, slashSuf); + } +} diff --git a/jdk/test/java/lang/Double/ParseDouble.java b/jdk/test/java/lang/Double/ParseDouble.java index 504f5bc3dc0..6cefad6ee02 100644 --- a/jdk/test/java/lang/Double/ParseDouble.java +++ b/jdk/test/java/lang/Double/ParseDouble.java @@ -23,20 +23,106 @@ /* * @test - * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568 7039369 + * @bug 4160406 4705734 4707389 4826774 4895911 4421494 6358355 7021568 7039369 4396272 * @summary Test for Double.parseDouble method and acceptance regex */ -import java.util.regex.*; import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.regex.*; public class ParseDouble { + private static final BigDecimal HALF = BigDecimal.valueOf(0.5); + + private static void fail(String val, double n) { + throw new RuntimeException("Double.parseDouble failed. String:" + + val + " Result:" + n); + } + + private static void check(String val) { + double n = Double.parseDouble(val); + boolean isNegativeN = n < 0 || n == 0 && 1/n < 0; + double na = Math.abs(n); + String s = val.trim().toLowerCase(); + switch (s.charAt(s.length() - 1)) { + case 'd': + case 'f': + s = s.substring(0, s.length() - 1); + break; + } + boolean isNegative = false; + if (s.charAt(0) == '+') { + s = s.substring(1); + } else if (s.charAt(0) == '-') { + s = s.substring(1); + isNegative = true; + } + if (s.equals("nan")) { + if (!Double.isNaN(n)) { + fail(val, n); + } + return; + } + if (Double.isNaN(n)) { + fail(val, n); + } + if (isNegativeN != isNegative) + fail(val, n); + if (s.equals("infinity")) { + if (na != Double.POSITIVE_INFINITY) { + fail(val, n); + } + return; + } + BigDecimal bd; + if (s.startsWith("0x")) { + s = s.substring(2); + int indP = s.indexOf('p'); + long exp = Long.parseLong(s.substring(indP + 1)); + int indD = s.indexOf('.'); + String significand; + if (indD >= 0) { + significand = s.substring(0, indD) + s.substring(indD + 1, indP); + exp -= 4*(indP - indD - 1); + } else { + significand = s.substring(0, indP); + } + bd = new BigDecimal(new BigInteger(significand, 16)); + if (exp >= 0) { + bd = bd.multiply(BigDecimal.valueOf(2).pow((int)exp)); + } else { + bd = bd.divide(BigDecimal.valueOf(2).pow((int)-exp)); + } + } else { + bd = new BigDecimal(s); + } + BigDecimal l, u; + if (Double.isInfinite(na)) { + l = new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Math.ulp(Double.MAX_VALUE)).multiply(HALF)); + u = null; + } else { + l = new BigDecimal(na).subtract(new BigDecimal(Math.ulp(Math.nextUp(-na))).multiply(HALF)); + u = new BigDecimal(na).add(new BigDecimal(Math.ulp(n)).multiply(HALF)); + } + int cmpL = bd.compareTo(l); + int cmpU = u != null ? bd.compareTo(u) : -1; + if ((Double.doubleToLongBits(n) & 1) != 0) { + if (cmpL <= 0 || cmpU >= 0) { + fail(val, n); + } + } else { + if (cmpL < 0 || cmpU > 0) { + fail(val, n); + } + } + } + private static void check(String val, double expected) { double n = Double.parseDouble(val); if (n != expected) - throw new RuntimeException("Double.parseDouble failed. String:" + - val + " Result:" + n); + fail(val, n); + check(val); } private static void rudimentaryTest() { @@ -460,6 +546,7 @@ public class ParseDouble { try { d = Double.parseDouble(input[i]); + check(input[i]); } catch (NumberFormatException e) { if (! exceptionalInput) { @@ -560,12 +647,13 @@ public class ParseDouble { * region that should convert to that value. */ private static void testSubnormalPowers() { + boolean failed = false; BigDecimal TWO = BigDecimal.valueOf(2); // An ulp is the same for all subnormal values BigDecimal ulp_BD = new BigDecimal(Double.MIN_VALUE); - // Test subnormal powers of two - for(int i = -1074; i <= -1022; i++) { + // Test subnormal powers of two (except Double.MIN_VALUE) + for(int i = -1073; i <= -1022; i++) { double d = Math.scalb(1.0, i); /* @@ -578,17 +666,69 @@ public class ParseDouble { double convertedLowerBound = Double.parseDouble(lowerBound.toString()); double convertedUpperBound = Double.parseDouble(upperBound.toString()); + if (convertedLowerBound != d) { + failed = true; + System.out.printf("2^%d lowerBound converts as %a %s%n", + i, convertedLowerBound, lowerBound); + } + if (convertedUpperBound != d) { + failed = true; + System.out.printf("2^%d upperBound converts as %a %s%n", + i, convertedUpperBound, upperBound); + } } + /* + * Double.MIN_VALUE + * The region ]0.5*Double.MIN_VALUE, 1.5*Double.MIN_VALUE[ should round to Double.MIN_VALUE . + */ + BigDecimal minValue = new BigDecimal(Double.MIN_VALUE); + if (Double.parseDouble(minValue.multiply(new BigDecimal(0.5)).toString()) != 0.0) { + failed = true; + System.out.printf("0.5*MIN_VALUE doesn't convert 0%n"); + } + if (Double.parseDouble(minValue.multiply(new BigDecimal(0.50000000001)).toString()) != Double.MIN_VALUE) { + failed = true; + System.out.printf("0.50000000001*MIN_VALUE doesn't convert to MIN_VALUE%n"); + } + if (Double.parseDouble(minValue.multiply(new BigDecimal(1.49999999999)).toString()) != Double.MIN_VALUE) { + failed = true; + System.out.printf("1.49999999999*MIN_VALUE doesn't convert to MIN_VALUE%n"); + } + if (Double.parseDouble(minValue.multiply(new BigDecimal(1.5)).toString()) != 2*Double.MIN_VALUE) { + failed = true; + System.out.printf("1.5*MIN_VALUE doesn't convert to 2*MIN_VALUE%n"); + } + + if (failed) + throw new RuntimeException("Inconsistent conversion"); } + /** + * For each power of two, test at boundaries of + * region that should convert to that value. + */ + private static void testPowers() { + for(int i = -1074; i <= +1023; i++) { + double d = Math.scalb(1.0, i); + BigDecimal d_BD = new BigDecimal(d); + + BigDecimal lowerBound = d_BD.subtract(new BigDecimal(Math.ulp(Math.nextUp(-d))).multiply(HALF)); + BigDecimal upperBound = d_BD.add(new BigDecimal(Math.ulp(d)).multiply(HALF)); + + check(lowerBound.toString()); + check(upperBound.toString()); + } + check(new BigDecimal(Double.MAX_VALUE).add(new BigDecimal(Math.ulp(Double.MAX_VALUE)).multiply(HALF)).toString()); + } private static void testStrictness() { - final double expected = 0x0.0000008000001p-1022; + final double expected = 0x0.0000008000000p-1022; +// final double expected = 0x0.0000008000001p-1022; boolean failed = false; double conversion = 0.0; double sum = 0.0; // Prevent conversion from being optimized away - //2^-1047 + 2^-1075 + //2^-1047 + 2^-1075 rounds to 2^-1047 String decimal = "6.631236871469758276785396630275967243399099947355303144249971758736286630139265439618068200788048744105960420552601852889715006376325666595539603330361800519107591783233358492337208057849499360899425128640718856616503093444922854759159988160304439909868291973931426625698663157749836252274523485312442358651207051292453083278116143932569727918709786004497872322193856150225415211997283078496319412124640111777216148110752815101775295719811974338451936095907419622417538473679495148632480391435931767981122396703443803335529756003353209830071832230689201383015598792184172909927924176339315507402234836120730914783168400715462440053817592702766213559042115986763819482654128770595766806872783349146967171293949598850675682115696218943412532098591327667236328125E-316"; for(int i = 0; i <= 12_000; i++) { @@ -620,6 +760,7 @@ public class ParseDouble { testRegex(paddedBadStrings, true); testSubnormalPowers(); + testPowers(); testStrictness(); } } diff --git a/jdk/test/java/lang/Float/ParseFloat.java b/jdk/test/java/lang/Float/ParseFloat.java index 4d646668f9c..f78cef77d03 100644 --- a/jdk/test/java/lang/Float/ParseFloat.java +++ b/jdk/test/java/lang/Float/ParseFloat.java @@ -23,17 +23,105 @@ /* * @test - * @bug 4160406 4705734 4707389 + * @bug 4160406 4705734 4707389 6358355 7032154 * @summary Tests for Float.parseFloat method */ +import java.math.BigDecimal; +import java.math.BigInteger; + public class ParseFloat { + private static final BigDecimal HALF = BigDecimal.valueOf(0.5); + + private static void fail(String val, float n) { + throw new RuntimeException("Float.parseFloat failed. String:" + + val + " Result:" + n); + } + + private static void check(String val) { + float n = Float.parseFloat(val); + boolean isNegativeN = n < 0 || n == 0 && 1/n < 0; + float na = Math.abs(n); + String s = val.trim().toLowerCase(); + switch (s.charAt(s.length() - 1)) { + case 'd': + case 'f': + s = s.substring(0, s.length() - 1); + break; + } + boolean isNegative = false; + if (s.charAt(0) == '+') { + s = s.substring(1); + } else if (s.charAt(0) == '-') { + s = s.substring(1); + isNegative = true; + } + if (s.equals("nan")) { + if (!Float.isNaN(n)) { + fail(val, n); + } + return; + } + if (Float.isNaN(n)) { + fail(val, n); + } + if (isNegativeN != isNegative) + fail(val, n); + if (s.equals("infinity")) { + if (na != Float.POSITIVE_INFINITY) { + fail(val, n); + } + return; + } + BigDecimal bd; + if (s.startsWith("0x")) { + s = s.substring(2); + int indP = s.indexOf('p'); + long exp = Long.parseLong(s.substring(indP + 1)); + int indD = s.indexOf('.'); + String significand; + if (indD >= 0) { + significand = s.substring(0, indD) + s.substring(indD + 1, indP); + exp -= 4*(indP - indD - 1); + } else { + significand = s.substring(0, indP); + } + bd = new BigDecimal(new BigInteger(significand, 16)); + if (exp >= 0) { + bd = bd.multiply(BigDecimal.valueOf(2).pow((int)exp)); + } else { + bd = bd.divide(BigDecimal.valueOf(2).pow((int)-exp)); + } + } else { + bd = new BigDecimal(s); + } + BigDecimal l, u; + if (Float.isInfinite(na)) { + l = new BigDecimal(Float.MAX_VALUE).add(new BigDecimal(Math.ulp(Float.MAX_VALUE)).multiply(HALF)); + u = null; + } else { + l = new BigDecimal(na).subtract(new BigDecimal(Math.ulp(-Math.nextUp(-na))).multiply(HALF)); + u = new BigDecimal(na).add(new BigDecimal(Math.ulp(n)).multiply(HALF)); + } + int cmpL = bd.compareTo(l); + int cmpU = u != null ? bd.compareTo(u) : -1; + if ((Float.floatToIntBits(n) & 1) != 0) { + if (cmpL <= 0 || cmpU >= 0) { + fail(val, n); + } + } else { + if (cmpL < 0 || cmpU > 0) { + fail(val, n); + } + } + } + private static void check(String val, float expected) { float n = Float.parseFloat(val); if (n != expected) - throw new RuntimeException("Float.parseFloat failed. String:" + - val + " Result:" + n); + fail(val, n); + check(val); } private static void rudimentaryTest() { @@ -47,6 +135,17 @@ public class ParseFloat { check("-10", (float) -10.0); check("-10.00", (float) -10.0); check("-10.01", (float) -10.01); + + // bug 6358355 + check("144115196665790480", 0x1.000002p57f); + check("144115196665790481", 0x1.000002p57f); + check("0.050000002607703203", 0.05f); + check("0.050000002607703204", 0.05f); + check("0.050000002607703205", 0.05f); + check("0.050000002607703206", 0.05f); + check("0.050000002607703207", 0.05f); + check("0.050000002607703208", 0.05f); + check("0.050000002607703209", 0.050000004f); } static String badStrings[] = { @@ -182,6 +281,7 @@ public class ParseFloat { try { d = Float.parseFloat(input[i]); + check(input[i]); } catch (NumberFormatException e) { if (! exceptionalInput) { @@ -199,6 +299,24 @@ public class ParseFloat { } } + /** + * For each power of two, test at boundaries of + * region that should convert to that value. + */ + private static void testPowers() { + for(int i = -149; i <= +127; i++) { + float f = Math.scalb(1.0f, i); + BigDecimal f_BD = new BigDecimal(f); + + BigDecimal lowerBound = f_BD.subtract(new BigDecimal(Math.ulp(-Math.nextUp(-f))).multiply(HALF)); + BigDecimal upperBound = f_BD.add(new BigDecimal(Math.ulp(f)).multiply(HALF)); + + check(lowerBound.toString()); + check(upperBound.toString()); + } + check(new BigDecimal(Float.MAX_VALUE).add(new BigDecimal(Math.ulp(Float.MAX_VALUE)).multiply(HALF)).toString()); + } + public static void main(String[] args) throws Exception { rudimentaryTest(); @@ -206,5 +324,7 @@ public class ParseFloat { testParsing(paddedGoodStrings, false); testParsing(badStrings, true); testParsing(paddedBadStrings, true); + + testPowers(); } } diff --git a/jdk/test/java/lang/Runtime/exec/ExecCommand.java b/jdk/test/java/lang/Runtime/exec/ExecCommand.java index 40f61734e56..e74cd62ea44 100644 --- a/jdk/test/java/lang/Runtime/exec/ExecCommand.java +++ b/jdk/test/java/lang/Runtime/exec/ExecCommand.java @@ -24,15 +24,18 @@ /** * @test - * @bug 8012453 + * @bug 8012453 8016046 * @run main/othervm ExecCommand * @summary workaround for legacy applications with Runtime.getRuntime().exec(String command) */ import java.io.BufferedWriter; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Files; import java.security.AccessControlException; public class ExecCommand { @@ -57,16 +60,22 @@ public class ExecCommand { if ( ncmd.equals(".\\Program") || ncmd.equals("\".\\Program") || ncmd.equals(".\\Program Files\\do.cmd") - || ncmd.equals(".\\Program.cmd")) + || ncmd.equals(".\\Program.cmd") + || ncmd.equals("cmd")) { return; } super.checkExec(cmd); } + + @Override public void checkDelete(String file) {} + @Override public void checkRead(String file) {} } // Parameters for the Runtime.exec calls private static final String TEST_RTE_ARG[] = { + "cmd /C dir > dirOut.txt", + "cmd /C dir > \".\\Program Files\\dirOut.txt\"", ".\\Program Files\\do.cmd", "\".\\Program Files\\doNot.cmd\" arg", "\".\\Program Files\\do.cmd\" arg", @@ -83,14 +92,28 @@ public class ExecCommand { // Golden image for results private static final String TEST_RTE_GI[][] = { - //Pure system | Legacy mode | Legacy mode & SM + //Def Legacy mode, Enforced mode, Set Legacy mode, Set Legacy mode & SM + // [cmd /C dir > dirOut.txt] + new String[]{"Success", + "IOException", // [cmd /C dir ">" dirOut.txt] no redirection + "Success", + "IOException"}, //SM - no legacy mode, bad command + + // [cmd /C dir > ".\Program Files\dirOut.txt"] + new String[]{"Success", + "IOException", // [cmd /C dir ">" ".\Program Files\dirOut.txt"] no redirection + "Success", + "IOException"}, //SM - no legacy mode, bad command + // [.\Program File\do.cmd] - new String[]{"IOException", // [.\Program] not found + new String[]{"Success", + "IOException", // [.\Program] not found "Success", "IOException"}, //SM - no legacy mode [.\Program] - OK // [".\Program File\doNot.cmd" arg] new String[]{"Success", + "Success", "Success", "AccessControlException"}, //SM - [".\Program] - OK, // [.\\Program Files\\doNot.cmd] - Fail @@ -98,15 +121,28 @@ public class ExecCommand { // [".\Program File\do.cmd" arg] // AccessControlException new String[]{"Success", + "Success", "Success", "Success"}, //SM - [".\Program] - OK, // [.\\Program Files\\do.cmd] - OK // compatibility - new String[]{"Success", "Success", "Success"}, //[".\Program.cmd"] - new String[]{"Success", "Success", "Success"} //[.\Program.cmd] + new String[]{"Success", "Success", "Success", "Success"}, //[".\Program.cmd"] + new String[]{"Success", "Success", "Success", "Success"} //[.\Program.cmd] }; + private static void deleteOut(String path) { + try { + Files.delete(FileSystems.getDefault().getPath(path)); + } catch (IOException ex) { + //that is OK + } + } + private static void checkOut(String path) throws FileNotFoundException { + if (Files.notExists(FileSystems.getDefault().getPath(path))) + throw new FileNotFoundException(path); + } + public static void main(String[] _args) throws Exception { if (!System.getProperty("os.name").startsWith("Windows")) { return; @@ -126,20 +162,51 @@ public class ExecCommand { } // action - for (int k = 0; k < 3; ++k) { + for (int k = 0; k < 4; ++k) { switch (k) { + case 0: + // the "jdk.lang.Process.allowAmbiguousCommands" is undefined + // "true" by default with the legacy verification procedure + break; case 1: - System.setProperty("jdk.lang.Process.allowAmbigousCommands", ""); + System.setProperty("jdk.lang.Process.allowAmbiguousCommands", "false"); break; case 2: + System.setProperty("jdk.lang.Process.allowAmbiguousCommands", ""); + break; + case 3: System.setSecurityManager( new SecurityMan() ); break; } for (int i = 0; i < TEST_RTE_ARG.length; ++i) { String outRes; try { + // tear up + switch (i) { + case 0: + // [cmd /C dir > dirOut.txt] + deleteOut(".\\dirOut.txt"); + break; + case 1: + // [cmd /C dir > ".\Program Files\dirOut.txt"] + deleteOut(".\\Program Files\\dirOut.txt"); + break; + } + Process exec = Runtime.getRuntime().exec(TEST_RTE_ARG[i]); exec.waitFor(); + + //exteded check + switch (i) { + case 0: + // [cmd /C dir > dirOut.txt] + checkOut(".\\dirOut.txt"); + break; + case 1: + // [cmd /C dir > ".\Program Files\dirOut.txt"] + checkOut(".\\Program Files\\dirOut.txt"); + break; + } outRes = "Success"; } catch (IOException ioe) { outRes = "IOException: " + ioe.getMessage(); @@ -150,8 +217,8 @@ public class ExecCommand { } if (!outRes.startsWith(TEST_RTE_GI[i][k])) { - throw new Error("Unexpected output! Step" + k + "" + i - + " \nArgument: " + TEST_RTE_ARG[i] + throw new Error("Unexpected output! Step" + k + ":" + i + + "\nArgument: " + TEST_RTE_ARG[i] + "\nExpected: " + TEST_RTE_GI[i][k] + "\n Output: " + outRes); } else { diff --git a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java index 6db95eb3261..2cd61019136 100644 --- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java +++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,8 @@ /* * @test - * @bug 7146431 - * @summary Test that internal JAXP packages cannot be accessed + * @bug 7146431 8000450 + * @summary Test that internal packages cannot be accessed */ public class CheckPackageAccess { @@ -32,6 +32,7 @@ public class CheckPackageAccess { public static void main(String[] args) throws Exception { String[] pkgs = new String[] { + "com.sun.corba.se.impl.", "com.sun.org.apache.xerces.internal.utils.", "com.sun.org.apache.xalan.internal.utils." }; SecurityManager sm = new SecurityManager(); @@ -40,7 +41,11 @@ public class CheckPackageAccess { System.out.println("Checking package access for " + pkg); try { sm.checkPackageAccess(pkg); - throw new Exception("Expected SecurityException not thrown"); + throw new Exception("Expected PackageAccess SecurityException not thrown"); + } catch (SecurityException se) { } + try { + sm.checkPackageDefinition(pkg); + throw new Exception("Expected PackageDefinition SecurityException not thrown"); } catch (SecurityException se) { } } } diff --git a/jdk/test/java/lang/Thread/StopThrowable.java b/jdk/test/java/lang/Thread/StopThrowable.java new file mode 100644 index 00000000000..edc3a8d50a8 --- /dev/null +++ b/jdk/test/java/lang/Thread/StopThrowable.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7059085 + * @summary Check that Thread.stop(Throwable) throws UOE + * @run testng StopThrowable + */ + +import org.testng.annotations.Test; + +import java.util.concurrent.CountDownLatch; + +public class StopThrowable { + + @Test(expectedExceptions=UnsupportedOperationException.class) + public void testStopSelf() { + Thread.currentThread().stop(new ThreadDeath()); + } + + private static void awaitUnchecked(CountDownLatch latch) { + try { + latch.await(); + } catch (InterruptedException e) { + // should not happen + throw new RuntimeException(e); + } + } + + @Test(expectedExceptions=UnsupportedOperationException.class) + public void testStopOther() throws Throwable { + CountDownLatch ready = new CountDownLatch(1); + CountDownLatch done = new CountDownLatch(1); + Thread t = new Thread( () -> { ready.countDown(); awaitUnchecked(done); } ); + t.start(); + try { + ready.await(); + t.stop(new ThreadDeath()); + } finally { + done.countDown(); + } + } + + @Test(expectedExceptions=UnsupportedOperationException.class) + public void testNull() { + Thread.currentThread().stop(null); + } +} diff --git a/jdk/test/java/lang/ThreadGroup/Suspend.java b/jdk/test/java/lang/ThreadGroup/Suspend.java index 6c417b98f27..e527d26b39f 100644 --- a/jdk/test/java/lang/ThreadGroup/Suspend.java +++ b/jdk/test/java/lang/ThreadGroup/Suspend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,47 +23,55 @@ /** * @test - * @bug 4176355 + * @bug 4176355 7181748 * @summary Suspending a ThreadGroup that contains the current thread has * unpredictable results. */ public class Suspend implements Runnable { - private static Thread first=null; - private static Thread second=null; - private static ThreadGroup group = new ThreadGroup(""); - private static int count = 0; - Suspend() { - Thread thread = new Thread(group, this); - if (first == null) - first = thread; - else - second = thread; - - thread.start(); - } + private static volatile int count = 0; + private static final ThreadGroup group = new ThreadGroup(""); + private static final Thread first = new Thread(group, new Suspend()); + private static final Thread second = new Thread(group, new Suspend()); public void run() { while (true) { try { - Thread.sleep(1000); // Give other thread a chance to start - if (Thread.currentThread() == first) - group.suspend(); - else + Thread.sleep(100); + if (Thread.currentThread() == first) { + if (second.isAlive()) { + group.suspend(); + } + } else { count++; - } catch(InterruptedException e){ + } + } catch (InterruptedException e) { } } } public static void main(String[] args) throws Exception { - for (int i=0; i<2; i++) - new Suspend(); - Thread.sleep(3000); + // Launch two threads as part of the same thread group + first.start(); + second.start(); + + // Wait for the thread group suspend to be issued + while (!first.isAlive() || !second.isAlive()) { + Thread.sleep(100); + } + Thread.sleep(1000); + // Suppose, the thread group is now suspended + + count = 0; + Thread.sleep(1000); + + // Increment of the count indicates that the second thread is still running boolean failed = (count > 1); - first.stop(); second.stop(); - if (failed) + first.stop(); + second.stop(); + if (failed) { throw new RuntimeException("Failure."); + } } } diff --git a/jdk/test/java/lang/instrument/MakeJAR4.sh b/jdk/test/java/lang/instrument/MakeJAR4.sh index 3376bd7cc4c..91a7e8dd0dd 100644 --- a/jdk/test/java/lang/instrument/MakeJAR4.sh +++ b/jdk/test/java/lang/instrument/MakeJAR4.sh @@ -43,4 +43,4 @@ while [ $# != 0 ] ; do done -${JAR} "{TESTTOOLVMOPTS}" cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ${OTHER}*.java +${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ${OTHER}*.java diff --git a/jdk/test/java/lang/instrument/RetransformBigClass.sh b/jdk/test/java/lang/instrument/RetransformBigClass.sh index 582eca8e05a..acaa5ae0d0c 100644 --- a/jdk/test/java/lang/instrument/RetransformBigClass.sh +++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh @@ -23,7 +23,6 @@ # @test # @bug 7122253 -# @ignore until the fix for 7122253 (from HotSpot) is in a promoted build # @summary Retransform a big class. # @author Daniel D. Daugherty # diff --git a/jdk/test/java/lang/invoke/7196190/MHProxyTest.java b/jdk/test/java/lang/invoke/7196190/MHProxyTest.java deleted file mode 100644 index 5e07f393cb1..00000000000 --- a/jdk/test/java/lang/invoke/7196190/MHProxyTest.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 7196190 - * @summary Improve method of handling MethodHandles - * - * @run main/othervm MHProxyTest - */ - -import java.lang.invoke.*; -import java.security.*; -import static java.lang.invoke.MethodHandles.*; -import static java.lang.invoke.MethodType.*; - -public class MHProxyTest { - private static final Class C_Unsafe; - private static final MethodHandle MH_getUnsafe; - static { - // Do these before there is a SM installed. - C_Unsafe = sun.misc.Unsafe.class; // EXPECT A WARNING ON THIS LINE - Lookup lookup = lookup(); - MethodHandle gumh = null; - try { - gumh = lookup.findStatic(C_Unsafe, "getUnsafe", methodType(C_Unsafe)); - } catch (ReflectiveOperationException ex) { - throw new InternalError(ex.toString()); - } - MH_getUnsafe = gumh; - // Try some different lookups: - try { - lookup.in(Object.class).findStatic(C_Unsafe, "getUnsafe", methodType(C_Unsafe)); - } catch (ReflectiveOperationException ex) { - throw new InternalError(ex.toString()); - } - lookup = lookup().in(C_Unsafe); - try { - lookup.in(C_Unsafe).findStatic(C_Unsafe, "getUnsafe", methodType(C_Unsafe)); - } catch (ReflectiveOperationException ex) { - throw new InternalError(ex.toString()); - } - } - - public static void main(String[] args) throws Throwable { - System.setSecurityManager(new SecurityManager()); - Lookup lookup = lookup(); - testBasic(lookup); - testDoPriv(lookup); - testSetVar(); - Lookup l2 = lookup.in(Object.class); - System.out.println("=== "+l2); - testBasic(l2); - testDoPriv(l2); - Lookup l3 = lookup.in(C_Unsafe); - System.out.println("=== "+l3); - testBasic(l3); - testDoPriv(l3); - if (failure != null) - throw failure; - } - - private static Throwable failure; - private static void fail(Throwable ex) { - if (failure == null) - failure = ex; - StackTraceElement frame = new Exception().getStackTrace()[1]; - System.out.printf("Failed at %s:%d: %s\n", frame.getFileName(), frame.getLineNumber(), ex); - } - private static void ok(Throwable ex) { - StackTraceElement frame = new Exception().getStackTrace()[1]; - System.out.printf("OK at %s:%d: %s\n", frame.getFileName(), frame.getLineNumber(), ex); - } - - private static void testBasic(Lookup lookup) throws Throwable { - // Verify that we can't get to this guy under the SM: - try { - MethodHandle badmh = lookup.findStatic(C_Unsafe, "getUnsafe", methodType(C_Unsafe)); - assert(badmh.type() == methodType(C_Unsafe)); - badmh = badmh.asType(badmh.type().generic()); - Object u = C_Unsafe.cast(badmh.invokeExact()); - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got mh to getUnsafe!")); - } catch (SecurityException ex) { - ok(ex); - } - try { - Object u = MH_getUnsafe.invokeWithArguments(); - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got the Unsafe object! (MH invoke)")); - } catch (SecurityException ex) { - ok(ex); - } - try { - MethodHandle mh = MH_getUnsafe; - mh = mh.asType(mh.type().generic()); - mh = foldArguments(identity(Object.class), mh); - mh = filterReturnValue(mh, identity(Object.class)); - Object u = mh.invokeExact(); - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got the Unsafe object! (MH invokeWithArguments)")); - } catch (SecurityException ex) { - ok(ex); - } - } - - private static void testDoPriv(Lookup lookup) throws Throwable { - PrivilegedAction privAct = MethodHandleProxies.asInterfaceInstance(PrivilegedAction.class, MH_getUnsafe); - try { - Object u = AccessController.doPrivileged(privAct); - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got the Unsafe object! (static doPriv)")); - } catch (SecurityException ex) { - ok(ex); - } - MethodHandle MH_doPriv = lookup.findStatic(AccessController.class, "doPrivileged", - methodType(Object.class, PrivilegedAction.class)); - MH_doPriv = MH_doPriv.bindTo(privAct); - try { - Object u = MH_doPriv.invoke(); - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got the Unsafe object! (MH + doPriv)")); - } catch (SecurityException ex) { - ok(ex); - } - // try one more layer of indirection: - Runnable rbl = MethodHandleProxies.asInterfaceInstance(Runnable.class, MH_doPriv); - try { - rbl.run(); - fail(new AssertionError("got the Unsafe object! (Runnable + MH + doPriv)")); - } catch (SecurityException ex) { - ok(ex); - } - } - - private static void testSetVar() throws Throwable { - { - // Test the box pattern: - Object[] box = new Object[1]; - MethodHandle MH_getFoo = identity(Object.class).bindTo("foo"); - MethodHandle MH_storeToBox = insertArguments(arrayElementSetter(Object[].class), 0, box, 0); - MethodHandle mh = filterReturnValue(MH_getFoo, MH_storeToBox); - mh.invokeExact(); - assert(box[0] == "foo"); - } - { - Object[] box = new Object[1]; - MethodHandle MH_storeToBox = insertArguments(arrayElementSetter(Object[].class), 0, box, 0); - MethodHandle mh = filterReturnValue(MH_getUnsafe.asType(MH_getUnsafe.type().generic()), MH_storeToBox); - try { - mh.invokeExact(); - Object u = box[0]; - assert(C_Unsafe.isInstance(u)); - fail(new AssertionError("got the Unsafe object! (MH + setElement)")); - } catch (SecurityException ex) { - ok(ex); - } - } - } -} diff --git a/jdk/test/java/lang/invoke/lambda/LambdaConstructorMethodHandleUnbox.java b/jdk/test/java/lang/invoke/lambda/LambdaConstructorMethodHandleUnbox.java new file mode 100644 index 00000000000..5d77da88828 --- /dev/null +++ b/jdk/test/java/lang/invoke/lambda/LambdaConstructorMethodHandleUnbox.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8016761 + * @summary Lambda metafactory: incorrect type conversion of constructor method handle + */ + +public class LambdaConstructorMethodHandleUnbox { + interface IntFunction { + int m(X x); + } + + public static void main(String[] args) { + IntFunction s = Integer::new; + if (s.m("2000") + s.m("13") != 2013) { + throw new RuntimeException("Lambda conversion failure"); + } + } +} diff --git a/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java b/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java index ccffecabebd..12403164aba 100644 --- a/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java +++ b/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java index 00f3768efe6..195fb573ec8 100644 --- a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java +++ b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java index 26b3b661531..b88710c81a6 100644 --- a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java +++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java @@ -36,12 +36,14 @@ import javax.management.MBeanServer; import java.util.logging.*; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.HashMap; public class LoggingMXBeanTest { - static String LOGGER_NAME_1 = "com.sun.management.Logger"; - static String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2"; - static String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown"; + static final String LOGGER_NAME_1 = "com.sun.management.Logger"; + static final String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2"; + static final String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown"; // These instance variables prevent premature logger garbage collection // See getLogger() weak reference warnings. @@ -213,23 +215,35 @@ public class LoggingMXBeanTest PlatformLoggingMXBean mxbean2) { // verify logger names List loggers1 = mxbean1.getLoggerNames(); + System.out.println("Loggers: " + loggers1); + + // Retrieve the named loggers to prevent them from being + // spontaneously gc'ed. + Map loggersMap = new HashMap<>(); + for (String n : loggers1) { + loggersMap.put(n, Logger.getLogger(n)); + } + List loggers2 = mxbean2.getLoggerNames(); + // loggers1 and loggers2 should be identical - no new logger should + // have been created in between (at least no new logger name) + // if (loggers1.size() != loggers2.size()) throw new RuntimeException("LoggerNames: unmatched number of entries"); - List loggers3 = new ArrayList<>(loggers1); - loggers3.removeAll(loggers2); - if (loggers3.size() != 0) + if (!loggers2.containsAll(loggersMap.keySet())) throw new RuntimeException("LoggerNames: unmatched loggers"); + // verify logger's level and parent for (String logger : loggers1) { - if (!mxbean1.getLoggerLevel(logger) - .equals(mxbean2.getLoggerLevel(logger))) + String level1 = mxbean1.getLoggerLevel(logger); + String level2 = mxbean2.getLoggerLevel(logger); + if (!java.util.Objects.equals(level1, level2)) { throw new RuntimeException( - "LoggerLevel: unmatched level for " + logger - + ", " + mxbean1.getLoggerLevel(logger) - + ", " + mxbean2.getLoggerLevel(logger)); + "LoggerLevel: unmatched level for " + logger + + ", " + level1 + ", " + level2); + } if (!mxbean1.getParentLoggerName(logger) .equals(mxbean2.getParentLoggerName(logger))) diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java index 3566a1f3619..17c58bce981 100644 --- a/jdk/test/java/math/BigInteger/BigIntegerTest.java +++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,15 +23,19 @@ /* * @test - * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 + * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 * @summary tests methods in BigInteger * @run main/timeout=400 BigIntegerTest * @author madbot */ -import java.util.Random; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.math.BigInteger; -import java.io.*; +import java.util.Random; /** * This is a simple test class created to ensure that the results @@ -48,21 +52,45 @@ import java.io.*; * */ public class BigIntegerTest { + // + // Bit large number thresholds based on the int thresholds + // defined in BigInteger itself: + // + // KARATSUBA_THRESHOLD = 50 ints = 1600 bits + // TOOM_COOK_THRESHOLD = 75 ints = 2400 bits + // KARATSUBA_SQUARE_THRESHOLD = 90 ints = 2880 bits + // TOOM_COOK_SQUARE_THRESHOLD = 140 ints = 4480 bits + // + // SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8 ints = 256 bits + // + static final int BITS_KARATSUBA = 1600; + static final int BITS_TOOM_COOK = 2400; + static final int BITS_KARATSUBA_SQUARE = 2880; + static final int BITS_TOOM_COOK_SQUARE = 4480; + static final int BITS_SCHOENHAGE_BASE = 256; + + static final int ORDER_SMALL = 60; + static final int ORDER_MEDIUM = 100; + // #bits for testing Karatsuba and Burnikel-Ziegler + static final int ORDER_KARATSUBA = 1800; + // #bits for testing Toom-Cook + static final int ORDER_TOOM_COOK = 3000; + // #bits for testing Karatsuba squaring + static final int ORDER_KARATSUBA_SQUARE = 3200; + // #bits for testing Toom-Cook squaring + static final int ORDER_TOOM_COOK_SQUARE = 4600; + static Random rnd = new Random(); static int size = 1000; // numbers per batch static boolean failure = false; - // Some variables for sizing test numbers in bits - private static int order1 = 100; - private static int order2 = 60; - private static int order3 = 30; - - public static void pow() { + public static void pow(int order) { int failCount1 = 0; for (int i=0; i + * (u << a)*(v << b) = (u*v) << (a + b) + * + * For Karatsuba multiplication, the right hand expression will be evaluated + * using the standard naive algorithm, and the left hand expression using + * the Karatsuba algorithm. For 3-way Toom-Cook multiplication, the right + * hand expression will be evaluated using Karatsuba multiplication, and the + * left hand expression using 3-way Toom-Cook multiplication. + */ + public static void multiplyLarge() { + int failCount = 0; + + BigInteger base = BigInteger.ONE.shiftLeft(BITS_KARATSUBA - 32 - 1); + for (int i=0; ibigInteger.multiply(bigInteger) tests whether + * the parameter is the same instance on which the method is being invoked + * and calls square() accordingly. + */ + public static void squareLarge() { + int failCount = 0; + + BigInteger base = BigInteger.ONE.shiftLeft(BITS_KARATSUBA_SQUARE - 32 - 1); + for (int i=0; i= lower; bits--) { + for (int i = 0; i < 50; i++) { + BigInteger x = BigInteger.ONE.shiftLeft(bits - 1).or(new BigInteger(bits - 2, rnd)); + + for (int radix = Character.MIN_RADIX; radix < Character.MAX_RADIX; radix++) { + String result = x.toString(radix); + BigInteger test = new BigInteger(result, radix); + if (!test.equals(x)) { + failCount++; + System.err.println("BigInteger toString: " + x); + System.err.println("Test: " + test); + System.err.println(radix); + } + } + } + } + } + report("String Conversion", failCount); } - public static void byteArrayConv() { + public static void byteArrayConv(int order) { int failCount = 0; for (int i=0; i0) order1 = (int)((Integer.parseInt(args[0]))* 3.333); if (args.length >1) order2 = (int)((Integer.parseInt(args[1]))* 3.333); if (args.length >2) order3 = (int)((Integer.parseInt(args[2]))* 3.333); + if (args.length >3) + order4 = (int)((Integer.parseInt(args[3]))* 3.333); prime(); nextProbablePrime(); - arithmetic(); - divideAndRemainder(); - pow(); + arithmetic(order1); // small numbers + arithmetic(order3); // Karatsuba / Burnikel-Ziegler range + arithmetic(order4); // Toom-Cook range + + divideAndRemainder(order1); // small numbers + divideAndRemainder(order3); // Karatsuba / Burnikel-Ziegler range + divideAndRemainder(order4); // Toom-Cook range + + pow(order1); + pow(order3); + pow(order4); + + square(ORDER_MEDIUM); + square(ORDER_KARATSUBA_SQUARE); + square(ORDER_TOOM_COOK_SQUARE); bitCount(); bitLength(); - bitOps(); - bitwise(); + bitOps(order1); + bitwise(order1); - shift(); + shift(order1); - byteArrayConv(); + byteArrayConv(order1); - modInv(); - modExp(); - modExp2(); + modInv(order1); // small numbers + modInv(order3); // Karatsuba / Burnikel-Ziegler range + modInv(order4); // Toom-Cook range + + modExp(order1, order2); + modExp2(order1); stringConv(); serialize(); + multiplyLarge(); + squareLarge(); + if (failure) throw new RuntimeException("Failure in BigIntegerTest."); } @@ -747,7 +959,7 @@ public class BigIntegerTest { */ private static BigInteger fetchNumber(int order) { boolean negative = rnd.nextBoolean(); - int numType = rnd.nextInt(6); + int numType = rnd.nextInt(7); BigInteger result = null; if (order < 2) order = 2; @@ -783,6 +995,19 @@ public class BigIntegerTest { result = result.or(temp); } break; + case 5: // Runs of consecutive ones and zeros + result = ZERO; + int remaining = order; + int bit = rnd.nextInt(2); + while (remaining > 0) { + int runLength = Math.min(remaining, rnd.nextInt(order)); + result = result.shiftLeft(runLength); + if (bit > 0) + result = result.add(ONE.shiftLeft(runLength).subtract(ONE)); + remaining -= runLength; + bit = 1 - bit; + } + break; default: // random bits result = new BigInteger(order, rnd); diff --git a/jdk/test/java/math/BigInteger/PrimitiveConversionTests.java b/jdk/test/java/math/BigInteger/PrimitiveConversionTests.java new file mode 100644 index 00000000000..d459fe54cf0 --- /dev/null +++ b/jdk/test/java/math/BigInteger/PrimitiveConversionTests.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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 static java.math.BigInteger.ONE; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +/** + * @test + * @bug 7131192 + * @summary This test ensures that BigInteger.floatValue() and + * BigInteger.doubleValue() behave correctly. + * @author Louis Wasserman + */ +public class PrimitiveConversionTests { + static final List ALL_BIGINTEGER_CANDIDATES; + + static { + List samples = new ArrayList<>(); + // Now add values near 2^N for lots of values of N. + for (int exponent : Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 31, 32, 33, + 34, 62, 63, 64, 65, 71, 72, 73, 79, 80, 81, 255, 256, 257, 511, + 512, 513, Double.MAX_EXPONENT - 1, Double.MAX_EXPONENT, + Double.MAX_EXPONENT + 1, 2000, 2001, 2002)) { + BigInteger x = ONE.shiftLeft(exponent); + for (BigInteger y : Arrays.asList(x, x.add(ONE), x.subtract(ONE))) { + samples.add(y); + samples.add(y.negate()); + } + } + + Random rng = new Random(1234567); + for (int i = 0; i < 2000; i++) { + samples.add(new BigInteger(rng.nextInt(2000), rng)); + } + + ALL_BIGINTEGER_CANDIDATES = Collections.unmodifiableList(samples); + } + + public static int testDoubleValue() { + int failures = 0; + for (BigInteger big : ALL_BIGINTEGER_CANDIDATES) { + double expected = Double.parseDouble(big.toString()); + double actual = big.doubleValue(); + + // should be bitwise identical + if (Double.doubleToRawLongBits(expected) != Double + .doubleToRawLongBits(actual)) { + System.out.println(big); + failures++; + } + } + return failures; + } + + public static int testFloatValue() { + int failures = 0; + for (BigInteger big : ALL_BIGINTEGER_CANDIDATES) { + float expected = Float.parseFloat(big.toString()); + float actual = big.floatValue(); + + // should be bitwise identical + if (Float.floatToRawIntBits(expected) != Float + .floatToRawIntBits(actual)) { + System.out.println(big + " " + expected + " " + actual); + failures++; + } + } + return failures; + } + + public static void main(String[] args) { + int failures = testDoubleValue(); + failures += testFloatValue(); + if (failures > 0) { + throw new RuntimeException("Incurred " + failures + + " failures while testing primitive conversions."); + } + } +} diff --git a/jdk/test/java/net/CookieHandler/CookieManagerTest.java b/jdk/test/java/net/CookieHandler/CookieManagerTest.java index a59a0a3795d..b52af04966e 100644 --- a/jdk/test/java/net/CookieHandler/CookieManagerTest.java +++ b/jdk/test/java/net/CookieHandler/CookieManagerTest.java @@ -24,20 +24,14 @@ /* * @test * @summary Unit test for java.net.CookieManager - * @bug 6244040 7150552 + * @bug 6244040 7150552 7051862 * @run main/othervm -ea CookieManagerTest * @author Edward Wang */ import com.sun.net.httpserver.*; import java.io.IOException; -import java.net.CookieHandler; -import java.net.CookieManager; -import java.net.CookiePolicy; -import java.net.HttpURLConnection; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.URL; +import java.net.*; public class CookieManagerTest { @@ -51,15 +45,37 @@ public class CookieManagerTest { if (httpTrans.badRequest) { throw new RuntimeException("Test failed : bad cookie header"); } + checkCookiePolicy(); } - public static void startHttpServer() throws IOException { + public static void startHttpServer() throws IOException { httpTrans = new CookieTransactionHandler(); server = HttpServer.create(new InetSocketAddress(0), 0); server.createContext("/", httpTrans); server.start(); } + /* + * Checks if CookiePolicy.ACCEPT_ORIGINAL_SERVER#shouldAccept() + * returns false for null arguments + */ + private static void checkCookiePolicy() throws Exception { + CookiePolicy cp = CookiePolicy.ACCEPT_ORIGINAL_SERVER; + boolean retVal; + retVal = cp.shouldAccept(null, null); + checkValue(retVal); + retVal = cp.shouldAccept(null, new HttpCookie("CookieName", "CookieVal")); + checkValue(retVal); + retVal = cp.shouldAccept((new URL("http", "localhost", 2345, "/")).toURI(), + null); + checkValue(retVal); + } + + private static void checkValue(boolean val) { + if (val) + throw new RuntimeException("Return value is not false!"); + } + public static void makeHttpCall() throws IOException { try { System.out.println("http server listenining on: " diff --git a/jdk/test/java/net/CookieHandler/EmptyCookieHeader.java b/jdk/test/java/net/CookieHandler/EmptyCookieHeader.java new file mode 100644 index 00000000000..f35631741a6 --- /dev/null +++ b/jdk/test/java/net/CookieHandler/EmptyCookieHeader.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8015799 + * @summary HttpURLConnection.getHeaderFields() throws IllegalArgumentException + */ + +import com.sun.net.httpserver.*; +import java.io.IOException; +import java.io.OutputStream; +import java.net.*; +import java.util.*; + +public class EmptyCookieHeader { + + public static void main(String[] args) throws Exception { + new EmptyCookieHeader().runTest(); + } + + public void runTest() throws Exception { + final CookieHandler oldHandler = CookieHandler.getDefault(); + CookieHandler.setDefault(new TestCookieHandler()); + HttpServer s = HttpServer.create(new InetSocketAddress(0), 0); + try { + startServer(s); + URL url = new URL("http://localhost:" + s.getAddress().getPort() + "/"); + HttpURLConnection c = (HttpURLConnection)url.openConnection(); + c.getHeaderFields(); + } finally { + CookieHandler.setDefault(oldHandler); + s.stop(0); + } + } + + static void startServer(HttpServer server) throws IOException { + server.createContext("/", new EmptyCookieHandler()); + server.start(); + } + + static class EmptyCookieHandler implements HttpHandler { + + @Override + public void handle(HttpExchange exchange) throws IOException { + String requestMethod = exchange.getRequestMethod(); + if (requestMethod.equalsIgnoreCase("GET")) { + Headers responseHeaders = exchange.getResponseHeaders(); + responseHeaders.set("Content-Type", "text/plain"); + responseHeaders.set("Date", "June 13th 2012"); + + // No domain value set + responseHeaders.set("Set-Cookie2", "name=value"); + responseHeaders.set("Set-Cookie2", ""); + exchange.sendResponseHeaders(200, 0); + try (OutputStream os = exchange.getResponseBody()) { + String str = "This is what the server sent!"; + os.write(str.getBytes()); + } + } + } + } + + class TestCookieHandler extends CookieHandler { + @Override + public Map> get(URI uri, + Map> respH) { + return new HashMap<>(); + } + + @Override + public void put(URI uri, Map> respH) { } + } +} diff --git a/jdk/test/java/net/CookieHandler/LocalHostCookie.java b/jdk/test/java/net/CookieHandler/LocalHostCookie.java new file mode 100644 index 00000000000..ac8d61622ef --- /dev/null +++ b/jdk/test/java/net/CookieHandler/LocalHostCookie.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 com.sun.net.httpserver.*; +import java.io.IOException; +import java.io.OutputStream; +import java.net.*; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; + +/* + * @test + * @bug 7169142 + * @summary CookieHandler does not work with localhost + * @run main/othervm LocalHostCookie + */ +public class LocalHostCookie { + + public static void main(String[] args) throws Exception { + new LocalHostCookie().runTest(); + } + + public void runTest() throws Exception { + Server s = null; + try { + s = new Server(); + s.startServer(); + URL url = new URL("http","localhost", s.getPort(), "/"); + HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(); + urlConnection.setRequestMethod("GET"); + urlConnection.setDoOutput(true); + urlConnection.connect(); + urlConnection.getInputStream(); + + CookieHandler cookieHandler = CookieHandler.getDefault(); + if (cookieHandler == null) { + cookieHandler = new java.net.CookieManager(); + CookieHandler.setDefault(cookieHandler); + } + cookieHandler.put(urlConnection.getURL().toURI(), + urlConnection.getHeaderFields()); + Map> map = + cookieHandler.get(urlConnection.getURL().toURI(), + urlConnection.getHeaderFields()); + if (map.containsKey("Cookie")) { + List list = map.get("Cookie"); + // name-value list will be empty if ".local" is not appended + if (list == null || list.size() == 0) { + throw new RuntimeException("Test failed!"); + } + } + } finally { + s.stopServer(); + } + } + + class Server { + HttpServer server; + + public void startServer() { + InetSocketAddress addr = new InetSocketAddress(0); + try { + server = HttpServer.create(addr, 0); + } catch (IOException ioe) { + throw new RuntimeException("Server could not be created"); + } + + server.createContext("/", new MyCookieHandler()); + server.start(); + } + + public int getPort() { + return server.getAddress().getPort(); + } + + public void stopServer() { + server.stop(0); + } + } + + class MyCookieHandler implements HttpHandler { + + @Override + public void handle(HttpExchange exchange) throws IOException { + String requestMethod = exchange.getRequestMethod(); + if (requestMethod.equalsIgnoreCase("GET")){ + Headers responseHeaders = exchange.getResponseHeaders(); + responseHeaders.set("Content-Type", "text/plain"); + responseHeaders.set("Date", "June 13th 2012"); + // No domain value set + responseHeaders.set("Set-Cookie2", "name=value"); + exchange.sendResponseHeaders(200, 0); + OutputStream os = exchange.getResponseBody(); + String str = "This is what the server sent!"; + os.write(str.getBytes()); + os.flush(); + os.close(); + } + } + } +} + diff --git a/jdk/test/java/net/MulticastSocket/Promiscuous.java b/jdk/test/java/net/MulticastSocket/Promiscuous.java new file mode 100644 index 00000000000..ce0a1033156 --- /dev/null +++ b/jdk/test/java/net/MulticastSocket/Promiscuous.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8014499 + * @summary Test for interference when two sockets are bound to the same + * port but joined to different multicast groups + * @run main Promiscuous + * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous + */ + +import java.io.IOException; +import static java.lang.System.out; +import java.net.*; + +public class Promiscuous { + + static final int TIMEOUT = 5 * 1000; // 5 secs + static int id = 1000; + + static void receive(MulticastSocket mc, boolean datagramExpected, int id) + throws IOException + { + byte[] ba = new byte[100]; + DatagramPacket p = new DatagramPacket(ba, ba.length); + try { + mc.receive(p); + int recvId = Integer.parseInt( + new String(p.getData(), 0, p.getLength(), "UTF-8")); + if (datagramExpected) { + if (recvId != id) + throw new RuntimeException("Unexpected id, got " + recvId + + ", expected: " + id); + out.printf("Received message as expected, %s\n", p.getAddress()); + } else { + throw new RuntimeException("Unexpected message received, " + + p.getAddress()); + } + } catch (SocketTimeoutException e) { + if (datagramExpected) + throw new RuntimeException("Expected message not received, " + + e.getMessage()); + else + out.printf("Message not received, as expected\n"); + } + } + + static void test(InetAddress group1, InetAddress group2) + throws IOException + { + try (MulticastSocket mc1 = new MulticastSocket(); + MulticastSocket mc2 = new MulticastSocket(mc1.getLocalPort()); + DatagramSocket ds = new DatagramSocket()) { + final int port = mc1.getLocalPort(); + out.printf("Using port: %d\n", port); + + mc1.setSoTimeout(TIMEOUT); + mc2.setSoTimeout(TIMEOUT); + int nextId = id; + byte[] msg = Integer.toString(nextId).getBytes("UTF-8"); + DatagramPacket p = new DatagramPacket(msg, msg.length); + p.setAddress(group1); + p.setPort(port); + + mc1.joinGroup(group1); + out.printf("mc1 joined the MC group: %s\n", group1); + mc2.joinGroup(group2); + out.printf("mc2 joined the MC group: %s\n", group2); + + out.printf("Sending datagram to: %s/%d\n", group1, port); + ds.send(p); + + // the packet should be received by mc1 only + receive(mc1, true, nextId); + receive(mc2, false, 0); + + nextId = ++id; + msg = Integer.toString(nextId).getBytes("UTF-8"); + p = new DatagramPacket(msg, msg.length); + p.setAddress(group2); + p.setPort(port); + + out.printf("Sending datagram to: %s/%d\n", group2, port); + ds.send(p); + + // the packet should be received by mc2 only + receive(mc2, true, nextId); + receive(mc1, false, 0); + + mc1.leaveGroup(group1); + mc2.leaveGroup(group2); + } + } + + public static void main(String args[]) throws IOException { + String os = System.getProperty("os.name"); + + // Requires IP_MULTICAST_ALL on Linux (new since 2.6.31) so skip + // on older kernels. Note that we skip on <= version 3 to keep the + // parsing simple + if (os.equals("Linux")) { + String osversion = System.getProperty("os.version"); + String[] vers = osversion.split("\\.", 0); + int major = Integer.parseInt(vers[0]); + if (major < 3) { + System.out.format("Kernel version is %s, test skipped%n", osversion); + return; + } + } + + // multicast groups used for the test + InetAddress ip4Group1 = InetAddress.getByName("224.7.8.9"); + InetAddress ip4Group2 = InetAddress.getByName("225.4.5.6"); + + test(ip4Group1, ip4Group2); + } +} diff --git a/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java new file mode 100644 index 00000000000..027b4b79eea --- /dev/null +++ b/jdk/test/java/nio/channels/DatagramChannel/Promiscuous.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8014377 + * @summary Test for interference when two sockets are bound to the same + * port but joined to different multicast groups + * @build Promiscuous NetworkConfiguration + * @run main Promiscuous + * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous + */ + +import java.nio.ByteBuffer; +import java.nio.channels.*; +import java.net.*; +import static java.net.StandardProtocolFamily.*; +import java.util.*; +import java.io.IOException; + +public class Promiscuous { + + static final Random rand = new Random(); + + static final ProtocolFamily UNSPEC = new ProtocolFamily() { + public String name() { + return "UNSPEC"; + } + }; + + /** + * Sends a datagram to the given multicast group + */ + static int sendDatagram(NetworkInterface nif, + InetAddress group, + int port) + throws IOException + { + ProtocolFamily family = (group instanceof Inet6Address) ? + StandardProtocolFamily.INET6 : StandardProtocolFamily.INET; + DatagramChannel dc = DatagramChannel.open(family) + .setOption(StandardSocketOptions.IP_MULTICAST_IF, nif); + int id = rand.nextInt(); + byte[] msg = Integer.toString(id).getBytes("UTF-8"); + ByteBuffer buf = ByteBuffer.wrap(msg); + System.out.format("Send message -> group %s (id=0x%x)\n", + group.getHostAddress(), id); + dc.send(buf, new InetSocketAddress(group, port)); + dc.close(); + return id; + } + + /** + * Wait (with timeout) for datagram. The {@code datagramExepcted} + * parameter indicates whether a datagram is expected, and if + * {@true} then {@code id} is the identifier in the payload. + */ + static void receiveDatagram(DatagramChannel dc, + String name, + boolean datagramExepcted, + int id) + throws IOException + { + System.out.println("Checking if received by " + name); + + Selector sel = Selector.open(); + dc.configureBlocking(false); + dc.register(sel, SelectionKey.OP_READ); + ByteBuffer buf = ByteBuffer.allocateDirect(100); + + try { + for (;;) { + System.out.println("Waiting to receive message"); + sel.select(5*1000); + SocketAddress sa = dc.receive(buf); + + // no datagram received + if (sa == null) { + if (datagramExepcted) { + throw new RuntimeException("Expected message not recieved"); + } + System.out.println("No message received (correct)"); + return; + } + + // datagram received + + InetAddress sender = ((InetSocketAddress)sa).getAddress(); + buf.flip(); + byte[] bytes = new byte[buf.remaining()]; + buf.get(bytes); + int receivedId = Integer.parseInt(new String(bytes)); + + System.out.format("Received message from %s (id=0x%x)\n", + sender, receivedId); + + if (!datagramExepcted) { + if (receivedId == id) + throw new RuntimeException("Message not expected"); + System.out.println("Message ignored (has wrong id)"); + } else { + if (receivedId == id) { + System.out.println("Message expected"); + return; + } + System.out.println("Message ignored (wrong sender)"); + } + + sel.selectedKeys().clear(); + buf.rewind(); + } + } finally { + sel.close(); + } + } + + static void test(ProtocolFamily family, + NetworkInterface nif, + InetAddress group1, + InetAddress group2) + throws IOException + { + + System.out.format("%nTest family=%s%n", family.name()); + + DatagramChannel dc1 = (family == UNSPEC) ? + DatagramChannel.open() : DatagramChannel.open(family); + DatagramChannel dc2 = (family == UNSPEC) ? + DatagramChannel.open() : DatagramChannel.open(family); + + try { + dc1.setOption(StandardSocketOptions.SO_REUSEADDR, true); + dc2.setOption(StandardSocketOptions.SO_REUSEADDR, true); + + dc1.bind(new InetSocketAddress(0)); + int port = dc1.socket().getLocalPort(); + dc2.bind(new InetSocketAddress(port)); + + System.out.format("dc1 joining [%s]:%d @ %s\n", + group1.getHostAddress(), port, nif.getName()); + System.out.format("dc2 joining [%s]:%d @ %s\n", + group2.getHostAddress(), port, nif.getName()); + + dc1.join(group1, nif); + dc2.join(group2, nif); + + int id = sendDatagram(nif, group1, port); + + receiveDatagram(dc1, "dc1", true, id); + receiveDatagram(dc2, "dc2", false, id); + + id = sendDatagram(nif, group2, port); + + receiveDatagram(dc1, "dc1", false, id); + receiveDatagram(dc2, "dc2", true, id); + + } finally { + dc1.close(); + dc2.close(); + } + } + + public static void main(String[] args) throws IOException { + String os = System.getProperty("os.name"); + + // Requires IP_MULTICAST_ALL on Linux (new since 2.6.31) so skip + // on older kernels. Note that we skip on <= version 3 to keep the + // parsing simple + if (os.equals("Linux")) { + String osversion = System.getProperty("os.version"); + String[] vers = osversion.split("\\.", 0); + int major = Integer.parseInt(vers[0]); + if (major < 3) { + System.out.format("Kernel version is %s, test skipped%n", osversion); + return; + } + } + + // get local network configuration to use + NetworkConfiguration config = NetworkConfiguration.probe(); + + // multicast groups used for the test + InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6"); + InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6"); + + for (NetworkInterface nif: config.ip4Interfaces()) { + InetAddress source = config.ip4Addresses(nif).iterator().next(); + test(INET, nif, ip4Group1, ip4Group2); + + // Solaris and Linux allow IPv6 sockets join IPv4 multicast groups + if (os.equals("SunOS") || os.equals("Linux")) + test(UNSPEC, nif, ip4Group1, ip4Group2); + } + } +} diff --git a/jdk/test/java/nio/file/Files/StreamTest.java b/jdk/test/java/nio/file/Files/StreamTest.java index 0033dd31f38..b5ff2977257 100644 --- a/jdk/test/java/nio/file/Files/StreamTest.java +++ b/jdk/test/java/nio/file/Files/StreamTest.java @@ -43,7 +43,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; -import java.util.Comparators; +import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Objects; @@ -139,7 +139,7 @@ public class StreamTest { public void testBasic() { try (CloseableStream s = Files.list(testFolder)) { - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); assertEquals(actual, level1); } catch (IOException ioe) { fail("Unexpected IOException"); @@ -155,7 +155,7 @@ public class StreamTest { public void testWalk() { try (CloseableStream s = Files.walk(testFolder)) { - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); assertEquals(actual, all); } catch (IOException ioe) { fail("Unexpected IOException"); @@ -165,7 +165,7 @@ public class StreamTest { public void testWalkOneLevel() { try (CloseableStream s = Files.walk(testFolder, 1)) { Object[] actual = s.filter(path -> ! path.equals(testFolder)) - .sorted(Comparators.naturalOrder()) + .sorted(Comparator.naturalOrder()) .toArray(); assertEquals(actual, level1); } catch (IOException ioe) { @@ -177,7 +177,7 @@ public class StreamTest { // If link is not supported, the directory structure won't have link. // We still want to test the behavior with FOLLOW_LINKS option. try (CloseableStream s = Files.walk(testFolder, FileVisitOption.FOLLOW_LINKS)) { - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); assertEquals(actual, all_folowLinks); } catch (IOException ioe) { fail("Unexpected IOException"); @@ -637,13 +637,13 @@ public class StreamTest { public void testClosedStream() throws IOException { try (CloseableStream s = Files.list(testFolder)) { s.close(); - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); assertTrue(actual.length <= level1.length); } try (CloseableStream s = Files.walk(testFolder)) { s.close(); - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); fail("Operate on closed stream should throw IllegalStateException"); } catch (IllegalStateException ex) { // expected @@ -652,7 +652,7 @@ public class StreamTest { try (CloseableStream s = Files.find(testFolder, Integer.MAX_VALUE, (p, attr) -> true)) { s.close(); - Object[] actual = s.sorted(Comparators.naturalOrder()).toArray(); + Object[] actual = s.sorted(Comparator.naturalOrder()).toArray(); fail("Operate on closed stream should throw IllegalStateException"); } catch (IllegalStateException ex) { // expected diff --git a/jdk/test/java/security/Signature/SignatureGetAlgorithm.java b/jdk/test/java/security/Signature/SignatureGetAlgorithm.java new file mode 100644 index 00000000000..2111ffc20fd --- /dev/null +++ b/jdk/test/java/security/Signature/SignatureGetAlgorithm.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ + +/* + * Portions Copyright (c) 2013 IBM Corporation + */ + +/* + * @test + * @bug 8014620 + * @summary Signature.getAlgorithm return null in special case + * @run main/othervm SignatureGetAlgorithm + * @author youdwei + */ +import java.security.*; + +public class SignatureGetAlgorithm { + + public static void main(String[] args) throws Exception { + Provider testProvider = new TestProvider(); + Security.addProvider(testProvider); + Signature sig = Signature.getInstance("MySignatureAlg"); + String algorithm = sig.getAlgorithm(); + System.out.println("Algorithm Name: " + algorithm); + if (algorithm == null) { + throw new Exception("algorithm name should be 'MySignatureAlg'"); + } + } + + public static class TestProvider extends Provider { + TestProvider() { + super("test", 1.0, "test"); + put("Signature.MySignatureAlg", + "SignatureGetAlgorithm$MySignatureAlg"); + } + } + + public static class MySignatureAlg extends Signature { + + public MySignatureAlg() { + super(null); + } + + MySignatureAlg(String s) { + super(s); + } + + @Override + protected void engineInitVerify(PublicKey publicKey) + throws InvalidKeyException { + } + + @Override + protected void engineInitSign(PrivateKey privateKey) + throws InvalidKeyException { + } + + @Override + protected void engineUpdate(byte b) throws SignatureException { + } + + @Override + protected void engineUpdate(byte[] b, int off, int len) + throws SignatureException { + } + + @Override + protected byte[] engineSign() + throws SignatureException { + return new byte[0]; + } + + @Override + protected boolean engineVerify(byte[] sigBytes) + throws SignatureException { + return false; + } + + @Override + @Deprecated + protected void engineSetParameter(String param, Object value) + throws InvalidParameterException { + } + + @Override + @Deprecated + protected Object engineGetParameter(String param) + throws InvalidParameterException { + return null; + } + } +} diff --git a/jdk/test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java b/jdk/test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java index df69edc7f22..25eaab56eea 100644 --- a/jdk/test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java +++ b/jdk/test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 6383095 + * @bug 6383095 8019259 * @summary CRL revoked certificate failures masked by OCSP failures * * Note that the certificate validity is from Mar 16 14:55:35 2009 GMT to @@ -254,12 +254,32 @@ public class FailoverToCRL { CertPathValidator validator = CertPathValidator.getInstance("PKIX"); try { + System.out.println("Validating cert via OCSP: no responder URL"); validator.validate(path, params); } catch (CertPathValidatorException cpve) { if (cpve.getReason() != BasicReason.REVOKED) { throw new Exception( - "unexpect exception, should be a REVOKED CPVE", cpve); + "unexpected exception, should be a REVOKED CPVE", cpve); } + System.out.println(" successful failover to using CRLs"); + } + + java.security.cert.PKIXRevocationChecker revocationChecker = + (java.security.cert.PKIXRevocationChecker) + validator.getRevocationChecker(); + revocationChecker.setOCSPResponder( + new java.net.URI("bad_ocsp_responder_url")); + params.addCertPathChecker(revocationChecker); + + try { + System.out.println("Validating cert via OCSP: bad responder URL"); + validator.validate(path, params); + } catch (CertPathValidatorException cpve) { + if (cpve.getReason() != BasicReason.REVOKED) { + throw new Exception( + "unexpected exception, should be a REVOKED CPVE", cpve); + } + System.out.println(" successful failover to using CRLs"); } } } diff --git a/jdk/test/java/security/testlibrary/Proc.java b/jdk/test/java/security/testlibrary/Proc.java new file mode 100644 index 00000000000..1ab58bf5212 --- /dev/null +++ b/jdk/test/java/security/testlibrary/Proc.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.Permission; +import java.util.ArrayList; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +/** + * This is a test library that makes writing a Java test that spawns multiple + * Java processes easily. + * + * Usage: + * + * Proc.create("Clazz") // The class to launch + * .args("x") // with args + * .env("env", "value") // and an environment variable + * .prop("key","value") // and a system property + * .perm(perm) // with granted permissions + * .start(); // and start + * + * create/start must be called, args/env/prop/perm can be called zero or + * multiple times between create and start. + * + * The controller can call inheritIO to share its I/O to the process. + * Otherwise, it can send data into a proc's stdin with write/println, and + * read its stdout with readLine. stderr is always redirected to DFILE + * unless nodump() is called. A protocol is designed to make + * data exchange among the controller and the processes super easy, in which + * useful data are always printed with a special prefix ("PROCISFUN:"). + * If the data is binary, make it BASE64. + * + * For example: + * + * - A producer Proc calls Proc.binOut() or Proc.textOut() to send out data. + * This method would prints to the stdout something like + * + * PROCISFUN:[raw text or base64 binary] + * + * - The controller calls producer.readData() to get the content. This method + * ignores all other output and only reads lines starting with "PROCISFUN:". + * + * - The controller does not care if the context is text or base64, it simply + * feeds the data to a consumer Proc by calling consumer.println(data). + * This will be printed into System.in of the consumer process. + * + * - The consumer Proc calls Proc.binIn() or Proc.textIn() to read the data. + * The first method de-base64 the input and return a byte[] block. + * + * Please note only plain ASCII is supported in raw text at the moment. + * + * As the Proc objects are hidden so deeply, two static methods, d(String) and + * d(Throwable) are provided to output info into stderr, where they will + * normally be appended messages to DFILE (unless nodump() is called). + * Developers can view the messages in real time by calling + * + * tail -f proc.debug + * + * TODO: + * + * . launch java tools, say, keytool + * . launch another version of java + * . start in another directory + * . start and finish using one method + * + * This is not a test, but is the core of + * JDK-8009977: A test library to launch multiple Java processes + */ +public class Proc { + private Process p; + private BufferedReader br; // the stdout of a process + private String launcher; // Optional: the java program + + private List perms = new ArrayList<>(); + private List args = new ArrayList<>(); + private Map env = new HashMap<>(); + private Map prop = new HashMap(); + private boolean inheritIO = false; + private boolean noDump = false; + + private String clazz; // Class to launch + private String debug; // debug flag, controller will show data + // transfer between procs + + final private static String PREFIX = "PROCISFUN:"; + final private static String DFILE = "proc.debug"; + + // The following methods are called by controllers + + // Creates a Proc by the Java class name, launcher is an optional + // argument to specify the java program + public static Proc create(String clazz, String... launcher) { + Proc pc = new Proc(); + pc.clazz = clazz; + if (launcher.length > 0) { + pc.launcher = launcher[0]; + } + return pc; + } + // Sets inheritIO flag to proc. If set, proc will same I/O channels as + // teh controller. Otherwise, its stdin/stdout is untouched, and its + // stderr is redirected to DFILE. + public Proc inheritIO() { + inheritIO = true; + return this; + } + // When called, stderr inherits parent stderr, otherwise, append to a file + public Proc nodump() { + noDump = true; + return this; + } + // Specifies some args. Can be called multiple times. + public Proc args(String... args) { + for (String c: args) { + this.args.add(c); + } + return this; + } + // Returns debug prefix + public String debug() { + return debug; + } + // Enables debug with prefix + public Proc debug(String title) { + debug = title; + return this; + } + // Specifies an env var. Can be called multiple times. + public Proc env(String a, String b) { + env.put(a, b); + return this; + } + // Specifies a Java system property. Can be called multiple times. + public Proc prop(String a, String b) { + prop.put(a, b); + return this; + } + // Adds a perm to policy. Can be called multiple times. In order to make it + // effective, please also call prop("java.security.manager", ""). + public Proc perm(Permission p) { + perms.add(p); + return this; + } + // Starts the proc + public Proc start() throws IOException { + List cmd = new ArrayList<>(); + if (launcher != null) { + cmd.add(launcher); + } else { + cmd.add(new File(new File(System.getProperty("java.home"), "bin"), + "java").getPath()); + } + cmd.add("-cp"); + StringBuilder cp = new StringBuilder(); + for (URL url: ((URLClassLoader)Proc.class.getClassLoader()).getURLs()) { + if (cp.length() != 0) { + cp.append(File.pathSeparatorChar); + } + cp.append(url.getFile()); + } + cmd.add(cp.toString()); + for (Entry e: prop.entrySet()) { + cmd.add("-D" + e.getKey() + "=" + e.getValue()); + } + if (!perms.isEmpty()) { + Path p = Files.createTempFile( + Paths.get(".").toAbsolutePath(), "policy", null); + StringBuilder sb = new StringBuilder(); + sb.append("grant {\n"); + for (Permission perm: perms) { + // Sometimes a permission has no name or actions. + // but it's safe to use an empty string. + String s = String.format("%s \"%s\", \"%s\"", + perm.getClass().getCanonicalName(), + perm.getName() + .replace("\\", "\\\\").replace("\"", "\\\""), + perm.getActions()); + sb.append(" permission ").append(s).append(";\n"); + } + sb.append("};\n"); + Files.write(p, sb.toString().getBytes()); + cmd.add("-Djava.security.policy=" + p.toString()); + } + cmd.add(clazz); + for (String s: args) { + cmd.add(s); + } + if (debug != null) { + System.out.println("PROC: " + debug + " cmdline: " + cmd); + } + ProcessBuilder pb = new ProcessBuilder(cmd); + for (Entry e: env.entrySet()) { + pb.environment().put(e.getKey(), e.getValue()); + } + if (inheritIO) { + pb.inheritIO(); + } else if (noDump) { + pb.redirectError(ProcessBuilder.Redirect.INHERIT); + } else { + pb.redirectError(ProcessBuilder.Redirect.appendTo(new File(DFILE))); + } + p = pb.start(); + br = new BufferedReader(new InputStreamReader(p.getInputStream())); + return this; + } + // Reads a line from stdout of proc + public String readLine() throws IOException { + String s = br.readLine(); + if (debug != null) { + System.out.println("PROC: " + debug + " readline: " + + (s == null ? "" : s)); + } + return s; + } + // Reads a special line from stdout of proc + public String readData() throws Exception { + while (true) { + String s = readLine(); + if (s == null) { + if (p.waitFor() != 0) { + throw new Exception("Proc abnormal end"); + } else { + return s; + } + } + if (s.startsWith(PREFIX)) { + return s.substring(PREFIX.length()); + } + } + } + // Writes text into stdin of proc + public void println(String s) throws IOException { + if (debug != null) { + System.out.println("PROC: " + debug + " println: " + s); + } + write((s + "\n").getBytes()); + } + // Writes data into stdin of proc + public void write(byte[] b) throws IOException { + p.getOutputStream().write(b); + p.getOutputStream().flush(); + } + // Reads all output and wait for process end + public int waitFor() throws Exception { + while (true) { + String s = readLine(); + if (s == null) { + break; + } + } + return p.waitFor(); + } + + // The following methods are used inside a proc + + // Writes out a BASE64 binary with a prefix + public static void binOut(byte[] data) { + System.out.println(PREFIX + Base64.getEncoder().encodeToString(data)); + } + // Reads in a line of BASE64 binary + public static byte[] binIn() throws Exception { + return Base64.getDecoder().decode(textIn()); + } + // Writes out a text with a prefix + public static void textOut(String data) { + System.out.println(PREFIX + data); + } + // Reads in a line of text + public static String textIn() throws Exception { + StringBuilder sb = new StringBuilder(); + boolean isEmpty = true; + while (true) { + int i = System.in.read(); + if (i == -1) break; + isEmpty = false; + if (i == '\n') break; + if (i != 13) { + // Force it to a char, so only simple ASCII works. + sb.append((char)i); + } + } + return isEmpty ? null : sb.toString(); + } + // Sends string to stderr. If inheritIO is not called, they will + // be collected into DFILE + public static void d(String s) throws IOException { + System.err.println(s); + } + // Sends an exception to stderr + public static void d(Throwable e) throws IOException { + e.printStackTrace(); + } +} diff --git a/jdk/test/java/text/Format/DateFormat/Bug7177315.java b/jdk/test/java/text/Format/DateFormat/Bug7177315.java new file mode 100644 index 00000000000..6fd6fc14b88 --- /dev/null +++ b/jdk/test/java/text/Format/DateFormat/Bug7177315.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7177315 + * @summary Make sure that space characters are properly skipped when + * parsing 2-digit year values. + */ + +import java.text.*; +import java.util.*; + +public class Bug7177315 { + private static final String EXPECTED = "01/01/2012"; + private static final String[] DATA = { + "01/01/12", + "01/01/ 12", + "01/01/ 12", + "1/1/12", + "1/1/ 12" + }; + + public static void main (String[] args) throws ParseException { + SimpleDateFormat parseFormat = new SimpleDateFormat("MM/dd/yy", Locale.US); + Calendar cal = new GregorianCalendar(2012-80, Calendar.JANUARY, 1); + parseFormat.set2DigitYearStart(cal.getTime()); + SimpleDateFormat fmtFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.US); + + for (String text : DATA) { + Date date = parseFormat.parse(text); + String got = fmtFormat.format(date); + if (!EXPECTED.equals(got)) { + throw new RuntimeException("got: " + got + ", expected: " + EXPECTED); + } + } + } +} diff --git a/jdk/test/java/text/Format/DateFormat/WeekDateTest.java b/jdk/test/java/text/Format/DateFormat/WeekDateTest.java index d7908d913e4..f38336be690 100644 --- a/jdk/test/java/text/Format/DateFormat/WeekDateTest.java +++ b/jdk/test/java/text/Format/DateFormat/WeekDateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,8 +32,8 @@ import java.util.*; import static java.util.GregorianCalendar.*; public class WeekDateTest { - static SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyy-MM-dd"); - static SimpleDateFormat ywdFormat = new SimpleDateFormat("YYYY-'W'ww-u"); + static SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US); + static SimpleDateFormat ywdFormat = new SimpleDateFormat("YYYY-'W'ww-u", Locale.US); static { ymdFormat.setCalendar(newCalendar()); ywdFormat.setCalendar(newCalendar()); diff --git a/jdk/test/java/util/Arrays/ParallelPrefix.java b/jdk/test/java/util/Arrays/ParallelPrefix.java new file mode 100644 index 00000000000..072de79c42c --- /dev/null +++ b/jdk/test/java/util/Arrays/ParallelPrefix.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 unit test for Arrays.ParallelPrefix(). + * @author Tristan Yan + * @run testng ParallelPrefix + */ + +import java.util.Arrays; +import java.util.function.BinaryOperator; +import java.util.function.DoubleBinaryOperator; +import java.util.function.Function; +import java.util.function.IntBinaryOperator; +import java.util.function.LongBinaryOperator; +import java.util.stream.IntStream; +import java.util.stream.LongStream; +import static org.testng.Assert.*; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class ParallelPrefix { + //Array size less than MIN_PARTITION + private final static int SMALL_ARRAY_SIZE = 1 << 3; + + //Array size equals MIN_PARTITION + private final static int THRESHOLD_ARRAY_SIZE = 1 << 4; + + //Array size greater than MIN_PARTITION + private final static int MEDIUM_ARRAY_SIZE = 1 << 8; + + //Array size much greater than MIN_PARTITION + private final static int LARGE_ARRAY_SIZE = 1 << 12; + + private final static int[] ARRAY_SIZE_COLLECTION = new int[]{ + SMALL_ARRAY_SIZE, THRESHOLD_ARRAY_SIZE,MEDIUM_ARRAY_SIZE, LARGE_ARRAY_SIZE}; + + @DataProvider + public static Object[][] intSet(){ + return genericData(size -> IntStream.range(0, size).toArray(), new IntBinaryOperator[]{Integer::sum, Integer::min}); + } + + @DataProvider + public static Object[][] longSet(){ + return genericData(size -> LongStream.range(0, size).toArray(), new LongBinaryOperator[]{Long::sum, Long::min}); + } + + @DataProvider + public static Object[][] doubleSet(){ + return genericData(size -> IntStream.range(0, size).mapToDouble(i -> (double)i).toArray(), + new DoubleBinaryOperator[]{Double::sum, Double::min}); + } + + @DataProvider + public static Object[][] stringSet(){ + Function stringsFunc = size -> + IntStream.range(0, size).mapToObj(Integer::toString).toArray(String[]::new); + BinaryOperator cancatBop = String::concat; + return genericData(stringsFunc, new BinaryOperator[]{cancatBop}); + } + + private static Object[][] genericData(Function generateFunc, OPS[] ops) { + //test arrays which size is equals n-1, n, n+1, test random data + Object[][] data = new Object[ARRAY_SIZE_COLLECTION.length * 3 * ops.length][4]; + for(int n = 0; n < ARRAY_SIZE_COLLECTION.length; n++ ) { + for(int testValue = -1 ; testValue <= 1; testValue++) { + int array_size = ARRAY_SIZE_COLLECTION[n] + testValue; + for(int opsN = 0; opsN < ops.length; opsN++) { + int index = n * 3 * ops.length + (testValue + 1) * ops.length + opsN; + data[index][0] = generateFunc.apply(array_size); + data[index][1] = array_size / 3; + data[index][2] = 2 * array_size / 3; + data[index][3] = ops[opsN]; + } + } + } + return data; + } + + @Test(dataProvider="intSet") + public void testParallelPrefixForInt(int[] data, int fromIndex, int toIndex, IntBinaryOperator op) { + int[] sequentialResult = data.clone(); + for (int index = fromIndex + 1; index < toIndex; index++) { + sequentialResult[index ] = op.applyAsInt(sequentialResult[index - 1], sequentialResult[index]); + } + + int[] parallelResult = data.clone(); + Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op); + assertEquals(parallelResult, sequentialResult); + + int[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex); + Arrays.parallelPrefix(parallelRangeResult, op); + assertEquals(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex)); + } + + @Test(dataProvider="longSet") + public void testParallelPrefixForLong(long[] data, int fromIndex, int toIndex, LongBinaryOperator op) { + long[] sequentialResult = data.clone(); + for (int index = fromIndex + 1; index < toIndex; index++) { + sequentialResult[index ] = op.applyAsLong(sequentialResult[index - 1], sequentialResult[index]); + } + + long[] parallelResult = data.clone(); + Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op); + assertEquals(parallelResult, sequentialResult); + + long[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex); + Arrays.parallelPrefix(parallelRangeResult, op); + assertEquals(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex)); + } + + @Test(dataProvider="doubleSet") + public void testParallelPrefixForDouble(double[] data, int fromIndex, int toIndex, DoubleBinaryOperator op) { + double[] sequentialResult = data.clone(); + for (int index = fromIndex + 1; index < toIndex; index++) { + sequentialResult[index ] = op.applyAsDouble(sequentialResult[index - 1], sequentialResult[index]); + } + + double[] parallelResult = data.clone(); + Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op); + assertEquals(parallelResult, sequentialResult); + + double[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex); + Arrays.parallelPrefix(parallelRangeResult, op); + assertEquals(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex)); + } + + @Test(dataProvider="stringSet") + public void testParallelPrefixForStringr(String[] data , int fromIndex, int toIndex, BinaryOperator op) { + String[] sequentialResult = data.clone(); + for (int index = fromIndex + 1; index < toIndex; index++) { + sequentialResult[index ] = op.apply(sequentialResult[index - 1], sequentialResult[index]); + } + + String[] parallelResult = data.clone(); + Arrays.parallelPrefix(parallelResult, fromIndex, toIndex, op); + assertEquals(parallelResult, sequentialResult); + + String[] parallelRangeResult = Arrays.copyOfRange(data, fromIndex, toIndex); + Arrays.parallelPrefix(parallelRangeResult, op); + assertEquals(parallelRangeResult, Arrays.copyOfRange(sequentialResult, fromIndex, toIndex)); + } +} + diff --git a/jdk/test/java/util/BitSet/BitSetStreamTest.java b/jdk/test/java/util/BitSet/BitSetStreamTest.java index a7fae5c9421..394f3ac3337 100644 --- a/jdk/test/java/util/BitSet/BitSetStreamTest.java +++ b/jdk/test/java/util/BitSet/BitSetStreamTest.java @@ -65,10 +65,10 @@ public class BitSetStreamTest { { "index 0", IntStream.of(0) }, { "index 255", IntStream.of(255) }, { "every bit", IntStream.range(0, 255) }, - { "step 2", IntStream.range(0, 255, 2) }, - { "step 3", IntStream.range(0, 255, 3) }, - { "step 5", IntStream.range(0, 255, 5) }, - { "step 7", IntStream.range(0, 255, 7) }, + { "step 2", IntStream.range(0, 255).map(f -> f * 2) }, + { "step 3", IntStream.range(0, 255).map(f -> f * 3) }, + { "step 5", IntStream.range(0, 255).map(f -> f * 5) }, + { "step 7", IntStream.range(0, 255).map(f -> f * 7) }, { "1, 10, 100, 1000", IntStream.of(1, 10, 100, 1000) }, { "25 fibs", IntStream.generate(new Fibs()).limit(25) } }; diff --git a/jdk/test/java/util/Collection/ListDefaults.java b/jdk/test/java/util/Collection/ListDefaults.java index 6011fbf7804..e0f8e6f6992 100644 --- a/jdk/test/java/util/Collection/ListDefaults.java +++ b/jdk/test/java/util/Collection/ListDefaults.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; -import java.util.Comparators; import java.util.List; import java.util.LinkedList; import java.util.Stack; @@ -337,23 +336,23 @@ public class ListDefaults { CollectionSupplier.shuffle(list); list.sort(null); - CollectionAsserts.assertSorted(list, Comparators.naturalOrder()); + CollectionAsserts.assertSorted(list, Comparator.naturalOrder()); if (test.name.startsWith("reverse")) { Collections.reverse(list); } CollectionAsserts.assertContents(list, original); CollectionSupplier.shuffle(list); - list.sort(Comparators.naturalOrder()); - CollectionAsserts.assertSorted(list, Comparators.naturalOrder()); + list.sort(Comparator.naturalOrder()); + CollectionAsserts.assertSorted(list, Comparator.naturalOrder()); if (test.name.startsWith("reverse")) { Collections.reverse(list); } CollectionAsserts.assertContents(list, original); CollectionSupplier.shuffle(list); - list.sort(Comparators.reverseOrder()); - CollectionAsserts.assertSorted(list, Comparators.reverseOrder()); + list.sort(Comparator.reverseOrder()); + CollectionAsserts.assertSorted(list, Comparator.reverseOrder()); if (!test.name.startsWith("reverse")) { Collections.reverse(list); } @@ -390,8 +389,8 @@ public class ListDefaults { final List copy = new ArrayList<>(list); final List subList = list.subList(SUBLIST_FROM, SUBLIST_TO); CollectionSupplier.shuffle(subList); - subList.sort(Comparators.naturalOrder()); - CollectionAsserts.assertSorted(subList, Comparators.naturalOrder()); + subList.sort(Comparator.naturalOrder()); + CollectionAsserts.assertSorted(subList, Comparator.naturalOrder()); // verify that elements [0, from) remain unmodified for (int i = 0; i < SUBLIST_FROM; i++) { assertTrue(list.get(i) == copy.get(i), @@ -412,8 +411,8 @@ public class ListDefaults { public void call(final List list) { final List copy = new ArrayList<>(list); CollectionSupplier.shuffle(list); - list.sort(Comparators.naturalOrder()); - CollectionAsserts.assertSorted(list, Comparators.naturalOrder()); + list.sort(Comparator.naturalOrder()); + CollectionAsserts.assertSorted(list, Comparator.naturalOrder()); } }); } diff --git a/jdk/test/java/util/Comparators/BasicTest.java b/jdk/test/java/util/Comparator/BasicTest.java similarity index 55% rename from jdk/test/java/util/Comparators/BasicTest.java rename to jdk/test/java/util/Comparator/BasicTest.java index 0913eb84b58..5bbb700e0b3 100644 --- a/jdk/test/java/util/Comparators/BasicTest.java +++ b/jdk/test/java/util/Comparator/BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,19 +21,16 @@ * questions. */ -/* +/** * @test - * @bug 8001667 8010279 + * @summary Comparator default method tests * @run testng BasicTest */ +import java.util.TreeMap; import java.util.Comparator; -import java.util.Comparators; -import java.util.AbstractMap; -import java.util.Map; import org.testng.annotations.Test; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.ToIntFunction; import java.util.function.ToLongFunction; @@ -41,12 +38,8 @@ import java.util.function.ToDoubleFunction; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertSame; import static org.testng.Assert.fail; -/** - * Unit tests for helper methods in Comparators - */ @Test(groups = "unit") public class BasicTest { private static class Thing { @@ -97,7 +90,7 @@ public class BasicTest { Thing[] things = new Thing[intValues.length]; for (int i=0; i comp = Comparators.comparing(new ToIntFunction() { + Comparator comp = Comparator.comparing(new ToIntFunction() { @Override public int applyAsInt(Thing thing) { return thing.getIntField(); @@ -111,7 +104,7 @@ public class BasicTest { Thing[] things = new Thing[longValues.length]; for (int i=0; i comp = Comparators.comparing(new ToLongFunction() { + Comparator comp = Comparator.comparing(new ToLongFunction() { @Override public long applyAsLong(Thing thing) { return thing.getLongField(); @@ -125,7 +118,7 @@ public class BasicTest { Thing[] things = new Thing[doubleValues.length]; for (int i=0; i comp = Comparators.comparing(new ToDoubleFunction() { + Comparator comp = Comparator.comparing(new ToDoubleFunction() { @Override public double applyAsDouble(Thing thing) { return thing.getDoubleField(); @@ -139,7 +132,7 @@ public class BasicTest { Thing[] things = new Thing[doubleValues.length]; for (int i=0; i comp = Comparators.comparing(new Function() { + Comparator comp = Comparator.comparing(new Function() { @Override public String apply(Thing thing) { return thing.getStringField(); @@ -150,16 +143,16 @@ public class BasicTest { } public void testNaturalOrderComparator() { - Comparator comp = Comparators.naturalOrder(); + Comparator comp = Comparator.naturalOrder(); assertComparisons(stringValues, comp, comparisons); } public void testReverseComparator() { - Comparator cmpr = Comparators.reverseOrder(); - Comparator cmp = cmpr.reverseOrder(); + Comparator cmpr = Comparator.reverseOrder(); + Comparator cmp = cmpr.reversed(); - assertEquals(cmp.reverseOrder(), cmpr); + assertEquals(cmp.reversed(), cmpr); assertEquals(0, cmp.compare("a", "a")); assertEquals(0, cmpr.compare("a", "a")); assertTrue(cmp.compare("a", "b") < 0); @@ -170,9 +163,9 @@ public class BasicTest { public void testReverseComparator2() { Comparator cmp = (s1, s2) -> s1.length() - s2.length(); - Comparator cmpr = cmp.reverseOrder(); + Comparator cmpr = cmp.reversed(); - assertEquals(cmpr.reverseOrder(), cmp); + assertEquals(cmpr.reversed(), cmp); assertEquals(0, cmp.compare("abc", "def")); assertEquals(0, cmpr.compare("abc", "def")); assertTrue(cmp.compare("abcd", "def") > 0); @@ -181,71 +174,11 @@ public class BasicTest { assertTrue(cmpr.compare("abc", "defg") > 0); } - @Test(expectedExceptions=NullPointerException.class) - public void testReverseComparatorNPE() { - Comparator cmp = Comparators.reverseOrder(null); - } - - public void testComposeComparator() { - // Longer string in front - Comparator first = (s1, s2) -> s2.length() - s1.length(); - Comparator second = Comparators.naturalOrder(); - Comparator composed = Comparators.compose(first, second); - - assertTrue(composed.compare("abcdefg", "abcdef") < 0); - assertTrue(composed.compare("abcdef", "abcdefg") > 0); - assertTrue(composed.compare("abcdef", "abcdef") == 0); - assertTrue(composed.compare("abcdef", "ghijkl") < 0); - assertTrue(composed.compare("ghijkl", "abcdefg") > 0); - } - - private void assertPairComparison(K k1, V v1, K k2, V v2, - Comparator> ck, - Comparator> cv) { - final Map.Entry p11 = new AbstractMap.SimpleImmutableEntry<>(k1, v1); - final Map.Entry p12 = new AbstractMap.SimpleImmutableEntry<>(k1, v2); - final Map.Entry p21 = new AbstractMap.SimpleImmutableEntry<>(k2, v1); - final Map.Entry p22 = new AbstractMap.SimpleImmutableEntry<>(k2, v2); - - assertTrue(ck.compare(p11, p11) == 0); - assertTrue(ck.compare(p12, p11) == 0); - assertTrue(ck.compare(p11, p12) == 0); - assertTrue(ck.compare(p12, p22) < 0); - assertTrue(ck.compare(p12, p21) < 0); - assertTrue(ck.compare(p21, p11) > 0); - assertTrue(ck.compare(p21, p12) > 0); - - assertTrue(cv.compare(p11, p11) == 0); - assertTrue(cv.compare(p12, p11) > 0); - assertTrue(cv.compare(p11, p12) < 0); - assertTrue(cv.compare(p12, p22) == 0); - assertTrue(cv.compare(p12, p21) > 0); - assertTrue(cv.compare(p21, p11) == 0); - assertTrue(cv.compare(p21, p12) < 0); - - Comparator> cmp = Comparators.compose(ck, cv); - assertTrue(cmp.compare(p11, p11) == 0); - assertTrue(cmp.compare(p12, p11) > 0); - assertTrue(cmp.compare(p11, p12) < 0); - assertTrue(cmp.compare(p12, p22) < 0); - assertTrue(cmp.compare(p12, p21) < 0); - assertTrue(cmp.compare(p21, p11) > 0); - assertTrue(cmp.compare(p21, p12) > 0); - - cmp = Comparators.compose(cv, ck); - assertTrue(cmp.compare(p11, p11) == 0); - assertTrue(cmp.compare(p12, p11) > 0); - assertTrue(cmp.compare(p11, p12) < 0); - assertTrue(cmp.compare(p12, p22) < 0); - assertTrue(cmp.compare(p12, p21) > 0); - assertTrue(cmp.compare(p21, p11) > 0); - assertTrue(cmp.compare(p21, p12) < 0); - } - - public void testKVComparatorable() { - assertPairComparison(1, "ABC", 2, "XYZ", - Comparators.naturalOrderKeys(), - Comparators.naturalOrderValues()); + private void assertComparison(Comparator cmp, T less, T greater) { + assertTrue(cmp.compare(less, greater) < 0, "less"); + assertTrue(cmp.compare(less, less) == 0, "equal"); + assertTrue(cmp.compare(greater, greater) == 0, "equal"); + assertTrue(cmp.compare(greater, less) > 0, "greater"); } private static class People { @@ -273,33 +206,15 @@ public class BasicTest { new People("Jonah", "Doe", 10), new People("John", "Cook", 54), new People("Mary", "Cook", 50), + new People("Mary", null, 25), + new People("John", null, 27) }; - public void testKVComparators() { - // Comparator cmp = Comparators.naturalOrder(); // Should fail to compiler as People is not comparable - // We can use simple comparator, but those have been tested above. - // Thus choose to do compose for some level of interation. - Comparator cmp1 = Comparators.comparing((Function) People::getFirstName); - Comparator cmp2 = Comparators.comparing((Function) People::getLastName); - Comparator cmp = Comparators.compose(cmp1, cmp2); - - assertPairComparison(people[0], people[0], people[1], people[1], - Comparators.byKey(cmp), - Comparators.byValue(cmp)); - - } - - private void assertComparison(Comparator cmp, T less, T greater) { - assertTrue(cmp.compare(less, greater) < 0, "less"); - assertTrue(cmp.compare(less, less) == 0, "equal"); - assertTrue(cmp.compare(greater, less) > 0, "greater"); - } - public void testComparatorDefaultMethods() { - Comparator cmp = Comparators.comparing((Function) People::getFirstName); - Comparator cmp2 = Comparators.comparing((Function) People::getLastName); + Comparator cmp = Comparator.comparing((Function) People::getFirstName); + Comparator cmp2 = Comparator.comparing((Function) People::getLastName); // reverseOrder - assertComparison(cmp.reverseOrder(), people[1], people[0]); + assertComparison(cmp.reversed(), people[1], people[0]); // thenComparing(Comparator) assertComparison(cmp.thenComparing(cmp2), people[0], people[1]); assertComparison(cmp.thenComparing(cmp2), people[4], people[0]); @@ -317,96 +232,138 @@ public class BasicTest { assertComparison(cmp.thenComparing(People::getAgeAsDouble), people[1], people[5]); } - public void testGreaterOf() { - // lesser - assertSame(Comparators.greaterOf(Comparators.comparing( - (Function) People::getFirstName)) - .apply(people[0], people[1]), - people[1]); - // euqal - assertSame(Comparators.greaterOf(Comparators.comparing( - (Function) People::getLastName)) - .apply(people[0], people[1]), - people[0]); - // greater - assertSame(Comparators.greaterOf(Comparators.comparing( - (ToIntFunction) People::getAge)) - .apply(people[0], people[1]), - people[0]); + + public void testNullsFirst() { + Comparator strcmp = Comparator.nullsFirst(Comparator.naturalOrder()); + Comparator cmp = Comparator.comparing(People::getLastName, strcmp) + .thenComparing(People::getFirstName, strcmp); + // Mary.null vs Mary.Cook - solve by last name + assertComparison(cmp, people[6], people[5]); + // John.null vs Mary.null - solve by first name + assertComparison(cmp, people[7], people[6]); + + // More than one thenComparing + strcmp = Comparator.nullsFirst(Comparator.comparing((ToIntFunction) String::length) + .thenComparing(String.CASE_INSENSITIVE_ORDER)); + assertComparison(strcmp, null, "abc"); + assertComparison(strcmp, "ab", "abc"); + assertComparison(strcmp, "abc", "def"); + assertEquals(0, strcmp.compare("abc", "ABC")); + + // Ensure reverse still handle null properly + Comparator strcmp2 = strcmp.reversed().thenComparing(Comparator.naturalOrder()); + assertComparison(strcmp2, "abc", null); + assertComparison(strcmp2, "abc", "ab"); + assertComparison(strcmp2, "def", "abc"); + assertComparison(strcmp2, "ABC", "abc"); + + // Considering non-null values to be equal + Comparator blind = Comparator.nullsFirst(null); + assertComparison(blind, null, "abc"); + assertEquals(0, blind.compare("abc", "def")); + // reverse still consider non-null values to be equal + strcmp = blind.reversed(); + assertComparison(strcmp, "abc", null); + assertEquals(0, strcmp.compare("abc", "def")); + // chain with another comparator to compare non-nulls + strcmp = blind.thenComparing(Comparator.naturalOrder()); + assertComparison(strcmp, null, "abc"); + assertComparison(strcmp, "abc", "def"); } - public void testLesserOf() { - // lesser - assertSame(Comparators.lesserOf(Comparators.comparing( - (Function) People::getFirstName)) - .apply(people[0], people[1]), - people[0]); - // euqal - assertSame(Comparators.lesserOf(Comparators.comparing( - (Function) People::getLastName)) - .apply(people[0], people[1]), - people[0]); - // greater - assertSame(Comparators.lesserOf(Comparators.comparing( - (ToIntFunction) People::getAge)) - .apply(people[0], people[1]), - people[1]); + public void testNullsLast() { + Comparator strcmp = Comparator.nullsLast(Comparator.naturalOrder()); + Comparator cmp = Comparator.comparing(People::getLastName, strcmp) + .thenComparing(People::getFirstName, strcmp); + // Mary.null vs Mary.Cook - solve by last name + assertComparison(cmp, people[5], people[6]); + // John.null vs Mary.null - solve by first name + assertComparison(cmp, people[7], people[6]); + + // More than one thenComparing + strcmp = Comparator.nullsLast(Comparator.comparing((ToIntFunction) String::length) + .thenComparing(String.CASE_INSENSITIVE_ORDER)); + assertComparison(strcmp, "abc", null); + assertComparison(strcmp, "ab", "abc"); + assertComparison(strcmp, "abc", "def"); + + // Ensure reverse still handle null properly + Comparator strcmp2 = strcmp.reversed().thenComparing(Comparator.naturalOrder()); + assertComparison(strcmp2, null, "abc"); + assertComparison(strcmp2, "abc", "ab"); + assertComparison(strcmp2, "def", "abc"); + assertComparison(strcmp2, "ABC", "abc"); + + // Considering non-null values to be equal + Comparator blind = Comparator.nullsLast(null); + assertComparison(blind, "abc", null); + assertEquals(0, blind.compare("abc", "def")); + // reverse still consider non-null values to be equal + strcmp = blind.reversed(); + assertComparison(strcmp, null, "abc"); + assertEquals(0, strcmp.compare("abc", "def")); + // chain with another comparator to compare non-nulls + strcmp = blind.thenComparing(Comparator.naturalOrder()); + assertComparison(strcmp, "abc", null); + assertComparison(strcmp, "abc", "def"); + } + + public void testComposeComparator() { + // Longer string in front + Comparator first = (s1, s2) -> s2.length() - s1.length(); + Comparator second = Comparator.naturalOrder(); + Comparator composed = first.thenComparing(second); + + assertTrue(composed.compare("abcdefg", "abcdef") < 0); + assertTrue(composed.compare("abcdef", "abcdefg") > 0); + assertTrue(composed.compare("abcdef", "abcdef") == 0); + assertTrue(composed.compare("abcdef", "ghijkl") < 0); + assertTrue(composed.compare("ghijkl", "abcdefg") > 0); } public void testNulls() { try { - Comparators.naturalOrder().compare("abc", (String) null); + Comparator.naturalOrder().compare("abc", (String) null); fail("expected NPE with naturalOrder"); } catch (NullPointerException npe) {} try { - Comparators.naturalOrder().compare((String) null, "abc"); + Comparator.naturalOrder().compare((String) null, "abc"); fail("expected NPE with naturalOrder"); } catch (NullPointerException npe) {} try { - Comparators.reverseOrder().compare("abc", (String) null); + Comparator.reverseOrder().compare("abc", (String) null); fail("expected NPE with naturalOrder"); } catch (NullPointerException npe) {} try { - Comparators.reverseOrder().compare((String) null, "abc"); + Comparator.reverseOrder().compare((String) null, "abc"); fail("expected NPE with naturalOrder"); } catch (NullPointerException npe) {} try { - Comparator> cmp = Comparators.byKey(null); - fail("byKey(null) should throw NPE"); + Comparator cmp = Comparator.comparing((Function) null, Comparator.naturalOrder()); + fail("comparing(null, cmp) should throw NPE"); + } catch (NullPointerException npe) {} + try { + Comparator cmp = Comparator.comparing((Function) People::getFirstName, null); + fail("comparing(f, null) should throw NPE"); } catch (NullPointerException npe) {} try { - Comparator> cmp = Comparators.byValue(null); - fail("byValue(null) should throw NPE"); - } catch (NullPointerException npe) {} - - try { - Comparator cmp = Comparators.comparing((Function) null); + Comparator cmp = Comparator.comparing((Function) null); fail("comparing(null) should throw NPE"); } catch (NullPointerException npe) {} try { - Comparator cmp = Comparators.comparing((ToIntFunction) null); + Comparator cmp = Comparator.comparing((ToIntFunction) null); fail("comparing(null) should throw NPE"); } catch (NullPointerException npe) {} try { - Comparator cmp = Comparators.comparing((ToLongFunction) null); + Comparator cmp = Comparator.comparing((ToLongFunction) null); fail("comparing(null) should throw NPE"); } catch (NullPointerException npe) {} try { - Comparator cmp = Comparators.comparing((ToDoubleFunction) null); + Comparator cmp = Comparator.comparing((ToDoubleFunction) null); fail("comparing(null) should throw NPE"); } catch (NullPointerException npe) {} - - try { - BinaryOperator op = Comparators.lesserOf(null); - fail("lesserOf(null) should throw NPE"); - } catch (NullPointerException npe) {} - - try { - BinaryOperator op = Comparators.greaterOf(null); - fail("lesserOf(null) should throw NPE"); - } catch (NullPointerException npe) {} } } diff --git a/jdk/test/java/util/Comparator/TypeTest.java b/jdk/test/java/util/Comparator/TypeTest.java new file mode 100644 index 00000000000..b1c8a41cf3a --- /dev/null +++ b/jdk/test/java/util/Comparator/TypeTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 Comparator API narrowing type test + * @run testng TypeTest + */ + +import java.util.function.Function; +import java.util.Map; +import java.util.TreeMap; +import java.util.Comparator; +import org.testng.annotations.Test; + +@Test(groups = "unit") +public class TypeTest { + static class Person { + String name; + static Comparator C = (p1, p2) -> p1.name.compareTo(p2.name); + + Person(String name) { + this.name = name; + } + + String getName() { return name; } + } + + static class Employee extends Person { + int id; + static Comparator C = (e1, e2) -> e1.id - e2.id; + + Employee(int id, String name) { + super(name); + this.id = id; + } + } + + static class Manager extends Employee { + long reports; + static Comparator C = (e1, e2) -> (int) (e1.reports - e2.reports); + + Manager(String name, int id, long reports) { + super(id, name); + this.reports = reports; + } + } + + static void assertOrder(T o1, T o2, Comparator cmp) { + if (cmp.compare(o1, o2) > 0) { + System.out.println("Fail!!"); + } + if (cmp.compare(o1, o2) == 0) { + System.out.println("Equal!!"); + } + } + + public static void main(String[] args) { + Manager m1 = new Manager("Manager", 2, 2000); + Manager m2 = new Manager("Manager", 4, 1300); + + // Comparator tmp = Person.C; + + // Comparator cmp = Employee.C.thenComparing(Person.C); + Comparator cmp = Employee.C.thenComparing(Person.C); + assertOrder(m1, m2, Employee.C.thenComparing(Person.C)); + assertOrder(m1, m2, cmp); + assertOrder(m1, new Employee(1, "Z"), Person.C); + assertOrder(new Employee(1, "Z"), m2, Employee.C); + + assertOrder(m1, m2, Comparator.comparing(Employee::getName, String.CASE_INSENSITIVE_ORDER)); + + Map map = new TreeMap<>(); + map.entrySet().stream().sorted(Map.Entry.comparingByKey(String.CASE_INSENSITIVE_ORDER)); + } +} diff --git a/jdk/test/java/util/Currency/PropertiesTest.sh b/jdk/test/java/util/Currency/PropertiesTest.sh index 6c16851062e..65ab89da2e0 100644 --- a/jdk/test/java/util/Currency/PropertiesTest.sh +++ b/jdk/test/java/util/Currency/PropertiesTest.sh @@ -23,7 +23,7 @@ # # @test -# @bug 6332666 7180362 8003846 +# @bug 6332666 6863624 7180362 8003846 # @summary tests the capability of replacing the currency data with user # specified currency properties file # @build PropertiesTest @@ -56,10 +56,15 @@ case "$OS" in PS=":" FS="/" ;; - Windows* | CYGWIN* ) + Windows* ) PS=";" FS="/" ;; + CYGWIN* ) + PS=";" + FS="/" + TESTJAVA=`cygpath -u ${TESTJAVA}` + ;; * ) echo "Unrecognized system!" exit 1; @@ -92,24 +97,27 @@ run PropertiesTest -c dump1 dump2 ${PROPS} # Dump built-in currency data + overrides in properties file copied into # JRE image. -# copy the test properties file +# Copy the test properties file. If testjava is not a typical jdk-image +# or testjava is not writable, make a private copy of it. COPIED=0 -if [ -w $TESTJAVA ] +if [ -w ${TESTJAVA}${FS}jre${FS}lib ] then WRITABLEJDK=$TESTJAVA -else - WRITABLEJDK=.${FS}testjava - cp -r $TESTJAVA $WRITABLEJDK - COPIED=1 -fi - -if [ -d ${WRITABLEJDK}${FS}jre ] -then PROPLOCATION=${WRITABLEJDK}${FS}jre${FS}lib else - PROPLOCATION=${WRITABLEJDK}${FS}lib + WRITABLEJDK=.${FS}testjava + if [ -d ${TESTJAVA}${FS}jre ] + then + PROPLOCATION=${WRITABLEJDK}${FS}jre${FS}lib + else + PROPLOCATION=${WRITABLEJDK}${FS}lib + fi + cp -r $TESTJAVA $WRITABLEJDK + chmod -R +w $WRITABLEJDK + COPIED=1 fi cp ${PROPS} $PROPLOCATION +echo "Properties location: ${PROPLOCATION}" # run echo '' diff --git a/jdk/test/java/util/Formatter/Basic-X.java.template b/jdk/test/java/util/Formatter/Basic-X.java.template index 831c49212f0..a2d586a8958 100644 --- a/jdk/test/java/util/Formatter/Basic-X.java.template +++ b/jdk/test/java/util/Formatter/Basic-X.java.template @@ -1177,6 +1177,13 @@ public class Basic$Type$ extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Formatter/Basic.java b/jdk/test/java/util/Formatter/Basic.java index 7afed1d5b4d..79123a19bca 100644 --- a/jdk/test/java/util/Formatter/Basic.java +++ b/jdk/test/java/util/Formatter/Basic.java @@ -25,7 +25,7 @@ * @summary Unit test for formatter * @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937 * 5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122 - * 6344623 6369500 6534606 6282094 6286592 6476425 5063507 + * 6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 * * @run shell/timeout=240 Basic.sh */ diff --git a/jdk/test/java/util/Formatter/BasicBigDecimal.java b/jdk/test/java/util/Formatter/BasicBigDecimal.java index 6f36201aa34..9549441da87 100644 --- a/jdk/test/java/util/Formatter/BasicBigDecimal.java +++ b/jdk/test/java/util/Formatter/BasicBigDecimal.java @@ -1177,6 +1177,13 @@ public class BasicBigDecimal extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Formatter/BasicDouble.java b/jdk/test/java/util/Formatter/BasicDouble.java index d33eb4d6c5f..4c86c29c198 100644 --- a/jdk/test/java/util/Formatter/BasicDouble.java +++ b/jdk/test/java/util/Formatter/BasicDouble.java @@ -1113,6 +1113,15 @@ public class BasicDouble extends Basic { + + + + + + + + + @@ -1168,6 +1177,13 @@ public class BasicDouble extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Formatter/BasicDoubleObject.java b/jdk/test/java/util/Formatter/BasicDoubleObject.java index 63cec1afe6a..674bf2beffd 100644 --- a/jdk/test/java/util/Formatter/BasicDoubleObject.java +++ b/jdk/test/java/util/Formatter/BasicDoubleObject.java @@ -1113,6 +1113,15 @@ public class BasicDoubleObject extends Basic { + + + + + + + + + @@ -1168,6 +1177,13 @@ public class BasicDoubleObject extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Formatter/BasicFloat.java b/jdk/test/java/util/Formatter/BasicFloat.java index d4e3d7434ca..7ed68c3eddd 100644 --- a/jdk/test/java/util/Formatter/BasicFloat.java +++ b/jdk/test/java/util/Formatter/BasicFloat.java @@ -1096,6 +1096,15 @@ public class BasicFloat extends Basic { + + + + + + + + + @@ -1168,6 +1177,13 @@ public class BasicFloat extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Formatter/BasicFloatObject.java b/jdk/test/java/util/Formatter/BasicFloatObject.java index e0deba7050e..db77cef27b3 100644 --- a/jdk/test/java/util/Formatter/BasicFloatObject.java +++ b/jdk/test/java/util/Formatter/BasicFloatObject.java @@ -1129,6 +1129,15 @@ public class BasicFloatObject extends Basic { + + + + + + + + + @@ -1168,6 +1177,13 @@ public class BasicFloatObject extends Basic { test("%.3G", "1.00E-05", recip(create(100000.0))); test("%.3G", "-1.00E-05", recip(create(-100000.0))); + test("%.1g", "-0", -0.0); + test("%3.0g", " -0", -0.0); + test("%.1g", "0", 0.0); + test("%3.0g", " 0", 0.0); + test("%.1g", "0", +0.0); + test("%3.0g", " 0", +0.0); + test("%3.0g", "1e-06", 0.000001); test("%3.0g", "1e-05", 0.00001); test("%3.0g", "1e-05", 0.0000099); diff --git a/jdk/test/java/util/Locale/LocaleProviders.java b/jdk/test/java/util/Locale/LocaleProviders.java index 30ad90a4bb7..811e78ff3ab 100644 --- a/jdk/test/java/util/Locale/LocaleProviders.java +++ b/jdk/test/java/util/Locale/LocaleProviders.java @@ -207,6 +207,7 @@ public class LocaleProviders { String jreResult = "\u5e73\u6210 16.11.03 (\u6c34) \u5348\u524d 11:53:47"; Locale l = new Locale("ja", "JP", "JP"); SimpleDateFormat sdf = new SimpleDateFormat("GGGG yyyy.MMM.dd '('E')' a hh:mm:ss", l); + sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); String result = sdf.format(sampleDate); System.out.println(result); if (LocaleProviderAdapter.getAdapterPreference() diff --git a/jdk/test/java/util/Locale/LocaleProviders.sh b/jdk/test/java/util/Locale/LocaleProviders.sh index 7c238caafe6..bf8b7af2b32 100644 --- a/jdk/test/java/util/Locale/LocaleProviders.sh +++ b/jdk/test/java/util/Locale/LocaleProviders.sh @@ -24,7 +24,7 @@ # # @test # @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8010666 -# 8013086 8013233 8013903 +# 8013086 8013233 8013903 8015960 # @summary tests for "java.locale.providers" system property # @compile -XDignore.symbol.file LocaleProviders.java # @run shell/timeout=600 LocaleProviders.sh diff --git a/jdk/test/java/util/Map/Defaults.java b/jdk/test/java/util/Map/Defaults.java index 92a2cb30b69..48a93525b7f 100644 --- a/jdk/test/java/util/Map/Defaults.java +++ b/jdk/test/java/util/Map/Defaults.java @@ -36,6 +36,7 @@ import java.util.Collection; import java.util.Collections; import java.util.EnumMap; import java.util.HashMap; +import java.util.HashSet; import java.util.Hashtable; import java.util.IdentityHashMap; import java.util.Iterator; @@ -47,6 +48,7 @@ import java.util.WeakHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; +import java.util.function.BiFunction; import java.util.function.Supplier; import org.testng.annotations.Test; @@ -60,14 +62,14 @@ import static org.testng.Assert.assertSame; public class Defaults { - @Test(dataProvider = "Nulls Map") + @Test(dataProvider = "Map rw=all keys=withNull values=withNull") public void testGetOrDefaultNulls(String description, Map map) { - assertTrue(map.containsKey(null), "null key absent"); - assertNull(map.get(null), "value not null"); - assertSame(map.get(null), map.getOrDefault(null, EXTRA_VALUE), "values should match"); + assertTrue(map.containsKey(null), description + ": null key absent"); + assertNull(map.get(null), description + ": value not null"); + assertSame(map.get(null), map.getOrDefault(null, EXTRA_VALUE), description + ": values should match"); } - @Test(dataProvider = "Map") + @Test(dataProvider = "Map rw=all keys=all values=all") public void testGetOrDefault(String description, Map map) { assertTrue(map.containsKey(KEYS[1]), "expected key missing"); assertSame(map.get(KEYS[1]), map.getOrDefault(KEYS[1], EXTRA_VALUE), "values should match"); @@ -76,7 +78,7 @@ public class Defaults { assertNull(map.getOrDefault(EXTRA_KEY, null), "null not returned as default"); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testPutIfAbsentNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -96,7 +98,7 @@ public class Defaults { assertSame(map.get(null), EXTRA_VALUE, "value not expected"); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testPutIfAbsent(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); @@ -109,7 +111,7 @@ public class Defaults { assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); } - @Test(dataProvider = "Nulls Map") + @Test(dataProvider = "Map rw=all keys=all values=all") public void testForEach(String description, Map map) { IntegerEnum[] EACH_KEY = new IntegerEnum[map.size()]; @@ -120,10 +122,43 @@ public class Defaults { assertSame(v, map.get(k)); }); - assertEquals(KEYS, EACH_KEY); + assertEquals(KEYS, EACH_KEY, description); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=all values=all") + public static void testReplaceAll(String description, Map map) { + IntegerEnum[] EACH_KEY = new IntegerEnum[map.size()]; + Set EACH_REPLACE = new HashSet<>(map.size()); + + map.replaceAll((k,v) -> { + int idx = (null == k) ? 0 : k.ordinal(); // substitute for index. + assertNull(EACH_KEY[idx]); + EACH_KEY[idx] = (idx == 0) ? KEYS[0] : k; // substitute for comparison. + assertSame(v, map.get(k)); + String replacement = v + " replaced"; + EACH_REPLACE.add(replacement); + return replacement; + }); + + assertEquals(KEYS, EACH_KEY, description); + assertEquals(map.values().size(), EACH_REPLACE.size(), description + EACH_REPLACE); + assertTrue(EACH_REPLACE.containsAll(map.values()), description + " : " + EACH_REPLACE + " != " + map.values()); + assertTrue(map.values().containsAll(EACH_REPLACE), description + " : " + EACH_REPLACE + " != " + map.values()); + } + + @Test(dataProvider = "Map rw=true keys=nonNull values=nonNull") + public static void testReplaceAllNoNullReplacement(String description, Map map) { + assertThrows( + () -> { map.replaceAll(null); }, + NullPointerException.class, + description); + assertThrows( + () -> { map.replaceAll((k,v) -> null); }, + NullPointerException.class, + description); + } + + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public static void testRemoveNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -136,7 +171,7 @@ public class Defaults { assertFalse(map.remove(null, null)); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public static void testRemove(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); @@ -151,7 +186,7 @@ public class Defaults { assertFalse(map.remove(EXTRA_KEY, EXTRA_VALUE)); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testReplaceKVNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -159,7 +194,7 @@ public class Defaults { assertSame(map.get(null), EXTRA_VALUE); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testReplaceKV(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); @@ -177,7 +212,7 @@ public class Defaults { assertSame(map.get(EXTRA_KEY), expected); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testReplaceKVVNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -189,7 +224,7 @@ public class Defaults { assertSame(map.get(null), EXTRA_VALUE); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testReplaceKVV(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); @@ -212,7 +247,7 @@ public class Defaults { assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testComputeIfAbsentNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -220,7 +255,7 @@ public class Defaults { assertSame(map.get(null), EXTRA_VALUE, description); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testComputeIfAbsent(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object expected = map.get(KEYS[1]); @@ -234,19 +269,26 @@ public class Defaults { assertSame(map.get(EXTRA_KEY), EXTRA_VALUE); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testComputeIfPresentNulls(String description, Map map) { - assertTrue(map.containsKey(null)); - assertNull(map.get(null)); + assertTrue(map.containsKey(null), description + ": null key absent"); + assertNull(map.get(null), description + ": value not null"); assertSame(map.computeIfPresent(null, (k, v) -> { - fail(); + fail(description + ": null value is not deemed present"); return EXTRA_VALUE; }), null, description); assertTrue(map.containsKey(null)); - assertSame(map.get(null), null, description); + assertNull(map.get(null), description); + assertNull(map.remove(EXTRA_KEY), description + ": unexpected mapping"); + assertNull(map.put(EXTRA_KEY, null), description + ": unexpected value"); + assertSame(map.computeIfPresent(EXTRA_KEY, (k, v) -> { + fail(description + ": null value is not deemed present"); + return EXTRA_VALUE; + }), null, description); + assertNull(map.get(EXTRA_KEY), description + ": null mapping gone"); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testComputeIfPresent(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object value = map.get(KEYS[1]); @@ -267,10 +309,16 @@ public class Defaults { assertSame(map.get(EXTRA_KEY), null); } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testComputeNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); + assertSame(map.compute(null, (k, v) -> { + assertNull(k); + assertNull(v); + return null; + }), null, description); + assertFalse(map.containsKey(null), description + ": null key present."); assertSame(map.compute(null, (k, v) -> { assertSame(k, null); assertNull(v); @@ -278,16 +326,50 @@ public class Defaults { }), EXTRA_VALUE, description); assertTrue(map.containsKey(null)); assertSame(map.get(null), EXTRA_VALUE, description); - assertSame(map.remove(null), EXTRA_VALUE, "removed value not expected"); - assertFalse(map.containsKey(null), "null key present"); + assertSame(map.remove(null), EXTRA_VALUE, description + ": removed value not expected"); + // no mapping before and after + assertFalse(map.containsKey(null), description + ": null key present"); assertSame(map.compute(null, (k, v) -> { - assertSame(k, null); + assertNull(k); + assertNull(v); + return null; + }), null, description + ": expected null result" ); + assertFalse(map.containsKey(null), description + ": null key present"); + // compute with map not containing value + assertNull(map.remove(EXTRA_KEY), description + ": unexpected mapping"); + assertFalse(map.containsKey(EXTRA_KEY), description + ": key present"); + assertSame(map.compute(EXTRA_KEY, (k, v) -> { + assertSame(k, EXTRA_KEY); assertNull(v); return null; }), null, description); + assertFalse(map.containsKey(EXTRA_KEY), description + ": null key present"); + // ensure removal. + assertNull(map.put(EXTRA_KEY, EXTRA_VALUE)); + assertSame(map.compute(EXTRA_KEY, (k, v) -> { + assertSame(k, EXTRA_KEY); + assertSame(v, EXTRA_VALUE); + return null; + }), null, description + ": null resulted expected"); + assertFalse(map.containsKey(EXTRA_KEY), description + ": null key present"); + // compute with map containing null value + assertNull(map.put(EXTRA_KEY, null), description + ": unexpected value"); + assertSame(map.compute(EXTRA_KEY, (k, v) -> { + assertSame(k, EXTRA_KEY); + assertNull(v); + return null; + }), null, description); + assertFalse(map.containsKey(EXTRA_KEY), description + ": null key present"); + assertNull(map.put(EXTRA_KEY, null), description + ": unexpected value"); + assertSame(map.compute(EXTRA_KEY, (k, v) -> { + assertSame(k, EXTRA_KEY); + assertNull(v); + return EXTRA_VALUE; + }), EXTRA_VALUE, description); + assertTrue(map.containsKey(EXTRA_KEY), "null key present"); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testCompute(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object value = map.get(KEYS[1]); @@ -314,7 +396,7 @@ public class Defaults { } - @Test(dataProvider = "R/W Nulls Map") + @Test(dataProvider = "Map rw=true keys=withNull values=withNull") public void testMergeNulls(String description, Map map) { assertTrue(map.containsKey(null), "null key absent"); assertNull(map.get(null), "value not null"); @@ -327,7 +409,7 @@ public class Defaults { assertSame(map.get(null), EXTRA_VALUE, description); } - @Test(dataProvider = "R/W Map") + @Test(dataProvider = "Map rw=true keys=all values=all") public void testMerge(String description, Map map) { assertTrue(map.containsKey(KEYS[1])); Object value = map.get(KEYS[1]); @@ -391,52 +473,58 @@ public class Defaults { private static final IntegerEnum EXTRA_KEY = IntegerEnum.EXTRA_KEY; private static final String EXTRA_VALUE = String.valueOf(TEST_SIZE); - @DataProvider(name = "Map", parallel = true) - public static Iterator allNullsMapProvider() { + @DataProvider(name = "Map rw=all keys=all values=all", parallel = true) + public static Iterator allMapProvider() { return makeAllMaps().iterator(); } - @DataProvider(name = "Nulls Map", parallel = true) - public static Iterator allMapProvider() { - return makeRWMaps(true).iterator(); + @DataProvider(name = "Map rw=all keys=withNull values=withNull", parallel = true) + public static Iterator allMapWithNullsProvider() { + return makeAllMapsWithNulls().iterator(); } - @DataProvider(name = "R/W Map", parallel = true) - public static Iterator rwMapProvider() { + @DataProvider(name = "Map rw=true keys=nonNull values=nonNull", parallel = true) + public static Iterator rwNonNullMapProvider() { + return makeRWNoNullsMaps().iterator(); + } + + @DataProvider(name = "Map rw=true keys=nonNull values=all", parallel = true) + public static Iterator rwNonNullKeysMapProvider() { return makeRWMapsNoNulls().iterator(); } - @DataProvider(name = "R/W Nulls Map", parallel = true) - public static Iterator rwNullsMapProvider() { - return makeRWMaps(true).iterator(); + @DataProvider(name = "Map rw=true keys=all values=all", parallel = true) + public static Iterator rwMapProvider() { + return makeAllRWMaps().iterator(); } - private static Collection makeAllMapsNoNulls() { + @DataProvider(name = "Map rw=true keys=withNull values=withNull", parallel = true) + public static Iterator rwNullsMapProvider() { + return makeAllRWMapsWithNulls().iterator(); + } + + private static Collection makeAllRWMapsWithNulls() { Collection all = new ArrayList<>(); - all.addAll(makeRWMaps(false)); - all.addAll(makeRWNoNullsMaps()); - all.addAll(makeROMaps(false)); + all.addAll(makeRWMaps(true, true)); return all; } + private static Collection makeRWMapsNoNulls() { Collection all = new ArrayList<>(); - all.addAll(makeRWMaps(false)); + all.addAll(makeRWNoNullKeysMaps(false)); all.addAll(makeRWNoNullsMaps()); return all; } - private static Collection makeAllMaps() { + private static Collection makeAllROMaps() { Collection all = new ArrayList<>(); all.addAll(makeROMaps(false)); - all.addAll(makeRWMaps(false)); - all.addAll(makeRWNoNullsMaps()); - all.addAll(makeRWMaps(true)); all.addAll(makeROMaps(true)); return all; @@ -445,52 +533,99 @@ public class Defaults { private static Collection makeAllRWMaps() { Collection all = new ArrayList<>(); - all.addAll(makeRWMaps(false)); all.addAll(makeRWNoNullsMaps()); - all.addAll(makeRWMaps(true)); + all.addAll(makeRWMaps(false,true)); + all.addAll(makeRWMaps(true,true)); + all.addAll(makeRWNoNullKeysMaps(true)); + return all; + } + + private static Collection makeAllMaps() { + Collection all = new ArrayList<>(); + + all.addAll(makeAllROMaps()); + all.addAll(makeAllRWMaps()); return all; } - private static Collection makeRWMaps(boolean nulls) { + private static Collection makeAllMapsWithNulls() { + Collection all = new ArrayList<>(); + + all.addAll(makeROMaps(true)); + all.addAll(makeRWMaps(true,true)); + + return all; + } + /** + * + * @param nullKeys include null keys + * @param nullValues include null values + * @return + */ + private static Collection makeRWMaps(boolean nullKeys, boolean nullValues) { return Arrays.asList( - new Object[]{"HashMap", makeMap(HashMap::new, nulls)}, - new Object[]{"IdentityHashMap", makeMap(IdentityHashMap::new, nulls)}, - new Object[]{"LinkedHashMap", makeMap(LinkedHashMap::new, nulls)}, - new Object[]{"WeakHashMap", makeMap(WeakHashMap::new, nulls)}, - new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(makeMap(HashMap::new, nulls), IntegerEnum.class, String.class)}, - new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(makeMap(HashMap::new, nulls))}, - new Object[]{"ExtendsAbstractMap", makeMap(ExtendsAbstractMap::new, nulls)}); + new Object[]{"HashMap", makeMap(HashMap::new, nullKeys, nullValues)}, + new Object[]{"IdentityHashMap", makeMap(IdentityHashMap::new, nullKeys, nullValues)}, + new Object[]{"LinkedHashMap", makeMap(LinkedHashMap::new, nullKeys, nullValues)}, + new Object[]{"WeakHashMap", makeMap(WeakHashMap::new, nullKeys, nullValues)}, + new Object[]{"Collections.checkedMap(HashMap)", Collections.checkedMap(makeMap(HashMap::new, nullKeys, nullValues), IntegerEnum.class, String.class)}, + new Object[]{"Collections.synchronizedMap(HashMap)", Collections.synchronizedMap(makeMap(HashMap::new, nullKeys, nullValues))}, + new Object[]{"ExtendsAbstractMap", makeMap(ExtendsAbstractMap::new, nullKeys, nullValues)}); + } + + /** + * + * @param nulls include null values + * @return + */ + private static Collection makeRWNoNullKeysMaps(boolean nulls) { + return Arrays.asList( + // null key hostile + new Object[]{"EnumMap", makeMap(() -> new EnumMap(IntegerEnum.class), false, nulls)}, + new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(makeMap(() -> new EnumMap(IntegerEnum.class), false, nulls))} + ); } private static Collection makeRWNoNullsMaps() { return Arrays.asList( - // null hostile - new Object[]{"EnumMap", makeMap(() -> new EnumMap(IntegerEnum.class), false)}, - new Object[]{"Hashtable", makeMap(Hashtable::new, false)}, - new Object[]{"TreeMap", makeMap(TreeMap::new, false)}, - new Object[]{"ConcurrentHashMap", makeMap(ConcurrentHashMap::new, false)}, - new Object[]{"ConcurrentSkipListMap", makeMap(ConcurrentSkipListMap::new, false)}, - new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(makeMap(ConcurrentHashMap::new, false), IntegerEnum.class, String.class)}, - new Object[]{"Collections.synchronizedMap(EnumMap)", Collections.synchronizedMap(makeMap(() -> new EnumMap(IntegerEnum.class), false))}, - new Object[]{"ImplementsConcurrentMap", makeMap(ImplementsConcurrentMap::new, false)}); + // null key and value hostile + new Object[]{"Hashtable", makeMap(Hashtable::new, false, false)}, + new Object[]{"TreeMap", makeMap(TreeMap::new, false, false)}, + new Object[]{"ConcurrentHashMap", makeMap(ConcurrentHashMap::new, false, false)}, + new Object[]{"ConcurrentSkipListMap", makeMap(ConcurrentSkipListMap::new, false, false)}, + new Object[]{"Collections.checkedMap(ConcurrentHashMap)", Collections.checkedMap(makeMap(ConcurrentHashMap::new, false, false), IntegerEnum.class, String.class)}, + new Object[]{"ImplementsConcurrentMap", makeMap(ImplementsConcurrentMap::new, false, false)} + ); } + /** + * + * @param nulls include nulls + * @return + */ private static Collection makeROMaps(boolean nulls) { return Arrays.asList(new Object[][]{ - new Object[]{"Collections.unmodifiableMap(HashMap)", Collections.unmodifiableMap(makeMap(HashMap::new, nulls))} + new Object[]{"Collections.unmodifiableMap(HashMap)", Collections.unmodifiableMap(makeMap(HashMap::new, nulls, nulls))} }); } - private static Map makeMap(Supplier> supplier, boolean nulls) { + /** + * + * @param supplier a supplier of mutable map instances. + * + * @param nullKeys include null keys + * @param nullValues include null values + * @return + */ + private static Map makeMap(Supplier> supplier, boolean nullKeys, boolean nullValues) { Map result = supplier.get(); for (int each = 0; each < TEST_SIZE; each++) { - if (nulls) { - result.put((each == 0) ? null : KEYS[each], null); - } else { - result.put(KEYS[each], VALUES[each]); - } + IntegerEnum key = nullKeys ? (each == 0) ? null : KEYS[each] : KEYS[each]; + String value = nullValues ? (each == 0) ? null : VALUES[each] : VALUES[each]; + + result.put(key, value); } return result; @@ -520,6 +655,12 @@ public class Defaults { : "Failed to throw " + throwable.getCanonicalName()); } + public static void assertThrows(Class throwable, String message, Thrower... throwers) { + for(Thrower thrower : throwers) { + assertThrows(thrower, throwable, message); + } + } + public static void assertInstance(T actual, Class expected) { assertInstance(expected.isInstance(actual), null); } diff --git a/jdk/test/java/util/Map/EntryComparators.java b/jdk/test/java/util/Map/EntryComparators.java new file mode 100644 index 00000000000..ce607a36901 --- /dev/null +++ b/jdk/test/java/util/Map/EntryComparators.java @@ -0,0 +1,139 @@ +/* + * 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 8009736 8010279 + * @run testng EntryComparators + */ +import java.util.function.Function; +import java.util.Comparator; +import java.util.AbstractMap; +import java.util.Map; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + +/** + * Unit tests for Map.Entry.comparing + */ +@Test(groups = "unit") +public class EntryComparators { + + private void assertPairComparison(K k1, V v1, K k2, V v2, + Comparator> ck, + Comparator> cv) { + final Map.Entry p11 = new AbstractMap.SimpleImmutableEntry<>(k1, v1); + final Map.Entry p12 = new AbstractMap.SimpleImmutableEntry<>(k1, v2); + final Map.Entry p21 = new AbstractMap.SimpleImmutableEntry<>(k2, v1); + final Map.Entry p22 = new AbstractMap.SimpleImmutableEntry<>(k2, v2); + + assertTrue(ck.compare(p11, p11) == 0); + assertTrue(ck.compare(p12, p11) == 0); + assertTrue(ck.compare(p11, p12) == 0); + assertTrue(ck.compare(p12, p22) < 0); + assertTrue(ck.compare(p12, p21) < 0); + assertTrue(ck.compare(p21, p11) > 0); + assertTrue(ck.compare(p21, p12) > 0); + + assertTrue(cv.compare(p11, p11) == 0); + assertTrue(cv.compare(p12, p11) > 0); + assertTrue(cv.compare(p11, p12) < 0); + assertTrue(cv.compare(p12, p22) == 0); + assertTrue(cv.compare(p12, p21) > 0); + assertTrue(cv.compare(p21, p11) == 0); + assertTrue(cv.compare(p21, p12) < 0); + + Comparator> cmp = ck.thenComparing(cv); + assertTrue(cmp.compare(p11, p11) == 0); + assertTrue(cmp.compare(p12, p11) > 0); + assertTrue(cmp.compare(p11, p12) < 0); + assertTrue(cmp.compare(p12, p22) < 0); + assertTrue(cmp.compare(p12, p21) < 0); + assertTrue(cmp.compare(p21, p11) > 0); + assertTrue(cmp.compare(p21, p12) > 0); + + cmp = cv.thenComparing(ck); + assertTrue(cmp.compare(p11, p11) == 0); + assertTrue(cmp.compare(p12, p11) > 0); + assertTrue(cmp.compare(p11, p12) < 0); + assertTrue(cmp.compare(p12, p22) < 0); + assertTrue(cmp.compare(p12, p21) > 0); + assertTrue(cmp.compare(p21, p11) > 0); + assertTrue(cmp.compare(p21, p12) < 0); + } + + public void testKVComparables() { + assertPairComparison(1, "ABC", 2, "XYZ", + Map.Entry.comparingByKey(), + Map.Entry.comparingByValue()); + } + + private static class People { + final String firstName; + final String lastName; + final int age; + + People(String first, String last, int age) { + firstName = first; + lastName = last; + this.age = age; + } + + String getFirstName() { return firstName; } + String getLastName() { return lastName; } + int getAge() { return age; } + } + + private final People people[] = { + new People("John", "Doe", 34), + new People("Mary", "Doe", 30), + }; + + public void testKVComparators() { + // Comparator cmp = Comparator.naturalOrder(); // Should fail to compiler as People is not comparable + // We can use simple comparator, but those have been tested above. + // Thus choose to do compose for some level of interation. + Comparator cmp1 = Comparator.comparing((Function) People::getFirstName); + Comparator cmp2 = Comparator.comparing((Function) People::getLastName); + Comparator cmp = cmp1.thenComparing(cmp2); + + assertPairComparison(people[0], people[0], people[1], people[1], + Map.Entry.comparingByKey(cmp), + Map.Entry.comparingByValue(cmp)); + + } + + public void testNulls() { + try { + Comparator> cmp = Map.Entry.comparingByKey(null); + fail("comparingByKey(null) should throw NPE"); + } catch (NullPointerException npe) {} + + try { + Comparator> cmp = Map.Entry.comparingByValue(null); + fail("comparingByValue(null) should throw NPE"); + } catch (NullPointerException npe) {} + } +} diff --git a/jdk/test/java/util/Properties/Bug6609431.java b/jdk/test/java/util/Properties/Bug6609431.java new file mode 100644 index 00000000000..a1232f1fd43 --- /dev/null +++ b/jdk/test/java/util/Properties/Bug6609431.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 6609431 + * @summary Test whether loading of a property value in a file ending with + * a backslash works fine. + */ + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.Properties; + +public class Bug6609431 { + private static final String expected = "backslash"; + + public static void main(String[] args) throws IOException { + try (FileReader fr = + new FileReader(new File(System.getProperty("test.src", "."), + "Bug6609431.properties"))) { + Properties p = new Properties(); + p.load(fr); + p.getProperty("a"); + String val = p.getProperty("b"); + if (!val.equals(expected)) { + throw new RuntimeException("Value returned from the property" + + " list was incorrect. Returned: '" + val + + "', expected: '" + expected + "'"); + } + } + } +} diff --git a/jdk/test/java/util/Properties/Bug6609431.properties b/jdk/test/java/util/Properties/Bug6609431.properties new file mode 100644 index 00000000000..59f35f43823 --- /dev/null +++ b/jdk/test/java/util/Properties/Bug6609431.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# 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. +# +a=backslashbackslash +b=backslash\ diff --git a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java index 5990dde97c5..d58c2b9d544 100644 --- a/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java +++ b/jdk/test/java/util/Spliterator/SpliteratorTraversingAndSplittingTest.java @@ -170,7 +170,7 @@ public class SpliteratorTraversingAndSplittingTest { () -> Spliterators.spliteratorUnknownSize(exp.iterator(), 0)); db.add("Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Spliterator ), ...)", - () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(exp.spliterator()), exp.size(), 0)); + () -> Spliterators.spliterator(Spliterators.iterator(exp.spliterator()), exp.size(), 0)); db.add("Spliterators.spliterator(T[], ...)", () -> Spliterators.spliterator(exp.toArray(new Integer[0]), 0)); @@ -549,10 +549,10 @@ public class SpliteratorTraversingAndSplittingTest { () -> Arrays.spliterator(exp)); db.add("Spliterators.spliterator(PrimitiveIterator.OfInt, ...)", - () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0)); + () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0)); db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfInt, ...)", - () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0)); + () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0)); class IntSpliteratorFromArray extends Spliterators.AbstractIntSpliterator { int[] a; @@ -702,10 +702,10 @@ public class SpliteratorTraversingAndSplittingTest { () -> Arrays.spliterator(exp)); db.add("Spliterators.spliterator(PrimitiveIterator.OfLong, ...)", - () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0)); + () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0)); db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfLong, ...)", - () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0)); + () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0)); class LongSpliteratorFromArray extends Spliterators.AbstractLongSpliterator { long[] a; @@ -862,10 +862,10 @@ public class SpliteratorTraversingAndSplittingTest { () -> Arrays.spliterator(exp)); db.add("Spliterators.spliterator(PrimitiveIterator.OfDouble, ...)", - () -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0)); + () -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0)); db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfDouble, ...)", - () -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0)); + () -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0)); class DoubleSpliteratorFromArray extends Spliterators.AbstractDoubleSpliterator { double[] a; diff --git a/jdk/test/java/util/concurrent/Executors/PrivilegedCallables.java b/jdk/test/java/util/concurrent/Executors/PrivilegedCallables.java index a69041232f5..a77511e440d 100644 --- a/jdk/test/java/util/concurrent/Executors/PrivilegedCallables.java +++ b/jdk/test/java/util/concurrent/Executors/PrivilegedCallables.java @@ -43,7 +43,8 @@ public class PrivilegedCallables { final Random rnd = new Random(); - @SuppressWarnings("serial") Throwable[] throwables = { + @SuppressWarnings("serial") + Throwable[] throwables = { new Exception() {}, new RuntimeException() {}, new Error() {} @@ -51,6 +52,11 @@ public class PrivilegedCallables { Throwable randomThrowable() { return throwables[rnd.nextInt(throwables.length)]; } + void throwThrowable(Throwable t) throws Exception { + if (t instanceof Error) throw (Error) t; + if (t instanceof RuntimeException) throw (RuntimeException) t; + throw (Exception) t; + } //---------------------------------------------------------------- // A Policy class designed to make permissions fiddling very easy. @@ -119,9 +125,8 @@ public class PrivilegedCallables { if (rnd.nextBoolean()) { final Throwable t = randomThrowable(); real = new Callable() { - @SuppressWarnings("deprecation") public Integer call() throws Exception { - Thread.currentThread().stop(t); + throwThrowable(t); return null; }}; try { c.call(); diff --git a/jdk/test/java/util/concurrent/FutureTask/Throw.java b/jdk/test/java/util/concurrent/FutureTask/Throw.java index 4182cdf1a0c..7bc442728ad 100644 --- a/jdk/test/java/util/concurrent/FutureTask/Throw.java +++ b/jdk/test/java/util/concurrent/FutureTask/Throw.java @@ -31,10 +31,9 @@ import java.util.concurrent.*; public class Throw { - @SuppressWarnings("deprecation") static void THROW(final Throwable t) { if (t != null) - Thread.currentThread().stop(t); + Throw.uncheckedThrow(t); } Callable thrower(final Throwable t) { @@ -138,4 +137,8 @@ public class Throw { catch (Throwable t) { if (k.isAssignableFrom(t.getClass())) pass(); else unexpected(t);}} + @SuppressWarnings("unchecked") static + void uncheckedThrow(Throwable t) throws T { + throw (T)t; // rely on vacuous cast + } } diff --git a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java index 7699d180005..1394a4c38ed 100644 --- a/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java +++ b/jdk/test/java/util/concurrent/ThreadPoolExecutor/ThrowingTasks.java @@ -101,8 +101,10 @@ public class ThrowingTasks { static class Thrower implements Runnable { Throwable t; Thrower(Throwable t) { this.t = t; } - @SuppressWarnings("deprecation") - public void run() { if (t != null) Thread.currentThread().stop(t); } + public void run() { + if (t != null) + ThrowingTasks.uncheckedThrow(t); + } } static final Thrower noThrower = new Thrower(null); @@ -265,4 +267,8 @@ public class ThrowingTasks { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} + @SuppressWarnings("unchecked") static + void uncheckedThrow(Throwable t) throws T { + throw (T)t; // rely on vacuous cast + } } diff --git a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java index e00cf4c612a..390f01d0f15 100644 --- a/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java +++ b/jdk/test/java/util/concurrent/locks/Lock/FlakyMutex.java @@ -37,7 +37,7 @@ import java.util.concurrent.locks.*; * tryAcquire method that randomly throws various Throwable * subclasses. */ -@SuppressWarnings({"deprecation", "serial"}) +@SuppressWarnings("serial") public class FlakyMutex implements Lock { static class MyError extends Error {} static class MyException extends Exception {} @@ -49,7 +49,7 @@ public class FlakyMutex implements Lock { switch (rnd.nextInt(10)) { case 0: throw new MyError(); case 1: throw new MyRuntimeException(); - case 2: Thread.currentThread().stop(new MyException()); break; + case 2: FlakyMutex.uncheckedThrow(new MyException()); default: /* Do nothing */ break; } } @@ -146,4 +146,8 @@ public class FlakyMutex implements Lock { try {realMain(args);} catch (Throwable t) {unexpected(t);} System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new AssertionError("Some tests failed");} + @SuppressWarnings("unchecked") static + void uncheckedThrow(Throwable t) throws T { + throw (T)t; // rely on vacuous cast + } } diff --git a/jdk/test/java/util/function/BinaryOperator/BasicTest.java b/jdk/test/java/util/function/BinaryOperator/BasicTest.java new file mode 100644 index 00000000000..1519fb88177 --- /dev/null +++ b/jdk/test/java/util/function/BinaryOperator/BasicTest.java @@ -0,0 +1,104 @@ +/* + * 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 8009736 8010279 + * @run testng BasicTest + */ + +import java.util.Comparator; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.ToIntFunction; +import org.testng.annotations.Test; + + +import static java.util.function.BinaryOperator.minBy; +import static java.util.function.BinaryOperator.maxBy; +import static org.testng.Assert.assertSame; +import static org.testng.Assert.fail; + +/** + * Unit tests for helper methods in Comparators + */ +@Test(groups = "unit") +public class BasicTest { + + private static class People { + final String firstName; + final String lastName; + final int age; + + People(String first, String last, int age) { + firstName = first; + lastName = last; + this.age = age; + } + + String getFirstName() { return firstName; } + String getLastName() { return lastName; } + int getAge() { return age; } + } + + private final People people[] = { + new People("John", "Doe", 34), + new People("Mary", "Doe", 30), + }; + + public void testMaxBy() { + Comparator cmp = Comparator.comparing((Function) People::getFirstName); + // lesser + assertSame(maxBy(cmp).apply(people[0], people[1]), people[1]); + // euqal + cmp = Comparator.comparing((Function) People::getLastName); + assertSame(maxBy(cmp).apply(people[0], people[1]), people[0]); + // greater + cmp = Comparator.comparing((ToIntFunction) People::getAge); + assertSame(maxBy(cmp).apply(people[0], people[1]), people[0]); + } + + public void testLesserOf() { + Comparator cmp = Comparator.comparing((Function) People::getFirstName); + // lesser + assertSame(minBy(cmp).apply(people[0], people[1]), people[0]); + // euqal + cmp = Comparator.comparing((Function) People::getLastName); + assertSame(minBy(cmp).apply(people[0], people[1]), people[0]); + // greater + cmp = Comparator.comparing((ToIntFunction) People::getAge); + assertSame(minBy(cmp).apply(people[0], people[1]), people[1]); + } + + public void testNulls() { + try { + BinaryOperator op = minBy(null); + fail("minBy(null) should throw NPE"); + } catch (NullPointerException npe) {} + + try { + BinaryOperator op = maxBy(null); + fail("maxBy(null) should throw NPE"); + } catch (NullPointerException npe) {} + } +} diff --git a/jdk/test/java/util/logging/LogManagerInstanceTest.java b/jdk/test/java/util/logging/LogManagerInstanceTest.java new file mode 100644 index 00000000000..c6fbe1e56d7 --- /dev/null +++ b/jdk/test/java/util/logging/LogManagerInstanceTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.logging.*; + +/* + * @test + * @bug 8010727 + * @summary LogManager.addLogger should succeed to add a logger named "" + * if LogManager.getLogger("") returns null. + * + * @run main LogManagerInstanceTest + */ + +public class LogManagerInstanceTest { + public static void main(String[] argv) { + LogManager mgr = LogManager.getLogManager(); + if (getRootLogger(mgr) == null) { + throw new RuntimeException("Root logger not exist"); + } + + SecondLogManager mgr2 = new SecondLogManager(); + Logger root = getRootLogger(mgr2); + if (mgr2.base != root) { + throw new RuntimeException(mgr2.base + " is not the root logger"); + } + } + + private static Logger getRootLogger(LogManager mgr) { + Logger l = mgr.getLogger(""); + if (l != null && !l.getName().isEmpty()) { + throw new RuntimeException(l.getName() + " is not an invalid root logger"); + } + return l; + } + + static class SecondLogManager extends LogManager { + final Logger base; + private SecondLogManager() { + Logger root = getLogger(""); + if (root == null) { + root = new BaseLogger("", null); + if (!super.addLogger(root)) + throw new RuntimeException("Fail to addLogger " + root); + } else { + throw new RuntimeException("Root logger already exists"); + } + this.base = root; + } + } + static class BaseLogger extends Logger { + BaseLogger(String name, String rbname) { + super(name, rbname); + } + } +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java new file mode 100644 index 00000000000..dd901ed5f92 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobal.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * @test + * @bug 7184195 + * @summary checks that java.util.logging.Logger.getGlobal().info() logs without configuration + * @build TestGetGlobal testgetglobal.HandlerImpl testgetglobal.LogManagerImpl1 testgetglobal.LogManagerImpl2 testgetglobal.LogManagerImpl3 testgetglobal.BadLogManagerImpl testgetglobal.DummyLogManagerImpl + * @run main/othervm/timeout=10 TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager TestGetGlobal + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl1 TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl1 TestGetGlobal + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobal + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobal + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobal + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobal + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobal + * @author danielfuchs + */ +public class TestGetGlobal { + + final static String[] messages = { + "1. This message should not appear on the console.", + "2. This message should appear on the console.", + "3. This message should now appear on the console too." + }; + + static { + System.setProperty("java.util.logging.config.file", + System.getProperty("test.src", ".") + java.io.File.separator + "logging.properties"); + } + + public static void main(String... args) { + + Logger.global.info(messages[0]); // at this point LogManager is not + // initialized yet, so this message should not appear. + Logger.getGlobal().info(messages[1]); // calling getGlobal() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[2]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, 1, messages.length)); + if (!testgetglobal.HandlerImpl.received.equals(expected)) { + throw new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected); + } + } +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java new file mode 100644 index 00000000000..62580a8bc3b --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalByName.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * @test + * @bug 7184195 + * @summary checks that java.util.logging.Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info() logs without configuration + * @build TestGetGlobalByName testgetglobal.HandlerImpl testgetglobal.LogManagerImpl1 testgetglobal.LogManagerImpl2 testgetglobal.LogManagerImpl3 testgetglobal.BadLogManagerImpl testgetglobal.DummyLogManagerImpl + * @run main/othervm/timeout=10 TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager TestGetGlobalByName + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl1 TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl TestGetGlobalByName + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalByName + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobalByName + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobalByName + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobalByName + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobalByName + * @author danielfuchs + */ +public class TestGetGlobalByName { + + final static String[] messages = { + "1. This message should not appear on the console.", + "2. This message should appear on the console.", + "3. This message should now appear on the console too." + }; + + static { + System.setProperty("java.util.logging.config.file", + System.getProperty("test.src", ".") + java.io.File.separator + "logging.properties"); + } + + public static void main(String... args) { + + Logger.global.info(messages[0]); // at this point LogManager is not + // initialized yet, so this message should not appear. + Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(messages[1]); // calling getLogger() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[2]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, 1, messages.length)); + if (!testgetglobal.HandlerImpl.received.equals(expected)) { + throw new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected); + } + } +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java new file mode 100644 index 00000000000..4ef38ce3611 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/TestGetGlobalConcurrent.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** + * @test + * @bug 7184195 + * @summary checks that java.util.logging.Logger.getGlobal().info() logs without configuration + * @build TestGetGlobalConcurrent testgetglobal.HandlerImpl testgetglobal.LogManagerImpl1 testgetglobal.LogManagerImpl2 testgetglobal.LogManagerImpl3 testgetglobal.BadLogManagerImpl testgetglobal.DummyLogManagerImpl + * @run main/othervm/timeout=10 TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager TestGetGlobalConcurrent + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl TestGetGlobalConcurrent + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl2 TestGetGlobalConcurrent + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.LogManagerImpl3 TestGetGlobalConcurrent + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.BadLogManagerImpl TestGetGlobalConcurrent + * @run main/othervm/timeout=10 -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobalConcurrent + * @run main/othervm/timeout=10/policy=policy -Djava.security.manager -Djava.util.logging.manager=testgetglobal.DummyLogManagerImpl TestGetGlobalConcurrent + * @author danielfuchs + */ +public class TestGetGlobalConcurrent { + + final static String[] messages = { + "1. This message should not appear on the console.", + "2. This message should appear on the console.", + "3. This message should now appear on the console too.", + "4. This message should appear on the console.", + "5. This message should now appear on the console too.", + "6. This message should appear on the console.", + "7. This message should now appear on the console too.", + "8. This message should appear on the console.", + "9. This message should now appear on the console too." + }; + + static { + System.setProperty("java.util.logging.config.file", + System.getProperty("test.src", ".") + java.io.File.separator + "logging.properties"); + } + + public static void test1() { + final int nb = 1; + final int i = 2*nb + 1; + Logger.getGlobal().info(messages[i]); // calling getGlobal() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[i+1]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, i, i+2)); + if (!testgetglobal.HandlerImpl.received.containsAll(expected)) { + fail(new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected)); + } + } + public static void test2() { + final int nb = 2; + final int i = 2*nb + 1; + Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).info(messages[i]); // calling getGlobal() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[i+1]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, i, i+2)); + if (!testgetglobal.HandlerImpl.received.containsAll(expected)) { + fail(new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected)); + } + } + public static void test3() { + final int nb = 3; + final int i = 2*nb + 1; + java.util.logging.LogManager.getLogManager(); + Logger.getGlobal().info(messages[i]); // calling getGlobal() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[i+1]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, i, i+2)); + if (!testgetglobal.HandlerImpl.received.containsAll(expected)) { + fail(new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected)); + } + } + public static void test4() { + log = new MyLogger("foo.bar"); + java.util.logging.LogManager.getLogManager().addLogger(log); + } + + + private static volatile Throwable failed = null; + private static volatile Logger log = null; + + public static class MyLogger extends Logger { + public MyLogger(String name) { + super(name, null); + } + } + + public static void fail(Throwable failure) { + failure.printStackTrace(); + if (failed == null) failed = failure; + } + + public static class WaitAndRun implements Runnable { + private final Runnable run; + public WaitAndRun(Runnable run) { + this.run = run; + } + public void run() { + try { + Thread.sleep(10); + run.run(); + } catch (Exception | Error x) { + fail(x); + } + } + } + + final static class Run1 implements Runnable { + public void run() { test1(); } + } + final static class Run2 implements Runnable { + public void run() { test2(); } + } + final static class Run3 implements Runnable { + public void run() { test3(); } + } + final static class Run4 implements Runnable { + public void run() { test4(); } + } + + public static void main(String... args) throws Exception { + + final Thread t1 = new Thread(new WaitAndRun(new Run1()), "test1"); + final Thread t2 = new Thread(new WaitAndRun(new Run2()), "test2"); + final Thread t3 = new Thread(new WaitAndRun(new Run3()), "test3"); + final Thread t4 = new Thread(new WaitAndRun(new Run4()), "test4"); + + t1.setDaemon(true); t2.setDaemon(true); t3.setDaemon(true); t4.setDaemon(true); + t1.start(); t2.start(); t3.start(); t4.start(); + + Thread.sleep(10); + + Logger.getGlobal().info(messages[1]); // calling getGlobal() will + // initialize the LogManager - and thus this message should appear. + Logger.global.info(messages[2]); // Now that the LogManager is + // initialized, this message should appear too. + + final List expected = Arrays.asList(Arrays.copyOfRange(messages, 1, 3)); + if (!testgetglobal.HandlerImpl.received.containsAll(expected)) { + throw new Error("Unexpected message list: "+testgetglobal.HandlerImpl.received+" vs "+ expected); + } + + + t1.join(); t2.join(); t3.join(); t4.join(); + + if (failed != null) { + throw new Error("Test failed.", failed); + } + + System.out.println("Test passed"); + } +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/logging.properties b/jdk/test/java/util/logging/Logger/getGlobal/logging.properties new file mode 100644 index 00000000000..0e201a9c60c --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/logging.properties @@ -0,0 +1,2 @@ +.level=INFO +handlers=testgetglobal.HandlerImpl diff --git a/jdk/test/java/util/logging/Logger/getGlobal/policy b/jdk/test/java/util/logging/Logger/getGlobal/policy new file mode 100644 index 00000000000..bcb7cde0da3 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/policy @@ -0,0 +1,7 @@ +grant { + permission java.util.PropertyPermission "java.util.logging.config.file", "write"; + permission java.util.PropertyPermission "test.src", "read"; + permission java.lang.RuntimePermission "setContextClassLoader"; + permission java.lang.RuntimePermission "shutdownHooks"; + permission java.util.logging.LoggingPermission "control"; +}; diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/BadLogManagerImpl.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/BadLogManagerImpl.java new file mode 100644 index 00000000000..e3fd771ffd7 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/BadLogManagerImpl.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.logging.LogManager; +import java.util.logging.Logger; + +/** + * This class is used to verify that calling Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) + * in the constructor of a LogManager subclass installed as default + * LogManager does not cause issues beyond throwing the expected NPE. + * In that case the default LogManager class will simply be used. + * @author danielfuchs + */ +public class BadLogManagerImpl extends LogManager { + + final Logger globalLogger; + public BadLogManagerImpl() { + // The call below should generate an NPE, which will be + // catched in LogManager initializer. + globalLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + System.err.println("Global is: " + globalLogger); + throw new Error("Should not have reached here"); + } + +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/DummyLogManagerImpl.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/DummyLogManagerImpl.java new file mode 100644 index 00000000000..e3a48372fa7 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/DummyLogManagerImpl.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.logging.LogManager; +import java.util.logging.Logger; + +/** + * A dummy LogManager subclass that does nothing beyond extending LogManager. + * @author danielfuchs + */ +public class DummyLogManagerImpl extends LogManager { + + +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java new file mode 100644 index 00000000000..f8737acb25f --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/HandlerImpl.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.List; +import java.util.logging.ConsoleHandler; +import java.util.logging.LogRecord; + +/** + * + * @author danielfuchs + */ +public class HandlerImpl extends ConsoleHandler { + + public final static List received = new CopyOnWriteArrayList<>(); + + public HandlerImpl() { + } + + @Override + public void publish(LogRecord record) { + received.add(record.getMessage()); + super.publish(record); + } +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl1.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl1.java new file mode 100644 index 00000000000..9f3f6432a58 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl1.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.logging.LogManager; +import java.util.logging.Logger; + +/** + * This class is used to verify that calling Logger.getGlobal() in the static + * initializer of a LogManager subclass installed as default LogManager + * does not cause issues. + * @author danielfuchs + */ +public class LogManagerImpl1 extends LogManager { + + static final Logger global; + static { + global = Logger.getGlobal(); + System.err.println("Global is: " + global); + } + +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl2.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl2.java new file mode 100644 index 00000000000..dd9d7aeca7f --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl2.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.logging.LogManager; +import java.util.logging.Logger; + +/** + * This class is used to verify that calling Logger.getGlobal() in the constructor + * initializer of a LogManager subclass installed as default LogManager + * does not cause issues. + * @author danielfuchs + */ +public class LogManagerImpl2 extends LogManager { + + final Logger globalLogger; + public LogManagerImpl2() { + globalLogger = Logger.getGlobal(); + System.err.println("Global is: " + globalLogger); + } + +} diff --git a/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl3.java b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl3.java new file mode 100644 index 00000000000..f5ce01cd90d --- /dev/null +++ b/jdk/test/java/util/logging/Logger/getGlobal/testgetglobal/LogManagerImpl3.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 testgetglobal; + +import java.util.logging.LogManager; +import java.util.logging.Logger; + +/** + * This class is used to verify that calling Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) + * in the static initializer of a LogManager subclass installed as default + * LogManager does not cause issues beyond throwing the expected NPE. + * @author danielfuchs + */ +public class LogManagerImpl3 extends LogManager { + + static final Logger global; + static { + Logger g = null; + try { + g = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + throw new Error("Should not have reached here"); + } catch (Exception x) { + // This is to be expected: Logger.getLogger(Logger.GLOBAL_LOGGER_NAME) + // will call LogManager.getLogManager() which will return null, since + // we haven't manage to do new LogManagerImpl3() yet. + // + System.err.println("Got expected exception - you cannot call" + + " Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)" + + " in LogManager subclass static initializer: " + x); + x.printStackTrace(); + } + if (g == null) { + g = Logger.getGlobal(); + } + global = g; + System.err.println("Global is: " + global); + } + +} diff --git a/jdk/test/java/util/logging/TestAppletLoggerContext.java b/jdk/test/java/util/logging/TestAppletLoggerContext.java new file mode 100644 index 00000000000..c7f3d4f4991 --- /dev/null +++ b/jdk/test/java/util/logging/TestAppletLoggerContext.java @@ -0,0 +1,610 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.security.CodeSource; +import java.security.Permission; +import java.security.PermissionCollection; +import java.security.Permissions; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.LogManager; +import java.util.logging.Logger; +import java.util.logging.LoggingPermission; +import sun.misc.JavaAWTAccess; +import sun.misc.SharedSecrets; + +/* + * @test + * @bug 8017174 8010727 + * @summary NPE when using Logger.getAnonymousLogger or + * LogManager.getLogManager().getLogger + * + * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingApplet + * @run main/othervm -Dtest.security=on TestAppletLoggerContext LoadingApplet + * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingMain + * @run main/othervm -Dtest.security=on TestAppletLoggerContext LoadingMain + * @run main/othervm -Dtest.security=off TestAppletLoggerContext One + * @run main/othervm -Dtest.security=on TestAppletLoggerContext One + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Two + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Two + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Three + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Three + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Four + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Four + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Five + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Five + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Six + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Six + * @run main/othervm -Dtest.security=off TestAppletLoggerContext Seven + * @run main/othervm -Dtest.security=on TestAppletLoggerContext Seven + * @run main/othervm -Dtest.security=off TestAppletLoggerContext + * @run main/othervm -Dtest.security=on TestAppletLoggerContext + */ + +// NOTE: We run in other VM in order to 1. switch security manager and 2. cause +// LogManager class to be loaded anew. +public class TestAppletLoggerContext { + + // Avoids the hassle of dealing with files and system props... + static class SimplePolicy extends Policy { + private final Permissions perms; + public SimplePolicy(Permission... permissions) { + perms = new Permissions(); + for (Permission permission : permissions) { + perms.add(permission); + } + } + @Override + public PermissionCollection getPermissions(CodeSource cs) { + return perms; + } + @Override + public PermissionCollection getPermissions(ProtectionDomain pd) { + return perms; + } + @Override + public boolean implies(ProtectionDomain pd, Permission p) { + return perms.implies(p); + } + } + + // The bridge class initializes the logging system. + // It stubs the applet context in order to simulate context changes. + // + public static class Bridge { + + private static class JavaAWTAccessStub implements JavaAWTAccess { + boolean active = true; + + private static class TestExc { + private final Map map = new HashMap<>(); + void put(Object key, Object v) { map.put(key, v); } + Object get(Object key) { return map.get(key); } + void remove(Object o) { map.remove(o); } + public static TestExc exc(Object o) { + return TestExc.class.cast(o); + } + } + + TestExc exc; + TestExc global = new TestExc(); + + @Override + public Object getContext() { return active ? global : null; } + @Override + public Object getExecutionContext() { return active ? exc : null; } + @Override + public Object get(Object o, Object o1) { return TestExc.exc(o).get(o1); } + @Override + public void put(Object o, Object o1, Object o2) { TestExc.exc(o).put(o1, o2); } + @Override + public void remove(Object o, Object o1) { TestExc.exc(o).remove(o1); } + @Override + public Object get(Object o) { return global.get(o); } + @Override + public void put(Object o, Object o1) { global.put(o, o1); } + @Override + public void remove(Object o) { global.remove(o); } + @Override + public boolean isDisposed() { return false; } + @Override + public boolean isMainAppContext() { return exc == null; } + } + + final static JavaAWTAccessStub javaAwtAccess = new JavaAWTAccessStub(); + public static void init() { + SharedSecrets.setJavaAWTAccess(javaAwtAccess); + if (System.getProperty("test.security", "on").equals("on")) { + Policy p = new SimplePolicy(new LoggingPermission("control", null), + new RuntimePermission("setContextClassLoader"), + new RuntimePermission("shutdownHooks")); + Policy.setPolicy(p); + System.setSecurityManager(new SecurityManager()); + } + } + + public static void changeContext() { + System.out.println("... Switching to a new applet context ..."); + javaAwtAccess.active = true; + javaAwtAccess.exc = new JavaAWTAccessStub.TestExc(); + } + + public static void desactivate() { + System.out.println("... Running with no applet context ..."); + javaAwtAccess.exc = null; + javaAwtAccess.active = false; + } + + public static class CustomAnonymousLogger extends Logger { + public CustomAnonymousLogger() { + this(""); + } + public CustomAnonymousLogger(String name) { + super(null, null); + System.out.println( " LogManager: " +LogManager.getLogManager()); + System.out.println( " getLogger: " +LogManager.getLogManager().getLogger(name)); + setParent(LogManager.getLogManager().getLogger(name)); + } + } + + public static class CustomLogger extends Logger { + CustomLogger(String name) { + super(name, null); + } + } + } + + public static enum TestCase { + LoadingApplet, LoadingMain, One, Two, Three, Four, Five, Six, Seven; + public void test() { + switch(this) { + // When run - each of these two tests must be + // run before any other tests and before each other. + case LoadingApplet: testLoadingApplet(); break; + case LoadingMain: testLoadingMain(); break; + case One: testOne(); break; + case Two: testTwo(); break; + case Three: testThree(); break; + case Four: testFour(); break; + case Five: testFive(); break; + case Six: testSix(); break; + case Seven: testSeven(); break; + } + } + public String describe() { + switch(this) { + case LoadingApplet: + return "Test that when the LogManager class is" + + " loaded in an applet thread first," + + "\n all LoggerContexts are correctly initialized"; + case LoadingMain: + return "Test that when the LogManager class is" + + " loaded in the main thread first," + + "\n all LoggerContexts are correctly initialized"; + case One: + return "Test that Logger.getAnonymousLogger()" + + " and new CustomAnonymousLogger() don't throw NPE"; + case Two: + return "Test that Logger.getLogger(\"\")" + + " does not return null nor throws NPE"; + case Three: + return "Test that LogManager.getLogManager().getLogger(\"\")" + + " does not return null nor throws NPE"; + case Four: + return "Test that Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)" + + " does not return null,\n and that" + + " new CustomAnonymousLogger(Logger.GLOBAL_LOGGER_NAME)" + + " does not throw NPE"; + case Five: + return "Test that LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME)" + + "\n does not return null nor throws NPE"; + case Six: + return "Test that manager.getLogger(Logger.GLOBAL_LOGGER_NAME)" + + " returns null\n when manager is not the default" + + " LogManager instance.\n" + + "Test adding a new logger named \"global\" in that" + + " non default instance."; + case Seven: return "Test that manager.getLogger(\"\")" + + " returns null\n when manager is not the default" + + " LogManager instance.\n" + + "Test adding a new logger named \"\" in that" + + " non default instance."; + default: return "Undefined"; + } + } + }; + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + Bridge.init(); + EnumSet tests = EnumSet.noneOf(TestCase.class); + for (String arg : args) { + tests.add(TestCase.valueOf(arg)); + } + if (args.length == 0) { + tests = EnumSet.complementOf(EnumSet.of(TestCase.LoadingMain)); + } + final EnumSet loadingTests = + EnumSet.of(TestCase.LoadingApplet, TestCase.LoadingMain); + int testrun = 0; + for (TestCase test : tests) { + if (loadingTests.contains(test)) { + if (testrun > 0) { + throw new UnsupportedOperationException("Test case " + + test + " must be executed first!"); + } + } + System.out.println("Testing "+ test+": "); + System.out.println(test.describe()); + try { + test.test(); + } catch (Exception x) { + throw new Error(String.valueOf(test) + + (System.getSecurityManager() == null ? " without " : " with ") + + "security failed: "+x+"\n "+"FAILED: "+test.describe()+"\n", x); + } finally { + testrun++; + } + Bridge.changeContext(); + System.out.println("PASSED: "+ test); + } + } + + public static void testLoadingApplet() { + Bridge.changeContext(); + + Logger bar = new Bridge.CustomLogger("com.foo.Bar"); + LogManager.getLogManager().addLogger(bar); + assertNotNull(bar.getParent()); + testParent(bar); + testParent(LogManager.getLogManager().getLogger("global")); + testParent(LogManager.getLogManager().getLogger(bar.getName())); + + Bridge.desactivate(); + + Logger foo = new Bridge.CustomLogger("com.foo.Foo"); + boolean b = LogManager.getLogManager().addLogger(foo); + assertEquals(Boolean.TRUE, Boolean.valueOf(b)); + assertNotNull(foo.getParent()); + testParent(foo); + testParent(LogManager.getLogManager().getLogger("global")); + testParent(LogManager.getLogManager().getLogger(foo.getName())); + } + + public static void testLoadingMain() { + Bridge.desactivate(); + + Logger bar = new Bridge.CustomLogger("com.foo.Bar"); + LogManager.getLogManager().addLogger(bar); + assertNotNull(bar.getParent()); + testParent(bar); + testParent(LogManager.getLogManager().getLogger("global")); + testParent(LogManager.getLogManager().getLogger(bar.getName())); + + Bridge.changeContext(); + + Logger foo = new Bridge.CustomLogger("com.foo.Foo"); + boolean b = LogManager.getLogManager().addLogger(foo); + assertEquals(Boolean.TRUE, Boolean.valueOf(b)); + assertNotNull(foo.getParent()); + testParent(foo); + testParent(LogManager.getLogManager().getLogger("global")); + testParent(LogManager.getLogManager().getLogger(foo.getName())); + + } + + public static void testOne() { + for (int i=0; i<3 ; i++) { + Logger logger1 = Logger.getAnonymousLogger(); + Logger logger1b = Logger.getAnonymousLogger(); + Bridge.changeContext(); + Logger logger2 = Logger.getAnonymousLogger(); + Logger logger2b = Logger.getAnonymousLogger(); + Bridge.changeContext(); + Logger logger3 = new Bridge.CustomAnonymousLogger(); + Logger logger3b = new Bridge.CustomAnonymousLogger(); + Bridge.changeContext(); + Logger logger4 = new Bridge.CustomAnonymousLogger(); + Logger logger4b = new Bridge.CustomAnonymousLogger(); + } + } + + + public static void testTwo() { + for (int i=0; i<3 ; i++) { + Logger logger1 = Logger.getLogger(""); + Logger logger1b = Logger.getLogger(""); + assertNotNull(logger1); + assertNotNull(logger1b); + assertEquals(logger1, logger1b); + Bridge.changeContext(); + Logger logger2 = Logger.getLogger(""); + Logger logger2b = Logger.getLogger(""); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, logger2b); + assertEquals(logger1, logger2); + } + } + + public static void testThree() { + for (int i=0; i<3 ; i++) { + Logger logger1 = LogManager.getLogManager().getLogger(""); + Logger logger1b = LogManager.getLogManager().getLogger(""); + assertNotNull(logger1); + assertNotNull(logger1b); + assertEquals(logger1, logger1b); + Bridge.changeContext(); + Logger logger2 = LogManager.getLogManager().getLogger(""); + Logger logger2b = LogManager.getLogManager().getLogger(""); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, logger2b); + assertEquals(logger1, logger2); + } + } + + public static void testFour() { + for (int i=0; i<3 ; i++) { + Logger logger1 = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger1b = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger1); + assertNotNull(logger1b); + assertEquals(logger1, logger1b); + Bridge.changeContext(); + + Logger logger2 = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger2b = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, logger2b); + + assertEquals(logger1, logger2); + + Bridge.changeContext(); + Logger logger3 = new Bridge.CustomAnonymousLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger3b = new Bridge.CustomAnonymousLogger(Logger.GLOBAL_LOGGER_NAME); + Bridge.changeContext(); + Logger logger4 = new Bridge.CustomAnonymousLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger4b = new Bridge.CustomAnonymousLogger(Logger.GLOBAL_LOGGER_NAME); + } + } + + public static void testFive() { + for (int i=0; i<3 ; i++) { + Logger logger1 = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger1b = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger1); + assertNotNull(logger1b); + assertEquals(logger1, logger1b); + + Bridge.changeContext(); + + Logger logger2 = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger2b = LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, logger2b); + + assertEquals(logger1, logger2); + } + } + + /** + * This test is designed to test the behavior of additional LogManager instances. + * It must be noted that if the security manager is off, then calling + * Bridge.changeContext() has actually no effect - which explains why we have + * some differences between the cases security manager on & security manager + * off. + **/ + public static void testSix() { + for (int i=0; i<3 ; i++) { + Bridge.desactivate(); + LogManager manager = new LogManager() {}; + Logger logger1 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger1b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNull(logger1); + assertNull(logger1b); + Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); + manager.addLogger(global); + Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, global); + assertEquals(logger2b, global); + assertNull(manager.getLogger("")); + assertNull(manager.getLogger("")); + + Bridge.changeContext(); + + // this is not a supported configuration: + // We are in an applet context with several log managers. + // We however need to check our assumptions... + + // Applet context => root logger and global logger are not null. + // root == LogManager.getLogManager().rootLogger + // global == Logger.global + + Logger logger3 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger3b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger3); + assertNotNull(logger3b); + Logger expected = (System.getSecurityManager() != null + ? Logger.getGlobal() + : global); + assertEquals(logger3, expected); // in applet context, we will not see + // the LogManager's custom global logger added above... + assertEquals(logger3b, expected); // in applet context, we will not see + // the LogManager's custom global logger added above... + Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); + manager.addLogger(global2); // adding a global logger will not work in applet context + // we will always get back the global logger. + // this could be considered as a bug... + Logger logger4 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger4b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger4); + assertNotNull(logger4b); + assertEquals(logger4, expected); // adding a global logger will not work in applet context + assertEquals(logger4b, expected); // adding a global logger will not work in applet context + + Logger logger5 = manager.getLogger(""); + Logger logger5b = manager.getLogger(""); + Logger expectedRoot = (System.getSecurityManager() != null + ? LogManager.getLogManager().getLogger("") + : null); + assertEquals(logger5, expectedRoot); + assertEquals(logger5b, expectedRoot); + + } + } + + /** + * This test is designed to test the behavior of additional LogManager instances. + * It must be noted that if the security manager is off, then calling + * Bridge.changeContext() has actually no effect - which explains why we have + * some differences between the cases security manager on & security manager + * off. + **/ + public static void testSeven() { + for (int i=0; i<3 ; i++) { + Bridge.desactivate(); + LogManager manager = new LogManager() {}; + Logger logger1 = manager.getLogger(""); + Logger logger1b = manager.getLogger(""); + assertNull(logger1); + assertNull(logger1b); + Logger global = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); + manager.addLogger(global); + Logger logger2 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger2b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + assertNotNull(logger2); + assertNotNull(logger2b); + assertEquals(logger2, global); + assertEquals(logger2b, global); + Logger logger3 = manager.getLogger(""); + Logger logger3b = manager.getLogger(""); + assertNull(logger3); + assertNull(logger3b); + Logger root = new Bridge.CustomLogger(""); + manager.addLogger(root); + Logger logger4 = manager.getLogger(""); + Logger logger4b = manager.getLogger(""); + assertNotNull(logger4); + assertNotNull(logger4b); + assertEquals(logger4, root); + assertEquals(logger4b, root); + + Bridge.changeContext(); + + // this is not a supported configuration: + // We are in an applet context with several log managers. + // We haowever need to check our assumptions... + + // Applet context => root logger and global logger are not null. + // root == LogManager.getLogManager().rootLogger + // global == Logger.global + + Logger logger5 = manager.getLogger(""); + Logger logger5b = manager.getLogger(""); + Logger expectedRoot = (System.getSecurityManager() != null + ? LogManager.getLogManager().getLogger("") + : root); + + assertNotNull(logger5); + assertNotNull(logger5b); + assertEquals(logger5, expectedRoot); + assertEquals(logger5b, expectedRoot); + if (System.getSecurityManager() != null) { + assertNotEquals(logger5, root); + assertNotEquals(logger5b, root); + } + + Logger global2 = new Bridge.CustomLogger(Logger.GLOBAL_LOGGER_NAME); + manager.addLogger(global2); // adding a global logger will not work in applet context + // we will always get back the global logger. + // this could be considered as a bug... + Logger logger6 = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger logger6b = manager.getLogger(Logger.GLOBAL_LOGGER_NAME); + Logger expectedGlobal = (System.getSecurityManager() != null + ? Logger.getGlobal() + : global); + assertNotNull(logger6); + assertNotNull(logger6b); + assertEquals(logger6, expectedGlobal); // adding a global logger will not work in applet context + assertEquals(logger6b, expectedGlobal); // adding a global logger will not work in applet context + + Logger root2 = new Bridge.CustomLogger(""); + manager.addLogger(root2); // adding a root logger will not work in applet context + // we will always get back the default manager's root logger. + // this could be considered as a bug... + Logger logger7 = manager.getLogger(""); + Logger logger7b = manager.getLogger(""); + assertNotNull(logger7); + assertNotNull(logger7b); + assertEquals(logger7, expectedRoot); // adding a global logger will not work in applet context + assertEquals(logger7b, expectedRoot); // adding a global logger will not work in applet context + assertNotEquals(logger7, root2); + assertNotEquals(logger7b, root2); + } + } + + public static void testParent(Logger logger) { + Logger l = logger; + while (l.getParent() != null) { + l = l.getParent(); + } + assertEquals("", l.getName()); + } + + public static class TestError extends RuntimeException { + public TestError(String msg) { + super(msg); + } + } + + public static void assertNotNull(Object obj) { + if (obj == null) throw new NullPointerException(); + } + + public static void assertNull(Object obj) { + if (obj != null) throw new TestError("Null expected, got "+obj); + } + + public static void assertEquals(Object o1, Object o2) { + if (o1 != o2) { + throw new TestError(o1 + " != " + o2); + } + } + + public static void assertNotEquals(Object o1, Object o2) { + if (o1 == o2) { + throw new TestError(o1 + " == " + o2); + } + } +} diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java b/jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java index da108752d26..0eb7c874249 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/DoubleStreamTestDataProvider.java @@ -92,15 +92,6 @@ public class DoubleStreamTestDataProvider { } list.add(new Object[]{"SpinedList:" + name, TestData.Factory.ofSpinedBuffer("SpinedList:" + name, isl)}); - - list.add(streamDataDescr("Primitives.range(0,l): " + doubles.length, - () -> DoubleStream.range(0, doubles.length))); - list.add(streamDataDescr("Primitives.range(0,l,2): " + doubles.length, - () -> DoubleStream.range(0, doubles.length, 2))); - list.add(streamDataDescr("Primitives.range(0,l,3): " + doubles.length, - () -> DoubleStream.range(0, doubles.length, 3))); - list.add(streamDataDescr("Primitives.range(0,l,7): " + doubles.length, - () -> DoubleStream.range(0, doubles.length, 7))); } testData = list.toArray(new Object[0][]); } @@ -128,15 +119,6 @@ public class DoubleStreamTestDataProvider { () -> Spliterators.spliterator(isl.iterator(), doubles.length, 0))); spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator()):" + name, () -> Spliterators.spliteratorUnknownSize(isl.iterator(), 0))); - - spliterators.add(splitDescr("Primitives.range(0,l):" + name, - () -> DoubleStream.range(0, doubles.length).spliterator())); - spliterators.add(splitDescr("Primitives.range(0,l,2):" + name, - () -> DoubleStream.range(0, doubles.length, 2).spliterator())); - spliterators.add(splitDescr("Primitives.range(0,l,3):" + name, - () -> DoubleStream.range(0, doubles.length, 3).spliterator())); - spliterators.add(splitDescr("Primitives.range(0,l,7):" + name, - () -> DoubleStream.range(0, doubles.length, 7).spliterator())); // Need more! } spliteratorTestData = spliterators.toArray(new Object[0][]); @@ -144,10 +126,6 @@ public class DoubleStreamTestDataProvider { } - static Object[] streamDataDescr(String description, Supplier s) { - return new Object[] { description, TestData.Factory.ofDoubleSupplier(description, s) }; - } - static Object[] splitDescr(String description, Supplier s) { return new Object[] { description, s }; } diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java b/jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java index 3ef2acfbe34..dded670d167 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/IntStreamTestDataProvider.java @@ -95,12 +95,8 @@ public class IntStreamTestDataProvider { list.add(streamDataDescr("IntStream.intRange(0,l): " + ints.length, () -> IntStream.range(0, ints.length))); - list.add(streamDataDescr("IntStream.intRange(0,l,2): " + ints.length, - () -> IntStream.range(0, ints.length, 2))); - list.add(streamDataDescr("IntStream.intRange(0,l,3): " + ints.length, - () -> IntStream.range(0, ints.length, 3))); - list.add(streamDataDescr("IntStream.intRange(0,l,7): " + ints.length, - () -> IntStream.range(0, ints.length, 7))); + list.add(streamDataDescr("IntStream.rangeClosed(0,l): " + ints.length, + () -> IntStream.rangeClosed(0, ints.length))); } testData = list.toArray(new Object[0][]); } @@ -131,13 +127,8 @@ public class IntStreamTestDataProvider { spliterators.add(splitDescr("IntStream.intRange(0,l):" + name, () -> IntStream.range(0, ints.length).spliterator())); - spliterators.add(splitDescr("IntStream.intRange(0,l,2):" + name, - () -> IntStream.range(0, ints.length, 2).spliterator())); - spliterators.add(splitDescr("IntStream.intRange(0,l,3):" + name, - () -> IntStream.range(0, ints.length, 3).spliterator())); - spliterators.add(splitDescr("IntStream.intRange(0,l,7):" + name, - () -> IntStream.range(0, ints.length, 7).spliterator())); - + spliterators.add(splitDescr("IntStream.intRangeClosed(0,l):" + name, + () -> IntStream.rangeClosed(0, ints.length).spliterator())); // Need more! } spliteratorTestData = spliterators.toArray(new Object[0][]); diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java b/jdk/test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java index f1d8ffe81c6..225cbf147f6 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/LambdaTestHelpers.java @@ -269,7 +269,7 @@ public class LambdaTestHelpers { Set uniq = new HashSet<>(); while(iter.hasNext()) { T each = iter.next(); - assertTrue(!uniq.contains(each)); + assertTrue(!uniq.contains(each), "Not unique"); uniq.add(each); } } diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/LoggingTestCase.java b/jdk/test/java/util/stream/bootlib/java/util/stream/LoggingTestCase.java new file mode 100644 index 00000000000..a0f221929ad --- /dev/null +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/LoggingTestCase.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.util.stream; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.testng.Assert; +import org.testng.ITestResult; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * LoggingTestCase + * + */ +@Test +public class LoggingTestCase extends Assert { + private Map context = new HashMap<>(); + + @BeforeMethod + public void before() { + context.clear(); + } + + @AfterMethod + public void after(ITestResult result) { + if (!result.isSuccess()) { + List list = new ArrayList<>(); + Collections.addAll(list, result.getParameters()); + list.add(context.toString()); + result.setParameters(list.toArray(new Object[list.size()])); + } + } + + protected void setContext(String key, Object value) { + context.put(key, value); + } + + protected void clearContext(String key) { + context.remove(key); + } +} diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java b/jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java index f37a1108c50..4ce7ae6d217 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/LongStreamTestDataProvider.java @@ -95,12 +95,8 @@ public class LongStreamTestDataProvider { list.add(streamDataDescr("LongStream.longRange(0,l): " + longs.length, () -> LongStream.range(0, longs.length))); - list.add(streamDataDescr("LongStream.longRange(0,l,2): " + longs.length, - () -> LongStream.range(0, longs.length, 2))); - list.add(streamDataDescr("LongStream.longRange(0,l,3): " + longs.length, - () -> LongStream.range(0, longs.length, 3))); - list.add(streamDataDescr("LongStream.longRange(0,l,7): " + longs.length, - () -> LongStream.range(0, longs.length, 7))); + list.add(streamDataDescr("LongStream.longRangeClosed(0,l): " + longs.length, + () -> LongStream.rangeClosed(0, longs.length))); } testData = list.toArray(new Object[0][]); } @@ -131,12 +127,8 @@ public class LongStreamTestDataProvider { spliterators.add(splitDescr("LongStream.longRange(0,l):" + name, () -> LongStream.range(0, longs.length).spliterator())); - spliterators.add(splitDescr("LongStream.longRange(0,l,2):" + name, - () -> LongStream.range(0, longs.length, 2).spliterator())); - spliterators.add(splitDescr("LongStream.longRange(0,l,3):" + name, - () -> LongStream.range(0, longs.length, 3).spliterator())); - spliterators.add(splitDescr("LongStream.longRange(0,l,7):" + name, - () -> LongStream.range(0, longs.length, 7).spliterator())); + spliterators.add(splitDescr("LongStream.longRangeClosed(0,l):" + name, + () -> LongStream.rangeClosed(0, longs.length).spliterator())); // Need more! } spliteratorTestData = spliterators.toArray(new Object[0][]); diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java b/jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java index 763b8838b5d..115a37dc6c5 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/OpTestCase.java @@ -50,7 +50,7 @@ import org.testng.annotations.Test; * ways and asserts that they produce equivalent results. */ @Test -public abstract class OpTestCase extends Assert { +public abstract class OpTestCase extends LoggingTestCase { private final Map> testScenarios; @@ -67,6 +67,25 @@ public abstract class OpTestCase extends Assert { return ((AbstractPipeline) s).getStreamFlags(); } + /** + * An asserter for results produced when exercising of stream or terminal + * tests. + * + * @param the type of result to assert on + */ + public interface ResultAsserter { + /** + * Assert a result produced when exercising of stream or terminal + * test. + * + * @param actual the actual result + * @param expected the expected result + * @param isOrdered true if the pipeline is ordered + * @param isParallel true if the pipeline is parallel + */ + void assertResult(R actual, R expected, boolean isOrdered, boolean isParallel); + } + // Exercise stream operations public interface BaseStreamTestScenario { @@ -190,14 +209,19 @@ public abstract class OpTestCase extends Assert { Set testSet = new HashSet<>(); Collection refResult; - boolean isOrdered; Consumer> before = LambdaTestHelpers.bEmpty; Consumer> after = LambdaTestHelpers.bEmpty; - BiConsumer, Iterable> sequentialEqualityAsserter = LambdaTestHelpers::assertContentsEqual; - BiConsumer, Iterable> parallelEqualityAsserter = LambdaTestHelpers::assertContentsEqual; + ResultAsserter> resultAsserter = (act, exp, ord, par) -> { + if (par & !ord) { + LambdaTestHelpers.assertContentsUnordered(act, exp); + } + else { + LambdaTestHelpers.assertContentsEqual(act, exp); + } + }; private ExerciseDataStreamBuilder(TestData data, Function m) { this.data = data; @@ -211,10 +235,6 @@ public abstract class OpTestCase extends Assert { testSet.addAll(testScenarios.get(shape)); } - public BiConsumer, Iterable> getEqualityAsserter(BaseStreamTestScenario t) { - return t.isParallel() ? parallelEqualityAsserter : sequentialEqualityAsserter; - } - // public > ExerciseDataStreamBuilder expectedResult(I expectedResult) { @@ -299,29 +319,15 @@ public abstract class OpTestCase extends Assert { return this; } - public ExerciseDataStreamBuilder sequentialEqualityAsserter(BiConsumer, Iterable> equalator) { - this.sequentialEqualityAsserter = equalator; - return this; - } - - public ExerciseDataStreamBuilder parallelEqualityAsserter(BiConsumer, Iterable> equalator) { - this.parallelEqualityAsserter = equalator; + public ExerciseDataStreamBuilder resultAsserter(ResultAsserter> resultAsserter) { + this.resultAsserter = resultAsserter; return this; } // Build method - private long count(StreamShape shape, BaseStream s) { - switch (shape) { - case REFERENCE: return ((Stream) s).count(); - case INT_VALUE: return ((IntStream) s).count(); - case LONG_VALUE: return ((LongStream) s).count(); - case DOUBLE_VALUE: return ((DoubleStream) s).count(); - default: throw new IllegalStateException("Unknown shape: " + shape); - } - } - public Collection exercise() { + final boolean isOrdered; if (refResult == null) { // Induce the reference result before.accept(data); @@ -330,9 +336,10 @@ public abstract class OpTestCase extends Assert { Node refNodeResult = ((AbstractPipeline) sOut).evaluateToArrayNode(size -> (U[]) new Object[size]); refResult = LambdaTestHelpers.toBoxedList(refNodeResult.spliterator()); after.accept(data); - S_OUT anotherCopy = m.apply(data.stream()); - long count = count(((AbstractPipeline) anotherCopy).getOutputShape(), anotherCopy); - assertEquals(count, refNodeResult.count()); + } + else { + S_OUT sOut = m.apply(data.stream()); + isOrdered = StreamOpFlag.ORDERED.isKnown(((AbstractPipeline) sOut).getStreamFlags()); } List errors = new ArrayList<>(); @@ -343,16 +350,20 @@ public abstract class OpTestCase extends Assert { List result = new ArrayList<>(); test.run(data, LambdaTestHelpers.toBoxingConsumer(result::add), m); - Runnable asserter = () -> getEqualityAsserter(test).accept(result, refResult); - if (test.isParallel() && !isOrdered) - asserter = () -> LambdaTestHelpers.assertContentsUnordered(result, refResult); - LambdaTestHelpers.launderAssertion( - asserter, - () -> String.format("%n%s: %s != %s", test, refResult, result)); + Runnable asserter = () -> resultAsserter.assertResult(result, refResult, isOrdered, test.isParallel()); + + if (refResult.size() > 1000) { + LambdaTestHelpers.launderAssertion( + asserter, + () -> String.format("%n%s: [actual size=%d] != [expected size=%d]", test, result.size(), refResult.size())); + } + else { + LambdaTestHelpers.launderAssertion( + asserter, + () -> String.format("%n%s: [actual] %s != [expected] %s", test, result, refResult)); + } after.accept(data); -// } catch (AssertionError ae) { -// errors.add(ae); } catch (Throwable t) { errors.add(new Error(String.format("%s: %s", test, t), t)); } @@ -406,8 +417,7 @@ public abstract class OpTestCase extends Assert { Set testSet = EnumSet.allOf(TerminalTestScenario.class); - Function> sequentialEqualityAsserter = s -> LambdaTestHelpers::assertContentsEqual; - Function> parallelEqualityAsserter = s -> LambdaTestHelpers::assertContentsEqual; + ResultAsserter resultAsserter = (act, exp, ord, par) -> LambdaTestHelpers.assertContentsEqual(act, exp); private ExerciseDataTerminalBuilder(TestData data, Function streamF, Function terminalF) { this.data = data; @@ -423,23 +433,12 @@ public abstract class OpTestCase extends Assert { } public ExerciseDataTerminalBuilder equalator(BiConsumer equalityAsserter) { - this.sequentialEqualityAsserter = s -> equalityAsserter; - this.parallelEqualityAsserter = s -> equalityAsserter; + resultAsserter = (act, exp, ord, par) -> equalityAsserter.accept(act, exp); return this; } - public ExerciseDataTerminalBuilder sequentialEqualityAsserter(BiConsumer equalityAsserter) { - this.sequentialEqualityAsserter = s -> equalityAsserter; - return this; - } - - public ExerciseDataTerminalBuilder parallelEqualityAsserter(BiConsumer equalityAsserter) { - this.parallelEqualityAsserter = s -> equalityAsserter; - return this; - } - - public ExerciseDataTerminalBuilder parallelEqualityAsserter(Function> equalatorProvider) { - this.parallelEqualityAsserter = equalatorProvider; + public ExerciseDataTerminalBuilder resultAsserter(ResultAsserter resultAsserter) { + this.resultAsserter = resultAsserter; return this; } @@ -467,8 +466,9 @@ public abstract class OpTestCase extends Assert { // Build method public R exercise() { - S_OUT out = streamF.apply(data.stream()); + S_OUT out = streamF.apply(data.stream()).sequential(); AbstractPipeline ap = (AbstractPipeline) out; + boolean isOrdered = StreamOpFlag.ORDERED.isKnown(ap.getStreamFlags()); StreamShape shape = ap.getOutputShape(); Node node = ap.evaluateToArrayNode(size -> (U[]) new Object[size]); @@ -481,9 +481,8 @@ public abstract class OpTestCase extends Assert { S_OUT source = (S_OUT) createPipeline(shape, node.spliterator(), StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SIZED, false); - BiConsumer asserter = sequentialEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, false), () -> String.format("Single sequential: %s != %s", refResult, result)); } @@ -491,11 +490,10 @@ public abstract class OpTestCase extends Assert { S_OUT source = (S_OUT) createPipeline(shape, node.spliterator(), StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SIZED, false); - // Force short-curcuit + // Force short-circuit source = (S_OUT) chain(source, new ShortCircuitOp(shape)); - BiConsumer asserter = sequentialEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, false), () -> String.format("Single sequential pull: %s != %s", refResult, result)); } @@ -503,44 +501,39 @@ public abstract class OpTestCase extends Assert { S_OUT source = (S_OUT) createPipeline(shape, node.spliterator(), StreamOpFlag.IS_ORDERED | StreamOpFlag.IS_SIZED, true); - BiConsumer asserter = parallelEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, true), () -> String.format("Single parallel: %s != %s", refResult, result)); } if (testSet.contains(TerminalTestScenario.ALL_SEQUENTIAL)) { // This may forEach or tryAdvance depending on the terminal op implementation S_OUT source = streamF.apply(data.stream()); - BiConsumer asserter = sequentialEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, false), () -> String.format("All sequential: %s != %s", refResult, result)); } if (testSet.contains(TerminalTestScenario.ALL_SEQUENTIAL_SHORT_CIRCUIT)) { S_OUT source = streamF.apply(data.stream()); - // Force short-curcuit + // Force short-circuit source = (S_OUT) chain(source, new ShortCircuitOp(shape)); - BiConsumer asserter = sequentialEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, false), () -> String.format("All sequential pull: %s != %s", refResult, result)); } if (testSet.contains(TerminalTestScenario.ALL_PARALLEL)) { S_OUT source = streamF.apply(data.parallelStream()); - BiConsumer asserter = parallelEqualityAsserter.apply(source); R result = terminalF.apply(source); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, true), () -> String.format("All parallel: %s != %s", refResult, result)); } if (testSet.contains(TerminalTestScenario.ALL_PARALLEL_SEQUENTIAL)) { S_OUT source = streamF.apply(data.parallelStream()); - BiConsumer asserter = parallelEqualityAsserter.apply(source); R result = terminalF.apply(source.sequential()); - LambdaTestHelpers.launderAssertion(() -> asserter.accept(refResult, result), + LambdaTestHelpers.launderAssertion(() -> resultAsserter.assertResult(result, refResult, isOrdered, false), () -> String.format("All parallel then sequential: %s != %s", refResult, result)); } diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java b/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java index 8cadf5fd824..4d221735315 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/SpliteratorTestHelper.java @@ -42,11 +42,33 @@ import static org.testng.Assert.fail; */ public class SpliteratorTestHelper { + public interface ContentAsserter { + void assertContents(Collection actual, Collection expected, boolean isOrdered); + } + + private static ContentAsserter DEFAULT_CONTENT_ASSERTER + = SpliteratorTestHelper::assertContents; + + @SuppressWarnings("unchecked") + private static ContentAsserter defaultContentAsserter() { + return (ContentAsserter) DEFAULT_CONTENT_ASSERTER; + } + public static void testSpliterator(Supplier> supplier) { - testSpliterator(supplier, (Consumer b) -> b); + testSpliterator(supplier, defaultContentAsserter()); + } + + public static void testSpliterator(Supplier> supplier, + ContentAsserter asserter) { + testSpliterator(supplier, (Consumer b) -> b, asserter); } public static void testIntSpliterator(Supplier supplier) { + testIntSpliterator(supplier, defaultContentAsserter()); + } + + public static void testIntSpliterator(Supplier supplier, + ContentAsserter asserter) { class BoxingAdapter implements Consumer, IntConsumer { private final Consumer b; @@ -65,10 +87,15 @@ public class SpliteratorTestHelper { } } - testSpliterator(supplier, c -> new BoxingAdapter(c)); + testSpliterator(supplier, BoxingAdapter::new, asserter); } public static void testLongSpliterator(Supplier supplier) { + testLongSpliterator(supplier, defaultContentAsserter()); + } + + public static void testLongSpliterator(Supplier supplier, + ContentAsserter asserter) { class BoxingAdapter implements Consumer, LongConsumer { private final Consumer b; @@ -87,10 +114,15 @@ public class SpliteratorTestHelper { } } - testSpliterator(supplier, c -> new BoxingAdapter(c)); + testSpliterator(supplier, BoxingAdapter::new, asserter); } public static void testDoubleSpliterator(Supplier supplier) { + testDoubleSpliterator(supplier, defaultContentAsserter()); + } + + public static void testDoubleSpliterator(Supplier supplier, + ContentAsserter asserter) { class BoxingAdapter implements Consumer, DoubleConsumer { private final Consumer b; @@ -109,11 +141,12 @@ public class SpliteratorTestHelper { } } - testSpliterator(supplier, c -> new BoxingAdapter(c)); + testSpliterator(supplier, BoxingAdapter::new, asserter); } static > void testSpliterator(Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { ArrayList fromForEach = new ArrayList<>(); Spliterator spliterator = supplier.get(); Consumer addToFromForEach = boxingAdapter.apply(fromForEach::add); @@ -121,14 +154,14 @@ public class SpliteratorTestHelper { Collection exp = Collections.unmodifiableList(fromForEach); - testForEach(exp, supplier, boxingAdapter); - testTryAdvance(exp, supplier, boxingAdapter); - testMixedTryAdvanceForEach(exp, supplier, boxingAdapter); - testMixedTraverseAndSplit(exp, supplier, boxingAdapter); + testForEach(exp, supplier, boxingAdapter, asserter); + testTryAdvance(exp, supplier, boxingAdapter, asserter); + testMixedTryAdvanceForEach(exp, supplier, boxingAdapter, asserter); + testMixedTraverseAndSplit(exp, supplier, boxingAdapter, asserter); testSplitAfterFullTraversal(supplier, boxingAdapter); - testSplitOnce(exp, supplier, boxingAdapter); - testSplitSixDeep(exp, supplier, boxingAdapter); - testSplitUntilNull(exp, supplier, boxingAdapter); + testSplitOnce(exp, supplier, boxingAdapter, asserter); + testSplitSixDeep(exp, supplier, boxingAdapter, asserter); + testSplitUntilNull(exp, supplier, boxingAdapter, asserter); } // @@ -136,7 +169,8 @@ public class SpliteratorTestHelper { private static > void testForEach( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); long sizeIfKnown = spliterator.getExactSizeIfKnown(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -159,13 +193,14 @@ public class SpliteratorTestHelper { } assertEquals(fromForEach.size(), exp.size()); - assertContents(fromForEach, exp, isOrdered); + asserter.assertContents(fromForEach, exp, isOrdered); } private static > void testTryAdvance( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); long sizeIfKnown = spliterator.getExactSizeIfKnown(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -188,13 +223,14 @@ public class SpliteratorTestHelper { } assertEquals(fromTryAdvance.size(), exp.size()); - assertContents(fromTryAdvance, exp, isOrdered); + asserter.assertContents(fromTryAdvance, exp, isOrdered); } private static > void testMixedTryAdvanceForEach( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); long sizeIfKnown = spliterator.getExactSizeIfKnown(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -218,18 +254,14 @@ public class SpliteratorTestHelper { } assertEquals(dest.size(), exp.size()); - if (isOrdered) { - assertEquals(dest, exp); - } - else { - assertContentsUnordered(dest, exp); - } + asserter.assertContents(dest, exp, isOrdered); } private static > void testMixedTraverseAndSplit( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); long sizeIfKnown = spliterator.getExactSizeIfKnown(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -266,12 +298,7 @@ public class SpliteratorTestHelper { } assertEquals(dest.size(), exp.size()); - if (isOrdered) { - assertEquals(dest, exp); - } - else { - assertContentsUnordered(dest, exp); - } + asserter.assertContents(dest, exp, isOrdered); } private static > void testSplitAfterFullTraversal( @@ -285,16 +312,14 @@ public class SpliteratorTestHelper { // Full traversal using forEach spliterator = supplier.get(); - spliterator.forEachRemaining(boxingAdapter.apply(e -> { - })); + spliterator.forEachRemaining(boxingAdapter.apply(e -> { })); split = spliterator.trySplit(); assertNull(split); // Full traversal using tryAdvance then forEach spliterator = supplier.get(); spliterator.tryAdvance(boxingAdapter.apply(e -> { })); - spliterator.forEachRemaining(boxingAdapter.apply(e -> { - })); + spliterator.forEachRemaining(boxingAdapter.apply(e -> { })); split = spliterator.trySplit(); assertNull(split); } @@ -302,7 +327,8 @@ public class SpliteratorTestHelper { private static > void testSplitOnce( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); long sizeIfKnown = spliterator.getExactSizeIfKnown(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -322,13 +348,15 @@ public class SpliteratorTestHelper { if (s1Size >= 0 && s2Size >= 0) assertEquals(sizeIfKnown, s1Size + s2Size); } - assertContents(fromSplit, exp, isOrdered); + + asserter.assertContents(fromSplit, exp, isOrdered); } private static > void testSplitSixDeep( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { S spliterator = supplier.get(); boolean isOrdered = spliterator.hasCharacteristics(Spliterator.ORDERED); @@ -340,13 +368,13 @@ public class SpliteratorTestHelper { // verify splitting with forEach splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), false); - assertContents(dest, exp, isOrdered); + asserter.assertContents(dest, exp, isOrdered); // verify splitting with tryAdvance dest.clear(); spliterator = supplier.get(); splitSixDeepVisitor(depth, 0, dest, spliterator, boxingAdapter, spliterator.characteristics(), true); - assertContents(dest, exp, isOrdered); + asserter.assertContents(dest, exp, isOrdered); } } @@ -411,7 +439,8 @@ public class SpliteratorTestHelper { private static > void testSplitUntilNull( Collection exp, Supplier supplier, - UnaryOperator> boxingAdapter) { + UnaryOperator> boxingAdapter, + ContentAsserter asserter) { Spliterator s = supplier.get(); boolean isOrdered = s.hasCharacteristics(Spliterator.ORDERED); assertSpliterator(s); @@ -420,7 +449,7 @@ public class SpliteratorTestHelper { Consumer c = boxingAdapter.apply(splits::add); testSplitUntilNull(new SplitNode(c, s)); - assertContents(splits, exp, isOrdered); + asserter.assertContents(splits, exp, isOrdered); } private static class SplitNode { @@ -540,23 +569,10 @@ public class SpliteratorTestHelper { assertEquals(actual, expected); } else { - assertContentsUnordered(actual, expected); + LambdaTestHelpers.assertContentsUnordered(actual, expected); } } - private static void assertContentsUnordered(Iterable actual, Iterable expected) { - assertEquals(toBoxedMultiset(actual), toBoxedMultiset(expected)); - } - - private static Map toBoxedMultiset(Iterable c) { - Map result = new HashMap<>(); - c.forEach(e -> { - if (result.containsKey(e)) result.put(e, result.get(e) + 1); - else result.put(e, 1); - }); - return result; - } - static void mixedTraverseAndSplit(Consumer b, Spliterator splTop) { Spliterator spl1, spl2, spl3; splTop.tryAdvance(b); diff --git a/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java b/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java index e8b65d2bdf0..c204b318ed6 100644 --- a/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java +++ b/jdk/test/java/util/stream/bootlib/java/util/stream/TestData.java @@ -45,7 +45,7 @@ public interface TestData> @Override default Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } Spliterator spliterator(); @@ -292,7 +292,7 @@ public interface TestData> @Override public PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -317,7 +317,7 @@ public interface TestData> @Override public PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -342,7 +342,7 @@ public interface TestData> @Override public PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java index 7ad4801e421..c1e8a309e89 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/DoubleNodeTest.java @@ -48,7 +48,7 @@ public class DoubleNodeTest extends OpTestCase { List> nodes = new ArrayList<>(); nodes.add(Nodes.node(array)); - nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array)))); + nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); nodes.add(tree(toList(array), l -> Nodes.node(toDoubleArray(l)))); nodes.add(fill(array, Nodes.doubleBuilder(array.length))); nodes.add(fill(array, Nodes.doubleBuilder())); @@ -102,7 +102,7 @@ public class DoubleNodeTest extends OpTestCase { double i = it.nextDouble(); if (it.hasNext()) { - return new Nodes.DoubleConcNode(Nodes.node(new double[] {i}), degenerateTree(it)); + return new Nodes.ConcNode.OfDouble(Nodes.node(new double[] {i}), degenerateTree(it)); } else { return Nodes.node(new double[] {i}); @@ -114,7 +114,7 @@ public class DoubleNodeTest extends OpTestCase { return m.apply(l); } else { - return new Nodes.DoubleConcNode( + return new Nodes.ConcNode.OfDouble( tree(l.subList(0, l.size() / 2), m), tree(l.subList(l.size() / 2, l.size()), m)); } @@ -122,12 +122,12 @@ public class DoubleNodeTest extends OpTestCase { @Test(dataProvider = "nodes") public void testAsArray(double[] array, Node.OfDouble n) { - assertEquals(n.asDoubleArray(), array); + assertEquals(n.asPrimitiveArray(), array); } @Test(dataProvider = "nodes") public void testFlattenAsArray(double[] array, Node.OfDouble n) { - assertEquals(Nodes.flattenDouble(n).asDoubleArray(), array); + assertEquals(Nodes.flattenDouble(n).asPrimitiveArray(), array); } @Test(dataProvider = "nodes") @@ -162,4 +162,18 @@ public class DoubleNodeTest extends OpTestCase { public void testSpliterator(double[] array, Node.OfDouble n) { SpliteratorTestHelper.testDoubleSpliterator(n::spliterator); } + + @Test(dataProvider = "nodes") + public void testTruncate(double[] array, Node.OfDouble n) { + int[] nums = new int[] { 0, 1, array.length / 2, array.length - 1, array.length }; + for (int start : nums) + for (int end : nums) { + if (start < 0 || end < 0 || end < start || end > array.length) + continue; + Node.OfDouble slice = n.truncate(start, end, Double[]::new); + double[] asArray = slice.asPrimitiveArray(); + for (int k = start; k < end; k++) + assertEquals(array[k], asArray[k - start]); + } + } } diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java index 0d345ad451a..e050e63d37b 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/IntNodeTest.java @@ -48,7 +48,7 @@ public class IntNodeTest extends OpTestCase { List> nodes = new ArrayList<>(); nodes.add(Nodes.node(array)); - nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array)))); + nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); nodes.add(tree(toList(array), l -> Nodes.node(toIntArray(l)))); nodes.add(fill(array, Nodes.intBuilder(array.length))); nodes.add(fill(array, Nodes.intBuilder())); @@ -102,7 +102,7 @@ public class IntNodeTest extends OpTestCase { int i = it.nextInt(); if (it.hasNext()) { - return new Nodes.IntConcNode(Nodes.node(new int[] {i}), degenerateTree(it)); + return new Nodes.ConcNode.OfInt(Nodes.node(new int[] {i}), degenerateTree(it)); } else { return Nodes.node(new int[] {i}); @@ -114,7 +114,7 @@ public class IntNodeTest extends OpTestCase { return m.apply(l); } else { - return new Nodes.IntConcNode( + return new Nodes.ConcNode.OfInt( tree(l.subList(0, l.size() / 2), m), tree(l.subList(l.size() / 2, l.size()), m)); } @@ -122,12 +122,12 @@ public class IntNodeTest extends OpTestCase { @Test(dataProvider = "nodes") public void testAsArray(int[] array, Node.OfInt n) { - assertEquals(n.asIntArray(), array); + assertEquals(n.asPrimitiveArray(), array); } @Test(dataProvider = "nodes") public void testFlattenAsArray(int[] array, Node.OfInt n) { - assertEquals(Nodes.flattenInt(n).asIntArray(), array); + assertEquals(Nodes.flattenInt(n).asPrimitiveArray(), array); } @Test(dataProvider = "nodes") @@ -160,4 +160,18 @@ public class IntNodeTest extends OpTestCase { public void testSpliterator(int[] array, Node.OfInt n) { SpliteratorTestHelper.testIntSpliterator(n::spliterator); } + + @Test(dataProvider = "nodes") + public void testTruncate(int[] array, Node.OfInt n) { + int[] nums = new int[] { 0, 1, array.length / 2, array.length - 1, array.length }; + for (int start : nums) + for (int end : nums) { + if (start < 0 || end < 0 || end < start || end > array.length) + continue; + Node.OfInt slice = n.truncate(start, end, Integer[]::new); + int[] asArray = slice.asPrimitiveArray(); + for (int k = start; k < end; k++) + assertEquals(array[k], asArray[k - start]); + } + } } diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java index 0b101a04ad9..d266fd7d04e 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/LongNodeTest.java @@ -48,7 +48,7 @@ public class LongNodeTest extends OpTestCase { List> nodes = new ArrayList<>(); nodes.add(Nodes.node(array)); - nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array)))); + nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array)))); nodes.add(tree(toList(array), l -> Nodes.node(toLongArray(l)))); nodes.add(fill(array, Nodes.longBuilder(array.length))); nodes.add(fill(array, Nodes.longBuilder())); @@ -102,7 +102,7 @@ public class LongNodeTest extends OpTestCase { long i = it.nextLong(); if (it.hasNext()) { - return new Nodes.LongConcNode(Nodes.node(new long[] {i}), degenerateTree(it)); + return new Nodes.ConcNode.OfLong(Nodes.node(new long[] {i}), degenerateTree(it)); } else { return Nodes.node(new long[] {i}); @@ -114,7 +114,7 @@ public class LongNodeTest extends OpTestCase { return m.apply(l); } else { - return new Nodes.LongConcNode( + return new Nodes.ConcNode.OfLong( tree(l.subList(0, l.size() / 2), m), tree(l.subList(l.size() / 2, l.size()), m)); } @@ -122,12 +122,12 @@ public class LongNodeTest extends OpTestCase { @Test(dataProvider = "nodes") public void testAsArray(long[] array, Node.OfLong n) { - assertEquals(n.asLongArray(), array); + assertEquals(n.asPrimitiveArray(), array); } @Test(dataProvider = "nodes") public void testFlattenAsArray(long[] array, Node.OfLong n) { - assertEquals(Nodes.flattenLong(n).asLongArray(), array); + assertEquals(Nodes.flattenLong(n).asPrimitiveArray(), array); } @Test(dataProvider = "nodes") @@ -161,4 +161,18 @@ public class LongNodeTest extends OpTestCase { public void testSpliterator(long[] array, Node.OfLong n) { SpliteratorTestHelper.testLongSpliterator(n::spliterator); } + + @Test(dataProvider = "nodes") + public void testTruncate(long[] array, Node.OfLong n) { + int[] nums = new int[] { 0, 1, array.length / 2, array.length - 1, array.length }; + for (int start : nums) + for (int end : nums) { + if (start < 0 || end < 0 || end < start || end > array.length) + continue; + Node.OfLong slice = n.truncate(start, end, Long[]::new); + long[] asArray = slice.asPrimitiveArray(); + for (int k = start; k < end; k++) + assertEquals(array[k], asArray[k - start]); + } + } } diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/NodeTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/NodeTest.java index 8f5bff5cb66..da710033fda 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/NodeTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/NodeTest.java @@ -137,4 +137,18 @@ public class NodeTest extends OpTestCase { public void testSpliterator(Integer[] array, Node n) { SpliteratorTestHelper.testSpliterator(n::spliterator); } + + @Test(dataProvider = "nodes") + public void testTruncate(Integer[] array, Node n) { + int[] nums = new int[] { 0, 1, array.length / 2, array.length - 1, array.length }; + for (int start : nums) + for (int end : nums) { + if (start < 0 || end < 0 || end < start || end > array.length) + continue; + Node slice = n.truncate(start, end, Integer[]::new); + Integer[] asArray = slice.asArray(Integer[]::new); + for (int k = start; k < end; k++) + assertEquals(array[k], asArray[k - start]); + } + } } diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/SliceSpliteratorTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/SliceSpliteratorTest.java new file mode 100644 index 00000000000..7aa27bf5b88 --- /dev/null +++ b/jdk/test/java/util/stream/boottest/java/util/stream/SliceSpliteratorTest.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.util.stream; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Spliterator; + +import static java.util.stream.Collectors.toList; +import static org.testng.Assert.assertEquals; + +/** + * @bug 8012987 + */ +@Test +public class SliceSpliteratorTest extends LoggingTestCase { + + static class UnorderedContentAsserter implements SpliteratorTestHelper.ContentAsserter { + Collection source; + + UnorderedContentAsserter(Collection source) { + this.source = source; + } + + @Override + public void assertContents(Collection actual, Collection expected, boolean isOrdered) { + if (isOrdered) { + assertEquals(actual, expected); + } + else { + assertEquals(actual.size(), expected.size()); + assertTrue(source.containsAll(actual)); + } + } + } + + interface SliceTester { + void test(int size, int skip, int limit); + } + + @DataProvider(name = "sliceSpliteratorDataProvider") + public static Object[][] sliceSpliteratorDataProvider() { + List data = new ArrayList<>(); + + // SIZED/SUBSIZED slice spliterator + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = IntStream.range(0, size).boxed().collect(toList()); + + SpliteratorTestHelper.testSpliterator(() -> { + Spliterator s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); + + return new StreamSpliterators.SliceSpliterator.OfRef<>(s, skip, limit); + }); + }; + data.add(new Object[]{"StreamSpliterators.SliceSpliterator.OfRef", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = IntStream.range(0, size).boxed().collect(toList()); + + SpliteratorTestHelper.testIntSpliterator(() -> { + Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); + + return new StreamSpliterators.SliceSpliterator.OfInt(s, skip, limit); + }); + }; + data.add(new Object[]{"StreamSpliterators.SliceSpliterator.OfInt", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = LongStream.range(0, size).boxed().collect(toList()); + + SpliteratorTestHelper.testLongSpliterator(() -> { + Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); + + return new StreamSpliterators.SliceSpliterator.OfLong(s, skip, limit); + }); + }; + data.add(new Object[]{"StreamSpliterators.SliceSpliterator.OfLong", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = LongStream.range(0, size).asDoubleStream().boxed().collect(toList()); + + SpliteratorTestHelper.testDoubleSpliterator(() -> { + Spliterator.OfDouble s = Arrays.spliterator(source.stream().mapToDouble(i->i).toArray()); + + return new StreamSpliterators.SliceSpliterator.OfDouble(s, skip, limit); + }); + }; + data.add(new Object[]{"StreamSpliterators.SliceSpliterator.OfLong", r}); + } + + + // Unordered slice spliterator + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = IntStream.range(0, size).boxed().collect(toList()); + final UnorderedContentAsserter uca = new UnorderedContentAsserter<>(source); + + SpliteratorTestHelper.testSpliterator(() -> { + Spliterator s = Arrays.spliterator(source.stream().toArray(Integer[]::new)); + + return new StreamSpliterators.UnorderedSliceSpliterator.OfRef<>(s, skip, limit); + }, uca); + }; + data.add(new Object[]{"StreamSpliterators.UnorderedSliceSpliterator.OfRef", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = IntStream.range(0, size).boxed().collect(toList()); + final UnorderedContentAsserter uca = new UnorderedContentAsserter<>(source); + + SpliteratorTestHelper.testIntSpliterator(() -> { + Spliterator.OfInt s = Arrays.spliterator(source.stream().mapToInt(i->i).toArray()); + + return new StreamSpliterators.UnorderedSliceSpliterator.OfInt(s, skip, limit); + }, uca); + }; + data.add(new Object[]{"StreamSpliterators.UnorderedSliceSpliterator.OfInt", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = LongStream.range(0, size).boxed().collect(toList()); + final UnorderedContentAsserter uca = new UnorderedContentAsserter<>(source); + + SpliteratorTestHelper.testLongSpliterator(() -> { + Spliterator.OfLong s = Arrays.spliterator(source.stream().mapToLong(i->i).toArray()); + + return new StreamSpliterators.UnorderedSliceSpliterator.OfLong(s, skip, limit); + }, uca); + }; + data.add(new Object[]{"StreamSpliterators.UnorderedSliceSpliterator.OfLong", r}); + } + + { + SliceTester r = (size, skip, limit) -> { + final Collection source = LongStream.range(0, size).asDoubleStream().boxed().collect(toList()); + final UnorderedContentAsserter uca = new UnorderedContentAsserter<>(source); + + SpliteratorTestHelper.testDoubleSpliterator(() -> { + Spliterator.OfDouble s = Arrays.spliterator(LongStream.range(0, SIZE).asDoubleStream().toArray()); + + return new StreamSpliterators.UnorderedSliceSpliterator.OfDouble(s, skip, limit); + }, uca); + }; + data.add(new Object[]{"StreamSpliterators.UnorderedSliceSpliterator.OfLong", r}); + } + + return data.toArray(new Object[0][]); + } + + static final int SIZE = 256; + + static final int STEP = 32; + + @Test(dataProvider = "sliceSpliteratorDataProvider") + public void testSliceSpliterator(String description, SliceTester r) { + setContext("size", SIZE); + for (int skip = 0; skip < SIZE; skip += STEP) { + setContext("skip", skip); + for (int limit = 0; limit < SIZE; limit += STEP) { + setContext("limit", skip); + r.test(SIZE, skip, limit); + } + } + } +} diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java index 3fee90b6106..8f9c4ffd886 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java @@ -210,7 +210,7 @@ public class SpinedBufferTest { list2.clear(); sb.forEach((int i) -> list2.add(i)); assertEquals(list1, list2); - int[] array = sb.asIntArray(); + int[] array = sb.asPrimitiveArray(); list2.clear(); for (int i : array) list2.add(i); @@ -285,7 +285,7 @@ public class SpinedBufferTest { list2.clear(); sb.forEach((long i) -> list2.add(i)); assertEquals(list1, list2); - long[] array = sb.asLongArray(); + long[] array = sb.asPrimitiveArray(); list2.clear(); for (long i : array) list2.add(i); @@ -300,7 +300,7 @@ public class SpinedBufferTest { for (int size : sizes) { // @@@ replace with double range when implemented - double[] array = LongStream.range(0, size).doubles().toArray(); + double[] array = LongStream.range(0, size).asDoubleStream().toArray(); SpinedBuffer.OfDouble sb = new SpinedBuffer.OfDouble(); Arrays.stream(array).forEach(sb); @@ -361,7 +361,7 @@ public class SpinedBufferTest { list2.clear(); sb.forEach((double i) -> list2.add(i)); assertEquals(list1, list2); - double[] array = sb.asDoubleArray(); + double[] array = sb.asPrimitiveArray(); list2.clear(); for (double i : array) list2.add(i); diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/StreamFlagsTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/StreamFlagsTest.java index a5fa364e1e0..29243cfb90a 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/StreamFlagsTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/StreamFlagsTest.java @@ -80,8 +80,8 @@ public class StreamFlagsTest { EnumSet.of(ORDERED, DISTINCT, SIZED), EnumSet.of(SORTED, SHORT_CIRCUIT)); assertFlags(OpTestCase.getStreamFlags(repeat), - EnumSet.of(ORDERED), - EnumSet.of(SIZED, DISTINCT, SORTED, SHORT_CIRCUIT)); + EnumSet.noneOf(StreamOpFlag.class), + EnumSet.of(DISTINCT, SORTED, SHORT_CIRCUIT)); } public void testFilter() { diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/UnorderedTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/UnorderedTest.java index 48b4e7576e1..47eb533d8a2 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/UnorderedTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/UnorderedTest.java @@ -184,7 +184,6 @@ public class UnorderedTest extends OpTestCase { UnaryOperator fi = interpose(f, (S s) -> (S) chain(s, checkClearOrderedOp)); withData(data). terminal(fi, terminalF). - without(TerminalTestScenario.ALL_PARALLEL_SEQUENTIAL). equalator(equalityAsserter). exercise(); } @@ -195,7 +194,6 @@ public class UnorderedTest extends OpTestCase { UnaryOperator fi = interpose(f, (S s) -> (S) chain(s, checkSetOrderedOp)); withData(data). terminal(fi, s -> terminalF.apply(s.sequential())). - without(TerminalTestScenario.ALL_PARALLEL_SEQUENTIAL). equalator(equalityAsserter). exercise(); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java index cb492f8003a..ddadacc5a1d 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DistinctOpTest.java @@ -64,7 +64,6 @@ public class DistinctOpTest extends OpTestCase { node = withData(data). stream(s -> s.unordered().distinct()). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). exercise(); assertUnique(node); diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java index 4a66d1a86d4..c476f18c624 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java @@ -44,12 +44,12 @@ public class DoublePrimitiveOpsTests { public void testToArray() { { - double[] array = LongStream.range(1, 10).doubles().map(i -> i * 2).toArray(); + double[] array = LongStream.range(1, 10).asDoubleStream().map(i -> i * 2).toArray(); assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18}); } { - double[] array = LongStream.range(1, 10).parallel().doubles().map(i -> i * 2).toArray(); + double[] array = LongStream.range(1, 10).parallel().asDoubleStream().map(i -> i * 2).toArray(); assertEquals(array, new double[]{2, 4, 6, 8, 10, 12, 14, 16, 18}); } } @@ -99,7 +99,7 @@ public class DoublePrimitiveOpsTests { } { - double[] actual = LongStream.range(1, 100).parallel().doubles().limit(9).toArray(); + double[] actual = LongStream.range(1, 100).parallel().asDoubleStream().limit(9).toArray(); Assert.assertTrue(Arrays.equals(expected, actual)); } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java index dcb88fb61cb..4332a0cc786 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java @@ -110,7 +110,7 @@ public class ExplodeOpTest extends OpTestCase { result = exerciseOps(data, s -> DoubleStream.empty()); assertEquals(0, result.size()); - exerciseOps(data, s -> s.flatMap(e -> DoubleStream.range(0, e))); - exerciseOps(data, s -> s.flatMap(e -> DoubleStream.range(0, e).limit(10))); + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).asDoubleStream())); + exerciseOps(data, s -> s.flatMap(e -> IntStream.range(0, (int) e).limit(10).asDoubleStream())); } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java index 4a078a485da..d5bb72cda5b 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ForEachOpTest.java @@ -58,6 +58,17 @@ public class ForEachOpTest extends OpTestCase { 55); } + private ResultAsserter> resultAsserter() { + return (act, exp, ord, par) -> { + if (par) { + LambdaTestHelpers.assertContentsUnordered(act, exp); + } + else { + LambdaTestHelpers.assertContents(act, exp); + } + }; + } + @Test public void testForEachOrdered() { List input = countTo(10000); @@ -93,13 +104,13 @@ public class ForEachOpTest extends OpTestCase { // Test head withData(data). terminal(terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); // Test multiple stages withData(data). terminal(s -> s.map(LambdaTestHelpers.identity()), terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); } @@ -141,13 +152,13 @@ public class ForEachOpTest extends OpTestCase { // Test head withData(data). terminal(terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); // Test multiple stages withData(data). terminal(s -> s.map(i -> i), terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); } @@ -189,13 +200,13 @@ public class ForEachOpTest extends OpTestCase { // Test head withData(data). terminal(terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); // Test multiple stages withData(data). terminal(s -> s.map(i -> i), terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); } @@ -205,7 +216,7 @@ public class ForEachOpTest extends OpTestCase { public void testDoubleForEachOrdered() { List input = countTo(10000); TestData.OfDouble data = TestData.Factory.ofDoubleSupplier("[1, 10000]", - () -> DoubleStream.range(1, 10001)); + () -> IntStream.range(1, 10001).asDoubleStream()); Function> terminalFunc = s -> { List l = new ArrayList<>(); @@ -237,13 +248,13 @@ public class ForEachOpTest extends OpTestCase { // Test head withData(data). terminal(terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); // Test multiple stages withData(data). terminal(s -> s.map(i -> i), terminalFunc). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). + resultAsserter(resultAsserter()). exercise(); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java index 7c6d6953c18..ce48d27734a 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/GroupByOpTest.java @@ -133,9 +133,16 @@ public class GroupByOpTest extends OpTestCase { Collector>> tab = Collectors.groupingBy(md.m); Map> result = withData(data) - .terminal(s -> s, s -> s.collect(tab)) - .parallelEqualityAsserter(s -> StreamOpFlagTestHelper.isStreamOrdered(s) ? GroupByOpTest::assertObjectEquals : GroupByOpTest::assertMultiMapEquals) - .exercise(); + .terminal(s -> s, s -> s.collect(tab)) + .resultAsserter((act, exp, ord, par) -> { + if (par & !ord) { + GroupByOpTest.assertMultiMapEquals(act, exp); + } + else { + GroupByOpTest.assertObjectEquals(act, exp); + } + }) + .exercise(); assertEquals(result.keySet().size(), md.expectedSize); } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java index a43802cc419..dc086668f54 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java @@ -22,45 +22,440 @@ */ package org.openjdk.tests.java.util.stream; -import java.util.stream.OpTestCase; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import java.util.Arrays; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; +import java.util.Spliterator; +import java.util.function.Function; +import java.util.function.UnaryOperator; +import java.util.stream.DoubleStream; +import java.util.stream.DoubleStreamTestScenario; +import java.util.stream.IntStream; +import java.util.stream.IntStreamTestScenario; +import java.util.stream.LambdaTestHelpers; +import java.util.stream.LongStream; +import java.util.stream.LongStreamTestScenario; +import java.util.stream.OpTestCase; import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import java.util.stream.StreamTestScenario; +import java.util.stream.TestData; -import static java.util.stream.LambdaTestHelpers.assertContents; +import static java.util.stream.LambdaTestHelpers.assertUnique; @Test public class InfiniteStreamWithLimitOpTest extends OpTestCase { - private static final List tenAs = Arrays.asList("A", "A", "A", "A", "A", "A", "A", "A", "A", "A"); + private static final long SKIP_LIMIT_SIZE = 1 << 16; - public void testRepeatLimit() { - assertContents(Stream.generate(() -> "A").limit(10).iterator(), tenAs.iterator()); + @DataProvider(name = "Stream.limit") + @SuppressWarnings("rawtypes") + public static Object[][] sliceFunctionsDataProvider() { + Function f = s -> String.format(s, SKIP_LIMIT_SIZE); + + List data = new ArrayList<>(); + + data.add(new Object[]{f.apply("Stream.limit(%d)"), + (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("Stream.substream(%d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); + data.add(new Object[]{f.apply("Stream.substream(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + + return data.toArray(new Object[0][]); } - public void testIterateLimit() { - assertContents(Stream.iterate("A", s -> s).limit(10).iterator(), tenAs.iterator()); + @DataProvider(name = "IntStream.limit") + public static Object[][] intSliceFunctionsDataProvider() { + Function f = s -> String.format(s, SKIP_LIMIT_SIZE); + + List data = new ArrayList<>(); + + data.add(new Object[]{f.apply("IntStream.limit(%d)"), + (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("IntStream.substream(%d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); + data.add(new Object[]{f.apply("IntStream.substream(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + + return data.toArray(new Object[0][]); } - public void testIterateFibLimit() { - Stream fib = Stream.iterate(new int[] {0, 1}, pair -> new int[] {pair[1], pair[0] + pair[1]}) - .map(pair -> pair[0]); + @DataProvider(name = "LongStream.limit") + public static Object[][] longSliceFunctionsDataProvider() { + Function f = s -> String.format(s, SKIP_LIMIT_SIZE); - assertContents( - fib.limit(10).iterator(), - Arrays.asList(0, 1, 1, 2, 3, 5, 8, 13, 21, 34).iterator()); + List data = new ArrayList<>(); + + data.add(new Object[]{f.apply("LongStream.limit(%d)"), + (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("LongStream.substream(%d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); + data.add(new Object[]{f.apply("LongStream.substream(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + + return data.toArray(new Object[0][]); } - public void testInfiniteWithLimitToShortCircuitTerminal() { - Object[] array = Stream.generate(() -> 1).limit(4).toArray(); - assertEquals(4, array.length); - array = Stream.generate(() -> 1).limit(4).filter(i -> true).toArray(); - assertEquals(4, array.length); - List result = Stream.generate(() -> 1).limit(4).collect(Collectors.toList()); - assertEquals(result, Arrays.asList(1, 1, 1, 1)); + @DataProvider(name = "DoubleStream.limit") + public static Object[][] doubleSliceFunctionsDataProvider() { + Function f = s -> String.format(s, SKIP_LIMIT_SIZE); + + List data = new ArrayList<>(); + + data.add(new Object[]{f.apply("DoubleStream.limit(%d)"), + (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("DoubleStream.substream(%d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); + data.add(new Object[]{f.apply("DoubleStream.substream(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + + return data.toArray(new Object[0][]); + } + + private ResultAsserter> unorderedAsserter() { + return (act, exp, ord, par) -> { + if (par & !ord) { + // Can only assert that all elements of the actual result + // are distinct and that the count is the limit size + // any element within the range [0, Long.MAX_VALUE) may be + // present + assertUnique(act); + long count = 0; + for (T l : act) { + count++; + } + assertEquals(count, SKIP_LIMIT_SIZE, "size not equal"); + } + else { + LambdaTestHelpers.assertContents(act, exp); + } + }; + } + + private TestData.OfRef refLongs() { + return refLongRange(0, Long.MAX_VALUE); + } + + private TestData.OfRef refLongRange(long l, long u) { + return TestData.Factory.ofSupplier( + String.format("[%d, %d)", l, u), + () -> LongStream.range(l, u).boxed()); + } + + private TestData.OfInt ints() { + return intRange(0, Integer.MAX_VALUE); + } + + private TestData.OfInt intRange(int l, int u) { + return TestData.Factory.ofIntSupplier( + String.format("[%d, %d)", l, u), + () -> IntStream.range(l, u)); + } + + private TestData.OfLong longs() { + return longRange(0, Long.MAX_VALUE); + } + + private TestData.OfLong longRange(long l, long u) { + return TestData.Factory.ofLongSupplier( + String.format("[%d, %d)", l, u), + () -> LongStream.range(l, u)); + } + + private TestData.OfDouble doubles() { + return doubleRange(0, 1L << 53); + } + + private TestData.OfDouble doubleRange(long l, long u) { + return TestData.Factory.ofDoubleSupplier( + String.format("[%d, %d)", l, u), + () -> LongStream.range(l, u).mapToDouble(i -> (double) i)); + } + + + // Sized/subsized range + + @Test(dataProvider = "Stream.limit") + public void testSubsizedWithRange(String description, UnaryOperator> fs) { + // Range is [0, Long.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(refLongs()). + stream(s -> fs.apply(s)). + without(StreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED). + exercise(); + } + + @Test(dataProvider = "IntStream.limit") + public void testIntSubsizedWithRange(String description, UnaryOperator fs) { + // Range is [0, Integer.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(ints()). + stream(s -> fs.apply(s)). + without(IntStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED). + exercise(); + } + + @Test(dataProvider = "LongStream.limit") + public void testLongSubsizedWithRange(String description, UnaryOperator fs) { + // Range is [0, Long.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(longs()). + stream(s -> fs.apply(s)). + without(LongStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED). + exercise(); + } + + @Test(dataProvider = "DoubleStream.limit") + public void testDoubleSubsizedWithRange(String description, UnaryOperator fs) { + // Range is [0, 2^53), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(doubles()). + stream(s -> fs.apply(s)). + without(DoubleStreamTestScenario.PAR_STREAM_TO_ARRAY_CLEAR_SIZED). + exercise(); + } + + + // Unordered finite not SIZED/SUBSIZED + + @Test(dataProvider = "Stream.limit") + public void testUnorderedFinite(String description, UnaryOperator> fs) { + // Range is [0, Long.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(longs()). + stream(s -> fs.apply(s.filter(i -> true).unordered().boxed())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "IntStream.limit") + public void testIntUnorderedFinite(String description, UnaryOperator fs) { + // Range is [0, Integer.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(ints()). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "LongStream.limit") + public void testLongUnorderedFinite(String description, UnaryOperator fs) { + // Range is [0, Long.MAX_VALUE), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(longs()). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "DoubleStream.limit") + public void testDoubleUnorderedFinite(String description, UnaryOperator fs) { + // Range is [0, 1L << 53), splits are SUBSIZED + // Such a size will induce out of memory errors for incorrect + // slice implementations + // Upper bound ensures values mapped to doubles will be unique + withData(doubles()). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + + // Unordered finite not SUBSIZED + + @SuppressWarnings({"rawtypes", "unchecked"}) + private Spliterator.OfLong proxyNotSubsized(Spliterator.OfLong s) { + InvocationHandler ih = new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + switch (method.getName()) { + case "characteristics": { + int c = (Integer) method.invoke(s, args); + return c & ~Spliterator.SUBSIZED; + } + case "hasCharacteristics": { + int c = (Integer) args[0]; + boolean b = (Boolean) method.invoke(s, args); + return b & ((c & Spliterator.SUBSIZED) == 0); + } + default: + return method.invoke(s, args); + } + } + }; + + return (Spliterator.OfLong) Proxy.newProxyInstance(this.getClass().getClassLoader(), + new Class[]{Spliterator.OfLong.class}, + ih); + } + + private TestData.OfLong proxiedLongRange(long l, long u) { + return TestData.Factory.ofLongSupplier( + String.format("[%d, %d)", l, u), + () -> StreamSupport.longStream(proxyNotSubsized(LongStream.range(l, u).spliterator()))); + } + + @Test(dataProvider = "Stream.limit") + public void testUnorderedSizedNotSubsizedFinite(String description, UnaryOperator> fs) { + // Range is [0, Long.MAX_VALUE), splits are not SUBSIZED (proxy clears + // the SUBSIZED characteristic) + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(proxiedLongRange(0, Long.MAX_VALUE)). + stream(s -> fs.apply(s.unordered().boxed())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "IntStream.limit") + public void testIntUnorderedSizedNotSubsizedFinite(String description, UnaryOperator fs) { + // Range is [0, Integer.MAX_VALUE), splits are not SUBSIZED (proxy clears + // the SUBSIZED characteristic) + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(proxiedLongRange(0, Integer.MAX_VALUE)). + stream(s -> fs.apply(s.unordered().mapToInt(i -> (int) i))). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "LongStream.limit") + public void testLongUnorderedSizedNotSubsizedFinite(String description, UnaryOperator fs) { + // Range is [0, Long.MAX_VALUE), splits are not SUBSIZED (proxy clears + // the SUBSIZED characteristic) + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(proxiedLongRange(0, Long.MAX_VALUE)). + stream(s -> fs.apply(s.unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "DoubleStream.limit") + public void testDoubleUnorderedSizedNotSubsizedFinite(String description, UnaryOperator fs) { + // Range is [0, Double.MAX_VALUE), splits are not SUBSIZED (proxy clears + // the SUBSIZED characteristic) + // Such a size will induce out of memory errors for incorrect + // slice implementations + withData(proxiedLongRange(0, 1L << 53)). + stream(s -> fs.apply(s.unordered().mapToDouble(i -> (double) i))). + resultAsserter(unorderedAsserter()). + exercise(); + } + + + // Unordered generation + + @Test(dataProvider = "Stream.limit") + public void testUnorderedGenerator(String description, UnaryOperator> fs) { + // Source is spliterator of infinite size + TestData.OfRef generator = TestData.Factory.ofSupplier( + "[1L, 1L, ...]", () -> Stream.generate(() -> 1L)); + + withData(generator). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + exercise(); + } + + @Test(dataProvider = "IntStream.limit") + public void testIntUnorderedGenerator(String description, UnaryOperator fs) { + // Source is spliterator of infinite size + TestData.OfInt generator = TestData.Factory.ofIntSupplier( + "[1, 1, ...]", () -> IntStream.generate(() -> 1)); + + withData(generator). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + exercise(); + } + + @Test(dataProvider = "LongStream.limit") + public void testLongUnorderedGenerator(String description, UnaryOperator fs) { + // Source is spliterator of infinite size + TestData.OfLong generator = TestData.Factory.ofLongSupplier( + "[1L, 1L, ...]", () -> LongStream.generate(() -> 1)); + + withData(generator). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + exercise(); + } + + @Test(dataProvider = "DoubleStream.limit") + public void testDoubleUnorderedGenerator(String description, UnaryOperator fs) { + // Source is spliterator of infinite size + TestData.OfDouble generator = TestData.Factory.ofDoubleSupplier( + "[1.0, 1.0, ...]", () -> DoubleStream.generate(() -> 1.0)); + + withData(generator). + stream(s -> fs.apply(s.filter(i -> true).unordered())). + exercise(); + } + + + // Unordered iteration + + @Test(dataProvider = "Stream.limit") + public void testUnorderedIteration(String description, UnaryOperator> fs) { + // Source is a right-balanced tree of infinite size + TestData.OfRef iterator = TestData.Factory.ofSupplier( + "[1L, 2L, 3L, ...]", () -> Stream.iterate(1L, i -> i + 1L)); + + // Ref + withData(iterator). + stream(s -> fs.apply(s.unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "IntStream.limit") + public void testIntUnorderedIteration(String description, UnaryOperator fs) { + // Source is a right-balanced tree of infinite size + TestData.OfInt iterator = TestData.Factory.ofIntSupplier( + "[1, 2, 3, ...]", () -> IntStream.iterate(1, i -> i + 1)); + + // Ref + withData(iterator). + stream(s -> fs.apply(s.unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "LongStream.limit") + public void testLongUnorderedIteration(String description, UnaryOperator fs) { + // Source is a right-balanced tree of infinite size + TestData.OfLong iterator = TestData.Factory.ofLongSupplier( + "[1L, 2L, 3L, ...]", () -> LongStream.iterate(1, i -> i + 1)); + + // Ref + withData(iterator). + stream(s -> fs.apply(s.unordered())). + resultAsserter(unorderedAsserter()). + exercise(); + } + + @Test(dataProvider = "DoubleStream.limit") + public void testDoubleUnorderedIteration(String description, UnaryOperator fs) { + // Source is a right-balanced tree of infinite size + TestData.OfDouble iterator = TestData.Factory.ofDoubleSupplier( + "[1.0, 2.0, 3.0, ...]", () -> DoubleStream.iterate(1, i -> i + 1)); + + // Ref + withData(iterator). + stream(s -> fs.apply(s.unordered())). + resultAsserter(unorderedAsserter()). + exercise(); } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java index 6521f8b7abd..0d74f487325 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java @@ -145,6 +145,7 @@ public class IntSliceOpTest extends OpTestCase { List skips = sizes(data.size()); for (int s : skips) { + setContext("skip", s); Collection sr = exerciseOps(data, st -> st.substream(s)); assertEquals(sr.size(), sliceSize(data.size(), s)); @@ -159,7 +160,9 @@ public class IntSliceOpTest extends OpTestCase { List limits = skips; for (int s : skips) { + setContext("skip", s); for (int limit : limits) { + setContext("limit", limit); Collection sr = exerciseOps(data, st -> st.substream(s).limit(limit)); assertEquals(sr.size(), sliceSize(sliceSize(data.size(), s), 0, limit)); @@ -174,6 +177,7 @@ public class IntSliceOpTest extends OpTestCase { List limits = sizes(data.size()); for (int limit : limits) { + setContext("limit", limit); Collection sr = exerciseOps(data, st -> st.limit(limit)); assertEquals(sr.size(), sliceSize(data.size(), 0, limit)); @@ -189,6 +193,7 @@ public class IntSliceOpTest extends OpTestCase { @Test(groups = { "serialization-hostile" }) public void testLimitShortCircuit() { for (int l : Arrays.asList(0, 10)) { + setContext("limit", l); AtomicInteger ai = new AtomicInteger(); IntStream.range(1, 101) .peek(i -> ai.getAndIncrement()) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntUniqOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntUniqOpTest.java index 8205d4d510d..3ec5d219a23 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntUniqOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntUniqOpTest.java @@ -60,7 +60,6 @@ public class IntUniqOpTest extends OpTestCase { public void testOpSorted(String name, TestData.OfInt data) { Collection result = withData(data). stream(s -> s.sorted().distinct().boxed()). - parallelEqualityAsserter(LambdaTestHelpers::assertContentsUnordered). exercise(); assertUnique(result); diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MapOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MapOpTest.java index 9225ddd9223..4f7aaf6fa02 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MapOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MapOpTest.java @@ -24,16 +24,6 @@ package org.openjdk.tests.java.util.stream; import org.testng.annotations.Test; -import java.util.function.DoubleToIntFunction; -import java.util.function.DoubleToLongFunction; -import java.util.function.Function; -import java.util.function.IntToDoubleFunction; -import java.util.function.IntToLongFunction; -import java.util.function.LongToDoubleFunction; -import java.util.function.LongToIntFunction; -import java.util.function.ToDoubleFunction; -import java.util.function.ToIntFunction; -import java.util.function.ToLongFunction; import java.util.stream.*; import static java.util.stream.LambdaTestHelpers.*; @@ -98,8 +88,8 @@ public class MapOpTest extends OpTestCase { exerciseOps(data, s -> s.mapToObj(i -> i)); exerciseOps(data, s -> s.map(i -> 0)); exerciseOps(data, s -> s.map(i -> i * 2)); - exerciseOps(data, s -> s.longs()); - exerciseOps(data, s -> s.doubles()); + exerciseOps(data, s -> s.asLongStream()); + exerciseOps(data, s -> s.asDoubleStream()); exerciseOps(data, s -> s.boxed()); exerciseOps(data, s -> s.mapToObj(Integer::toString)); exerciseOps(data, s -> s.mapToLong(i -> i)); @@ -113,7 +103,7 @@ public class MapOpTest extends OpTestCase { exerciseOps(data, s -> s.mapToObj(i -> i)); exerciseOps(data, s -> s.map(i -> 0L)); exerciseOps(data, s -> s.map(i -> i * 2L)); - exerciseOps(data, s -> s.doubles()); + exerciseOps(data, s -> s.asDoubleStream()); exerciseOps(data, s -> s.boxed()); exerciseOps(data, s -> s.mapToObj(e -> Long.toString(e))); exerciseOps(data, s -> s.mapToInt(i -> (int) i)); diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MatchOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MatchOpTest.java index a6516118915..e88a8d95e93 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MatchOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MatchOpTest.java @@ -23,19 +23,16 @@ package org.openjdk.tests.java.util.stream; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.PrimitiveIterator; +import java.util.Spliterators; import java.util.function.DoublePredicate; -import java.util.function.DoubleSupplier; import java.util.function.Function; import java.util.function.IntPredicate; -import java.util.function.IntSupplier; import java.util.function.LongPredicate; -import java.util.function.LongSupplier; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.stream.DoubleStream; @@ -46,6 +43,7 @@ import java.util.stream.LongStream; import java.util.stream.LongStreamTestDataProvider; import java.util.stream.OpTestCase; import java.util.stream.Stream; +import java.util.stream.StreamSupport; import java.util.stream.StreamTestDataProvider; import java.util.stream.TestData; @@ -97,6 +95,7 @@ public class MatchOpTest extends OpTestCase { private void assertPredicates(List source, Kind kind, Predicate[] predicates, boolean... answers) { for (int i = 0; i < predicates.length; i++) { + setContext("i", i); boolean match = this.kinds().get(kind).apply(predicates[i]).apply(source.stream()); assertEquals(answers[i], match, kind.toString() + predicates[i].toString()); } @@ -119,7 +118,9 @@ public class MatchOpTest extends OpTestCase { @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) public void testStream(String name, TestData.OfRef data) { for (Predicate p : INTEGER_PREDICATES) { + setContext("p", p); for (Kind kind : Kind.values()) { + setContext("kind", kind); exerciseTerminalOps(data, this.kinds().get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(pFalse), this.kinds().get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(pEven), this.kinds().get(kind).apply(p)); @@ -128,29 +129,40 @@ public class MatchOpTest extends OpTestCase { } public void testInfinite() { - class CycleSupplier implements Supplier { - final Iterable source; - Iterator i = Collections.emptyIterator(); + class CycleIterator implements Iterator { + final Supplier> source; + Iterator i = null; - CycleSupplier(Iterable source) { + CycleIterator(Supplier> source) { this.source = source; } @Override - public T get() { - if (!i.hasNext()) { - i = source.iterator(); + public Integer next() { + if (i == null || !i.hasNext()) { + i = source.get(); } return i.next(); } + + @Override + public boolean hasNext() { + if (i == null || !i.hasNext()) { + i = source.get(); + } + return i.hasNext(); + } } - assertFalse(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).allMatch(i -> i > 3)); - assertTrue(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).anyMatch(i -> i > 3)); - assertFalse(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).noneMatch(i -> i > 3)); - assertFalse(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).parallel().allMatch(i -> i > 3)); - assertTrue(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).parallel().anyMatch(i -> i > 3)); - assertFalse(Stream.generate(new CycleSupplier<>(Arrays.asList(1, 2, 3, 4))).parallel().noneMatch(i -> i > 3)); + Supplier> source = () -> Arrays.asList(1, 2, 3, 4).iterator(); + Supplier> s = () -> StreamSupport.stream(Spliterators.spliteratorUnknownSize(new CycleIterator(source), 0)); + + assertFalse(s.get().allMatch(i -> i > 3)); + assertTrue(s.get().anyMatch(i -> i > 3)); + assertFalse(s.get().noneMatch(i -> i > 3)); + assertFalse(s.get().parallel().allMatch(i -> i > 3)); + assertTrue(s.get().parallel().anyMatch(i -> i > 3)); + assertFalse(s.get().parallel().noneMatch(i -> i > 3)); } // @@ -168,6 +180,7 @@ public class MatchOpTest extends OpTestCase { private void assertIntPredicates(Supplier source, Kind kind, IntPredicate[] predicates, boolean... answers) { for (int i = 0; i < predicates.length; i++) { + setContext("i", i); boolean match = intKinds.get(kind).apply(predicates[i]).apply(source.get()); assertEquals(answers[i], match, kind.toString() + predicates[i].toString()); } @@ -189,40 +202,52 @@ public class MatchOpTest extends OpTestCase { @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) public void testIntStream(String name, TestData.OfInt data) { - for (IntPredicate p : INT_PREDICATES) + for (IntPredicate p : INT_PREDICATES) { + setContext("p", p); for (Kind kind : Kind.values()) { + setContext("kind", kind); exerciseTerminalOps(data, intKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(ipFalse), intKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(ipEven), intKinds.get(kind).apply(p)); } + } } public void testIntInfinite() { - class CycleSupplier implements IntSupplier { + class CycleIterator implements PrimitiveIterator.OfInt { final Supplier source; PrimitiveIterator.OfInt i = null; - CycleSupplier(Supplier source) { + CycleIterator(Supplier source) { this.source = source; } @Override - public int getAsInt() { + public int nextInt() { if (i == null || !i.hasNext()) { i = source.get(); } return i.nextInt(); } + + @Override + public boolean hasNext() { + if (i == null || !i.hasNext()) { + i = source.get(); + } + return i.hasNext(); + } } Supplier source = () -> Arrays.stream(new int[]{1, 2, 3, 4}).iterator(); + Supplier s = () -> StreamSupport.intStream(Spliterators.spliteratorUnknownSize(new CycleIterator(source), 0)); - assertFalse(IntStream.generate(new CycleSupplier(source)).allMatch(i -> i > 3)); - assertTrue(IntStream.generate(new CycleSupplier(source)).anyMatch(i -> i > 3)); - assertFalse(IntStream.generate(new CycleSupplier(source)).noneMatch(i -> i > 3)); - assertFalse(IntStream.generate(new CycleSupplier(source)).parallel().allMatch(i -> i > 3)); - assertTrue(IntStream.generate(new CycleSupplier(source)).parallel().anyMatch(i -> i > 3)); - assertFalse(IntStream.generate(new CycleSupplier(source)).parallel().noneMatch(i -> i > 3)); + assertFalse(s.get().allMatch(i -> i > 3)); + assertTrue(s.get().anyMatch(i -> i > 3)); + assertFalse(s.get().noneMatch(i -> i > 3)); + assertFalse(s.get().parallel().allMatch(i -> i > 3)); + assertTrue(s.get().parallel().anyMatch(i -> i > 3)); + assertFalse(s.get().parallel().noneMatch(i -> i > 3)); } // @@ -240,6 +265,7 @@ public class MatchOpTest extends OpTestCase { private void assertLongPredicates(Supplier source, Kind kind, LongPredicate[] predicates, boolean... answers) { for (int i = 0; i < predicates.length; i++) { + setContext("i", i); boolean match = longKinds.get(kind).apply(predicates[i]).apply(source.get()); assertEquals(answers[i], match, kind.toString() + predicates[i].toString()); } @@ -261,40 +287,52 @@ public class MatchOpTest extends OpTestCase { @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) public void testLongStream(String name, TestData.OfLong data) { - for (LongPredicate p : LONG_PREDICATES) + for (LongPredicate p : LONG_PREDICATES) { + setContext("p", p); for (Kind kind : Kind.values()) { + setContext("kind", kind); exerciseTerminalOps(data, longKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(lpFalse), longKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(lpEven), longKinds.get(kind).apply(p)); } + } } public void testLongInfinite() { - class CycleSupplier implements LongSupplier { + class CycleIterator implements PrimitiveIterator.OfLong { final Supplier source; PrimitiveIterator.OfLong i = null; - CycleSupplier(Supplier source) { + CycleIterator(Supplier source) { this.source = source; } @Override - public long getAsLong() { + public long nextLong() { if (i == null || !i.hasNext()) { i = source.get(); } return i.nextLong(); } + + @Override + public boolean hasNext() { + if (i == null || !i.hasNext()) { + i = source.get(); + } + return i.hasNext(); + } } Supplier source = () -> Arrays.stream(new long[]{1, 2, 3, 4}).iterator(); + Supplier s = () -> StreamSupport.longStream(Spliterators.spliteratorUnknownSize(new CycleIterator(source), 0)); - assertFalse(LongStream.generate(new CycleSupplier(source)).allMatch(i -> i > 3)); - assertTrue(LongStream.generate(new CycleSupplier(source)).anyMatch(i -> i > 3)); - assertFalse(LongStream.generate(new CycleSupplier(source)).noneMatch(i -> i > 3)); - assertFalse(LongStream.generate(new CycleSupplier(source)).parallel().allMatch(i -> i > 3)); - assertTrue(LongStream.generate(new CycleSupplier(source)).parallel().anyMatch(i -> i > 3)); - assertFalse(LongStream.generate(new CycleSupplier(source)).parallel().noneMatch(i -> i > 3)); + assertFalse(s.get().allMatch(i -> i > 3)); + assertTrue(s.get().anyMatch(i -> i > 3)); + assertFalse(s.get().noneMatch(i -> i > 3)); + assertFalse(s.get().parallel().allMatch(i -> i > 3)); + assertTrue(s.get().parallel().anyMatch(i -> i > 3)); + assertFalse(s.get().parallel().noneMatch(i -> i > 3)); } // @@ -312,60 +350,73 @@ public class MatchOpTest extends OpTestCase { private void assertDoublePredicates(Supplier source, Kind kind, DoublePredicate[] predicates, boolean... answers) { for (int i = 0; i < predicates.length; i++) { + setContext("i", i); boolean match = doubleKinds.get(kind).apply(predicates[i]).apply(source.get()); assertEquals(answers[i], match, kind.toString() + predicates[i].toString()); } } public void testDoubleStreamMatches() { - assertDoublePredicates(() -> LongStream.range(0, 0).doubles(), Kind.ANY, DOUBLE_PREDICATES, false, false, false, false); - assertDoublePredicates(() -> LongStream.range(0, 0).doubles(), Kind.ALL, DOUBLE_PREDICATES, true, true, true, true); - assertDoublePredicates(() -> LongStream.range(0, 0).doubles(), Kind.NONE, DOUBLE_PREDICATES, true, true, true, true); + assertDoublePredicates(() -> LongStream.range(0, 0).asDoubleStream(), Kind.ANY, DOUBLE_PREDICATES, false, false, false, false); + assertDoublePredicates(() -> LongStream.range(0, 0).asDoubleStream(), Kind.ALL, DOUBLE_PREDICATES, true, true, true, true); + assertDoublePredicates(() -> LongStream.range(0, 0).asDoubleStream(), Kind.NONE, DOUBLE_PREDICATES, true, true, true, true); - assertDoublePredicates(() -> LongStream.range(1, 2).doubles(), Kind.ANY, DOUBLE_PREDICATES, true, false, false, true); - assertDoublePredicates(() -> LongStream.range(1, 2).doubles(), Kind.ALL, DOUBLE_PREDICATES, true, false, false, true); - assertDoublePredicates(() -> LongStream.range(1, 2).doubles(), Kind.NONE, DOUBLE_PREDICATES, false, true, true, false); + assertDoublePredicates(() -> LongStream.range(1, 2).asDoubleStream(), Kind.ANY, DOUBLE_PREDICATES, true, false, false, true); + assertDoublePredicates(() -> LongStream.range(1, 2).asDoubleStream(), Kind.ALL, DOUBLE_PREDICATES, true, false, false, true); + assertDoublePredicates(() -> LongStream.range(1, 2).asDoubleStream(), Kind.NONE, DOUBLE_PREDICATES, false, true, true, false); - assertDoublePredicates(() -> LongStream.range(1, 6).doubles(), Kind.ANY, DOUBLE_PREDICATES, true, false, true, true); - assertDoublePredicates(() -> LongStream.range(1, 6).doubles(), Kind.ALL, DOUBLE_PREDICATES, true, false, false, false); - assertDoublePredicates(() -> LongStream.range(1, 6).doubles(), Kind.NONE, DOUBLE_PREDICATES, false, true, false, false); + assertDoublePredicates(() -> LongStream.range(1, 6).asDoubleStream(), Kind.ANY, DOUBLE_PREDICATES, true, false, true, true); + assertDoublePredicates(() -> LongStream.range(1, 6).asDoubleStream(), Kind.ALL, DOUBLE_PREDICATES, true, false, false, false); + assertDoublePredicates(() -> LongStream.range(1, 6).asDoubleStream(), Kind.NONE, DOUBLE_PREDICATES, false, true, false, false); } @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleStream(String name, TestData.OfDouble data) { - for (DoublePredicate p : DOUBLE_PREDICATES) + for (DoublePredicate p : DOUBLE_PREDICATES) { + setContext("p", p); for (Kind kind : Kind.values()) { + setContext("kind", kind); exerciseTerminalOps(data, doubleKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(dpFalse), doubleKinds.get(kind).apply(p)); exerciseTerminalOps(data, s -> s.filter(dpEven), doubleKinds.get(kind).apply(p)); } + } } public void testDoubleInfinite() { - class CycleSupplier implements DoubleSupplier { + class CycleIterator implements PrimitiveIterator.OfDouble { final Supplier source; PrimitiveIterator.OfDouble i = null; - CycleSupplier(Supplier source) { + CycleIterator(Supplier source) { this.source = source; } @Override - public double getAsDouble() { + public double nextDouble() { if (i == null || !i.hasNext()) { i = source.get(); } return i.nextDouble(); } + + @Override + public boolean hasNext() { + if (i == null || !i.hasNext()) { + i = source.get(); + } + return i.hasNext(); + } } Supplier source = () -> Arrays.stream(new double[]{1, 2, 3, 4}).iterator(); + Supplier s = () -> StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(new CycleIterator(source), 0)); - assertFalse(DoubleStream.generate(new CycleSupplier(source)).allMatch(i -> i > 3)); - assertTrue(DoubleStream.generate(new CycleSupplier(source)).anyMatch(i -> i > 3)); - assertFalse(DoubleStream.generate(new CycleSupplier(source)).noneMatch(i -> i > 3)); - assertFalse(DoubleStream.generate(new CycleSupplier(source)).parallel().allMatch(i -> i > 3)); - assertTrue(DoubleStream.generate(new CycleSupplier(source)).parallel().anyMatch(i -> i > 3)); - assertFalse(DoubleStream.generate(new CycleSupplier(source)).parallel().noneMatch(i -> i > 3)); + assertFalse(s.get().allMatch(i -> i > 3)); + assertTrue(s.get().anyMatch(i -> i > 3)); + assertFalse(s.get().noneMatch(i -> i > 3)); + assertFalse(s.get().parallel().allMatch(i -> i > 3)); + assertTrue(s.get().parallel().anyMatch(i -> i > 3)); + assertFalse(s.get().parallel().noneMatch(i -> i > 3)); } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MinMaxTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MinMaxTest.java index 6ae36097dbc..eed4a82bbe2 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MinMaxTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/MinMaxTest.java @@ -80,8 +80,8 @@ public class MinMaxTest extends OpTestCase { public void testDoubleMinMax() { assertEquals(DoubleStream.empty().min(), OptionalDouble.empty()); assertEquals(DoubleStream.empty().max(), OptionalDouble.empty()); - assertEquals(1.0, LongStream.range(1, 1001).doubles().min().getAsDouble()); - assertEquals(1000.0, LongStream.range(1, 1001).doubles().max().getAsDouble()); + assertEquals(1.0, LongStream.range(1, 1001).asDoubleStream().min().getAsDouble()); + assertEquals(1000.0, LongStream.range(1, 1001).asDoubleStream().max().getAsDouble()); } @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/PrimitiveSumTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/PrimitiveSumTest.java index 98c93513d05..6f2822f9d32 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/PrimitiveSumTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/PrimitiveSumTest.java @@ -34,7 +34,7 @@ public class PrimitiveSumTest extends OpTestCase { withData(data). terminal(s -> (long) s.sum()). - expectedResult(data.stream().longs().reduce(0, LambdaTestHelpers.lrPlus)). + expectedResult(data.stream().asLongStream().reduce(0, LambdaTestHelpers.lrPlus)). exercise(); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java index 182b98c50c1..1e6b343fc60 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/RangeTest.java @@ -24,10 +24,11 @@ package org.openjdk.tests.java.util.stream; import java.util.Arrays; import java.util.Optional; -import java.util.stream.DoubleStream; +import java.util.Spliterator; import java.util.stream.IntStream; import java.util.stream.LongStream; import java.util.stream.OpTestCase; +import java.util.stream.SpliteratorTestHelper; import java.util.stream.Stream; import java.util.stream.TestData; @@ -54,73 +55,80 @@ public class RangeTest extends OpTestCase { // - public void testIntRangeErrors() { - for (int start : Arrays.asList(1, 10, -1, -10)) { - for (int end : Arrays.asList(1, 10, -1, -10)) { - for (int step : Arrays.asList(0, 1, -1, Integer.MAX_VALUE, Integer.MIN_VALUE)) { - if (step > 0) - executeAndNoCatch(() -> IntStream.range(start, end, step)); - else - executeAndCatch(() -> IntStream.range(start, end, step)); - } - } - } - } - public void testIntRange() { - // Without step + // Half-open for (int start : Arrays.asList(1, 10, -1, -10)) { + setContext("start", start); for (int end : Arrays.asList(1, 10, -1, -10)) { - int step = 1; + setContext("end", end); int size = (start < end) ? end - start : 0; int[] exp = new int[size]; - if (start < end) { - for (int i = start, p = 0; i < end; i++, p++) { - exp[p] = i; - } + for (int i = start, p = 0; i < end; i++, p++) { + exp[p] = i; } int[] inc = IntStream.range(start, end).toArray(); assertEquals(inc.length, size); assertTrue(Arrays.equals(exp, inc)); - withData(intRangeData(start, end, step)).stream(s -> s). + withData(intRangeData(start, end)).stream(s -> s). expectedResult(exp).exercise(); } } - // With step + // Closed for (int start : Arrays.asList(1, 10, -1, -10)) { + setContext("start", start); for (int end : Arrays.asList(1, 10, -1, -10)) { - for (int step : Arrays.asList(1, -1, -2, 2)) { - if (step > 0) { - int d = end - start; - int size = (start < end) ? (d / step) + ((d % step == 0) ? 0 : 1) : 0; - int[] exp = new int[size]; - if (start < end) { - for (int i = start, p = 0; i < end; i += step, p++) { - exp[p] = i; - } - } - - int[] inc = IntStream.range(start, end, step).toArray(); - assertEquals(inc.length, size); - assertTrue(Arrays.equals(exp, inc)); - - withData(intRangeData(start, end, step)).stream(s -> s). - expectedResult(exp).exercise(); - } + setContext("end", end); + int size = (start <= end) ? end - start + 1 : 0; + int[] exp = new int[size]; + for (int i = start, p = 0; i <= end; i++, p++) { + exp[p] = i; } + + int[] inc = IntStream.rangeClosed(start, end).toArray(); + assertEquals(inc.length, size); + assertTrue(Arrays.equals(exp, inc)); + + withData(intRangeClosedData(start, end)).stream(s -> s). + expectedResult(exp).exercise(); } } + + // Closed, maximum upper bound of Integer.MAX_VALUE + { + int[] inc = IntStream.rangeClosed(Integer.MAX_VALUE - 1, Integer.MAX_VALUE).toArray(); + assertEquals(2, inc.length); + assertEquals(Integer.MAX_VALUE - 1, inc[0]); + assertEquals(Integer.MAX_VALUE, inc[1]); + + inc = IntStream.rangeClosed(Integer.MAX_VALUE, Integer.MAX_VALUE).toArray(); + assertEquals(1, inc.length); + assertEquals(Integer.MAX_VALUE, inc[0]); + + SpliteratorTestHelper.testIntSpliterator( + () -> IntStream.rangeClosed(Integer.MAX_VALUE - 8, Integer.MAX_VALUE).spliterator()); + } + + // Range wider than Integer.MAX_VALUE + { + Spliterator.OfInt s = IntStream.rangeClosed(Integer.MIN_VALUE, Integer.MAX_VALUE). + spliterator(); + assertEquals(s.estimateSize(), 1L << 32); + } } - TestData.OfInt intRangeData(int start, int end, int step) { - return TestData.Factory.ofIntSupplier("int range", () -> IntStream.range(start, end, step)); + TestData.OfInt intRangeData(int start, int end) { + return TestData.Factory.ofIntSupplier("int range", () -> IntStream.range(start, end)); + } + + TestData.OfInt intRangeClosedData(int start, int end) { + return TestData.Factory.ofIntSupplier("int rangeClosed", () -> IntStream.rangeClosed(start, end)); } public void tesIntRangeReduce() { - withData(intRangeData(0, 10000, 1)). + withData(intRangeData(0, 10000)). terminal(s -> s.reduce(0, Integer::sum)).exercise(); } @@ -137,74 +145,73 @@ public class RangeTest extends OpTestCase { // - public void testLongRangeErrors() { - for (long start : Arrays.asList(1, 10, -1, -10)) { - for (long end : Arrays.asList(1, 10, -1, -10)) { - for (long step : Arrays.asList(0L, 1L, -1L, Long.MAX_VALUE, Long.MIN_VALUE)) { - if (step > 0) - executeAndNoCatch(() -> LongStream.range(start, end, step)); - else - executeAndCatch(() -> LongStream.range(start, end, step)); - } - } - } - } - public void testLongRange() { - // Without step + // Half-open for (long start : Arrays.asList(1, 1000, -1, -1000)) { + setContext("start", start); for (long end : Arrays.asList(1, 1000, -1, -1000)) { - long step = 1; + setContext("end", end); long size = start < end ? end - start : 0; long[] exp = new long[(int) size]; - if (start < end) { - for (long i = start, p = 0; i < end; i++, p++) { - exp[(int) p] = i; - } + for (long i = start, p = 0; i < end; i++, p++) { + exp[(int) p] = i; } long[] inc = LongStream.range(start, end).toArray(); assertEquals(inc.length, size); assertTrue(Arrays.equals(exp, inc)); - withData(longRangeData(start, end, step)).stream(s -> s). + withData(longRangeData(start, end)).stream(s -> s). expectedResult(exp).exercise(); } } - // With step + // Closed for (long start : Arrays.asList(1, 1000, -1, -1000)) { + setContext("start", start); for (long end : Arrays.asList(1, 1000, -1, -1000)) { - for (long step : Arrays.asList(1, -1, -2, 2)) { - if (step > 0) { - - long d = end - start; - long size = start < end ? (d / step) + ((d % step == 0) ? 0 : 1) : 0; - long[] exp = new long[(int) size]; - if (start < end) { - for (long i = start, p = 0; i < end; i += step, p++) { - exp[(int) p] = i; - } - } - - long[] inc = LongStream.range(start, end, step).toArray(); - assertEquals(inc.length, size); - assertTrue(Arrays.equals(exp, inc)); - - withData(longRangeData(start, end, step)).stream(s -> s). - expectedResult(exp).exercise(); - } + setContext("end", end); + long size = start <= end ? end - start + 1: 0; + long[] exp = new long[(int) size]; + for (long i = start, p = 0; i <= end; i++, p++) { + exp[(int) p] = i; } + + long[] inc = LongStream.rangeClosed(start, end).toArray(); + assertEquals(inc.length, size); + assertTrue(Arrays.equals(exp, inc)); + + withData(longRangeClosedData(start, end)).stream(s -> s). + expectedResult(exp).exercise(); } } + + // Closed, maximum upper bound of Long.MAX_VALUE + { + long[] inc = LongStream.rangeClosed(Long.MAX_VALUE - 1, Long.MAX_VALUE).toArray(); + assertEquals(2, inc.length); + assertEquals(Long.MAX_VALUE - 1, inc[0]); + assertEquals(Long.MAX_VALUE, inc[1]); + + inc = LongStream.rangeClosed(Long.MAX_VALUE, Long.MAX_VALUE).toArray(); + assertEquals(1, inc.length); + assertEquals(Long.MAX_VALUE, inc[0]); + + SpliteratorTestHelper.testLongSpliterator( + () -> LongStream.rangeClosed(Long.MAX_VALUE - 8, Long.MAX_VALUE).spliterator()); + } } - TestData.OfLong longRangeData(long start, long end, long step) { - return TestData.Factory.ofLongSupplier("long range", () -> LongStream.range(start, end, step)); + TestData.OfLong longRangeData(long start, long end) { + return TestData.Factory.ofLongSupplier("long range", () -> LongStream.range(start, end)); + } + + TestData.OfLong longRangeClosedData(long start, long end) { + return TestData.Factory.ofLongSupplier("long rangeClosed", () -> LongStream.rangeClosed(start, end)); } public void testLongRangeReduce() { - withData(longRangeData(0, 10000, 1)). + withData(longRangeData(0, 10000)). terminal(s -> s.reduce(0, Long::sum)).exercise(); } @@ -219,182 +226,116 @@ public class RangeTest extends OpTestCase { assertEquals(first, LongStream.iterate(0, i -> i + 1).parallel().filter(i -> i > 10000).findFirst().getAsLong()); } - // - - public void testDoubleRangeErrors() { - for (double start : Arrays.asList(1, 10, -1, -10)) { - for (double end : Arrays.asList(1, 10, -1, -10)) { - for (double step : Arrays.asList(0.0, +0.0, -0.0, 1.0, -1.0, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY)) { - try { - if (step > 0) - executeAndNoCatch(() -> DoubleStream.range(start, end, step)); - else - executeAndCatch(() -> DoubleStream.range(start, end, step)); - } - catch (AssertionError e) { - System.out.printf("start=%f, end=%f, step=%f%n", start, end, step); - throw e; - } - } - } - } - - for (double start : Arrays.asList(0.0, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN)) { - for (double end : Arrays.asList(0.0, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN)) { - for (double step : Arrays.asList(1.0, -1.0, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN)) { - try { - if ((start == 0.0 && end == 0.0 && step > 0) - || (start > end && step > 0)) { - executeAndNoCatch(() -> DoubleStream.range(start, end, step)); - } - else { - executeAndCatch(() -> DoubleStream.range(start, end, step)); - } - } - catch (AssertionError e) { - System.out.printf("start=%f, end=%f, step=%f%n", start, end, step); - throw e; - } - } - } - } - } - - public void testDoubleRange() { - // Without step - for (double start : Arrays.asList(1, 1000, -1, -1000)) { - for (double end : Arrays.asList(1, 1000, -1, -1000)) { - double step = 1; - double size = start < end ? Math.ceil((end - start) / step) : 0; - double[] exp = new double[(int) size]; - for (long i = 0; i < size; i++) { - exp[(int) i] = start + i * step; - } - - double[] inc = DoubleStream.range(start, end).toArray(); - assertEquals(inc.length, (int) size); - assertTrue(Arrays.equals(exp, inc)); - - withData(doubleRangeData(start, end, step)).stream(s -> s). - expectedResult(exp).exercise(); - } - } - - // With step - for (double start : Arrays.asList(1, 1000, -1, -1000)) { - for (double end : Arrays.asList(1, 1000, -1, -1000)) { - for (double step : Arrays.asList(1, -1, -2, 2)) { - if (step <= 0) - continue; - double size = start < end ? Math.ceil((end - start) / step) : 0; - double[] exp = new double[(int) size]; - for (long i = 0; i < size; i++) { - exp[(int) i] = start + i * step; - } - - double[] inc = DoubleStream.range(start, end, step).toArray(); - assertEquals(inc.length, (int) size); - assertTrue(Arrays.equals(exp, inc)); - - withData(doubleRangeData(start, end, step)).stream(s -> s). - expectedResult(exp).exercise(); - } - } - } - - // With non-integer values - for (double step : Arrays.asList(Math.PI / 1000.0, Math.PI / 1000.0, Math.PI / 10000.0)) { - double start = -Math.PI; - double end = Math.PI; - double size = start < end ? Math.ceil((end - start) / step) : 0; - double[] exp = new double[(int) size]; - for (long i = 0; i < size; i++) { - exp[(int) i] = start + i * step; - } - - withData(doubleRangeData(start, end, step)).stream(s -> s). - expectedResult(exp).exercise(); - } - } - - TestData.OfDouble doubleRangeData(double start, double end, double step) { - return TestData.Factory.ofDoubleSupplier("double range", () -> DoubleStream.range(start, end, step)); - } - - public void tesDoubleRangeReduce() { - withData(doubleRangeData(0, 10000, 1)). - terminal(s -> s.reduce(0, Double::sum)).exercise(); - } - - public void testDoubleInfiniteRangeLimit() { - withData(TestData.Factory.ofDoubleSupplier( - "double range", () -> DoubleStream.iterate(0, i -> i + 1).limit(10000))). - terminal(s -> s.reduce(0, Double::sum)).exercise(); - } - - public void testDoubleInfiniteRangeFindFirst() { - double first = DoubleStream.iterate(0, i -> i + 1).filter(i -> i > 10000).findFirst().getAsDouble(); - assertEquals(first, DoubleStream.iterate(0, i -> i + 1).parallel().filter(i -> i > 10000).findFirst().getAsDouble()); - } - - // - - private static int[] reverse(int[] a) { - int[] b = new int[a.length]; - for (int i = 0; i < a.length; i++) { - b[b.length - i - 1] = a[i]; - } - return b; - } - - private static long[] reverse(long[] a) { - long[] b = new long[a.length]; - for (int i = 0; i < a.length; i++) { - b[b.length - i - 1] = a[i]; - } - return b; - } - - private static double[] reverse(double[] a) { - double[] b = new double[a.length]; - for (int i = 0; i < a.length; i++) { - b[b.length - i - 1] = a[i]; - } - return b; - } - - private void executeAndCatch(Runnable r) { - executeAndCatch(IllegalArgumentException.class, r); - } - - private void executeAndNoCatch(Runnable r) { - executeAndCatch(null, r); - } - - private void executeAndCatch(Class expected, Runnable r) { - Exception caught = null; - try { - r.run(); - } - catch (Exception e) { - caught = e; - } - - if (expected != null) { - assertNotNull(caught, - String.format("No Exception was thrown, expected an Exception of %s to be thrown", - expected.getName())); - assertTrue(expected.isInstance(caught), - String.format("Exception thrown %s not an instance of %s", - caught.getClass().getName(), expected.getName())); - } - else { - if (caught != null) { - assertNull(caught, - String.format("Unexpected exception of %s was thrown", - caught.getClass().getName())); - } - } - } - + // Enable when Stream.concat is present and range implementations are + // updated to use that +// private static void assertSizedAndSubSized(Spliterator s) { +// assertTrue(s.hasCharacteristics(Spliterator.SIZED | Spliterator.SUBSIZED)); +// } +// +// private static void assertNotSizedAndSubSized(Spliterator s) { +// assertFalse(s.hasCharacteristics(Spliterator.SIZED | Spliterator.SUBSIZED)); +// } +// +// public void testLongLongRange() { +// // Test [Long.MIN_VALUE, Long.MAX_VALUE) +// // This will concatenate streams of three ranges +// // [Long.MIN_VALUE, x) [x, 0) [0, Long.MAX_VALUE) +// // where x = Long.divideUnsigned(0 - Long.MIN_VALUE, 2) + 1 +// { +// Spliterator.OfLong s = LongStream.range(Long.MIN_VALUE, Long.MAX_VALUE).spliterator(); +// +// assertEquals(s.estimateSize(), Long.MAX_VALUE); +// assertNotSizedAndSubSized(s); +// +// Spliterator.OfLong s1 = s.trySplit(); +// assertNotSizedAndSubSized(s1); +// assertSizedAndSubSized(s); +// +// Spliterator.OfLong s2 = s1.trySplit(); +// assertSizedAndSubSized(s1); +// assertSizedAndSubSized(s2); +// +// assertTrue(s.estimateSize() == Long.MAX_VALUE); +// assertTrue(s1.estimateSize() < Long.MAX_VALUE); +// assertTrue(s2.estimateSize() < Long.MAX_VALUE); +// +// assertEquals(s.estimateSize() + s1.estimateSize() + s2.estimateSize(), +// Long.MAX_VALUE - Long.MIN_VALUE); +// } +// +// long[][] ranges = { {Long.MIN_VALUE, 0}, {-1, Long.MAX_VALUE} }; +// for (int i = 0; i < ranges.length; i++) { +// long start = ranges[i][0]; +// long end = ranges[i][1]; +// +// Spliterator.OfLong s = LongStream.range(start, end).spliterator(); +// +// assertEquals(s.estimateSize(), Long.MAX_VALUE); +// assertNotSizedAndSubSized(s); +// +// Spliterator.OfLong s1 = s.trySplit(); +// assertSizedAndSubSized(s1); +// assertSizedAndSubSized(s); +// +// assertTrue(s.estimateSize() < Long.MAX_VALUE); +// assertTrue(s1.estimateSize() < Long.MAX_VALUE); +// +// assertEquals(s.estimateSize() + s1.estimateSize(), end - start); +// } +// } +// +// public void testLongLongRangeClosed() { +// // Test [Long.MIN_VALUE, Long.MAX_VALUE] +// // This will concatenate streams of four ranges +// // [Long.MIN_VALUE, x) [x, 0) [0, y) [y, Long.MAX_VALUE] +// // where x = Long.divideUnsigned(0 - Long.MIN_VALUE, 2) + 1 +// // y = Long.divideUnsigned(Long.MAX_VALUE, 2) + 1 +// +// { +// Spliterator.OfLong s = LongStream.rangeClosed(Long.MIN_VALUE, Long.MAX_VALUE).spliterator(); +// +// assertEquals(s.estimateSize(), Long.MAX_VALUE); +// assertNotSizedAndSubSized(s); +// +// Spliterator.OfLong s1 = s.trySplit(); +// assertNotSizedAndSubSized(s1); +// assertNotSizedAndSubSized(s); +// +// Spliterator.OfLong s2 = s1.trySplit(); +// assertSizedAndSubSized(s1); +// assertSizedAndSubSized(s2); +// +// Spliterator.OfLong s3 = s.trySplit(); +// assertSizedAndSubSized(s3); +// assertSizedAndSubSized(s); +// +// assertTrue(s.estimateSize() < Long.MAX_VALUE); +// assertTrue(s3.estimateSize() < Long.MAX_VALUE); +// assertTrue(s1.estimateSize() < Long.MAX_VALUE); +// assertTrue(s2.estimateSize() < Long.MAX_VALUE); +// +// assertEquals(s.estimateSize() + s3.estimateSize() + s1.estimateSize() + s2.estimateSize(), +// Long.MAX_VALUE - Long.MIN_VALUE + 1); +// } +// +// long[][] ranges = { {Long.MIN_VALUE, 0}, {-1, Long.MAX_VALUE} }; +// for (int i = 0; i < ranges.length; i++) { +// long start = ranges[i][0]; +// long end = ranges[i][1]; +// +// Spliterator.OfLong s = LongStream.rangeClosed(start, end).spliterator(); +// +// assertEquals(s.estimateSize(), Long.MAX_VALUE); +// assertNotSizedAndSubSized(s); +// +// Spliterator.OfLong s1 = s.trySplit(); +// assertSizedAndSubSized(s1); +// assertSizedAndSubSized(s); +// +// assertTrue(s.estimateSize() < Long.MAX_VALUE); +// assertTrue(s1.estimateSize() < Long.MAX_VALUE); +// +// assertEquals(s.estimateSize() + s1.estimateSize(), end - start + 1); +// } +// } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ReduceByOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ReduceByOpTest.java index 539ed9beada..3fcb4691701 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ReduceByOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ReduceByOpTest.java @@ -51,6 +51,7 @@ public class ReduceByOpTest extends OpTestCase { Map result = data.stream().collect(groupingBy(LambdaTestHelpers.forPredicate(pEven, true, false), reducing(0, rPlus))); assertEquals(result.size(), gbResult.size()); for (Map.Entry entry : result.entrySet()) { + setContext("entry", entry); Boolean key = entry.getKey(); assertEquals(entry.getValue(), data.stream().filter(e -> pEven.test(e) == key).reduce(0, rPlus)); } @@ -59,7 +60,9 @@ public class ReduceByOpTest extends OpTestCase { Map> mgResult = exerciseTerminalOps(data, s -> s.collect(groupingBy(mId))); Map miResult = exerciseTerminalOps(data, s -> s.collect(groupingBy(mId, reducing(0, e -> 1, Integer::sum)))); assertEquals(miResult.keySet().size(), uniqueSize); - for (Map.Entry entry : miResult.entrySet()) + for (Map.Entry entry : miResult.entrySet()) { + setContext("entry", entry); assertEquals((int) entry.getValue(), mgResult.get(entry.getKey()).size()); + } } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java index e74810002fb..efa5c62e640 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java @@ -27,8 +27,8 @@ import java.util.stream.OpTestCase; import java.util.stream.StreamTestDataProvider; import org.testng.annotations.Test; -import java.util.Comparators; import java.util.Iterator; +import java.util.Comparator; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.Supplier; @@ -64,8 +64,12 @@ public class SequentialOpTest extends OpTestCase { (UnaryOperator>) s -> s.parallel().map(id).peek(e -> { counter.incrementAndGet(); }).map(id) }; - for (Supplier> supp : suppliers) - for (UnaryOperator> config : configs) { + for (int i = 0; i < suppliers.length; i++) { + setContext("supplierIndex", i); + Supplier> supp = suppliers[i]; + for (int j = 0; j < configs.length; j++) { + setContext("configIndex", j); + UnaryOperator> config = configs[j]; counter.set(0); Stream stream = config.apply(supp.get()); assertEquals(0, counter.get()); @@ -86,6 +90,7 @@ public class SequentialOpTest extends OpTestCase { }); assertTrue(data.size() == 0 || counter.get() > 0); } + } } @SuppressWarnings({"rawtypes", "unchecked"}) @@ -96,23 +101,35 @@ public class SequentialOpTest extends OpTestCase { = new UnaryOperator[] { (UnaryOperator>) s -> s, (UnaryOperator>) s -> s.sequential(), - (UnaryOperator>) s -> s.parallel() + (UnaryOperator>) s -> s.parallel(), + (UnaryOperator>) s -> s.unordered() }; UnaryOperator>[] stuff = new UnaryOperator[] { (UnaryOperator>) s -> s, (UnaryOperator>) s -> s.map(id), - (UnaryOperator>) s -> s.sorted(Comparators.naturalOrder()), - (UnaryOperator>) s -> s.map(id).sorted(Comparators.naturalOrder()).map(id), - (UnaryOperator>) s -> s.filter(LambdaTestHelpers.pEven).sorted(Comparators.naturalOrder()).map(id), + (UnaryOperator>) s -> s.sorted(Comparator.naturalOrder()), + (UnaryOperator>) s -> s.map(id).sorted(Comparator.naturalOrder()).map(id), + (UnaryOperator>) s -> s.filter(LambdaTestHelpers.pEven).sorted(Comparator.naturalOrder()).map(id), }; - for (UnaryOperator> c1 : changers) - for (UnaryOperator> s1 : stuff) - for (UnaryOperator> c2 : changers) - for (UnaryOperator> s2 : stuff) { + for (int c1Index = 0; c1Index < changers.length; c1Index++) { + setContext("c1Index", c1Index); + UnaryOperator> c1 = changers[c1Index]; + for (int s1Index = 0; s1Index < stuff.length; s1Index++) { + setContext("s1Index", s1Index); + UnaryOperator> s1 = stuff[s1Index]; + for (int c2Index = 0; c2Index < changers.length; c2Index++) { + setContext("c2Index", c2Index); + UnaryOperator> c2 = changers[c2Index]; + for (int s2Index = 0; s2Index < stuff.length; s2Index++) { + setContext("s2Index", s2Index); + UnaryOperator> s2 = stuff[s2Index]; UnaryOperator> composed = s -> s2.apply(c2.apply(s1.apply(c1.apply(s)))); exerciseOps(data, composed); } + } + } + } } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java index 5074ce93c03..29086fa351d 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java @@ -26,7 +26,11 @@ import org.testng.annotations.Test; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.stream.DoubleStream; +import java.util.stream.IntStream; +import java.util.stream.LambdaTestHelpers; +import java.util.stream.LongStream; import java.util.stream.OpTestCase; import java.util.stream.Stream; import java.util.stream.StreamTestDataProvider; @@ -145,19 +149,20 @@ public class SliceOpTest extends OpTestCase { List skips = sizes(data.size()); for (int s : skips) { - Collection sr = exerciseOpsInt(data, - st -> st.substream(s), - st -> st.substream(s), - st -> st.substream(s), - st -> st.substream(s)); - assertEquals(sr.size(), sliceSize(data.size(), s)); + setContext("skip", s); + testSliceMulti(data, + sliceSize(data.size(), s), + st -> st.substream(s), + st -> st.substream(s), + st -> st.substream(s), + st -> st.substream(s)); - sr = exerciseOpsInt(data, - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2)); - assertEquals(sr.size(), sliceSize(sliceSize(data.size(), s), s/2)); + testSliceMulti(data, + sliceSize(sliceSize(data.size(), s), s/2), + st -> st.substream(s).substream(s / 2), + st -> st.substream(s).substream(s / 2), + st -> st.substream(s).substream(s / 2), + st -> st.substream(s).substream(s / 2)); } } @@ -167,20 +172,22 @@ public class SliceOpTest extends OpTestCase { List limits = skips; for (int s : skips) { - for (int limit : limits) { - Collection sr = exerciseOpsInt(data, - st -> st.substream(s).limit(limit), - st -> st.substream(s).limit(limit), - st -> st.substream(s).limit(limit), - st -> st.substream(s).limit(limit)); - assertEquals(sr.size(), sliceSize(sliceSize(data.size(), s), 0, limit)); + setContext("skip", s); + for (int l : limits) { + setContext("limit", l); + testSliceMulti(data, + sliceSize(sliceSize(data.size(), s), 0, l), + st -> st.substream(s).limit(l), + st -> st.substream(s).limit(l), + st -> st.substream(s).limit(l), + st -> st.substream(s).limit(l)); - sr = exerciseOpsInt(data, - st -> st.substream(s, limit+s), - st -> st.substream(s, limit+s), - st -> st.substream(s, limit+s), - st -> st.substream(s, limit+s)); - assertEquals(sr.size(), sliceSize(data.size(), s, limit)); + testSliceMulti(data, + sliceSize(data.size(), s, l), + st -> st.substream(s, l+s), + st -> st.substream(s, l+s), + st -> st.substream(s, l+s), + st -> st.substream(s, l+s)); } } } @@ -189,32 +196,87 @@ public class SliceOpTest extends OpTestCase { public void testLimitOps(String name, TestData.OfRef data) { List limits = sizes(data.size()); - for (int limit : limits) { - Collection sr = exerciseOpsInt(data, - st -> st.limit(limit), - st -> st.limit(limit), - st -> st.limit(limit), - st -> st.limit(limit)); - assertEquals(sr.size(), sliceSize(data.size(), 0, limit)); + for (int l : limits) { + setContext("limit", l); + testSliceMulti(data, + sliceSize(data.size(), 0, l), + st -> st.limit(l), + st -> st.limit(l), + st -> st.limit(l), + st -> st.limit(l)); + } - sr = exerciseOpsInt(data, - st -> st.limit(limit).limit(limit / 2), - st -> st.limit(limit).limit(limit / 2), - st -> st.limit(limit).limit(limit / 2), - st -> st.limit(limit).limit(limit / 2)); - assertEquals(sr.size(), sliceSize(sliceSize(data.size(), 0, limit), 0, limit/2)); + for (int l : limits) { + setContext("limit", l); + testSliceMulti(data, + sliceSize(sliceSize(data.size(), 0, l), 0, l / 2), + st -> st.limit(l).limit(l / 2), + st -> st.limit(l).limit(l / 2), + st -> st.limit(l).limit(l / 2), + st -> st.limit(l).limit(l / 2)); + } + } + + private ResultAsserter> sliceResultAsserter(Iterable data, + int expectedSize) { + return (act, exp, ord, par) -> { + if (par & !ord) { + List expected = new ArrayList<>(); + data.forEach(expected::add); + + List actual = new ArrayList<>(); + act.forEach(actual::add); + + assertEquals(actual.size(), expectedSize); + assertTrue(expected.containsAll(actual)); + } + else { + LambdaTestHelpers.assertContents(act, exp); + } + }; + } + + private void testSliceMulti(TestData.OfRef data, + int expectedSize, + Function, Stream> mRef, + Function mInt, + Function mLong, + Function mDouble) { + + @SuppressWarnings({ "rawtypes", "unchecked" }) + Function, Stream>[] ms = new Function[4]; + ms[0] = mRef; + ms[1] = s -> mInt.apply(s.mapToInt(e -> e)).mapToObj(e -> e); + ms[2] = s -> mLong.apply(s.mapToLong(e -> e)).mapToObj(e -> (int) e); + ms[3] = s -> mDouble.apply(s.mapToDouble(e -> e)).mapToObj(e -> (int) e); + testSliceMulti(data, expectedSize, ms); + } + + @SafeVarargs + private final void testSliceMulti(TestData.OfRef data, + int expectedSize, + Function, Stream>... ms) { + for (int i = 0; i < ms.length; i++) { + setContext("mIndex", i); + Function, Stream> m = ms[i]; + Collection sr = withData(data) + .stream(m) + .resultAsserter(sliceResultAsserter(data, expectedSize)) + .exercise(); + assertEquals(sr.size(), expectedSize); } } public void testLimitSort() { List l = countTo(100); Collections.reverse(l); - exerciseOps(l, s -> s.limit(10).sorted(Comparators.naturalOrder())); + exerciseOps(l, s -> s.limit(10).sorted(Comparator.naturalOrder())); } @Test(groups = { "serialization-hostile" }) public void testLimitShortCircuit() { for (int l : Arrays.asList(0, 10)) { + setContext("l", l); AtomicInteger ai = new AtomicInteger(); countTo(100).stream() .peek(i -> ai.getAndIncrement()) @@ -224,18 +286,6 @@ public class SliceOpTest extends OpTestCase { } } - public void testSkipParallel() { - List l = countTo(1000).parallelStream().substream(200).limit(200).sequential().collect(Collectors.toList()); - assertEquals(l.size(), 200); - assertEquals(l.get(l.size() -1).intValue(), 400); - } - - public void testLimitParallel() { - List l = countTo(1000).parallelStream().limit(500).sequential().collect(Collectors.toList()); - assertEquals(l.size(), 500); - assertEquals(l.get(l.size() -1).intValue(), 500); - } - private List sizes(int size) { if (size < 4) { return Arrays.asList(0, 1, 2, 3, 4, 6); diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java index 2d1886b70c8..956dea39ec3 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SortedOpTest.java @@ -40,10 +40,10 @@ public class SortedOpTest extends OpTestCase { public void testSorted() { assertCountSum(countTo(0).stream().sorted(), 0, 0); assertCountSum(countTo(10).stream().sorted(), 10, 55); - assertCountSum(countTo(10).stream().sorted(cInteger.reverseOrder()), 10, 55); + assertCountSum(countTo(10).stream().sorted(cInteger.reversed()), 10, 55); List to10 = countTo(10); - assertSorted(to10.stream().sorted(cInteger.reverseOrder()).iterator(), cInteger.reverseOrder()); + assertSorted(to10.stream().sorted(cInteger.reversed()).iterator(), cInteger.reversed()); Collections.reverse(to10); assertSorted(to10.stream().sorted().iterator()); @@ -51,7 +51,7 @@ public class SortedOpTest extends OpTestCase { Spliterator s = to10.stream().sorted().spliterator(); assertTrue(s.hasCharacteristics(Spliterator.SORTED)); - s = to10.stream().sorted(cInteger.reverseOrder()).spliterator(); + s = to10.stream().sorted(cInteger.reversed()).spliterator(); assertFalse(s.hasCharacteristics(Spliterator.SORTED)); } @@ -87,8 +87,8 @@ public class SortedOpTest extends OpTestCase { assertSorted(result.iterator()); assertContentsUnordered(data, result); - result = exerciseOps(data, s -> s.sorted(cInteger.reverseOrder())); - assertSorted(result.iterator(), cInteger.reverseOrder()); + result = exerciseOps(data, s -> s.sorted(cInteger.reversed())); + assertSorted(result.iterator(), cInteger.reversed()); assertContentsUnordered(data, result); } @@ -104,23 +104,23 @@ public class SortedOpTest extends OpTestCase { assertContentsUnordered(data, result); result = withData(data) - .stream(s -> s.sorted(cInteger.reverseOrder()).sorted(cInteger.reverseOrder()), + .stream(s -> s.sorted(cInteger.reversed()).sorted(cInteger.reversed()), new CollectorOps.TestParallelSizedOp()) .exercise(); - assertSorted(result, cInteger.reverseOrder()); + assertSorted(result, cInteger.reversed()); assertContentsUnordered(data, result); result = withData(data) - .stream(s -> s.sorted().sorted(cInteger.reverseOrder()), + .stream(s -> s.sorted().sorted(cInteger.reversed()), new CollectorOps.TestParallelSizedOp()) .exercise(); - assertSorted(result, cInteger.reverseOrder()); + assertSorted(result, cInteger.reversed()); assertContentsUnordered(data, result); result = withData(data) - .stream(s -> s.sorted(cInteger.reverseOrder()).sorted(), + .stream(s -> s.sorted(cInteger.reversed()).sorted(), new CollectorOps.TestParallelSizedOp()) .exercise(); @@ -150,7 +150,7 @@ public class SortedOpTest extends OpTestCase { } private IntStream unknownSizeIntStream(int[] a) { - return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0)); + return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0)); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) @@ -193,7 +193,7 @@ public class SortedOpTest extends OpTestCase { } private LongStream unknownSizeLongStream(long[] a) { - return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0)); + return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0)); } @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) @@ -236,7 +236,7 @@ public class SortedOpTest extends OpTestCase { } private DoubleStream unknownSizeDoubleStream(double[] a) { - return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0)); + return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0)); } @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java index 8898c104df9..5a2760872fa 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamBuilderTest.java @@ -275,7 +275,7 @@ public class StreamBuilderTest extends OpTestCase { @Test(dataProvider = "sizes") public void testDoubleAfterBuilding(int size) { StreamBuilder.OfDouble sb = DoubleStream.builder(); - DoubleStream.range(0, size).forEach(sb); + IntStream.range(0, size).asDoubleStream().forEach(sb); sb.build(); checkISE(() -> sb.accept(1)); @@ -287,13 +287,13 @@ public class StreamBuilderTest extends OpTestCase { public void testDoubleStreamBuilder(int size) { testDoubleStreamBuilder(size, (s) -> { StreamBuilder.OfDouble sb = DoubleStream.builder(); - DoubleStream.range(0, s).forEach(sb); + IntStream.range(0, s).asDoubleStream().forEach(sb); return sb.build(); }); testDoubleStreamBuilder(size, (s) -> { StreamBuilder.OfDouble sb = DoubleStream.builder(); - DoubleStream.range(0, s).forEach(i -> { + IntStream.range(0, s).asDoubleStream().forEach(i -> { StreamBuilder.OfDouble _sb = sb.add(i); assertTrue(sb == _sb); }); @@ -307,12 +307,12 @@ public class StreamBuilderTest extends OpTestCase { withData(data). stream(s -> s). - expectedResult(DoubleStream.range(0, size).toArray()). + expectedResult(IntStream.range(0, size).asDoubleStream().toArray()). exercise(); withData(data). stream(s -> s.map(i -> i)). - expectedResult(DoubleStream.range(0, size).toArray()). + expectedResult(IntStream.range(0, size).asDoubleStream().toArray()). exercise(); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java index e7629adae88..b4cae8946c9 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamLinkTest.java @@ -47,6 +47,7 @@ public class StreamLinkTest extends OpTestCase { @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) public void testManyStreams(String name, TestData.OfRef data) { for (int n : sizes) { + setContext("n", n); List expected = data.stream().map(e -> (Integer) (e + n)).collect(Collectors.toList()); withData(data). @@ -59,6 +60,7 @@ public class StreamLinkTest extends OpTestCase { @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) public void testIntManyStreams(String name, TestData.OfInt data) { for (int n : sizes) { + setContext("n", n); int[] expected = data.stream().map(e -> e + n).toArray(); withData(data). @@ -71,6 +73,7 @@ public class StreamLinkTest extends OpTestCase { @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) public void testLongManyStreams(String name, TestData.OfLong data) { for (int n : sizes) { + setContext("n", n); long[] expected = data.stream().map(e -> e + n).toArray(); withData(data). @@ -83,6 +86,7 @@ public class StreamLinkTest extends OpTestCase { @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleManyStreams(String name, TestData.OfDouble data) { for (int n : sizes) { + setContext("n", n); double[] expected = data.stream().map(e -> accumulate(e, n)).toArray(); withData(data). diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java index bc56b2f77ec..bd111cfdb27 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java @@ -256,9 +256,14 @@ public class StreamSpliteratorTest extends OpTestCase { s -> s.map(LambdaTestHelpers.identity()).parallel() ); - for (Consumer> terminalOp : terminalOps) { - for (UnaryOperator> intermediateOp : intermediateOps) { - for (boolean proxyEstimateSize : new boolean[]{false, true}) { + for (int i = 0; i < terminalOps.size(); i++) { + setContext("termOpIndex", i); + Consumer> terminalOp = terminalOps.get(i); + for (int j = 0; j < intermediateOps.size(); j++) { + setContext("intOpIndex", j); + UnaryOperator> intermediateOp = intermediateOps.get(j); + for (boolean proxyEstimateSize : new boolean[] {false, true}) { + setContext("proxyEstimateSize", proxyEstimateSize); Spliterator sp = intermediateOp.apply(l.stream()).spliterator(); ProxyNoExactSizeSpliterator psp = new ProxyNoExactSizeSpliterator<>(sp, proxyEstimateSize); Stream s = StreamSupport.parallelStream(psp); @@ -345,9 +350,14 @@ public class StreamSpliteratorTest extends OpTestCase { s -> s.map(i -> i).parallel() ); - for (Consumer terminalOp : terminalOps) { - for (UnaryOperator intermediateOp : intermediateOps) { - for (boolean proxyEstimateSize : new boolean[]{false, true}) { + for (int i = 0; i < terminalOps.size(); i++) { + setContext("termOpIndex", i); + Consumer terminalOp = terminalOps.get(i); + for (int j = 0; j < intermediateOps.size(); j++) { + setContext("intOpIndex", j); + UnaryOperator intermediateOp = intermediateOps.get(j); + for (boolean proxyEstimateSize : new boolean[] {false, true}) { + setContext("proxyEstimateSize", proxyEstimateSize); // Size is assumed to be larger than the target size for no splitting // @@@ Need way to obtain the target size Spliterator.OfInt sp = intermediateOp.apply(IntStream.range(0, 1000)).spliterator(); @@ -433,9 +443,14 @@ public class StreamSpliteratorTest extends OpTestCase { s -> s.map(i -> i).parallel() ); - for (Consumer terminalOp : terminalOps) { - for (UnaryOperator intermediateOp : intermediateOps) { - for (boolean proxyEstimateSize : new boolean[]{false, true}) { + for (int i = 0; i < terminalOps.size(); i++) { + Consumer terminalOp = terminalOps.get(i); + setContext("termOpIndex", i); + for (int j = 0; j < intermediateOps.size(); j++) { + setContext("intOpIndex", j); + UnaryOperator intermediateOp = intermediateOps.get(j); + for (boolean proxyEstimateSize : new boolean[] {false, true}) { + setContext("proxyEstimateSize", proxyEstimateSize); // Size is assumed to be larger than the target size for no splitting // @@@ Need way to obtain the target size Spliterator.OfLong sp = intermediateOp.apply(LongStream.range(0, 1000)).spliterator(); @@ -521,12 +536,17 @@ public class StreamSpliteratorTest extends OpTestCase { s -> s.map(i -> i).parallel() ); - for (Consumer terminalOp : terminalOps) { - for (UnaryOperator intermediateOp : intermediateOps) { - for (boolean proxyEstimateSize : new boolean[]{false, true}) { + for (int i = 0; i < terminalOps.size(); i++) { + Consumer terminalOp = terminalOps.get(i); + setContext("termOpIndex", i); + for (int j = 0; j < intermediateOps.size(); j++) { + UnaryOperator intermediateOp = intermediateOps.get(j); + setContext("intOpIndex", j); + for (boolean proxyEstimateSize : new boolean[] {false, true}) { + setContext("proxyEstimateSize", proxyEstimateSize); // Size is assumed to be larger than the target size for no splitting // @@@ Need way to obtain the target size - Spliterator.OfDouble sp = intermediateOp.apply(DoubleStream.range(0, 1000)).spliterator(); + Spliterator.OfDouble sp = intermediateOp.apply(IntStream.range(0, 1000).asDoubleStream()).spliterator(); ProxyNoExactSizeSpliterator.OfDouble psp = new ProxyNoExactSizeSpliterator.OfDouble(sp, proxyEstimateSize); DoubleStream s = StreamSupport.doubleParallelStream(psp); terminalOp.accept(s); diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java index 2dd8c55016e..b9087415c98 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/TabulatorsTest.java @@ -202,26 +202,38 @@ public class TabulatorsTest extends OpTestCase { } } + private ResultAsserter mapTabulationAsserter(boolean ordered) { + return (act, exp, ord, par) -> { + if (par & (!ordered || !ord)) { + TabulatorsTest.nestedMapEqualityAssertion(act, exp); + } + else { + LambdaTestHelpers.assertContentsEqual(act, exp); + } + }; + } + private void exerciseMapTabulation(TestData> data, Collector collector, TabulationAssertion assertion) throws ReflectiveOperationException { - boolean ordered = data.isOrdered() - && !collector.characteristics().contains(Collector.Characteristics.UNORDERED); + boolean ordered = !collector.characteristics().contains(Collector.Characteristics.UNORDERED); + M m = withData(data) .terminal(s -> s.collect(collector)) - .parallelEqualityAsserter(ordered ? LambdaTestHelpers::assertContentsEqual : this::nestedMapEqualityAssertion) + .resultAsserter(mapTabulationAsserter(ordered)) .exercise(); assertion.assertValue(m, () -> data.stream(), ordered); + m = withData(data) .terminal(s -> s.unordered().collect(collector)) - .parallelEqualityAsserter(this::nestedMapEqualityAssertion) + .resultAsserter(mapTabulationAsserter(ordered)) .exercise(); assertion.assertValue(m, () -> data.stream(), false); } - private void nestedMapEqualityAssertion(Object o1, Object o2) { + private static void nestedMapEqualityAssertion(Object o1, Object o2) { if (o1 instanceof Map) { Map m1 = (Map) o1; Map m2 = (Map) o2; diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java index 0971e89fcf1..04475e87260 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ToArrayOpTest.java @@ -29,6 +29,7 @@ import java.util.function.Function; import java.util.stream.*; import static java.util.stream.LambdaTestHelpers.*; +import static org.testng.Assert.assertEquals; /** @@ -134,15 +135,51 @@ public class ToArrayOpTest extends OpTestCase { s -> s.sorted() )); + private ResultAsserter statefulOpResultAsserter(TestData.OfRef data) { + return (act, exp, ord, par) -> { + if (par) { + if (!data.isOrdered()) { + // Relax the checking if the data source is unordered + // It is not exactly possible to determine if the limit + // operation is present and if it is before or after + // the sorted operation + // If the limit operation is present and before the sorted + // operation then the sub-set output after limit is a + // non-deterministic sub-set of the source + List expected = new ArrayList<>(); + data.forEach(expected::add); + + List actual = Arrays.asList(act); + + assertEquals(actual.size(), exp.length); + assertTrue(expected.containsAll(actual)); + return; + } + else if (!ord) { + LambdaTestHelpers.assertContentsUnordered(Arrays.asList(act), + Arrays.asList(exp)); + return; + } + } + assertEquals(act, exp); + }; + } + @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) public void testStatefulOpPermutations(String name, TestData.OfRef data) { for (Function, Stream> f : statefulOpPermutations) { - exerciseTerminalOps(data, f, s -> s.toArray()); + withData(data).terminal(f, s -> s.toArray()) + .resultAsserter(statefulOpResultAsserter(data)) + .exercise(); - Integer[] is = exerciseTerminalOps(data, f, s -> s.toArray(Integer[]::new)); + Integer[] is = withData(data).terminal(f, s -> s.toArray(Integer[]::new)) + .resultAsserter(statefulOpResultAsserter(data)) + .exercise(); assertEquals(is.getClass(), Integer[].class); - Number[] ns = exerciseTerminalOps(data, f, s -> s.toArray(Number[]::new)); + Number[] ns = withData(data).terminal(f, s -> s.toArray(Number[]::new)) + .resultAsserter(statefulOpResultAsserter(data)) + .exercise(); assertEquals(ns.getClass(), Number[].class); if (data.size() > 0) { diff --git a/jdk/test/javax/print/PrintServiceLookup/GetPrintServices.java b/jdk/test/javax/print/PrintServiceLookup/GetPrintServices.java new file mode 100644 index 00000000000..f8373a6383a --- /dev/null +++ b/jdk/test/javax/print/PrintServiceLookup/GetPrintServices.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.attribute.AttributeSet; +import javax.print.attribute.HashAttributeSet; +import javax.print.attribute.standard.PrinterName; + +/* + * @test + * @bug 8013810 + * @summary Test that print service returned without filter are of the same class as with name filter + */ +public class GetPrintServices { + + public static void main(String[] args) throws Exception { + for (PrintService service : PrintServiceLookup.lookupPrintServices(null, null)) { + String serviceName = service.getName(); + PrintService serviceByName = lookupByName(serviceName); + if (!service.equals(serviceByName)) { + throw new RuntimeException("NOK " + serviceName + + " expected: " + service.getClass().getName() + + " got: " + serviceByName.getClass().getName()); + } + } + System.out.println("Test PASSED"); + } + + private static PrintService lookupByName(String name) { + AttributeSet attributes = new HashAttributeSet(); + attributes.add(new PrinterName(name, null)); + for (PrintService service : PrintServiceLookup.lookupPrintServices(null, attributes)) { + return service; + } + return null; + } +} diff --git a/jdk/test/javax/swing/JFileChooser/8013442/Test8013442.java b/jdk/test/javax/swing/JFileChooser/8013442/Test8013442.java new file mode 100644 index 00000000000..e7b892ddaed --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/8013442/Test8013442.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8013442 + * @summary Tests that at least one file filter is selected + * @author Sergey Malenkov + */ + +import java.io.File; +import java.util.concurrent.CountDownLatch; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UIManager.LookAndFeelInfo; +import javax.swing.filechooser.FileFilter; + +public class Test8013442 extends FileFilter implements Runnable, Thread.UncaughtExceptionHandler { + private static final CountDownLatch LATCH = new CountDownLatch(1); + + public static void main(String[] args) throws InterruptedException { + SwingUtilities.invokeLater(new Test8013442()); + LATCH.await(); // workaround for jtreg + } + + private int index; + private LookAndFeelInfo[] infos; + private JFileChooser chooser; + + @Override + public boolean accept(File file) { + return !file.isFile() || file.getName().toLowerCase().endsWith(".txt"); + } + + @Override + public String getDescription() { + return "Text files"; + } + + @Override + public void run() { + if (this.infos == null) { + this.infos = UIManager.getInstalledLookAndFeels(); + Thread.currentThread().setUncaughtExceptionHandler(this); + } + if (this.infos.length == this.index) { + LATCH.countDown(); // release main thread + } else if (this.chooser == null) { + // change LaF before creation of Swing components + LookAndFeelInfo info = this.infos[this.index]; + System.out.println(info.getName()); + try { + UIManager.setLookAndFeel(info.getClassName()); + } + catch (Exception exception) { + throw new Error("could not change look and feel", exception); + } + // create and show new file chooser + JFrame frame = new JFrame(getClass().getSimpleName()); + frame.add(this.chooser = new JFileChooser()); + frame.setSize(800, 600); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + SwingUtilities.invokeLater(this); + } + else { + int count = this.chooser.getChoosableFileFilters().length; + System.out.println("count = " + count + "; " + this.chooser.isAcceptAllFileFilterUsed()); + if (count == 0) { + if (null != this.chooser.getFileFilter()) { + throw new Error("file filter is selected"); + } + // close window and stop testing file chooser for current LaF + SwingUtilities.getWindowAncestor(this.chooser).dispose(); + this.chooser = null; + this.index++; + } else { + if (null == this.chooser.getFileFilter()) { + throw new Error("file filter is not selected"); + } + if (count == 2) { + // remove default file filter + this.chooser.setAcceptAllFileFilterUsed(false); + } else if (this.chooser.isAcceptAllFileFilterUsed()) { + // remove add file filter + this.chooser.addChoosableFileFilter(this); + } else { + // remove custom file filter + this.chooser.removeChoosableFileFilter(this); + } + } + SwingUtilities.invokeLater(this); + } + } + + public void uncaughtException(Thread thread, Throwable throwable) { + throwable.printStackTrace(); + System.exit(1); + } +} diff --git a/jdk/test/javax/swing/JMenu/4692443/bug4692443.java b/jdk/test/javax/swing/JMenu/4692443/bug4692443.java new file mode 100644 index 00000000000..6032287e534 --- /dev/null +++ b/jdk/test/javax/swing/JMenu/4692443/bug4692443.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library ../../regtesthelpers + * @build Util + * @bug 4692443 7105030 + * @summary JMenu: MenuListener.menuSelected() event fired too late when using mnemonics + * @author Alexander Zuev + * @run main bug4692443 + */ + +import javax.swing.*; +import javax.swing.event.*; +import java.awt.event.*; +import java.awt.*; +import sun.awt.SunToolkit; + +public class bug4692443 { + + public static PassedListener pass; + public static FailedListener fail; + public static volatile Boolean passed; + + public static void main(String args[]) throws Throwable { + + fail = new FailedListener(); + pass = new PassedListener(); + passed = false; + Robot robo = new Robot(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + toolkit.realSync(); + + try { + robo = new Robot(); + } catch (AWTException e) { + throw new RuntimeException("Robot could not be created"); + } + int altKey = java.awt.event.KeyEvent.VK_ALT; + robo.setAutoDelay(100); + Util.hitMnemonics(robo, KeyEvent.VK_F); // Enter File menu + robo.keyPress(KeyEvent.VK_S); // Enter submenu + robo.keyRelease(KeyEvent.VK_S); + robo.keyPress(KeyEvent.VK_O); // Launch "One" action + robo.keyRelease(KeyEvent.VK_O); + robo.keyPress(KeyEvent.VK_M); // Launch "One" action + robo.keyRelease(KeyEvent.VK_M); + + toolkit.realSync(); + + if (!passed) { + throw new RuntimeException("Test failed."); + } + + } + + private static void createAndShowGUI() { + JFrame mainFrame = new JFrame("Bug 4692443"); + JMenuBar mbar = new JMenuBar(); + JMenu menu = new JMenu("File"); + menu.setMnemonic('F'); + menu.add(new JMenuItem("Menu Item 1")).setMnemonic('I'); + final JMenu submenu = new JMenu("Submenu"); + submenu.setMnemonic('S'); + submenu.addMenuListener(new MenuListener() { + public void menuSelected(MenuEvent e) { + JMenuItem item = submenu.add(new JMenuItem("One", 'O')); + item.addActionListener(pass); + submenu.add(new JMenuItem("Two", 'w')); + submenu.add(new JMenuItem("Three", 'r')); + } + public void menuDeselected(MenuEvent e) { + submenu.removeAll(); + } + public void menuCanceled(MenuEvent e) { + submenu.removeAll(); + } + }); + menu.add(submenu); + JMenuItem menuItem = menu.add(new JMenuItem("Menu Item 2")); + menuItem.setMnemonic('M'); + menuItem.addActionListener(fail); + mbar.add(menu); + mainFrame.setJMenuBar(mbar); + + mainFrame.setSize(200, 200); + mainFrame.setLocation(200, 200); + mainFrame.setVisible(true); + mainFrame.toFront(); + } + + public static class FailedListener implements ActionListener { + public void actionPerformed(ActionEvent ev) { + throw new RuntimeException("Test failed."); + } + } + + public static class PassedListener implements ActionListener { + public void actionPerformed(ActionEvent ev) { + passed = true; + } + } + +} diff --git a/jdk/test/javax/swing/JTree/8013571/Test8013571.java b/jdk/test/javax/swing/JTree/8013571/Test8013571.java new file mode 100644 index 00000000000..15ad391dcf2 --- /dev/null +++ b/jdk/test/javax/swing/JTree/8013571/Test8013571.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; + +/* + * @test + * @bug 8016545 + * @summary Tests beans with public fields + * @author Sergey Malenkov + */ + +public class Test8013571 extends DefaultTreeModel { + public static void main(String[] args) { + DefaultMutableTreeNode root = create("root"); + root.add(create("colors", "blue", "violet", "red", "yellow")); + root.add(create("sports", "basketball", "soccer", "football", "hockey")); + root.add(create("food", "hot dogs", "pizza", "ravioli", "bananas")); + Test8013571 model = new Test8013571(root); + JTree tree = new JTree(model); + model.fireTreeChanged(tree); + } + + private static DefaultMutableTreeNode create(String name, String... values) { + DefaultMutableTreeNode node = new DefaultMutableTreeNode(name); + for (String value : values) { + node.add(create(value)); + } + return node; + } + + private Test8013571(DefaultMutableTreeNode root) { + super(root); + } + + private void fireTreeChanged(Object source) { + fireTreeNodesInserted(source, null, null, null); + fireTreeNodesChanged(source, null, null, null); + fireTreeNodesRemoved(source, null, null, null); + fireTreeStructureChanged(source, null, null, null); + } +} diff --git a/jdk/test/javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java b/jdk/test/javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java new file mode 100644 index 00000000000..742fc99091a --- /dev/null +++ b/jdk/test/javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.swing.JComboBox; + +/* + * @test + * @bug 8015336 + * @summary No NPE for BasicComboBoxEditor.setItem(null) + * @author Sergey Malenkov + */ +public class Test8015336 { + public static void main(String[] args) throws Exception { + new JComboBox().getEditor().setItem(new Test8015336()); + } + + @Override + public String toString() { + return null; + } +} diff --git a/jdk/test/javax/swing/text/View/8014863/bug8014863.java b/jdk/test/javax/swing/text/View/8014863/bug8014863.java index 3ceebd676f2..ba78b4bbbbb 100644 --- a/jdk/test/javax/swing/text/View/8014863/bug8014863.java +++ b/jdk/test/javax/swing/text/View/8014863/bug8014863.java @@ -136,9 +136,12 @@ public class bug8014863 { "qqqq pp qqqq pp qqqq pp qqqq pp" + " qqqq pp qqqq pp qqqq pp qqqq

        "); editorPane.setCaretPosition(1); - + // An actual font size depends on OS and might be differnet on various OSs. + // It is necessary to calculate the width to meet the expected number of lines. + int width = SwingUtilities.computeStringWidth(editorPane.getFontMetrics(editorPane.getFont()), + "qqqq pp qqqq pp qqqq pp qqqqqqqq"); frame.add(editorPane); - frame.setSize(200, 200); + frame.setSize(width, 200); frame.setVisible(true); } }); diff --git a/jdk/test/javax/swing/text/View/8015853/bug8015853.java b/jdk/test/javax/swing/text/View/8015853/bug8015853.java new file mode 100644 index 00000000000..f63210683be --- /dev/null +++ b/jdk/test/javax/swing/text/View/8015853/bug8015853.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8015853 + * @summary Tests the rendering of a large HTML document + * @author Dmitry Markov + * @run main bug8015853 + */ + +import java.io.*; +import java.net.URL; +import java.util.Scanner; +import javax.swing.*; +import javax.swing.text.html.HTMLEditorKit; + +public class bug8015853 { + + private static String text = ""; + + public static void main(String[] args) throws Exception { + + try { + URL path = ClassLoader.getSystemResource("bug8015853.txt"); + File file = new File(path.toURI()); + Scanner scanner = new Scanner(file); + while (scanner.hasNextLine()) { + text += scanner.nextLine() + "\n"; + } + scanner.close(); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + text += text; + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + } + + private static void createAndShowGUI() { + try { + UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JEditorPane editorPane = new JEditorPane(); + HTMLEditorKit editorKit = new HTMLEditorKit(); + editorPane.setEditorKit(editorKit); + editorPane.setText(text); + + frame.add(editorPane); + frame.setVisible(true); + } +} diff --git a/jdk/test/javax/swing/text/View/8015853/bug8015853.txt b/jdk/test/javax/swing/text/View/8015853/bug8015853.txt new file mode 100644 index 00000000000..d9a6230684f --- /dev/null +++ b/jdk/test/javax/swing/text/View/8015853/bug8015853.txt @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.*; +import java.net.URL; +import java.util.Scanner; +import javax.swing.*; +import javax.swing.text.html.HTMLEditorKit; +public class bug8015853 { + private static String text = ""; + public static void main(String[] args) throws Exception { + + try { + URL path = ClassLoader.getSystemResource("bug8015853.txt"); + File file = new File(path.toURI()); + Scanner scanner = new Scanner(file); + while (scanner.hasNextLine()) { + text += scanner.nextLine() + "\n"; + } + scanner.close(); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + System.out.println(text); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + } + private static void createAndShowGUI() { + try { + UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JEditorPane editorPane = new JEditorPane(); + HTMLEditorKit editorKit = new HTMLEditorKit(); + editorPane.setEditorKit(editorKit); + editorPane.setText(text); + frame.add(editorPane); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java index 60ce1c66de2..62fd8e2536c 100644 --- a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java +++ b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @summary Basic unit tests for generating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java GenerationTests.java - * @run main GenerationTests + * @run main/othervm GenerationTests * @author Sean Mullan */ @@ -487,6 +487,7 @@ public class GenerationTests { Collections.singletonList(obj), "signature", null); DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA"), doc); + dsc.setIdAttributeNS(nc, null, "Id"); sig.sign(dsc); @@ -494,6 +495,7 @@ public class GenerationTests { DOMValidateContext dvc = new DOMValidateContext (kvks, doc.getDocumentElement()); + dvc.setIdAttributeNS(nc, null, "Id"); XMLSignature sig2 = fac.unmarshalXMLSignature(dvc); if (sig.equals(sig2) == false) { diff --git a/jdk/test/javax/xml/crypto/dsig/SecurityManager/XMLDSigWithSecMgr.java b/jdk/test/javax/xml/crypto/dsig/SecurityManager/XMLDSigWithSecMgr.java index 31c4ec5904e..014a7a6ab38 100644 --- a/jdk/test/javax/xml/crypto/dsig/SecurityManager/XMLDSigWithSecMgr.java +++ b/jdk/test/javax/xml/crypto/dsig/SecurityManager/XMLDSigWithSecMgr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,6 +140,10 @@ public class XMLDSigWithSecMgr implements Runnable { // validate a signature with SecurityManager enabled DOMValidateContext dvc = new DOMValidateContext (kp.getPublic(), envelope.getFirstChild()); + + // disable secure validation mode so that http reference will work + dvc.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.FALSE); + sig = fac.unmarshalXMLSignature(dvc); if (!sig.validate(dvc)) { throw new Exception diff --git a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java index 4ee123e42e1..5a86692f8c8 100644 --- a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java +++ b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ * @summary Basic unit tests for validating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java ValidationTests.java - * @run main ValidationTests + * @run main/othervm ValidationTests * @author Sean Mullan */ import java.io.File; diff --git a/jdk/test/javax/xml/jaxp/XPath/8009579/XPathExceptionInitCause.java b/jdk/test/javax/xml/jaxp/XPath/8009579/XPathExceptionInitCause.java new file mode 100644 index 00000000000..6ffe91a1b27 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/XPath/8009579/XPathExceptionInitCause.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8009579 + * @summary The initCause() incorrectly initialise the cause in + * XPathException class when used with XPathException(String) + * constructor. + * @run main XPathExceptionInitCause + * @author aleksej.efimov@oracle.com + */ + +import javax.xml.xpath.XPathException; +import java.io.ByteArrayOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectInputStream; +import java.io.IOException; +import java.io.InvalidClassException; + + +public class XPathExceptionInitCause { + + /* This is a serial form of XPathException with two causes serialized + * by JDK7 code: + * + * ByteArrayOutputStream fser = new ByteArrayOutputStream(); + * ObjectOutputStream oos = new ObjectOutputStream(fser); + * oos.writeObject(new XPathException(new Exception()).initCause(null)); + * oos.close(); + */ + static final byte [] TWOCAUSES = {-84,-19,0,5,115,114,0,30,106,97,118,97,120,46,120, + 109,108,46,120,112,97,116,104,46,88,80,97,116,104,69,120,99,101,112,116, + 105,111,110,-26,-127,97,60,-120,119,127,28,2,0,1,76,0,5,99,97,117,115,101, + 116,0,21,76,106,97,118,97,47,108,97,110,103,47,84,104,114,111,119,97,98, + 108,101,59,120,114,0,19,106,97,118,97,46,108,97,110,103,46,69,120,99,101, + 112,116,105,111,110,-48,-3,31,62,26,59,28,-60,2,0,0,120,114,0,19,106,97, + 118,97,46,108,97,110,103,46,84,104,114,111,119,97,98,108,101,-43,-58,53, + 39,57,119,-72,-53,3,0,4,76,0,5,99,97,117,115,101,113,0,126,0,1,76,0,13, + 100,101,116,97,105,108,77,101,115,115,97,103,101,116,0,18,76,106,97,118, + 97,47,108,97,110,103,47,83,116,114,105,110,103,59,91,0,10,115,116,97,99, + 107,84,114,97,99,101,116,0,30,91,76,106,97,118,97,47,108,97,110,103,47,83, + 116,97,99,107,84,114,97,99,101,69,108,101,109,101,110,116,59,76,0,20,115, + 117,112,112,114,101,115,115,101,100,69,120,99,101,112,116,105,111,110,115, + 116,0,16,76,106,97,118,97,47,117,116,105,108,47,76,105,115,116,59,120,112, + 112,112,117,114,0,30,91,76,106,97,118,97,46,108,97,110,103,46,83,116,97,99, + 107,84,114,97,99,101,69,108,101,109,101,110,116,59,2,70,42,60,60,-3,34,57, + 2,0,0,120,112,0,0,0,1,115,114,0,27,106,97,118,97,46,108,97,110,103,46,83, + 116,97,99,107,84,114,97,99,101,69,108,101,109,101,110,116,97,9,-59,-102, + 38,54,-35,-123,2,0,4,73,0,10,108,105,110,101,78,117,109,98,101,114,76,0, + 14,100,101,99,108,97,114,105,110,103,67,108,97,115,115,113,0,126,0,4,76, + 0,8,102,105,108,101,78,97,109,101,113,0,126,0,4,76,0,10,109,101,116,104, + 111,100,78,97,109,101,113,0,126,0,4,120,112,0,0,0,31,116,0,23,88,80,97,116, + 104,69,120,99,101,112,116,105,111,110,83,101,114,105,97,108,105,122,101, + 116,0,28,88,80,97,116,104,69,120,99,101,112,116,105,111,110,83,101,114,105, + 97,108,105,122,101,46,106,97,118,97,116,0,4,109,97,105,110,115,114,0,38, + 106,97,118,97,46,117,116,105,108,46,67,111,108,108,101,99,116,105,111,110, + 115,36,85,110,109,111,100,105,102,105,97,98,108,101,76,105,115,116,-4,15, + 37,49,-75,-20,-114,16,2,0,1,76,0,4,108,105,115,116,113,0,126,0,6,120,114, + 0,44,106,97,118,97,46,117,116,105,108,46,67,111,108,108,101,99,116,105,111, + 110,115,36,85,110,109,111,100,105,102,105,97,98,108,101,67,111,108,108,101, + 99,116,105,111,110,25,66,0,-128,-53,94,-9,30,2,0,1,76,0,1,99,116,0,22,76, + 106,97,118,97,47,117,116,105,108,47,67,111,108,108,101,99,116,105,111,110, + 59,120,112,115,114,0,19,106,97,118,97,46,117,116,105,108,46,65,114,114,97, + 121,76,105,115,116,120,-127,-46,29,-103,-57,97,-99,3,0,1,73,0,4,115,105, + 122,101,120,112,0,0,0,0,119,4,0,0,0,0,120,113,0,126,0,20,120,115,113,0,126, + 0,2,113,0,126,0,21,112,117,113,0,126,0,8,0,0,0,1,115,113,0,126,0,10,0,0,0, + 31,113,0,126,0,12,113,0,126,0,13,113,0,126,0,14,113,0,126,0,18,120 + }; + + /* This is a serial form of ordinary XPathException serialized by JDK7 code: + * + * Throwable cause = new Throwable( "message 1" ); + * XPathException xpathexcep = new XPathException( "message 2" ); + * xpathexcep.initCause( cause ); + * ByteArrayOutputStream fser = new ByteArrayOutputStream(); + * ObjectOutputStream oos = new ObjectOutputStream(fser); + * oos.writeObject(xpathexcep); + * oos.close(); + */ + static final byte [] NORMALJDK7SER = {-84,-19,0,5,115,114,0,30,106,97,118,97,120, + 46,120,109,108,46,120,112,97,116,104,46,88,80,97,116,104,69,120,99,101,112, + 116,105,111,110,-26,-127,97,60,-120,119,127,28,2,0,1,76,0,5,99,97,117,115, + 101,116,0,21,76,106,97,118,97,47,108,97,110,103,47,84,104,114,111,119,97, + 98,108,101,59,120,114,0,19,106,97,118,97,46,108,97,110,103,46,69,120,99, + 101,112,116,105,111,110,-48,-3,31,62,26,59,28,-60,2,0,0,120,114,0,19,106, + 97,118,97,46,108,97,110,103,46,84,104,114,111,119,97,98,108,101,-43,-58, + 53,39,57,119,-72,-53,3,0,4,76,0,5,99,97,117,115,101,113,0,126,0,1,76,0,13, + 100,101,116,97,105,108,77,101,115,115,97,103,101,116,0,18,76,106,97,118, + 97,47,108,97,110,103,47,83,116,114,105,110,103,59,91,0,10,115,116,97,99, + 107,84,114,97,99,101,116,0,30,91,76,106,97,118,97,47,108,97,110,103,47,83, + 116,97,99,107,84,114,97,99,101,69,108,101,109,101,110,116,59,76,0,20,115, + 117,112,112,114,101,115,115,101,100,69,120,99,101,112,116,105,111,110,115, + 116,0,16,76,106,97,118,97,47,117,116,105,108,47,76,105,115,116,59,120,112, + 115,113,0,126,0,3,113,0,126,0,8,116,0,9,109,101,115,115,97,103,101,32,49, + 117,114,0,30,91,76,106,97,118,97,46,108,97,110,103,46,83,116,97,99,107,84, + 114,97,99,101,69,108,101,109,101,110,116,59,2,70,42,60,60,-3,34,57,2,0,0, + 120,112,0,0,0,1,115,114,0,27,106,97,118,97,46,108,97,110,103,46,83,116,97, + 99,107,84,114,97,99,101,69,108,101,109,101,110,116,97,9,-59,-102,38,54,-35, + -123,2,0,4,73,0,10,108,105,110,101,78,117,109,98,101,114,76,0,14,100,101, + 99,108,97,114,105,110,103,67,108,97,115,115,113,0,126,0,4,76,0,8,102,105, + 108,101,78,97,109,101,113,0,126,0,4,76,0,10,109,101,116,104,111,100,78,97, + 109,101,113,0,126,0,4,120,112,0,0,0,19,116,0,23,88,80,97,116,104,69,120, + 99,101,112,116,105,111,110,83,101,114,105,97,108,105,122,101,116,0,28,88, + 80,97,116,104,69,120,99,101,112,116,105,111,110,83,101,114,105,97,108,105, + 122,101,46,106,97,118,97,116,0,4,109,97,105,110,115,114,0,38,106,97,118, + 97,46,117,116,105,108,46,67,111,108,108,101,99,116,105,111,110,115,36,85, + 110,109,111,100,105,102,105,97,98,108,101,76,105,115,116,-4,15,37,49,-75, + -20,-114,16,2,0,1,76,0,4,108,105,115,116,113,0,126,0,6,120,114,0,44,106, + 97,118,97,46,117,116,105,108,46,67,111,108,108,101,99,116,105,111,110,115, + 36,85,110,109,111,100,105,102,105,97,98,108,101,67,111,108,108,101,99,116, + 105,111,110,25,66,0,-128,-53,94,-9,30,2,0,1,76,0,1,99,116,0,22,76,106,97, + 118,97,47,117,116,105,108,47,67,111,108,108,101,99,116,105,111,110,59,120, + 112,115,114,0,19,106,97,118,97,46,117,116,105,108,46,65,114,114,97,121,76, + 105,115,116,120,-127,-46,29,-103,-57,97,-99,3,0,1,73,0,4,115,105,122,101, + 120,112,0,0,0,0,119,4,0,0,0,0,120,113,0,126,0,22,120,116,0,9,109,101,115, + 115,97,103,101,32,50,117,113,0,126,0,10,0,0,0,1,115,113,0,126,0,12,0,0,0, + 20,113,0,126,0,14,113,0,126,0,15,113,0,126,0,16,113,0,126,0,20,120,112 + }; + + //Serialize XPathException + static byte [] pickleXPE(XPathException xpe) throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream xpeos = new ObjectOutputStream(bos); + xpeos.writeObject(xpe); + xpeos.close(); + return bos.toByteArray(); + } + + //Deserialize XPathException with byte array as serial data source + static XPathException unpickleXPE(byte [] ser) + throws IOException, ClassNotFoundException { + XPathException xpe; + ByteArrayInputStream bis = new ByteArrayInputStream(ser); + ObjectInputStream xpeis = new ObjectInputStream(bis); + xpe = (XPathException) xpeis.readObject(); + xpeis.close(); + return xpe; + } + + public static void main(String[] args) throws Exception { + Throwable cause = new Throwable("message 1"); + XPathException xpathexcep = new XPathException("message 2"); + + //Test XPE initCause() method + xpathexcep.initCause(cause); + System.out.println("getCause() result: '" + xpathexcep.getCause() + + "' Cause itself: '" + cause + "'"); + if (!xpathexcep.getCause().toString().equals(cause.toString())) { + throw new Exception("Incorrect cause is set by initCause()"); + } + + //Test serialization/deserialization of initialized XPE + byte [] xpeserial; + XPathException xpedeser; + xpeserial = pickleXPE(xpathexcep); + xpedeser = unpickleXPE(xpeserial); + System.out.println("Serialized XPE: message='" + xpathexcep.getMessage() + + "' cause='" + xpathexcep.getCause().toString() + "'"); + System.out.println("Deserialized XPE: message='" + xpedeser.getMessage() + + "' cause='" + xpedeser.getCause().toString()+"'"); + if(xpedeser.getCause() == null || + !xpedeser.getCause().toString().equals(cause.toString()) || + !xpedeser.getMessage().toString().equals("message 2") ) + throw new Exception("XPathException incorrectly serialized/deserialized"); + + //Test serialization/deserialization of uninitialized cause in XPE + XPathException xpeuninit = new XPathException("uninitialized cause"); + xpeserial = pickleXPE(xpeuninit); + xpedeser = unpickleXPE(xpeserial); + System.out.println("Serialized XPE: message='" + xpeuninit.getMessage() + + "' cause='" + xpeuninit.getCause()+"'"); + System.out.println("Deserialized XPE: message='" + xpedeser.getMessage() + + "' cause='" + xpedeser.getCause()+"'"); + if(xpedeser.getCause() != null || + !xpedeser.getMessage().toString().equals("uninitialized cause") ) + throw new Exception("XPathException incorrectly serialized/deserialized"); + + //Test deserialization of normal XPathException serialized by JDK7 + XPathException xpejdk7 = unpickleXPE(NORMALJDK7SER); + if(xpejdk7 == null || xpejdk7.getCause() == null || + !xpejdk7.getMessage().equals("message 2") || + !xpejdk7.getCause().getMessage().equals("message 1")) + throw new Exception("XpathException serialized by JDK7 was " + + "incorrectly deserialized."); + + //Test deserialization of XPathException with two causes from JDK7. + //The serialization are done for the following XPathException object: + // new XPathException(new Exception()).initCause(null) + try { + xpejdk7 = unpickleXPE(TWOCAUSES); + throw new Exception("Expected InvalidClassException but it wasn't" + + " observed"); + } catch(InvalidClassException e) { + System.out.println("InvalidClassException caught as expected."); + } + + } +} diff --git a/jdk/test/javax/xml/jaxp/XPath/8015978/XPathNegativeZero.java b/jdk/test/javax/xml/jaxp/XPath/8015978/XPathNegativeZero.java new file mode 100644 index 00000000000..79a3ed51535 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/XPath/8015978/XPathNegativeZero.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8015978 + * @summary Incorrect transformation of XPath expression "string(-0)" + * @run main XPathNegativeZero + * @author aleksej.efimov@oracle.com + */ + +import java.io.File; +import java.io.StringWriter; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.Templates; +import javax.xml.transform.Transformer; +import javax.xml.transform.Source; +import javax.xml.transform.Result; +import javax.xml.transform.stream.StreamSource; +import javax.xml.transform.stream.StreamResult; + + +public class XPathNegativeZero { + + static final String EXPECTEDXML = "\"0\""; + + public static void main(final String[] args) throws Exception { + //file name of XML file to transform + final String xml = System.getProperty("test.src", ".")+"/dummy.xml"; + //file name of XSL file w/ transformation + final String xsl = System.getProperty("test.src", ".")+"/negativezero.xsl"; + final String result = xform(xml, xsl).trim(); + + System.out.println("transformed XML: '"+result+ "' expected XML: '"+EXPECTEDXML+"'"); + if (!result.equals(EXPECTEDXML)) + throw new Exception("Negative zero was incorrectly transformed"); + } + + private static String xform(final String xml, final String xsl) throws Exception { + final TransformerFactory tf = TransformerFactory.newInstance(); + final Source xslsrc = new StreamSource(new File(xsl)); + final Templates tmpl = tf.newTemplates(xslsrc); + final Transformer t = tmpl.newTransformer(); + + StringWriter writer = new StringWriter(); + final Source src = new StreamSource(new File(xml)); + final Result res = new StreamResult(writer); + + t.transform(src, res); + return writer.toString(); + } +} diff --git a/jdk/test/javax/xml/jaxp/XPath/8015978/dummy.xml b/jdk/test/javax/xml/jaxp/XPath/8015978/dummy.xml new file mode 100644 index 00000000000..3ad73ac3b6f --- /dev/null +++ b/jdk/test/javax/xml/jaxp/XPath/8015978/dummy.xml @@ -0,0 +1 @@ + diff --git a/jdk/test/javax/xml/jaxp/XPath/8015978/negativezero.xsl b/jdk/test/javax/xml/jaxp/XPath/8015978/negativezero.xsl new file mode 100644 index 00000000000..5ee2dbe6dd5 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/XPath/8015978/negativezero.xsl @@ -0,0 +1,4 @@ + + + "" + diff --git a/jdk/test/lib/testlibrary/ClassFileInstaller.java b/jdk/test/lib/testlibrary/ClassFileInstaller.java new file mode 100644 index 00000000000..694223e77f3 --- /dev/null +++ b/jdk/test/lib/testlibrary/ClassFileInstaller.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; + +/** + * Dump a class file for a class on the class path in the current directory + */ +public class ClassFileInstaller { + /** + * @param args The names of the classes to dump + * @throws Exception + */ + public static void main(String... args) throws Exception { + for (String arg : args) { + ClassLoader cl = ClassFileInstaller.class.getClassLoader(); + + // Convert dotted class name to a path to a class file + String pathName = arg.replace('.', '/').concat(".class"); + InputStream is = cl.getResourceAsStream(pathName); + + // Create the class file's package directory + Path p = Paths.get(pathName); + Files.createDirectories(p.getParent()); + // Create the class file + Files.copy(is, p, StandardCopyOption.REPLACE_EXISTING); + } + } +} diff --git a/jdk/test/sun/awt/AppContext/8012933/Test8012933.java b/jdk/test/sun/awt/AppContext/8012933/Test8012933.java new file mode 100644 index 00000000000..445407be430 --- /dev/null +++ b/jdk/test/sun/awt/AppContext/8012933/Test8012933.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8012933 + * @summary Tests (although somewhat indirectly) that createNewAppContext() + * immediately followed by dispose() works correctly + * @author Leonid Romanov + */ + +import sun.awt.SunToolkit; +import sun.awt.AppContext; + +public class Test8012933 { + private AppContext appContext = null; + final ThreadGroup threadGroup = new ThreadGroup("test thread group"); + final Object lock = new Object(); + boolean isCreated = false; + + public static void main(String[] args) throws Exception { + SunToolkit.createNewAppContext(); + new Test8012933().test(); + } + + private void test() throws Exception { + createAppContext(); + long startTime = System.currentTimeMillis(); + appContext.dispose(); + long endTime = System.currentTimeMillis(); + + // In case of the bug, calling dispose() when there is no EQ + // dispatch thread running fails to create it, so it takes + // almost 10 sec to return from dispose(), which is spent + // waiting on the notificationLock. + if ((endTime - startTime) > 9000) { + throw new RuntimeException("Returning from dispose() took too much time, probably a bug"); + } + } + + private void createAppContext() { + isCreated = false; + final Runnable runnable = new Runnable() { + public void run() { + appContext = SunToolkit.createNewAppContext(); + synchronized (lock) { + isCreated = true; + lock.notifyAll(); + } + } + }; + + final Thread thread = new Thread(threadGroup, runnable, "creates app context"); + synchronized (lock) { + thread.start(); + while (!isCreated) { + try { + lock.wait(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + } + + if (appContext == null) { + throw new RuntimeException("failed to create app context."); + } else { + System.out.println("app context was created."); + } + } + +} diff --git a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java index 89bd29af056..12418c0ed2a 100644 --- a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java +++ b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java @@ -23,7 +23,7 @@ /** * @test - * @bug 6476665 7033534 + * @bug 6476665 7033534 6830714 * @summary Verifies color conversion of Component Color Model based images * @run main ColConvCCMTest */ @@ -57,9 +57,9 @@ public class ColConvCCMTest extends ColConvTest { final static double [] ACCURACY = { // Accuracy for color conversions 2.5, // sRGB - 6.5, // LINEAR_RGB + (isOpenProfile() ? 45.0 : 10.1), // LINEAR_RGB 10.5, // GRAY - 45.5, // PYCC + (isOpenProfile() ? 207 : 45.5), // PYCC 47.5 // CIEXYZ }; diff --git a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java index b9f85c72519..9ad05689942 100644 --- a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java +++ b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java @@ -62,7 +62,11 @@ public class ColConvDCMTest extends ColConvTest { ColorSpace.CS_LINEAR_RGB, }; - final static double ACCURACY = 2.5; + final static double [] ACCURACY = { + // Accuracy for color conversions + 2.5, // sRGB + (isOpenProfile() ? 45.0 : 2.5), // LINEAR_RGB + }; final static String [] gldImgNames = { "SRGB.png", "SRGB555.png", "SRGB565.png", "LRGB.png", "LRGB555.png", @@ -142,7 +146,7 @@ public class ColConvDCMTest extends ColConvTest { if (!testImage(imgTypes[i][0], imgTypes[i][1], imgTypes[i][2], imgTypes[i][3], cSpaces[imgTypes[i][4]], gldImage, - ACCURACY)) + ACCURACY[imgTypes[i][4]])) { throw new RuntimeException( "Invalid result of the ColorConvertOp for " + @@ -154,7 +158,8 @@ public class ColConvDCMTest extends ColConvTest { if (!testSubImage(SI_X, SI_Y, SI_W, SI_H, imgTypes[i][0], imgTypes[i][1], imgTypes[i][2], imgTypes[i][3], - cSpaces[imgTypes[i][4]], gldImage, ACCURACY)) + cSpaces[imgTypes[i][4]], gldImage, + ACCURACY[imgTypes[i][4]])) { throw new RuntimeException( "Invalid result of the ColorConvertOp for " + diff --git a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java index db3719134f1..b3f1c2e4da2 100644 --- a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java +++ b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java @@ -22,6 +22,7 @@ */ import java.awt.color.ColorSpace; +import java.awt.color.ICC_Profile; import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; @@ -126,4 +127,33 @@ public abstract class ColConvTest implements Runnable { public boolean isPassed() { return passed; } + + private static Boolean isOpenProfile = null; + + public static boolean isOpenProfile() { + if (isOpenProfile == null) { + ICC_Profile p = ICC_Profile.getInstance(ColorSpace.CS_sRGB); + + byte[] h = p.getData(ICC_Profile.icSigHead); + + if (h == null || h.length < 128) { + throw new RuntimeException("Test failed: invalid sRGB header"); + } + + final byte[] lcmsID = new byte[] { + (byte)0x6c, // l + (byte)0x63, // c + (byte)0x6d, // m + (byte)0x73, // s + }; + + int off = ICC_Profile.icHdrCmmId; + + isOpenProfile = ((h[off + 0] == lcmsID[0]) + && (h[off + 1] == lcmsID[1]) + && (h[off + 2] == lcmsID[2]) + && (h[off + 3] == lcmsID[3])); + } + return isOpenProfile; + } } diff --git a/jdk/src/share/classes/sun/misc/FDBigInt.java b/jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java similarity index 90% rename from jdk/src/share/classes/sun/misc/FDBigInt.java rename to jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java index 8cc4f13c3b8..8ad96803b08 100644 --- a/jdk/src/share/classes/sun/misc/FDBigInt.java +++ b/jdk/test/sun/misc/FloatingDecimal/OldFDBigIntForTest.java @@ -4,9 +4,7 @@ * * 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. + * 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 @@ -23,41 +21,41 @@ * questions. */ -package sun.misc; +//package sun.misc; /* * A really, really simple bigint package * tailored to the needs of floating base conversion. */ -class FDBigInt { +class OldFDBigIntForTest { int nWords; // number of words used int data[]; // value: data[0] is least significant - public FDBigInt( int v ){ + public OldFDBigIntForTest( int v ){ nWords = 1; data = new int[1]; data[0] = v; } - public FDBigInt( long v ){ + public OldFDBigIntForTest( long v ){ data = new int[2]; data[0] = (int)v; data[1] = (int)(v>>>32); nWords = (data[1]==0) ? 1 : 2; } - public FDBigInt( FDBigInt other ){ + public OldFDBigIntForTest( OldFDBigIntForTest other ){ data = new int[nWords = other.nWords]; System.arraycopy( other.data, 0, data, 0, nWords ); } - private FDBigInt( int [] d, int n ){ + private OldFDBigIntForTest( int [] d, int n ){ data = d; nWords = n; } - public FDBigInt( long seed, char digit[], int nd0, int nd ){ + public OldFDBigIntForTest( long seed, char digit[], int nd0, int nd ){ int n= (nd+8)/9; // estimate size needed. if ( n < 2 ) n = 2; data = new int[n]; // allocate enough space @@ -189,10 +187,10 @@ class FDBigInt { } /* - * Multiply a FDBigInt by an int. - * Result is a new FDBigInt. + * Multiply a OldFDBigIntForTest by an int. + * Result is a new OldFDBigIntForTest. */ - public FDBigInt + public OldFDBigIntForTest mult( int iv ) { long v = iv; int r[]; @@ -207,15 +205,15 @@ class FDBigInt { p >>>= 32; } if ( p == 0L){ - return new FDBigInt( r, nWords ); + return new OldFDBigIntForTest( r, nWords ); } else { r[nWords] = (int)p; - return new FDBigInt( r, nWords+1 ); + return new OldFDBigIntForTest( r, nWords+1 ); } } /* - * Multiply a FDBigInt by an int and add another int. + * Multiply a OldFDBigIntForTest by an int and add another int. * Result is computed in place. * Hope it fits! */ @@ -240,11 +238,11 @@ class FDBigInt { } /* - * Multiply a FDBigInt by another FDBigInt. - * Result is a new FDBigInt. + * Multiply a OldFDBigIntForTest by another OldFDBigIntForTest. + * Result is a new OldFDBigIntForTest. */ - public FDBigInt - mult( FDBigInt other ){ + public OldFDBigIntForTest + mult( OldFDBigIntForTest other ){ // crudely guess adequate size for r int r[] = new int[ nWords + other.nWords ]; int i; @@ -265,14 +263,14 @@ class FDBigInt { for ( i = r.length-1; i> 0; i--) if ( r[i] != 0 ) break; - return new FDBigInt( r, i+1 ); + return new OldFDBigIntForTest( r, i+1 ); } /* - * Add one FDBigInt to another. Return a FDBigInt + * Add one OldFDBigIntForTest to another. Return a OldFDBigIntForTest */ - public FDBigInt - add( FDBigInt other ){ + public OldFDBigIntForTest + add( OldFDBigIntForTest other ){ int i; int a[], b[]; int n, m; @@ -304,17 +302,17 @@ class FDBigInt { int s[] = new int[ r.length+1 ]; System.arraycopy( r, 0, s, 0, r.length ); s[i++] = (int)c; - return new FDBigInt( s, i ); + return new OldFDBigIntForTest( s, i ); } - return new FDBigInt( r, i ); + return new OldFDBigIntForTest( r, i ); } /* - * Subtract one FDBigInt from another. Return a FDBigInt + * Subtract one OldFDBigIntForTest from another. Return a OldFDBigIntForTest * Assert that the result is positive. */ - public FDBigInt - sub( FDBigInt other ){ + public OldFDBigIntForTest + sub( OldFDBigIntForTest other ){ int r[] = new int[ this.nWords ]; int i; int n = this.nWords; @@ -334,10 +332,10 @@ class FDBigInt { } assert c == 0L : c; // borrow out of subtract assert dataInRangeIsZero(i, m, other); // negative result of subtract - return new FDBigInt( r, n-nzeros ); + return new OldFDBigIntForTest( r, n-nzeros ); } - private static boolean dataInRangeIsZero(int i, int m, FDBigInt other) { + private static boolean dataInRangeIsZero(int i, int m, OldFDBigIntForTest other) { while ( i < m ) if (other.data[i++] != 0) return false; @@ -345,13 +343,13 @@ class FDBigInt { } /* - * Compare FDBigInt with another FDBigInt. Return an integer + * Compare OldFDBigIntForTest with another OldFDBigIntForTest. Return an integer * >0: this > other * 0: this == other * <0: this < other */ public int - cmp( FDBigInt other ){ + cmp( OldFDBigIntForTest other ){ int i; if ( this.nWords > other.nWords ){ // if any of my high-order words is non-zero, @@ -405,7 +403,7 @@ class FDBigInt { * as an integer, 0 <= q < 10. */ public int - quoRemIteration( FDBigInt S )throws IllegalArgumentException { + quoRemIteration( OldFDBigIntForTest S )throws IllegalArgumentException { // ensure that this and S have the same number of // digits. If S is properly normalized and q < 10 then // this must be so. diff --git a/jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java b/jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java new file mode 100644 index 00000000000..253e9e9e568 --- /dev/null +++ b/jdk/test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java @@ -0,0 +1,2436 @@ +/* + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +//package sun.misc; + +import sun.misc.DoubleConsts; +import sun.misc.FloatConsts; +import java.util.regex.*; + +public class OldFloatingDecimalForTest{ + boolean isExceptional; + boolean isNegative; + int decExponent; + char digits[]; + int nDigits; + int bigIntExp; + int bigIntNBits; + boolean mustSetRoundDir = false; + boolean fromHex = false; + int roundDir = 0; // set by doubleValue + + /* + * The fields below provides additional information about the result of + * the binary to decimal digits conversion done in dtoa() and roundup() + * methods. They are changed if needed by those two methods. + */ + + // True if the dtoa() binary to decimal conversion was exact. + boolean exactDecimalConversion = false; + + // True if the result of the binary to decimal conversion was rounded-up + // at the end of the conversion process, i.e. roundUp() method was called. + boolean decimalDigitsRoundedUp = false; + + private OldFloatingDecimalForTest( boolean negSign, int decExponent, char []digits, int n, boolean e ) + { + isNegative = negSign; + isExceptional = e; + this.decExponent = decExponent; + this.digits = digits; + this.nDigits = n; + } + + /* + * Constants of the implementation + * Most are IEEE-754 related. + * (There are more really boring constants at the end.) + */ + static final long signMask = 0x8000000000000000L; + static final long expMask = 0x7ff0000000000000L; + static final long fractMask= ~(signMask|expMask); + static final int expShift = 52; + static final int expBias = 1023; + static final long fractHOB = ( 1L< 0L ) { // i.e. while ((v&highbit) == 0L ) + v <<= 1; + } + + int n = 0; + while (( v & lowbytes ) != 0L ){ + v <<= 8; + n += 8; + } + while ( v != 0L ){ + v <<= 1; + n += 1; + } + return n; + } + + /* + * Keep big powers of 5 handy for future reference. + */ + private static OldFDBigIntForTest b5p[]; + + private static synchronized OldFDBigIntForTest + big5pow( int p ){ + assert p >= 0 : p; // negative power of 5 + if ( b5p == null ){ + b5p = new OldFDBigIntForTest[ p+1 ]; + }else if (b5p.length <= p ){ + OldFDBigIntForTest t[] = new OldFDBigIntForTest[ p+1 ]; + System.arraycopy( b5p, 0, t, 0, b5p.length ); + b5p = t; + } + if ( b5p[p] != null ) + return b5p[p]; + else if ( p < small5pow.length ) + return b5p[p] = new OldFDBigIntForTest( small5pow[p] ); + else if ( p < long5pow.length ) + return b5p[p] = new OldFDBigIntForTest( long5pow[p] ); + else { + // construct the value. + // recursively. + int q, r; + // in order to compute 5^p, + // compute its square root, 5^(p/2) and square. + // or, let q = p / 2, r = p -q, then + // 5^p = 5^(q+r) = 5^q * 5^r + q = p >> 1; + r = p - q; + OldFDBigIntForTest bigq = b5p[q]; + if ( bigq == null ) + bigq = big5pow ( q ); + if ( r < small5pow.length ){ + return (b5p[p] = bigq.mult( small5pow[r] ) ); + }else{ + OldFDBigIntForTest bigr = b5p[ r ]; + if ( bigr == null ) + bigr = big5pow( r ); + return (b5p[p] = bigq.mult( bigr ) ); + } + } + } + + // + // a common operation + // + private static OldFDBigIntForTest + multPow52( OldFDBigIntForTest v, int p5, int p2 ){ + if ( p5 != 0 ){ + if ( p5 < small5pow.length ){ + v = v.mult( small5pow[p5] ); + } else { + v = v.mult( big5pow( p5 ) ); + } + } + if ( p2 != 0 ){ + v.lshiftMe( p2 ); + } + return v; + } + + // + // another common operation + // + private static OldFDBigIntForTest + constructPow52( int p5, int p2 ){ + OldFDBigIntForTest v = new OldFDBigIntForTest( big5pow( p5 ) ); + if ( p2 != 0 ){ + v.lshiftMe( p2 ); + } + return v; + } + + /* + * Make a floating double into a OldFDBigIntForTest. + * This could also be structured as a OldFDBigIntForTest + * constructor, but we'd have to build a lot of knowledge + * about floating-point representation into it, and we don't want to. + * + * AS A SIDE EFFECT, THIS METHOD WILL SET THE INSTANCE VARIABLES + * bigIntExp and bigIntNBits + * + */ + private OldFDBigIntForTest + doubleToBigInt( double dval ){ + long lbits = Double.doubleToLongBits( dval ) & ~signMask; + int binexp = (int)(lbits >>> expShift); + lbits &= fractMask; + if ( binexp > 0 ){ + lbits |= fractHOB; + } else { + assert lbits != 0L : lbits; // doubleToBigInt(0.0) + binexp +=1; + while ( (lbits & fractHOB ) == 0L){ + lbits <<= 1; + binexp -= 1; + } + } + binexp -= expBias; + int nbits = countBits( lbits ); + /* + * We now know where the high-order 1 bit is, + * and we know how many there are. + */ + int lowOrderZeros = expShift+1-nbits; + lbits >>>= lowOrderZeros; + + bigIntExp = binexp+1-nbits; + bigIntNBits = nbits; + return new OldFDBigIntForTest( lbits ); + } + + /* + * Compute a number that is the ULP of the given value, + * for purposes of addition/subtraction. Generally easy. + * More difficult if subtracting and the argument + * is a normalized a power of 2, as the ULP changes at these points. + */ + private static double ulp( double dval, boolean subtracting ){ + long lbits = Double.doubleToLongBits( dval ) & ~signMask; + int binexp = (int)(lbits >>> expShift); + double ulpval; + if ( subtracting && ( binexp >= expShift ) && ((lbits&fractMask) == 0L) ){ + // for subtraction from normalized, powers of 2, + // use next-smaller exponent + binexp -= 1; + } + if ( binexp > expShift ){ + ulpval = Double.longBitsToDouble( ((long)(binexp-expShift))< 0L (not zero, nor negative). + * + * The only reason that we develop the digits here, rather than + * calling on Long.toString() is that we can do it a little faster, + * and besides want to treat trailing 0s specially. If Long.toString + * changes, we should re-evaluate this strategy! + */ + private void + developLongDigits( int decExponent, long lvalue, long insignificant ){ + char digits[]; + int ndigits; + int digitno; + int c; + // + // Discard non-significant low-order bits, while rounding, + // up to insignificant value. + int i; + for ( i = 0; insignificant >= 10L; i++ ) + insignificant /= 10L; + if ( i != 0 ){ + long pow10 = long5pow[i] << i; // 10^i == 5^i * 2^i; + long residue = lvalue % pow10; + lvalue /= pow10; + decExponent += i; + if ( residue >= (pow10>>1) ){ + // round up based on the low-order bits we're discarding + lvalue++; + } + } + if ( lvalue <= Integer.MAX_VALUE ){ + assert lvalue > 0L : lvalue; // lvalue <= 0 + // even easier subcase! + // can do int arithmetic rather than long! + int ivalue = (int)lvalue; + ndigits = 10; + digits = perThreadBuffer.get(); + digitno = ndigits-1; + c = ivalue%10; + ivalue /= 10; + while ( c == 0 ){ + decExponent++; + c = ivalue%10; + ivalue /= 10; + } + while ( ivalue != 0){ + digits[digitno--] = (char)(c+'0'); + decExponent++; + c = ivalue%10; + ivalue /= 10; + } + digits[digitno] = (char)(c+'0'); + } else { + // same algorithm as above (same bugs, too ) + // but using long arithmetic. + ndigits = 20; + digits = perThreadBuffer.get(); + digitno = ndigits-1; + c = (int)(lvalue%10L); + lvalue /= 10L; + while ( c == 0 ){ + decExponent++; + c = (int)(lvalue%10L); + lvalue /= 10L; + } + while ( lvalue != 0L ){ + digits[digitno--] = (char)(c+'0'); + decExponent++; + c = (int)(lvalue%10L); + lvalue /= 10; + } + digits[digitno] = (char)(c+'0'); + } + char result []; + ndigits -= digitno; + result = new char[ ndigits ]; + System.arraycopy( digits, digitno, result, 0, ndigits ); + this.digits = result; + this.decExponent = decExponent+1; + this.nDigits = ndigits; + } + + // + // add one to the least significant digit. + // in the unlikely event there is a carry out, + // deal with it. + // assert that this will only happen where there + // is only one digit, e.g. (float)1e-44 seems to do it. + // + private void + roundup(){ + int i; + int q = digits[ i = (nDigits-1)]; + if ( q == '9' ){ + while ( q == '9' && i > 0 ){ + digits[i] = '0'; + q = digits[--i]; + } + if ( q == '9' ){ + // carryout! High-order 1, rest 0s, larger exp. + decExponent += 1; + digits[0] = '1'; + return; + } + // else fall through. + } + digits[i] = (char)(q+1); + decimalDigitsRoundedUp = true; + } + + public boolean digitsRoundedUp() { + return decimalDigitsRoundedUp; + } + + /* + * FIRST IMPORTANT CONSTRUCTOR: DOUBLE + */ + public OldFloatingDecimalForTest( double d ) + { + long dBits = Double.doubleToLongBits( d ); + long fractBits; + int binExp; + int nSignificantBits; + + // discover and delete sign + if ( (dBits&signMask) != 0 ){ + isNegative = true; + dBits ^= signMask; + } else { + isNegative = false; + } + // Begin to unpack + // Discover obvious special cases of NaN and Infinity. + binExp = (int)( (dBits&expMask) >> expShift ); + fractBits = dBits&fractMask; + if ( binExp == (int)(expMask>>expShift) ) { + isExceptional = true; + if ( fractBits == 0L ){ + digits = infinity; + } else { + digits = notANumber; + isNegative = false; // NaN has no sign! + } + nDigits = digits.length; + return; + } + isExceptional = false; + // Finish unpacking + // Normalize denormalized numbers. + // Insert assumed high-order bit for normalized numbers. + // Subtract exponent bias. + if ( binExp == 0 ){ + if ( fractBits == 0L ){ + // not a denorm, just a 0! + decExponent = 0; + digits = zero; + nDigits = 1; + return; + } + while ( (fractBits&fractHOB) == 0L ){ + fractBits <<= 1; + binExp -= 1; + } + nSignificantBits = expShift + binExp +1; // recall binExp is - shift count. + binExp += 1; + } else { + fractBits |= fractHOB; + nSignificantBits = expShift+1; + } + binExp -= expBias; + // call the routine that actually does all the hard work. + dtoa( binExp, fractBits, nSignificantBits ); + } + + /* + * SECOND IMPORTANT CONSTRUCTOR: SINGLE + */ + public OldFloatingDecimalForTest( float f ) + { + int fBits = Float.floatToIntBits( f ); + int fractBits; + int binExp; + int nSignificantBits; + + // discover and delete sign + if ( (fBits&singleSignMask) != 0 ){ + isNegative = true; + fBits ^= singleSignMask; + } else { + isNegative = false; + } + // Begin to unpack + // Discover obvious special cases of NaN and Infinity. + binExp = (fBits&singleExpMask) >> singleExpShift; + fractBits = fBits&singleFractMask; + if ( binExp == (singleExpMask>>singleExpShift) ) { + isExceptional = true; + if ( fractBits == 0L ){ + digits = infinity; + } else { + digits = notANumber; + isNegative = false; // NaN has no sign! + } + nDigits = digits.length; + return; + } + isExceptional = false; + // Finish unpacking + // Normalize denormalized numbers. + // Insert assumed high-order bit for normalized numbers. + // Subtract exponent bias. + if ( binExp == 0 ){ + if ( fractBits == 0 ){ + // not a denorm, just a 0! + decExponent = 0; + digits = zero; + nDigits = 1; + return; + } + while ( (fractBits&singleFractHOB) == 0 ){ + fractBits <<= 1; + binExp -= 1; + } + nSignificantBits = singleExpShift + binExp +1; // recall binExp is - shift count. + binExp += 1; + } else { + fractBits |= singleFractHOB; + nSignificantBits = singleExpShift+1; + } + binExp -= singleExpBias; + // call the routine that actually does all the hard work. + dtoa( binExp, ((long)fractBits)<<(expShift-singleExpShift), nSignificantBits ); + } + + private void + dtoa( int binExp, long fractBits, int nSignificantBits ) + { + int nFractBits; // number of significant bits of fractBits; + int nTinyBits; // number of these to the right of the point. + int decExp; + + // Examine number. Determine if it is an easy case, + // which we can do pretty trivially using float/long conversion, + // or whether we must do real work. + nFractBits = countBits( fractBits ); + nTinyBits = Math.max( 0, nFractBits - binExp - 1 ); + if ( binExp <= maxSmallBinExp && binExp >= minSmallBinExp ){ + // Look more closely at the number to decide if, + // with scaling by 10^nTinyBits, the result will fit in + // a long. + if ( (nTinyBits < long5pow.length) && ((nFractBits + n5bits[nTinyBits]) < 64 ) ){ + /* + * We can do this: + * take the fraction bits, which are normalized. + * (a) nTinyBits == 0: Shift left or right appropriately + * to align the binary point at the extreme right, i.e. + * where a long int point is expected to be. The integer + * result is easily converted to a string. + * (b) nTinyBits > 0: Shift right by expShift-nFractBits, + * which effectively converts to long and scales by + * 2^nTinyBits. Then multiply by 5^nTinyBits to + * complete the scaling. We know this won't overflow + * because we just counted the number of bits necessary + * in the result. The integer you get from this can + * then be converted to a string pretty easily. + */ + long halfULP; + if ( nTinyBits == 0 ) { + if ( binExp > nSignificantBits ){ + halfULP = 1L << ( binExp-nSignificantBits-1); + } else { + halfULP = 0L; + } + if ( binExp >= expShift ){ + fractBits <<= (binExp-expShift); + } else { + fractBits >>>= (expShift-binExp) ; + } + developLongDigits( 0, fractBits, halfULP ); + return; + } + /* + * The following causes excess digits to be printed + * out in the single-float case. Our manipulation of + * halfULP here is apparently not correct. If we + * better understand how this works, perhaps we can + * use this special case again. But for the time being, + * we do not. + * else { + * fractBits >>>= expShift+1-nFractBits; + * fractBits *= long5pow[ nTinyBits ]; + * halfULP = long5pow[ nTinyBits ] >> (1+nSignificantBits-nFractBits); + * developLongDigits( -nTinyBits, fractBits, halfULP ); + * return; + * } + */ + } + } + /* + * This is the hard case. We are going to compute large positive + * integers B and S and integer decExp, s.t. + * d = ( B / S ) * 10^decExp + * 1 <= B / S < 10 + * Obvious choices are: + * decExp = floor( log10(d) ) + * B = d * 2^nTinyBits * 10^max( 0, -decExp ) + * S = 10^max( 0, decExp) * 2^nTinyBits + * (noting that nTinyBits has already been forced to non-negative) + * I am also going to compute a large positive integer + * M = (1/2^nSignificantBits) * 2^nTinyBits * 10^max( 0, -decExp ) + * i.e. M is (1/2) of the ULP of d, scaled like B. + * When we iterate through dividing B/S and picking off the + * quotient bits, we will know when to stop when the remainder + * is <= M. + * + * We keep track of powers of 2 and powers of 5. + */ + + /* + * Estimate decimal exponent. (If it is small-ish, + * we could double-check.) + * + * First, scale the mantissa bits such that 1 <= d2 < 2. + * We are then going to estimate + * log10(d2) ~=~ (d2-1.5)/1.5 + log(1.5) + * and so we can estimate + * log10(d) ~=~ log10(d2) + binExp * log10(2) + * take the floor and call it decExp. + * FIXME -- use more precise constants here. It costs no more. + */ + double d2 = Double.longBitsToDouble( + expOne | ( fractBits &~ fractHOB ) ); + decExp = (int)Math.floor( + (d2-1.5D)*0.289529654D + 0.176091259 + (double)binExp * 0.301029995663981 ); + int B2, B5; // powers of 2 and powers of 5, respectively, in B + int S2, S5; // powers of 2 and powers of 5, respectively, in S + int M2, M5; // powers of 2 and powers of 5, respectively, in M + int Bbits; // binary digits needed to represent B, approx. + int tenSbits; // binary digits needed to represent 10*S, approx. + OldFDBigIntForTest Sval, Bval, Mval; + + B5 = Math.max( 0, -decExp ); + B2 = B5 + nTinyBits + binExp; + + S5 = Math.max( 0, decExp ); + S2 = S5 + nTinyBits; + + M5 = B5; + M2 = B2 - nSignificantBits; + + /* + * the long integer fractBits contains the (nFractBits) interesting + * bits from the mantissa of d ( hidden 1 added if necessary) followed + * by (expShift+1-nFractBits) zeros. In the interest of compactness, + * I will shift out those zeros before turning fractBits into a + * OldFDBigIntForTest. The resulting whole number will be + * d * 2^(nFractBits-1-binExp). + */ + fractBits >>>= (expShift+1-nFractBits); + B2 -= nFractBits-1; + int common2factor = Math.min( B2, S2 ); + B2 -= common2factor; + S2 -= common2factor; + M2 -= common2factor; + + /* + * HACK!! For exact powers of two, the next smallest number + * is only half as far away as we think (because the meaning of + * ULP changes at power-of-two bounds) for this reason, we + * hack M2. Hope this works. + */ + if ( nFractBits == 1 ) + M2 -= 1; + + if ( M2 < 0 ){ + // oops. + // since we cannot scale M down far enough, + // we must scale the other values up. + B2 -= M2; + S2 -= M2; + M2 = 0; + } + /* + * Construct, Scale, iterate. + * Some day, we'll write a stopping test that takes + * account of the asymmetry of the spacing of floating-point + * numbers below perfect powers of 2 + * 26 Sept 96 is not that day. + * So we use a symmetric test. + */ + char digits[] = this.digits = new char[18]; + int ndigit = 0; + boolean low, high; + long lowDigitDifference; + int q; + + /* + * Detect the special cases where all the numbers we are about + * to compute will fit in int or long integers. + * In these cases, we will avoid doing OldFDBigIntForTest arithmetic. + * We use the same algorithms, except that we "normalize" + * our OldFDBigIntForTests before iterating. This is to make division easier, + * as it makes our fist guess (quotient of high-order words) + * more accurate! + * + * Some day, we'll write a stopping test that takes + * account of the asymmetry of the spacing of floating-point + * numbers below perfect powers of 2 + * 26 Sept 96 is not that day. + * So we use a symmetric test. + */ + Bbits = nFractBits + B2 + (( B5 < n5bits.length )? n5bits[B5] : ( B5*3 )); + tenSbits = S2+1 + (( (S5+1) < n5bits.length )? n5bits[(S5+1)] : ( (S5+1)*3 )); + if ( Bbits < 64 && tenSbits < 64){ + if ( Bbits < 32 && tenSbits < 32){ + // wa-hoo! They're all ints! + int b = ((int)fractBits * small5pow[B5] ) << B2; + int s = small5pow[S5] << S2; + int m = small5pow[M5] << M2; + int tens = s * 10; + /* + * Unroll the first iteration. If our decExp estimate + * was too high, our first quotient will be zero. In this + * case, we discard it and decrement decExp. + */ + ndigit = 0; + q = b / s; + b = 10 * ( b % s ); + m *= 10; + low = (b < m ); + high = (b+m > tens ); + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; + } else { + digits[ndigit++] = (char)('0' + q); + } + /* + * HACK! Java spec sez that we always have at least + * one digit after the . in either F- or E-form output. + * Thus we will need more than one digit if we're using + * E-form + */ + if ( decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = b / s; + b = 10 * ( b % s ); + m *= 10; + assert q < 10 : q; // excessively large digit + if ( m > 0L ){ + low = (b < m ); + high = (b+m > tens ); + } else { + // hack -- m might overflow! + // in this case, it is certainly > b, + // which won't + // and b+m > tens, too, since that has overflowed + // either! + low = true; + high = true; + } + digits[ndigit++] = (char)('0' + q); + } + lowDigitDifference = (b<<1) - tens; + exactDecimalConversion = (b == 0); + } else { + // still good! they're all longs! + long b = (fractBits * long5pow[B5] ) << B2; + long s = long5pow[S5] << S2; + long m = long5pow[M5] << M2; + long tens = s * 10L; + /* + * Unroll the first iteration. If our decExp estimate + * was too high, our first quotient will be zero. In this + * case, we discard it and decrement decExp. + */ + ndigit = 0; + q = (int) ( b / s ); + b = 10L * ( b % s ); + m *= 10L; + low = (b < m ); + high = (b+m > tens ); + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; + } else { + digits[ndigit++] = (char)('0' + q); + } + /* + * HACK! Java spec sez that we always have at least + * one digit after the . in either F- or E-form output. + * Thus we will need more than one digit if we're using + * E-form + */ + if ( decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = (int) ( b / s ); + b = 10 * ( b % s ); + m *= 10; + assert q < 10 : q; // excessively large digit + if ( m > 0L ){ + low = (b < m ); + high = (b+m > tens ); + } else { + // hack -- m might overflow! + // in this case, it is certainly > b, + // which won't + // and b+m > tens, too, since that has overflowed + // either! + low = true; + high = true; + } + digits[ndigit++] = (char)('0' + q); + } + lowDigitDifference = (b<<1) - tens; + exactDecimalConversion = (b == 0); + } + } else { + OldFDBigIntForTest ZeroVal = new OldFDBigIntForTest(0); + OldFDBigIntForTest tenSval; + int shiftBias; + + /* + * We really must do OldFDBigIntForTest arithmetic. + * Fist, construct our OldFDBigIntForTest initial values. + */ + Bval = multPow52( new OldFDBigIntForTest( fractBits ), B5, B2 ); + Sval = constructPow52( S5, S2 ); + Mval = constructPow52( M5, M2 ); + + + // normalize so that division works better + Bval.lshiftMe( shiftBias = Sval.normalizeMe() ); + Mval.lshiftMe( shiftBias ); + tenSval = Sval.mult( 10 ); + /* + * Unroll the first iteration. If our decExp estimate + * was too high, our first quotient will be zero. In this + * case, we discard it and decrement decExp. + */ + ndigit = 0; + q = Bval.quoRemIteration( Sval ); + Mval = Mval.mult( 10 ); + low = (Bval.cmp( Mval ) < 0); + high = (Bval.add( Mval ).cmp( tenSval ) > 0 ); + assert q < 10 : q; // excessively large digit + if ( (q == 0) && ! high ){ + // oops. Usually ignore leading zero. + decExp--; + } else { + digits[ndigit++] = (char)('0' + q); + } + /* + * HACK! Java spec sez that we always have at least + * one digit after the . in either F- or E-form output. + * Thus we will need more than one digit if we're using + * E-form + */ + if ( decExp < -3 || decExp >= 8 ){ + high = low = false; + } + while( ! low && ! high ){ + q = Bval.quoRemIteration( Sval ); + Mval = Mval.mult( 10 ); + assert q < 10 : q; // excessively large digit + low = (Bval.cmp( Mval ) < 0); + high = (Bval.add( Mval ).cmp( tenSval ) > 0 ); + digits[ndigit++] = (char)('0' + q); + } + if ( high && low ){ + Bval.lshiftMe(1); + lowDigitDifference = Bval.cmp(tenSval); + } else { + lowDigitDifference = 0L; // this here only for flow analysis! + } + exactDecimalConversion = (Bval.cmp( ZeroVal ) == 0); + } + this.decExponent = decExp+1; + this.digits = digits; + this.nDigits = ndigit; + /* + * Last digit gets rounded based on stopping condition. + */ + if ( high ){ + if ( low ){ + if ( lowDigitDifference == 0L ){ + // it's a tie! + // choose based on which digits we like. + if ( (digits[nDigits-1]&1) != 0 ) roundup(); + } else if ( lowDigitDifference > 0 ){ + roundup(); + } + } else { + roundup(); + } + } + } + + public boolean decimalDigitsExact() { + return exactDecimalConversion; + } + + public String + toString(){ + // most brain-dead version + StringBuffer result = new StringBuffer( nDigits+8 ); + if ( isNegative ){ result.append( '-' ); } + if ( isExceptional ){ + result.append( digits, 0, nDigits ); + } else { + result.append( "0."); + result.append( digits, 0, nDigits ); + result.append('e'); + result.append( decExponent ); + } + return new String(result); + } + + public String toJavaFormatString() { + char result[] = perThreadBuffer.get(); + int i = getChars(result); + return new String(result, 0, i); + } + + private int getChars(char[] result) { + assert nDigits <= 19 : nDigits; // generous bound on size of nDigits + int i = 0; + if (isNegative) { result[0] = '-'; i = 1; } + if (isExceptional) { + System.arraycopy(digits, 0, result, i, nDigits); + i += nDigits; + } else { + if (decExponent > 0 && decExponent < 8) { + // print digits.digits. + int charLength = Math.min(nDigits, decExponent); + System.arraycopy(digits, 0, result, i, charLength); + i += charLength; + if (charLength < decExponent) { + charLength = decExponent-charLength; + System.arraycopy(zero, 0, result, i, charLength); + i += charLength; + result[i++] = '.'; + result[i++] = '0'; + } else { + result[i++] = '.'; + if (charLength < nDigits) { + int t = nDigits - charLength; + System.arraycopy(digits, charLength, result, i, t); + i += t; + } else { + result[i++] = '0'; + } + } + } else if (decExponent <=0 && decExponent > -3) { + result[i++] = '0'; + result[i++] = '.'; + if (decExponent != 0) { + System.arraycopy(zero, 0, result, i, -decExponent); + i -= decExponent; + } + System.arraycopy(digits, 0, result, i, nDigits); + i += nDigits; + } else { + result[i++] = digits[0]; + result[i++] = '.'; + if (nDigits > 1) { + System.arraycopy(digits, 1, result, i, nDigits-1); + i += nDigits-1; + } else { + result[i++] = '0'; + } + result[i++] = 'E'; + int e; + if (decExponent <= 0) { + result[i++] = '-'; + e = -decExponent+1; + } else { + e = decExponent-1; + } + // decExponent has 1, 2, or 3, digits + if (e <= 9) { + result[i++] = (char)(e+'0'); + } else if (e <= 99) { + result[i++] = (char)(e/10 +'0'); + result[i++] = (char)(e%10 + '0'); + } else { + result[i++] = (char)(e/100+'0'); + e %= 100; + result[i++] = (char)(e/10+'0'); + result[i++] = (char)(e%10 + '0'); + } + } + } + return i; + } + + // Per-thread buffer for string/stringbuffer conversion + private static ThreadLocal perThreadBuffer = new ThreadLocal() { + protected synchronized char[] initialValue() { + return new char[26]; + } + }; + + public void appendTo(Appendable buf) { + char result[] = perThreadBuffer.get(); + int i = getChars(result); + if (buf instanceof StringBuilder) + ((StringBuilder) buf).append(result, 0, i); + else if (buf instanceof StringBuffer) + ((StringBuffer) buf).append(result, 0, i); + else + assert false; + } + + @SuppressWarnings("fallthrough") + public static OldFloatingDecimalForTest + readJavaFormatString( String in ) throws NumberFormatException { + boolean isNegative = false; + boolean signSeen = false; + int decExp; + char c; + + parseNumber: + try{ + in = in.trim(); // don't fool around with white space. + // throws NullPointerException if null + int l = in.length(); + if ( l == 0 ) throw new NumberFormatException("empty String"); + int i = 0; + switch ( c = in.charAt( i ) ){ + case '-': + isNegative = true; + //FALLTHROUGH + case '+': + i++; + signSeen = true; + } + + // Check for NaN and Infinity strings + c = in.charAt(i); + if(c == 'N' || c == 'I') { // possible NaN or infinity + boolean potentialNaN = false; + char targetChars[] = null; // char array of "NaN" or "Infinity" + + if(c == 'N') { + targetChars = notANumber; + potentialNaN = true; + } else { + targetChars = infinity; + } + + // compare Input string to "NaN" or "Infinity" + int j = 0; + while(i < l && j < targetChars.length) { + if(in.charAt(i) == targetChars[j]) { + i++; j++; + } + else // something is amiss, throw exception + break parseNumber; + } + + // For the candidate string to be a NaN or infinity, + // all characters in input string and target char[] + // must be matched ==> j must equal targetChars.length + // and i must equal l + if( (j == targetChars.length) && (i == l) ) { // return NaN or infinity + return (potentialNaN ? new OldFloatingDecimalForTest(Double.NaN) // NaN has no sign + : new OldFloatingDecimalForTest(isNegative? + Double.NEGATIVE_INFINITY: + Double.POSITIVE_INFINITY)) ; + } + else { // something went wrong, throw exception + break parseNumber; + } + + } else if (c == '0') { // check for hexadecimal floating-point number + if (l > i+1 ) { + char ch = in.charAt(i+1); + if (ch == 'x' || ch == 'X' ) // possible hex string + return parseHexString(in); + } + } // look for and process decimal floating-point string + + char[] digits = new char[ l ]; + int nDigits= 0; + boolean decSeen = false; + int decPt = 0; + int nLeadZero = 0; + int nTrailZero= 0; + digitLoop: + while ( i < l ){ + switch ( c = in.charAt( i ) ){ + case '0': + if ( nDigits > 0 ){ + nTrailZero += 1; + } else { + nLeadZero += 1; + } + break; // out of switch. + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + while ( nTrailZero > 0 ){ + digits[nDigits++] = '0'; + nTrailZero -= 1; + } + digits[nDigits++] = c; + break; // out of switch. + case '.': + if ( decSeen ){ + // already saw one ., this is the 2nd. + throw new NumberFormatException("multiple points"); + } + decPt = i; + if ( signSeen ){ + decPt -= 1; + } + decSeen = true; + break; // out of switch. + default: + break digitLoop; + } + i++; + } + /* + * At this point, we've scanned all the digits and decimal + * point we're going to see. Trim off leading and trailing + * zeros, which will just confuse us later, and adjust + * our initial decimal exponent accordingly. + * To review: + * we have seen i total characters. + * nLeadZero of them were zeros before any other digits. + * nTrailZero of them were zeros after any other digits. + * if ( decSeen ), then a . was seen after decPt characters + * ( including leading zeros which have been discarded ) + * nDigits characters were neither lead nor trailing + * zeros, nor point + */ + /* + * special hack: if we saw no non-zero digits, then the + * answer is zero! + * Unfortunately, we feel honor-bound to keep parsing! + */ + if ( nDigits == 0 ){ + digits = zero; + nDigits = 1; + if ( nLeadZero == 0 ){ + // we saw NO DIGITS AT ALL, + // not even a crummy 0! + // this is not allowed. + break parseNumber; // go throw exception + } + + } + + /* Our initial exponent is decPt, adjusted by the number of + * discarded zeros. Or, if there was no decPt, + * then its just nDigits adjusted by discarded trailing zeros. + */ + if ( decSeen ){ + decExp = decPt - nLeadZero; + } else { + decExp = nDigits+nTrailZero; + } + + /* + * Look for 'e' or 'E' and an optionally signed integer. + */ + if ( (i < l) && (((c = in.charAt(i) )=='e') || (c == 'E') ) ){ + int expSign = 1; + int expVal = 0; + int reallyBig = Integer.MAX_VALUE / 10; + boolean expOverflow = false; + switch( in.charAt(++i) ){ + case '-': + expSign = -1; + //FALLTHROUGH + case '+': + i++; + } + int expAt = i; + expLoop: + while ( i < l ){ + if ( expVal >= reallyBig ){ + // the next character will cause integer + // overflow. + expOverflow = true; + } + switch ( c = in.charAt(i++) ){ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + expVal = expVal*10 + ( (int)c - (int)'0' ); + continue; + default: + i--; // back up. + break expLoop; // stop parsing exponent. + } + } + int expLimit = bigDecimalExponent+nDigits+nTrailZero; + if ( expOverflow || ( expVal > expLimit ) ){ + // + // The intent here is to end up with + // infinity or zero, as appropriate. + // The reason for yielding such a small decExponent, + // rather than something intuitive such as + // expSign*Integer.MAX_VALUE, is that this value + // is subject to further manipulation in + // doubleValue() and floatValue(), and I don't want + // it to be able to cause overflow there! + // (The only way we can get into trouble here is for + // really outrageous nDigits+nTrailZero, such as 2 billion. ) + // + decExp = expSign*expLimit; + } else { + // this should not overflow, since we tested + // for expVal > (MAX+N), where N >= abs(decExp) + decExp = decExp + expSign*expVal; + } + + // if we saw something not a digit ( or end of string ) + // after the [Ee][+-], without seeing any digits at all + // this is certainly an error. If we saw some digits, + // but then some trailing garbage, that might be ok. + // so we just fall through in that case. + // HUMBUG + if ( i == expAt ) + break parseNumber; // certainly bad + } + /* + * We parsed everything we could. + * If there are leftovers, then this is not good input! + */ + if ( i < l && + ((i != l - 1) || + (in.charAt(i) != 'f' && + in.charAt(i) != 'F' && + in.charAt(i) != 'd' && + in.charAt(i) != 'D'))) { + break parseNumber; // go throw exception + } + + return new OldFloatingDecimalForTest( isNegative, decExp, digits, nDigits, false ); + } catch ( StringIndexOutOfBoundsException e ){ } + throw new NumberFormatException("For input string: \"" + in + "\""); + } + + /* + * Take a FloatingDecimal, which we presumably just scanned in, + * and find out what its value is, as a double. + * + * AS A SIDE EFFECT, SET roundDir TO INDICATE PREFERRED + * ROUNDING DIRECTION in case the result is really destined + * for a single-precision float. + */ + + public strictfp double doubleValue(){ + int kDigits = Math.min( nDigits, maxDecimalDigits+1 ); + long lValue; + double dValue; + double rValue, tValue; + + // First, check for NaN and Infinity values + if(digits == infinity || digits == notANumber) { + if(digits == notANumber) + return Double.NaN; + else + return (isNegative?Double.NEGATIVE_INFINITY:Double.POSITIVE_INFINITY); + } + else { + if (mustSetRoundDir) { + roundDir = 0; + } + /* + * convert the lead kDigits to a long integer. + */ + // (special performance hack: start to do it using int) + int iValue = (int)digits[0]-(int)'0'; + int iDigits = Math.min( kDigits, intDecimalDigits ); + for ( int i=1; i < iDigits; i++ ){ + iValue = iValue*10 + (int)digits[i]-(int)'0'; + } + lValue = (long)iValue; + for ( int i=iDigits; i < kDigits; i++ ){ + lValue = lValue*10L + (long)((int)digits[i]-(int)'0'); + } + dValue = (double)lValue; + int exp = decExponent-kDigits; + /* + * lValue now contains a long integer with the value of + * the first kDigits digits of the number. + * dValue contains the (double) of the same. + */ + + if ( nDigits <= maxDecimalDigits ){ + /* + * possibly an easy case. + * We know that the digits can be represented + * exactly. And if the exponent isn't too outrageous, + * the whole thing can be done with one operation, + * thus one rounding error. + * Note that all our constructors trim all leading and + * trailing zeros, so simple values (including zero) + * will always end up here + */ + if (exp == 0 || dValue == 0.0) + return (isNegative)? -dValue : dValue; // small floating integer + else if ( exp >= 0 ){ + if ( exp <= maxSmallTen ){ + /* + * Can get the answer with one operation, + * thus one roundoff. + */ + rValue = dValue * small10pow[exp]; + if ( mustSetRoundDir ){ + tValue = rValue / small10pow[exp]; + roundDir = ( tValue == dValue ) ? 0 + :( tValue < dValue ) ? 1 + : -1; + } + return (isNegative)? -rValue : rValue; + } + int slop = maxDecimalDigits - kDigits; + if ( exp <= maxSmallTen+slop ){ + /* + * We can multiply dValue by 10^(slop) + * and it is still "small" and exact. + * Then we can multiply by 10^(exp-slop) + * with one rounding. + */ + dValue *= small10pow[slop]; + rValue = dValue * small10pow[exp-slop]; + + if ( mustSetRoundDir ){ + tValue = rValue / small10pow[exp-slop]; + roundDir = ( tValue == dValue ) ? 0 + :( tValue < dValue ) ? 1 + : -1; + } + return (isNegative)? -rValue : rValue; + } + /* + * Else we have a hard case with a positive exp. + */ + } else { + if ( exp >= -maxSmallTen ){ + /* + * Can get the answer in one division. + */ + rValue = dValue / small10pow[-exp]; + tValue = rValue * small10pow[-exp]; + if ( mustSetRoundDir ){ + roundDir = ( tValue == dValue ) ? 0 + :( tValue < dValue ) ? 1 + : -1; + } + return (isNegative)? -rValue : rValue; + } + /* + * Else we have a hard case with a negative exp. + */ + } + } + + /* + * Harder cases: + * The sum of digits plus exponent is greater than + * what we think we can do with one error. + * + * Start by approximating the right answer by, + * naively, scaling by powers of 10. + */ + if ( exp > 0 ){ + if ( decExponent > maxDecimalExponent+1 ){ + /* + * Lets face it. This is going to be + * Infinity. Cut to the chase. + */ + return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY; + } + if ( (exp&15) != 0 ){ + dValue *= small10pow[exp&15]; + } + if ( (exp>>=4) != 0 ){ + int j; + for( j = 0; exp > 1; j++, exp>>=1 ){ + if ( (exp&1)!=0) + dValue *= big10pow[j]; + } + /* + * The reason for the weird exp > 1 condition + * in the above loop was so that the last multiply + * would get unrolled. We handle it here. + * It could overflow. + */ + double t = dValue * big10pow[j]; + if ( Double.isInfinite( t ) ){ + /* + * It did overflow. + * Look more closely at the result. + * If the exponent is just one too large, + * then use the maximum finite as our estimate + * value. Else call the result infinity + * and punt it. + * ( I presume this could happen because + * rounding forces the result here to be + * an ULP or two larger than + * Double.MAX_VALUE ). + */ + t = dValue / 2.0; + t *= big10pow[j]; + if ( Double.isInfinite( t ) ){ + return (isNegative)? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY; + } + t = Double.MAX_VALUE; + } + dValue = t; + } + } else if ( exp < 0 ){ + exp = -exp; + if ( decExponent < minDecimalExponent-1 ){ + /* + * Lets face it. This is going to be + * zero. Cut to the chase. + */ + return (isNegative)? -0.0 : 0.0; + } + if ( (exp&15) != 0 ){ + dValue /= small10pow[exp&15]; + } + if ( (exp>>=4) != 0 ){ + int j; + for( j = 0; exp > 1; j++, exp>>=1 ){ + if ( (exp&1)!=0) + dValue *= tiny10pow[j]; + } + /* + * The reason for the weird exp > 1 condition + * in the above loop was so that the last multiply + * would get unrolled. We handle it here. + * It could underflow. + */ + double t = dValue * tiny10pow[j]; + if ( t == 0.0 ){ + /* + * It did underflow. + * Look more closely at the result. + * If the exponent is just one too small, + * then use the minimum finite as our estimate + * value. Else call the result 0.0 + * and punt it. + * ( I presume this could happen because + * rounding forces the result here to be + * an ULP or two less than + * Double.MIN_VALUE ). + */ + t = dValue * 2.0; + t *= tiny10pow[j]; + if ( t == 0.0 ){ + return (isNegative)? -0.0 : 0.0; + } + t = Double.MIN_VALUE; + } + dValue = t; + } + } + + /* + * dValue is now approximately the result. + * The hard part is adjusting it, by comparison + * with OldFDBigIntForTest arithmetic. + * Formulate the EXACT big-number result as + * bigD0 * 10^exp + */ + OldFDBigIntForTest bigD0 = new OldFDBigIntForTest( lValue, digits, kDigits, nDigits ); + exp = decExponent - nDigits; + + correctionLoop: + while(true){ + /* AS A SIDE EFFECT, THIS METHOD WILL SET THE INSTANCE VARIABLES + * bigIntExp and bigIntNBits + */ + OldFDBigIntForTest bigB = doubleToBigInt( dValue ); + + /* + * Scale bigD, bigB appropriately for + * big-integer operations. + * Naively, we multiply by powers of ten + * and powers of two. What we actually do + * is keep track of the powers of 5 and + * powers of 2 we would use, then factor out + * common divisors before doing the work. + */ + int B2, B5; // powers of 2, 5 in bigB + int D2, D5; // powers of 2, 5 in bigD + int Ulp2; // powers of 2 in halfUlp. + if ( exp >= 0 ){ + B2 = B5 = 0; + D2 = D5 = exp; + } else { + B2 = B5 = -exp; + D2 = D5 = 0; + } + if ( bigIntExp >= 0 ){ + B2 += bigIntExp; + } else { + D2 -= bigIntExp; + } + Ulp2 = B2; + // shift bigB and bigD left by a number s. t. + // halfUlp is still an integer. + int hulpbias; + if ( bigIntExp+bigIntNBits <= -expBias+1 ){ + // This is going to be a denormalized number + // (if not actually zero). + // half an ULP is at 2^-(expBias+expShift+1) + hulpbias = bigIntExp+ expBias + expShift; + } else { + hulpbias = expShift + 2 - bigIntNBits; + } + B2 += hulpbias; + D2 += hulpbias; + // if there are common factors of 2, we might just as well + // factor them out, as they add nothing useful. + int common2 = Math.min( B2, Math.min( D2, Ulp2 ) ); + B2 -= common2; + D2 -= common2; + Ulp2 -= common2; + // do multiplications by powers of 5 and 2 + bigB = multPow52( bigB, B5, B2 ); + OldFDBigIntForTest bigD = multPow52( new OldFDBigIntForTest( bigD0 ), D5, D2 ); + // + // to recap: + // bigB is the scaled-big-int version of our floating-point + // candidate. + // bigD is the scaled-big-int version of the exact value + // as we understand it. + // halfUlp is 1/2 an ulp of bigB, except for special cases + // of exact powers of 2 + // + // the plan is to compare bigB with bigD, and if the difference + // is less than halfUlp, then we're satisfied. Otherwise, + // use the ratio of difference to halfUlp to calculate a fudge + // factor to add to the floating value, then go 'round again. + // + OldFDBigIntForTest diff; + int cmpResult; + boolean overvalue; + if ( (cmpResult = bigB.cmp( bigD ) ) > 0 ){ + overvalue = true; // our candidate is too big. + diff = bigB.sub( bigD ); + if ( (bigIntNBits == 1) && (bigIntExp > -expBias+1) ){ + // candidate is a normalized exact power of 2 and + // is too big. We will be subtracting. + // For our purposes, ulp is the ulp of the + // next smaller range. + Ulp2 -= 1; + if ( Ulp2 < 0 ){ + // rats. Cannot de-scale ulp this far. + // must scale diff in other direction. + Ulp2 = 0; + diff.lshiftMe( 1 ); + } + } + } else if ( cmpResult < 0 ){ + overvalue = false; // our candidate is too small. + diff = bigD.sub( bigB ); + } else { + // the candidate is exactly right! + // this happens with surprising frequency + break correctionLoop; + } + OldFDBigIntForTest halfUlp = constructPow52( B5, Ulp2 ); + if ( (cmpResult = diff.cmp( halfUlp ) ) < 0 ){ + // difference is small. + // this is close enough + if (mustSetRoundDir) { + roundDir = overvalue ? -1 : 1; + } + break correctionLoop; + } else if ( cmpResult == 0 ){ + // difference is exactly half an ULP + // round to some other value maybe, then finish + dValue += 0.5*ulp( dValue, overvalue ); + // should check for bigIntNBits == 1 here?? + if (mustSetRoundDir) { + roundDir = overvalue ? -1 : 1; + } + break correctionLoop; + } else { + // difference is non-trivial. + // could scale addend by ratio of difference to + // halfUlp here, if we bothered to compute that difference. + // Most of the time ( I hope ) it is about 1 anyway. + dValue += ulp( dValue, overvalue ); + if ( dValue == 0.0 || dValue == Double.POSITIVE_INFINITY ) + break correctionLoop; // oops. Fell off end of range. + continue; // try again. + } + + } + return (isNegative)? -dValue : dValue; + } + } + + /* + * Take a FloatingDecimal, which we presumably just scanned in, + * and find out what its value is, as a float. + * This is distinct from doubleValue() to avoid the extremely + * unlikely case of a double rounding error, wherein the conversion + * to double has one rounding error, and the conversion of that double + * to a float has another rounding error, IN THE WRONG DIRECTION, + * ( because of the preference to a zero low-order bit ). + */ + + public strictfp float floatValue(){ + int kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 ); + int iValue; + float fValue; + + // First, check for NaN and Infinity values + if(digits == infinity || digits == notANumber) { + if(digits == notANumber) + return Float.NaN; + else + return (isNegative?Float.NEGATIVE_INFINITY:Float.POSITIVE_INFINITY); + } + else { + /* + * convert the lead kDigits to an integer. + */ + iValue = (int)digits[0]-(int)'0'; + for ( int i=1; i < kDigits; i++ ){ + iValue = iValue*10 + (int)digits[i]-(int)'0'; + } + fValue = (float)iValue; + int exp = decExponent-kDigits; + /* + * iValue now contains an integer with the value of + * the first kDigits digits of the number. + * fValue contains the (float) of the same. + */ + + if ( nDigits <= singleMaxDecimalDigits ){ + /* + * possibly an easy case. + * We know that the digits can be represented + * exactly. And if the exponent isn't too outrageous, + * the whole thing can be done with one operation, + * thus one rounding error. + * Note that all our constructors trim all leading and + * trailing zeros, so simple values (including zero) + * will always end up here. + */ + if (exp == 0 || fValue == 0.0f) + return (isNegative)? -fValue : fValue; // small floating integer + else if ( exp >= 0 ){ + if ( exp <= singleMaxSmallTen ){ + /* + * Can get the answer with one operation, + * thus one roundoff. + */ + fValue *= singleSmall10pow[exp]; + return (isNegative)? -fValue : fValue; + } + int slop = singleMaxDecimalDigits - kDigits; + if ( exp <= singleMaxSmallTen+slop ){ + /* + * We can multiply dValue by 10^(slop) + * and it is still "small" and exact. + * Then we can multiply by 10^(exp-slop) + * with one rounding. + */ + fValue *= singleSmall10pow[slop]; + fValue *= singleSmall10pow[exp-slop]; + return (isNegative)? -fValue : fValue; + } + /* + * Else we have a hard case with a positive exp. + */ + } else { + if ( exp >= -singleMaxSmallTen ){ + /* + * Can get the answer in one division. + */ + fValue /= singleSmall10pow[-exp]; + return (isNegative)? -fValue : fValue; + } + /* + * Else we have a hard case with a negative exp. + */ + } + } else if ( (decExponent >= nDigits) && (nDigits+decExponent <= maxDecimalDigits) ){ + /* + * In double-precision, this is an exact floating integer. + * So we can compute to double, then shorten to float + * with one round, and get the right answer. + * + * First, finish accumulating digits. + * Then convert that integer to a double, multiply + * by the appropriate power of ten, and convert to float. + */ + long lValue = (long)iValue; + for ( int i=kDigits; i < nDigits; i++ ){ + lValue = lValue*10L + (long)((int)digits[i]-(int)'0'); + } + double dValue = (double)lValue; + exp = decExponent-nDigits; + dValue *= small10pow[exp]; + fValue = (float)dValue; + return (isNegative)? -fValue : fValue; + + } + /* + * Harder cases: + * The sum of digits plus exponent is greater than + * what we think we can do with one error. + * + * Start by weeding out obviously out-of-range + * results, then convert to double and go to + * common hard-case code. + */ + if ( decExponent > singleMaxDecimalExponent+1 ){ + /* + * Lets face it. This is going to be + * Infinity. Cut to the chase. + */ + return (isNegative)? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY; + } else if ( decExponent < singleMinDecimalExponent-1 ){ + /* + * Lets face it. This is going to be + * zero. Cut to the chase. + */ + return (isNegative)? -0.0f : 0.0f; + } + + /* + * Here, we do 'way too much work, but throwing away + * our partial results, and going and doing the whole + * thing as double, then throwing away half the bits that computes + * when we convert back to float. + * + * The alternative is to reproduce the whole multiple-precision + * algorithm for float precision, or to try to parameterize it + * for common usage. The former will take about 400 lines of code, + * and the latter I tried without success. Thus the semi-hack + * answer here. + */ + mustSetRoundDir = !fromHex; + double dValue = doubleValue(); + return stickyRound( dValue ); + } + } + + + /* + * All the positive powers of 10 that can be + * represented exactly in double/float. + */ + private static final double small10pow[] = { + 1.0e0, + 1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5, + 1.0e6, 1.0e7, 1.0e8, 1.0e9, 1.0e10, + 1.0e11, 1.0e12, 1.0e13, 1.0e14, 1.0e15, + 1.0e16, 1.0e17, 1.0e18, 1.0e19, 1.0e20, + 1.0e21, 1.0e22 + }; + + private static final float singleSmall10pow[] = { + 1.0e0f, + 1.0e1f, 1.0e2f, 1.0e3f, 1.0e4f, 1.0e5f, + 1.0e6f, 1.0e7f, 1.0e8f, 1.0e9f, 1.0e10f + }; + + private static final double big10pow[] = { + 1e16, 1e32, 1e64, 1e128, 1e256 }; + private static final double tiny10pow[] = { + 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 }; + + private static final int maxSmallTen = small10pow.length-1; + private static final int singleMaxSmallTen = singleSmall10pow.length-1; + + private static final int small5pow[] = { + 1, + 5, + 5*5, + 5*5*5, + 5*5*5*5, + 5*5*5*5*5, + 5*5*5*5*5*5, + 5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5*5*5*5*5, + 5*5*5*5*5*5*5*5*5*5*5*5*5 + }; + + + private static final long long5pow[] = { + 1L, + 5L, + 5L*5, + 5L*5*5, + 5L*5*5*5, + 5L*5*5*5*5, + 5L*5*5*5*5*5, + 5L*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + 5L*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5*5, + }; + + // approximately ceil( log2( long5pow[i] ) ) + private static final int n5bits[] = { + 0, + 3, + 5, + 7, + 10, + 12, + 14, + 17, + 19, + 21, + 24, + 26, + 28, + 31, + 33, + 35, + 38, + 40, + 42, + 45, + 47, + 49, + 52, + 54, + 56, + 59, + 61, + }; + + private static final char infinity[] = { 'I', 'n', 'f', 'i', 'n', 'i', 't', 'y' }; + private static final char notANumber[] = { 'N', 'a', 'N' }; + private static final char zero[] = { '0', '0', '0', '0', '0', '0', '0', '0' }; + + + /* + * Grammar is compatible with hexadecimal floating-point constants + * described in section 6.4.4.2 of the C99 specification. + */ + private static Pattern hexFloatPattern = null; + private static synchronized Pattern getHexFloatPattern() { + if (hexFloatPattern == null) { + hexFloatPattern = Pattern.compile( + //1 234 56 7 8 9 + "([-+])?0[xX](((\\p{XDigit}+)\\.?)|((\\p{XDigit}*)\\.(\\p{XDigit}+)))[pP]([-+])?(\\p{Digit}+)[fFdD]?" + ); + } + return hexFloatPattern; + } + + /* + * Convert string s to a suitable floating decimal; uses the + * double constructor and set the roundDir variable appropriately + * in case the value is later converted to a float. + */ + static OldFloatingDecimalForTest parseHexString(String s) { + // Verify string is a member of the hexadecimal floating-point + // string language. + Matcher m = getHexFloatPattern().matcher(s); + boolean validInput = m.matches(); + + if (!validInput) { + // Input does not match pattern + throw new NumberFormatException("For input string: \"" + s + "\""); + } else { // validInput + /* + * We must isolate the sign, significand, and exponent + * fields. The sign value is straightforward. Since + * floating-point numbers are stored with a normalized + * representation, the significand and exponent are + * interrelated. + * + * After extracting the sign, we normalized the + * significand as a hexadecimal value, calculating an + * exponent adjust for any shifts made during + * normalization. If the significand is zero, the + * exponent doesn't need to be examined since the output + * will be zero. + * + * Next the exponent in the input string is extracted. + * Afterwards, the significand is normalized as a *binary* + * value and the input value's normalized exponent can be + * computed. The significand bits are copied into a + * double significand; if the string has more logical bits + * than can fit in a double, the extra bits affect the + * round and sticky bits which are used to round the final + * value. + */ + + // Extract significand sign + String group1 = m.group(1); + double sign = (( group1 == null ) || group1.equals("+"))? 1.0 : -1.0; + + + // Extract Significand magnitude + /* + * Based on the form of the significand, calculate how the + * binary exponent needs to be adjusted to create a + * normalized *hexadecimal* floating-point number; that + * is, a number where there is one nonzero hex digit to + * the left of the (hexa)decimal point. Since we are + * adjusting a binary, not hexadecimal exponent, the + * exponent is adjusted by a multiple of 4. + * + * There are a number of significand scenarios to consider; + * letters are used in indicate nonzero digits: + * + * 1. 000xxxx => x.xxx normalized + * increase exponent by (number of x's - 1)*4 + * + * 2. 000xxx.yyyy => x.xxyyyy normalized + * increase exponent by (number of x's - 1)*4 + * + * 3. .000yyy => y.yy normalized + * decrease exponent by (number of zeros + 1)*4 + * + * 4. 000.00000yyy => y.yy normalized + * decrease exponent by (number of zeros to right of point + 1)*4 + * + * If the significand is exactly zero, return a properly + * signed zero. + */ + + String significandString =null; + int signifLength = 0; + int exponentAdjust = 0; + { + int leftDigits = 0; // number of meaningful digits to + // left of "decimal" point + // (leading zeros stripped) + int rightDigits = 0; // number of digits to right of + // "decimal" point; leading zeros + // must always be accounted for + /* + * The significand is made up of either + * + * 1. group 4 entirely (integer portion only) + * + * OR + * + * 2. the fractional portion from group 7 plus any + * (optional) integer portions from group 6. + */ + String group4; + if( (group4 = m.group(4)) != null) { // Integer-only significand + // Leading zeros never matter on the integer portion + significandString = stripLeadingZeros(group4); + leftDigits = significandString.length(); + } + else { + // Group 6 is the optional integer; leading zeros + // never matter on the integer portion + String group6 = stripLeadingZeros(m.group(6)); + leftDigits = group6.length(); + + // fraction + String group7 = m.group(7); + rightDigits = group7.length(); + + // Turn "integer.fraction" into "integer"+"fraction" + significandString = + ((group6 == null)?"":group6) + // is the null + // check necessary? + group7; + } + + significandString = stripLeadingZeros(significandString); + signifLength = significandString.length(); + + /* + * Adjust exponent as described above + */ + if (leftDigits >= 1) { // Cases 1 and 2 + exponentAdjust = 4*(leftDigits - 1); + } else { // Cases 3 and 4 + exponentAdjust = -4*( rightDigits - signifLength + 1); + } + + // If the significand is zero, the exponent doesn't + // matter; return a properly signed zero. + + if (signifLength == 0) { // Only zeros in input + return new OldFloatingDecimalForTest(sign * 0.0); + } + } + + // Extract Exponent + /* + * Use an int to read in the exponent value; this should + * provide more than sufficient range for non-contrived + * inputs. If reading the exponent in as an int does + * overflow, examine the sign of the exponent and + * significand to determine what to do. + */ + String group8 = m.group(8); + boolean positiveExponent = ( group8 == null ) || group8.equals("+"); + long unsignedRawExponent; + try { + unsignedRawExponent = Integer.parseInt(m.group(9)); + } + catch (NumberFormatException e) { + // At this point, we know the exponent is + // syntactically well-formed as a sequence of + // digits. Therefore, if an NumberFormatException + // is thrown, it must be due to overflowing int's + // range. Also, at this point, we have already + // checked for a zero significand. Thus the signs + // of the exponent and significand determine the + // final result: + // + // significand + // + - + // exponent + +infinity -infinity + // - +0.0 -0.0 + return new OldFloatingDecimalForTest(sign * (positiveExponent ? + Double.POSITIVE_INFINITY : 0.0)); + } + + long rawExponent = + (positiveExponent ? 1L : -1L) * // exponent sign + unsignedRawExponent; // exponent magnitude + + // Calculate partially adjusted exponent + long exponent = rawExponent + exponentAdjust ; + + // Starting copying non-zero bits into proper position in + // a long; copy explicit bit too; this will be masked + // later for normal values. + + boolean round = false; + boolean sticky = false; + int bitsCopied=0; + int nextShift=0; + long significand=0L; + // First iteration is different, since we only copy + // from the leading significand bit; one more exponent + // adjust will be needed... + + // IMPORTANT: make leadingDigit a long to avoid + // surprising shift semantics! + long leadingDigit = getHexDigit(significandString, 0); + + /* + * Left shift the leading digit (53 - (bit position of + * leading 1 in digit)); this sets the top bit of the + * significand to 1. The nextShift value is adjusted + * to take into account the number of bit positions of + * the leadingDigit actually used. Finally, the + * exponent is adjusted to normalize the significand + * as a binary value, not just a hex value. + */ + if (leadingDigit == 1) { + significand |= leadingDigit << 52; + nextShift = 52 - 4; + /* exponent += 0 */ } + else if (leadingDigit <= 3) { // [2, 3] + significand |= leadingDigit << 51; + nextShift = 52 - 5; + exponent += 1; + } + else if (leadingDigit <= 7) { // [4, 7] + significand |= leadingDigit << 50; + nextShift = 52 - 6; + exponent += 2; + } + else if (leadingDigit <= 15) { // [8, f] + significand |= leadingDigit << 49; + nextShift = 52 - 7; + exponent += 3; + } else { + throw new AssertionError("Result from digit conversion too large!"); + } + // The preceding if-else could be replaced by a single + // code block based on the high-order bit set in + // leadingDigit. Given leadingOnePosition, + + // significand |= leadingDigit << (SIGNIFICAND_WIDTH - leadingOnePosition); + // nextShift = 52 - (3 + leadingOnePosition); + // exponent += (leadingOnePosition-1); + + + /* + * Now the exponent variable is equal to the normalized + * binary exponent. Code below will make representation + * adjustments if the exponent is incremented after + * rounding (includes overflows to infinity) or if the + * result is subnormal. + */ + + // Copy digit into significand until the significand can't + // hold another full hex digit or there are no more input + // hex digits. + int i = 0; + for(i = 1; + i < signifLength && nextShift >= 0; + i++) { + long currentDigit = getHexDigit(significandString, i); + significand |= (currentDigit << nextShift); + nextShift-=4; + } + + // After the above loop, the bulk of the string is copied. + // Now, we must copy any partial hex digits into the + // significand AND compute the round bit and start computing + // sticky bit. + + if ( i < signifLength ) { // at least one hex input digit exists + long currentDigit = getHexDigit(significandString, i); + + // from nextShift, figure out how many bits need + // to be copied, if any + switch(nextShift) { // must be negative + case -1: + // three bits need to be copied in; can + // set round bit + significand |= ((currentDigit & 0xEL) >> 1); + round = (currentDigit & 0x1L) != 0L; + break; + + case -2: + // two bits need to be copied in; can + // set round and start sticky + significand |= ((currentDigit & 0xCL) >> 2); + round = (currentDigit &0x2L) != 0L; + sticky = (currentDigit & 0x1L) != 0; + break; + + case -3: + // one bit needs to be copied in + significand |= ((currentDigit & 0x8L)>>3); + // Now set round and start sticky, if possible + round = (currentDigit &0x4L) != 0L; + sticky = (currentDigit & 0x3L) != 0; + break; + + case -4: + // all bits copied into significand; set + // round and start sticky + round = ((currentDigit & 0x8L) != 0); // is top bit set? + // nonzeros in three low order bits? + sticky = (currentDigit & 0x7L) != 0; + break; + + default: + throw new AssertionError("Unexpected shift distance remainder."); + // break; + } + + // Round is set; sticky might be set. + + // For the sticky bit, it suffices to check the + // current digit and test for any nonzero digits in + // the remaining unprocessed input. + i++; + while(i < signifLength && !sticky) { + currentDigit = getHexDigit(significandString,i); + sticky = sticky || (currentDigit != 0); + i++; + } + + } + // else all of string was seen, round and sticky are + // correct as false. + + + // Check for overflow and update exponent accordingly. + + if (exponent > DoubleConsts.MAX_EXPONENT) { // Infinite result + // overflow to properly signed infinity + return new OldFloatingDecimalForTest(sign * Double.POSITIVE_INFINITY); + } else { // Finite return value + if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result + exponent >= DoubleConsts.MIN_EXPONENT) { + + // The result returned in this block cannot be a + // zero or subnormal; however after the + // significand is adjusted from rounding, we could + // still overflow in infinity. + + // AND exponent bits into significand; if the + // significand is incremented and overflows from + // rounding, this combination will update the + // exponent correctly, even in the case of + // Double.MAX_VALUE overflowing to infinity. + + significand = (( (exponent + + (long)DoubleConsts.EXP_BIAS) << + (DoubleConsts.SIGNIFICAND_WIDTH-1)) + & DoubleConsts.EXP_BIT_MASK) | + (DoubleConsts.SIGNIF_BIT_MASK & significand); + + } else { // Subnormal or zero + // (exponent < DoubleConsts.MIN_EXPONENT) + + if (exponent < (DoubleConsts.MIN_SUB_EXPONENT -1 )) { + // No way to round back to nonzero value + // regardless of significand if the exponent is + // less than -1075. + return new OldFloatingDecimalForTest(sign * 0.0); + } else { // -1075 <= exponent <= MIN_EXPONENT -1 = -1023 + /* + * Find bit position to round to; recompute + * round and sticky bits, and shift + * significand right appropriately. + */ + + sticky = sticky || round; + round = false; + + // Number of bits of significand to preserve is + // exponent - abs_min_exp +1 + // check: + // -1075 +1074 + 1 = 0 + // -1023 +1074 + 1 = 52 + + int bitsDiscarded = 53 - + ((int)exponent - DoubleConsts.MIN_SUB_EXPONENT + 1); + assert bitsDiscarded >= 1 && bitsDiscarded <= 53; + + // What to do here: + // First, isolate the new round bit + round = (significand & (1L << (bitsDiscarded -1))) != 0L; + if (bitsDiscarded > 1) { + // create mask to update sticky bits; low + // order bitsDiscarded bits should be 1 + long mask = ~((~0L) << (bitsDiscarded -1)); + sticky = sticky || ((significand & mask) != 0L ) ; + } + + // Now, discard the bits + significand = significand >> bitsDiscarded; + + significand = (( ((long)(DoubleConsts.MIN_EXPONENT -1) + // subnorm exp. + (long)DoubleConsts.EXP_BIAS) << + (DoubleConsts.SIGNIFICAND_WIDTH-1)) + & DoubleConsts.EXP_BIT_MASK) | + (DoubleConsts.SIGNIF_BIT_MASK & significand); + } + } + + // The significand variable now contains the currently + // appropriate exponent bits too. + + /* + * Determine if significand should be incremented; + * making this determination depends on the least + * significant bit and the round and sticky bits. + * + * Round to nearest even rounding table, adapted from + * table 4.7 in "Computer Arithmetic" by IsraelKoren. + * The digit to the left of the "decimal" point is the + * least significant bit, the digits to the right of + * the point are the round and sticky bits + * + * Number Round(x) + * x0.00 x0. + * x0.01 x0. + * x0.10 x0. + * x0.11 x1. = x0. +1 + * x1.00 x1. + * x1.01 x1. + * x1.10 x1. + 1 + * x1.11 x1. + 1 + */ + boolean incremented = false; + boolean leastZero = ((significand & 1L) == 0L); + if( ( leastZero && round && sticky ) || + ((!leastZero) && round )) { + incremented = true; + significand++; + } + + OldFloatingDecimalForTest fd = new OldFloatingDecimalForTest(Math.copySign( + Double.longBitsToDouble(significand), + sign)); + + /* + * Set roundingDir variable field of fd properly so + * that the input string can be properly rounded to a + * float value. There are two cases to consider: + * + * 1. rounding to double discards sticky bit + * information that would change the result of a float + * rounding (near halfway case between two floats) + * + * 2. rounding to double rounds up when rounding up + * would not occur when rounding to float. + * + * For former case only needs to be considered when + * the bits rounded away when casting to float are all + * zero; otherwise, float round bit is properly set + * and sticky will already be true. + * + * The lower exponent bound for the code below is the + * minimum (normalized) subnormal exponent - 1 since a + * value with that exponent can round up to the + * minimum subnormal value and the sticky bit + * information must be preserved (i.e. case 1). + */ + if ((exponent >= FloatConsts.MIN_SUB_EXPONENT-1) && + (exponent <= FloatConsts.MAX_EXPONENT ) ){ + // Outside above exponent range, the float value + // will be zero or infinity. + + /* + * If the low-order 28 bits of a rounded double + * significand are 0, the double could be a + * half-way case for a rounding to float. If the + * double value is a half-way case, the double + * significand may have to be modified to round + * the the right float value (see the stickyRound + * method). If the rounding to double has lost + * what would be float sticky bit information, the + * double significand must be incremented. If the + * double value's significand was itself + * incremented, the float value may end up too + * large so the increment should be undone. + */ + if ((significand & 0xfffffffL) == 0x0L) { + // For negative values, the sign of the + // roundDir is the same as for positive values + // since adding 1 increasing the significand's + // magnitude and subtracting 1 decreases the + // significand's magnitude. If neither round + // nor sticky is true, the double value is + // exact and no adjustment is required for a + // proper float rounding. + if( round || sticky) { + if (leastZero) { // prerounding lsb is 0 + // If round and sticky were both true, + // and the least significant + // significand bit were 0, the rounded + // significand would not have its + // low-order bits be zero. Therefore, + // we only need to adjust the + // significand if round XOR sticky is + // true. + if (round ^ sticky) { + fd.roundDir = 1; + } + } + else { // prerounding lsb is 1 + // If the prerounding lsb is 1 and the + // resulting significand has its + // low-order bits zero, the significand + // was incremented. Here, we undo the + // increment, which will ensure the + // right guard and sticky bits for the + // float rounding. + if (round) + fd.roundDir = -1; + } + } + } + } + + fd.fromHex = true; + return fd; + } + } + } + + /** + * Return s with any leading zeros removed. + */ + static String stripLeadingZeros(String s) { + return s.replaceFirst("^0+", ""); + } + + /** + * Extract a hexadecimal digit from position position + * of string s. + */ + static int getHexDigit(String s, int position) { + int value = Character.digit(s.charAt(position), 16); + if (value <= -1 || value >= 16) { + throw new AssertionError("Unexpected failure of digit conversion of " + + s.charAt(position)); + } + return value; + } + + +} diff --git a/jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java b/jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java new file mode 100644 index 00000000000..cfdb7b84982 --- /dev/null +++ b/jdk/test/sun/misc/FloatingDecimal/TestFDBigInteger.java @@ -0,0 +1,434 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.math.BigInteger; +import java.util.Random; +import sun.misc.FDBigInteger; + +/** + * @test + * @bug 7032154 + * @summary unit testys of sun.misc.FDBigInteger + * @author Dmitry Nadezhin + */ +public class TestFDBigInteger { + + private static final int MAX_P5 = 413; + private static final int MAX_P2 = 65; + private static final long LONG_SIGN_MASK = (1L << 63); + private static final BigInteger FIVE = BigInteger.valueOf(5); + private static final FDBigInteger MUTABLE_ZERO = FDBigInteger.valueOfPow52(0, 0).leftInplaceSub(FDBigInteger.valueOfPow52(0, 0)); + private static final FDBigInteger IMMUTABLE_ZERO = FDBigInteger.valueOfPow52(0, 0).leftInplaceSub(FDBigInteger.valueOfPow52(0, 0)); + private static final FDBigInteger IMMUTABLE_MILLION = genMillion1(); + private static final FDBigInteger IMMUTABLE_BILLION = genBillion1(); + private static final FDBigInteger IMMUTABLE_TEN18 = genTen18(); + + static { + IMMUTABLE_ZERO.makeImmutable(); + IMMUTABLE_MILLION.makeImmutable(); + IMMUTABLE_BILLION.makeImmutable(); + IMMUTABLE_TEN18.makeImmutable(); + } + + private static FDBigInteger mutable(String hex, int offset) { + char[] chars = new BigInteger(hex, 16).toString().toCharArray(); + return new FDBigInteger(0, chars, 0, chars.length).multByPow52(0, offset * 32); + } + + private static FDBigInteger immutable(String hex, int offset) { + FDBigInteger fd = mutable(hex, offset); + fd.makeImmutable(); + return fd; + } + + private static BigInteger biPow52(int p5, int p2) { + return FIVE.pow(p5).shiftLeft(p2); + } + + // data.length == 1, nWords == 1, offset == 0 + private static FDBigInteger genMillion1() { + return FDBigInteger.valueOfPow52(6, 0).leftShift(6); + } + + // data.length == 2, nWords == 1, offset == 0 + private static FDBigInteger genMillion2() { + return FDBigInteger.valueOfMulPow52(1000000L, 0, 0); + } + + // data.length == 1, nWords == 1, offset == 0 + private static FDBigInteger genBillion1() { + return FDBigInteger.valueOfPow52(9, 0).leftShift(9); + } + + // data.length == 2, nWords == 2, offset == 0 + private static FDBigInteger genTen18() { + return FDBigInteger.valueOfPow52(18, 0).leftShift(18); + } + + private static void check(BigInteger expected, FDBigInteger actual, String message) throws Exception { + if (!expected.equals(actual.toBigInteger())) { + throw new Exception(message + " result " + actual.toHexString() + " expected " + expected.toString(16)); + } + } + + private static void testValueOfPow52(int p5, int p2) throws Exception { + check(biPow52(p5, p2), FDBigInteger.valueOfPow52(p5, p2), + "valueOfPow52(" + p5 + "," + p2 + ")"); + } + + private static void testValueOfPow52() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + for (int p2 = 0; p2 <= MAX_P2; p2++) { + testValueOfPow52(p5, p2); + } + } + } + + private static void testValueOfMulPow52(long value, int p5, int p2) throws Exception { + BigInteger bi = BigInteger.valueOf(value & ~LONG_SIGN_MASK); + if (value < 0) { + bi = bi.setBit(63); + } + check(biPow52(p5, p2).multiply(bi), FDBigInteger.valueOfMulPow52(value, p5, p2), + "valueOfMulPow52(" + Long.toHexString(value) + "." + p5 + "," + p2 + ")"); + } + + private static void testValueOfMulPow52(long value, int p5) throws Exception { + testValueOfMulPow52(value, p5, 0); + testValueOfMulPow52(value, p5, 1); + testValueOfMulPow52(value, p5, 30); + testValueOfMulPow52(value, p5, 31); + testValueOfMulPow52(value, p5, 33); + testValueOfMulPow52(value, p5, 63); + } + + private static void testValueOfMulPow52() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + testValueOfMulPow52(0xFFFFFFFFL, p5); + testValueOfMulPow52(0x123456789AL, p5); + testValueOfMulPow52(0x7FFFFFFFFFFFFFFFL, p5); + testValueOfMulPow52(0xFFFFFFFFFFF54321L, p5); + } + } + + private static void testLeftShift(FDBigInteger t, int shift, boolean isImmutable) throws Exception { + BigInteger bt = t.toBigInteger(); + FDBigInteger r = t.leftShift(shift); + if ((bt.signum() == 0 || shift == 0 || !isImmutable) && r != t) { + throw new Exception("leftShift doesn't reuse its argument"); + } + if (isImmutable) { + check(bt, t, "leftShift corrupts its argument"); + } + check(bt.shiftLeft(shift), r, "leftShift returns wrong result"); + } + + private static void testLeftShift() throws Exception { + testLeftShift(IMMUTABLE_ZERO, 0, true); + testLeftShift(IMMUTABLE_ZERO, 10, true); + testLeftShift(MUTABLE_ZERO, 0, false); + testLeftShift(MUTABLE_ZERO, 10, false); + + testLeftShift(IMMUTABLE_MILLION, 0, true); + testLeftShift(IMMUTABLE_MILLION, 1, true); + testLeftShift(IMMUTABLE_MILLION, 12, true); + testLeftShift(IMMUTABLE_MILLION, 13, true); + testLeftShift(IMMUTABLE_MILLION, 32, true); + testLeftShift(IMMUTABLE_MILLION, 33, true); + testLeftShift(IMMUTABLE_MILLION, 44, true); + testLeftShift(IMMUTABLE_MILLION, 45, true); + + testLeftShift(genMillion1(), 0, false); + testLeftShift(genMillion1(), 1, false); + testLeftShift(genMillion1(), 12, false); + testLeftShift(genMillion1(), 13, false); + testLeftShift(genMillion1(), 25, false); + testLeftShift(genMillion1(), 26, false); + testLeftShift(genMillion1(), 32, false); + testLeftShift(genMillion1(), 33, false); + testLeftShift(genMillion1(), 44, false); + testLeftShift(genMillion1(), 45, false); + + testLeftShift(genMillion2(), 0, false); + testLeftShift(genMillion2(), 1, false); + testLeftShift(genMillion2(), 12, false); + testLeftShift(genMillion2(), 13, false); + testLeftShift(genMillion2(), 25, false); + testLeftShift(genMillion2(), 26, false); + testLeftShift(genMillion2(), 32, false); + testLeftShift(genMillion2(), 33, false); + testLeftShift(genMillion2(), 44, false); + testLeftShift(genMillion2(), 45, false); + } + + private static void testQuoRemIteration(FDBigInteger t, FDBigInteger s) throws Exception { + BigInteger bt = t.toBigInteger(); + BigInteger bs = s.toBigInteger(); + int q = t.quoRemIteration(s); + BigInteger[] qr = bt.divideAndRemainder(bs); + if (!BigInteger.valueOf(q).equals(qr[0])) { + throw new Exception("quoRemIteration returns incorrect quo"); + } + check(qr[1].multiply(BigInteger.TEN), t, "quoRemIteration returns incorrect rem"); + } + + private static void testQuoRemIteration() throws Exception { + // IMMUTABLE_TEN18 == 0de0b6b3a7640000 + // q = 0 + testQuoRemIteration(mutable("00000001", 0), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("00000001", 1), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("0de0b6b2", 1), IMMUTABLE_TEN18); + // q = 1 -> q = 0 + testQuoRemIteration(mutable("0de0b6b3", 1), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("0de0b6b3a763FFFF", 0), IMMUTABLE_TEN18); + // q = 1 + testQuoRemIteration(mutable("0de0b6b3a7640000", 0), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("0de0b6b3FFFFFFFF", 0), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("8ac72304", 1), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("0de0b6b400000000", 0), IMMUTABLE_TEN18); + testQuoRemIteration(mutable("8ac72305", 1), IMMUTABLE_TEN18); + // q = 18 + testQuoRemIteration(mutable("FFFFFFFF", 1), IMMUTABLE_TEN18); + } + + private static void testCmp(FDBigInteger t, FDBigInteger o) throws Exception { + BigInteger bt = t.toBigInteger(); + BigInteger bo = o.toBigInteger(); + int cmp = t.cmp(o); + int bcmp = bt.compareTo(bo); + if (bcmp != cmp) { + throw new Exception("cmp returns " + cmp + " expected " + bcmp); + } + check(bt, t, "cmp corrupts this"); + check(bo, o, "cmp corrupts other"); + if (o.cmp(t) != -cmp) { + throw new Exception("asymmetrical cmp"); + } + check(bt, t, "cmp corrupts this"); + check(bo, o, "cmp corrupts other"); + } + + private static void testCmp() throws Exception { + testCmp(mutable("FFFFFFFF", 0), mutable("100000000", 0)); + testCmp(mutable("FFFFFFFF", 0), mutable("1", 1)); + testCmp(mutable("5", 0), mutable("6", 0)); + testCmp(mutable("5", 0), mutable("5", 0)); + testCmp(mutable("5000000001", 0), mutable("500000001", 0)); + testCmp(mutable("5000000001", 0), mutable("6", 1)); + testCmp(mutable("5000000001", 0), mutable("5", 1)); + testCmp(mutable("5000000000", 0), mutable("5", 1)); + } + + private static void testCmpPow52(FDBigInteger t, int p5, int p2) throws Exception { + FDBigInteger o = FDBigInteger.valueOfPow52(p5, p2); + BigInteger bt = t.toBigInteger(); + BigInteger bo = biPow52(p5, p2); + int cmp = t.cmp(o); + int bcmp = bt.compareTo(bo); + if (bcmp != cmp) { + throw new Exception("cmpPow52 returns " + cmp + " expected " + bcmp); + } + check(bt, t, "cmpPow52 corrupts this"); + check(bo, o, "cmpPow5 corrupts other"); + } + + private static void testCmpPow52() throws Exception { + testCmpPow52(mutable("00000002", 1), 0, 31); + testCmpPow52(mutable("00000002", 1), 0, 32); + testCmpPow52(mutable("00000002", 1), 0, 33); + testCmpPow52(mutable("00000002", 1), 0, 34); + testCmpPow52(mutable("00000002", 1), 0, 64); + testCmpPow52(mutable("00000003", 1), 0, 32); + testCmpPow52(mutable("00000003", 1), 0, 33); + testCmpPow52(mutable("00000003", 1), 0, 34); + } + + private static void testAddAndCmp(FDBigInteger t, FDBigInteger x, FDBigInteger y) throws Exception { + BigInteger bt = t.toBigInteger(); + BigInteger bx = x.toBigInteger(); + BigInteger by = y.toBigInteger(); + int cmp = t.addAndCmp(x, y); + int bcmp = bt.compareTo(bx.add(by)); + if (bcmp != cmp) { + throw new Exception("addAndCmp returns " + cmp + " expected " + bcmp); + } + check(bt, t, "addAndCmp corrupts this"); + check(bx, x, "addAndCmp corrupts x"); + check(by, y, "addAndCmp corrupts y"); + } + + private static void testAddAndCmp() throws Exception { + testAddAndCmp(MUTABLE_ZERO, MUTABLE_ZERO, MUTABLE_ZERO); + testAddAndCmp(mutable("00000001", 0), MUTABLE_ZERO, MUTABLE_ZERO); + testAddAndCmp(mutable("00000001", 0), mutable("00000001", 0), MUTABLE_ZERO); + testAddAndCmp(mutable("00000001", 0), MUTABLE_ZERO, mutable("00000001", 0)); + testAddAndCmp(mutable("00000001", 0), mutable("00000002", 0), MUTABLE_ZERO); + testAddAndCmp(mutable("00000001", 0), MUTABLE_ZERO, mutable("00000002", 0)); + testAddAndCmp(mutable("00000001", 2), mutable("FFFFFFFF", 0), mutable("FFFFFFFF", 0)); + testAddAndCmp(mutable("00000001", 0), mutable("00000001", 1), mutable("00000001", 0)); + + testAddAndCmp(mutable("00000001", 2), mutable("0F0F0F0F80000000", 1), mutable("F0F0F0F080000000", 1)); + testAddAndCmp(mutable("00000001", 2), mutable("0F0F0F0E80000000", 1), mutable("F0F0F0F080000000", 1)); + + testAddAndCmp(mutable("00000002", 1), mutable("0000000180000000", 1), mutable("0000000280000000", 1)); + testAddAndCmp(mutable("00000003", 1), mutable("0000000180000000", 1), mutable("0000000280000000", 1)); + testAddAndCmp(mutable("00000004", 1), mutable("0000000180000000", 1), mutable("0000000280000000", 1)); + testAddAndCmp(mutable("00000005", 1), mutable("0000000180000000", 1), mutable("0000000280000000", 1)); + + testAddAndCmp(mutable("00000001", 2), mutable("8000000000000000", 0), mutable("8000000000000000", 0)); + testAddAndCmp(mutable("00000001", 2), mutable("8000000000000000", 0), mutable("8000000000000001", 0)); + testAddAndCmp(mutable("00000002", 2), mutable("8000000000000000", 0), mutable("8000000000000000", 0)); + testAddAndCmp(mutable("00000003", 2), mutable("8000000000000000", 0), mutable("8000000000000000", 0)); + } + + private static void testMultBy10(FDBigInteger t, boolean isImmutable) throws Exception { + BigInteger bt = t.toBigInteger(); + FDBigInteger r = t.multBy10(); + if ((bt.signum() == 0 || !isImmutable) && r != t) { + throw new Exception("multBy10 of doesn't reuse its argument"); + } + if (isImmutable) { + check(bt, t, "multBy10 corrupts its argument"); + } + check(bt.multiply(BigInteger.TEN), r, "multBy10 returns wrong result"); + } + + private static void testMultBy10() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + for (int p2 = 0; p2 <= MAX_P2; p2++) { + // This strange way of creating a value ensures that it is mutable. + FDBigInteger value = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5, p2); + testMultBy10(value, false); + value.makeImmutable(); + testMultBy10(value, true); + } + } + } + + private static void testMultByPow52(FDBigInteger t, int p5, int p2) throws Exception { + BigInteger bt = t.toBigInteger(); + FDBigInteger r = t.multByPow52(p5, p2); + if (bt.signum() == 0 && r != t) { + throw new Exception("multByPow52 of doesn't reuse its argument"); + } + check(bt.multiply(biPow52(p5, p2)), r, "multByPow52 returns wrong result"); + } + + private static void testMultByPow52() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + for (int p2 = 0; p2 <= MAX_P2; p2++) { + // This strange way of creating a value ensures that it is mutable. + FDBigInteger value = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5, p2); + testMultByPow52(value, p5, p2); + } + } + } + + private static void testLeftInplaceSub(FDBigInteger left, FDBigInteger right, boolean isImmutable) throws Exception { + BigInteger biLeft = left.toBigInteger(); + BigInteger biRight = right.toBigInteger(); + FDBigInteger diff = left.leftInplaceSub(right); + if (!isImmutable && diff != left) { + throw new Exception("leftInplaceSub of doesn't reuse its argument"); + } + if (isImmutable) { + check(biLeft, left, "leftInplaceSub corrupts its left immutable argument"); + } + check(biRight, right, "leftInplaceSub corrupts its right argument"); + check(biLeft.subtract(biRight), diff, "leftInplaceSub returns wrong result"); + } + + private static void testLeftInplaceSub() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + for (int p2 = 0; p2 <= MAX_P2; p2++) { +// for (int p5r = 0; p5r <= p5; p5r += 10) { +// for (int p2r = 0; p2r <= p2; p2r += 10) { + for (int p5r = 0; p5r <= p5; p5r++) { + for (int p2r = 0; p2r <= p2; p2r++) { + // This strange way of creating a value ensures that it is mutable. + FDBigInteger left = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5, p2); + FDBigInteger right = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5r, p2r); + testLeftInplaceSub(left, right, false); + left = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5, p2); + left.makeImmutable(); + testLeftInplaceSub(left, right, true); + } + } + } + } + } + + private static void testRightInplaceSub(FDBigInteger left, FDBigInteger right, boolean isImmutable) throws Exception { + BigInteger biLeft = left.toBigInteger(); + BigInteger biRight = right.toBigInteger(); + FDBigInteger diff = left.rightInplaceSub(right); + if (!isImmutable && diff != right) { + throw new Exception("rightInplaceSub of doesn't reuse its argument"); + } + check(biLeft, left, "leftInplaceSub corrupts its left argument"); + if (isImmutable) { + check(biRight, right, "leftInplaceSub corrupts its right immutable argument"); + } + try { + check(biLeft.subtract(biRight), diff, "rightInplaceSub returns wrong result"); + } catch (Exception e) { + System.out.println(biLeft+" - "+biRight+" = "+biLeft.subtract(biRight)); + throw e; + } + } + + private static void testRightInplaceSub() throws Exception { + for (int p5 = 0; p5 <= MAX_P5; p5++) { + for (int p2 = 0; p2 <= MAX_P2; p2++) { +// for (int p5r = 0; p5r <= p5; p5r += 10) { +// for (int p2r = 0; p2r <= p2; p2r += 10) { + for (int p5r = 0; p5r <= p5; p5r++) { + for (int p2r = 0; p2r <= p2; p2r++) { + // This strange way of creating a value ensures that it is mutable. + FDBigInteger left = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5, p2); + FDBigInteger right = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5r, p2r); + testRightInplaceSub(left, right, false); + right = FDBigInteger.valueOfPow52(0, 0).multByPow52(p5r, p2r); + right.makeImmutable(); + testRightInplaceSub(left, right, true); + } + } + } + } + } + + public static void main(String[] args) throws Exception { + testValueOfPow52(); + testValueOfMulPow52(); + testLeftShift(); + testQuoRemIteration(); + testCmp(); + testCmpPow52(); + testAddAndCmp(); + // Uncomment the following for more comprehensize but slow testing. + // testLeftInplaceSub(); + // testMultBy10(); + // testMultByPow52(); + // testRightInplaceSub(); + } +} diff --git a/jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java b/jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java new file mode 100644 index 00000000000..08fa34afceb --- /dev/null +++ b/jdk/test/sun/misc/FloatingDecimal/TestFloatingDecimal.java @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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.Random; +import sun.misc.FloatingDecimal; + +/* +OldFloatingDecimalForTest + +public class OldFloatingDecimalForTest { + public boolean digitsRoundedUp(); + public OldFloatingDecimalForTest(double); + public OldFloatingDecimalForTest(float); + public boolean decimalDigitsExact(); + public java.lang.String toString(); + public java.lang.String toJavaFormatString(); + public void appendTo(java.lang.Appendable); + public static OldFloatingDecimalForTest readJavaFormatString(java.lang.String) throws java.lang.NumberFormatException; + public strictfp double doubleValue(); + public strictfp float floatValue(); +} + +sun.misc.FloatingDecimal + +public class sun.misc.FloatingDecimal { + public sun.misc.FloatingDecimal(); + public static java.lang.String toJavaFormatString(double); + public static java.lang.String toJavaFormatString(float); + public static void appendTo(double, java.lang.Appendable); + public static void appendTo(float, java.lang.Appendable); + public static double parseDouble(java.lang.String) throws java.lang.NumberFormatException; + public static float parseFloat(java.lang.String) throws java.lang.NumberFormatException; + public static sun.misc.FloatingDecimal$AbstractD2ABuffer getD2ABuffer(double); +} +*/ + +/** + * @test + * @bug 7032154 + * @summary unit tests of sun.misc.FloatingDecimal + * @author Brian Burkhalter + */ +public class TestFloatingDecimal { + private static enum ResultType { + RESULT_EXCEPTION, + RESULT_PRINT + } + + private static final ResultType RESULT_TYPE = ResultType.RESULT_PRINT; + private static final int NUM_RANDOM_TESTS = 100000; + + private static final Random RANDOM = new Random(); + + private static void result(String message) { + switch (RESULT_TYPE) { + case RESULT_EXCEPTION: + throw new RuntimeException(message); + case RESULT_PRINT: + System.err.println(message); + break; + default: + assert false; + } + } + + private static int check(String test, Object expected, Object actual) { + int failures = 0; + if(!actual.equals(expected)) { + failures++; + result("Test "+test+" expected "+expected+" but obtained "+actual); + } + return failures; + } + + private static int testAppendToDouble() { + System.out.println(" testAppendToDouble"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + double[] d = new double[] { + RANDOM.nextLong(), + RANDOM.nextGaussian(), + RANDOM.nextDouble()*Double.MAX_VALUE + }; + for(int j = 0; j < d.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(d[j]); + StringBuilder sb = new StringBuilder(); + ofd.appendTo(sb); + String oldString = sb.toString(); + sb = new StringBuilder(); + FloatingDecimal.appendTo(d[j], sb); + String newString = sb.toString(); + failures += check("testAppendToDouble", oldString, newString); + } + } + + return failures; + } + + private static int testAppendToFloat() { + System.out.println(" testAppendToFloat"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + float[] f = new float[] { + RANDOM.nextLong(), + (float)RANDOM.nextGaussian(), + RANDOM.nextFloat()*Float.MAX_VALUE + }; + for(int j = 0; j < f.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(f[j]); + StringBuilder sb = new StringBuilder(); + ofd.appendTo(sb); + String oldString = sb.toString(); + sb = new StringBuilder(); + FloatingDecimal.appendTo(f[j], sb); + String newString = sb.toString(); + failures += check("testAppendToFloat", oldString, newString); + } + } + + return failures; + } + + private static int testAppendTo() { + System.out.println("testAppendTo"); + int failures = 0; + + failures += testAppendToDouble(); + failures += testAppendToFloat(); + + return failures; + } + + private static int testParseDouble() { + System.out.println(" testParseDouble"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + double[] d = new double[] { + RANDOM.nextLong(), + RANDOM.nextGaussian(), + RANDOM.nextDouble()*Double.MAX_VALUE + }; + for(int j = 0; j < d.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(d[j]); + String javaFormatString = ofd.toJavaFormatString(); + ofd = OldFloatingDecimalForTest.readJavaFormatString(javaFormatString); + double oldDouble = ofd.doubleValue(); + double newDouble = FloatingDecimal.parseDouble(javaFormatString); + failures += check("testParseDouble", oldDouble, newDouble); + } + } + + return failures; + } + + private static int testParseFloat() { + System.out.println(" testParseFloat"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + float[] f = new float[] { + RANDOM.nextInt(), + (float)RANDOM.nextGaussian(), + RANDOM.nextFloat()*Float.MAX_VALUE + }; + for(int j = 0; j < f.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(f[j]); + String javaFormatString = ofd.toJavaFormatString(); + ofd = OldFloatingDecimalForTest.readJavaFormatString(javaFormatString); + float oldFloat = ofd.floatValue(); + float newFloat = FloatingDecimal.parseFloat(javaFormatString); + failures += check("testParseFloat", oldFloat, newFloat); + } + } + + return failures; + } + + private static int testParse() { + System.out.println("testParse"); + int failures = 0; + + failures += testParseDouble(); + failures += testParseFloat(); + + return failures; + } + + private static int testToJavaFormatStringDoubleFixed() { + System.out.println(" testToJavaFormatStringDoubleFixed"); + int failures = 0; + + double[] d = new double [] { + -5.9522650387500933e18, // dtoa() fast path + 0.872989018674569, // dtoa() fast iterative - long + 1.1317400099603851e308 // dtoa() slow iterative + }; + + for(int i = 0; i < d.length; i++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(d[i]); + failures += check("testToJavaFormatStringDoubleFixed", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(d[i])); + } + + return failures; + } + + private static int testToJavaFormatStringDoubleRandom() { + System.out.println(" testToJavaFormatStringDoubleRandom"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + double[] d = new double[] { + RANDOM.nextLong(), + RANDOM.nextGaussian(), + RANDOM.nextDouble()*Double.MAX_VALUE + }; + for(int j = 0; j < d.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(d[j]); + failures += check("testToJavaFormatStringDoubleRandom", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(d[j])); + } + } + + return failures; + } + + private static int testToJavaFormatStringDouble() { + System.out.println(" testToJavaFormatStringDouble"); + int failures = 0; + failures += testToJavaFormatStringDoubleFixed(); + failures += testToJavaFormatStringDoubleRandom(); + return failures; + } + + private static int testToJavaFormatStringFloatFixed() { + System.out.println(" testToJavaFormatStringFloatFixed"); + int failures = 0; + + float[] f = new float[] { + -9.8784166e8f, // dtoa() fast path + 0.70443946f, // dtoa() fast iterative - int + 1.8254228e37f // dtoa() slow iterative + }; + + for(int i = 0; i < f.length; i++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(f[i]); + failures += check("testToJavaFormatStringFloatFixed", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(f[i])); + } + + return failures; + } + + private static int testToJavaFormatStringFloatRandom() { + System.out.println(" testToJavaFormatStringFloatRandom"); + int failures = 0; + + for(int i = 0; i < NUM_RANDOM_TESTS; i++) { + float[] f = new float[] { + RANDOM.nextInt(), + (float)RANDOM.nextGaussian(), + RANDOM.nextFloat()*Float.MAX_VALUE + }; + for(int j = 0; j < f.length; j++) { + OldFloatingDecimalForTest ofd = new OldFloatingDecimalForTest(f[j]); + failures += check("testToJavaFormatStringFloatRandom", ofd.toJavaFormatString(), FloatingDecimal.toJavaFormatString(f[j])); + } + } + + return failures; + } + + private static int testToJavaFormatStringFloat() { + System.out.println(" testToJavaFormatStringFloat"); + int failures = 0; + + failures += testToJavaFormatStringFloatFixed(); + failures += testToJavaFormatStringFloatRandom(); + + return failures; + } + + private static int testToJavaFormatString() { + System.out.println("testToJavaFormatString"); + int failures = 0; + + failures += testToJavaFormatStringDouble(); + failures += testToJavaFormatStringFloat(); + + return failures; + } + + public static void main(String[] args) { + int failures = 0; + + failures += testAppendTo(); + failures += testParse(); + failures += testToJavaFormatString(); + + if (failures != 0) { + throw new RuntimeException("" + failures + " failures while testing FloatingDecimal"); + } + } +} diff --git a/jdk/test/sun/misc/Hashing.java b/jdk/test/sun/misc/Hashing.java deleted file mode 100644 index 0b5baeff368..00000000000 --- a/jdk/test/sun/misc/Hashing.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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 Ensure that Murmur3 hash performs according to specification. - * @compile -XDignore.symbol.file Hashing.java - */ -public class Hashing { - - static final byte ONE_BYTE[] = { - (byte) 0x80}; - static final byte TWO_BYTE[] = { - (byte) 0x80, (byte) 0x81}; - static final char ONE_CHAR[] = { - (char) 0x8180}; - static final byte THREE_BYTE[] = { - (byte) 0x80, (byte) 0x81, (byte) 0x82}; - static final byte FOUR_BYTE[] = { - (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83}; - static final char TWO_CHAR[] = { - (char) 0x8180, (char) 0x8382}; - static final int ONE_INT[] = { - 0x83828180}; - static final byte SIX_BYTE[] = { - (byte) 0x80, (byte) 0x81, (byte) 0x82, - (byte) 0x83, (byte) 0x84, (byte) 0x85}; - static final char THREE_CHAR[] = { - (char) 0x8180, (char) 0x8382, (char) 0x8584}; - static final byte EIGHT_BYTE[] = { - (byte) 0x80, (byte) 0x81, (byte) 0x82, - (byte) 0x83, (byte) 0x84, (byte) 0x85, - (byte) 0x86, (byte) 0x87}; - static final char FOUR_CHAR[] = { - (char) 0x8180, (char) 0x8382, - (char) 0x8584, (char) 0x8786}; - static final int TWO_INT[] = { - 0x83828180, 0x87868584}; - // per http://code.google.com/p/smhasher/source/browse/trunk/main.cpp, line:72 - static final int MURMUR3_32_X86_CHECK_VALUE = 0xB0F57EE3; - - public static void testMurmur3_32_ByteArray() { - System.out.println("testMurmur3_32_ByteArray"); - - byte[] vector = new byte[256]; - byte[] hashes = new byte[4 * 256]; - - for (int i = 0; i < 256; i++) { - vector[i] = (byte) i; - } - - // Hash subranges {}, {0}, {0,1}, {0,1,2}, ..., {0,...,255} - for (int i = 0; i < 256; i++) { - int hash = sun.misc.Hashing.murmur3_32(256 - i, vector, 0, i); - - hashes[i * 4] = (byte) hash; - hashes[i * 4 + 1] = (byte) (hash >>> 8); - hashes[i * 4 + 2] = (byte) (hash >>> 16); - hashes[i * 4 + 3] = (byte) (hash >>> 24); - } - - // hash to get final result. - int final_hash = sun.misc.Hashing.murmur3_32(0, hashes); - - if (MURMUR3_32_X86_CHECK_VALUE != final_hash) { - throw new RuntimeException( - String.format("Calculated hash result not as expected. Expected %08X got %08X", - MURMUR3_32_X86_CHECK_VALUE, - final_hash)); - } - } - - public static void testEquivalentHashes() { - int bytes, chars, ints; - - System.out.println("testEquivalentHashes"); - - bytes = sun.misc.Hashing.murmur3_32(TWO_BYTE); - chars = sun.misc.Hashing.murmur3_32(ONE_CHAR); - if (bytes != chars) { - throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x", bytes, chars)); - } - - bytes = sun.misc.Hashing.murmur3_32(FOUR_BYTE); - chars = sun.misc.Hashing.murmur3_32(TWO_CHAR); - ints = sun.misc.Hashing.murmur3_32(ONE_INT); - if ((bytes != chars) || (bytes != ints)) { - throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x != i:%08x", bytes, chars, ints)); - } - bytes = sun.misc.Hashing.murmur3_32(SIX_BYTE); - chars = sun.misc.Hashing.murmur3_32(THREE_CHAR); - if (bytes != chars) { - throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x", bytes, chars)); - } - - bytes = sun.misc.Hashing.murmur3_32(EIGHT_BYTE); - chars = sun.misc.Hashing.murmur3_32(FOUR_CHAR); - ints = sun.misc.Hashing.murmur3_32(TWO_INT); - if ((bytes != chars) || (bytes != ints)) { - throw new RuntimeException(String.format("Hashes did not match. b:%08x != c:%08x != i:%08x", bytes, chars, ints)); - } - } - - public static void main(String[] args) { - testMurmur3_32_ByteArray(); - testEquivalentHashes(); - } -} diff --git a/jdk/test/sun/misc/JavaLangAccess/NewUnsafeString.java b/jdk/test/sun/misc/JavaLangAccess/NewUnsafeString.java index 930d57bee80..ab608d7dcf5 100644 --- a/jdk/test/sun/misc/JavaLangAccess/NewUnsafeString.java +++ b/jdk/test/sun/misc/JavaLangAccess/NewUnsafeString.java @@ -22,7 +22,7 @@ */ import java.util.Objects; -import java.util.Comparators; +import java.util.Comparator; import sun.misc.JavaLangAccess; import sun.misc.SharedSecrets; @@ -48,7 +48,7 @@ public class NewUnsafeString { if (!benchmark.equals(constructorCopy)) { throw new Error("Copy not equal"); } - if (0 != Objects.compare(benchmark, constructorCopy, Comparators.naturalOrder())) { + if (0 != Objects.compare(benchmark, constructorCopy, Comparator.naturalOrder())) { throw new Error("Copy not equal"); } @@ -58,7 +58,7 @@ public class NewUnsafeString { if (!benchmark.equals(jlaCopy)) { throw new Error("Copy not equal"); } - if (0 != Objects.compare(benchmark, jlaCopy, Comparators.naturalOrder())) { + if (0 != Objects.compare(benchmark, jlaCopy, Comparator.naturalOrder())) { throw new Error("Copy not equal"); } @@ -68,7 +68,7 @@ public class NewUnsafeString { if (!constructorCopy.equals(jlaCopy)) { throw new Error("Copy not equal"); } - if (0 != Objects.compare(constructorCopy, jlaCopy, Comparators.naturalOrder())) { + if (0 != Objects.compare(constructorCopy, jlaCopy, Comparator.naturalOrder())) { throw new Error("Copy not equal"); } diff --git a/jdk/test/sun/net/www/http/HttpClient/B7025238.java b/jdk/test/sun/net/www/http/HttpClient/B7025238.java new file mode 100644 index 00000000000..313972594a4 --- /dev/null +++ b/jdk/test/sun/net/www/http/HttpClient/B7025238.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 com.sun.net.httpserver.*; +import java.io.IOException; +import java.io.OutputStream; +import java.net.*; +import java.util.concurrent.Executors; + +/* + * @test + * @bug 7025238 + * @summary HttpURLConnection does not handle URLs with an empty path component + */ +public class B7025238 { + + public static void main(String[] args) throws Exception { + new B7025238().runTest(); + } + + public void runTest() throws Exception { + Server s = null; + try { + s = new Server(); + s.startServer(); + URL url = new URL("http://localhost:" + s.getPort() + "?q=test"); + HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(); + urlConnection.setRequestMethod("GET"); + urlConnection.connect(); + int code = urlConnection.getResponseCode(); + + if (code != 200) { + throw new RuntimeException("Test failed!"); + } + } finally { + s.stopServer(); + } + } + + class Server { + HttpServer server; + + public void startServer() { + InetSocketAddress addr = new InetSocketAddress(0); + try { + server = HttpServer.create(addr, 0); + } catch (IOException ioe) { + throw new RuntimeException("Server could not be created"); + } + + server.createContext("/", new EmptyPathHandler()); + server.start(); + } + + public int getPort() { + return server.getAddress().getPort(); + } + + public void stopServer() { + server.stop(0); + } + } + + class EmptyPathHandler implements HttpHandler { + + @Override + public void handle(HttpExchange exchange) throws IOException { + String requestMethod = exchange.getRequestMethod(); + + if (requestMethod.equalsIgnoreCase("GET")) { + Headers responseHeaders = exchange.getResponseHeaders(); + responseHeaders.set("Content-Type", "text/plain"); + exchange.sendResponseHeaders(200, 0); + OutputStream os = exchange.getResponseBody(); + String str = "Hello from server!"; + os.write(str.getBytes()); + os.flush(); + os.close(); + } + } + } +} + diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java b/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java new file mode 100644 index 00000000000..07d353cba85 --- /dev/null +++ b/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 com.sun.net.httpserver.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.*; + +/* + * @test + * @bug 7157360 + * @summary HttpURLConnection: HTTP method DELETE doesn't support output + */ +public class PostOnDelete { + + /* string to send */ + private static String msg = "Hello Server"; + /* length of the string to verify */ + private int len = msg.length(); + + public static void main(String[] args) throws Exception { + new PostOnDelete().runTest(); + } + + public void runTest() throws Exception { + Server s = null; + try { + s = new Server(); + s.startServer(); + URL url = new URL("http://localhost:" + s.getPort()); + HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(); + urlConnection.setRequestMethod("DELETE"); + urlConnection.setDoOutput(true); + OutputStream os = urlConnection.getOutputStream(); + os.write(msg.getBytes()); + os.close(); + int code = urlConnection.getResponseCode(); + + if (code != 200) { + throw new RuntimeException("Request entity for DELETE failed!"); + } + } finally { + s.stopServer(); + } + } + + class Server { + HttpServer server; + + public void startServer() { + InetSocketAddress addr = new InetSocketAddress(0); + try { + server = HttpServer.create(addr, 0); + } catch (IOException ioe) { + throw new RuntimeException("Server could not be created"); + } + + server.createContext("/", new EmptyPathHandler()); + server.start(); + } + + public int getPort() { + return server.getAddress().getPort(); + } + + public void stopServer() { + server.stop(0); + } + } + + class EmptyPathHandler implements HttpHandler { + + @Override + public void handle(HttpExchange exchange) throws IOException { + String requestMethod = exchange.getRequestMethod(); + + if (requestMethod.equalsIgnoreCase("DELETE")) { + InputStream is = exchange.getRequestBody(); + + int count = 0; + while (is.read() != -1) { + count++; + } + is.close(); + + Headers responseHeaders = exchange.getResponseHeaders(); + responseHeaders.set("Content-Type", "text/plain"); + exchange.sendResponseHeaders((count == len) ? 200 : 400, 0); + OutputStream os = exchange.getResponseBody(); + String str = "Hello from server!"; + os.write(str.getBytes()); + os.flush(); + os.close(); + } + } + } +} diff --git a/jdk/test/sun/security/krb5/auto/AcceptorSubKey.java b/jdk/test/sun/security/krb5/auto/AcceptorSubKey.java index 9aba5e48582..26b1fbda724 100644 --- a/jdk/test/sun/security/krb5/auto/AcceptorSubKey.java +++ b/jdk/test/sun/security/krb5/auto/AcceptorSubKey.java @@ -26,10 +26,10 @@ * @bug 7077646 * @summary gssapi wrap for CFX per-message tokens always set FLAG_ACCEPTOR_SUBKEY * @compile -XDignore.symbol.file AcceptorSubKey.java - * @run main/othervm AcceptorSubKey + * @run main/othervm AcceptorSubKey 0 + * @run main/othervm AcceptorSubKey 4 */ -import java.util.Arrays; import sun.security.jgss.GSSUtil; // The basic krb5 test skeleton you can copy from @@ -37,8 +37,14 @@ public class AcceptorSubKey { public static void main(String[] args) throws Exception { + int expected = Integer.parseInt(args[0]); + new OneKDC(null).writeJAASConf(); + if (expected != 0) { + System.setProperty("sun.security.krb5.acceptor.subkey", "true"); + } + Context c, s; c = Context.fromJAAS("client"); s = Context.fromJAAS("server"); @@ -53,8 +59,8 @@ public class AcceptorSubKey { // FLAG_ACCEPTOR_SUBKEY is 4 int flagOn = wrapped[2] & 4; - if (flagOn != 0) { - throw new Exception("Java GSS should not have set acceptor subkey"); + if (flagOn != expected) { + throw new Exception("not expected"); } s.dispose(); diff --git a/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java b/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java index aa6c0a40d28..99c68223870 100644 --- a/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java +++ b/jdk/test/sun/security/krb5/auto/BasicKrb5Test.java @@ -59,6 +59,7 @@ import org.ietf.jgss.GSSName; import sun.security.jgss.GSSUtil; import sun.security.krb5.Config; +import sun.security.krb5.KrbException; import sun.security.krb5.internal.crypto.EType; /** @@ -84,12 +85,10 @@ public class BasicKrb5Test { // Creates and starts the KDC. This line must be put ahead of etype check // since the check needs a krb5.conf. - new OneKDC(etype).writeJAASConf(); - - System.out.println("Testing etype " + etype); - if (etype != null && !EType.isSupported(Config.getType(etype))) { - // aes256 is not enabled on all systems - System.out.println("Not supported."); + try { + new OneKDC(etype).writeJAASConf(); + } catch (KrbException ke) { + System.out.println("Testing etype " + etype + "Not supported."); return; } diff --git a/jdk/test/sun/security/krb5/auto/BasicProc.java b/jdk/test/sun/security/krb5/auto/BasicProc.java new file mode 100644 index 00000000000..54b204fb420 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BasicProc.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8009977 + * @summary A test library to launch multiple Java processes + * @library ../../../../java/security/testlibrary/ + * @compile -XDignore.symbol.file BasicProc.java + * @run main/othervm BasicProc + */ + +import java.io.File; +import org.ietf.jgss.Oid; + +import javax.security.auth.PrivateCredentialPermission; + +public class BasicProc { + + static String CONF = "krb5.conf"; + static String KTAB = "ktab"; + public static void main(String[] args) throws Exception { + String HOST = "localhost"; + String SERVER = "server/" + HOST; + String BACKEND = "backend/" + HOST; + String USER = "user"; + char[] PASS = "password".toCharArray(); + String REALM = "REALM"; + + Oid oid = new Oid("1.2.840.113554.1.2.2"); + + if (args.length == 0) { + System.setProperty("java.security.krb5.conf", CONF); + KDC kdc = KDC.create(REALM, HOST, 0, true); + kdc.addPrincipal(USER, PASS); + kdc.addPrincipalRandKey("krbtgt/" + REALM); + kdc.addPrincipalRandKey(SERVER); + kdc.addPrincipalRandKey(BACKEND); + + String cwd = System.getProperty("user.dir"); + kdc.writeKtab(KTAB); + KDC.saveConfig(CONF, kdc, "forwardable = true"); + + Proc pc = Proc.create("BasicProc") + .args("client") + .prop("java.security.krb5.conf", CONF) + .prop("java.security.manager", "") + .perm(new java.util.PropertyPermission( + "sun.security.krb5.principal", "read")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrincipals")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrivateCredentials")) + .perm(new javax.security.auth.AuthPermission("doAs")) + .perm(new javax.security.auth.kerberos.ServicePermission( + "krbtgt/" + REALM + "@" + REALM, "initiate")) + .perm(new javax.security.auth.kerberos.ServicePermission( + "server/localhost@" + REALM, "initiate")) + .perm(new javax.security.auth.kerberos.DelegationPermission( + "\"server/localhost@" + REALM + "\" " + + "\"krbtgt/" + REALM + "@" + REALM + "\"")) + .debug("C") + .start(); + Proc ps = Proc.create("BasicProc") + .args("server") + .prop("java.security.krb5.conf", CONF) + .prop("java.security.manager", "") + .perm(new java.util.PropertyPermission( + "sun.security.krb5.principal", "read")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrincipals")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrivateCredentials")) + .perm(new javax.security.auth.AuthPermission("doAs")) + .perm(new PrivateCredentialPermission( + "javax.security.auth.kerberos.KeyTab * \"*\"", + "read")) + .perm(new javax.security.auth.kerberos.ServicePermission( + "server/localhost@" + REALM, "accept")) + .perm(new java.io.FilePermission( + cwd + File.separator + KTAB, "read")) + .perm(new javax.security.auth.kerberos.ServicePermission( + "backend/localhost@" + REALM, "initiate")) + .debug("S") + .start(); + Proc pb = Proc.create("BasicProc") + .args("backend") + .prop("java.security.krb5.conf", CONF) + .prop("java.security.manager", "") + .perm(new java.util.PropertyPermission( + "sun.security.krb5.principal", "read")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrincipals")) + .perm(new javax.security.auth.AuthPermission( + "modifyPrivateCredentials")) + .perm(new javax.security.auth.AuthPermission("doAs")) + .perm(new PrivateCredentialPermission( + "javax.security.auth.kerberos.KeyTab * \"*\"", + "read")) + .perm(new javax.security.auth.kerberos.ServicePermission( + "backend/localhost@" + REALM, "accept")) + .perm(new java.io.FilePermission( + cwd + File.separator + KTAB, "read")) + .debug("B") + .start(); + + // Client and server handshake + String token = pc.readData(); + ps.println(token); + token = ps.readData(); + pc.println(token); + // Server and backend handshake + token = ps.readData(); + pb.println(token); + token = pb.readData(); + ps.println(token); + // wrap/unwrap/getMic/verifyMic and plain text + token = ps.readData(); + pb.println(token); + token = pb.readData(); + ps.println(token); + token = pb.readData(); + ps.println(token); + + if ((pc.waitFor() | ps.waitFor() | pb.waitFor()) != 0) { + throw new Exception(); + } + } else if (args[0].equals("client")) { + Context c = Context.fromUserPass(USER, PASS, false); + c.startAsClient(SERVER, oid); + c.x().requestCredDeleg(true); + Proc.binOut(c.take(new byte[0])); + byte[] token = Proc.binIn(); + c.take(token); + } else if (args[0].equals("server")) { + Context s = Context.fromUserKtab(SERVER, KTAB, true); + s.startAsServer(oid); + byte[] token = Proc.binIn(); + token = s.take(token); + Proc.binOut(token); + Context s2 = s.delegated(); + s2.startAsClient(BACKEND, oid); + Proc.binOut(s2.take(new byte[0])); + token = Proc.binIn(); + s2.take(token); + byte[] msg = "Hello".getBytes(); + Proc.binOut(s2.wrap(msg, true)); + s2.verifyMic(Proc.binIn(), msg); + String in = Proc.textIn(); + if (!in.equals("Hello")) { + throw new Exception(); + } + } else if (args[0].equals("backend")) { + Context b = Context.fromUserKtab(BACKEND, KTAB, true); + b.startAsServer(oid); + byte[] token = Proc.binIn(); + Proc.binOut(b.take(token)); + byte[] msg = b.unwrap(Proc.binIn(), true); + Proc.binOut(b.getMic(msg)); + Proc.textOut(new String(msg)); + } + } + // create a native server + private static Proc ns(Proc p) throws Exception { + return p + .env("KRB5_CONFIG", CONF) + .env("KRB5_KTNAME", KTAB) + .prop("sun.security.jgss.native", "true") + .prop("javax.security.auth.useSubjectCredsOnly", "false") + .prop("sun.security.nativegss.debug", "true"); + } +} diff --git a/jdk/test/sun/security/krb5/auto/Context.java b/jdk/test/sun/security/krb5/auto/Context.java index 738f2c3d4e3..cb3d6e98def 100644 --- a/jdk/test/sun/security/krb5/auto/Context.java +++ b/jdk/test/sun/security/krb5/auto/Context.java @@ -195,6 +195,7 @@ public class Context { Krb5LoginModule krb5 = new Krb5LoginModule(); Map map = new HashMap<>(); + map.put("isInitiator", "false"); map.put("doNotPrompt", "true"); map.put("useTicketCache", "false"); map.put("useKeyTab", "true"); @@ -616,9 +617,10 @@ public class Context { */ static public void handshake(final Context c, final Context s) throws Exception { byte[] t = new byte[0]; - while (!c.x.isEstablished() || !s.x.isEstablished()) { - t = c.take(t); - t = s.take(t); + while (true) { + if (t != null || !c.x.isEstablished()) t = c.take(t); + if (t != null || !s.x.isEstablished()) t = s.take(t); + if (c.x.isEstablished() && s.x.isEstablished()) break; } } } diff --git a/jdk/test/sun/security/krb5/auto/KDC.java b/jdk/test/sun/security/krb5/auto/KDC.java index 44330dfc723..0157a930909 100644 --- a/jdk/test/sun/security/krb5/auto/KDC.java +++ b/jdk/test/sun/security/krb5/auto/KDC.java @@ -1137,7 +1137,7 @@ public class KDC { * @return REALM.NAME = { kdc = host:port } */ private static String realmLineForKDC(KDC kdc) { - return String.format(" %s = {\n kdc = %s:%d\n }\n", + return String.format("%s = {\n kdc = %s:%d\n}\n", kdc.realm, kdc.kdc, kdc.port); diff --git a/jdk/test/sun/security/krb5/auto/NoneReplayCacheTest.java b/jdk/test/sun/security/krb5/auto/NoneReplayCacheTest.java new file mode 100644 index 00000000000..b92ad20395a --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/NoneReplayCacheTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2013 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 8001326 + * @run main/othervm NoneReplayCacheTest + * @summary the replaycache type none cannot stop an authenticator replay, + * but it can stop a message replay when s.s.k.acceptor.subkey is true. + * You should not really use none in production environment. This test merely + * shows there can be other protections when replay cache is not working fine. + */ + +import org.ietf.jgss.GSSException; +import sun.security.jgss.GSSUtil; + +public class NoneReplayCacheTest { + + public static void main(String[] args) + throws Exception { + + new OneKDC(null); + + System.setProperty("sun.security.krb5.rcache", "none"); + System.setProperty("sun.security.krb5.acceptor.subkey", "true"); + + Context c, s; + c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + s = Context.fromUserKtab(OneKDC.SERVER, OneKDC.KTAB, true); + + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_KRB5_MECH_OID); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + + byte[] first = c.take(new byte[0]); + + c.take(s.take(first)); + + byte[] msg = c.wrap("hello".getBytes(), true); + s.unwrap(msg, true); + + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + s.take(first); // apreq replay not detectable + try { + s.unwrap(msg, true); // msg replay detectable + throw new Exception("This method should fail"); + } catch (GSSException gsse) { + gsse.printStackTrace(); + } + } +} diff --git a/jdk/test/sun/security/krb5/auto/OneKDC.java b/jdk/test/sun/security/krb5/auto/OneKDC.java index 90a7e8e8748..16703b63067 100644 --- a/jdk/test/sun/security/krb5/auto/OneKDC.java +++ b/jdk/test/sun/security/krb5/auto/OneKDC.java @@ -67,10 +67,19 @@ public class OneKDC extends KDC { addPrincipalRandKey("krbtgt/" + REALM); addPrincipalRandKey(SERVER); addPrincipalRandKey(BACKEND); + + String extraConfig = ""; + if (etype != null) { + extraConfig += "default_tkt_enctypes=" + etype + + "\ndefault_tgs_enctypes=" + etype; + if (etype.startsWith("des")) { + extraConfig += "\nallow_weak_crypto = true"; + } + } KDC.saveConfig(KRB5_CONF, this, "forwardable = true", "default_keytab_name = " + KTAB, - etype == null ? "" : "default_tkt_enctypes=" + etype + "\ndefault_tgs_enctypes=" + etype); + extraConfig); System.setProperty("java.security.krb5.conf", KRB5_CONF); // Whatever krb5.conf had been loaded before, we reload ours now. Config.refresh(); diff --git a/jdk/test/sun/security/krb5/auto/OnlyDesLogin.java b/jdk/test/sun/security/krb5/auto/OnlyDesLogin.java new file mode 100644 index 00000000000..c4b03d166f8 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/OnlyDesLogin.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8014310 + * @summary JAAS/Krb5LoginModule using des encytypes failure with NPE after JDK-8012679 + * @compile -XDignore.symbol.file OnlyDesLogin.java + * @run main/othervm OnlyDesLogin + */ + +import sun.security.krb5.Config; + +import javax.security.auth.login.LoginException; + +public class OnlyDesLogin { + + public static void main(String[] args) throws Exception { + + OneKDC kdc = new OneKDC(null); + kdc.writeJAASConf(); + + KDC.saveConfig(OneKDC.KRB5_CONF, kdc, + "default_tkt_enctypes=des-cbc-md5", + "default_tgs_enctypes=des-cbc-md5", + "permitted_enctypes=des-cbc-md5"); + Config.refresh(); + + try { + Context.fromJAAS("client"); + throw new Exception("What?"); + } catch (LoginException le) { + // This is OK + } + } +} diff --git a/jdk/test/sun/security/krb5/auto/ReplayCacheExpunge.java b/jdk/test/sun/security/krb5/auto/ReplayCacheExpunge.java new file mode 100644 index 00000000000..da68ec3b7e1 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/ReplayCacheExpunge.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 8001326 + * @run main/othervm ReplayCacheExpunge 16 + * @run main/othervm/fail ReplayCacheExpunge 15 + * @summary when number of expired entries minus number of good entries + * is more than 30, expunge occurs, and expired entries are forgotten. +*/ + +import java.util.Random; +import sun.security.krb5.internal.KerberosTime; +import sun.security.krb5.internal.ReplayCache; +import sun.security.krb5.internal.rcache.AuthTimeWithHash; + +public class ReplayCacheExpunge { + static final String client = "dummy@REALM"; + static final String server = "server/localhost@REALM"; + static final Random rand = new Random(); + + public static void main(String[] args) throws Exception { + // Make sure clockskew is default value + System.setProperty("java.security.krb5.conf", "nothing"); + + int count = Integer.parseInt(args[0]); + ReplayCache cache = ReplayCache.getInstance("dfl:./"); + AuthTimeWithHash a1 = + new AuthTimeWithHash(client, server, time(-400), 0, hash("1")); + AuthTimeWithHash a2 = + new AuthTimeWithHash(client, server, time(0), 0, hash("4")); + KerberosTime now = new KerberosTime(time(0)*1000L); + KerberosTime then = new KerberosTime(time(-300)*1000L); + + // Once upon a time, we added a lot of events + for (int i=0; i reqs = new ArrayList<>(); + private static String HOST = "localhost"; + + // Where should the rcache be saved. It seems KRB5RCACHEDIR is not + // recognized on Solaris. Maybe version too low? I see 1.6. + private static String cwd = + System.getProperty("os.name").startsWith("SunOS") ? + "/var/krb5/rcache/" : + System.getProperty("user.dir"); + + + private static int uid; + + public static void main0(String[] args) throws Exception { + System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF); + if (args.length == 0) { // The controller + int ns = 5; // number of servers + int nu = 5; // number of users + int nx = 50; // number of experiments + int np = 5; // number of peers (services) + int mode = 0; // native(1), random(0), java(-1) + boolean random = true; // random experiments choreograph + + // Do not test interop with native GSS on some platforms + String os = System.getProperty("os.name", "???"); + if (!os.startsWith("SunOS") && !os.startsWith("Linux")) { + mode = -1; + } + + try { + Class clazz = Class.forName( + "com.sun.security.auth.module.UnixSystem"); + uid = (int)(long)(Long) + clazz.getMethod("getUid").invoke(clazz.newInstance()); + } catch (Exception e) { + uid = -1; + } + + KDC kdc = KDC.create(OneKDC.REALM, HOST, 0, true); + for (int i=0; i>4]; + h[2*i+1] = hexConst[hash[i]&0xf]; + } + return new String(h); + } + // return size of dfl file, excluding the null hash ones + private static int csize(int p) throws Exception { + try (SeekableByteChannel chan = Files.newByteChannel( + Paths.get(dfl(p)), StandardOpenOption.READ)) { + chan.position(6); + int cc = 0; + while (true) { + try { + if (AuthTime.readFrom(chan) != null) cc++; + } catch (BufferUnderflowException e) { + break; + } + } + return cc; + } catch (IOException ioe) { + return 0; + } + } + // models an experiement + private static class Ex { + int i; // # + boolean expected; // expected result + boolean actual; // actual output + int old; // which ap-req to send + String server; // which server to send to + String hash; // the hash of req + int user; // which initiator + int peer; // which acceptor + int csize; // size of rcache after test + } + // models a saved ap-req msg + private static class Req { + String msg; // based64-ed req + int user; // which initiator + int peer; // which accceptor + Req(int user, int peer, String msg) { + this.msg = msg; + this.user= user; + this.peer = peer; + } + } +} diff --git a/jdk/test/sun/security/krb5/ccache/EmptyCC.java b/jdk/test/sun/security/krb5/ccache/EmptyCC.java index a0cd759373d..f70df4f010a 100644 --- a/jdk/test/sun/security/krb5/ccache/EmptyCC.java +++ b/jdk/test/sun/security/krb5/ccache/EmptyCC.java @@ -26,15 +26,12 @@ * @bug 7158329 * @bug 8001208 * @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds() + * @library ../../../../java/security/testlibrary/ * @compile -XDignore.symbol.file EmptyCC.java * @run main EmptyCC tmpcc * @run main EmptyCC FILE:tmpcc */ import java.io.File; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import sun.security.krb5.Credentials; import sun.security.krb5.PrincipalName; import sun.security.krb5.internal.ccache.CredentialsCache; @@ -48,32 +45,9 @@ public class EmptyCC { // Main process, write the ccache and launch sub process CredentialsCache cache = CredentialsCache.create(pn, ccache); cache.save(); - - // java -cp $test.classes EmptyCC readcc - ProcessBuilder pb = new ProcessBuilder( - new File(new File(System.getProperty("java.home"), "bin"), - "java").getPath(), - "-cp", - System.getProperty("test.classes"), - "EmptyCC", - ccache, - "readcc" - ); - - pb.environment().put("KRB5CCNAME", ccache); - pb.redirectErrorStream(true); - - Process p = pb.start(); - try (InputStream ins = p.getInputStream()) { - byte[] buf = new byte[8192]; - int n; - while ((n = ins.read(buf)) > 0) { - System.out.write(buf, 0, n); - } - } - if (p.waitFor() != 0) { - throw new Exception("Test failed"); - } + Proc p = Proc.create("EmptyCC").args(ccache, "readcc") + .env("KRB5CCNAME", ccache).start(); + p.waitFor(); } else { // Sub process, read the ccache String cc = System.getenv("KRB5CCNAME"); diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java index 1de0ab3bc54..0522226d987 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLEngineImpl/SSLEngineDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,15 +21,14 @@ * questions. */ +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + /* * @test * @bug 6492872 * @summary Deadlock in SSLEngine * @run main/othervm SSLEngineDeadlock - * - * SunJSSE does not support dynamic system properties, no way to re-use - * system properties in samevm/agentvm mode. - * * @author Brad R. Wetmore */ @@ -74,6 +73,7 @@ import javax.net.ssl.SSLEngineResult.*; import java.io.*; import java.security.*; import java.nio.*; +import java.lang.management.*; public class SSLEngineDeadlock { @@ -144,6 +144,8 @@ public class SSLEngineDeadlock { } SSLEngineDeadlock test = new SSLEngineDeadlock(); test.runTest(); + + detectDeadLock(); } System.out.println("Test Passed."); } @@ -360,6 +362,22 @@ public class SSLEngineDeadlock { b.limit(b.capacity()); } + /* + * Detect dead lock + */ + private static void detectDeadLock() throws Exception { + ThreadMXBean threadBean = ManagementFactory.getThreadMXBean(); + long[] threadIds = threadBean.findDeadlockedThreads(); + if (threadIds != null && threadIds.length != 0) { + for (long id : threadIds) { + ThreadInfo info = + threadBean.getThreadInfo(id, Integer.MAX_VALUE); + System.out.println("Deadlocked ThreadInfo: " + info); + } + throw new Exception("Found Deadlock!"); + } + } + /* * Logging code */ diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NoImpactServerRenego.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NoImpactServerRenego.java new file mode 100644 index 00000000000..ab23ce4239c --- /dev/null +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NoImpactServerRenego.java @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @bug 7188658 + * @summary Add possibility to disable client initiated renegotiation + * @run main/othervm + * -Djdk.tls.rejectClientInitiatedRenegotiation=true NoImpactServerRenego + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class NoImpactServerRenego implements + HandshakeCompletedListener { + + static byte handshakesCompleted = 0; + + /* + * Define what happens when handshaking is completed + */ + public void handshakeCompleted(HandshakeCompletedEvent event) { + synchronized (this) { + handshakesCompleted++; + System.out.println("Session: " + event.getSession().toString()); + System.out.println("Seen handshake completed #" + + handshakesCompleted); + } + } + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "../../../../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + sslSocket.addHandshakeCompletedListener(this); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + for (int i = 0; i < 10; i++) { + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + } + + System.out.println("invalidating"); + sslSocket.getSession().invalidate(); + System.out.println("starting new handshake"); + sslSocket.startHandshake(); + + for (int i = 0; i < 10; i++) { + System.out.println("sending/receiving data, iteration: " + i); + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + } + + sslSocket.close(); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + for (int i = 0; i < 10; i++) { + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + } + + for (int i = 0; i < 10; i++) { + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + } + + sslSocket.close(); + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + /* + * Start the tests. + */ + new NoImpactServerRenego(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + NoImpactServerRenego() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) { + System.out.print("Server Exception:"); + throw serverException; + } + if (clientException != null) { + System.out.print("Client Exception:"); + throw clientException; + } + + /* + * Give the Handshaker Thread a chance to run + */ + Thread.sleep(1000); + + synchronized (this) { + if (handshakesCompleted != 2) { + throw new Exception("Didn't see 2 handshake completed events."); + } + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } +} diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/RejectClientRenego.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/RejectClientRenego.java new file mode 100644 index 00000000000..01a7febca29 --- /dev/null +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/RejectClientRenego.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @bug 7188658 + * @summary Add possibility to disable client initiated renegotiation + * @run main/othervm RejectClientRenego true + * @run main/othervm RejectClientRenego false + */ + +import java.io.*; +import java.net.*; +import javax.net.ssl.*; + +public class RejectClientRenego implements + HandshakeCompletedListener { + + static byte handshakesCompleted = 0; + + /* + * Define what happens when handshaking is completed + */ + public void handshakeCompleted(HandshakeCompletedEvent event) { + synchronized (this) { + handshakesCompleted++; + System.out.println("Session: " + event.getSession().toString()); + System.out.println("Seen handshake completed #" + + handshakesCompleted); + } + } + + /* + * ============================================================= + * Set the various variables needed for the tests, then + * specify what tests to run on each side. + */ + + /* + * Should we run the client or server in a separate thread? + * Both sides can throw exceptions, but do you have a preference + * as to which side should be the main thread. + */ + static boolean separateServerThread = false; + + /* + * Where do we find the keystores? + */ + static String pathToStores = "../../../../../../../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + /* + * Is the server ready to serve? + */ + volatile static boolean serverReady = false; + + /* + * Turn on SSL debugging? + */ + static boolean debug = false; + + /* + * If the client or server is doing some kind of object creation + * that the other side depends on, and that thread prematurely + * exits, you may experience a hang. The test harness will + * terminate all hung threads after its timeout has expired, + * currently 3 minutes by default, but you might try to be + * smart about it.... + */ + + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf = + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + + serverPort = sslServerSocket.getLocalPort(); + + /* + * Signal Client, we're ready for his connect. + */ + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + sslSocket.addHandshakeCompletedListener(this); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + for (int i = 0; i < 10; i++) { + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + } + + try { + for (int i = 0; i < 10; i++) { + System.out.println("sending/receiving data, iteration: " + i); + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + } + throw new Exception("Not reject client initialized renegotiation"); + } catch (IOException ioe) { + System.out.println("Got the expected exception"); + } finally { + sslSocket.close(); + } + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + void doClientSide() throws Exception { + + /* + * Wait for server to get started. + */ + while (!serverReady) { + Thread.sleep(50); + } + + SSLSocketFactory sslsf = + (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + + for (int i = 0; i < 10; i++) { + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + } + + if (!isAbbreviated) { + System.out.println("invalidating"); + sslSocket.getSession().invalidate(); + } + System.out.println("starting new handshake"); + sslSocket.startHandshake(); + + try { + for (int i = 0; i < 10; i++) { + sslOS.write(280); + sslOS.flush(); + sslIS.read(); + } + throw new Exception("Not reject client initialized renegotiation"); + } catch (IOException ioe) { + System.out.println("Got the expected exception"); + } finally { + sslSocket.close(); + } + } + + /* + * ============================================================= + * The remainder is just support stuff + */ + + // use any free port by default + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + // Is it abbreviated handshake? + private static boolean isAbbreviated = false; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + // reject client initialized SSL renegotiation. + System.setProperty( + "jdk.tls.rejectClientInitiatedRenegotiation", "true"); + + if (debug) + System.setProperty("javax.net.debug", "all"); + + // Is it abbreviated handshake? + if ("true".equals(args[0])) { + isAbbreviated = true; + } + + /* + * Start the tests. + */ + new RejectClientRenego(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + RejectClientRenego() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) { + System.out.print("Server Exception:"); + throw serverException; + } + if (clientException != null) { + System.out.print("Client Exception:"); + throw clientException; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } +} diff --git a/jdk/test/sun/security/tools/policytool/Alias.sh b/jdk/test/sun/security/tools/policytool/Alias.sh index 4db8c09b42a..ae1e4082004 100644 --- a/jdk/test/sun/security/tools/policytool/Alias.sh +++ b/jdk/test/sun/security/tools/policytool/Alias.sh @@ -52,6 +52,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/ChangeUI.html b/jdk/test/sun/security/tools/policytool/ChangeUI.html index d025716ea03..da22d7b8cf8 100644 --- a/jdk/test/sun/security/tools/policytool/ChangeUI.html +++ b/jdk/test/sun/security/tools/policytool/ChangeUI.html @@ -17,7 +17,8 @@ reading these instructions.

        First, policytool will be invoked.

          -
        1. If testing on Windows, create a temporary directory. (Example: C:\foo\tmp) +
        2. Find (or create) a temporary directory that you have write access to. +(Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)
        3. Add new policy entry
        4. Add permission:
          @@ -63,9 +64,9 @@ First, policytool will be invoked.

        5. Confirm there are 2 entries in the permission list
        6. Press cancel
        7. Save as "/tmp/p"
          -If testing on Windows, save in the temporary directory created in Step 0. -(Example: Save as "C:\foo\tmp\p.policy") -
        8. Confirm that the file /tmp/p (or C:\foo\tmp\p.policy) looks like +(Or use the temporary directory mentioned in Step 0 if it's not '/tmp'. + For example, "C:\foo\tmp\p" on Windows) +
        9. Confirm that the file created in the previous step looks like
           /* AUTOMATICALLY GENERATED ON Tue Jul 19 16:27:30 CST 2005*/
           /* DO NOT EDIT */
          diff --git a/jdk/test/sun/security/tools/policytool/ChangeUI.sh b/jdk/test/sun/security/tools/policytool/ChangeUI.sh
          index 95e25af1227..1b6a7984087 100644
          --- a/jdk/test/sun/security/tools/policytool/ChangeUI.sh
          +++ b/jdk/test/sun/security/tools/policytool/ChangeUI.sh
          @@ -22,7 +22,7 @@
           #
           
           # @test
          -# @bug  6296772 6293981 6290216
          +# @bug  6296772 6293981 6290216 8015276
           # @summary FilePermission and DelegationPermission, and cancel button
           #
           # @run applet/manual=done ChangeUI.html
          @@ -51,6 +51,11 @@ case "$OS" in
               PS=":"
               FS="/"
               ;;
          +  CYGWIN* )
          +    NULL=/dev/null
          +    PS=";"
          +    FS="/"
          +    ;;
             Windows* )
               NULL=NUL
               PS=";"
          diff --git a/jdk/test/sun/security/tools/policytool/OpenPolicy.sh b/jdk/test/sun/security/tools/policytool/OpenPolicy.sh
          index 5aca3324661..325b817c3d2 100644
          --- a/jdk/test/sun/security/tools/policytool/OpenPolicy.sh
          +++ b/jdk/test/sun/security/tools/policytool/OpenPolicy.sh
          @@ -51,6 +51,11 @@ case "$OS" in
               PS=":"
               FS="/"
               ;;
          +  CYGWIN* )
          +    NULL=/dev/null
          +    PS=";"
          +    FS="/"
          +    ;;
             Windows* )
               NULL=NUL
               PS=";"
          diff --git a/jdk/test/sun/security/tools/policytool/SaveAs.sh b/jdk/test/sun/security/tools/policytool/SaveAs.sh
          index 661ebd99a3e..af18ad96c21 100644
          --- a/jdk/test/sun/security/tools/policytool/SaveAs.sh
          +++ b/jdk/test/sun/security/tools/policytool/SaveAs.sh
          @@ -52,6 +52,11 @@ case "$OS" in
               PS=":"
               FS="/"
               ;;
          +  CYGWIN* )
          +    NULL=/dev/null
          +    PS=";"
          +    FS="/"
          +    ;;
             Windows* )
               NULL=NUL
               PS=";"
          diff --git a/jdk/test/sun/security/tools/policytool/UpdatePermissions.html b/jdk/test/sun/security/tools/policytool/UpdatePermissions.html
          index 2a59b5908ae..31e6fcf7fc3 100644
          --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.html
          +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.html
          @@ -10,8 +10,8 @@ reading these instructions.

          First, policytool will be invoked.

          Then, follow these steps:
          -0) If testing on Windows, create a temporary directory. -(Example: C:\foo\tmp)

          +0) Find (or create) a temporary directory that you have write access to. +(Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)

          1) Click on the "Add Policy Entry" button in the main policytool window.

          @@ -32,13 +32,10 @@ select "Save As".

          8) In the SaveAs window, enter "/tmp/ptool.test" as the file name and click "OK".
          -If testing on Windows, use the temporary directory created in Step 0. -(Example: Save as "C:\foo\tmp\ptool.test")

          - -9) cat /tmp/ptool.test
          -If testing on Windows, check the contents of the file created in the previous -step.

          +(Or use the temporary directory mentioned in Step 0 if it's not '/tmp'. +For example, "C:\foo\tmp\ptool.test" on Windows)

          +9) Check the content of the file created in the previous step

          10) check to make sure that the new entry is in the policy file.

          @@ -53,8 +50,8 @@ step.

          In the confirmation dialog pop-up, click "OK".

          -Exit policytool. If testing on Windows, delete the temporary directory and its -contents created during this test.

          +Exit policytool. Delete the files created during this test. If the +temporary directory is also newly created, empty and delete it.

          Press "Pass" if ... press "Fail" otherwise.

          diff --git a/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh b/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh index eada9d734cd..05978a38b57 100644 --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh @@ -23,6 +23,7 @@ # @test # @bug 4218206 +# @bug 8015276 # @summary missing or invalid permission target names in policy tool # # @run applet/manual=done UpdatePermissions.html @@ -51,6 +52,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/UsePolicy.sh b/jdk/test/sun/security/tools/policytool/UsePolicy.sh index 3422f2cfc15..c8412389a3b 100644 --- a/jdk/test/sun/security/tools/policytool/UsePolicy.sh +++ b/jdk/test/sun/security/tools/policytool/UsePolicy.sh @@ -51,6 +51,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/i18n.html b/jdk/test/sun/security/tools/policytool/i18n.html index 6c70d24398c..b358c50d2d9 100644 --- a/jdk/test/sun/security/tools/policytool/i18n.html +++ b/jdk/test/sun/security/tools/policytool/i18n.html @@ -15,10 +15,15 @@ If at any time an exception is thrown, or if any message is incomprehensible, then the test failed. Otherwise, the test passed.

          +Preparation: Find (or create) a temporary directory that you have write +access to (Example: 'C:\tmp' on Windows or '/tmp' on other systems) and copy +the files "ks", "good", "bad" from the scratch sub-directory of this test's +working directory (the -w argument of jtreg) into the temporary directory. +If 'policy1' or 'policy2' already exists in this directory, remove it. +

          Press "Pass" if ... press "Fail" otherwise.

          -

            -
          1. If testing on Windows, create a temporary directory. (Example: C:\foo\tmp) +
            1. Pull down the 'File' and 'KeyStore' menus and check values
            2. Pull down 'File' menu and select 'View Warning Log'. Confirm FileNotFound.
            3. Pull down 'File' menu and select 'New'. @@ -46,65 +51,65 @@ Press "Pass" if ... press "Fail" otherwise.
            4. Select "play" from Target menu.
            5. Click OK, confirm changed permission.
            6. Type "hello" for 'CodeBase', click on 'Done', and check error message +
            7. Clean up the 'CodeBase' textbox
            8. Type "hello" for 'SignedBy', click on 'Done', and check warning message -
            9. Click, on 'Edit Policy Entry' and 'Remove Policy Entry' +
            10. Click on 'Edit Policy Entry' and 'Remove Policy Entry' and check error messages -
            11. Select policy entry, click on 'Edit Policy Entry', and check pop-up window +
            12. Select policy entry, click on 'Edit Policy Entry', check pop-up window and close it
            13. Select policy entry, click on 'Remove Policy Entry', and check pop-up window
            14. Do not remove the entry, click 'Cancel'.
            15. Pull down 'File' menu and select 'Exit'. Confirm Save option. Click 'Cancel'. -
            16. Select 'File' menu value 'Save' and enter "/tmp/policy1" as the filename.
              - If testing on Windows, use the temporary directory created in Step 0. - (Example: Save as "C:\foo\tmp\policy1")
              - Check status message. +
            17. Select 'File' menu value 'Save' and save into file "policy1" in the + temporary directory. Check status message.
            18. Select 'File' menu value 'New'
            19. Click 'Add Policy Entry', type in "hello" for 'SignedBy' field, click 'Done'. Confirm warning.
            20. Select 'File' menu value 'Open' and confirm save option - (do not save changes) -
            21. Type "/tmp/policy1" (if Windows, "C:\foo\tmp\policy1") for the filename - and confirm warning message
              + (Click 'Cancel', do not save changes)
            22. Pull down 'File' menu, select 'View Warning Log' and confirm KeyStore alias warning
            23. Pull down 'KeyStore' menu and select 'Edit' -
            24. Enter 'foo' as KeyStore URL and check error -
            25. Using keytool create JKS keystore -
            26. Enter KeyStore URL but leave other fields empty. Should succeed. +
            27. Enter 'foo' as KeyStore URL, click 'OK', and check error +
            28. Enter KeyStore URL "file:/tmp/ks" (Or use the temporary directory mentioned + in the preparation if it's not '/tmp'. For example, "file:/C:/tmp/ks" on Windows) + but leave other fields empty. Click 'OK'. Should succeed.
            29. Pull down 'KeyStore' menu and select 'Edit' -
            30. Confirm URL and Type values. -
            31. Enter 'foo' as the provider and check error message. -
            32. Enter 'SUN' as the provider. Should succeed. +
            33. Confirm URL and Type values. The Type should be "jks" +
            34. Enter 'foo' as the provider, click 'OK' and check error message. +
            35. Enter 'SUN' as the provider, click 'OK'. Should succeed.
            36. Pull down 'KeyStore' menu and select 'Edit'
            37. Confirm URL, Type, and Provider values. -
            38. Enter 'foo' as the password URL and check error message. -
            39. Enter URL with bad password and check error message. -
            40. Enter URL with good password. Should succeed. +
            41. Enter 'foo' as the password URL, click 'OK' and check error message. +
            42. Enter URL "file:/tmp/bad" (Or use the temporary directory mentioned in + the preparation if it's not '/tmp'. For example, "file:/C:/tmp/bad" on Windows), + click 'OK' and check error message. +
            43. Enter URL "file:/tmp/good" (Or use the temporary directory mentioned in + the preparation if it's not '/tmp'. For example, "file:/C:/tmp/good" on Windows) + and click 'OK'. Should succeed.
            44. Pull down 'KeyStore' menu and select 'Edit'
            45. Confirm URL, Type, Provider, and Password URL values.
            46. Click OK -
            47. Pull down 'File' menu and select 'Save As'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm status message.
              +
            48. Pull down 'File' menu and select 'Save As' and save into file "policy2" + in the temporary directory. Confirm status message.
            49. Pull down 'File' menu and select 'New'. -
            50. Pull down 'File' menu and select 'Open'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm warning message.
              +
            51. Pull down 'File' menu and select 'Open' and open "policy2" in the + temporary directory.
            52. Click on 'Add Policy Entry', enter Codebase 'http://foo', SignedBy 'bar'. Click on 'Done' and confirm alias warning.
            53. Double-Click on just created policy entry, confirm edit window appears. -
            54. Change SignedBy to an alias in previously created keystore. +
            55. Change SignedBy to an 'hello'.
            56. Click on Done and confirm it worked with no warning.
            57. Double-Click on "SignedBy hello" policy entry and confirm edit window appears.
            58. Click on Edit/Remove Principal, confirm errors.
            59. Click on 'Add Principal' and check new window.
            60. Click on 'OK' and confirm error message (no principal name) -
            61. Enter valid KeyStore alias as principal name, click OK and +
            62. Enter 'hello' as principal name, click OK and confirm status message.
            63. Confirm new principal in Principals list. -
            64. Click on 'Done' (creating policy entry), confirm alias warning. +
            65. Click on 'Done' (creating policy entry).
            66. View warning log and confirm X500Principal/KeyStore alias message.
            67. Confirm principal added to policy entry in main window listing.
            68. Double click on that entry. @@ -116,14 +121,14 @@ Press "Pass" if ... press "Fail" otherwise. Confirm name cleared. Type 'foo' as name. Click OK. Confirm error. type 'cn=foo' as name. Click OK. should succeed.
            69. Confirm changed principal in list. -
            70. Click on 'Add Permission', and add any FilePermission. -
            71. Click on 'Done' in Policy Entry window. Confirm alias warning. +
            72. Click on 'Add Permission', and add a FilePermission, choose a target and + an action. Click OK. +
            73. Click on 'Done' in Policy Entry window.
            74. Confirm entries in main window listing.
            75. Select 'File' menu value 'Exit'
            76. Save Changes, confirm status message. -
            77. If testing on Windows, delete the temporary directory and its contents - created during this test. -
            +
          2. Delete all files created during this test. If the temporary directory + is also newly created, empty and delete it.

          diff --git a/jdk/test/sun/security/tools/policytool/i18n.sh b/jdk/test/sun/security/tools/policytool/i18n.sh index 8537d48c708..58b59e060b2 100644 --- a/jdk/test/sun/security/tools/policytool/i18n.sh +++ b/jdk/test/sun/security/tools/policytool/i18n.sh @@ -23,10 +23,13 @@ # @test # @bug 4348370 +# @bug 8015274 +# @bug 8015276 +# @bug 8016158 # @summary policytool not i18n compliant # # @run applet/manual=done i18n.html -# @run shell i18n.sh +# @run shell/timeout=1200 i18n.sh # @run applet/manual=yesno i18n.html # set a few environment variables so that the shell-script can run stand-alone @@ -51,6 +54,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" @@ -66,6 +74,19 @@ esac echo "HELLO!" +echo "Checking for $HOME/.java.policy" + +# 8015274 +if [ -e $HOME/.java.policy ]; then + echo "You have a .java.policy file in your HOME directory" + echo "The file must be removed before running this test" + exit 1 +fi + +${TESTJAVA}${FS}bin${FS}keytool -genkeypair -alias hello -dname CN=Hello \ + -storepass changeit -keypass changeit -keystore ks +echo changeit > good +echo badpass > bad ${TESTJAVA}${FS}bin${FS}policytool exit $? diff --git a/jdk/test/sun/text/resources/LocaleData b/jdk/test/sun/text/resources/LocaleData index 7d95a57d7ba..4bcb9739295 100644 --- a/jdk/test/sun/text/resources/LocaleData +++ b/jdk/test/sun/text/resources/LocaleData @@ -11,7 +11,7 @@ LocaleNames//es=Spanish # bug #4052679 LocaleNames/fr/fr=fran\u00e7ais -# bug #4055602, 4290801 +# bug #4055602, 4290801, 8013836 CurrencyNames/pt_BR/BRL=R$ FormatData/pt_BR/NumberPatterns/0=#,##0.###;-#,##0.### # FormatData/pt_BR/NumberPatterns/1=R$ #,##0.##;-R$ #,##0.## # Changed; see bug 4122840 @@ -28,16 +28,13 @@ FormatData/pt_BR/DateTimePatterns/0={1} {0} FormatData/pt_BR/NumberElements/0=, FormatData/pt_BR/NumberElements/1=. FormatData/pt_BR/NumberElements/2=; -FormatData/pt_BR/MonthAbbreviations/0=Jan -FormatData/pt_BR/MonthAbbreviations/1=Fev -FormatData/pt_BR/MonthAbbreviations/2=Mar FormatData/pt_BR/DayAbbreviations/0=Dom FormatData/pt_BR/DayAbbreviations/1=Seg FormatData/pt_BR/DayAbbreviations/2=Ter FormatData/pt_BR/DayNames/0=Domingo FormatData/pt_BR/DayNames/1=Segunda-feira FormatData/pt_BR/DayNames/2=Ter\u00e7a-feira -CalendarData/pt_BR/firstDayOfWeek=2 +CalendarData/pt_BR/firstDayOfWeek=1 CalendarData/pt_BR/minimalDaysInFirstWeek=1 FormatData/pt_BR/MonthNames/0=Janeiro FormatData/pt_BR/MonthNames/1=Fevereiro @@ -7667,3 +7664,18 @@ LocaleNames/sq/sq=shqip # bug 7074882 FormatData/mt/MonthNames/7=Awwissu FormatData/mt/MonthAbbreviations/7=Aww + +# bug 7040556 +FormatData/pt/MonthAbbreviations/0=jan +FormatData/pt/MonthAbbreviations/1=fev +FormatData/pt/MonthAbbreviations/2=mar +FormatData/pt/MonthAbbreviations/3=abr +FormatData/pt/MonthAbbreviations/4=mai +FormatData/pt/MonthAbbreviations/5=jun +FormatData/pt/MonthAbbreviations/6=jul +FormatData/pt/MonthAbbreviations/7=ago +FormatData/pt/MonthAbbreviations/8=set +FormatData/pt/MonthAbbreviations/9=out +FormatData/pt/MonthAbbreviations/10=nov +FormatData/pt/MonthAbbreviations/11=dez + diff --git a/jdk/test/sun/text/resources/LocaleDataTest.java b/jdk/test/sun/text/resources/LocaleDataTest.java index ca5d7fee153..961fcf52be1 100644 --- a/jdk/test/sun/text/resources/LocaleDataTest.java +++ b/jdk/test/sun/text/resources/LocaleDataTest.java @@ -35,7 +35,7 @@ * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787 * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495 * 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509 - * 7114053 7074882 + * 7114053 7074882 7040556 8013836 * @summary Verify locale data * */ diff --git a/jdk/test/sun/tools/jcmd/jcmd_Output1.awk b/jdk/test/sun/tools/jcmd/jcmd_Output1.awk index 986951dc178..5bf0403fa2d 100644 --- a/jdk/test/sun/tools/jcmd/jcmd_Output1.awk +++ b/jdk/test/sun/tools/jcmd/jcmd_Output1.awk @@ -8,10 +8,10 @@ BEGIN { current=1; } -# or match on a path name to a jar file followed by arbitraty arguments +# or match on a path name to a jar or war file followed by arbitraty arguments # - note, jar files ending with ".jar" is only a convention, not a requirement. #Theoretically, any valid file name could occur here. -/^[0-9]+ .*\.jar($| .*$)/ { +/^[0-9]+ .*\.(jar|war)($| .*$)/ { current=1; } diff --git a/jdk/test/sun/tools/jps/jps-l_Output1.awk b/jdk/test/sun/tools/jps/jps-l_Output1.awk index 5280197ed6b..08a48c17659 100644 --- a/jdk/test/sun/tools/jps/jps-l_Output1.awk +++ b/jdk/test/sun/tools/jps/jps-l_Output1.awk @@ -8,10 +8,10 @@ BEGIN { matched++; } -# or match on a jar file name - note, jar files ending with +# or match on a jar or war file name - note, jar files ending with # ".jar" is only a convention , not a requirement. Theoretically, # any valid file name could occur here. -/^[0-9]+ .*\.jar$/ { +/^[0-9]+ .*\.(jar|war)$/ { matched++; } diff --git a/jdk/test/sun/tools/jps/jps_Output1.awk b/jdk/test/sun/tools/jps/jps_Output1.awk index 1781bc560e3..c64b0f104f5 100644 --- a/jdk/test/sun/tools/jps/jps_Output1.awk +++ b/jdk/test/sun/tools/jps/jps_Output1.awk @@ -8,10 +8,10 @@ BEGIN { matched++; } -# or match on a path name to a jar file - note, jar files ending with +# or match on a path name to a jar or war file - note, jar files ending with # ".jar" is only a convention, not a requirement. Theoretically, # any valid file name could occur here. -/^[0-9]+ .*\.jar$/ { +/^[0-9]+ .*\.(jar|war)$/ { matched++; } diff --git a/jdk/test/tools/launcher/VersionCheck.java b/jdk/test/tools/launcher/VersionCheck.java index 64f0e6adfb8..7373ac5cb29 100644 --- a/jdk/test/tools/launcher/VersionCheck.java +++ b/jdk/test/tools/launcher/VersionCheck.java @@ -49,6 +49,7 @@ public class VersionCheck extends TestHelper { "javaw", "javaws", "jcontrol", + "jmc", "jvisualvm", "packager", "unpack200", @@ -72,6 +73,7 @@ public class VersionCheck extends TestHelper { "jdeps", "jinfo", "jmap", + "jmc", "jps", "jrunscript", "jjs", diff --git a/jdk/test/tools/pack200/AttributeTests.java b/jdk/test/tools/pack200/AttributeTests.java index bcf4c7c9282..09b9986175c 100644 --- a/jdk/test/tools/pack200/AttributeTests.java +++ b/jdk/test/tools/pack200/AttributeTests.java @@ -37,6 +37,7 @@ public class AttributeTests { public static void main(String... args) throws Exception { test6746111(); testMethodParameters(); + Utils.cleanup(); } /* diff --git a/jdk/test/tools/pack200/BandIntegrity.java b/jdk/test/tools/pack200/BandIntegrity.java index 1145972267f..2a59f3b8c13 100644 --- a/jdk/test/tools/pack200/BandIntegrity.java +++ b/jdk/test/tools/pack200/BandIntegrity.java @@ -40,7 +40,7 @@ import java.util.List; * the java packer and unpacker must be called in the same java instance. */ public class BandIntegrity { - public static void main(String... args) throws IOException { + public static void main(String... args) throws IOException { File testFile = new File("test.jar"); Utils.jar("cvf", testFile.getName(), "-C", Utils.TEST_CLS_DIR.getAbsolutePath(), @@ -56,6 +56,7 @@ public class BandIntegrity { Utils.createFile(configFile, scratch); File outFile = new File("out.jar"); Utils.repack(testFile, outFile, true, - "-v", "--config-file=" + configFile.getName()); + "-v", "--config-file=" + configFile.getName()); + Utils.cleanup(); } } diff --git a/jdk/test/tools/pack200/CommandLineTests.java b/jdk/test/tools/pack200/CommandLineTests.java index 4e0c8b1e003..2a53b309046 100644 --- a/jdk/test/tools/pack200/CommandLineTests.java +++ b/jdk/test/tools/pack200/CommandLineTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,6 +83,11 @@ public class CommandLineTests { Utils.recursiveCopy(Utils.JavaSDK, EXP_SDK); creatConfigFile(); } + // cleanup the test area + static void cleanup() throws IOException { + Utils.recursiveDelete(EXP_SDK); + Utils.cleanup(); + } // Hopefully, this should be kept in sync with what the installer does. static void creatConfigFile() throws IOException { @@ -172,6 +177,7 @@ public class CommandLineTests { init(); testJRE(); testJDK(); + cleanup(); // cleanup only if we pass successfully } catch (IOException ioe) { throw new RuntimeException(ioe); } diff --git a/jdk/test/tools/pack200/InstructionTests.java b/jdk/test/tools/pack200/InstructionTests.java index 171fe4ee88a..569b7a0acb0 100644 --- a/jdk/test/tools/pack200/InstructionTests.java +++ b/jdk/test/tools/pack200/InstructionTests.java @@ -35,6 +35,7 @@ import java.util.List; public class InstructionTests { public static void main(String... args) throws Exception { testInvokeOpCodes(); + Utils.cleanup(); } /* * the following should produce invokestatic and invokespecial diff --git a/jdk/test/tools/pack200/Pack200Props.java b/jdk/test/tools/pack200/Pack200Props.java index 61b718ea9d9..50fb0b14743 100644 --- a/jdk/test/tools/pack200/Pack200Props.java +++ b/jdk/test/tools/pack200/Pack200Props.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ */ import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -45,11 +46,12 @@ import java.util.jar.Pack200.Packer; public class Pack200Props { - public static void main(String... args) { + public static void main(String... args) throws IOException { verifyDefaults(); File out = new File("test" + Utils.PACK_FILE_EXT); out.delete(); verifySegmentLimit(out); + Utils.cleanup(); } static void verifySegmentLimit(File outFile) { diff --git a/jdk/test/tools/pack200/Pack200Test.java b/jdk/test/tools/pack200/Pack200Test.java index d897bf86824..b4226f2845a 100644 --- a/jdk/test/tools/pack200/Pack200Test.java +++ b/jdk/test/tools/pack200/Pack200Test.java @@ -66,7 +66,7 @@ public class Pack200Test { } } - private static void doPackUnpack() { + private static void doPackUnpack() throws IOException { for (File in : jarList) { JarOutputStream javaUnpackerStream = null; JarOutputStream nativeUnpackerStream = null; @@ -117,12 +117,13 @@ public class Pack200Test { Utils.close((Closeable) jarFile); } } + Utils.cleanup(); // cleanup artifacts, if successful run } /** * @param args the command line arguments */ - public static void main(String[] args) { + public static void main(String[] args) throws IOException { // select the jars carefully, adding more jars will increase the // testing time, especially for jprt. jarList.add(Utils.locateJar("tools.jar")); diff --git a/jdk/test/tools/pack200/PackageVersionTest.java b/jdk/test/tools/pack200/PackageVersionTest.java index fe6d5d9cb59..dc109b8a391 100644 --- a/jdk/test/tools/pack200/PackageVersionTest.java +++ b/jdk/test/tools/pack200/PackageVersionTest.java @@ -1,6 +1,5 @@ - /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +53,7 @@ public class PackageVersionTest { public final static int JAVA7_PACKAGE_MAJOR_VERSION = 170; public final static int JAVA7_PACKAGE_MINOR_VERSION = 1; - public static void main(String... args) { + public static void main(String... args) throws IOException { if (!javaHome.getName().endsWith("jre")) { throw new RuntimeException("Error: requires an SDK to run"); } @@ -78,6 +77,7 @@ public class PackageVersionTest { // test for resource file, ie. no class files verifyPack("Test6.java", JAVA5_PACKAGE_MAJOR_VERSION, JAVA5_PACKAGE_MINOR_VERSION); + Utils.cleanup(); } static void verify6991164() { diff --git a/jdk/test/tools/pack200/RepackTest.java b/jdk/test/tools/pack200/RepackTest.java index 774e0d66eb3..8a3d86e7c94 100644 --- a/jdk/test/tools/pack200/RepackTest.java +++ b/jdk/test/tools/pack200/RepackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ public class RepackTest { public static void main(String... args) throws Exception { testRepack(); + Utils.cleanup(); } /* diff --git a/jdk/test/tools/pack200/T7007157.java b/jdk/test/tools/pack200/T7007157.java index 72f8792c22b..29a8ca7fc1f 100644 --- a/jdk/test/tools/pack200/T7007157.java +++ b/jdk/test/tools/pack200/T7007157.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,5 +63,6 @@ public class T7007157 { Utils.close(fos); Utils.close(jarFile); } + Utils.cleanup(); } } diff --git a/jdk/test/tools/pack200/TestExceptions.java b/jdk/test/tools/pack200/TestExceptions.java index 0778cf5c7e1..1b6f39a78cc 100644 --- a/jdk/test/tools/pack200/TestExceptions.java +++ b/jdk/test/tools/pack200/TestExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,12 +219,13 @@ public class TestExceptions { } } - public static void main(String... args) { + public static void main(String... args) throws IOException { init(); pack200Test1(); pack200Test2(); pack200Test3(); unpack200Test1(); + Utils.cleanup(); } // containers for test inputs and management diff --git a/jdk/test/tools/pack200/TimeStamp.java b/jdk/test/tools/pack200/TimeStamp.java index 8dfc2d9bc2e..acce4624aab 100644 --- a/jdk/test/tools/pack200/TimeStamp.java +++ b/jdk/test/tools/pack200/TimeStamp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -149,6 +149,7 @@ public class TimeStamp { Utils.close(jf1); Utils.close(jf2); } + Utils.cleanup(); if (errors > 0) { throw new RuntimeException("FAIL:" + errors + " error(s) encounted"); } diff --git a/jdk/test/tools/pack200/UnpackerMemoryTest.java b/jdk/test/tools/pack200/UnpackerMemoryTest.java index fc63d154f90..ec8ffb6a402 100644 --- a/jdk/test/tools/pack200/UnpackerMemoryTest.java +++ b/jdk/test/tools/pack200/UnpackerMemoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ public class UnpackerMemoryTest { Utils.close(fos); } } + Utils.cleanup(); } } diff --git a/jdk/test/tools/pack200/Utils.java b/jdk/test/tools/pack200/Utils.java index df3426431d4..b1bc2f894b1 100644 --- a/jdk/test/tools/pack200/Utils.java +++ b/jdk/test/tools/pack200/Utils.java @@ -75,6 +75,7 @@ class Utils { static final File TEST_CLS_DIR = new File(System.getProperty("test.classes")); static final String VERIFIER_DIR_NAME = "pack200-verifier"; static final File VerifierJar = new File(VERIFIER_DIR_NAME + JAR_FILE_EXT); + static final File XCLASSES = new File("xclasses"); private Utils() {} // all static @@ -95,8 +96,7 @@ class Utils { } List javaFileList = findFiles(srcDir, createFilter(JAVA_FILE_EXT)); File tmpFile = File.createTempFile("javac", ".tmp"); - File classesDir = new File("xclasses"); - classesDir.mkdirs(); + XCLASSES.mkdirs(); FileOutputStream fos = null; PrintStream ps = null; try { @@ -111,14 +111,14 @@ class Utils { } compiler("-d", - "xclasses", + XCLASSES.getName(), "@" + tmpFile.getAbsolutePath()); jar("cvfe", VerifierJar.getName(), "sun.tools.pack.verify.Main", "-C", - "xclasses", + XCLASSES.getName(), "."); } @@ -175,6 +175,33 @@ class Utils { }; } + /* + * clean up all the usual suspects + */ + static void cleanup() throws IOException { + recursiveDelete(XCLASSES); + List toDelete = new ArrayList<>(); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".out"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".bak"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".jar"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".pack"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".bnd"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".txt"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".idx"))); + toDelete.addAll(Utils.findFiles(new File("."), + Utils.createFilter(".gidx"))); + for (File f : toDelete) { + f.delete(); + } + } + static final FileFilter DIR_FILTER = new FileFilter() { public boolean accept(File pathname) { if (pathname.isDirectory()) { @@ -199,6 +226,9 @@ class Utils { Files.createDirectories(parent); } Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING); + if (dst.isDirectory() && !dst.canWrite()) { + dst.setWritable(true); + } } static String baseName(File file, String extension) { diff --git a/jdk/test/tools/pack200/typeannos/TestTypeAnnotations.java b/jdk/test/tools/pack200/typeannos/TestTypeAnnotations.java index 598185aaabc..f00801b5b14 100644 --- a/jdk/test/tools/pack200/typeannos/TestTypeAnnotations.java +++ b/jdk/test/tools/pack200/typeannos/TestTypeAnnotations.java @@ -41,5 +41,6 @@ public class TestTypeAnnotations { "-C", Utils.TEST_CLS_DIR.getAbsolutePath(), "."); Utils.testWithRepack(testFile, "--unknown-attribute=error"); + Utils.cleanup(); } } diff --git a/langtools/.hgtags b/langtools/.hgtags index 64eada69c78..d8403722780 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -216,3 +216,6 @@ e19283cd30a43fca94d8f7639c73ef66db493b1e jdk8-b90 149890642a0ed5138a4f16fe08ddbfeb8f8a1cb4 jdk8-b92 2c5a568ee36eb2d9471483b7a310c49ed545db55 jdk8-b93 48c6e6ab7c815fd41d747f0218f8041c22f3a460 jdk8-b94 +4cb1136231275a1f8af53f5bfdef0b488e4b5bab jdk8-b95 +988aef3a8c3adac482363293f65e77ec4c5ce98d jdk8-b96 +6a11a81a8824c17f6cd2ec8f8492e1229b694e96 jdk8-b97 diff --git a/langtools/make/build.properties b/langtools/make/build.properties index 7fd5ffcb371..d16be20b724 100644 --- a/langtools/make/build.properties +++ b/langtools/make/build.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ boot.javac.target = 7 target.java = ${target.java.home}/bin/java # Version info -- override as needed -jdk.version = 1.7.0 +jdk.version = 1.8.0 build.number = b00 milestone = internal @@ -60,8 +60,8 @@ full.version = ${release}-${build.number} bootstrap.full.version = ${bootstrap.release}-${build.number} # options for the tasks used to compile the tools -javac.source = 7 -javac.target = 7 +javac.source = 8 +javac.target = 8 javac.debug = true javac.debuglevel = source,lines javac.no.jdk.warnings = -XDignore.symbol.file=true diff --git a/langtools/src/share/classes/com/sun/javadoc/Tag.java b/langtools/src/share/classes/com/sun/javadoc/Tag.java index 2e129f50505..1d8c5907be2 100644 --- a/langtools/src/share/classes/com/sun/javadoc/Tag.java +++ b/langtools/src/share/classes/com/sun/javadoc/Tag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,36 +54,44 @@ public interface Tag { * {@link}, the curly brackets * are not part of the name, so in this example the name * would be simply @link. + * + * @return the name of this tag */ String name(); /** * Return the containing {@link Doc} of this Tag element. + * + * @return the containing {@link Doc} of this Tag element */ Doc holder(); /** * Return the kind of this tag. - * similar or synonymous tags. For most tags, + * For most tags, * kind() == name(); * the following table lists those cases where there is more * than one tag of a given kind: *

          - * - * - * - * - * - * - * - * - * + *
          kind() name()
          @throws @throws
          @throws @exception
          @see @see
          @see @link
          @see @linkplain
          @serial @serial
          @serial @serialData
          + * + * + * + * + * + * + * + * *
          {@code kind() } {@code name() }
          {@code @throws } {@code @throws }
          {@code @throws } {@code @exception }
          {@code @see } {@code @see }
          {@code @see } {@code @link }
          {@code @see } {@code @linkplain }
          {@code @serial } {@code @serial }
          {@code @serial } {@code @serialData }
          + * + * @return the kind of this tag. */ String kind(); /** - * Return the text of this tag, that is, portion beyond tag name. + * Return the text of this tag, that is, the portion beyond tag name. + * + * @return the text of this tag */ String text(); diff --git a/langtools/src/share/classes/com/sun/source/util/TreePath.java b/langtools/src/share/classes/com/sun/source/util/TreePath.java index d7df6a96b03..1d23b08fde6 100644 --- a/langtools/src/share/classes/com/sun/source/util/TreePath.java +++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java @@ -125,18 +125,25 @@ public class TreePath implements Iterable { return parent; } + /** + * Iterates from leaves to root. + */ + @Override public Iterator iterator() { return new Iterator() { + @Override public boolean hasNext() { return next != null; } + @Override public Tree next() { Tree t = next.leaf; next = next.parent; return t; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java index 3f854395f9b..dc4fc9d0137 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java @@ -77,10 +77,12 @@ public abstract class Attribute { public Attribute createAttribute(ClassReader cr, int name_index, byte[] data) throws IOException { - if (standardAttributes == null) + if (standardAttributes == null) { init(); + } ConstantPool cp = cr.getConstantPool(); + String reasonForDefaultAttr; try { String name = cp.getUTF8Value(name_index); Class attrClass = standardAttributes.get(name); @@ -90,14 +92,18 @@ public abstract class Attribute { Constructor constr = attrClass.getDeclaredConstructor(constrArgTypes); return constr.newInstance(new Object[] { cr, name_index, data.length }); } catch (Throwable t) { + reasonForDefaultAttr = t.toString(); // fall through and use DefaultAttribute // t.printStackTrace(); } + } else { + reasonForDefaultAttr = "unknown attribute"; } } catch (ConstantPoolException e) { + reasonForDefaultAttr = e.toString(); // fall through and use DefaultAttribute } - return new DefaultAttribute(cr, name_index, data); + return new DefaultAttribute(cr, name_index, data, reasonForDefaultAttr); } protected void init() { diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java b/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java index e8b5fc8d85a..52aefca5469 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java @@ -26,9 +26,9 @@ package com.sun.tools.classfile; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; import java.nio.file.Path; import static com.sun.tools.classfile.AccessFlags.*; @@ -44,26 +44,24 @@ import static com.sun.tools.classfile.AccessFlags.*; public class ClassFile { public static ClassFile read(File file) throws IOException, ConstantPoolException { - return read(file, new Attribute.Factory()); + return read(file.toPath(), new Attribute.Factory()); } - public static ClassFile read(Path path) + public static ClassFile read(Path input) throws IOException, ConstantPoolException { - return read(path.toFile(), new Attribute.Factory()); + return read(input, new Attribute.Factory()); + } + + public static ClassFile read(Path input, Attribute.Factory attributeFactory) + throws IOException, ConstantPoolException { + try (InputStream in = Files.newInputStream(input)) { + return new ClassFile(in, attributeFactory); + } } public static ClassFile read(File file, Attribute.Factory attributeFactory) throws IOException, ConstantPoolException { - FileInputStream in = new FileInputStream(file); - try { - return new ClassFile(in, attributeFactory); - } finally { - try { - in.close(); - } catch (IOException e) { - // ignore - } - } + return read(file.toPath(), attributeFactory); } public static ClassFile read(InputStream in) diff --git a/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java b/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java index fba1700f35e..16fdeb9824d 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,13 +33,24 @@ package com.sun.tools.classfile; */ public class DefaultAttribute extends Attribute { DefaultAttribute(ClassReader cr, int name_index, byte[] data) { + this(cr, name_index, data, null); + } + + DefaultAttribute(ClassReader cr, int name_index, byte[] data, String reason) { super(name_index, data.length); info = data; + this.reason = reason; } public DefaultAttribute(ConstantPool constant_pool, int name_index, byte[] info) { + this(constant_pool, name_index, info, null); + } + + public DefaultAttribute(ConstantPool constant_pool, int name_index, + byte[] info, String reason) { super(name_index, info.length); this.info = info; + this.reason = reason; } public R accept(Visitor visitor, P p) { @@ -47,4 +58,7 @@ public class DefaultAttribute extends Attribute { } public final byte[] info; + /** Why did we need to generate a DefaultAttribute + */ + public final String reason; } diff --git a/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java index ba1f2aa870f..6744500f1c2 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ package com.sun.tools.classfile; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; +import java.nio.charset.Charset; /** * See JVMS, section 4.8.15. @@ -38,6 +39,8 @@ import java.io.IOException; * deletion without notice. */ public class SourceDebugExtension_attribute extends Attribute { + private static final Charset UTF8 = Charset.forName("UTF-8"); + SourceDebugExtension_attribute(ClassReader cr, int name_index, int length) throws IOException { super(name_index, length); debug_extension = new byte[attribute_length]; @@ -55,12 +58,7 @@ public class SourceDebugExtension_attribute extends Attribute { } public String getValue() { - DataInputStream d = new DataInputStream(new ByteArrayInputStream(debug_extension)); - try { - return d.readUTF(); - } catch (IOException e) { - return null; - } + return new String(debug_extension, UTF8); } public R accept(Visitor visitor, D data) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java index 6fe85c0ee6d..5369733893b 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java @@ -311,8 +311,42 @@ public class HtmlWriter { " targetPage = \"\" + window.location.search;" + DocletConstants.NL + " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + " targetPage = targetPage.substring(1);" + DocletConstants.NL + - " if (targetPage.indexOf(\":\") != -1)" + DocletConstants.NL + + " if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL + " targetPage = \"undefined\";" + DocletConstants.NL + + " function validURL(url) {" + DocletConstants.NL + + " var pos = url.indexOf(\".html\");" + DocletConstants.NL + + " if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL + + " return false;" + DocletConstants.NL + + " var allowNumber = false;" + DocletConstants.NL + + " var allowSep = false;" + DocletConstants.NL + + " var seenDot = false;" + DocletConstants.NL + + " for (var i = 0; i < url.length - 5; i++) {" + DocletConstants.NL + + " var ch = url.charAt(i);" + DocletConstants.NL + + " if ('a' <= ch && ch <= 'z' ||" + DocletConstants.NL + + " 'A' <= ch && ch <= 'Z' ||" + DocletConstants.NL + + " ch == '$' ||" + DocletConstants.NL + + " ch == '_') {" + DocletConstants.NL + + " allowNumber = true;" + DocletConstants.NL + + " allowSep = true;" + DocletConstants.NL + + " } else if ('0' <= ch && ch <= '9'" + DocletConstants.NL + + " || ch == '-') {" + DocletConstants.NL + + " if (!allowNumber)" + DocletConstants.NL + + " return false;" + DocletConstants.NL + + " } else if (ch == '/' || ch == '.') {" + DocletConstants.NL + + " if (!allowSep)" + DocletConstants.NL + + " return false;" + DocletConstants.NL + + " allowNumber = false;" + DocletConstants.NL + + " allowSep = false;" + DocletConstants.NL + + " if (ch == '.')" + DocletConstants.NL + + " seenDot = true;" + DocletConstants.NL + + " if (ch == '/' && seenDot)" + DocletConstants.NL + + " return false;" + DocletConstants.NL + + " } else {" + DocletConstants.NL + + " return false;"+ DocletConstants.NL + + " }" + DocletConstants.NL + + " }" + DocletConstants.NL + + " return true;" + DocletConstants.NL + + " }" + DocletConstants.NL + " function loadFrames() {" + DocletConstants.NL + " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + " top.classFrame.location = top.targetPage;" + DocletConstants.NL + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties index fc635cc7d32..373b5334c42 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties @@ -4,7 +4,9 @@ doclet.Overview=\u6982\u8981 doclet.Window_Overview=\u6982\u8981\u30EA\u30B9\u30C8 doclet.Window_Overview_Summary=\u6982\u8981 doclet.Package=\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.Profile=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB doclet.All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.All_Profiles=\u3059\u3079\u3066\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB doclet.Tree=\u968E\u5C64\u30C4\u30EA\u30FC doclet.Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64 doclet.Window_Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64 @@ -17,6 +19,8 @@ doclet.Prev_Class=\u524D\u306E\u30AF\u30E9\u30B9 doclet.Next_Class=\u6B21\u306E\u30AF\u30E9\u30B9 doclet.Prev_Package=\u524D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 doclet.Next_Package=\u6B21\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.Prev_Profile=\u524D\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB +doclet.Next_Profile=\u6B21\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB doclet.Prev_Letter=\u524D\u306E\u6587\u5B57 doclet.Next_Letter=\u6B21\u306E\u6587\u5B57 doclet.Href_Class_Title={0}\u5185\u306E\u30AF\u30E9\u30B9 @@ -32,6 +36,7 @@ doclet.navAnnotationTypeOptionalMember=\u30AA\u30D7\u30B7\u30E7\u30F3 doclet.navAnnotationTypeRequiredMember=\u5FC5\u9808 doclet.navAnnotationTypeMember=\u8981\u7D20 doclet.navField=\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.navProperty=\u30D7\u30ED\u30D1\u30C6\u30A3 doclet.navEnum=\u5217\u6319\u578B\u5B9A\u6570 doclet.navConstructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.navMethod=\u30E1\u30BD\u30C3\u30C9 @@ -40,6 +45,7 @@ doclet.Window_Single_Index=\u7D22\u5F15 doclet.Window_Split_Index={0}\u306E\u7D22\u5F15 doclet.Help=\u30D8\u30EB\u30D7 doclet.Skip_navigation_links=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30F3\u30AF\u3092\u30B9\u30AD\u30C3\u30D7 +doclet.Navigation=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3 doclet.New_Page=NewPage doclet.navDeprecated=\u975E\u63A8\u5968 doclet.Window_Deprecated_List=\u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8 @@ -126,7 +132,7 @@ doclet.Help_line_13=\u5404\u6982\u8981\u30A8\u30F3\u30C8\u30EA\u306B\u306F\u3001 doclet.Help_line_14=\u4F7F\u7528 doclet.Help_line_15=\u5404\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u306F\u305D\u308C\u305E\u308C\u300C\u4F7F\u7528\u300D\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F\u3001\u3069\u306E\u3088\u3046\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u3001\u30E1\u30BD\u30C3\u30C9\u3001\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3001\u7279\u5B9A\u306E\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4E00\u90E8\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u304B\u304C\u8A18\u8FF0\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u305F\u3068\u3048\u3070\u3001\u30AF\u30E9\u30B9A\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9A\u306E\u5834\u5408\u3001\u305D\u306E\u300C\u4F7F\u7528\u300D\u30DA\u30FC\u30B8\u306B\u306F\u3001A\u306E\u30B5\u30D6\u30AF\u30E9\u30B9\u3001A\u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3001A\u3092\u8FD4\u3059\u30E1\u30BD\u30C3\u30C9\u3068\u3001\u578BA\u3092\u6301\u3064\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u542B\u307E\u308C\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u306B\u306F\u3001\u307E\u305A\u305D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u79FB\u52D5\u3057\u3001\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306E\u300C\u4F7F\u7528\u300D\u30EA\u30F3\u30AF\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002 doclet.Help_line_16=\u968E\u5C64\u30C4\u30EA\u30FC(\u30AF\u30E9\u30B9\u968E\u5C64) -doclet.Help_line_17_with_tree_link=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F{0}\u30DA\u30FC\u30B8\u304C\u3042\u308A\u3001\u3055\u3089\u306B\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u968E\u5C64\u30DA\u30FC\u30B8\u306F\u3001\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3092\u542B\u307F\u307E\u3059\u3002\u30AF\u30E9\u30B9\u306F java.lang.Object \u3092\u958B\u59CB\u70B9\u3068\u3059\u308B\u7D99\u627F\u69CB\u9020\u3067\u7DE8\u6210\u3055\u308C\u307E\u3059\u3002\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u3001java.lang.Object \u304B\u3089\u306F\u7D99\u627F\u3057\u307E\u305B\u3093\u3002 +doclet.Help_line_17_with_tree_link=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F{0}\u30DA\u30FC\u30B8\u304C\u3042\u308A\u3001\u3055\u3089\u306B\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u968E\u5C64\u30DA\u30FC\u30B8\u306F\u3001\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3092\u542B\u307F\u307E\u3059\u3002\u30AF\u30E9\u30B9\u306F{1}\u3092\u958B\u59CB\u70B9\u3068\u3059\u308B\u7D99\u627F\u69CB\u9020\u3067\u7DE8\u6210\u3055\u308C\u307E\u3059\u3002\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u3001{1}\u304B\u3089\u306F\u7D99\u627F\u3057\u307E\u305B\u3093\u3002 doclet.Help_line_18=\u6982\u8981\u30DA\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 doclet.Help_line_19=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u8A72\u5F53\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u307F\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 doclet.Help_line_20_with_deprecated_api_link={0}\u30DA\u30FC\u30B8\u306F\u3001\u975E\u63A8\u5968\u306EAPI\u3092\u3059\u3079\u3066\u30EA\u30B9\u30C8\u3057\u307E\u3059\u3002\u975E\u63A8\u5968\u306EAPI\u3068\u306F\u3001\u6A5F\u80FD\u6539\u826F\u306A\u3069\u306E\u7406\u7531\u304B\u3089\u4F7F\u7528\u3092\u304A\u85A6\u3081\u3067\u304D\u306A\u304F\u306A\u3063\u305FAPI\u306E\u3053\u3068\u3067\u3001\u901A\u5E38\u306F\u305D\u308C\u306B\u4EE3\u308F\u308BAPI\u304C\u63D0\u4F9B\u3055\u308C\u307E\u3059\u3002\u975E\u63A8\u5968\u306EAPI\u306F\u4ECA\u5F8C\u306E\u5B9F\u88C5\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002 @@ -173,13 +179,14 @@ doclet.ClassUse_ConstructorArgsTypeParameters={0}\u578B\u306E\u578B\u5F15\u6570\ doclet.ClassUse_ConstructorThrows={0}\u3092\u30B9\u30ED\u30FC\u3059\u308B{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.ClassUse_No.usage.of.0={0}\u306F\u3069\u3053\u304B\u3089\u3082\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u305B\u3093 doclet.Window_ClassUse_Header={0} {1}\u306E\u4F7F\u7528 -doclet.ClassUse_Title={0}
          {1}\u306E\u4F7F\u7528 +doclet.ClassUse_Title={0}\u306E\u4F7F\u7528 doclet.navClassUse=\u4F7F\u7528 doclet.Error_in_packagelist=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30A8\u30E9\u30FC: {0} {1} doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} doclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} doclet.exception_encountered={1}\u306E\u51E6\u7406\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n{0} -doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex 1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link \u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline \u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir :.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group :.. \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier ::... \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag ::

          \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-Xdocrootparent \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30E1\u30F3\u30C8\u5185\u306E@docRoot(\u3053\u306E\u5F8C\u306B\u306F/..\u304C\u7D9A\u304F)\u306E\u3059\u3079\u3066\u306E\u51FA\u73FE\u7B87\u6240\u3092\u3067\u7F6E\u63DB\u3059\u308B\n-charset \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding \u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D +doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex 1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link \u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline \u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir :.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group :.. \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier ::... \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag ::
          \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-Xdocrootparent \ + \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30E1\u30F3\u30C8\u5185\u306E@docRoot(\u3053\u306E\u5F8C\u306B\u306F/..\u304C\u7D9A\u304F)\u306E\u3059\u3079\u3066\u306E\u51FA\u73FE\u7B87\u6240\u3092\u3067\u7F6E\u63DB\u3059\u308B\n-charset \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding \u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties index 76f0abe8add..61fd72cbe10 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties @@ -4,7 +4,9 @@ doclet.Overview=\u6982\u89C8 doclet.Window_Overview=\u6982\u89C8\u5217\u8868 doclet.Window_Overview_Summary=\u6982\u89C8 doclet.Package=\u7A0B\u5E8F\u5305 +doclet.Profile=\u914D\u7F6E\u6587\u4EF6 doclet.All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305 +doclet.All_Profiles=\u6240\u6709\u914D\u7F6E\u6587\u4EF6 doclet.Tree=\u6811 doclet.Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784 doclet.Window_Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784 @@ -17,6 +19,8 @@ doclet.Prev_Class=\u4E0A\u4E00\u4E2A\u7C7B doclet.Next_Class=\u4E0B\u4E00\u4E2A\u7C7B doclet.Prev_Package=\u4E0A\u4E00\u4E2A\u7A0B\u5E8F\u5305 doclet.Next_Package=\u4E0B\u4E00\u4E2A\u7A0B\u5E8F\u5305 +doclet.Prev_Profile=\u4E0A\u4E00\u914D\u7F6E\u6587\u4EF6 +doclet.Next_Profile=\u4E0B\u4E00\u914D\u7F6E\u6587\u4EF6 doclet.Prev_Letter=\u4E0A\u4E00\u4E2A\u5B57\u6BCD doclet.Next_Letter=\u4E0B\u4E00\u4E2A\u5B57\u6BCD doclet.Href_Class_Title={0}\u4E2D\u7684\u7C7B @@ -32,6 +36,7 @@ doclet.navAnnotationTypeOptionalMember=\u53EF\u9009 doclet.navAnnotationTypeRequiredMember=\u5FC5\u9700 doclet.navAnnotationTypeMember=\u5143\u7D20 doclet.navField=\u5B57\u6BB5 +doclet.navProperty=\u5C5E\u6027 doclet.navEnum=\u679A\u4E3E\u5E38\u91CF doclet.navConstructor=\u6784\u9020\u5668 doclet.navMethod=\u65B9\u6CD5 @@ -40,6 +45,7 @@ doclet.Window_Single_Index=\u7D22\u5F15 doclet.Window_Split_Index={0} - \u7D22\u5F15 doclet.Help=\u5E2E\u52A9 doclet.Skip_navigation_links=\u8DF3\u8FC7\u5BFC\u822A\u94FE\u63A5 +doclet.Navigation=\u5BFC\u822A doclet.New_Page=NewPage doclet.navDeprecated=\u5DF2\u8FC7\u65F6 doclet.Window_Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868 @@ -126,7 +132,7 @@ doclet.Help_line_13=\u6BCF\u4E2A\u6982\u8981\u6761\u76EE\u90FD\u5305\u542B\u8BE5 doclet.Help_line_14=\u4F7F\u7528 doclet.Help_line_15=\u6BCF\u4E2A\u5DF2\u6587\u6863\u5316\u7684\u7A0B\u5E8F\u5305, \u7C7B\u548C\u63A5\u53E3\u90FD\u6709\u5404\u81EA\u7684\u201C\u4F7F\u7528\u201D\u9875\u9762\u3002\u6B64\u9875\u9762\u4ECB\u7ECD\u4E86\u4F7F\u7528\u7ED9\u5B9A\u7C7B\u6216\u7A0B\u5E8F\u5305\u7684\u4EFB\u4F55\u90E8\u5206\u7684\u7A0B\u5E8F\u5305, \u7C7B, \u65B9\u6CD5, \u6784\u9020\u5668\u548C\u5B57\u6BB5\u3002\u5BF9\u4E8E\u7ED9\u5B9A\u7684\u7C7B\u6216\u63A5\u53E3 A, \u5176\u201C\u4F7F\u7528\u201D\u9875\u9762\u5305\u542B A \u7684\u5B50\u7C7B, \u58F0\u660E\u4E3A A \u7684\u5B57\u6BB5, \u8FD4\u56DE A \u7684\u65B9\u6CD5, \u4EE5\u53CA\u5E26\u6709\u7C7B\u578B\u4E3A A \u7684\u53C2\u6570\u7684\u65B9\u6CD5\u548C\u6784\u9020\u5668\u3002\u8BBF\u95EE\u6B64\u9875\u9762\u7684\u65B9\u6CD5\u662F: \u9996\u5148\u8F6C\u81F3\u7A0B\u5E8F\u5305, \u7C7B\u6216\u63A5\u53E3, \u7136\u540E\u5355\u51FB\u5BFC\u822A\u680F\u4E2D\u7684 "\u4F7F\u7528" \u94FE\u63A5\u3002 doclet.Help_line_16=\u6811 (\u7C7B\u5206\u5C42\u7ED3\u6784) -doclet.Help_line_17_with_tree_link=\u5BF9\u4E8E\u6240\u6709\u7A0B\u5E8F\u5305, \u6709\u4E00\u4E2A {0} \u9875\u9762, \u4EE5\u53CA\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002\u6BCF\u4E2A\u5206\u5C42\u7ED3\u6784\u9875\u9762\u90FD\u5305\u542B\u7C7B\u7684\u5217\u8868\u548C\u63A5\u53E3\u7684\u5217\u8868\u3002\u4ECE java.lang.Object \u5F00\u59CB, \u6309\u7EE7\u627F\u7ED3\u6784\u5BF9\u7C7B\u8FDB\u884C\u6392\u5217\u3002\u63A5\u53E3\u4E0D\u4ECE java.lang.Object \u7EE7\u627F\u3002 +doclet.Help_line_17_with_tree_link=\u5BF9\u4E8E\u6240\u6709\u7A0B\u5E8F\u5305, \u6709\u4E00\u4E2A{0}\u9875\u9762, \u4EE5\u53CA\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002\u6BCF\u4E2A\u5206\u5C42\u7ED3\u6784\u9875\u9762\u90FD\u5305\u542B\u7C7B\u7684\u5217\u8868\u548C\u63A5\u53E3\u7684\u5217\u8868\u3002\u4ECE{1}\u5F00\u59CB, \u6309\u7EE7\u627F\u7ED3\u6784\u5BF9\u7C7B\u8FDB\u884C\u6392\u5217\u3002\u63A5\u53E3\u4E0D\u4ECE{1}\u7EE7\u627F\u3002 doclet.Help_line_18=\u67E5\u770B\u201C\u6982\u89C8\u201D\u9875\u9762\u65F6, \u5355\u51FB "\u6811" \u5C06\u663E\u793A\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002 doclet.Help_line_19=\u67E5\u770B\u7279\u5B9A\u7A0B\u5E8F\u5305, \u7C7B\u6216\u63A5\u53E3\u9875\u9762\u65F6, \u5355\u51FB "\u6811" \u5C06\u4EC5\u663E\u793A\u8BE5\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002 doclet.Help_line_20_with_deprecated_api_link={0} \u9875\u9762\u5217\u51FA\u4E86\u6240\u6709\u5DF2\u8FC7\u65F6\u7684 API\u3002\u4E00\u822C\u7531\u4E8E\u8FDB\u884C\u4E86\u6539\u8FDB\u5E76\u4E14\u901A\u5E38\u63D0\u4F9B\u4E86\u66FF\u4EE3\u7684 API, \u6240\u4EE5\u5EFA\u8BAE\u4E0D\u8981\u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684 API\u3002\u5728\u5C06\u6765\u7684\u5B9E\u73B0\u8FC7\u7A0B\u4E2D, \u53EF\u80FD\u4F1A\u5220\u9664\u5DF2\u8FC7\u65F6\u7684 API\u3002 @@ -173,7 +179,7 @@ doclet.ClassUse_ConstructorArgsTypeParameters=\u7C7B\u578B\u53D8\u91CF\u7C7B\u57 doclet.ClassUse_ConstructorThrows=\u629B\u51FA{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668 doclet.ClassUse_No.usage.of.0=\u6CA1\u6709{0}\u7684\u7528\u6CD5 doclet.Window_ClassUse_Header={0} {1}\u7684\u4F7F\u7528 -doclet.ClassUse_Title={0} {1}
          \u7684\u4F7F\u7528 +doclet.ClassUse_Title={0}\u7684\u4F7F\u7528 doclet.navClassUse=\u4F7F\u7528 doclet.Error_in_packagelist=\u4F7F\u7528 -group \u9009\u9879\u65F6\u51FA\u9519: {0} {1} doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java index b0d64d59beb..719aace1556 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java @@ -289,7 +289,8 @@ public class ClassBuilder extends AbstractBuilder { * @param classInfoTree the content tree to which the documentation will be added */ public void buildClassSignature(XMLNode node, Content classInfoTree) { - StringBuilder modifiers = new StringBuilder(classDoc.modifiers() + " "); + StringBuilder modifiers = new StringBuilder(classDoc.modifiers()); + modifiers.append(modifiers.length() == 0 ? "" : " "); if (isEnum) { modifiers.append("enum "); int index; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java index 0eb548ff9e8..8edb5dd2bad 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java @@ -385,15 +385,21 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder { } commentTextBuilder.append(propertyDoc.commentText()); - Tag[] tags = propertyDoc.tags("@defaultValue"); - if (tags != null) { - for (Tag tag: tags) { - commentTextBuilder.append("\n") - .append(tag.name()) - .append(" ") - .append(tag.text()); + // copy certain tags + List allTags = new LinkedList(); + String[] tagNames = {"@defaultValue", "@since"}; + for (String tagName: tagNames) { + Tag[] tags = propertyDoc.tags(tagName); + if (tags != null) { + allTags.addAll(Arrays.asList(tags)); } } + for (Tag tag: allTags) { + commentTextBuilder.append("\n") + .append(tag.name()) + .append(" ") + .append(tag.text()); + } //add @see tags if (!isGetter && !isSetter) { diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties index 75202520a3c..82509fc3a63 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties @@ -29,6 +29,7 @@ doclet.Building_Index=\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u30AF\u30E9\u30 doclet.Building_Index_For_All_Classes=\u5168\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059... doclet.sourcetab_warning=-sourcetab\u306E\u5F15\u6570\u306F0\u3088\u308A\u5927\u304D\u3044\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 doclet.Packages=\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.Profiles=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB doclet.Other_Packages=\u305D\u306E\u4ED6\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 doclet.Notice_taglet_registered=\u767B\u9332\u3055\u308C\u305F\u30BF\u30B0\u30EC\u30C3\u30C8{0} ... doclet.Notice_taglet_unseen=\u6CE8\u610F: \u975E\u8868\u793A\u306E\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0: {0} @@ -37,6 +38,12 @@ doclet.Notice_taglet_conflict_warn=\u6CE8\u610F: \u6A19\u6E96\u30BF\u30B0\u3092\ doclet.Error_taglet_not_registered=\u30A8\u30E9\u30FC - \u30BF\u30B0\u30EC\u30C3\u30C8{1}\u3092\u767B\u9332\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u3001\u4F8B\u5916{0}\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F... doclet.Error_invalid_custom_tag_argument=\u30A8\u30E9\u30FC - {0}\u306F-tag\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5BFE\u3057\u3066\u7121\u52B9\u306A\u5F15\u6570\u3067\u3059... doclet.Author=\u4F5C\u6210\u8005: +doclet.DefaultValue=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024: +doclet.PropertyDescription=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u8AAC\u660E: +doclet.PropertyGetter=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u53D6\u5F97\u3057\u307E\u3059 +doclet.PropertySetter=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u8A2D\u5B9A\u3057\u307E\u3059 +doclet.PropertyGetterWithName=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002 +doclet.PropertySetterWithName=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002 doclet.Default=\u30C7\u30D5\u30A9\u30EB\u30C8: doclet.Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF: doclet.TypeParameters=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF: @@ -58,7 +65,9 @@ doclet.UnknownTagLowercase={0}\u306F\u4E0D\u660E\u306A\u30BF\u30B0\u3067\u3059\u doclet.noInheritedDoc=@inheritDoc\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001{0}\u306F\u3069\u306E\u30E1\u30BD\u30C3\u30C9\u3082\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u5B9F\u88C5\u3057\u3066\u3044\u307E\u305B\u3093\u3002 doclet.malformed_html_link_tag= \u30BF\u30B0\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63:\n"{0}" doclet.tag_misuse={0}\u30BF\u30B0\u306F{1}\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u4F7F\u7528\u3067\u304D\u308B\u306E\u306F\u6B21\u306E\u30BF\u30A4\u30D7\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u306E\u307F\u3067\u3059: {2}\u3002 +doclet.javafx_tag_misuse=\u30BF\u30B0@propertyGetter\u3001@propertySetter\u304A\u3088\u3073@propertyDescription\u306F\u3001JavaFX\u306E\u30D7\u30ED\u30D1\u30C6\u30A3getter\u3068setter\u306E\u307F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 doclet.Package_Summary=\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981 +doclet.Profile_Summary=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30B5\u30DE\u30EA\u30FC doclet.Interface_Summary=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u6982\u8981 doclet.Annotation_Types_Summary=\u6CE8\u91C8\u578B\u306E\u6982\u8981 doclet.Enum_Summary=\u5217\u6319\u578B\u306E\u6982\u8981 @@ -69,6 +78,7 @@ doclet.Nested_Class_Summary=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30 doclet.Annotation_Type_Optional_Member_Summary=\u4EFB\u610F\u8981\u7D20\u306E\u6982\u8981 doclet.Annotation_Type_Required_Member_Summary=\u5FC5\u9808\u8981\u7D20\u306E\u6982\u8981 doclet.Field_Summary=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u6982\u8981 +doclet.Property_Summary=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u6982\u8981 doclet.Enum_Constant_Summary=\u5217\u6319\u578B\u5B9A\u6570\u306E\u6982\u8981 doclet.Constructor_Summary=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u6982\u8981 doclet.Method_Summary=\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981 @@ -80,6 +90,7 @@ doclet.Errors=\u30A8\u30E9\u30FC doclet.Classes=\u30AF\u30E9\u30B9 doclet.Packages=\u30D1\u30C3\u30B1\u30FC\u30B8 doclet.packages=\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.profiles=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB doclet.All_Classes=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9 doclet.All_Superinterfaces=\u3059\u3079\u3066\u306E\u30B9\u30FC\u30D1\u30FC\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: doclet.All_Implemented_Interfaces=\u3059\u3079\u3066\u306E\u5B9F\u88C5\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: @@ -110,10 +121,13 @@ doclet.Methods_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u doclet.Methods_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 doclet.Fields_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 doclet.Fields_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.Properties_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D7\u30ED\u30D1\u30C6\u30A3 +doclet.Properties_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D7\u30ED\u30D1\u30C6\u30A3 doclet.Annotation_Type_Member_Detail=\u8981\u7D20\u306E\u8A73\u7D30 doclet.Enum_Constant_Detail=\u5217\u6319\u578B\u5B9A\u6570\u306E\u8A73\u7D30 doclet.Constants_Summary=\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024 doclet.Field_Detail=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u8A73\u7D30 +doclet.Property_Detail=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u8A73\u7D30 doclet.Method_Detail=\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30 doclet.Constructor_Detail=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u8A73\u7D30 doclet.Deprecated=\u975E\u63A8\u5968\u3067\u3059\u3002 @@ -127,6 +141,8 @@ doclet.Constants_Table_Summary={0}\u8868\u3001\u5B9A\u6570\u30D5\u30A3\u30FC\u30 doclet.Member_Table_Summary={0}\u8868\u3001{1}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E doclet.fields=\u30D5\u30A3\u30FC\u30EB\u30C9 doclet.Fields=\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.properties=\u30D7\u30ED\u30D1\u30C6\u30A3 +doclet.Properties=\u30D7\u30ED\u30D1\u30C6\u30A3 doclet.constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.Constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.methods=\u30E1\u30BD\u30C3\u30C9 @@ -144,6 +160,7 @@ doclet.subinterfaces=\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Modifier=\u4FEE\u98FE\u5B50 doclet.Type=\u30BF\u30A4\u30D7 doclet.Field=\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.Property=\u30D7\u30ED\u30D1\u30C6\u30A3 doclet.Constructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.Method=\u30E1\u30BD\u30C3\u30C9 doclet.Annotation_Type_Optional_Member=\u4EFB\u610F\u8981\u7D20 diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties index 121350f25c0..602682459a4 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties @@ -29,6 +29,7 @@ doclet.Building_Index=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7A0B\u5E8F\u5305\u54 doclet.Building_Index_For_All_Classes=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7C7B\u7684\u7D22\u5F15... doclet.sourcetab_warning=-sourcetab \u7684\u53C2\u6570\u5FC5\u987B\u662F\u5927\u4E8E 0 \u7684\u6574\u6570\u3002 doclet.Packages=\u7A0B\u5E8F\u5305 +doclet.Profiles=\u914D\u7F6E\u6587\u4EF6 doclet.Other_Packages=\u5176\u4ED6\u7A0B\u5E8F\u5305 doclet.Notice_taglet_registered=\u6CE8\u518C\u7684 Taglet {0}... doclet.Notice_taglet_unseen=\u6CE8: \u627E\u4E0D\u5230\u7684\u5B9A\u5236\u6807\u8BB0: {0} @@ -37,6 +38,12 @@ doclet.Notice_taglet_conflict_warn=\u6CE8: \u53EF\u80FD\u8986\u76D6\u5C06\u6765\ doclet.Error_taglet_not_registered=\u9519\u8BEF - \u5C1D\u8BD5\u6CE8\u518C Taglet {1}\u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF{0}... doclet.Error_invalid_custom_tag_argument=\u9519\u8BEF - \u5BF9\u4E8E -tag \u9009\u9879, {0}\u662F\u65E0\u6548\u53C2\u6570... doclet.Author=\u4F5C\u8005: +doclet.DefaultValue=\u9ED8\u8BA4\u503C: +doclet.PropertyDescription=\u5C5E\u6027\u8BF4\u660E: +doclet.PropertyGetter=\u83B7\u53D6\u5C5E\u6027\u7684\u503C +doclet.PropertySetter=\u8BBE\u7F6E\u5C5E\u6027\u7684\u503C +doclet.PropertyGetterWithName=\u83B7\u53D6\u5C5E\u6027{0}\u7684\u503C\u3002 +doclet.PropertySetterWithName=\u8BBE\u7F6E\u5C5E\u6027{0}\u7684\u503C\u3002 doclet.Default=\u9ED8\u8BA4\u503C: doclet.Parameters=\u53C2\u6570: doclet.TypeParameters=\u7C7B\u578B\u53C2\u6570: @@ -58,7 +65,9 @@ doclet.UnknownTagLowercase={0}\u662F\u672A\u77E5\u6807\u8BB0 - \u9664\u4E86\u592 doclet.noInheritedDoc=\u4F7F\u7528\u4E86 @inheritDoc, \u4F46{0}\u672A\u8986\u76D6\u6216\u5B9E\u73B0\u4EFB\u4F55\u65B9\u6CD5\u3002 doclet.malformed_html_link_tag= \u6807\u8BB0\u683C\u5F0F\u9519\u8BEF: \n"{0}" doclet.tag_misuse=\u4E0D\u80FD\u5728{1}\u6587\u6863\u4E2D\u4F7F\u7528\u6807\u8BB0{0}\u3002\u53EA\u80FD\u5728\u4EE5\u4E0B\u7C7B\u578B\u7684\u6587\u6863\u4E2D\u4F7F\u7528\u8BE5\u6807\u8BB0: {2}\u3002 +doclet.javafx_tag_misuse=\u6807\u8BB0 @propertyGetter, @propertySetter \u548C @propertyDescription \u53EA\u80FD\u5728 JavaFX \u5C5E\u6027 getter \u548C setter \u4E2D\u4F7F\u7528\u3002 doclet.Package_Summary=\u7A0B\u5E8F\u5305\u6982\u8981 +doclet.Profile_Summary=\u6982\u8981\u4FE1\u606F\u6982\u8981 doclet.Interface_Summary=\u63A5\u53E3\u6982\u8981 doclet.Annotation_Types_Summary=\u6CE8\u91CA\u7C7B\u578B\u6982\u8981 doclet.Enum_Summary=\u679A\u4E3E\u6982\u8981 @@ -69,6 +78,7 @@ doclet.Nested_Class_Summary=\u5D4C\u5957\u7C7B\u6982\u8981 doclet.Annotation_Type_Optional_Member_Summary=\u53EF\u9009\u5143\u7D20\u6982\u8981 doclet.Annotation_Type_Required_Member_Summary=\u5FC5\u9700\u5143\u7D20\u6982\u8981 doclet.Field_Summary=\u5B57\u6BB5\u6982\u8981 +doclet.Property_Summary=\u5C5E\u6027\u6982\u8981 doclet.Enum_Constant_Summary=\u679A\u4E3E\u5E38\u91CF\u6982\u8981 doclet.Constructor_Summary=\u6784\u9020\u5668\u6982\u8981 doclet.Method_Summary=\u65B9\u6CD5\u6982\u8981 @@ -80,6 +90,7 @@ doclet.Errors=\u9519\u8BEF doclet.Classes=\u7C7B doclet.Packages=\u7A0B\u5E8F\u5305 doclet.packages=\u7A0B\u5E8F\u5305 +doclet.profiles=\u914D\u7F6E\u6587\u4EF6 doclet.All_Classes=\u6240\u6709\u7C7B doclet.All_Superinterfaces=\u6240\u6709\u8D85\u7EA7\u63A5\u53E3: doclet.All_Implemented_Interfaces=\u6240\u6709\u5DF2\u5B9E\u73B0\u7684\u63A5\u53E3: @@ -110,10 +121,13 @@ doclet.Methods_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u65B9\u6CD5 doclet.Methods_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u65B9\u6CD5 doclet.Fields_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5B57\u6BB5 doclet.Fields_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5B57\u6BB5 +doclet.Properties_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5C5E\u6027 +doclet.Properties_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5C5E\u6027 doclet.Annotation_Type_Member_Detail=\u5143\u7D20\u8BE6\u7EC6\u8D44\u6599 doclet.Enum_Constant_Detail=\u679A\u4E3E\u5E38\u91CF\u8BE6\u7EC6\u8D44\u6599 doclet.Constants_Summary=\u5E38\u91CF\u5B57\u6BB5\u503C doclet.Field_Detail=\u5B57\u6BB5\u8BE6\u7EC6\u8D44\u6599 +doclet.Property_Detail=\u5C5E\u6027\u8BE6\u7EC6\u4FE1\u606F doclet.Method_Detail=\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599 doclet.Constructor_Detail=\u6784\u9020\u5668\u8BE6\u7EC6\u8D44\u6599 doclet.Deprecated=\u5DF2\u8FC7\u65F6\u3002 @@ -127,6 +141,8 @@ doclet.Constants_Table_Summary={0}\u8868, \u5217\u8868\u5E38\u91CF\u5B57\u6BB5\u doclet.Member_Table_Summary={0}\u8868, \u5217\u8868{1}\u548C\u89E3\u91CA doclet.fields=\u5B57\u6BB5 doclet.Fields=\u5B57\u6BB5 +doclet.properties=\u5C5E\u6027 +doclet.Properties=\u5C5E\u6027 doclet.constructors=\u6784\u9020\u5668 doclet.Constructors=\u6784\u9020\u5668 doclet.methods=\u65B9\u6CD5 @@ -144,6 +160,7 @@ doclet.subinterfaces=\u5B50\u63A5\u53E3 doclet.Modifier=\u9650\u5B9A\u7B26 doclet.Type=\u7C7B\u578B doclet.Field=\u5B57\u6BB5 +doclet.Property=\u5C5E\u6027 doclet.Constructor=\u6784\u9020\u5668 doclet.Method=\u65B9\u6CD5 doclet.Annotation_Type_Optional_Member=\u53EF\u9009\u5143\u7D20 @@ -157,6 +174,6 @@ doclet.Value=\u503C doclet.0_and_1={0}\u548C{1} #Documentation for Enums -doclet.enum_values_doc=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n
          \nfor ({0} c : {0}.values())\n    System.out.println(c);\n
          \n@\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4 +doclet.enum_values_doc=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n
          \nfor ({0} c : {0}.values())\n    System.out.println(c);\n
          \n@return \u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4 -doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26\u5B8C\u5168\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@\u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@\u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException +doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26\u5B8C\u5168\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css index 97c67415bc2..6634d8aedfe 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css @@ -371,6 +371,7 @@ Table styles overflow:hidden; padding:0px; margin:0px; + white-space:pre; } caption a:link, caption a:hover, caption a:active, caption a:visited { color:#FFFFFF; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java index 377cd670dee..b6af4746e03 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java @@ -631,6 +631,10 @@ public class TagletManager { * Initialize standard Javadoc tags for ordering purposes. */ private void initStandardTaglets() { + if (javafx) { + initJavaFXTaglets(); + } + Taglet temp; addStandardTaglet(new ParamTaglet()); addStandardTaglet(new ReturnTaglet()); @@ -664,10 +668,6 @@ public class TagletManager { standardTags.add("serial"); standardTags.add("serialField"); standardTags.add("Text"); - - if (javafx) { - initJavaFXTaglets(); - } } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties new file mode 100644 index 00000000000..10282be9632 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties @@ -0,0 +1,68 @@ +# +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +dc.anchor.already.defined = \u30A2\u30F3\u30AB\u30FC\u304C\u3059\u3067\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059: {0} +dc.anchor.value.missing = \u30A2\u30F3\u30AB\u30FC\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +dc.attr.lacks.value = \u5C5E\u6027\u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093 +dc.attr.obsolete = \u5C5E\u6027\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u307E\u3059: {0} +dc.attr.obsolete.use.css = \u5C5E\u6027\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u304B\u308F\u308A\u306BCSS\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044: {0} +dc.attr.repeated = \u7E70\u308A\u8FD4\u3055\u308C\u305F\u5C5E\u6027: {0} +dc.attr.unknown = \u4E0D\u660E\u306A\u5C5E\u6027: {0} +dc.bad.option = \u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0} +dc.bad.value.for.option = \u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059: {0} {1} +dc.empty = @{0}\u306E\u8AAC\u660E\u304C\u3042\u308A\u307E\u305B\u3093 +dc.entity.invalid = \u7121\u52B9\u306A\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3&{0}; +dc.exception.not.thrown = \u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {0} +dc.invalid.anchor = \u30A2\u30F3\u30AB\u30FC\u306E\u540D\u524D\u304C\u7121\u52B9\u3067\u3059: "{0}" +dc.invalid.param = \u7121\u52B9\u306A@param\u306E\u4F7F\u7528 +dc.invalid.return = \u7121\u52B9\u306A@return\u306E\u4F7F\u7528 +dc.invalid.throws = \u7121\u52B9\u306A@throws\u306E\u4F7F\u7528 +dc.invalid.uri = \u7121\u52B9\u306AURI: "{0}" +dc.missing.comment = \u30B3\u30E1\u30F3\u30C8\u306A\u3057 +dc.missing.param = {0}\u306E@param\u304C\u3042\u308A\u307E\u305B\u3093 +dc.missing.return = @return\u304C\u3042\u308A\u307E\u305B\u3093 +dc.missing.throws = {0}\u306E@throws\u304C\u3042\u308A\u307E\u305B\u3093 +dc.no.alt.attr.for.image = \u30A4\u30E1\u30FC\u30B8\u306E"alt"\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +dc.no.summary.or.caption.for.table=\u8868\u306E\u8981\u7D04\u307E\u305F\u306F\u30AD\u30E3\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093 +dc.param.name.not.found = @param\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +dc.ref.not.found = \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +dc.tag.code.within.code = \u5185\u306E'{@code'} +dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0 +dc.tag.end.not.permitted = \u7121\u52B9\u306A\u7D42\u4E86\u30BF\u30B0: +dc.tag.end.unexpected = \u4E88\u671F\u3057\u306A\u3044\u7D42\u4E86\u30BF\u30B0: +dc.tag.header.sequence.1 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}> +dc.tag.header.sequence.2 = \u30D8\u30C3\u30C0\u30FC\u306E\u6307\u5B9A\u9806\u5E8F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093: <{0}> +dc.tag.nested.not.allowed=\u30CD\u30B9\u30C8\u3057\u305F\u30BF\u30B0\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093: <{0}> +dc.tag.not.allowed.here = \u3053\u3053\u3067\u306F\u30BF\u30B0\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093: <{0}> +dc.tag.not.allowed = \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u8981\u7D20\u3067\u3059: <{0}> +dc.tag.not.allowed.inline.element = \u30A4\u30F3\u30E9\u30A4\u30F3\u8981\u7D20<{1}>\u5185\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3067\u3059: {0} +dc.tag.not.allowed.inline.tag = @{1}\u5185\u3067\u4F7F\u7528\u3067\u304D\u306A\u3044\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3067\u3059: {0} +dc.tag.not.allowed.inline.other = \u3053\u3053\u3067\u306F\u30D6\u30ED\u30C3\u30AF\u8981\u7D20\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093: {0} +dc.tag.not.closed= \u8981\u7D20\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093: {0} +dc.tag.p.in.pre=
          \u8981\u7D20\u5185\u3067\u4E88\u671F\u3057\u306A\u3044

          \u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059 +dc.tag.self.closing = \u81EA\u5DF1\u7D42\u4E86\u8981\u7D20\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 +dc.tag.start.unmatched = \u7D42\u4E86\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093: +dc.tag.unknown = \u4E0D\u660E\u306A\u30BF\u30B0: {0} +dc.text.not.allowed = <{0}>\u8981\u7D20\u3067\u306F\u30C6\u30AD\u30B9\u30C8\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 diff --git a/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties new file mode 100644 index 00000000000..b3a9c7041bc --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties @@ -0,0 +1,68 @@ +# +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +dc.anchor.already.defined = \u951A\u5B9A\u70B9\u5DF2\u5B9A\u4E49: {0} +dc.anchor.value.missing = \u6CA1\u6709\u4E3A\u951A\u5B9A\u70B9\u6307\u5B9A\u503C +dc.attr.lacks.value = \u5C5E\u6027\u7F3A\u5C11\u503C +dc.attr.obsolete = \u5C5E\u6027\u5DF2\u8FC7\u65F6: {0} +dc.attr.obsolete.use.css = \u5C5E\u6027\u5DF2\u8FC7\u65F6, \u8BF7\u6539\u7528 CSS: {0} +dc.attr.repeated = \u5C5E\u6027\u91CD\u590D: {0} +dc.attr.unknown = \u672A\u77E5\u5C5E\u6027: {0} +dc.bad.option = \u9009\u9879\u9519\u8BEF: {0} +dc.bad.value.for.option = \u9009\u9879\u7684\u503C\u9519\u8BEF: {0} {1} +dc.empty = @{0} \u6CA1\u6709\u8BF4\u660E +dc.entity.invalid = \u5B9E\u4F53 &{0}; \u65E0\u6548 +dc.exception.not.thrown = \u672A\u629B\u51FA\u5F02\u5E38\u9519\u8BEF: {0} +dc.invalid.anchor = \u951A\u5B9A\u70B9\u7684\u540D\u79F0\u65E0\u6548: "{0}" +dc.invalid.param = @param \u7684\u7528\u6CD5\u65E0\u6548 +dc.invalid.return = @return \u7684\u7528\u6CD5\u65E0\u6548 +dc.invalid.throws = @throws \u7684\u7528\u6CD5\u65E0\u6548 +dc.invalid.uri = URI \u65E0\u6548: "{0}" +dc.missing.comment = \u6CA1\u6709\u6CE8\u91CA +dc.missing.param = {0}\u6CA1\u6709 @param +dc.missing.return = \u6CA1\u6709 @return +dc.missing.throws = {0}\u6CA1\u6709 @throws +dc.no.alt.attr.for.image = \u56FE\u50CF\u6CA1\u6709 "alt" \u5C5E\u6027 +dc.no.summary.or.caption.for.table=\u8868\u6CA1\u6709\u6982\u8981\u6216\u6807\u9898 +dc.param.name.not.found = \u627E\u4E0D\u5230 @param \u540D\u79F0 +dc.ref.not.found = \u627E\u4E0D\u5230\u5F15\u7528 +dc.tag.code.within.code = '{@code'} \u5728 \u4E2D +dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A +dc.tag.end.not.permitted = \u65E0\u6548\u7684\u7ED3\u675F\u6807\u8BB0: +dc.tag.end.unexpected = \u610F\u5916\u7684\u7ED3\u675F\u6807\u8BB0: +dc.tag.header.sequence.1 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}> +dc.tag.header.sequence.2 = \u4F7F\u7528\u7684\u6807\u9898\u8D85\u51FA\u5E8F\u5217: <{0}> +dc.tag.nested.not.allowed=\u4E0D\u5141\u8BB8\u4F7F\u7528\u5D4C\u5957\u6807\u8BB0: <{0}> +dc.tag.not.allowed.here = \u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u6807\u8BB0: <{0}> +dc.tag.not.allowed = \u6587\u6863\u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5143\u7D20: <{0}> +dc.tag.not.allowed.inline.element = \u5185\u5D4C\u5143\u7D20 <{1}> \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0} +dc.tag.not.allowed.inline.tag = @{1} \u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0} +dc.tag.not.allowed.inline.other = \u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u5757\u5143\u7D20: {0} +dc.tag.not.closed= \u5143\u7D20\u672A\u5173\u95ED: {0} +dc.tag.p.in.pre=

           \u5143\u7D20\u5185\u90E8\u610F\u5916\u5730\u4F7F\u7528\u4E86 

          +dc.tag.self.closing = \u4E0D\u5141\u8BB8\u4F7F\u7528\u81EA\u5173\u95ED\u5143\u7D20 +dc.tag.start.unmatched = \u7F3A\u5C11\u7ED3\u675F\u6807\u8BB0: +dc.tag.unknown = \u672A\u77E5\u6807\u8BB0: {0} +dc.text.not.allowed = <{0}> \u5143\u7D20\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u6587\u672C diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java index 19dde2aef0d..ef03f718cc0 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java +++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java @@ -69,6 +69,7 @@ import com.sun.tools.javac.code.Type.ClassType; import com.sun.tools.javac.code.Type.ErrorType; import com.sun.tools.javac.code.Type.UnionClassType; import com.sun.tools.javac.code.Types; +import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.code.Types.TypeRelation; import com.sun.tools.javac.comp.Attr; import com.sun.tools.javac.comp.AttrContext; @@ -653,8 +654,7 @@ public class JavacTrees extends DocTrees { switch (t.getTag()) { case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE: - return t.getTag() == s.getTag(); - + return t.hasTag(s.getTag()); default: throw new AssertionError("fuzzyMatcher " + t.getTag()); } @@ -668,7 +668,7 @@ public class JavacTrees extends DocTrees { if (s.isPartial()) return visit(s, t); - return s.getTag() == ARRAY + return s.hasTag(ARRAY) && visit(t.elemtype, types.elemtype(s)); } @@ -685,7 +685,7 @@ public class JavacTrees extends DocTrees { @Override public Boolean visitErrorType(ErrorType t, Type s) { - return s.getTag() == CLASS + return s.hasTag(CLASS) && t.tsym.name == ((ClassType) s).tsym.name; } }; diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java index ec76bbf7637..bb29eeaa530 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java @@ -83,7 +83,7 @@ public abstract class Attribute implements AnnotationValue { return v.visitString((String) value, p); if (value instanceof Integer) { int i = (Integer) value; - switch (type.tag) { + switch (type.getTag()) { case BOOLEAN: return v.visitBoolean(i != 0, p); case CHAR: return v.visitChar((char) i, p); case BYTE: return v.visitByte((byte) i, p); @@ -91,7 +91,7 @@ public abstract class Attribute implements AnnotationValue { case INT: return v.visitInt(i, p); } } - switch (type.tag) { + switch (type.getTag()) { case LONG: return v.visitLong((Long) value, p); case FLOAT: return v.visitFloat((Float) value, p); case DOUBLE: return v.visitDouble((Double) value, p); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java index 06e5f87f594..e57e683d49b 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java @@ -32,6 +32,8 @@ import java.util.Set; import javax.lang.model.element.Modifier; +import com.sun.tools.javac.util.Assert; + /** Access flags and other modifiers for Java classes and members. * *

          This is NOT part of any supported API. @@ -46,53 +48,29 @@ public class Flags { public static String toString(long flags) { StringBuilder buf = new StringBuilder(); String sep = ""; - for (Flag s : asFlagSet(flags)) { + for (Flag flag : asFlagSet(flags)) { buf.append(sep); - buf.append(s); + buf.append(flag); sep = " "; } return buf.toString(); } - public static EnumSet asFlagSet(long mask) { - EnumSet flags = EnumSet.noneOf(Flag.class); - if ((mask&PUBLIC) != 0) flags.add(Flag.PUBLIC); - if ((mask&PRIVATE) != 0) flags.add(Flag.PRIVATE); - if ((mask&PROTECTED) != 0) flags.add(Flag.PROTECTED); - if ((mask&STATIC) != 0) flags.add(Flag.STATIC); - if ((mask&FINAL) != 0) flags.add(Flag.FINAL); - if ((mask&SYNCHRONIZED) != 0) flags.add(Flag.SYNCHRONIZED); - if ((mask&VOLATILE) != 0) flags.add(Flag.VOLATILE); - if ((mask&TRANSIENT) != 0) flags.add(Flag.TRANSIENT); - if ((mask&NATIVE) != 0) flags.add(Flag.NATIVE); - if ((mask&INTERFACE) != 0) flags.add(Flag.INTERFACE); - if ((mask&ABSTRACT) != 0) flags.add(Flag.ABSTRACT); - if ((mask&DEFAULT) != 0) flags.add(Flag.DEFAULT); - if ((mask&STRICTFP) != 0) flags.add(Flag.STRICTFP); - if ((mask&BRIDGE) != 0) flags.add(Flag.BRIDGE); - if ((mask&SYNTHETIC) != 0) flags.add(Flag.SYNTHETIC); - if ((mask&DEPRECATED) != 0) flags.add(Flag.DEPRECATED); - if ((mask&HASINIT) != 0) flags.add(Flag.HASINIT); - if ((mask&ENUM) != 0) flags.add(Flag.ENUM); - if ((mask&MANDATED) != 0) flags.add(Flag.MANDATED); - if ((mask&IPROXY) != 0) flags.add(Flag.IPROXY); - if ((mask&NOOUTERTHIS) != 0) flags.add(Flag.NOOUTERTHIS); - if ((mask&EXISTS) != 0) flags.add(Flag.EXISTS); - if ((mask&COMPOUND) != 0) flags.add(Flag.COMPOUND); - if ((mask&CLASS_SEEN) != 0) flags.add(Flag.CLASS_SEEN); - if ((mask&SOURCE_SEEN) != 0) flags.add(Flag.SOURCE_SEEN); - if ((mask&LOCKED) != 0) flags.add(Flag.LOCKED); - if ((mask&UNATTRIBUTED) != 0) flags.add(Flag.UNATTRIBUTED); - if ((mask&ANONCONSTR) != 0) flags.add(Flag.ANONCONSTR); - if ((mask&ACYCLIC) != 0) flags.add(Flag.ACYCLIC); - if ((mask&PARAMETER) != 0) flags.add(Flag.PARAMETER); - if ((mask&VARARGS) != 0) flags.add(Flag.VARARGS); - return flags; + public static EnumSet asFlagSet(long flags) { + EnumSet flagSet = EnumSet.noneOf(Flag.class); + for (Flag flag : Flag.values()) { + if ((flags & flag.value) != 0) { + flagSet.add(flag); + flags &= ~flag.value; + } + } + Assert.check(flags == 0, "Flags parameter contains unknown flags " + flags); + return flagSet; } /* Standard Java flags. */ - public static final int PUBLIC = 1<<0; + public static final int PUBLIC = 1; public static final int PRIVATE = 1<<1; public static final int PROTECTED = 1<<2; public static final int STATIC = 1<<3; @@ -154,9 +132,9 @@ public class Flags { /** Flag is set for nested classes that do not access instance members * or `this' of an outer class and therefore don't need to be passed - * a this$n reference. This flag is currently set only for anonymous + * a this$n reference. This value is currently set only for anonymous * classes in superclass constructor calls and only for pre 1.4 targets. - * todo: use this flag for optimizing away this$n parameters in + * todo: use this value for optimizing away this$n parameters in * other cases. */ public static final int NOOUTERTHIS = 1<<22; @@ -278,6 +256,11 @@ public class Flags { */ public static final long BAD_OVERRIDE = 1L<<45; + /** + * Flag that indicates a signature polymorphic method (292). + */ + public static final long SIGNATURE_POLYMORPHIC = 1L<<46; + /** Modifier masks. */ public static final int @@ -337,49 +320,65 @@ public class Flags { return symbol.getConstValue() != null; } + public enum Flag { + PUBLIC(Flags.PUBLIC), + PRIVATE(Flags.PRIVATE), + PROTECTED(Flags.PROTECTED), + STATIC(Flags.STATIC), + FINAL(Flags.FINAL), + SYNCHRONIZED(Flags.SYNCHRONIZED), + VOLATILE(Flags.VOLATILE), + TRANSIENT(Flags.TRANSIENT), + NATIVE(Flags.NATIVE), + INTERFACE(Flags.INTERFACE), + ABSTRACT(Flags.ABSTRACT), + DEFAULT(Flags.DEFAULT), + STRICTFP(Flags.STRICTFP), + BRIDGE(Flags.BRIDGE), + SYNTHETIC(Flags.SYNTHETIC), + ANNOTATION(Flags.ANNOTATION), + DEPRECATED(Flags.DEPRECATED), + HASINIT(Flags.HASINIT), + BLOCK(Flags.BLOCK), + ENUM(Flags.ENUM), + MANDATED(Flags.MANDATED), + IPROXY(Flags.IPROXY), + NOOUTERTHIS(Flags.NOOUTERTHIS), + EXISTS(Flags.EXISTS), + COMPOUND(Flags.COMPOUND), + CLASS_SEEN(Flags.CLASS_SEEN), + SOURCE_SEEN(Flags.SOURCE_SEEN), + LOCKED(Flags.LOCKED), + UNATTRIBUTED(Flags.UNATTRIBUTED), + ANONCONSTR(Flags.ANONCONSTR), + ACYCLIC(Flags.ACYCLIC), + PARAMETER(Flags.PARAMETER), + VARARGS(Flags.VARARGS), + ACYCLIC_ANN(Flags.ACYCLIC_ANN), + GENERATEDCONSTR(Flags.GENERATEDCONSTR), + HYPOTHETICAL(Flags.HYPOTHETICAL), + PROPRIETARY(Flags.PROPRIETARY), + UNION(Flags.UNION), + OVERRIDE_BRIDGE(Flags.OVERRIDE_BRIDGE), + EFFECTIVELY_FINAL(Flags.EFFECTIVELY_FINAL), + CLASH(Flags.CLASH), + AUXILIARY(Flags.AUXILIARY), + NOT_IN_PROFILE(Flags.NOT_IN_PROFILE), + BAD_OVERRIDE(Flags.BAD_OVERRIDE); - PUBLIC("public"), - PRIVATE("private"), - PROTECTED("protected"), - STATIC("static"), - FINAL("final"), - SYNCHRONIZED("synchronized"), - VOLATILE("volatile"), - TRANSIENT("transient"), - NATIVE("native"), - INTERFACE("interface"), - ABSTRACT("abstract"), - DEFAULT("default"), - STRICTFP("strictfp"), - BRIDGE("bridge"), - SYNTHETIC("synthetic"), - DEPRECATED("deprecated"), - HASINIT("hasinit"), - ENUM("enum"), - MANDATED("mandated"), - IPROXY("iproxy"), - NOOUTERTHIS("noouterthis"), - EXISTS("exists"), - COMPOUND("compound"), - CLASS_SEEN("class_seen"), - SOURCE_SEEN("source_seen"), - LOCKED("locked"), - UNATTRIBUTED("unattributed"), - ANONCONSTR("anonconstr"), - ACYCLIC("acyclic"), - PARAMETER("parameter"), - VARARGS("varargs"), - PACKAGE("package"); - - private final String name; - - Flag(String name) { - this.name = name; + Flag(long flag) { + this.value = flag; + this.lowercaseName = name().toLowerCase(); } + @Override public String toString() { - return name; + return lowercaseName; } + + final long value; + final String lowercaseName; } + } diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java index 08fbd1a57e4..1ea1d4e47f5 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,9 +73,13 @@ public class Kinds { */ public final static int MTH = 1 << 4; + /** Poly kind, for deferred types. + */ + public final static int POLY = 1 << 5; + /** The error kind, which includes all other kinds. */ - public final static int ERR = (1 << 5) - 1; + public final static int ERR = (1 << 6) - 1; /** The set of all kinds. */ @@ -83,7 +87,7 @@ public class Kinds { /** Kinds for erroneous symbols that complement the above */ - public static final int ERRONEOUS = 1 << 6; + public static final int ERRONEOUS = 1 << 7; public static final int AMBIGUOUS = ERRONEOUS+1; // ambiguous reference public static final int HIDDEN = ERRONEOUS+2; // hidden method or field public static final int STATICERR = ERRONEOUS+3; // nonstatic member from static context @@ -214,10 +218,10 @@ public class Kinds { /** A KindName representing the kind of a given class/interface type. */ public static KindName typeKindName(Type t) { - if (t.tag == TYPEVAR || - t.tag == CLASS && (t.tsym.flags() & COMPOUND) != 0) + if (t.hasTag(TYPEVAR) || + t.hasTag(CLASS) && (t.tsym.flags() & COMPOUND) != 0) return KindName.BOUND; - else if (t.tag == PACKAGE) + else if (t.hasTag(PACKAGE)) return KindName.PACKAGE; else if ((t.tsym.flags_field & ANNOTATION) != 0) return KindName.ANNOTATION; diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java index 76e54103062..be0b5038018 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java @@ -215,7 +215,7 @@ public abstract class Printer implements Type.Visitor, Symbol.Vi @Override public String visitClassType(ClassType t, Locale locale) { StringBuilder buf = new StringBuilder(); - if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) { + if (t.getEnclosingType().hasTag(CLASS) && t.tsym.owner.kind == Kinds.TYP) { buf.append(visit(t.getEnclosingType(), locale)); buf.append('.'); buf.append(className(t, false, locale)); @@ -379,7 +379,7 @@ public abstract class Printer implements Type.Visitor, Symbol.Vi ? s.owner.name.toString() : s.name.toString(); if (s.type != null) { - if (s.type.tag == FORALL) { + if (s.type.hasTag(FORALL)) { ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms; } ms += "(" + printMethodArgs( diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java index b301cb858bd..e05418e4001 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java @@ -699,17 +699,17 @@ public abstract class Symbol implements Element { public final boolean precedes(TypeSymbol that, Types types) { if (this == that) return false; - if (this.type.tag == that.type.tag) { - if (this.type.hasTag(CLASS)) { + if (type.hasTag(that.type.getTag())) { + if (type.hasTag(CLASS)) { return types.rank(that.type) < types.rank(this.type) || types.rank(that.type) == types.rank(this.type) && that.getQualifiedName().compareTo(this.getQualifiedName()) < 0; - } else if (this.type.hasTag(TYPEVAR)) { + } else if (type.hasTag(TYPEVAR)) { return types.isSubtype(this.type, that.type); } } - return this.type.hasTag(TYPEVAR); + return type.hasTag(TYPEVAR); } @Override @@ -1537,25 +1537,6 @@ public abstract class Symbol implements Element { getKind() == ElementKind.INSTANCE_INIT; } - /** - * A polymorphic signature method (JLS SE 7, 8.4.1) is a method that - * (i) is declared in the java.lang.invoke.MethodHandle class, (ii) takes - * a single variable arity parameter (iii) whose declared type is Object[], - * (iv) has a return type of Object and (v) is native. - */ - public boolean isSignaturePolymorphic(Types types) { - List argtypes = type.getParameterTypes(); - Type firstElemType = argtypes.nonEmpty() ? - types.elemtype(argtypes.head) : - null; - return owner == types.syms.methodHandleType.tsym && - argtypes.length() == 1 && - firstElemType != null && - types.isSameType(firstElemType, types.syms.objectType) && - types.isSameType(type.getReturnType(), types.syms.objectType) && - (flags() & NATIVE) != 0; - } - public Attribute getDefaultValue() { return defaultValue; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java index 5f968f486a8..3130ad0d27e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java @@ -28,7 +28,6 @@ package com.sun.tools.javac.code; import java.util.*; import javax.lang.model.element.ElementVisitor; -import javax.lang.model.type.TypeVisitor; import com.sun.tools.javac.code.Symbol.*; import com.sun.tools.javac.code.Type.*; @@ -65,16 +64,16 @@ public class Symtab { /** Builtin types. */ - public final Type byteType = new Type(BYTE, null); - public final Type charType = new Type(CHAR, null); - public final Type shortType = new Type(SHORT, null); - public final Type intType = new Type(INT, null); - public final Type longType = new Type(LONG, null); - public final Type floatType = new Type(FLOAT, null); - public final Type doubleType = new Type(DOUBLE, null); - public final Type booleanType = new Type(BOOLEAN, null); + public final JCPrimitiveType byteType = new JCPrimitiveType(BYTE, null); + public final JCPrimitiveType charType = new JCPrimitiveType(CHAR, null); + public final JCPrimitiveType shortType = new JCPrimitiveType(SHORT, null); + public final JCPrimitiveType intType = new JCPrimitiveType(INT, null); + public final JCPrimitiveType longType = new JCPrimitiveType(LONG, null); + public final JCPrimitiveType floatType = new JCPrimitiveType(FLOAT, null); + public final JCPrimitiveType doubleType = new JCPrimitiveType(DOUBLE, null); + public final JCPrimitiveType booleanType = new JCPrimitiveType(BOOLEAN, null); public final Type botType = new BottomType(); - public final JCNoType voidType = new JCNoType(VOID); + public final JCVoidType voidType = new JCVoidType(); private final Names names; private final ClassReader reader; @@ -208,7 +207,7 @@ public class Symtab { public void initType(Type type, ClassSymbol c) { type.tsym = c; - typeOfTag[type.tag.ordinal()] = type; + typeOfTag[type.getTag().ordinal()] = type; } public void initType(Type type, String name) { @@ -220,7 +219,7 @@ public class Symtab { public void initType(Type type, String name, String bname) { initType(type, name); - boxedName[type.tag.ordinal()] = names.fromString("java.lang." + bname); + boxedName[type.getTag().ordinal()] = names.fromString("java.lang." + bname); } /** The class symbol that owns all predefined symbols. @@ -330,7 +329,7 @@ public class Symtab { } public void synthesizeBoxTypeIfMissing(final Type type) { - ClassSymbol sym = reader.enterClass(boxedName[type.tag.ordinal()]); + ClassSymbol sym = reader.enterClass(boxedName[type.getTag().ordinal()]); final Completer completer = sym.completer; if (completer != null) { sym.completer = new Completer() { @@ -388,12 +387,7 @@ public class Symtab { target = Target.instance(context); // Create the unknown type - unknownType = new Type(UNKNOWN, null) { - @Override - public R accept(TypeVisitor v, P p) { - return v.visitUnknown(this, p); - } - }; + unknownType = new UnknownType(); // create the basic builtin symbols rootPackage = new PackageSymbol(names.empty, null); @@ -570,15 +564,18 @@ public class Symtab { arrayClass.members().enter(arrayCloneMethod); // Enter operators. - enterUnop("+", doubleType, doubleType, nop); - enterUnop("+", floatType, floatType, nop); - enterUnop("+", longType, longType, nop); - enterUnop("+", intType, intType, nop); + /* Internally we use +++, --- for unary +, - to reduce +, - operators + * overloading + */ + enterUnop("+++", doubleType, doubleType, nop); + enterUnop("+++", floatType, floatType, nop); + enterUnop("+++", longType, longType, nop); + enterUnop("+++", intType, intType, nop); - enterUnop("-", doubleType, doubleType, dneg); - enterUnop("-", floatType, floatType, fneg); - enterUnop("-", longType, longType, lneg); - enterUnop("-", intType, intType, ineg); + enterUnop("---", doubleType, doubleType, dneg); + enterUnop("---", floatType, floatType, fneg); + enterUnop("---", longType, longType, lneg); + enterUnop("---", intType, intType, ineg); enterUnop("~", longType, longType, lxor); enterUnop("~", intType, intType, ixor); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java index 43784a2f4ff..a89f86eed50 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java @@ -70,25 +70,19 @@ import static com.sun.tools.javac.code.TypeTag.*; * * @see TypeTag */ -public class Type implements PrimitiveType { +public abstract class Type implements TypeMirror { /** Constant type: no type at all. */ - public static final JCNoType noType = new JCNoType(NONE); + public static final JCNoType noType = new JCNoType(); /** Constant type: special type to be used during recovery of deferred expressions. */ - public static final JCNoType recoveryType = new JCNoType(NONE); + public static final JCNoType recoveryType = new JCNoType(); /** If this switch is turned on, the names of type variables * and anonymous classes are printed with hashcodes appended. */ public static boolean moreInfo = false; - /** The tag of this type. - * - * @see TypeTag - */ - protected TypeTag tag; - /** The defining class / interface / package / type variable. */ public TypeSymbol tsym; @@ -98,61 +92,37 @@ public class Type implements PrimitiveType { * @return true if tag is equal to the current type tag. */ public boolean hasTag(TypeTag tag) { - return this.tag == tag; + return tag == getTag(); } /** * Returns the current type tag. * @return the value of the current type tag. */ - public TypeTag getTag() { - return tag; - } + public abstract TypeTag getTag(); public boolean isNumeric() { - switch (tag) { - case BYTE: case CHAR: - case SHORT: - case INT: case LONG: - case FLOAT: case DOUBLE: - return true; - default: - return false; - } + return false; } public boolean isPrimitive() { - return (isNumeric() || tag == BOOLEAN); + return false; } public boolean isPrimitiveOrVoid() { - return (isPrimitive() || tag == VOID); + return false; } public boolean isReference() { - switch (tag) { - case CLASS: - case ARRAY: - case TYPEVAR: - case WILDCARD: - case ERROR: - return true; - default: - return false; - } + return false; } public boolean isNullOrReference() { - return (tag == BOT || isReference()); + return false; } public boolean isPartial() { - switch(tag) { - case ERROR: case UNKNOWN: case UNDETVAR: - return true; - default: - return false; - } + return false; } /** @@ -165,6 +135,18 @@ public class Type implements PrimitiveType { return null; } + /** Is this a constant type whose value is false? + */ + public boolean isFalse() { + return false; + } + + /** Is this a constant type whose value is true? + */ + public boolean isTrue() { + return false; + } + /** * Get the representation of this type used for modelling purposes. * By default, this is itself. For ErrorType, a different value @@ -175,7 +157,7 @@ public class Type implements PrimitiveType { } public static List getModelTypes(List ts) { - ListBuffer lb = new ListBuffer(); + ListBuffer lb = new ListBuffer<>(); for (Type t: ts) lb.append(t.getModelType()); return lb.toList(); @@ -185,8 +167,7 @@ public class Type implements PrimitiveType { /** Define a type given its tag and type symbol */ - public Type(TypeTag tag, TypeSymbol tsym) { - this.tag = tag; + public Type(TypeSymbol tsym) { this.tsym = tsym; } @@ -225,18 +206,7 @@ public class Type implements PrimitiveType { * and with given constant value */ public Type constType(Object constValue) { - final Object value = constValue; - Assert.check(isPrimitive()); - return new Type(tag, tsym) { - @Override - public Object constValue() { - return value; - } - @Override - public Type baseType() { - return tsym.type; - } - }; + throw new AssertionError(); } /** @@ -294,7 +264,9 @@ public class Type implements PrimitiveType { String s = (tsym == null || tsym.name == null) ? "" : tsym.name.toString(); - if (moreInfo && tag == TYPEVAR) s = s + hashCode(); + if (moreInfo && hasTag(TYPEVAR)) { + s = s + hashCode(); + } return s; } @@ -320,12 +292,7 @@ public class Type implements PrimitiveType { */ public String stringValue() { Object cv = Assert.checkNonNull(constValue()); - if (tag == BOOLEAN) - return ((Integer) cv).intValue() == 0 ? "false" : "true"; - else if (tag == CHAR) - return String.valueOf((char) ((Integer) cv).intValue()); - else - return cv.toString(); + return cv.toString(); } /** @@ -343,24 +310,6 @@ public class Type implements PrimitiveType { return super.hashCode(); } - /** Is this a constant type whose value is false? - */ - public boolean isFalse() { - return - tag == BOOLEAN && - constValue() != null && - ((Integer)constValue()).intValue() == 0; - } - - /** Is this a constant type whose value is true? - */ - public boolean isTrue() { - return - tag == BOOLEAN && - constValue() != null && - ((Integer)constValue()).intValue() != 0; - } - public String argtypes(boolean varargs) { List args = getParameterTypes(); if (!varargs) return args.toString(); @@ -370,7 +319,7 @@ public class Type implements PrimitiveType { args = args.tail; buf.append(','); } - if (args.head.unannotatedType().tag == ARRAY) { + if (args.head.unannotatedType().hasTag(ARRAY)) { buf.append(((ArrayType)args.head.unannotatedType()).elemtype); if (args.head.getAnnotationMirrors().nonEmpty()) { buf.append(args.head.getAnnotationMirrors()); @@ -507,28 +456,122 @@ public class Type implements PrimitiveType { return tsym; } + @Override public TypeKind getKind() { - switch (tag) { - case BYTE: return TypeKind.BYTE; - case CHAR: return TypeKind.CHAR; - case SHORT: return TypeKind.SHORT; - case INT: return TypeKind.INT; - case LONG: return TypeKind.LONG; - case FLOAT: return TypeKind.FLOAT; - case DOUBLE: return TypeKind.DOUBLE; - case BOOLEAN: return TypeKind.BOOLEAN; - case VOID: return TypeKind.VOID; - case BOT: return TypeKind.NULL; - case NONE: return TypeKind.NONE; - default: return TypeKind.OTHER; - } + return TypeKind.OTHER; } + @Override public R accept(TypeVisitor v, P p) { - if (isPrimitive()) + throw new AssertionError(); + } + + public static class JCPrimitiveType extends Type + implements javax.lang.model.type.PrimitiveType { + + TypeTag tag; + + public JCPrimitiveType(TypeTag tag, TypeSymbol tsym) { + super(tsym); + this.tag = tag; + Assert.check(tag.isPrimitive); + } + + @Override + public boolean isNumeric() { + return tag != BOOLEAN; + } + + @Override + public boolean isPrimitive() { + return true; + } + + @Override + public TypeTag getTag() { + return tag; + } + + @Override + public boolean isPrimitiveOrVoid() { + return true; + } + + /** Define a constant type, of the same kind as this type + * and with given constant value + */ + @Override + public Type constType(Object constValue) { + final Object value = constValue; + return new JCPrimitiveType(tag, tsym) { + @Override + public Object constValue() { + return value; + } + @Override + public Type baseType() { + return tsym.type; + } + }; + } + + /** + * The constant value of this type, converted to String + */ + @Override + public String stringValue() { + Object cv = Assert.checkNonNull(constValue()); + if (tag == BOOLEAN) { + return ((Integer) cv).intValue() == 0 ? "false" : "true"; + } + else if (tag == CHAR) { + return String.valueOf((char) ((Integer) cv).intValue()); + } + else { + return cv.toString(); + } + } + + /** Is this a constant type whose value is false? + */ + @Override + public boolean isFalse() { + return + tag == BOOLEAN && + constValue() != null && + ((Integer)constValue()).intValue() == 0; + } + + /** Is this a constant type whose value is true? + */ + @Override + public boolean isTrue() { + return + tag == BOOLEAN && + constValue() != null && + ((Integer)constValue()).intValue() != 0; + } + + @Override + public R accept(TypeVisitor v, P p) { return v.visitPrimitive(this, p); - else + } + + @Override + public TypeKind getKind() { + switch (tag) { + case BYTE: return TypeKind.BYTE; + case CHAR: return TypeKind.CHAR; + case SHORT: return TypeKind.SHORT; + case INT: return TypeKind.INT; + case LONG: return TypeKind.LONG; + case FLOAT: return TypeKind.FLOAT; + case DOUBLE: return TypeKind.DOUBLE; + case BOOLEAN: return TypeKind.BOOLEAN; + } throw new AssertionError(); + } + } public static class WildcardType extends Type @@ -544,7 +587,7 @@ public class Type implements PrimitiveType { } public WildcardType(Type type, BoundKind kind, TypeSymbol tsym) { - super(WILDCARD, tsym); + super(tsym); this.type = Assert.checkNonNull(type); this.kind = kind; } @@ -557,6 +600,12 @@ public class Type implements PrimitiveType { this.bound = bound; } + @Override + public TypeTag getTag() { + return WILDCARD; + } + + @Override public boolean contains(Type t) { return kind != UNBOUND && type.contains(t); } @@ -573,6 +622,17 @@ public class Type implements PrimitiveType { return kind == UNBOUND; } + @Override + public boolean isReference() { + return true; + } + + @Override + public boolean isNullOrReference() { + return true; + } + + @Override public Type withTypeVar(Type t) { //-System.err.println(this+".withTypeVar("+t+");");//DEBUG if (bound == t) @@ -662,7 +722,7 @@ public class Type implements PrimitiveType { public List all_interfaces_field; public ClassType(Type outer, List typarams, TypeSymbol tsym) { - super(CLASS, tsym); + super(tsym); this.outer_field = outer; this.typarams_field = typarams; this.allparams_field = null; @@ -679,6 +739,11 @@ public class Type implements PrimitiveType { */ } + @Override + public TypeTag getTag() { + return CLASS; + } + @Override public R accept(Type.Visitor v, S s) { return v.visitClassType(this, s); @@ -702,7 +767,7 @@ public class Type implements PrimitiveType { */ public String toString() { StringBuilder buf = new StringBuilder(); - if (getEnclosingType().tag == CLASS && tsym.owner.kind == TYP) { + if (getEnclosingType().hasTag(CLASS) && tsym.owner.kind == TYP) { buf.append(getEnclosingType().toString()); buf.append("."); buf.append(className(tsym, false)); @@ -787,6 +852,16 @@ public class Type implements PrimitiveType { // optimization, was: allparams().nonEmpty(); } + @Override + public boolean isReference() { + return true; + } + + @Override + public boolean isNullOrReference() { + return true; + } + /** A cache for the rank. */ int rank_field = -1; @@ -931,11 +1006,15 @@ public class Type implements PrimitiveType { public Type elemtype; public ArrayType(Type elemtype, TypeSymbol arrayClass) { - super(ARRAY, arrayClass); + super(arrayClass); this.elemtype = elemtype; } @Override + public TypeTag getTag() { + return ARRAY; + } + public R accept(Type.Visitor v, S s) { return v.visitArrayType(this, s); } @@ -969,6 +1048,16 @@ public class Type implements PrimitiveType { return elemtype.isParameterized(); } + @Override + public boolean isReference() { + return true; + } + + @Override + public boolean isNullOrReference() { + return true; + } + public boolean isRaw() { return elemtype.isRaw(); } @@ -1023,13 +1112,17 @@ public class Type implements PrimitiveType { Type restype, List thrown, TypeSymbol methodClass) { - super(METHOD, methodClass); + super(methodClass); this.argtypes = argtypes; this.restype = restype; this.thrown = thrown; } @Override + public TypeTag getTag() { + return METHOD; + } + public R accept(Type.Visitor v, S s) { return v.visitMethodType(this, s); } @@ -1099,7 +1192,12 @@ public class Type implements PrimitiveType { public static class PackageType extends Type implements NoType { PackageType(TypeSymbol tsym) { - super(PACKAGE, tsym); + super(tsym); + } + + @Override + public TypeTag getTag() { + return PACKAGE; } @Override @@ -1142,17 +1240,22 @@ public class Type implements PrimitiveType { public Type lower; public TypeVar(Name name, Symbol owner, Type lower) { - super(TYPEVAR, null); + super(null); tsym = new TypeVariableSymbol(0, name, this, owner); this.lower = lower; } public TypeVar(TypeSymbol tsym, Type bound, Type lower) { - super(TYPEVAR, tsym); + super(tsym); this.bound = bound; this.lower = lower; } + @Override + public TypeTag getTag() { + return TYPEVAR; + } + @Override public R accept(Type.Visitor v, S s) { return v.visitTypeVar(this, s); @@ -1160,8 +1263,9 @@ public class Type implements PrimitiveType { @Override public Type getUpperBound() { - if ((bound == null || bound.tag == NONE) && this != tsym.type) + if ((bound == null || bound.hasTag(NONE)) && this != tsym.type) { bound = tsym.type.getUpperBound(); + } return bound; } @@ -1180,6 +1284,17 @@ public class Type implements PrimitiveType { return false; } + @Override + public boolean isReference() { + return true; + } + + @Override + public boolean isNullOrReference() { + return true; + } + + @Override public R accept(TypeVisitor v, P p) { return v.visitTypeVariable(this, p); } @@ -1225,10 +1340,13 @@ public class Type implements PrimitiveType { public static abstract class DelegatedType extends Type { public Type qtype; + public TypeTag tag; public DelegatedType(TypeTag tag, Type qtype) { - super(tag, qtype.tsym); + super(qtype.tsym); + this.tag = tag; this.qtype = qtype; } + public TypeTag getTag() { return tag; } public String toString() { return qtype.toString(); } public List getTypeArguments() { return qtype.getTypeArguments(); } public Type getEnclosingType() { return qtype.getEnclosingType(); } @@ -1362,6 +1480,12 @@ public class Type implements PrimitiveType { else return qtype + "?"; } + @Override + public boolean isPartial() { + return true; + } + + @Override public Type baseType() { if (inst != null) return inst.baseType(); else return this; @@ -1461,21 +1585,21 @@ public class Type implements PrimitiveType { } } - /** Represents VOID or NONE. + /** Represents NONE. */ - static class JCNoType extends Type implements NoType { - public JCNoType(TypeTag tag) { - super(tag, null); + public static class JCNoType extends Type implements NoType { + public JCNoType() { + super(null); + } + + @Override + public TypeTag getTag() { + return NONE; } @Override public TypeKind getKind() { - switch (tag) { - case VOID: return TypeKind.VOID; - case NONE: return TypeKind.NONE; - default: - throw new AssertionError("Unexpected tag: " + tag); - } + return TypeKind.NONE; } @Override @@ -1484,9 +1608,43 @@ public class Type implements PrimitiveType { } } + /** Represents VOID. + */ + public static class JCVoidType extends Type implements NoType { + + public JCVoidType() { + super(null); + } + + @Override + public TypeTag getTag() { + return VOID; + } + + @Override + public TypeKind getKind() { + return TypeKind.VOID; + } + + @Override + public R accept(TypeVisitor v, P p) { + return v.visitNoType(this, p); + } + + @Override + public boolean isPrimitiveOrVoid() { + return true; + } + } + static class BottomType extends Type implements NullType { public BottomType() { - super(BOT, null); + super(null); + } + + @Override + public TypeTag getTag() { + return BOT; } @Override @@ -1508,6 +1666,12 @@ public class Type implements PrimitiveType { public String stringValue() { return "null"; } + + @Override + public boolean isNullOrReference() { + return true; + } + } public static class ErrorType extends ClassType @@ -1517,7 +1681,6 @@ public class Type implements PrimitiveType { public ErrorType(Type originalType, TypeSymbol tsym) { super(noType, List.nil(), null); - tag = ERROR; this.tsym = tsym; this.originalType = (originalType == null ? noType : originalType); } @@ -1529,6 +1692,26 @@ public class Type implements PrimitiveType { c.members_field = new Scope.ErrorScope(c); } + @Override + public TypeTag getTag() { + return ERROR; + } + + @Override + public boolean isPartial() { + return true; + } + + @Override + public boolean isReference() { + return true; + } + + @Override + public boolean isNullOrReference() { + return true; + } + public ErrorType(Name name, TypeSymbol container, Type originalType) { this(new ClassSymbol(PUBLIC|STATIC|ACYCLIC, name, null, container), originalType); } @@ -1581,7 +1764,7 @@ public class Type implements PrimitiveType { public Type underlyingType; public AnnotatedType(Type underlyingType) { - super(underlyingType.tag, underlyingType.tsym); + super(underlyingType.tsym); this.typeAnnotations = List.nil(); this.underlyingType = underlyingType; Assert.check(!underlyingType.isAnnotated(), @@ -1590,7 +1773,7 @@ public class Type implements PrimitiveType { public AnnotatedType(List typeAnnotations, Type underlyingType) { - super(underlyingType.tag, underlyingType.tsym); + super(underlyingType.tsym); this.typeAnnotations = typeAnnotations; this.underlyingType = underlyingType; Assert.check(!underlyingType.isAnnotated(), @@ -1598,6 +1781,11 @@ public class Type implements PrimitiveType { "; adding: " + typeAnnotations); } + @Override + public TypeTag getTag() { + return underlyingType.getTag(); + } + @Override public boolean isAnnotated() { return true; @@ -1673,10 +1861,18 @@ public class Type implements PrimitiveType { @Override public List allparams() { return underlyingType.allparams(); } @Override + public boolean isPrimitive() { return underlyingType.isPrimitive(); } + @Override + public boolean isPrimitiveOrVoid() { return underlyingType.isPrimitiveOrVoid(); } + @Override public boolean isNumeric() { return underlyingType.isNumeric(); } @Override public boolean isReference() { return underlyingType.isReference(); } @Override + public boolean isNullOrReference() { return underlyingType.isNullOrReference(); } + @Override + public boolean isPartial() { return underlyingType.isPartial(); } + @Override public boolean isParameterized() { return underlyingType.isParameterized(); } @Override public boolean isRaw() { return underlyingType.isRaw(); } @@ -1741,6 +1937,28 @@ public class Type implements PrimitiveType { public TypeMirror getSuperBound() { return ((WildcardType)underlyingType).getSuperBound(); } } + public static class UnknownType extends Type { + + public UnknownType() { + super(null); + } + + @Override + public TypeTag getTag() { + return UNKNOWN; + } + + @Override + public R accept(TypeVisitor v, P p) { + return v.visitUnknown(this, p); + } + + @Override + public boolean isPartial() { + return true; + } + } + /** * A visitor for types. A visitor is used to implement operations * (or relations) on types. Most common operations on types are diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java index d786621e918..418f1e13406 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,8 @@ import com.sun.source.tree.Tree.Kind; import javax.lang.model.type.TypeKind; +import static com.sun.tools.javac.code.TypeTag.NumericClasses.*; + /** An interface for type tag values, which distinguish between different * sorts of types. * @@ -40,35 +42,32 @@ import javax.lang.model.type.TypeKind; public enum TypeTag { /** The tag of the basic type `byte'. */ - BYTE(1), + BYTE(BYTE_CLASS, BYTE_SUPERCLASSES, true), /** The tag of the basic type `char'. */ - CHAR(2), + CHAR(CHAR_CLASS, CHAR_SUPERCLASSES, true), /** The tag of the basic type `short'. */ - SHORT(3), - - /** The tag of the basic type `int'. - */ - INT(4), + SHORT(SHORT_CLASS, SHORT_SUPERCLASSES, true), /** The tag of the basic type `long'. */ - LONG(5), + LONG(LONG_CLASS, LONG_SUPERCLASSES, true), /** The tag of the basic type `float'. */ - FLOAT(6), - + FLOAT(FLOAT_CLASS, FLOAT_SUPERCLASSES, true), + /** The tag of the basic type `int'. + */ + INT(INT_CLASS, INT_SUPERCLASSES, true), /** The tag of the basic type `double'. */ - DOUBLE(7), - + DOUBLE(DOUBLE_CLASS, DOUBLE_CLASS, true), /** The tag of the basic type `boolean'. */ - BOOLEAN, + BOOLEAN(0, 0, true), /** The tag of the type `void'. */ @@ -132,21 +131,56 @@ public enum TypeTag { UNINITIALIZED_OBJECT; - /** This field will only be used for tags related with numeric types for - * optimization reasons. - */ - private final int order; + final int superClasses; + final int numericClass; + final boolean isPrimitive; private TypeTag() { - this(0); + this(0, 0, false); } - private TypeTag(int order) { - this.order = order; + private TypeTag(int numericClass, int superClasses, boolean isPrimitive) { + this.superClasses = superClasses; + this.numericClass = numericClass; + this.isPrimitive = isPrimitive; } - private static final int MIN_NUMERIC_TAG_ORDER = 1; - private static final int MAX_NUMERIC_TAG_ORDER = 7; + public static class NumericClasses { + public static final int BYTE_CLASS = 1; + public static final int CHAR_CLASS = 2; + public static final int SHORT_CLASS = 4; + public static final int INT_CLASS = 8; + public static final int LONG_CLASS = 16; + public static final int FLOAT_CLASS = 32; + public static final int DOUBLE_CLASS = 64; + + static final int BYTE_SUPERCLASSES = BYTE_CLASS | SHORT_CLASS | INT_CLASS | + LONG_CLASS | FLOAT_CLASS | DOUBLE_CLASS; + + static final int CHAR_SUPERCLASSES = CHAR_CLASS | INT_CLASS | + LONG_CLASS | FLOAT_CLASS | DOUBLE_CLASS; + + static final int SHORT_SUPERCLASSES = SHORT_CLASS | INT_CLASS | + LONG_CLASS | FLOAT_CLASS | DOUBLE_CLASS; + + static final int INT_SUPERCLASSES = INT_CLASS | LONG_CLASS | FLOAT_CLASS | DOUBLE_CLASS; + + static final int LONG_SUPERCLASSES = LONG_CLASS | FLOAT_CLASS | DOUBLE_CLASS; + + static final int FLOAT_SUPERCLASSES = FLOAT_CLASS | DOUBLE_CLASS; + } + + public boolean isStrictSubRangeOf(TypeTag tag) { + /* Please don't change the implementation of this method to call method + * isSubRangeOf. Both methods are called from hotspot code, the current + * implementation is better performance-wise than the commented modification. + */ + return (this.superClasses & tag.numericClass) != 0 && this != tag; + } + + public boolean isSubRangeOf(TypeTag tag) { + return (this.superClasses & tag.numericClass) != 0; + } /** Returns the number of type tags. */ @@ -155,29 +189,6 @@ public enum TypeTag { return (UNDETVAR.ordinal() + 1); } - public boolean isSubRangeOf(TypeTag range) { - return (this == range) || isStrictSubRangeOf(range); - } - - public boolean isStrictSubRangeOf(TypeTag range) { - if (this.order >= MIN_NUMERIC_TAG_ORDER && this.order <= MAX_NUMERIC_TAG_ORDER && - range.order >= MIN_NUMERIC_TAG_ORDER && this.order <= MAX_NUMERIC_TAG_ORDER) { - if (this == range) - return false; - switch (this) { - case BYTE: - return true; - case CHAR: case SHORT: case INT: - case LONG: case FLOAT: - return this.order < range.order && range.order <= MAX_NUMERIC_TAG_ORDER; - default: - return false; - } - } - else - return false; - } - public Kind getKindLiteral() { switch (this) { case INT: @@ -225,4 +236,5 @@ public enum TypeTag { throw new AssertionError("unknown primitive type " + this); } } + } diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java index 0927a339e1e..8a3b4235714 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java @@ -286,8 +286,9 @@ public class Types { * conversion to s? */ public boolean isConvertible(Type t, Type s, Warner warn) { - if (t.tag == ERROR) + if (t.hasTag(ERROR)) { return true; + } boolean tPrimitive = t.isPrimitive(); boolean sPrimitive = s.isPrimitive(); if (tPrimitive == sPrimitive) { @@ -396,7 +397,8 @@ public class Types { /** * Compute the function descriptor associated with a given functional interface */ - public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, CompoundScope membersCache) throws FunctionDescriptorLookupError { + public FunctionDescriptor findDescriptorInternal(TypeSymbol origin, + CompoundScope membersCache) throws FunctionDescriptorLookupError { if (!origin.isInterface() || (origin.flags() & ANNOTATION) != 0) { //t must be an interface throw failure("not.a.functional.intf", origin); @@ -655,17 +657,16 @@ public class Types { } } else if (isSubtype(t, s)) { return true; - } - else if (t.tag == TYPEVAR) { + } else if (t.hasTag(TYPEVAR)) { return isSubtypeUnchecked(t.getUpperBound(), s, warn); - } - else if (!s.isRaw()) { + } else if (!s.isRaw()) { Type t2 = asSuper(t, s.tsym); if (t2 != null && t2.isRaw()) { - if (isReifiable(s)) + if (isReifiable(s)) { warn.silentWarn(LintCategory.UNCHECKED); - else + } else { warn.warn(LintCategory.UNCHECKED); + } return true; } } @@ -673,13 +674,14 @@ public class Types { } private void checkUnsafeVarargsConversion(Type t, Type s, Warner warn) { - if (t.tag != ARRAY || isReifiable(t)) + if (!t.hasTag(ARRAY) || isReifiable(t)) { return; + } t = t.unannotatedType(); s = s.unannotatedType(); ArrayType from = (ArrayType)t; boolean shouldWarn = false; - switch (s.tag) { + switch (s.getTag()) { case ARRAY: ArrayType to = (ArrayType)s; shouldWarn = from.isVarargs() && @@ -735,8 +737,9 @@ public class Types { // where private TypeRelation isSubtype = new TypeRelation() { + @Override public Boolean visitType(Type t, Type s) { - switch (t.tag) { + switch (t.getTag()) { case BYTE: return (!s.hasTag(CHAR) && t.getTag().isSubRangeOf(s.getTag())); case CHAR: @@ -756,7 +759,7 @@ public class Types { case NONE: return false; default: - throw new AssertionError("isSubtype " + t.tag); + throw new AssertionError("isSubtype " + t.getTag()); } } @@ -826,14 +829,14 @@ public class Types { @Override public Boolean visitArrayType(ArrayType t, Type s) { - if (s.tag == ARRAY) { + if (s.hasTag(ARRAY)) { if (t.elemtype.isPrimitive()) return isSameType(t.elemtype, elemtype(s)); else return isSubtypeNoCapture(t.elemtype, elemtype(s)); } - if (s.tag == CLASS) { + if (s.hasTag(CLASS)) { Name sname = s.tsym.getQualifiedName(); return sname == names.java_lang_Object || sname == names.java_lang_Cloneable @@ -846,9 +849,9 @@ public class Types { @Override public Boolean visitUndetVar(UndetVar t, Type s) { //todo: test against origin needed? or replace with substitution? - if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN) { + if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) { return true; - } else if (s.tag == BOT) { + } else if (s.hasTag(BOT)) { //if 's' is 'null' there's no instantiated type U for which //U <: s (but 'null' itself, which is not a valid type) return false; @@ -913,15 +916,17 @@ public class Types { * Is t a supertype of s? */ public boolean isSuperType(Type t, Type s) { - switch (t.tag) { + switch (t.getTag()) { case ERROR: return true; case UNDETVAR: { UndetVar undet = (UndetVar)t; if (t == s || undet.qtype == s || - s.tag == ERROR || - s.tag == BOT) return true; + s.hasTag(ERROR) || + s.hasTag(BOT)) { + return true; + } undet.addBound(InferenceBound.LOWER, s, this); return true; } @@ -950,6 +955,22 @@ public class Types { /*inlined: ts.isEmpty() && ss.isEmpty();*/ } + /** + * A polymorphic signature method (JLS SE 7, 8.4.1) is a method that + * (i) is declared in the java.lang.invoke.MethodHandle class, (ii) takes + * a single variable arity parameter (iii) whose declared type is Object[], + * (iv) has a return type of Object and (v) is native. + */ + public boolean isSignaturePolymorphic(MethodSymbol msym) { + List argtypes = msym.type.getParameterTypes(); + return (msym.flags_field & NATIVE) != 0 && + msym.owner == syms.methodHandleType.tsym && + argtypes.tail.tail == null && + argtypes.head.hasTag(TypeTag.ARRAY) && + msym.type.getReturnType().tsym == syms.objectType.tsym && + ((ArrayType)argtypes.head).elemtype.tsym == syms.objectType.tsym; + } + /** * Is t the same type as s? */ @@ -974,12 +995,12 @@ public class Types { if (s.isPartial()) return visit(s, t); - switch (t.tag) { + switch (t.getTag()) { case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE: - return t.tag == s.tag; + return t.hasTag(s.getTag()); case TYPEVAR: { - if (s.tag == TYPEVAR) { + if (s.hasTag(TYPEVAR)) { //type-substitution does not preserve type-var types //check that type var symbols and bounds are indeed the same return sameTypeVars((TypeVar)t.unannotatedType(), (TypeVar)s.unannotatedType()); @@ -993,7 +1014,7 @@ public class Types { } } default: - throw new AssertionError("isSameType " + t.tag); + throw new AssertionError("isSameType " + t.getTag()); } } @@ -1064,8 +1085,9 @@ public class Types { @Override public Boolean visitForAll(ForAll t, Type s) { - if (s.tag != FORALL) + if (!s.hasTag(FORALL)) { return false; + } ForAll forAll = (ForAll)s; return hasSameBounds(t, forAll) @@ -1074,12 +1096,14 @@ public class Types { @Override public Boolean visitUndetVar(UndetVar t, Type s) { - if (s.tag == WILDCARD) + if (s.hasTag(WILDCARD)) { // FIXME, this might be leftovers from before capture conversion return false; + } - if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN) + if (t == s || t.qtype == s || s.hasTag(ERROR) || s.hasTag(UNKNOWN)) { return true; + } t.addBound(InferenceBound.EQ, s, Types.this); @@ -1155,9 +1179,9 @@ public class Types { // public boolean containedBy(Type t, Type s) { - switch (t.tag) { + switch (t.getTag()) { case UNDETVAR: - if (s.tag == WILDCARD) { + if (s.hasTag(WILDCARD)) { UndetVar undetvar = (UndetVar)t; WildcardType wt = (WildcardType)s.unannotatedType(); switch(wt.kind) { @@ -1225,7 +1249,7 @@ public class Types { private TypeRelation containsType = new TypeRelation() { private Type U(Type t) { - while (t.tag == WILDCARD) { + while (t.hasTag(WILDCARD)) { WildcardType w = (WildcardType)t.unannotatedType(); if (w.isSuperBound()) return w.bound == null ? syms.objectType : w.bound.bound; @@ -1236,7 +1260,7 @@ public class Types { } private Type L(Type t) { - while (t.tag == WILDCARD) { + while (t.hasTag(WILDCARD)) { WildcardType w = (WildcardType)t.unannotatedType(); if (w.isExtendsBound()) return syms.botType; @@ -1282,10 +1306,11 @@ public class Types { @Override public Boolean visitUndetVar(UndetVar t, Type s) { - if (s.tag != WILDCARD) + if (!s.hasTag(WILDCARD)) { return isSameType(t, s); - else + } else { return false; + } } @Override @@ -1295,13 +1320,13 @@ public class Types { }; public boolean isCaptureOf(Type s, WildcardType t) { - if (s.tag != TYPEVAR || !((TypeVar)s.unannotatedType()).isCaptured()) + if (!s.hasTag(TYPEVAR) || !((TypeVar)s.unannotatedType()).isCaptured()) return false; return isSameWildcard(t, ((CapturedType)s.unannotatedType()).wildcard); } public boolean isSameWildcard(WildcardType t, Type s) { - if (s.tag != WILDCARD) + if (!s.hasTag(WILDCARD)) return false; WildcardType w = (WildcardType)s.unannotatedType(); return w.kind == t.kind && w.type == t.type; @@ -1317,6 +1342,26 @@ public class Types { } // + /** + * Can t and s be compared for equality? Any primitive == + * primitive or primitive == object comparisons here are an error. + * Unboxing and correct primitive == primitive comparisons are + * already dealt with in Attr.visitBinary. + * + */ + public boolean isEqualityComparable(Type s, Type t, Warner warn) { + if (t.isNumeric() && s.isNumeric()) + return true; + + boolean tPrimitive = t.isPrimitive(); + boolean sPrimitive = s.isPrimitive(); + if (!tPrimitive && !sPrimitive) { + return isCastable(s, t, warn) || isCastable(t, s, warn); + } else { + return false; + } + } + // public boolean isCastable(Type t, Type s) { return isCastable(t, s, noWarnings); @@ -1353,15 +1398,15 @@ public class Types { private TypeRelation isCastable = new TypeRelation() { public Boolean visitType(Type t, Type s) { - if (s.tag == ERROR) + if (s.hasTag(ERROR)) return true; - switch (t.tag) { + switch (t.getTag()) { case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT: case DOUBLE: return s.isNumeric(); case BOOLEAN: - return s.tag == BOOLEAN; + return s.hasTag(BOOLEAN); case VOID: return false; case BOT: @@ -1378,10 +1423,10 @@ public class Types { @Override public Boolean visitClassType(ClassType t, Type s) { - if (s.tag == ERROR || s.tag == BOT) + if (s.hasTag(ERROR) || s.hasTag(BOT)) return true; - if (s.tag == TYPEVAR) { + if (s.hasTag(TYPEVAR)) { if (isCastable(t, s.getUpperBound(), noWarnings)) { warnStack.head.warn(LintCategory.UNCHECKED); return true; @@ -1396,11 +1441,11 @@ public class Types { visitIntersectionType((IntersectionClassType)t.unannotatedType(), s, false); } - if (s.tag == CLASS || s.tag == ARRAY) { + if (s.hasTag(CLASS) || s.hasTag(ARRAY)) { boolean upcast; if ((upcast = isSubtype(erasure(t), erasure(s))) || isSubtype(erasure(s), erasure(t))) { - if (!upcast && s.tag == ARRAY) { + if (!upcast && s.hasTag(ARRAY)) { if (!isReifiable(s)) warnStack.head.warn(LintCategory.UNCHECKED); return true; @@ -1453,7 +1498,7 @@ public class Types { } // Sidecast - if (s.tag == CLASS) { + if (s.hasTag(CLASS)) { if ((s.tsym.flags() & INTERFACE) != 0) { return ((t.tsym.flags() & FINAL) == 0) ? sideCast(t, s, warnStack.head) @@ -1485,7 +1530,7 @@ public class Types { @Override public Boolean visitArrayType(ArrayType t, Type s) { - switch (s.tag) { + switch (s.getTag()) { case ERROR: case BOT: return true; @@ -1500,7 +1545,7 @@ public class Types { return isSubtype(t, s); case ARRAY: if (elemtype(t).isPrimitive() || elemtype(s).isPrimitive()) { - return elemtype(t).tag == elemtype(s).tag; + return elemtype(t).hasTag(elemtype(s).getTag()); } else { return visit(elemtype(t), elemtype(s)); } @@ -1511,7 +1556,7 @@ public class Types { @Override public Boolean visitTypeVar(TypeVar t, Type s) { - switch (s.tag) { + switch (s.getTag()) { case ERROR: case BOT: return true; @@ -1563,8 +1608,9 @@ public class Types { private Set cache = new HashSet(); + @Override public Boolean visitType(Type t, Type s) { - if (s.tag == WILDCARD) + if (s.hasTag(WILDCARD)) return visit(s, t); else return notSoftSubtypeRecursive(t, s) || notSoftSubtypeRecursive(s, t); @@ -1601,10 +1647,10 @@ public class Types { if (t.isUnbound()) return false; - if (s.tag != WILDCARD) { + if (!s.hasTag(WILDCARD)) { if (t.isExtendsBound()) return notSoftSubtypeRecursive(s, t.type); - else // isSuperBound() + else return notSoftSubtypeRecursive(t.type, s); } @@ -1653,21 +1699,21 @@ public class Types { */ public boolean notSoftSubtype(Type t, Type s) { if (t == s) return false; - if (t.tag == TYPEVAR) { + if (t.hasTag(TYPEVAR)) { TypeVar tv = (TypeVar) t; return !isCastable(tv.bound, relaxBound(s), noWarnings); } - if (s.tag != WILDCARD) + if (!s.hasTag(WILDCARD)) s = upperBound(s); return !isSubtype(t, relaxBound(s)); } private Type relaxBound(Type t) { - if (t.tag == TYPEVAR) { - while (t.tag == TYPEVAR) + if (t.hasTag(TYPEVAR)) { + while (t.hasTag(TYPEVAR)) t = t.getUpperBound(); t = rewriteQuantifiers(t, true, true); } @@ -1716,16 +1762,16 @@ public class Types { // public boolean isArray(Type t) { - while (t.tag == WILDCARD) + while (t.hasTag(WILDCARD)) t = upperBound(t); - return t.tag == ARRAY; + return t.hasTag(ARRAY); } /** * The element type of an array. */ public Type elemtype(Type t) { - switch (t.tag) { + switch (t.getTag()) { case WILDCARD: return elemtype(upperBound(t)); case ARRAY: @@ -1759,7 +1805,7 @@ public class Types { */ public int dimensions(Type t) { int result = 0; - while (t.tag == ARRAY) { + while (t.hasTag(ARRAY)) { result++; t = elemtype(t); } @@ -1773,8 +1819,7 @@ public class Types { * @return the ArrayType for the given component */ public ArrayType makeArrayType(Type t) { - if (t.tag == VOID || - t.tag == PACKAGE) { + if (t.hasTag(VOID) || t.hasTag(PACKAGE)) { Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString()); } return new ArrayType(t, syms.arrayClass); @@ -1805,7 +1850,7 @@ public class Types { return t; Type st = supertype(t); - if (st.tag == CLASS || st.tag == TYPEVAR || st.tag == ERROR) { + if (st.hasTag(CLASS) || st.hasTag(TYPEVAR) || st.hasTag(ERROR)) { Type x = asSuper(st, sym); if (x != null) return x; @@ -1847,13 +1892,13 @@ public class Types { * @param sym a symbol */ public Type asOuterSuper(Type t, Symbol sym) { - switch (t.tag) { + switch (t.getTag()) { case CLASS: do { Type s = asSuper(t, sym); if (s != null) return s; t = t.getEnclosingType(); - } while (t.tag == CLASS); + } while (t.hasTag(CLASS)); return null; case ARRAY: return isSubtype(t, sym.type) ? sym.type : null; @@ -1874,16 +1919,16 @@ public class Types { * @param sym a symbol */ public Type asEnclosingSuper(Type t, Symbol sym) { - switch (t.tag) { + switch (t.getTag()) { case CLASS: do { Type s = asSuper(t, sym); if (s != null) return s; Type outer = t.getEnclosingType(); - t = (outer.tag == CLASS) ? outer : + t = (outer.hasTag(CLASS)) ? outer : (t.tsym.owner.enclClass() != null) ? t.tsym.owner.enclClass().type : Type.noType; - } while (t.tag == CLASS); + } while (t.hasTag(CLASS)); return null; case ARRAY: return isSubtype(t, sym.type) ? sym.type : null; @@ -1971,11 +2016,11 @@ public class Types { * (not defined for Method and ForAll types) */ public boolean isAssignable(Type t, Type s, Warner warn) { - if (t.tag == ERROR) + if (t.hasTag(ERROR)) return true; - if (t.tag.isSubRangeOf(INT) && t.constValue() != null) { + if (t.getTag().isSubRangeOf(INT) && t.constValue() != null) { int value = ((Number)t.constValue()).intValue(); - switch (s.tag) { + switch (s.getTag()) { case BYTE: if (Byte.MIN_VALUE <= value && value <= Byte.MAX_VALUE) return true; @@ -1991,7 +2036,7 @@ public class Types { case INT: return true; case CLASS: - switch (unboxedType(s).tag) { + switch (unboxedType(s).getTag()) { case BYTE: case CHAR: case SHORT: @@ -2119,7 +2164,7 @@ public class Types { null, syms.noSymbol); bc.type = new IntersectionClassType(bounds, bc, allInterfaces); - bc.erasure_field = (bounds.head.tag == TYPEVAR) ? + bc.erasure_field = (bounds.head.hasTag(TYPEVAR)) ? syms.objectType : // error condition, recover erasure(firstExplicitBound); bc.members_field = new Scope(bc); @@ -2182,7 +2227,7 @@ public class Types { */ @Override public Type visitTypeVar(TypeVar t, Void ignored) { - if (t.bound.tag == TYPEVAR || + if (t.bound.hasTag(TYPEVAR) || (!t.bound.isCompound() && !t.bound.isInterface())) { return t.bound; } else { @@ -2486,8 +2531,8 @@ public class Types { } private MethodSymbol implementationInternal(MethodSymbol ms, TypeSymbol origin, boolean checkResult, Filter implFilter) { - for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = supertype(t)) { - while (t.tag == TYPEVAR) + for (Type t = origin.type; t.hasTag(CLASS) || t.hasTag(TYPEVAR); t = supertype(t)) { + while (t.hasTag(TYPEVAR)) t = t.getUpperBound(); TypeSymbol c = t.tsym; for (Scope.Entry e = c.members().lookup(ms.name, implFilter); @@ -2668,13 +2713,13 @@ public class Types { @Override public Boolean visitMethodType(MethodType t, Type s) { - return s.tag == METHOD + return s.hasTag(METHOD) && containsTypeEquivalent(t.argtypes, s.getParameterTypes()); } @Override public Boolean visitForAll(ForAll t, Type s) { - if (s.tag != FORALL) + if (!s.hasTag(FORALL)) return strict ? false : visitMethodType(t.asMethodType(), s); ForAll forAll = (ForAll)s; @@ -3009,7 +3054,7 @@ public class Types { */ public int rank(Type t) { t = t.unannotatedType(); - switch(t.tag) { + switch(t.getTag()) { case CLASS: { ClassType cls = (ClassType)t; if (cls.rank_field < 0) { @@ -3075,7 +3120,7 @@ public class Types { */ @Deprecated public String toString(Type t) { - if (t.tag == FORALL) { + if (t.hasTag(FORALL)) { ForAll forAll = (ForAll)t; return typaramsString(forAll.tvars) + forAll.qtype; } @@ -3141,9 +3186,9 @@ public class Types { if (cl == null) { Type st = supertype(t); if (!t.isCompound()) { - if (st.tag == CLASS) { + if (st.hasTag(CLASS)) { cl = insert(closure(st), t); - } else if (st.tag == TYPEVAR) { + } else if (st.hasTag(TYPEVAR)) { cl = closure(st).prepend(t); } else { cl = List.of(t); @@ -3203,7 +3248,7 @@ public class Types { if (isSameType(cl1.head, cl2.head)) return intersect(cl1.tail, cl2.tail).prepend(cl1.head); if (cl1.head.tsym == cl2.head.tsym && - cl1.head.tag == CLASS && cl2.head.tag == CLASS) { + cl1.head.hasTag(CLASS) && cl2.head.hasTag(CLASS)) { if (cl1.head.isParameterized() && cl2.head.isParameterized()) { Type merge = merge(cl1.head,cl2.head); return intersect(cl1.tail, cl2.tail).prepend(merge); @@ -3327,7 +3372,7 @@ public class Types { final int CLASS_BOUND = 2; int boundkind = 0; for (Type t : ts) { - switch (t.tag) { + switch (t.getTag()) { case CLASS: boundkind |= CLASS_BOUND; break; @@ -3337,8 +3382,8 @@ public class Types { case TYPEVAR: do { t = t.getUpperBound(); - } while (t.tag == TYPEVAR); - if (t.tag == ARRAY) { + } while (t.hasTag(TYPEVAR)); + if (t.hasTag(ARRAY)) { boundkind |= ARRAY_BOUND; } else { boundkind |= CLASS_BOUND; @@ -3378,13 +3423,14 @@ public class Types { case CLASS_BOUND: // calculate lub(A, B) - while (ts.head.tag != CLASS && ts.head.tag != TYPEVAR) + while (!ts.head.hasTag(CLASS) && !ts.head.hasTag(TYPEVAR)) { ts = ts.tail; + } Assert.check(!ts.isEmpty()); //step 1 - compute erased candidate set (EC) List cl = erasedSupertypes(ts.head); for (Type t : ts.tail) { - if (t.tag == CLASS || t.tag == TYPEVAR) + if (t.hasTag(CLASS) || t.hasTag(TYPEVAR)) cl = intersect(cl, erasedSupertypes(t)); } //step 2 - compute minimal erased candidate set (MEC) @@ -3406,7 +3452,7 @@ public class Types { // calculate lub(A, B[]) List classes = List.of(arraySuperType()); for (Type t : ts) { - if (t.tag != ARRAY) // Filter out any arrays + if (!t.hasTag(ARRAY)) // Filter out any arrays classes = classes.prepend(t); } // lub(A, B[]) is lub(A, arraySuperType) @@ -3417,7 +3463,7 @@ public class Types { List erasedSupertypes(Type t) { ListBuffer buf = lb(); for (Type sup : closure(t)) { - if (sup.tag == TYPEVAR) { + if (sup.hasTag(TYPEVAR)) { buf.append(sup); } else { buf.append(erasure(sup)); @@ -3493,7 +3539,7 @@ public class Types { private static final UnaryVisitor hashCode = new UnaryVisitor() { public Integer visitType(Type t, Void ignored) { - return t.tag.ordinal(); + return t.getTag().ordinal(); } @Override @@ -3619,7 +3665,7 @@ public class Types { * Return the class that boxes the given primitive. */ public ClassSymbol boxedClass(Type t) { - return reader.enterClass(syms.boxedName[t.tag.ordinal()]); + return reader.enterClass(syms.boxedName[t.getTag().ordinal()]); } /** @@ -3651,7 +3697,7 @@ public class Types { */ public Type unboxedTypeOrType(Type t) { Type unboxedType = unboxedType(t); - return unboxedType.tag == NONE ? t : unboxedType; + return unboxedType.hasTag(NONE) ? t : unboxedType; } // @@ -3701,7 +3747,7 @@ public class Types { return buf.reverse(); } public Type capture(Type t) { - if (t.tag != CLASS) + if (!t.hasTag(CLASS)) return t; if (t.getEnclosingType() != Type.noType) { Type capturedEncl = capture(t.getEnclosingType()); @@ -3767,7 +3813,7 @@ public class Types { public List freshTypeVariables(List types) { ListBuffer result = lb(); for (Type t : types) { - if (t.tag == WILDCARD) { + if (t.hasTag(WILDCARD)) { t = t.unannotatedType(); Type bound = ((WildcardType)t).getExtendsBound(); if (bound == null) @@ -3937,14 +3983,14 @@ public class Types { @Override public Void visitClassType(ClassType source, Type target) throws AdaptFailure { - if (target.tag == CLASS) + if (target.hasTag(CLASS)) adaptRecursive(source.allparams(), target.allparams()); return null; } @Override public Void visitArrayType(ArrayType source, Type target) throws AdaptFailure { - if (target.tag == ARRAY) + if (target.hasTag(ARRAY)) adaptRecursive(elemtype(source), elemtype(target)); return null; } @@ -4126,7 +4172,7 @@ public class Types { } Type B(Type t) { - while (t.tag == WILDCARD) { + while (t.hasTag(WILDCARD)) { WildcardType w = (WildcardType)t.unannotatedType(); t = high ? w.getExtendsBound() : @@ -4171,7 +4217,7 @@ public class Types { * substituted by the wildcard */ private WildcardType makeSuperWildcard(Type bound, TypeVar formal) { - if (bound.tag == BOT) { + if (bound.hasTag(BOT)) { return new WildcardType(syms.objectType, BoundKind.UNBOUND, syms.boundClass, diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java index 475ebcf7b04..1be8604319f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java @@ -134,6 +134,7 @@ public class Attr extends JCTree.Visitor { allowAnonOuterThis = source.allowAnonOuterThis(); allowStringsInSwitch = source.allowStringsInSwitch(); allowPoly = source.allowPoly(); + allowTypeAnnos = source.allowTypeAnnotations(); allowLambda = source.allowLambda(); allowDefaultMethods = source.allowDefaultMethods(); sourceName = source.name; @@ -147,6 +148,7 @@ public class Attr extends JCTree.Visitor { statInfo = new ResultInfo(NIL, Type.noType); varInfo = new ResultInfo(VAR, Type.noType); unknownExprInfo = new ResultInfo(VAL, Type.noType); + unknownAnyPolyInfo = new ResultInfo(VAL, Infer.anyPoly); unknownTypeInfo = new ResultInfo(TYP, Type.noType); unknownTypeExprInfo = new ResultInfo(Kinds.TYP | Kinds.VAL, Type.noType); recoveryInfo = new RecoveryInfo(deferredAttr.emptyDeferredAttrContext); @@ -160,6 +162,10 @@ public class Attr extends JCTree.Visitor { */ boolean allowPoly; + /** Switch: support type annotations. + */ + boolean allowTypeAnnos; + /** Switch: support generics? */ boolean allowGenerics; @@ -240,7 +246,7 @@ public class Attr extends JCTree.Visitor { InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext(); Type owntype = found; if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) { - if (inferenceContext.free(found)) { + if (allowPoly && inferenceContext.free(found)) { inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() { @Override public void typesInferred(InferenceContext inferenceContext) { @@ -558,6 +564,7 @@ public class Attr extends JCTree.Visitor { final ResultInfo statInfo; final ResultInfo varInfo; + final ResultInfo unknownAnyPolyInfo; final ResultInfo unknownExprInfo; final ResultInfo unknownTypeInfo; final ResultInfo unknownTypeExprInfo; @@ -664,17 +671,21 @@ public class Attr extends JCTree.Visitor { attribStat(l.head, env); } - /** Attribute the arguments in a method call, returning a list of types. + /** Attribute the arguments in a method call, returning the method kind. */ - List attribArgs(List trees, Env env) { - ListBuffer argtypes = new ListBuffer(); + int attribArgs(List trees, Env env, ListBuffer argtypes) { + int kind = VAL; for (JCExpression arg : trees) { - Type argtype = allowPoly && deferredAttr.isDeferred(env, arg) ? - deferredAttr.new DeferredType(arg, env) : - chk.checkNonVoid(arg, attribExpr(arg, env, Infer.anyPoly)); + Type argtype; + if (allowPoly && deferredAttr.isDeferred(env, arg)) { + argtype = deferredAttr.new DeferredType(arg, env); + kind |= POLY; + } else { + argtype = chk.checkNonVoid(arg, attribTree(arg, env, unknownAnyPolyInfo)); + } argtypes.append(argtype); } - return argtypes.toList(); + return kind; } /** Attribute a type argument list, returning a list of types. @@ -745,25 +756,15 @@ public class Attr extends JCTree.Visitor { JCTree.JCExpression initializer, Type type) { - // in case no lint value has been set up for this env, scan up - // env stack looking for smallest enclosing env for which it is set. - Env lintEnv = env; - while (lintEnv.info.lint == null) - lintEnv = lintEnv.next; + /* When this env was created, it didn't have the correct lint nor had + * annotations has been processed. + * But now at this phase we have already processed annotations and the + * correct lint must have been set in chk, so we should use that one to + * attribute the initializer. + */ + Lint prevLint = env.info.lint; + env.info.lint = chk.getLint(); - // Having found the enclosing lint value, we can initialize the lint value for this class - // ... but ... - // There's a problem with evaluating annotations in the right order, such that - // env.info.enclVar.attributes_field might not yet have been evaluated, and so might be - // null. In that case, calling augment will throw an NPE. To avoid this, for now we - // revert to the jdk 6 behavior and ignore the (unevaluated) attributes. - if (env.info.enclVar.annotationsPendingCompletion()) { - env.info.lint = lintEnv.info.lint; - } else { - env.info.lint = lintEnv.info.lint.augment(env.info.enclVar); - } - - Lint prevLint = chk.setLint(env.info.lint); JavaFileObject prevSource = log.useSource(env.toplevel.sourcefile); try { @@ -775,10 +776,11 @@ public class Attr extends JCTree.Visitor { memberEnter.typeAnnotate(initializer, env, null); annotate.flush(); Type itype = attribExpr(initializer, env, type); - if (itype.constValue() != null) + if (itype.constValue() != null) { return coerce(itype, type).constValue(); - else + } else { return null; + } } finally { env.info.lint = prevLint; log.useSource(prevSource); @@ -1172,8 +1174,11 @@ public class Attr extends JCTree.Visitor { Env loopEnv = env.dup(env.tree, env.info.dup(env.info.scope.dup())); try { - attribStat(tree.var, loopEnv); + //the Formal Parameter of a for-each loop is not in the scope when + //attributing the for-each expression; we mimick this by attributing + //the for-each expression first (against original scope). Type exprType = types.upperBound(attribExpr(tree.expr, loopEnv)); + attribStat(tree.var, loopEnv); chk.checkNonVoid(tree.pos(), exprType); Type elemtype = types.elemtype(exprType); // perhaps expr is an array? if (elemtype == null) { @@ -1529,21 +1534,23 @@ public class Attr extends JCTree.Visitor { // If one arm has an integer subrange type (i.e., byte, // short, or char), and the other is an integer constant // that fits into the subrange, return the subrange type. - if (thenUnboxed.getTag().isStrictSubRangeOf(INT) && elseUnboxed.hasTag(INT) && - types.isAssignable(elseUnboxed, thenUnboxed)) + if (thenUnboxed.getTag().isStrictSubRangeOf(INT) && + elseUnboxed.hasTag(INT) && + types.isAssignable(elseUnboxed, thenUnboxed)) { return thenUnboxed.baseType(); - if (elseUnboxed.getTag().isStrictSubRangeOf(INT) && thenUnboxed.hasTag(INT) && - types.isAssignable(thenUnboxed, elseUnboxed)) + } + if (elseUnboxed.getTag().isStrictSubRangeOf(INT) && + thenUnboxed.hasTag(INT) && + types.isAssignable(thenUnboxed, elseUnboxed)) { return elseUnboxed.baseType(); + } - for (TypeTag tag : TypeTag.values()) { - if (tag.ordinal() >= TypeTag.getTypeTagCount()) break; + for (TypeTag tag : primitiveTags) { Type candidate = syms.typeOfTag[tag.ordinal()]; - if (candidate != null && - candidate.isPrimitive() && - types.isSubtype(thenUnboxed, candidate) && - types.isSubtype(elseUnboxed, candidate)) + if (types.isSubtype(thenUnboxed, candidate) && + types.isSubtype(elseUnboxed, candidate)) { return candidate; + } } } @@ -1572,6 +1579,17 @@ public class Attr extends JCTree.Visitor { return types.lub(thentype.baseType(), elsetype.baseType()); } + final static TypeTag[] primitiveTags = new TypeTag[]{ + BYTE, + CHAR, + SHORT, + INT, + LONG, + FLOAT, + DOUBLE, + BOOLEAN, + }; + public void visitIf(JCIf tree) { attribExpr(tree.cond, env, syms.booleanType); attribStat(tree.thenpart, env); @@ -1723,6 +1741,7 @@ public class Attr extends JCTree.Visitor { boolean isConstructorCall = methName == names._this || methName == names._super; + ListBuffer argtypesBuf = ListBuffer.lb(); if (isConstructorCall) { // We are seeing a ...this(...) or ...super(...) call. // Check that this is the first statement in a constructor. @@ -1733,7 +1752,8 @@ public class Attr extends JCTree.Visitor { localEnv.info.isSelfCall = true; // Attribute arguments, yielding list of argument types. - argtypes = attribArgs(tree.args, localEnv); + attribArgs(tree.args, localEnv, argtypesBuf); + argtypes = argtypesBuf.toList(); typeargtypes = attribTypes(tree.typeargs, localEnv); // Variable `site' points to the class in which the called @@ -1805,7 +1825,8 @@ public class Attr extends JCTree.Visitor { } else { // Otherwise, we are seeing a regular method call. // Attribute the arguments, yielding list of argument types, ... - argtypes = attribArgs(tree.args, localEnv); + int kind = attribArgs(tree.args, localEnv, argtypesBuf); + argtypes = argtypesBuf.toList(); typeargtypes = attribAnyTypes(tree.typeargs, localEnv); // ... and attribute the method using as a prototype a methodtype @@ -1813,7 +1834,7 @@ public class Attr extends JCTree.Visitor { // arguments (this will also set the method symbol). Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes); localEnv.info.pendingResolutionPhase = null; - Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(VAL, mpt, resultInfo.checkContext)); + Type mtype = attribTree(tree.meth, localEnv, new ResultInfo(kind, mpt, resultInfo.checkContext)); // Compute the result type. Type restype = mtype.getReturnType(); @@ -1830,9 +1851,6 @@ public class Attr extends JCTree.Visitor { // Check that value of resulting type is admissible in the // current context. Also, capture the return type result = check(tree, capture(restype), VAL, resultInfo); - - if (localEnv.info.lastResolveVarargs()) - Assert.check(result.isErroneous() || tree.varargsElement != null); } chk.validate(tree.typeargs, localEnv); } @@ -1986,7 +2004,9 @@ public class Attr extends JCTree.Visitor { } // Attribute constructor arguments. - List argtypes = attribArgs(tree.args, localEnv); + ListBuffer argtypesBuf = ListBuffer.lb(); + int pkind = attribArgs(tree.args, localEnv, argtypesBuf); + List argtypes = argtypesBuf.toList(); List typeargtypes = attribTypes(tree.typeargs, localEnv); // If we have made no mistakes in the class type... @@ -2073,11 +2093,16 @@ public class Attr extends JCTree.Visitor { clazztype, tree.constructor, rsEnv, - new ResultInfo(MTH, newMethodTemplate(syms.voidType, argtypes, typeargtypes))); + new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes))); if (rsEnv.info.lastResolveVarargs()) Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null); } - findDiamondIfNeeded(localEnv, tree, clazztype); + if (cdef == null && + !clazztype.isErroneous() && + clazztype.getTypeArguments().nonEmpty() && + findDiamonds) { + findDiamond(localEnv, tree, clazztype); + } } if (cdef != null) { @@ -2144,7 +2169,7 @@ public class Attr extends JCTree.Visitor { clazztype, tree.constructor, localEnv, - new ResultInfo(VAL, newMethodTemplate(syms.voidType, argtypes, typeargtypes))); + new ResultInfo(pkind, newMethodTemplate(syms.voidType, argtypes, typeargtypes))); } else { if (tree.clazz.hasTag(ANNOTATED_TYPE)) { checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations, @@ -2159,32 +2184,27 @@ public class Attr extends JCTree.Visitor { chk.validate(tree.typeargs, localEnv); } //where - void findDiamondIfNeeded(Env env, JCNewClass tree, Type clazztype) { - if (tree.def == null && - !clazztype.isErroneous() && - clazztype.getTypeArguments().nonEmpty() && - findDiamonds) { - JCTypeApply ta = (JCTypeApply)tree.clazz; - List prevTypeargs = ta.arguments; - try { - //create a 'fake' diamond AST node by removing type-argument trees - ta.arguments = List.nil(); - ResultInfo findDiamondResult = new ResultInfo(VAL, - resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt()); - Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type; - Type polyPt = allowPoly ? - syms.objectType : - clazztype; - if (!inferred.isErroneous() && - types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) { - String key = types.isSameType(clazztype, inferred) ? - "diamond.redundant.args" : - "diamond.redundant.args.1"; - log.warning(tree.clazz.pos(), key, clazztype, inferred); - } - } finally { - ta.arguments = prevTypeargs; + void findDiamond(Env env, JCNewClass tree, Type clazztype) { + JCTypeApply ta = (JCTypeApply)tree.clazz; + List prevTypeargs = ta.arguments; + try { + //create a 'fake' diamond AST node by removing type-argument trees + ta.arguments = List.nil(); + ResultInfo findDiamondResult = new ResultInfo(VAL, + resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt()); + Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type; + Type polyPt = allowPoly ? + syms.objectType : + clazztype; + if (!inferred.isErroneous() && + types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) { + String key = types.isSameType(clazztype, inferred) ? + "diamond.redundant.args" : + "diamond.redundant.args.1"; + log.warning(tree.clazz.pos(), key, clazztype, inferred); } + } finally { + ta.arguments = prevTypeargs; } } @@ -2609,7 +2629,7 @@ public class Attr extends JCTree.Visitor { //field initializer lambdaEnv = env.dup(that, env.info.dup(env.info.scope.dupUnshared())); lambdaEnv.info.scope.owner = - new MethodSymbol(0, names.empty, null, + new MethodSymbol((owner.flags() & STATIC) | BLOCK, names.empty, null, env.info.scope.owner); } else { lambdaEnv = env.dup(that, env.info.dup(env.info.scope.dup())); @@ -2990,6 +3010,8 @@ public class Attr extends JCTree.Visitor { !left.isErroneous() && !right.isErroneous()) { owntype = operator.type.getReturnType(); + // This will figure out when unboxing can happen and + // choose the right comparison operator. int opc = chk.checkOperator(tree.lhs.pos(), (OperatorSymbol)operator, tree.getTag(), @@ -3017,9 +3039,11 @@ public class Attr extends JCTree.Visitor { } // Check that argument types of a reference ==, != are - // castable to each other, (JLS???). + // castable to each other, (JLS 15.21). Note: unboxing + // comparisons will not have an acmp* opc at this point. if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) { - if (!types.isCastable(left, right, new Warner(tree.pos()))) { + if (!types.isEqualityComparable(left, right, + new Warner(tree.pos()))) { log.error(tree.pos(), "incomparable.types", left, right); } } @@ -3038,7 +3062,7 @@ public class Attr extends JCTree.Visitor { //should we propagate the target type? final ResultInfo castInfo; JCExpression expr = TreeInfo.skipParens(tree.expr); - boolean isPoly = expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE); + boolean isPoly = allowPoly && (expr.hasTag(LAMBDA) || expr.hasTag(REFERENCE)); if (isPoly) { //expression is a poly - we need to propagate target type info castInfo = new ResultInfo(VAL, clazztype, new Check.NestedCheckContext(resultInfo.checkContext) { @@ -3177,7 +3201,7 @@ public class Attr extends JCTree.Visitor { if (skind == TYP) { Type elt = site; while (elt.hasTag(ARRAY)) - elt = ((ArrayType)elt).elemtype; + elt = ((ArrayType)elt.unannotatedType()).elemtype; if (elt.hasTag(TYPEVAR)) { log.error(tree.pos(), "type.var.cant.be.deref"); result = types.createErrorType(tree.type); @@ -3405,7 +3429,7 @@ public class Attr extends JCTree.Visitor { Env env, ResultInfo resultInfo) { boolean isPolymorhicSignature = - sym.kind == MTH && ((MethodSymbol)sym.baseSymbol()).isSignaturePolymorphic(types); + (sym.baseSymbol().flags() & SIGNATURE_POLYMORPHIC) != 0; return isPolymorhicSignature ? checkSigPolyMethodId(tree, site, sym, env, resultInfo) : checkMethodIdInternal(tree, site, sym, env, resultInfo); @@ -3427,10 +3451,14 @@ public class Attr extends JCTree.Visitor { Symbol sym, Env env, ResultInfo resultInfo) { - Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase)); - Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo); - resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase)); - return owntype; + if ((resultInfo.pkind & POLY) != 0) { + Type pt = resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase)); + Type owntype = checkIdInternal(tree, site, sym, pt, env, resultInfo); + resultInfo.pt.map(deferredAttr.new RecoveryDeferredTypeMap(AttrMode.CHECK, sym, env.info.pendingResolutionPhase)); + return owntype; + } else { + return checkIdInternal(tree, site, sym, resultInfo.pt, env, resultInfo); + } } Type checkIdInternal(JCTree tree, @@ -3528,7 +3556,7 @@ public class Attr extends JCTree.Visitor { break; case MTH: { owntype = checkMethod(site, sym, - new ResultInfo(VAL, resultInfo.pt.getReturnType(), resultInfo.checkContext), + new ResultInfo(resultInfo.pkind, resultInfo.pt.getReturnType(), resultInfo.checkContext), env, TreeInfo.args(env.tree), resultInfo.pt.getParameterTypes(), resultInfo.pt.getTypeArguments()); break; @@ -3730,8 +3758,28 @@ public class Attr extends JCTree.Visitor { typeargtypes, noteWarner); + DeferredAttr.DeferredTypeMap checkDeferredMap = + deferredAttr.new DeferredTypeMap(DeferredAttr.AttrMode.CHECK, sym, env.info.pendingResolutionPhase); + + argtypes = Type.map(argtypes, checkDeferredMap); + + if (noteWarner.hasNonSilentLint(LintCategory.UNCHECKED)) { + chk.warnUnchecked(env.tree.pos(), + "unchecked.meth.invocation.applied", + kindName(sym), + sym.name, + rs.methodArguments(sym.type.getParameterTypes()), + rs.methodArguments(Type.map(argtypes, checkDeferredMap)), + kindName(sym.location()), + sym.location()); + owntype = new MethodType(owntype.getParameterTypes(), + types.erasure(owntype.getReturnType()), + types.erasure(owntype.getThrownTypes()), + syms.methodClass); + } + return chk.checkMethod(owntype, sym, env, argtrees, argtypes, env.info.lastResolveVarargs(), - noteWarner.hasNonSilentLint(LintCategory.UNCHECKED), resultInfo.checkContext.inferenceContext()); + resultInfo.checkContext.inferenceContext()); } catch (Infer.InferenceException ex) { //invalid target type - propagate exception outwards or report error //depending on the current check context @@ -4256,12 +4304,13 @@ public class Attr extends JCTree.Visitor { (c.flags() & ABSTRACT) == 0) { checkSerialVersionUID(tree, c); } + if (allowTypeAnnos) { + // Correctly organize the postions of the type annotations + TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree); - // Correctly organize the postions of the type annotations - TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree); - - // Check type annotations applicability rules - validateTypeAnnotations(tree); + // Check type annotations applicability rules + validateTypeAnnotations(tree); + } } // where /** get a diagnostic position for an attribute of Type t, or null if attribute missing */ diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java index dad29a3a016..76440d0b7d1 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java @@ -218,6 +218,14 @@ public class Check { return prev; } + /* This idiom should be used only in cases when it is needed to set the lint + * of an environment that has been created in a phase previous to annotations + * processing. + */ + Lint getLint() { + return lint; + } + DeferredLintHandler setDeferredLintHandler(DeferredLintHandler newDeferredLintHandler) { DeferredLintHandler prev = deferredLintHandler; deferredLintHandler = newDeferredLintHandler; @@ -544,7 +552,7 @@ public class Check { if (checkContext.compatible(found, req, checkContext.checkWarner(pos, found, req))) { return found; } else { - if (found.getTag().isSubRangeOf(DOUBLE) && req.getTag().isSubRangeOf(DOUBLE)) { + if (found.isNumeric() && req.isNumeric()) { checkContext.report(pos, diags.fragment("possible.loss.of.precision", found, req)); return types.createErrorType(found); } @@ -754,7 +762,7 @@ public class Check { * @param t The type to be checked. */ Type checkNullOrRefType(DiagnosticPosition pos, Type t) { - if (t.isNullOrReference()) + if (t.isReference() || t.hasTag(BOT)) return t; else return typeTagError(pos, @@ -847,25 +855,31 @@ public class Check { (s.flags() & (STATIC | FINAL)) != 0); } - Type checkMethod(Type owntype, - Symbol sym, - Env env, - final List argtrees, - List argtypes, - boolean useVarargs, - boolean unchecked, - InferenceContext inferenceContext) { + Type checkMethod(final Type mtype, + final Symbol sym, + final Env env, + final List argtrees, + final List argtypes, + final boolean useVarargs, + InferenceContext inferenceContext) { // System.out.println("call : " + env.tree); // System.out.println("method : " + owntype); // System.out.println("actuals: " + argtypes); + if (inferenceContext.free(mtype)) { + inferenceContext.addFreeTypeListener(List.of(mtype), new FreeTypeListener() { + public void typesInferred(InferenceContext inferenceContext) { + checkMethod(inferenceContext.asInstType(mtype), sym, env, argtrees, argtypes, useVarargs, inferenceContext); + } + }); + return mtype; + } + Type owntype = mtype; List formals = owntype.getParameterTypes(); Type last = useVarargs ? formals.last() : null; if (sym.name == names.init && sym.owner == syms.enumSym) formals = formals.tail.tail; List args = argtrees; - DeferredAttr.DeferredTypeMap checkDeferredMap = - deferredAttr.new DeferredTypeMap(DeferredAttr.AttrMode.CHECK, sym, env.info.pendingResolutionPhase); if (args != null) { //this is null when type-checking a method reference while (formals.head != last) { @@ -886,27 +900,13 @@ public class Check { } else if ((sym.flags() & VARARGS) != 0 && allowVarargs) { // non-varargs call to varargs method Type varParam = owntype.getParameterTypes().last(); - Type lastArg = checkDeferredMap.apply(argtypes.last()); + Type lastArg = argtypes.last(); if (types.isSubtypeUnchecked(lastArg, types.elemtype(varParam)) && !types.isSameType(types.erasure(varParam), types.erasure(lastArg))) log.warning(argtrees.last().pos(), "inexact.non-varargs.call", types.elemtype(varParam), varParam); } } - if (unchecked) { - warnUnchecked(env.tree.pos(), - "unchecked.meth.invocation.applied", - kindName(sym), - sym.name, - rs.methodArguments(sym.type.getParameterTypes()), - rs.methodArguments(Type.map(argtypes, checkDeferredMap)), - kindName(sym.location()), - sym.location()); - owntype = new MethodType(owntype.getParameterTypes(), - types.erasure(owntype.getReturnType()), - types.erasure(owntype.getThrownTypes()), - syms.methodClass); - } if (useVarargs) { Type argtype = owntype.getParameterTypes().last(); if (!types.isReifiable(argtype) && @@ -917,8 +917,8 @@ public class Check { "unchecked.generic.array.creation", argtype); } - if (!((MethodSymbol)sym.baseSymbol()).isSignaturePolymorphic(types)) { - setVarargsElement(env, types.elemtype(argtype), inferenceContext); + if ((sym.baseSymbol().flags() & SIGNATURE_POLYMORPHIC) == 0) { + TreeInfo.setVarargsElement(env.tree, types.elemtype(argtype)); } } PolyKind pkind = (sym.type.hasTag(FORALL) && @@ -928,17 +928,6 @@ public class Check { return owntype; } //where - private void setVarargsElement(final Env env, final Type elemtype, InferenceContext inferenceContext) { - if (inferenceContext.free(elemtype)) { - inferenceContext.addFreeTypeListener(List.of(elemtype), new FreeTypeListener() { - public void typesInferred(InferenceContext inferenceContext) { - setVarargsElement(env, inferenceContext.asInstType(elemtype), inferenceContext); - } - }); - } - TreeInfo.setVarargsElement(env.tree, elemtype); - } - private void assertConvertible(JCTree tree, Type actual, Type formal, Warner warn) { if (types.isConvertible(actual, formal, warn)) return; @@ -1638,7 +1627,7 @@ public class Check { log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access", cannotOverride(m, other), other.flags() == 0 ? - Flag.PACKAGE : + "package" : asFlagSet(other.flags() & AccessFlags)); m.flags_field |= BAD_OVERRIDE; return; @@ -1924,24 +1913,11 @@ public class Check { Symbol s3 = e.sym; if (s3 == s1 || s3 == s2 || s3.kind != MTH || (s3.flags() & (BRIDGE|SYNTHETIC)) != 0) continue; Type st3 = types.memberType(site,s3); - if (types.overrideEquivalent(st3, st1) && types.overrideEquivalent(st3, st2)) { - if (s3.owner == site.tsym) { - return true; - } - List tvars1 = st1.getTypeArguments(); - List tvars2 = st2.getTypeArguments(); - List tvars3 = st3.getTypeArguments(); - Type rt1 = st1.getReturnType(); - Type rt2 = st2.getReturnType(); - Type rt13 = types.subst(st3.getReturnType(), tvars3, tvars1); - Type rt23 = types.subst(st3.getReturnType(), tvars3, tvars2); - boolean compat = - !rt13.isPrimitiveOrVoid() && - !rt23.isPrimitiveOrVoid() && - (types.covariantReturnType(rt13, rt1, types.noWarnings) && - types.covariantReturnType(rt23, rt2, types.noWarnings)); - if (compat) - return true; + if (types.overrideEquivalent(st3, st1) && + types.overrideEquivalent(st3, st2) && + types.returnTypeSubstitutable(st3, st1) && + types.returnTypeSubstitutable(st3, st2)) { + return true; } } } @@ -3278,7 +3254,7 @@ public class Check { void checkDivZero(DiagnosticPosition pos, Symbol operator, Type operand) { if (operand.constValue() != null && lint.isEnabled(LintCategory.DIVZERO) - && (operand.getTag().isSubRangeOf(LONG)) + && operand.getTag().isSubRangeOf(LONG) && ((Number) (operand.constValue())).longValue() == 0) { int opc = ((OperatorSymbol)operator).opcode; if (opc == ByteCodes.idiv || opc == ByteCodes.imod diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java index 0dd6fe3887a..27b0c606fc2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java @@ -115,12 +115,17 @@ public class DeferredAttr extends JCTree.Visitor { SpeculativeCache speculativeCache; DeferredType(JCExpression tree, Env env) { - super(DEFERRED, null); + super(null); this.tree = tree; this.env = env.dup(tree, env.info.dup()); this.speculativeCache = new SpeculativeCache(); } + @Override + public TypeTag getTag() { + return DEFERRED; + } + /** * A speculative cache is used to keep track of all overload resolution rounds * that triggered speculative attribution on a given deferred type. Each entry @@ -959,10 +964,8 @@ public class DeferredAttr extends JCTree.Visitor { if (sym.kind == Kinds.AMBIGUOUS) { Resolve.AmbiguityError err = (Resolve.AmbiguityError)sym.baseSymbol(); result = ArgumentExpressionKind.PRIMITIVE; - for (List ambigousSyms = err.ambiguousSyms ; - ambigousSyms.nonEmpty() && !result.isPoly() ; - ambigousSyms = ambigousSyms.tail) { - Symbol s = ambigousSyms.head; + for (Symbol s : err.ambiguousSyms) { + if (result.isPoly()) break; if (s.kind == Kinds.MTH) { result = reduce(ArgumentExpressionKind.methodKind(s, types)); } diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java index d1280935955..df66e345703 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java @@ -1945,10 +1945,17 @@ public class Flow { } } + /* The analysis of each catch should be independent. + * Each one should have the same initial values of inits and + * uninits. + */ + final Bits initsCatchPrev = new Bits(initsTry); + final Bits uninitsCatchPrev = new Bits(uninitsTry); + for (List l = tree.catchers; l.nonEmpty(); l = l.tail) { JCVariableDecl param = l.head.param; - inits.assign(initsTry); - uninits.assign(uninitsTry); + inits.assign(initsCatchPrev); + uninits.assign(uninitsCatchPrev); scan(param); inits.incl(param.sym.adr); uninits.excl(param.sym.adr); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java index 21014afa71b..c5f4b271f2e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java @@ -96,7 +96,7 @@ public class Infer { } /** A value for prototypes that admit any type, including polymorphic ones. */ - public static final Type anyPoly = new Type(NONE, null); + public static final Type anyPoly = new JCNoType(); /** * This exception class is design to store a list of diagnostics corresponding @@ -952,8 +952,9 @@ public class Infer { Type solve(UndetVar uv, InferenceContext inferenceContext) { Infer infer = inferenceContext.infer(); List lobounds = filterBounds(uv, inferenceContext); - Type owntype = infer.types.lub(lobounds); - if (owntype.hasTag(ERROR)) { + //note: lobounds should have at least one element + Type owntype = lobounds.tail.tail == null ? lobounds.head : infer.types.lub(lobounds); + if (owntype.isPrimitive() || owntype.hasTag(ERROR)) { throw infer.inferenceException .setMessage("no.unique.minimal.instance.exists", uv.qtype, lobounds); @@ -971,8 +972,9 @@ public class Infer { Type solve(UndetVar uv, InferenceContext inferenceContext) { Infer infer = inferenceContext.infer(); List hibounds = filterBounds(uv, inferenceContext); - Type owntype = infer.types.glb(hibounds); - if (owntype.isErroneous()) { + //note: lobounds should have at least one element + Type owntype = hibounds.tail.tail == null ? hibounds.head : infer.types.glb(hibounds); + if (owntype.isPrimitive() || owntype.hasTag(ERROR)) { throw infer.inferenceException .setMessage("no.unique.maximal.instance.exists", uv.qtype, hibounds); @@ -1100,10 +1102,11 @@ public class Infer { } } //no progress - throw inferenceException; + throw inferenceException.setMessage(); } } catch (InferenceException ex) { + //did we fail because of interdependent ivars? inferenceContext.rollback(); instantiateAsUninferredVars(varsToSolve, inferenceContext); checkWithinBounds(inferenceContext, warn); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index a8ce9494776..9acfdba9c88 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -68,6 +68,8 @@ import static com.sun.tools.javac.tree.JCTree.Tag.*; */ public class LambdaToMethod extends TreeTranslator { + private JCDiagnostic.Factory diags; + private Log log; private Lower lower; private Names names; private Symtab syms; @@ -89,6 +91,9 @@ public class LambdaToMethod extends TreeTranslator { /** info about the current class being processed */ private KlassInfo kInfo; + /** dump statistics about lambda code generation */ + private boolean dumpLambdaToMethodStats; + /** Flag for alternate metafactories indicating the lambda object is intended to be serializable */ public static final int FLAG_SERIALIZABLE = 1 << 0; @@ -146,6 +151,8 @@ public class LambdaToMethod extends TreeTranslator { } private LambdaToMethod(Context context) { + diags = JCDiagnostic.Factory.instance(context); + log = Log.instance(context); lower = Lower.instance(context); names = Names.instance(context); syms = Symtab.instance(context); @@ -154,6 +161,8 @@ public class LambdaToMethod extends TreeTranslator { types = Types.instance(context); transTypes = TransTypes.instance(context); analyzer = new LambdaAnalyzerPreprocessor(); + Options options = Options.instance(context); + dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats"); } // @@ -1101,7 +1110,9 @@ public class LambdaToMethod extends TreeTranslator { Map prevSerializableLambdaCount = serializableLambdaCounts; Map prevClinits = clinits; + DiagnosticSource prevSource = log.currentSource(); try { + log.useSource(tree.sym.sourcefile); serializableLambdaCounts = new HashMap(); prevClinits = new HashMap(); if (tree.sym.owner.kind == MTH) { @@ -1126,6 +1137,7 @@ public class LambdaToMethod extends TreeTranslator { super.visitClassDef(tree); } finally { + log.useSource(prevSource.getFile()); frameStack = prevStack; serializableLambdaCounts = prevSerializableLambdaCount; clinits = prevClinits; @@ -1685,6 +1697,9 @@ public class LambdaToMethod extends TreeTranslator { } Name name = isSerializable() ? serializedLambdaName(owner) : lambdaName(); this.translatedSym = makeSyntheticMethod(0, name, null, owner.enclClass()); + if (dumpLambdaToMethodStats) { + log.note(tree, "lambda.stat", needsAltMetafactory(), translatedSym); + } } /** @@ -1841,6 +1856,11 @@ public class LambdaToMethod extends TreeTranslator { lambdaName().append(names.fromString("$bridge")), null, owner.enclClass()) : null; + if (dumpLambdaToMethodStats) { + String key = bridgeSym == null ? + "mref.stat" : "mref.stat.1"; + log.note(tree, key, needsAltMetafactory(), bridgeSym); + } } /** diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java index fb31aa3134f..4ee5e63fc28 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java @@ -2711,9 +2711,14 @@ public class Lower extends TreeTranslator { if (fvs.nonEmpty()) { List addedargtypes = List.nil(); for (List l = fvs; l.nonEmpty(); l = l.tail) { - if (TreeInfo.isInitialConstructor(tree)) + if (TreeInfo.isInitialConstructor(tree)) { + final Name pName = proxyName(l.head.name); + m.extraParams = + m.extraParams.append((VarSymbol) + (proxies.lookup(pName).sym)); added = added.prepend( - initField(tree.body.pos, proxyName(l.head.name))); + initField(tree.body.pos, pName)); + } addedargtypes = addedargtypes.prepend(l.head.erasure(types)); } Type olderasure = m.erasure(types); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java index 589f2669182..9b3457c7c83 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java @@ -109,15 +109,20 @@ public class MemberEnter extends JCTree.Visitor implements Completer { source = Source.instance(context); target = Target.instance(context); deferredLintHandler = DeferredLintHandler.instance(context); + allowTypeAnnos = source.allowTypeAnnotations(); } + /** Switch: support type annotations. + */ + boolean allowTypeAnnos; + /** A queue for classes whose members still need to be entered into the * symbol table. */ ListBuffer> halfcompleted = new ListBuffer>(); /** Set to true only when the first of a set of classes is - * processed from the halfcompleted queue. + * processed from the half completed queue. */ boolean isFirst = true; @@ -560,6 +565,10 @@ public class MemberEnter extends JCTree.Visitor implements Completer { chk.setDeferredLintHandler(prevLintHandler); } + if (types.isSignaturePolymorphic(m)) { + m.flags_field |= SIGNATURE_POLYMORPHIC; + } + // Set m.params ListBuffer params = new ListBuffer(); JCVariableDecl lastParam = null; @@ -1068,7 +1077,9 @@ public class MemberEnter extends JCTree.Visitor implements Completer { isFirst = true; } } - TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate); + if (allowTypeAnnos) { + TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, tree, annotate); + } } /* @@ -1113,7 +1124,9 @@ public class MemberEnter extends JCTree.Visitor implements Completer { } public void typeAnnotate(final JCTree tree, final Env env, final Symbol sym) { - tree.accept(new TypeAnnotate(env, sym)); + if (allowTypeAnnos) { + tree.accept(new TypeAnnotate(env, sym)); + } } /** diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java index 9618a00c3bb..14f9d4bd2b6 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -1207,7 +1207,7 @@ public class Resolve { bestSoFar.kind != AMBIGUOUS && l.nonEmpty(); l = l.tail) { sym = findField(env, site, name, l.head.tsym); - if (bestSoFar.kind < AMBIGUOUS && sym.kind < AMBIGUOUS && + if (bestSoFar.exists() && sym.exists() && sym.owner != bestSoFar.owner) bestSoFar = new AmbiguityError(bestSoFar, sym); else if (sym.kind < bestSoFar.kind) @@ -1573,7 +1573,6 @@ public class Resolve { allowBoxing, useVarargs, operator); - reportVerboseResolutionDiagnostic(env.tree.pos(), name, site, argtypes, typeargtypes, bestSoFar); return bestSoFar; } // where @@ -2224,7 +2223,7 @@ public class Resolve { return lookupMethod(env, pos, env.enclClass.sym, resolveMethodCheck, new BasicLookupHelper(name, env.enclClass.sym.type, argtypes, typeargtypes) { @Override - Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol doLookup(Env env, MethodResolutionPhase phase) { return findFun(env, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()); @@ -2256,7 +2255,7 @@ public class Resolve { List typeargtypes) { return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) { @Override - Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol doLookup(Env env, MethodResolutionPhase phase) { return findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), false); @@ -2267,7 +2266,7 @@ public class Resolve { sym = super.access(env, pos, location, sym); } else if (allowMethodHandles) { MethodSymbol msym = (MethodSymbol)sym; - if (msym.isSignaturePolymorphic(types)) { + if ((msym.flags() & SIGNATURE_POLYMORPHIC) != 0) { return findPolymorphicSignatureInstance(env, sym, argtypes); } } @@ -2355,7 +2354,7 @@ public class Resolve { List typeargtypes) { return lookupMethod(env, pos, site.tsym, resolveContext, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) { @Override - Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol doLookup(Env env, MethodResolutionPhase phase) { return findConstructor(pos, env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()); @@ -2413,7 +2412,7 @@ public class Resolve { return lookupMethod(env, pos, site.tsym, resolveMethodCheck, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) { @Override - Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol doLookup(Env env, MethodResolutionPhase phase) { return findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()); @@ -2503,7 +2502,7 @@ public class Resolve { return lookupMethod(env, pos, syms.predefClass, currentResolutionContext, new BasicLookupHelper(name, syms.predefClass.type, argtypes, null, BOX) { @Override - Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol doLookup(Env env, MethodResolutionPhase phase) { return findMethod(env, site, name, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired(), true); @@ -2668,6 +2667,13 @@ public class Resolve { */ abstract Symbol lookup(Env env, MethodResolutionPhase phase); + /** + * Dump overload resolution info + */ + void debug(DiagnosticPosition pos, Symbol sym) { + //do nothing + } + /** * Validate the result of the lookup */ @@ -2685,17 +2691,30 @@ public class Resolve { } @Override - Symbol access(Env env, DiagnosticPosition pos, Symbol location, Symbol sym) { + final Symbol lookup(Env env, MethodResolutionPhase phase) { + Symbol sym = doLookup(env, phase); if (sym.kind == AMBIGUOUS) { AmbiguityError a_err = (AmbiguityError)sym; sym = a_err.mergeAbstracts(site); } + return sym; + } + + abstract Symbol doLookup(Env env, MethodResolutionPhase phase); + + @Override + Symbol access(Env env, DiagnosticPosition pos, Symbol location, Symbol sym) { if (sym.kind >= AMBIGUOUS) { //if nothing is found return the 'first' error sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes); } return sym; } + + @Override + void debug(DiagnosticPosition pos, Symbol sym) { + reportVerboseResolutionDiagnostic(pos, name, site, argtypes, typeargtypes, sym); + } } /** @@ -2843,7 +2862,7 @@ public class Resolve { protected Symbol lookup(Env env, MethodResolutionPhase phase) { Scope sc = new Scope(syms.arrayClass); MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); - arrayConstr.type = new MethodType(List.of(syms.intType), site, List.nil(), syms.methodClass); + arrayConstr.type = new MethodType(List.of(syms.intType), site, List.nil(), syms.methodClass); sc.enter(arrayConstr); return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false); } @@ -2924,7 +2943,9 @@ public class Resolve { MethodResolutionPhase prevPhase = currentResolutionContext.step; Symbol prevBest = bestSoFar; currentResolutionContext.step = phase; - bestSoFar = phase.mergeResults(bestSoFar, lookupHelper.lookup(env, phase)); + Symbol sym = lookupHelper.lookup(env, phase); + lookupHelper.debug(pos, sym); + bestSoFar = phase.mergeResults(bestSoFar, sym); env.info.pendingResolutionPhase = (prevBest == bestSoFar) ? prevPhase : phase; } return lookupHelper.access(env, pos, location, bestSoFar); @@ -3630,35 +3651,39 @@ public class Resolve { * is more specific than the others, attempt to merge their signatures. */ Symbol mergeAbstracts(Type site) { - Symbol fst = ambiguousSyms.last(); - Symbol res = fst; - for (Symbol s : ambiguousSyms.reverse()) { - Type mt1 = types.memberType(site, res); - Type mt2 = types.memberType(site, s); - if ((s.flags() & ABSTRACT) == 0 || - !types.overrideEquivalent(mt1, mt2) || - !types.isSameTypes(fst.erasure(types).getParameterTypes(), - s.erasure(types).getParameterTypes())) { - //ambiguity cannot be resolved - return this; - } else { - Type mst = mostSpecificReturnType(mt1, mt2); - if (mst == null) { - // Theoretically, this can't happen, but it is possible - // due to error recovery or mixing incompatible class files + List ambiguousInOrder = ambiguousSyms.reverse(); + for (Symbol s : ambiguousInOrder) { + Type mt = types.memberType(site, s); + boolean found = true; + List allThrown = mt.getThrownTypes(); + for (Symbol s2 : ambiguousInOrder) { + Type mt2 = types.memberType(site, s2); + if ((s2.flags() & ABSTRACT) == 0 || + !types.overrideEquivalent(mt, mt2) || + !types.isSameTypes(s.erasure(types).getParameterTypes(), + s2.erasure(types).getParameterTypes())) { + //ambiguity cannot be resolved return this; } - Symbol mostSpecific = mst == mt1 ? res : s; - List allThrown = chk.intersect(mt1.getThrownTypes(), mt2.getThrownTypes()); - Type newSig = types.createMethodTypeWithThrown(mostSpecific.type, allThrown); - res = new MethodSymbol( - mostSpecific.flags(), - mostSpecific.name, - newSig, - mostSpecific.owner); + Type mst = mostSpecificReturnType(mt, mt2); + if (mst == null || mst != mt) { + found = false; + break; + } + allThrown = chk.intersect(allThrown, mt2.getThrownTypes()); + } + if (found) { + //all ambiguous methods were abstract and one method had + //most specific return type then others + return (allThrown == mt.getThrownTypes()) ? + s : new MethodSymbol( + s.flags(), + s.name, + types.createMethodTypeWithThrown(mt, allThrown), + s.owner); } } - return res; + return this; } @Override diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java index e532eea8595..1717e50194f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java @@ -1985,6 +1985,9 @@ public class ClassReader implements Completer { syms.methodClass); } MethodSymbol m = new MethodSymbol(flags, name, type, currentOwner); + if (types.isSignaturePolymorphic(m)) { + m.flags_field |= SIGNATURE_POLYMORPHIC; + } if (saveParameterNames) initParameterNames(m); Symbol prevOwner = currentOwner; diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java index 63cff9ffba6..d151dd46172 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java @@ -919,11 +919,15 @@ public class Code { if (o instanceof Long) return syms.longType; if (o instanceof Double) return syms.doubleType; if (o instanceof ClassSymbol) return syms.classType; - if (o instanceof Type.ArrayType) return syms.classType; - if (o instanceof Type.MethodType) return syms.methodTypeType; - if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type); if (o instanceof Pool.MethodHandle) return syms.methodHandleType; - throw new AssertionError(o); + if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type); + if (o instanceof Type) { + Type ty = ((Type)o).unannotatedType(); + + if (ty instanceof Type.ArrayType) return syms.classType; + if (ty instanceof Type.MethodType) return syms.methodTypeType; + } + throw new AssertionError("Invalid type of constant pool entry: " + o.getClass()); } /** Emit an opcode with a one-byte operand field; @@ -1855,7 +1859,7 @@ public class Code { } } - static final Type jsrReturnValue = new Type(INT, null); + static final Type jsrReturnValue = new JCPrimitiveType(INT, null); /* ************************************************************************** diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java index f9ceb77d33b..241845ec0eb 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java @@ -991,9 +991,19 @@ public class Gen extends JCTree.Visitor { */ void genMethod(JCMethodDecl tree, Env env, boolean fatcode) { MethodSymbol meth = tree.sym; -// System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG - if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + - (((tree.mods.flags & STATIC) == 0 || meth.isConstructor()) ? 1 : 0) > + int extras = 0; + // Count up extra parameters + if (meth.isConstructor()) { + extras++; + if (meth.enclClass().isInner() && + !meth.enclClass().isStatic()) { + extras++; + } + } else if ((tree.mods.flags & STATIC) == 0) { + extras++; + } + // System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG + if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + extras > ClassFile.MAX_PARAMETERS) { log.error(tree.pos(), "limit.parameters"); nerrs++; @@ -1773,7 +1783,16 @@ public class Gen extends JCTree.Visitor { r.load(); code.emitop0(ireturn + Code.truncate(Code.typecode(pt))); } else { + /* If we have a statement like: + * + * return; + * + * we need to store the code.pendingStatPos value before generating + * the finalizer. + */ + int tmpPos = code.pendingStatPos; targetEnv = unwind(env.enclMethod, env); + code.pendingStatPos = tmpPos; code.emitop0(return_); } endFinalizerGaps(env, targetEnv); diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java index 291a3414205..0c20e771cd9 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -1435,11 +1435,13 @@ public class JavaCompiler implements ClassReader.SourceCompleter { env.tree = transTypes.translateTopLevelClass(env.tree, localMake); compileStates.put(env, CompileState.TRANSTYPES); - if (shouldStop(CompileState.UNLAMBDA)) - return; + if (source.allowLambda()) { + if (shouldStop(CompileState.UNLAMBDA)) + return; - env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake); - compileStates.put(env, CompileState.UNLAMBDA); + env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake); + compileStates.put(env, CompileState.UNLAMBDA); + } if (shouldStop(CompileState.LOWER)) return; diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java index 44a6cd57dd5..72a279d7173 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java @@ -377,10 +377,10 @@ public class Main { } public Result compile(String[] args, - String[] classNames, - Context context, - List fileObjects, - Iterable processors) + String[] classNames, + Context context, + List fileObjects, + Iterable processors) { context.put(Log.outKey, out); log = Log.instance(context); diff --git a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java index 76d29eb7531..14e377fb37f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java +++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java @@ -139,7 +139,7 @@ public class JavacTypes implements javax.lang.model.util.Types { Type unboxed = types.unboxedType((Type) t); if (! unboxed.isPrimitive()) // only true primitives, not void throw new IllegalArgumentException(t.toString()); - return unboxed; + return (PrimitiveType)unboxed; } public TypeMirror capture(TypeMirror t) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java index 5b5ba0bb3f3..b2472185210 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -2914,7 +2914,9 @@ public class JavacParser implements Parser { pos = token.pos; accept(LBRACE); ListBuffer buf = new ListBuffer(); - if (token.kind != RBRACE) { + if (token.kind == COMMA) { + nextToken(); + } else if (token.kind != RBRACE) { buf.append(annotationValue()); while (token.kind == COMMA) { nextToken(); diff --git a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index 83b1ee23bb9..4e966f9b716 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -36,10 +36,7 @@ import java.util.regex.*; import javax.annotation.processing.*; import javax.lang.model.SourceVersion; -import javax.lang.model.element.AnnotationMirror; -import javax.lang.model.element.Element; -import javax.lang.model.element.PackageElement; -import javax.lang.model.element.TypeElement; +import javax.lang.model.element.*; import javax.lang.model.util.*; import javax.tools.DiagnosticListener; import javax.tools.JavaFileManager; @@ -762,12 +759,30 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea } @Override - public Set scan(Element e, Set p) { + public Set visitType(TypeElement e, Set p) { + // Type parameters are not considered to be enclosed by a type + scan(e.getTypeParameters(), p); + return scan(e.getEnclosedElements(), p); + } + + @Override + public Set visitExecutable(ExecutableElement e, Set p) { + // Type parameters are not considered to be enclosed by an executable + scan(e.getTypeParameters(), p); + return scan(e.getEnclosedElements(), p); + } + + void addAnnotations(Element e, Set p) { for (AnnotationMirror annotationMirror : elements.getAllAnnotationMirrors(e) ) { Element e2 = annotationMirror.getAnnotationType().asElement(); p.add((TypeElement) e2); } + } + + @Override + public Set scan(Element e, Set p) { + addAnnotations(e, p); return super.scan(e, p); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java index 157f7eb0125..42d9d44cfa2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java @@ -146,6 +146,20 @@ public class JavacRoundEnvironment implements RoundEnvironment { this.typeUtil = typeUtil; } + @Override + public Set visitType(TypeElement e, DeclaredType p) { + // Type parameters are not considered to be enclosed by a type + scan(e.getTypeParameters(), p); + return scan(e.getEnclosedElements(), p); + } + + @Override + public Set visitExecutable(ExecutableElement e, DeclaredType p) { + // Type parameters are not considered to be enclosed by an executable + scan(e.getTypeParameters(), p); + return scan(e.getEnclosedElements(), p); + } + @Override public Set scan(Element e, DeclaredType p) { java.util.List annotationMirrors = @@ -157,7 +171,6 @@ public class JavacRoundEnvironment implements RoundEnvironment { e.accept(this, p); return annotatedElements; } - } /** diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties index 192780ab956..2487b7bef92 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -1163,6 +1163,23 @@ compiler.note.compressed.diags=\ compiler.note.potential.lambda.found=\ This anonymous inner class creation can be turned into a lambda expression. +# 0: boolean, 1: symbol +compiler.note.lambda.stat=\ + Translating lambda expression\n\ + alternate metafactory = {0}\n\ + synthetic method = {1} + +# 0: boolean, 1: unused +compiler.note.mref.stat=\ + Translating method reference\n\ + alternate metafactory = {0}\n\ + +# 0: boolean, 1: symbol +compiler.note.mref.stat.1=\ + Translating method reference\n\ + alternate metafactory = {0}\n\ + bridge method = {1} + compiler.note.note=\ Note:\u0020 @@ -2187,7 +2204,7 @@ compiler.warn.assert.as.identifier=\ compiler.warn.underscore.as.identifier=\ ''_'' used as an identifier\n\ - (use of ''_'' as an identifier might not be supported in future releases) + (use of ''_'' as an identifier might not be supported in releases after Java SE 8) compiler.err.enum.as.identifier=\ as of release 5, ''enum'' is a keyword, and may not be used as an identifier\n\ diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties index dc6c03fbe25..bff4e9a217b 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties @@ -166,14 +166,17 @@ compiler.misc.descriptor.throws=\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF: {2} # 0: type compiler.misc.no.suitable.functional.intf.inst={0}\u306E\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30C7\u30A3\u30B9\u30AF\u30EA\u30D7\u30BF\u3092\u63A8\u8AD6\u3067\u304D\u307E\u305B\u3093 -# 0: type -compiler.misc.secondary.bound.must.be.marker.intf=\u30BB\u30AB\u30F3\u30C0\u30EA\u30FB\u30D0\u30A4\u30F3\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30DE\u30FC\u30AB\u30FC\u30FB\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: message segment +compiler.misc.bad.intersection.target.for.functional.expr=\u30E9\u30E0\u30C0\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u4EA4\u5DEE\u30BF\u30A4\u30D7\u30FB\u30BF\u30FC\u30B2\u30C3\u30C8\u304C\u4E0D\u6B63\u3067\u3059\n{0} + +# 0: symbol or type +compiler.misc.not.an.intf.component=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7{0}\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 # 0: symbol kind, 1: message segment -compiler.err.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\u3002{1} +compiler.err.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\n{1} # 0: symbol kind, 1: message segment -compiler.misc.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\u3002{1} +compiler.misc.invalid.mref={0}\u53C2\u7167\u304C\u7121\u52B9\u3067\u3059\n{1} compiler.misc.static.mref.with.targs=static\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u5316\u3055\u308C\u305F\u4FEE\u98FE\u5B50 @@ -245,24 +248,24 @@ compiler.err.duplicate.annotation.invalid.repeated=\u6CE8\u91C8{0}\u3092\u7E70\u compiler.err.duplicate.annotation.member.value={1}\u306E\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC\u306E\u5024{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 # 0: type, 1: type -compiler.err.duplicate.annotation.missing.container=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306E\u5BA3\u8A00\u306B\u306F\u6709\u52B9\u306A{1}\u6CE8\u91C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +compiler.err.duplicate.annotation.missing.container=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}\u306E\u5BA3\u8A00\u306B\u306F\u6709\u52B9\u306A{1}\u6CE8\u91C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 # 0: type -compiler.err.invalid.repeatable.annotation=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u7121\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u6CE8\u91C8\u3067\u6CE8\u91C8\u4ED8\u3051\u3055\u308C\u3066\u3044\u307E\u3059 +compiler.err.invalid.repeatable.annotation=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}\u306F\u7121\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u6CE8\u91C8\u3067\u6CE8\u91C8\u4ED8\u3051\u3055\u308C\u3066\u3044\u307E\u3059 -# 0: type -compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +# 0: symbol or type +compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093 # 0: type, 1: number -compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002{1}\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059 +compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002{1}\u5024\u8981\u7D20\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059 # 0: type -compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002{0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5024\u8981\u7D20\u304C\u7121\u52B9\u3067\u3059\u3002\u30E1\u30BD\u30C3\u30C9\u304C\u5FC5\u8981\u3067\u3059 +compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}\u306F\u6709\u52B9\u306A\u7E70\u8FD4\u3057\u53EF\u80FD\u306A\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093: \u5024\u8981\u7D20\u304C\u7121\u52B9\u3067\u3059 -# 0: type, 1: type, 2: type -compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059\u3002\u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306E\u5024\u8981\u7D20\u306B\u306F\u578B{2}\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002{1}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F +# 0: symbol type, 1: type, 2: type +compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: \u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306E\u5024\u8981\u7D20\u306B\u306F\u578B{2}\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002{1}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F -# 0: type, 1: symbol +# 0: symbol or type, 1: symbol compiler.err.invalid.repeatable.annotation.elem.nondefault=\u5305\u542B\u3059\u308B\u6CE8\u91C8{0}\u306B\u306F\u8981\u7D20{1}\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 # 0: symbol, 1: type, 2: symbol, 3: type @@ -357,6 +360,9 @@ compiler.err.illegal.esc.char=\u30A8\u30B9\u30B1\u30FC\u30D7\u6587\u5B57\u304C\u compiler.err.illegal.forward.ref=\u524D\u65B9\u53C2\u7167\u304C\u4E0D\u6B63\u3067\u3059 +# 0: symbol, 1: string +compiler.err.not.in.profile={0}\u306F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB''{1}''\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + # 0: symbol compiler.warn.forward.ref=\u521D\u671F\u5316\u3055\u308C\u308B\u524D\u306E\u5909\u6570''{0}''\u3092\u53C2\u7167\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F @@ -425,6 +431,10 @@ compiler.err.invalid.meth.decl.ret.type.req=\u7121\u52B9\u306A\u30E1\u30BD\u30C3 compiler.err.varargs.and.old.array.syntax=\u65E7\u5F0F\u306E\u914D\u5217\u8868\u8A18\u6CD5\u306F\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 +compiler.err.varargs.and.receiver =varargs\u8868\u8A18\u306F\u53D7\u53D6\u308A\u5074\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +compiler.err.array.and.receiver =\u65E7\u5F0F\u306E\u914D\u5217\u8868\u8A18\u6CD5\u306F\u53D7\u53D6\u308A\u5074\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + compiler.err.variable.not.allowed=\u5909\u6570\u306E\u5BA3\u8A00\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 # 0: name @@ -472,6 +482,7 @@ compiler.err.missing.meth.body.or.decl.abstract=\u30E1\u30BD\u30C3\u30C9\u672C\u compiler.err.missing.ret.stmt=return\u6587\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +# 0: unused compiler.misc.missing.ret.val=\u623B\u308A\u5024\u304C\u3042\u308A\u307E\u305B\u3093 compiler.misc.unexpected.ret.val=\u4E88\u671F\u3057\u306A\u3044\u623B\u308A\u5024 @@ -503,7 +514,7 @@ compiler.err.native.meth.cant.have.body=native\u30E1\u30BD\u30C3\u30C9\u304C\u67 compiler.err.neither.conditional.subtype=?\u306B\u5BFE\u3059\u308B\u4E0D\u9069\u5408\u306A\u578B : \u3069\u3061\u3089\u3082\u4ED6\u65B9\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n2\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {0}\n3\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {1} # 0: message segment -compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u5F0F\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059\u3002{0} +compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u5F0F\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0} compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u5F0F\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306Fvoid\u306B\u3067\u304D\u307E\u305B\u3093 @@ -521,6 +532,11 @@ compiler.err.incompatible.thrown.types.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7 compiler.misc.incompatible.arg.types.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u578B\u306F\u4E0D\u9069\u5408\u3067\u3059 +compiler.misc.incompatible.arg.types.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u578B\u306F\u4E0D\u9069\u5408\u3067\u3059 + +# 0: list of type, 1: message segment +compiler.misc.bad.arg.types.in.lambda=\u63A8\u5B9A\u30D1\u30E9\u30E1\u30FC\u30BF\u578B\u3067\u306F\u30E9\u30E0\u30C0\u5F0F\u306E\u578B\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\n\u63A8\u5B9A\u578B: {0} + compiler.err.new.not.allowed.in.annotation=''new''\u306F\u6CE8\u91C8\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 compiler.err.no.annotation.member={1}\u306E\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC{0}\u304C\u3042\u308A\u307E\u305B\u3093 @@ -545,6 +561,9 @@ compiler.misc.cant.access.inner.cls.constr=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\ # 0: symbol, 1: symbol compiler.err.not.def.public.cant.access={1}\u306E{0}\u306Fpublic\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u5916\u304B\u3089\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 +# 0: symbol, 1: symbol +compiler.misc.not.def.public.cant.access={1}\u306E{0}\u306Fpublic\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u5916\u304B\u3089\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 + # 0: name compiler.err.not.loop.label={0}\u306F\u30EB\u30FC\u30D7\u30FB\u30E9\u30D9\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093 @@ -684,7 +703,7 @@ compiler.err.illegal.default.super.call=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30 # 0: symbol, 1: type compiler.misc.overridden.default={1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u307E\u3059 -# 0: symbol, 1: symbol +# 0: symbol, 1: type or symbol compiler.misc.redundant.supertype=\u5197\u9577\u306A\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u306F{1}\u306B\u3088\u3063\u3066\u62E1\u5F35\u3055\u308C\u307E\u3057\u305F compiler.err.unclosed.char.lit=\u6587\u5B57\u30EA\u30C6\u30E9\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093 @@ -806,6 +825,8 @@ compiler.misc.x.print.rounds=\u5F80\u5FA9{0}:\n\t\u5165\u529B\u30D5\u30A1\u30A4\ ## The following string will appear before all messages keyed as: ## "compiler.note". +compiler.note.compressed.diags=\u4E00\u90E8\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u7C21\u7565\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002-Xdiags:verbose\u3067\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u5B8C\u5168\u306A\u51FA\u529B\u3092\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044 + compiler.note.potential.lambda.found=\u3053\u306E\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u30E9\u30E0\u30C0\u5F0F\u306B\u5909\u63DB\u3067\u304D\u307E\u3059\u3002 compiler.note.note=\u6CE8\u610F: @@ -1231,6 +1252,9 @@ compiler.err.not.within.bounds=\u578B\u5F15\u6570{0}\u306F\u578B\u5909\u6570{1}\ # 0: message segment compiler.err.prob.found.req=\u4E0D\u9069\u5408\u306A\u578B: {0} +# 0: message segment +compiler.misc.prob.found.req=\u4E0D\u9069\u5408\u306A\u578B: {0} + # 0: message segment, 1: type, 2: type compiler.warn.prob.found.req={0}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {1} @@ -1341,10 +1365,9 @@ compiler.misc.varargs.argument.mismatch=\u53EF\u5909\u5F15\u6570\u306E\u4E0D\u4E ##### -# 0: type, 1: file name +# 0: symbol or type, 1: file name compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file={1}\u306E\u88DC\u52A9\u30AF\u30E9\u30B9{0}\u306B\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u5916\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 - ## The first argument ({0}) is a "kindname". # 0: symbol kind, 1: symbol, 2: symbol compiler.err.abstract.cant.be.accessed.directly=\u62BD\u8C61{0}\u3067\u3042\u308B{1}({2}\u5185)\u306B\u76F4\u63A5\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 @@ -1356,6 +1379,9 @@ compiler.err.non-static.cant.be.ref=static\u3067\u306A\u3044{0} {1}\u3092static\ # 0: symbol kind, 1: symbol compiler.misc.non-static.cant.be.ref=static\u3067\u306A\u3044{0} {1}\u3092static\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u53C2\u7167\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +# 0: symbol kind, 1: symbol +compiler.misc.static.method.in.unbound.lookup=\u975E\u30D0\u30A4\u30F3\u30C9\u691C\u7D22\u3067\u9759\u7684\u306A{0} {1}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F + ## Both arguments ({0}, {1}) are "kindname"s. {0} is a comma-separated list ## of kindnames (the list should be identical to that provided in source. compiler.err.unexpected.type=\u4E88\u671F\u3057\u306A\u3044\u578B\n\u671F\u5F85\u5024: {0}\n\u691C\u51FA\u5024: {1} @@ -1467,6 +1493,9 @@ compiler.warn.override.unchecked.ret={0}\n\u623B\u308A\u5024\u306E\u578B\u306F{1 # 0: message segment, 1: type compiler.warn.override.unchecked.thrown={0}\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306F{1}\u3092\u30B9\u30ED\u30FC\u3057\u307E\u305B\u3093 +# 0: symbol +compiler.warn.override.equals.but.not.hashcode=\u30AF\u30E9\u30B9{0}\u306F\u7B49\u53F7\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u304C\u3001\u3053\u306E\u30AF\u30E9\u30B9\u3082\u30B9\u30FC\u30D1\u30FC\u30AF\u30E9\u30B9\u3082hashCode\u30E1\u30BD\u30C3\u30C9\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u305B\u3093 + ## The following are all possible strings for the first argument ({0}) of the ## above strings. # 0: symbol, 1: symbol, 2: symbol, 3: symbol @@ -1530,12 +1559,27 @@ compiler.err.assert.as.identifier=\u30EA\u30EA\u30FC\u30B91.4\u304B\u3089''asser # TODO 308: make a better error message compiler.err.this.as.identifier=\u30EA\u30EA\u30FC\u30B98\u304B\u3089''this''\u306F\u53D7\u4FE1\u30BF\u30A4\u30D7\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3068\u3057\u3066\u306E\u307F\u8A31\u53EF\u3055\u308C\u3001\u6700\u521D\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: symbol +compiler.err.receiver.parameter.not.applicable.constructor.toplevel.class=\u53D7\u53D6\u308A\u5074\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u6700\u4E0A\u4F4D\u30EC\u30D9\u30EB\u30FB\u30AF\u30E9\u30B9\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093 + # TODO 308: make a better error message compiler.err.cant.annotate.static.class=\u5305\u542B\u3059\u308Bstatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + # TODO 308: make a better error message +# 0: unused compiler.err.cant.annotate.nested.type=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 -compiler.err.incorrect.receiver.type=\u53D7\u4FE1\u30BF\u30A4\u30D7\u304C\u3001\u5305\u542B\u3059\u308B\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093 +# 0: type, 1: type +compiler.err.incorrect.receiver.name=\u53D7\u53D6\u308A\u5074\u306E\u540D\u524D\u304C\u3001\u5305\u542B\u3059\u308B\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\n\u5FC5\u9808: {0}\n\u691C\u51FA: {1} + +# 0: type, 1: type +compiler.err.incorrect.receiver.type=\u53D7\u53D6\u308A\u5074\u306E\u30BF\u30A4\u30D7\u304C\u3001\u5305\u542B\u3059\u308B\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\n\u5FC5\u9808: {0}\n\u691C\u51FA: {1} + +# 0: type, 1: type +compiler.err.incorrect.constructor.receiver.type=\u53D7\u53D6\u308A\u5074\u306E\u30BF\u30A4\u30D7\u304C\u3001\u5305\u542B\u3059\u308B\u5916\u90E8\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\n\u5FC5\u9808: {0}\n\u691C\u51FA: {1} + +# 0: type, 1: type +compiler.err.incorrect.constructor.receiver.name=\u53D7\u53D6\u308A\u5074\u306E\u540D\u524D\u304C\u3001\u5305\u542B\u3059\u308B\u5916\u90E8\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\n\u5FC5\u9808: {0}\n\u691C\u51FA: {1} compiler.err.no.annotations.on.dot.class=\u6CE8\u91C8\u306F\u30AF\u30E9\u30B9\u30FB\u30EA\u30C6\u30E9\u30EB\u306E\u30BF\u30A4\u30D7\u3067\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties index af6298e1b48..b2e76c037f4 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties @@ -166,14 +166,17 @@ compiler.misc.descriptor.throws=\u63CF\u8FF0\u7B26: {2} {0}({1}) \u629B\u51FA{3} # 0: type compiler.misc.no.suitable.functional.intf.inst=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u51FD\u6570\u63A5\u53E3\u63CF\u8FF0\u7B26 -# 0: type -compiler.misc.secondary.bound.must.be.marker.intf=\u6B21\u7EA7\u9650\u5236\u8303\u56F4{0}\u5FC5\u987B\u4E3A\u6807\u8BB0\u63A5\u53E3 +# 0: message segment +compiler.misc.bad.intersection.target.for.functional.expr=lambda \u6216\u65B9\u6CD5\u5F15\u7528\u7684\u4EA4\u53C9\u7C7B\u578B\u76EE\u6807\u9519\u8BEF\n{0} + +# 0: symbol or type +compiler.misc.not.an.intf.component=\u7EC4\u4EF6\u7C7B\u578B{0}\u4E0D\u662F\u63A5\u53E3 # 0: symbol kind, 1: message segment -compiler.err.invalid.mref={0} \u5F15\u7528\u65E0\u6548; {1} +compiler.err.invalid.mref={0}\u5F15\u7528\u65E0\u6548\n{1} # 0: symbol kind, 1: message segment -compiler.misc.invalid.mref={0} \u5F15\u7528\u65E0\u6548; {1} +compiler.misc.invalid.mref={0}\u5F15\u7528\u65E0\u6548\n{1} compiler.misc.static.mref.with.targs=\u6709\u5173\u9759\u6001\u65B9\u6CD5\u5F15\u7528\u7684\u53C2\u6570\u5316\u9650\u5B9A\u7B26 @@ -245,24 +248,24 @@ compiler.err.duplicate.annotation.invalid.repeated=\u65E0\u6CD5\u91CD\u590D\u6CE compiler.err.duplicate.annotation.member.value={1}\u4E2D\u7684\u6CE8\u91CA\u6210\u5458\u503C{0}\u91CD\u590D # 0: type, 1: type -compiler.err.duplicate.annotation.missing.container=\u6CE8\u91CA\u91CD\u590D, {0}\u7684\u58F0\u660E\u6CA1\u6709\u6709\u6548\u7684{1}\u6CE8\u91CA +compiler.err.duplicate.annotation.missing.container=\u6CE8\u91CA\u91CD\u590D: {0}\u7684\u58F0\u660E\u6CA1\u6709\u6709\u6548\u7684{1}\u6CE8\u91CA # 0: type -compiler.err.invalid.repeatable.annotation=\u6CE8\u91CA\u91CD\u590D, \u4F7F\u7528\u65E0\u6548\u7684\u53EF\u91CD\u590D\u6CE8\u91CA\u5BF9{0}\u8FDB\u884C\u4E86\u6CE8\u91CA +compiler.err.invalid.repeatable.annotation=\u6CE8\u91CA\u91CD\u590D: \u4F7F\u7528\u65E0\u6548\u7684 Repeatable \u6CE8\u91CA\u5BF9{0}\u8FDB\u884C\u4E86\u6CE8\u91CA -# 0: type -compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u672A\u58F0\u660E\u4EFB\u4F55\u503C\u5143\u7D20\u65B9\u6CD5 +# 0: symbol or type +compiler.err.invalid.repeatable.annotation.no.value=\u6CE8\u91CA\u91CD\u590D: {0}\u4E0D\u662F\u6709\u6548\u7684 Repeatable, \u672A\u58F0\u660E\u4EFB\u4F55\u503C\u5143\u7D20\u65B9\u6CD5 # 0: type, 1: number -compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u5DF2\u58F0\u660E {1} \u4E2A\u503C\u5143\u7D20\u65B9\u6CD5 +compiler.err.invalid.repeatable.annotation.multiple.values=\u6CE8\u91CA\u91CD\u590D: {0}\u4E0D\u662F\u6709\u6548\u7684 Repeatable, \u5DF2\u58F0\u660E {1} \u4E2A\u503C\u5143\u7D20\u65B9\u6CD5 # 0: type -compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91CA\u91CD\u590D, {0}\u4E0D\u662F\u6709\u6548\u7684\u53EF\u91CD\u590D\u7C7B\u578B, \u503C\u5143\u7D20\u65E0\u6548, \u9700\u8981\u65B9\u6CD5 +compiler.err.invalid.repeatable.annotation.invalid.value=\u6CE8\u91CA\u91CD\u590D: {0}\u4E0D\u662F\u6709\u6548\u7684 Repeatable: \u503C\u5143\u7D20\u65E0\u6548 -# 0: type, 1: type, 2: type -compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91CA\u91CD\u590D, \u5305\u542B\u6CE8\u91CA{0}\u7684\u503C\u5143\u7D20\u5E94\u5177\u6709\u7C7B\u578B{2}, \u4F46\u627E\u5230\u7684\u662F{1} +# 0: symbol type, 1: type, 2: type +compiler.err.invalid.repeatable.annotation.value.return=\u6CE8\u91CA\u91CD\u590D: \u5305\u542B\u6CE8\u91CA{0}\u7684\u503C\u5143\u7D20\u5E94\u5177\u6709\u7C7B\u578B{2}, \u4F46\u627E\u5230\u7684\u662F{1} -# 0: type, 1: symbol +# 0: symbol or type, 1: symbol compiler.err.invalid.repeatable.annotation.elem.nondefault=\u5305\u542B\u6CE8\u91CA{0}\u6CA1\u6709\u5143\u7D20 {1} \u7684\u9ED8\u8BA4\u503C # 0: symbol, 1: type, 2: symbol, 3: type @@ -357,6 +360,9 @@ compiler.err.illegal.esc.char=\u975E\u6CD5\u8F6C\u4E49\u7B26 compiler.err.illegal.forward.ref=\u975E\u6CD5\u524D\u5411\u5F15\u7528 +# 0: symbol, 1: string +compiler.err.not.in.profile={0}\u5728\u914D\u7F6E\u6587\u4EF6 ''{1}'' \u4E2D\u4E0D\u53EF\u7528 + # 0: symbol compiler.warn.forward.ref=\u5148\u5F15\u7528\u53D8\u91CF ''{0}'', \u7136\u540E\u518D\u5BF9\u5176\u521D\u59CB\u5316 @@ -425,6 +431,10 @@ compiler.err.invalid.meth.decl.ret.type.req=\u65B9\u6CD5\u58F0\u660E\u65E0\u6548 compiler.err.varargs.and.old.array.syntax=variable-arity \u53C2\u6570\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4F20\u7EDF\u6570\u7EC4\u8BB0\u53F7 +compiler.err.varargs.and.receiver =\u63A5\u6536\u65B9\u53C2\u6570\u4E0D\u5141\u8BB8\u4F7F\u7528 varargs \u8BB0\u53F7 + +compiler.err.array.and.receiver =\u63A5\u6536\u65B9\u53C2\u6570\u4E0D\u5141\u8BB8\u4F7F\u7528\u4F20\u7EDF\u6570\u7EC4\u8BB0\u53F7 + compiler.err.variable.not.allowed=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u53D8\u91CF\u58F0\u660E # 0: name @@ -472,6 +482,7 @@ compiler.err.missing.meth.body.or.decl.abstract=\u7F3A\u5C11\u65B9\u6CD5\u4E3B\u compiler.err.missing.ret.stmt=\u7F3A\u5C11\u8FD4\u56DE\u8BED\u53E5 +# 0: unused compiler.misc.missing.ret.val=\u7F3A\u5C11\u8FD4\u56DE\u503C compiler.misc.unexpected.ret.val=\u610F\u5916\u7684\u8FD4\u56DE\u503C @@ -503,7 +514,7 @@ compiler.err.native.meth.cant.have.body=\u672C\u673A\u65B9\u6CD5\u4E0D\u80FD\u5E compiler.err.neither.conditional.subtype=? \u7684\u4E0D\u517C\u5BB9\u7C7B\u578B: \u4E24\u8005\u90FD\u4E0D\u662F\u5BF9\u65B9\u7684\u5B50\u7C7B\u578B\n\u7B2C\u4E8C\u4E2A\u64CD\u4F5C\u6570: {0}\n\u7B2C\u4E09\u4E2A\u64CD\u4F5C\u6570: {1} # 0: message segment -compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u8868\u8FBE\u5F0F\u4E2D\u7684\u7C7B\u578B\u9519\u8BEF; {0} +compiler.misc.incompatible.type.in.conditional=\u6761\u4EF6\u8868\u8FBE\u5F0F\u4E2D\u7684\u7C7B\u578B\u9519\u8BEF\n{0} compiler.misc.conditional.target.cant.be.void=\u6761\u4EF6\u8868\u8FBE\u5F0F\u7684\u76EE\u6807\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A @@ -521,6 +532,11 @@ compiler.err.incompatible.thrown.types.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u6 compiler.misc.incompatible.arg.types.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u53C2\u6570\u7C7B\u578B\u4E0D\u517C\u5BB9 +compiler.misc.incompatible.arg.types.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u7684\u53C2\u6570\u7C7B\u578B\u4E0D\u517C\u5BB9 + +# 0: list of type, 1: message segment +compiler.misc.bad.arg.types.in.lambda=\u65E0\u6CD5\u4F7F\u7528\u63A8\u65AD\u53C2\u6570\u7C7B\u578B\u5BF9 lambda \u8868\u8FBE\u5F0F\u8FDB\u884C\u7C7B\u578B\u68C0\u67E5\n\u63A8\u65AD\u7C7B\u578B: {0} + compiler.err.new.not.allowed.in.annotation=\u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 ''new'' compiler.err.no.annotation.member={1}\u4E2D\u6CA1\u6709\u6CE8\u91CA\u6210\u5458{0} @@ -545,6 +561,9 @@ compiler.misc.cant.access.inner.cls.constr=\u65E0\u6CD5\u8BBF\u95EE\u6784\u9020\ # 0: symbol, 1: symbol compiler.err.not.def.public.cant.access={0}\u5728{1}\u4E2D\u4E0D\u662F\u516C\u5171\u7684; \u65E0\u6CD5\u4ECE\u5916\u90E8\u7A0B\u5E8F\u5305\u4E2D\u5BF9\u5176\u8FDB\u884C\u8BBF\u95EE +# 0: symbol, 1: symbol +compiler.misc.not.def.public.cant.access={0}\u5728{1}\u4E2D\u4E0D\u662F\u516C\u5171\u7684; \u65E0\u6CD5\u4ECE\u5916\u90E8\u7A0B\u5E8F\u5305\u4E2D\u5BF9\u5176\u8FDB\u884C\u8BBF\u95EE + # 0: name compiler.err.not.loop.label=\u4E0D\u662F loop \u6807\u7B7E: {0} @@ -684,7 +703,7 @@ compiler.err.illegal.default.super.call=\u9ED8\u8BA4\u8D85\u7EA7\u8C03\u7528\u4E # 0: symbol, 1: type compiler.misc.overridden.default=\u8986\u76D6\u4E86{1}\u4E2D\u7684\u65B9\u6CD5 {0} -# 0: symbol, 1: symbol +# 0: symbol, 1: type or symbol compiler.misc.redundant.supertype=\u5197\u4F59\u63A5\u53E3 {0} \u5DF2\u7531 {1} \u6269\u5C55 compiler.err.unclosed.char.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u6587\u5B57 @@ -806,6 +825,8 @@ compiler.misc.x.print.rounds=\u5FAA\u73AF {0}:\n\t\u8F93\u5165\u6587\u4EF6: {1}\ ## The following string will appear before all messages keyed as: ## "compiler.note". +compiler.note.compressed.diags=\u67D0\u4E9B\u6D88\u606F\u5DF2\u7ECF\u8FC7\u7B80\u5316; \u8BF7\u4F7F\u7528 -Xdiags:verbose \u91CD\u65B0\u7F16\u8BD1\u4EE5\u83B7\u5F97\u5B8C\u6574\u8F93\u51FA + compiler.note.potential.lambda.found=\u53EF\u5C06\u6B64\u533F\u540D\u5185\u90E8\u7C7B\u521B\u5EFA\u8F6C\u6362\u4E3A lambda \u8868\u8FBE\u5F0F\u3002 compiler.note.note=\u6CE8: @@ -879,10 +900,10 @@ compiler.misc.version.not.available=(\u7248\u672C\u4FE1\u606F\u4E0D\u53EF\u7528) compiler.misc.verbose.checking.attribution=[\u6B63\u5728\u68C0\u67E5{0}] # 0: string -compiler.misc.verbose.parsing.done=[\u8BED\u6CD5\u5206\u6790\u5DF2\u5B8C\u6210, \u7528\u65F6 {0} \u6BEB\u79D2] +compiler.misc.verbose.parsing.done=[\u89E3\u6790\u5DF2\u5B8C\u6210, \u7528\u65F6 {0} \u6BEB\u79D2] # 0: file name -compiler.misc.verbose.parsing.started=[\u8BED\u6CD5\u5206\u6790\u5F00\u59CB\u65F6\u95F4 {0}] +compiler.misc.verbose.parsing.started=[\u89E3\u6790\u5F00\u59CB\u65F6\u95F4 {0}] # 0: string compiler.misc.verbose.total=[\u5171 {0} \u6BEB\u79D2] @@ -1146,7 +1167,7 @@ compiler.err.expected2=\u9700\u8981{0}\u6216{1} # 0: token, 1: token, 2: token compiler.err.expected3=\u9700\u8981{0}, {1}\u6216{2} -compiler.err.premature.eof=\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u5DF2\u5230\u8FBE\u6587\u4EF6\u7ED3\u5C3E +compiler.err.premature.eof=\u89E3\u6790\u65F6\u5DF2\u5230\u8FBE\u6587\u4EF6\u7ED3\u5C3E ## The following are related in form, but do not easily fit the above paradigm. compiler.err.dot.class.expected=\u9700\u8981 ''.class'' @@ -1231,6 +1252,9 @@ compiler.err.not.within.bounds=\u7C7B\u578B\u53C2\u6570{0}\u4E0D\u5728\u7C7B\u57 # 0: message segment compiler.err.prob.found.req=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B: {0} +# 0: message segment +compiler.misc.prob.found.req=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B: {0} + # 0: message segment, 1: type, 2: type compiler.warn.prob.found.req={0}\n\u9700\u8981: {2}\n\u627E\u5230: {1} @@ -1341,10 +1365,9 @@ compiler.misc.varargs.argument.mismatch=varargs \u4E0D\u5339\u914D; {0} ##### -# 0: type, 1: file name +# 0: symbol or type, 1: file name compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file={1} \u4E2D\u7684\u8F85\u52A9\u7C7B{0}\u4E0D\u5E94\u4ECE\u5176\u81EA\u8EAB\u7684\u6E90\u6587\u4EF6\u4EE5\u5916\u8BBF\u95EE - ## The first argument ({0}) is a "kindname". # 0: symbol kind, 1: symbol, 2: symbol compiler.err.abstract.cant.be.accessed.directly=\u65E0\u6CD5\u76F4\u63A5\u8BBF\u95EE{2}\u4E2D\u7684\u62BD\u8C61{0} {1} @@ -1356,6 +1379,9 @@ compiler.err.non-static.cant.be.ref=\u65E0\u6CD5\u4ECE\u9759\u6001\u4E0A\u4E0B\u # 0: symbol kind, 1: symbol compiler.misc.non-static.cant.be.ref=\u65E0\u6CD5\u4ECE\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u5F15\u7528\u975E\u9759\u6001 {0} {1} +# 0: symbol kind, 1: symbol +compiler.misc.static.method.in.unbound.lookup=\u5728\u672A\u7ED1\u5B9A\u67E5\u627E\u4E2D\u627E\u5230\u9759\u6001{0} {1} + ## Both arguments ({0}, {1}) are "kindname"s. {0} is a comma-separated list ## of kindnames (the list should be identical to that provided in source. compiler.err.unexpected.type=\u610F\u5916\u7684\u7C7B\u578B\n\u9700\u8981: {0}\n\u627E\u5230: {1} @@ -1467,6 +1493,9 @@ compiler.warn.override.unchecked.ret={0}\n\u8FD4\u56DE\u7C7B\u578B\u9700\u8981\u # 0: message segment, 1: type compiler.warn.override.unchecked.thrown={0}\n\u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u672A\u629B\u51FA{1} +# 0: symbol +compiler.warn.override.equals.but.not.hashcode=\u7C7B{0}\u8986\u76D6\u4E86\u7B49\u53F7, \u4F46\u8BE5\u7C7B\u6216\u4EFB\u4F55\u8D85\u7C7B\u90FD\u672A\u8986\u76D6 hashCode \u65B9\u6CD5 + ## The following are all possible strings for the first argument ({0}) of the ## above strings. # 0: symbol, 1: symbol, 2: symbol, 3: symbol @@ -1530,12 +1559,27 @@ compiler.err.assert.as.identifier=\u4ECE\u53D1\u884C\u7248 1.4 \u5F00\u59CB, ''a # TODO 308: make a better error message compiler.err.this.as.identifier=\u4ECE\u53D1\u884C\u7248 8 \u5F00\u59CB, ''this'' \u53EA\u80FD\u4F5C\u4E3A\u63A5\u6536\u65B9\u7C7B\u578B\u7684\u53C2\u6570\u540D, \u8BE5\u53C2\u6570\u5FC5\u987B\u4E3A\u7B2C\u4E00\u4E2A\u53C2\u6570 +# 0: symbol +compiler.err.receiver.parameter.not.applicable.constructor.toplevel.class=\u63A5\u6536\u65B9\u53C2\u6570\u4E0D\u9002\u7528\u4E8E\u9876\u5C42\u7C7B\u7684\u6784\u9020\u5668 + # TODO 308: make a better error message compiler.err.cant.annotate.static.class=\u65E0\u6CD5\u5BF9\u5C01\u95ED\u9759\u6001\u5D4C\u5957\u7C7B\u8FDB\u884C\u6CE8\u91CA + # TODO 308: make a better error message +# 0: unused compiler.err.cant.annotate.nested.type=\u65E0\u6CD5\u5BF9\u5D4C\u5957\u7C7B\u578B\u8FDB\u884C\u6CE8\u91CA -compiler.err.incorrect.receiver.type=\u63A5\u6536\u65B9\u7C7B\u578B\u4E0E\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D +# 0: type, 1: type +compiler.err.incorrect.receiver.name=\u63A5\u6536\u65B9\u540D\u79F0\u4E0E\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D\n\u9700\u8981: {0}\n\u627E\u5230: {1} + +# 0: type, 1: type +compiler.err.incorrect.receiver.type=\u63A5\u6536\u65B9\u7C7B\u578B\u4E0E\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D\n\u9700\u8981: {0}\n\u627E\u5230: {1} + +# 0: type, 1: type +compiler.err.incorrect.constructor.receiver.type=\u63A5\u6536\u65B9\u7C7B\u578B\u4E0E\u5916\u90E8\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D\n\u9700\u8981: {0}\n\u627E\u5230: {1} + +# 0: type, 1: type +compiler.err.incorrect.constructor.receiver.name=\u63A5\u6536\u65B9\u540D\u79F0\u4E0E\u5916\u90E8\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D\n\u9700\u8981: {0}\n\u627E\u5230: {1} compiler.err.no.annotations.on.dot.class=\u7C7B\u6587\u5B57\u7C7B\u578B\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4EFB\u4F55\u6CE8\u91CA diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties index 7396add6c89..0170a70384d 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties @@ -47,6 +47,7 @@ javac.opt.sourceDest=\u751F\u6210\u3055\u308C\u305F\u30BD\u30FC\u30B9\u30FB\u30D javac.opt.headerDest=\u751F\u6210\u3055\u308C\u305F\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u683C\u7D0D\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B javac.opt.J=\u3092\u5B9F\u884C\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059 javac.opt.encoding=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u4F7F\u7528\u3059\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B +javac.opt.profile=\u4F7F\u7528\u3055\u308C\u3066\u3044\u308BAPI\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u4F7F\u7528\u53EF\u80FD\u304B\u3069\u3046\u304B\u3092\u78BA\u8A8D\u3057\u307E\u3059 javac.opt.target=\u7279\u5B9A\u306EVM\u30D0\u30FC\u30B8\u30E7\u30F3\u7528\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B javac.opt.source=\u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u3064 javac.opt.Werror=\u8B66\u544A\u304C\u767A\u751F\u3057\u305F\u5834\u5408\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7D42\u4E86\u3059\u308B @@ -61,6 +62,7 @@ javac.opt.arg.path= javac.opt.arg.dirs= javac.opt.arg.directory= javac.opt.arg.encoding= +javac.opt.arg.profile= javac.opt.arg.release= javac.opt.arg.number= javac.opt.plugin=\u5B9F\u884C\u3055\u308C\u308B\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u540D\u524D\u3068\u30AA\u30D7\u30B7\u30E7\u30F3\u5F15\u6570 @@ -95,6 +97,7 @@ javac.opt.printRounds=\u6CE8\u91C8\u51E6\u7406\u306E\u5F80\u5FA9\u306B\u3064\u30 javac.opt.printProcessorInfo=\u30D7\u30ED\u30BB\u30C3\u30B5\u304C\u51E6\u7406\u3092\u4F9D\u983C\u3055\u308C\u308B\u6CE8\u91C8\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u5370\u5237\u3059\u308B javac.opt.prefer=\u6697\u9ED9\u7684\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3055\u308C\u308B\u30AF\u30E9\u30B9\u306B\u3064\u3044\u3066\u3001\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3068\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4E21\u65B9\u304C\u898B\u3064\u304B\u3063\u305F\u969B\u3069\u3061\u3089\u3092\u8AAD\u307F\u8FBC\u3080\u304B\u6307\u5B9A\u3059\u308B javac.opt.AT=\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u306E\u8AAD\u53D6\u308A\u30AA\u30D7\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30D5\u30A1\u30A4\u30EB\u540D +javac.opt.diags=\u8A3A\u65AD\u30E2\u30FC\u30C9\u306E\u9078\u629E ## errors @@ -102,6 +105,7 @@ javac.err.empty.A.argument=-A\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3 javac.err.invalid.arg={0}\u306F\u7121\u52B9\u306A\u5F15\u6570\u3067\u3059 javac.err.invalid.A.key=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3''{0}''\u306E\u30AD\u30FC\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u4E00\u9023\u306E\u8B58\u5225\u5B50\u304C\u3001\u30C9\u30C3\u30C8\u3067\u533A\u5207\u3089\u308C\u3066\u3044\u307E\u305B\u3093 javac.err.invalid.flag={0}\u306F\u7121\u52B9\u306A\u30D5\u30E9\u30B0\u3067\u3059 +javac.err.invalid.profile=\u7121\u52B9\u306A\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB: {0} javac.err.invalid.target={0}\u306F\u7121\u52B9\u306A\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9\u3067\u3059 javac.err.no.source.files=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093 javac.err.no.source.files.classes=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u540D\u304C\u3042\u308A\u307E\u305B\u3093 @@ -110,6 +114,7 @@ javac.err.invalid.source={0}\u306F\u7121\u52B9\u306A\u30BD\u30FC\u30B9\u30FB\u30 javac.err.error.writing.file={0}\u306E\u66F8\u8FBC\u307F\u30A8\u30E9\u30FC\u3067\u3059\u3002{1} javac.warn.source.target.conflict=\u30BD\u30FC\u30B9\u30FB\u30EA\u30EA\u30FC\u30B9{0}\u306B\u306F\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9{1}\u304C\u5FC5\u8981\u3067\u3059 javac.warn.target.default.source.conflict=\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9{0}\u304C\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30BD\u30FC\u30B9\u30FB\u30EA\u30EA\u30FC\u30B9{1}\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059 +javac.warn.profile.target.conflict=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB{0}\u306F\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9{1}\u306B\u5BFE\u3057\u3066\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 javac.err.dir.not.found=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u3042\u308A\u307E\u305B\u3093: {0} javac.err.file.not.found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0} javac.err.file.not.directory=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0} diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties index aa2338d344b..79e497f1f87 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties @@ -47,6 +47,7 @@ javac.opt.sourceDest=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u6E90\u6587\u4EF javac.opt.headerDest=\u6307\u5B9A\u653E\u7F6E\u751F\u6210\u7684\u672C\u673A\u6807\u5934\u6587\u4EF6\u7684\u4F4D\u7F6E javac.opt.J=\u76F4\u63A5\u5C06 <\u6807\u8BB0> \u4F20\u9012\u7ED9\u8FD0\u884C\u65F6\u7CFB\u7EDF javac.opt.encoding=\u6307\u5B9A\u6E90\u6587\u4EF6\u4F7F\u7528\u7684\u5B57\u7B26\u7F16\u7801 +javac.opt.profile=\u8BF7\u786E\u4FDD\u4F7F\u7528\u7684 API \u5728\u6307\u5B9A\u7684\u914D\u7F6E\u6587\u4EF6\u4E2D\u53EF\u7528 javac.opt.target=\u751F\u6210\u7279\u5B9A VM \u7248\u672C\u7684\u7C7B\u6587\u4EF6 javac.opt.source=\u63D0\u4F9B\u4E0E\u6307\u5B9A\u53D1\u884C\u7248\u7684\u6E90\u517C\u5BB9\u6027 javac.opt.Werror=\u51FA\u73B0\u8B66\u544A\u65F6\u7EC8\u6B62\u7F16\u8BD1 @@ -61,6 +62,7 @@ javac.opt.arg.path=<\u8DEF\u5F84> javac.opt.arg.dirs=<\u76EE\u5F55> javac.opt.arg.directory=<\u76EE\u5F55> javac.opt.arg.encoding=<\u7F16\u7801> +javac.opt.arg.profile=<\u914D\u7F6E\u6587\u4EF6> javac.opt.arg.release=<\u53D1\u884C\u7248> javac.opt.arg.number=<\u7F16\u53F7> javac.opt.plugin=\u8981\u8FD0\u884C\u7684\u63D2\u4EF6\u7684\u540D\u79F0\u548C\u53EF\u9009\u53C2\u6570 @@ -95,6 +97,7 @@ javac.opt.printRounds=\u8F93\u51FA\u6709\u5173\u6CE8\u91CA\u5904\u7406\u5FAA\u73 javac.opt.printProcessorInfo=\u8F93\u51FA\u6709\u5173\u8BF7\u6C42\u5904\u7406\u7A0B\u5E8F\u5904\u7406\u54EA\u4E9B\u6CE8\u91CA\u7684\u4FE1\u606F javac.opt.prefer=\u6307\u5B9A\u8BFB\u53D6\u6587\u4EF6, \u5F53\u540C\u65F6\u627E\u5230\u9690\u5F0F\u7F16\u8BD1\u7C7B\u7684\u6E90\u6587\u4EF6\u548C\u7C7B\u6587\u4EF6\u65F6 javac.opt.AT=\u4ECE\u6587\u4EF6\u8BFB\u53D6\u9009\u9879\u548C\u6587\u4EF6\u540D +javac.opt.diags=\u9009\u62E9\u8BCA\u65AD\u6A21\u5F0F ## errors @@ -102,6 +105,7 @@ javac.err.empty.A.argument=-A \u9700\u8981\u4E00\u4E2A\u53C2\u6570; \u4F7F\u7528 javac.err.invalid.arg=\u65E0\u6548\u7684\u53C2\u6570: {0} javac.err.invalid.A.key=\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u9009\u9879 ''{0}'' \u4E2D\u7684\u5173\u952E\u5B57\u4E0D\u662F\u4EE5\u70B9\u5206\u9694\u7684\u6807\u8BC6\u7B26\u5E8F\u5217 javac.err.invalid.flag=\u65E0\u6548\u7684\u6807\u8BB0: {0} +javac.err.invalid.profile=\u914D\u7F6E\u6587\u4EF6\u65E0\u6548: {0} javac.err.invalid.target=\u65E0\u6548\u7684\u76EE\u6807\u53D1\u884C\u7248: {0} javac.err.no.source.files=\u65E0\u6E90\u6587\u4EF6 javac.err.no.source.files.classes=\u65E0\u6E90\u6587\u4EF6\u6216\u7C7B\u540D @@ -110,6 +114,7 @@ javac.err.invalid.source=\u65E0\u6548\u7684\u6E90\u53D1\u884C\u7248: {0} javac.err.error.writing.file=\u5199\u5165{0}\u65F6\u51FA\u9519; {1} javac.warn.source.target.conflict=\u6E90\u53D1\u884C\u7248 {0} \u9700\u8981\u76EE\u6807\u53D1\u884C\u7248 {1} javac.warn.target.default.source.conflict=\u76EE\u6807\u53D1\u884C\u7248 {0} \u4E0E\u9ED8\u8BA4\u7684\u6E90\u53D1\u884C\u7248 {1} \u51B2\u7A81 +javac.warn.profile.target.conflict=\u914D\u7F6E\u6587\u4EF6{0}\u5BF9\u4E8E\u76EE\u6807\u53D1\u884C\u7248 {1} \u65E0\u6548 javac.err.dir.not.found=\u627E\u4E0D\u5230\u76EE\u5F55: {0} javac.err.file.not.found=\u627E\u4E0D\u5230\u6587\u4EF6: {0} javac.err.file.not.directory=\u4E0D\u662F\u76EE\u5F55: {0} diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java index 40ec828b879..f503f5f6098 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java @@ -74,8 +74,11 @@ public class TreeInfo { context.put(treeInfoKey, this); Names names = Names.instance(context); - setOpname(POS, "+", names); - setOpname(NEG, names.hyphen); + /* Internally we use +++, --- for unary +, - to reduce +, - operators + * overloading + */ + setOpname(POS, "+++", names); + setOpname(NEG, "---", names); setOpname(NOT, "!", names); setOpname(COMPL, "~", names); setOpname(PREINC, "++", names); diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties index 22938542182..a31ba5973da 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties +++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties @@ -27,7 +27,7 @@ main.errors=\u30A8\u30E9\u30FC{0}\u500B main.error=\u30A8\u30E9\u30FC{0}\u500B main.warnings=\u8B66\u544A{0}\u500B main.warning=\u8B66\u544A{0}\u500B -main.usage=\u4F7F\u7528\u65B9\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n-overview HTML\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u6982\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3080\n-public public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u793A\u3059\n-protected protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8)\n-package package/protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-private \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-help \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n-doclet \u4EE3\u66FFdoclet\u3092\u4ECB\u3057\u3066\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n-docletpath doclet\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3059\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-sourcepath \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-classpath \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-exclude \u9664\u5916\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u6307\u5B9A\u3059\u308B\n-subpackages \u518D\u5E30\u7684\u306B\u30ED\u30FC\u30C9\u3059\u308B\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6307\u5B9A\u3059\u308B\n-breakiterator BreakIterator\u3067\u6700\u521D\u306E\u6587\u3092\u8A08\u7B97\u3059\u308B\n-bootclasspath \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u306B\u3088\u308A\u30ED\u30FC\u30C9\u3055\u308C\u305F\n\t\t\t \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-source \u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u4FDD\u3064\n-extdirs \u62E1\u5F35\u6A5F\u80FD\u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u305F\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-verbose Javadoc\u306E\u52D5\u4F5C\u306B\u3064\u3044\u3066\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n-locale en_US\u3084en_US_WIN\u306A\u3069\u306E\u4F7F\u7528\u3059\u308B\u30ED\u30B1\u30FC\u30EB\n-encoding \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D\n-quiet \u72B6\u614B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u306A\u3044\n-J \u3092\u5B9F\u884C\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059\n-X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B\n +main.usage=\u4F7F\u7528\u65B9\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n-overview HTML\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u6982\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3080\n-public public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u793A\u3059\n-protected protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8)\n-package package/protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-private \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-help \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n-doclet \u4EE3\u66FFdoclet\u3092\u4ECB\u3057\u3066\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n-docletpath doclet\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3059\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-sourcepath \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-classpath \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-exclude \u9664\u5916\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u6307\u5B9A\u3059\u308B\n-subpackages \u518D\u5E30\u7684\u306B\u30ED\u30FC\u30C9\u3059\u308B\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6307\u5B9A\u3059\u308B\n-breakiterator BreakIterator\u3067\u6700\u521D\u306E\u6587\u3092\u8A08\u7B97\u3059\u308B\n-bootclasspath \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u306B\u3088\u308A\u30ED\u30FC\u30C9\u3055\u308C\u305F\n\t\t\t \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-source \u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u63D0\u4F9B\u3059\u308B\n-extdirs \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u305F\u62E1\u5F35\u6A5F\u80FD\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-verbose Javadoc\u306E\u52D5\u4F5C\u306B\u3064\u3044\u3066\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n-locale en_US\u3084en_US_WIN\u306A\u3069\u306E\u4F7F\u7528\u3059\u308B\u30ED\u30B1\u30FC\u30EB\n-encoding \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D\n-quiet \u72B6\u614B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u306A\u3044\n-J \u3092\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059\n-X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B\n main.Xusage=-Xmaxerrs \u51FA\u529B\u3059\u308B\u30A8\u30E9\u30FC\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n-Xmaxwarns \u51FA\u529B\u3059\u308B\u8B66\u544A\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002 main.option.already.seen={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8907\u6570\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002 main.requires_argument=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002 diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java index f29faf05cd7..d203f1140bb 100644 --- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -220,12 +220,6 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { } }, - new HiddenOption(false, "-old") { - void process(JavahTask task, String opt, String arg) { - task.old = true; - } - }, - new HiddenOption(false, "-llni", "-Xllni") { void process(JavahTask task, String opt, String arg) { task.llni = true; @@ -663,7 +657,6 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { boolean llni; boolean doubleAlign; boolean force; - boolean old; Set javac_extras = new LinkedHashSet(); PrintWriter log; diff --git a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java index 94aeb019658..02795a57233 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java @@ -114,6 +114,9 @@ public class AttributeWriter extends BasicWriter } public Void visitDefault(DefaultAttribute attr, Void ignore) { + if (attr.reason != null) { + report(attr.reason); + } byte[] data = attr.info; int i = 0; int j = 0; @@ -365,8 +368,7 @@ public class AttributeWriter extends BasicWriter indent(+1); println("Start Length Slot Name Signature"); for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) { - Formatter formatter = new Formatter(); - println(formatter.format("%8d %7d %5d %5s %s", + println(String.format("%5d %7d %5d %5s %s", entry.start_pc, entry.length, entry.index, constantWriter.stringValue(entry.name_index), constantWriter.stringValue(entry.descriptor_index))); @@ -511,7 +513,12 @@ public class AttributeWriter extends BasicWriter } public Void visitSourceDebugExtension(SourceDebugExtension_attribute attr, Void ignore) { - println("SourceDebugExtension: " + attr.getValue()); + println("SourceDebugExtension:"); + indent(+1); + for (String s: attr.getValue().split("[\r\n]+")) { + println(s); + } + indent(-1); return null; } @@ -609,7 +616,8 @@ public class AttributeWriter extends BasicWriter public Void visit_append_frame(StackMapTable_attribute.append_frame frame, Void p) { printHeader(frame); println(" /* append */"); - println(" offset_delta = " + frame.offset_delta); + indent(+1); + println("offset_delta = " + frame.offset_delta); printMap("locals", frame.locals); return null; } diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java index 2b499a831cd..77f9c3c8991 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java +++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java @@ -452,8 +452,7 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { } try { - boolean ok = run(); - return ok ? EXIT_OK : EXIT_ERROR; + return run(); } finally { if (defaultFileManager != null) { try { @@ -569,12 +568,13 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { } public Boolean call() { - return run(); + return run() == 0; } - public boolean run() { - if (classes == null || classes.size() == 0) - return false; + public int run() { + if (classes == null || classes.isEmpty()) { + return EXIT_ERROR; + } context.put(PrintWriter.class, log); ClassWriter classWriter = ClassWriter.instance(context); @@ -583,54 +583,55 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { attributeFactory.setCompat(options.compat); - boolean ok = true; + int result = EXIT_OK; for (String className: classes) { - JavaFileObject fo; try { - writeClass(classWriter, className); + result = writeClass(classWriter, className); } catch (ConstantPoolException e) { reportError("err.bad.constant.pool", className, e.getLocalizedMessage()); - ok = false; + result = EXIT_ERROR; } catch (EOFException e) { reportError("err.end.of.file", className); - ok = false; + result = EXIT_ERROR; } catch (FileNotFoundException e) { reportError("err.file.not.found", e.getLocalizedMessage()); - ok = false; + result = EXIT_ERROR; } catch (IOException e) { //e.printStackTrace(); Object msg = e.getLocalizedMessage(); - if (msg == null) + if (msg == null) { msg = e; + } reportError("err.ioerror", className, msg); - ok = false; + result = EXIT_ERROR; } catch (Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.close(); reportError("err.crash", t.toString(), sw.toString()); - ok = false; + result = EXIT_ABNORMAL; } } - return ok; + return result; } - protected boolean writeClass(ClassWriter classWriter, String className) + protected int writeClass(ClassWriter classWriter, String className) throws IOException, ConstantPoolException { JavaFileObject fo = open(className); if (fo == null) { reportError("err.class.not.found", className); - return false; + return EXIT_ERROR; } ClassFileInfo cfInfo = read(fo); if (!className.endsWith(".class")) { String cfName = cfInfo.cf.getName(); - if (!cfName.replaceAll("[/$]", ".").equals(className.replaceAll("[/$]", "."))) + if (!cfName.replaceAll("[/$]", ".").equals(className.replaceAll("[/$]", "."))) { reportWarning("warn.unexpected.class", className, cfName.replace('/', '.')); + } } write(cfInfo); @@ -640,7 +641,7 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { if (a instanceof InnerClasses_attribute) { InnerClasses_attribute inners = (InnerClasses_attribute) a; try { - boolean ok = true; + int result = EXIT_OK; for (int i = 0; i < inners.classes.length; i++) { int outerIndex = inners.classes[i].outer_class_info_index; ConstantPool.CONSTANT_Class_info outerClassInfo = cf.constant_pool.getClassInfo(outerIndex); @@ -651,21 +652,22 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { String innerClassName = innerClassInfo.getName(); classWriter.println("// inner class " + innerClassName.replaceAll("[/$]", ".")); classWriter.println(); - ok = ok & writeClass(classWriter, innerClassName); + result = writeClass(classWriter, innerClassName); + if (result != EXIT_OK) return result; } } - return ok; + return result; } catch (ConstantPoolException e) { reportError("err.bad.innerclasses.attribute", className); - return false; + return EXIT_ERROR; } } else if (a != null) { reportError("err.bad.innerclasses.attribute", className); - return false; + return EXIT_ERROR; } } - return true; + return EXIT_OK; } protected JavaFileObject open(String className) throws IOException { diff --git a/langtools/src/share/classes/com/sun/tools/javap/resources/javap_ja.properties b/langtools/src/share/classes/com/sun/tools/javap/resources/javap_ja.properties new file mode 100644 index 00000000000..e5b96053f10 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javap/resources/javap_ja.properties @@ -0,0 +1,63 @@ + +err.prefix=\u30A8\u30E9\u30FC: + +err.bad.constant.pool={0}\u306E\u5B9A\u6570\u30D7\u30FC\u30EB\u306E\u8AAD\u53D6\u308A\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1} +err.class.not.found=\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0} +err.crash=\u91CD\u5927\u306A\u5185\u90E8\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0}\n\u6B21\u306E\u60C5\u5831\u3092\u542B\u3080\u30D0\u30B0\u30FB\u30EC\u30DD\u30FC\u30C8\u3092\u30D5\u30A1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044:\n{1} +err.end.of.file={0}\u306E\u8AAD\u53D6\u308A\u4E2D\u306B\u4E88\u671F\u3057\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F +err.file.not.found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0} +err.h.not.supported=-h\u306F\u4F7F\u7528\u53EF\u80FD\u3067\u306A\u304F\u306A\u308A\u307E\u3057\u305F - 'javah'\u30D7\u30ED\u30B0\u30E9\u30E0\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +err.incompatible.options=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u7D44\u5408\u305B\u304C\u4E0D\u6B63\u3067\u3059: {0} +err.internal.error=\u5185\u90E8\u30A8\u30E9\u30FC: {0} {1} {2} +err.invalid.arg.for.option=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0} +err.ioerror={0}\u306E\u8AAD\u53D6\u308A\u4E2D\u306BIO\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1} +err.missing.arg={0}\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +err.no.classes.specified=\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +err.not.standard.file.manager=\u6A19\u6E96\u30D5\u30A1\u30A4\u30EB\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u307F\u6307\u5B9A\u3067\u304D\u307E\u3059 +err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0} +err.verify.not.supported=-verify\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +err.no.SourceFile.attribute=SourceFile\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +err.source.file.not.found=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +err.bad.innerclasses.attribute={0}\u306EInnerClasses\u5C5E\u6027\u304C\u4E0D\u6B63\u3067\u3059 +warn.Xold.not.supported=-Xold\u306F\u4F7F\u7528\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3057\u305F + +main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} \n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001-help\u3092\u4F7F\u7528\u3057\u307E\u3059 + +warn.prefix=\u8B66\u544A: +warn.unexpected.class=\u30D0\u30A4\u30CA\u30EA\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B{1}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059 + +note.prefix=\u6CE8: + +main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} \n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001-help\u3092\u4F7F\u7528\u3057\u307E\u3059 + +main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059: + + +main.opt.help=\ -help --help -? \u3053\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B + +main.opt.version=\ -version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831 + +main.opt.v=\ -v -verbose \u8FFD\u52A0\u60C5\u5831\u3092\u51FA\u529B\u3059\u308B + +main.opt.l=\ -l \u884C\u756A\u53F7\u3068\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u8868\u3092\u51FA\u529B\u3059\u308B + +main.opt.public=\ -public public\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u8868\u793A\u3059\u308B + +main.opt.protected=\ -protected protected/public\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u8868\u793A\u3059\u308B + +main.opt.package=\ -package package/protected/public\u30AF\u30E9\u30B9\u304A\u3088\u3073\n \u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u8868\u793A\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8) + +main.opt.p=\ -p -private \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u8868\u793A\u3059\u308B + +main.opt.c=\ -c \u30B3\u30FC\u30C9\u3092\u9006\u30A2\u30BB\u30F3\u30D6\u30EB\u3059\u308B + +main.opt.s=\ -s \u5185\u90E8\u30BF\u30A4\u30D7\u7F72\u540D\u3092\u51FA\u529B\u3059\u308B + +main.opt.classpath=\ -classpath \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B + +main.opt.bootclasspath=\ -bootclasspath \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B + +main.opt.constants=\ -constants \u9759\u7684final\u5B9A\u6570\u3092\u8868\u793A\u3059\u308B + + +main.opt.sysinfo=\ -sysinfo \u51E6\u7406\u3057\u3066\u3044\u308B\u30AF\u30E9\u30B9\u306E\u30B7\u30B9\u30C6\u30E0\u60C5\u5831(\u30D1\u30B9\u3001\u30B5\u30A4\u30BA\u3001\u65E5\u4ED8\u3001MD5\u30CF\u30C3\u30B7\u30E5)\n \u3092\u8868\u793A\u3059\u308B diff --git a/langtools/src/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties new file mode 100644 index 00000000000..97e4f5ce972 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javap/resources/javap_zh_CN.properties @@ -0,0 +1,63 @@ + +err.prefix=\u9519\u8BEF: + +err.bad.constant.pool=\u8BFB\u53D6{0}\u7684\u5E38\u91CF\u6C60\u65F6\u51FA\u9519: {1} +err.class.not.found=\u627E\u4E0D\u5230\u7C7B: {0} +err.crash=\u51FA\u73B0\u4E25\u91CD\u7684\u5185\u90E8\u9519\u8BEF: {0}\n\u8BF7\u5EFA\u7ACB Bug \u62A5\u544A, \u5E76\u5305\u62EC\u4EE5\u4E0B\u4FE1\u606F:\n{1} +err.end.of.file=\u8BFB\u53D6{0}\u65F6\u51FA\u73B0\u610F\u5916\u7684\u6587\u4EF6\u7ED3\u5C3E +err.file.not.found=\u627E\u4E0D\u5230\u6587\u4EF6: {0} +err.h.not.supported=-h \u4E0D\u518D\u53EF\u7528 - \u8BF7\u4F7F\u7528 'javah' \u7A0B\u5E8F +err.incompatible.options=\u9009\u9879\u7EC4\u5408\u9519\u8BEF: {0} +err.internal.error=\u5185\u90E8\u9519\u8BEF: {0} {1} {2} +err.invalid.arg.for.option=\u9009\u9879\u7684\u53C2\u6570\u65E0\u6548: {0} +err.ioerror=\u8BFB\u53D6{0}\u65F6\u51FA\u73B0 IO \u9519\u8BEF: {1} +err.missing.arg=\u6CA1\u6709\u4E3A{0}\u6307\u5B9A\u503C +err.no.classes.specified=\u672A\u6307\u5B9A\u7C7B +err.not.standard.file.manager=\u4F7F\u7528\u6807\u51C6\u6587\u4EF6\u7BA1\u7406\u5668\u65F6\u53EA\u80FD\u6307\u5B9A\u7C7B\u6587\u4EF6 +err.unknown.option=\u672A\u77E5\u9009\u9879: {0} +err.verify.not.supported=\u4E0D\u652F\u6301 -verify +err.no.SourceFile.attribute=\u6CA1\u6709 SourceFile \u5C5E\u6027 +err.source.file.not.found=\u627E\u4E0D\u5230\u6E90\u6587\u4EF6 +err.bad.innerclasses.attribute={0}\u7684 InnerClasses \u5C5E\u6027\u9519\u8BEF +warn.Xold.not.supported=-Xold \u4E0D\u518D\u53EF\u7528 + +main.usage.summary=\u7528\u6CD5: {0} \n\u4F7F\u7528 -help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879 + +warn.prefix=\u8B66\u544A: +warn.unexpected.class=\u4E8C\u8FDB\u5236\u6587\u4EF6{0}\u5305\u542B{1} + +note.prefix=\u6CE8: + +main.usage.summary=\u7528\u6CD5: {0} \n\u4F7F\u7528 -help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879 + +main.usage=\u7528\u6CD5: {0} \n\u5176\u4E2D, \u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC: + + +main.opt.help=\ -help --help -? \u8F93\u51FA\u6B64\u7528\u6CD5\u6D88\u606F + +main.opt.version=\ -version \u7248\u672C\u4FE1\u606F + +main.opt.v=\ -v -verbose \u8F93\u51FA\u9644\u52A0\u4FE1\u606F + +main.opt.l=\ -l \u8F93\u51FA\u884C\u53F7\u548C\u672C\u5730\u53D8\u91CF\u8868 + +main.opt.public=\ -public \u4EC5\u663E\u793A\u516C\u5171\u7C7B\u548C\u6210\u5458 + +main.opt.protected=\ -protected \u663E\u793A\u53D7\u4FDD\u62A4\u7684/\u516C\u5171\u7C7B\u548C\u6210\u5458 + +main.opt.package=\ -package \u663E\u793A\u7A0B\u5E8F\u5305/\u53D7\u4FDD\u62A4\u7684/\u516C\u5171\u7C7B\n \u548C\u6210\u5458 (\u9ED8\u8BA4) + +main.opt.p=\ -p -private \u663E\u793A\u6240\u6709\u7C7B\u548C\u6210\u5458 + +main.opt.c=\ -c \u5BF9\u4EE3\u7801\u8FDB\u884C\u53CD\u6C47\u7F16 + +main.opt.s=\ -s \u8F93\u51FA\u5185\u90E8\u7C7B\u578B\u7B7E\u540D + +main.opt.classpath=\ -classpath \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E + +main.opt.bootclasspath=\ -bootclasspath \u8986\u76D6\u5F15\u5BFC\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E + +main.opt.constants=\ -constants \u663E\u793A\u9759\u6001\u6700\u7EC8\u5E38\u91CF + + +main.opt.sysinfo=\ -sysinfo \u663E\u793A\u6B63\u5728\u5904\u7406\u7684\u7C7B\u7684\n \u7CFB\u7EDF\u4FE1\u606F (\u8DEF\u5F84, \u5927\u5C0F, \u65E5\u671F, MD5 \u6563\u5217) diff --git a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties new file mode 100644 index 00000000000..8b1fceec177 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_ja.properties @@ -0,0 +1,40 @@ +main.usage.summary=\u4F7F\u7528\u65B9\u6CD5: {0} \n\u4F7F\u7528\u53EF\u80FD\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u30EA\u30B9\u30C8\u306B\u3064\u3044\u3066\u306F\u3001-h\u3001-?\u307E\u305F\u306F--help\u3092\u4F7F\u7528\u3057\u307E\u3059 + +main.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\u306B\u306F\u3001.class\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u540D\u3001\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001JAR\u30D5\u30A1\u30A4\u30EB\u3001\u5B8C\u5168\u4FEE\u98FE\u30AF\u30E9\u30B9\u540D\n\u307E\u305F\u306F\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9"*"\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u4F7F\u7528\u3067\u304D\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059: + +error.prefix=\u30A8\u30E9\u30FC: +warn.prefix=\u8B66\u544A: + +main.opt.h=\ -h -? --help \u3053\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B + +main.opt.version=\ --version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831 + +main.opt.V=\ -V --verbose-level= \u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EC\u30D9\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u30FB\u30EC\u30D9\u30EB\u306E\u4F9D\u5B58\u6027\u3092\u51FA\u529B\u3059\u308B\n \u6709\u52B9\u306A\u30EC\u30D9\u30EB: "package"\u304A\u3088\u3073"class" + +main.opt.v=\ -v --verbose \u8FFD\u52A0\u60C5\u5831\u3092\u51FA\u529B\u3059\u308B + +main.opt.s=\ -s --summary \u4F9D\u5B58\u6027\u306E\u8981\u7D04\u306E\u307F\u51FA\u529B\u3059\u308B + +main.opt.p=\ -p --package= \u5206\u6790\u3092\u3053\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30AF\u30E9\u30B9\u306B\u5236\u9650\u3059\u308B\n (\u8907\u6570\u56DE\u6307\u5B9A\u53EF\u80FD) + +main.opt.e=\ -e --regex= \u5206\u6790\u3092\u30D1\u30BF\u30FC\u30F3\u306B\u4E00\u81F4\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u5236\u9650\u3059\u308B\n (-p\u3068-e\u306F\u6392\u4ED6\u7684) + +main.opt.P=\ -P --profile \u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u542B\u3080\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30D5\u30A1\u30A4\u30EB\u3092\u8868\u793A\u3059\u308B + +main.opt.c=\ -c --classpath= \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B + +main.opt.R=\ -R --recursive \u3059\u3079\u3066\u306E\u4F9D\u5B58\u6027\u3092\u53CD\u5FA9\u7684\u306B\u8D70\u67FB\u3059\u308B + +main.opt.d=\ -d --depth= \u63A8\u79FB\u7684\u306A\u4F9D\u5B58\u6027\u5206\u6790\u306E\u6DF1\u3055\u3092\u6307\u5B9A\u3059\u308B + +err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0} +err.missing.arg={0}\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +err.internal.error=\u5185\u90E8\u30A8\u30E9\u30FC: {0} {1} {2} +err.invalid.arg.for.option=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059: {0} +err.option.after.class=\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u30AF\u30E9\u30B9\u306E\u524D\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0} +err.option.unsupported={0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {1} +err.profiles.msg=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093 +warn.invalid.arg=\u7121\u52B9\u306A\u30AF\u30E9\u30B9\u540D\u307E\u305F\u306F\u30D1\u30B9\u540D\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} +warn.split.package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F{1} {2}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + +artifact.not.found=\u898B\u3064\u304B\u308A\u307E\u305B\u3093 diff --git a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties new file mode 100644 index 00000000000..54e8aee6a94 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps_zh_CN.properties @@ -0,0 +1,40 @@ +main.usage.summary=\u7528\u6CD5: {0} \n\u4F7F\u7528 -h, -? \u6216 --help \u5217\u51FA\u53EF\u80FD\u7684\u9009\u9879 + +main.usage=\u7528\u6CD5: {0} \n\u5176\u4E2D, \u53EF\u4EE5\u662F .class \u6587\u4EF6, \u76EE\u5F55, JAR \u6587\u4EF6\u7684\u8DEF\u5F84\u540D,\n\u4E5F\u53EF\u4EE5\u662F\u5168\u9650\u5B9A\u7C7B\u540D\u6216\u901A\u914D\u7B26 "*"\u3002\u53EF\u80FD\u7684\u9009\u9879\u5305\u62EC: + +error.prefix=\u9519\u8BEF: +warn.prefix=\u8B66\u544A: + +main.opt.h=\ -h -? --help \u8F93\u51FA\u6B64\u7528\u6CD5\u6D88\u606F + +main.opt.version=\ --version \u7248\u672C\u4FE1\u606F + +main.opt.V=\ -V --verbose-level= \u8F93\u51FA\u7A0B\u5E8F\u5305\u7EA7\u522B\u6216\u7C7B\u7EA7\u522B\u88AB\u4F9D\u8D56\u5BF9\u8C61\n \u6709\u6548\u7EA7\u522B\u4E3A: "\u7A0B\u5E8F\u5305" \u548C "\u7C7B" + +main.opt.v=\ -v --verbose \u8F93\u51FA\u9644\u52A0\u4FE1\u606F + +main.opt.s=\ -s --summary \u4EC5\u8F93\u51FA\u88AB\u4F9D\u8D56\u5BF9\u8C61\u6982\u8981 + +main.opt.p=\ -p --package= \u5C06\u5206\u6790\u9650\u5236\u4E3A\u6B64\u7A0B\u5E8F\u5305\u4E2D\u7684\u7C7B\n (\u53EF\u4EE5\u6307\u5B9A\u591A\u6B21) + +main.opt.e=\ -e --regex= \u5C06\u5206\u6790\u9650\u5236\u4E3A\u4E0E\u6A21\u5F0F\u5339\u914D\u7684\u7A0B\u5E8F\u5305\n (-p \u548C -e \u4E92\u65A5) + +main.opt.P=\ -P --profile \u663E\u793A\u914D\u7F6E\u6587\u4EF6\u6216\u5305\u542B\u7A0B\u5E8F\u5305\u7684\u6587\u4EF6 + +main.opt.c=\ -c --classpath= \u6307\u5B9A\u67E5\u627E\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E + +main.opt.R=\ -R --recursive \u9012\u5F52\u904D\u5386\u6240\u6709\u88AB\u4F9D\u8D56\u5BF9\u8C61 + +main.opt.d=\ -d --depth= \u6307\u5B9A\u8FC7\u6E21\u88AB\u4F9D\u8D56\u5BF9\u8C61\u5206\u6790\u7684\u6DF1\u5EA6 + +err.unknown.option=\u672A\u77E5\u9009\u9879: {0} +err.missing.arg=\u6CA1\u6709\u4E3A{0}\u6307\u5B9A\u503C +err.internal.error=\u5185\u90E8\u9519\u8BEF: {0} {1} {2} +err.invalid.arg.for.option=\u9009\u9879\u7684\u53C2\u6570\u65E0\u6548: {0} +err.option.after.class=\u5FC5\u987B\u5728\u7C7B\u4E4B\u524D\u6307\u5B9A\u9009\u9879: {0} +err.option.unsupported=\u4E0D\u652F\u6301{0}: {1} +err.profiles.msg=\u6CA1\u6709\u914D\u7F6E\u6587\u4EF6\u4FE1\u606F +warn.invalid.arg=\u7C7B\u540D\u65E0\u6548\u6216\u8DEF\u5F84\u540D\u4E0D\u5B58\u5728: {0} +warn.split.package=\u5DF2\u5728{1} {2}\u4E2D\u5B9A\u4E49\u7A0B\u5E8F\u5305{0} + +artifact.not.found=\u627E\u4E0D\u5230 diff --git a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java index d559de8a951..d3e8769e7ff 100644 --- a/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java +++ b/langtools/src/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java @@ -136,7 +136,8 @@ public class CompileJavaPackages implements Transformer { // for each compile..... int kbPerFile = 175; String osarch = System.getProperty("os.arch"); - if (osarch.equals("i386")) { + String dataModel = System.getProperty("sun.arch.data.model"); + if ("32".equals(dataModel)) { // For 32 bit platforms, assume it is slightly smaller // because of smaller object headers and pointers. kbPerFile = 119; diff --git a/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java b/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java index eea03b8c526..0ec4b71b341 100644 --- a/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java +++ b/langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java @@ -38,7 +38,7 @@ import javax.tools.Diagnostic; * superclass for most concrete annotation processors. This class * examines annotation values to compute the {@linkplain * #getSupportedOptions options}, {@linkplain - * #getSupportedAnnotationTypes annotations}, and {@linkplain + * #getSupportedAnnotationTypes annotation types}, and {@linkplain * #getSupportedSourceVersion source version} supported by its * subtypes. * diff --git a/langtools/src/share/classes/javax/annotation/processing/Processor.java b/langtools/src/share/classes/javax/annotation/processing/Processor.java index a466bdd711f..c898e74255f 100644 --- a/langtools/src/share/classes/javax/annotation/processing/Processor.java +++ b/langtools/src/share/classes/javax/annotation/processing/Processor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ package javax.annotation.processing; import java.util.Set; +import javax.lang.model.util.Elements; +import javax.lang.model.AnnotatedConstruct; import javax.lang.model.element.*; import javax.lang.model.SourceVersion; @@ -88,23 +90,52 @@ import javax.lang.model.SourceVersion; * configuration mechanisms, such as command line options; for * details, refer to the particular tool's documentation. Which * processors the tool asks to {@linkplain #process run} is a function - * of what annotations are present on the {@linkplain + * of the types of the annotations {@linkplain AnnotatedConstruct present} + * on the {@linkplain * RoundEnvironment#getRootElements root elements}, what {@linkplain * #getSupportedAnnotationTypes annotation types a processor - * processes}, and whether or not a processor {@linkplain #process - * claims the annotations it processes}. A processor will be asked to + * supports}, and whether or not a processor {@linkplain #process + * claims the annotation types it processes}. A processor will be asked to * process a subset of the annotation types it supports, possibly an * empty set. * - * For a given round, the tool computes the set of annotation types on - * the root elements. If there is at least one annotation type - * present, as processors claim annotation types, they are removed - * from the set of unmatched annotations. When the set is empty or no - * more processors are available, the round has run to completion. If + * For a given round, the tool computes the set of annotation types + * that are present on the elements enclosed within the root elements. + * If there is at least one annotation type present, then as + * processors claim annotation types, they are removed from the set of + * unmatched annotation types. When the set is empty or no more + * processors are available, the round has run to completion. If * there are no annotation types present, annotation processing still * occurs but only universal processors which support - * processing {@code "*"} can claim the (empty) set of annotation - * types. + * processing all annotation types, {@code "*"}, can claim the (empty) + * set of annotation types. + * + *

          An annotation type is considered present if there is at least + * one annotation of that type present on an element enclosed within + * the root elements of a round. For this purpose, a type parameter is + * considered to be enclosed by its {@linkplain + * TypeParameterElement#getGenericElement generic + * element}. Annotations on {@linkplain + * java.lang.annotation.ElementType#TYPE_USE type uses}, as opposed to + * annotations on elements, are ignored when computing whether or not + * an annotation type is present. + * + *

          An annotation is present if it meets the definition of being + * present given in {@link AnnotatedConstruct}. In brief, an + * annotation is considered present for the purposes of discovery if + * it is directly present or present via inheritance. An annotation is + * not considered present by virtue of being wrapped by a + * container annotation. Operationally, this is equivalent to an + * annotation being present on an element if and only if it would be + * included in the results of {@link + * Elements#getAllAnnotationMirrors(Element)} called on that element. Since + * annotations inside container annotations are not considered + * present, to properly process {@linkplain + * java.lang.annotation.Repeatable repeatable annotation types}, + * processors are advised to include both the repeatable annotation + * type and its containing annotation type in the set of {@linkplain + * #getSupportedAnnotationTypes() supported annotation types} of a + * processor. * *

          Note that if a processor supports {@code "*"} and returns {@code * true}, all annotations are claimed. Therefore, a universal @@ -257,10 +288,10 @@ public interface Processor { /** * Processes a set of annotation types on type elements * originating from the prior round and returns whether or not - * these annotations are claimed by this processor. If {@code - * true} is returned, the annotations are claimed and subsequent + * these annotation types are claimed by this processor. If {@code + * true} is returned, the annotation types are claimed and subsequent * processors will not be asked to process them; if {@code false} - * is returned, the annotations are unclaimed and subsequent + * is returned, the annotation types are unclaimed and subsequent * processors may be asked to process them. A processor may * always return the same boolean value or may vary the result * based on chosen criteria. @@ -271,7 +302,7 @@ public interface Processor { * * @param annotations the annotation types requested to be processed * @param roundEnv environment for information about the current and prior round - * @return whether or not the set of annotations are claimed by this processor + * @return whether or not the set of annotation types are claimed by this processor */ boolean process(Set annotations, RoundEnvironment roundEnv); diff --git a/langtools/src/share/classes/javax/lang/model/SourceVersion.java b/langtools/src/share/classes/javax/lang/model/SourceVersion.java index e2f3bfd538f..ecb079db75a 100644 --- a/langtools/src/share/classes/javax/lang/model/SourceVersion.java +++ b/langtools/src/share/classes/javax/lang/model/SourceVersion.java @@ -53,6 +53,8 @@ public enum SourceVersion { * 1.4: assert * 1.5: annotations, generics, autoboxing, var-args... * 1.6: no changes + * 1.7: diamond syntax, try-with-resources, etc. + * 1.8: lambda expressions and default methods */ /** @@ -122,6 +124,9 @@ public enum SourceVersion { * The version recognized by the Java Platform, Standard Edition * 7. * + * Additions in this release include, diamond syntax for + * constructors, {@code try}-with-resources, strings in switch, + * binary literals, and multi-catch. * @since 1.7 */ RELEASE_7, @@ -130,6 +135,7 @@ public enum SourceVersion { * The version recognized by the Java Platform, Standard Edition * 8. * + * Additions in this release include lambda expressions and default methods. * @since 1.8 */ RELEASE_8; diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java index e67728d0117..1f9955f4a90 100644 --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java @@ -110,6 +110,8 @@ public class ElementScanner6 extends AbstractElementVisitor6 { /** * Constructor for concrete subclasses; uses the argument for the * default value. + * + * @param defaultValue the default value */ protected ElementScanner6(R defaultValue){ DEFAULT_VALUE = defaultValue; diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java index f4d84d05cd3..deee40f2bcb 100644 --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,6 +101,8 @@ public class ElementScanner7 extends ElementScanner6 { /** * Constructor for concrete subclasses; uses the argument for the * default value. + * + * @param defaultValue the default value */ protected ElementScanner7(R defaultValue){ super(defaultValue); diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java b/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java index 5bd0b91c8a2..f6871360cd4 100644 --- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java +++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,6 +101,8 @@ public class ElementScanner8 extends ElementScanner7 { /** * Constructor for concrete subclasses; uses the argument for the * default value. + * + * @param defaultValue the default value */ protected ElementScanner8(R defaultValue){ super(defaultValue); diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java index 5d1b3d7a309..4b2af1fc991 100644 --- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java +++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java @@ -118,6 +118,10 @@ public class SimpleTypeVisitor6 extends AbstractTypeVisitor6 { * The default action for visit methods. The implementation in * this class just returns {@link #DEFAULT_VALUE}; subclasses will * commonly override this method. + * + * @param e the type to process + * @param p a visitor-specified parameter + * @return {@code DEFAULT_VALUE} unless overridden */ protected R defaultAction(TypeMirror e, P p) { return DEFAULT_VALUE; diff --git a/langtools/test/com/sun/javadoc/testJavaFX/C.java b/langtools/test/com/sun/javadoc/testJavaFX/C.java index 9edfcb3bcee..7005185c2cb 100644 --- a/langtools/test/com/sun/javadoc/testJavaFX/C.java +++ b/langtools/test/com/sun/javadoc/testJavaFX/C.java @@ -57,6 +57,7 @@ public class C { * Defines the direction/speed at which the {@code Timeline} is expected to * be played. * @defaultValue 11 + * @since JavaFX 8.0 */ private DoubleProperty rate; diff --git a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java index d6055369f09..18d77db8666 100644 --- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java +++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java @@ -54,6 +54,8 @@ public class TestJavaFX extends JavadocTester { {"./" + BUG_ID + "/C.html", "Default value:"}, + {"./" + BUG_ID + "/C.html", + "Since:" + NL + "

          JavaFX 8.0
          " }, {"./" + BUG_ID + "/C.html", "

          Sets the value of the property Property"}, {"./" + BUG_ID + "/C.html", @@ -78,7 +80,7 @@ public class TestJavaFX extends JavadocTester { private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "-javafx", + "-d", BUG_ID, "-sourcepath", SRC_DIR, "-javafx", SRC_DIR + FS + "C.java", SRC_DIR + FS + "D.java" }; diff --git a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java index b1293bf2919..763566a03ac 100644 --- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java +++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4665566 4855876 7025314 + * @bug 4665566 4855876 7025314 8012375 8015997 * @summary Verify that the output has the right javascript. * @author jamieh * @library ../lib/ @@ -35,7 +35,7 @@ public class TestJavascript extends JavadocTester { //Test information. - private static final String BUG_ID = "4665566-4855876"; + private static final String BUG_ID = "4665566-4855876-8012375"; //Javadoc arguments. private static final String[] ARGS = new String[] { @@ -53,8 +53,42 @@ public class TestJavascript extends JavadocTester { " targetPage = \"\" + window.location.search;" + NL + " if (targetPage != \"\" && targetPage != \"undefined\")" + NL + " targetPage = targetPage.substring(1);" + NL + - " if (targetPage.indexOf(\":\") != -1)" + NL + + " if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + NL + " targetPage = \"undefined\";" + NL + + " function validURL(url) {" + NL + + " var pos = url.indexOf(\".html\");" + NL + + " if (pos == -1 || pos != url.length - 5)" + NL + + " return false;" + NL + + " var allowNumber = false;" + NL + + " var allowSep = false;" + NL + + " var seenDot = false;" + NL + + " for (var i = 0; i < url.length - 5; i++) {" + NL + + " var ch = url.charAt(i);" + NL + + " if ('a' <= ch && ch <= 'z' ||" + NL + + " 'A' <= ch && ch <= 'Z' ||" + NL + + " ch == '$' ||" + NL + + " ch == '_') {" + NL + + " allowNumber = true;" + NL + + " allowSep = true;" + NL + + " } else if ('0' <= ch && ch <= '9'" + NL + + " || ch == '-') {" + NL + + " if (!allowNumber)" + NL + + " return false;" + NL + + " } else if (ch == '/' || ch == '.') {" + NL + + " if (!allowSep)" + NL + + " return false;" + NL + + " allowNumber = false;" + NL + + " allowSep = false;" + NL + + " if (ch == '.')" + NL + + " seenDot = true;" + NL + + " if (ch == '/' && seenDot)" + NL + + " return false;" + NL + + " } else {" + NL + + " return false;" + NL + + " }" + NL + + " }" + NL + + " return true;" + NL + + " }" + NL + " function loadFrames() {" + NL + " if (targetPage != \"\" && targetPage != \"undefined\")" + NL + " top.classFrame.location = top.targetPage;" + NL + diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java index 2f8e8f68cea..b72d6fbdebe 100644 --- a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java +++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,10 +21,8 @@ * questions. */ -/** - * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} . +/* * @test - * @bug 0000000 * @summary Test for nested inline tags. * * @author jamieh * @library ../lib/ @@ -36,6 +34,9 @@ * @run main TestNestedInlineTag */ +/** + * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} . + */ public class TestNestedInlineTag extends JavadocTester { /** diff --git a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java index f0cf05dcb62..9ff91c2d5c9 100644 --- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java +++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4780441 4874845 4978816 + * @bug 4780441 4874845 4978816 8014017 * @summary Make sure that when the -private flag is not used, members * inherited from package private class are documented in the child. * @@ -33,17 +33,19 @@ * * Make sure that when a private interface method with generic parameters * is implemented, the comments can be inherited properly. + * + * Make sure when no modifier appear in the class signature, the + * signature is displayed correctly without extra space at the beginning. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestPrivateClasses + * @build JavadocTester TestPrivateClasses * @run main TestPrivateClasses */ public class TestPrivateClasses extends JavadocTester { //Test information. - private static final String BUG_ID = "4780441-4874845-4978816"; + private static final String BUG_ID = "4780441-4874845-4978816-8014017"; //Javadoc arguments. private static final String[] ARGS1 = new String[] { @@ -234,8 +236,19 @@ public class TestPrivateClasses extends JavadocTester { " in interface " + "I" + "<java.lang.String>"}, + + //Make sure when no modifier appear in the class signature, the + //signature is displayed correctly without extra space at the beginning. + {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html", + "

          class PrivateParent"},
          +
          +      {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
          +            "
          public class PublicChild"},
          +    };
          +    private static final String[][] NEGATED_TEST2 = {
          +        {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
          +            "
           class PrivateParent"},
               };
          -    private static final String[][] NEGATED_TEST2 = NO_TEST;
           
               /**
                * The entry point of the test.
          diff --git a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
          index 404fc1fe52e..c4044a53d91 100644
          --- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
          +++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -23,7 +23,7 @@
           
           /*
            * @test
          - * @bug      4494033 7028815 7052425
          + * @bug      4494033 7028815 7052425 8007338
            * @summary  Run tests on doclet stylesheet.
            * @author   jamieh
            * @library  ../lib/
          @@ -34,7 +34,7 @@
           public class TestStylesheet extends JavadocTester {
           
               //Test information.
          -    private static final String BUG_ID = "4494033-7028815-7052425";
          +    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
           
               //Javadoc arguments.
               private static final String[] ARGS = new String[] {
          @@ -44,29 +44,45 @@ public class TestStylesheet extends JavadocTester {
               //Input for string search tests.
               private static final String[][] TEST = {
                   {BUG_ID + FS + "stylesheet.css",
          -                "/* Javadoc style sheet */"},
          +            "/* Javadoc style sheet */"},
                   {BUG_ID + FS + "stylesheet.css",
          -                "/*" + NL + "Overall document style" + NL + "*/"},
          +            "/*" + NL + "Overall document style" + NL + "*/"},
                   {BUG_ID + FS + "stylesheet.css",
          -                "/*" + NL + "Heading styles" + NL + "*/"},
          +            "/*" + NL + "Heading styles" + NL + "*/"},
                   {BUG_ID + FS + "stylesheet.css",
          -                "/*" + NL + "Navigation bar styles" + NL + "*/"},
          +            "/*" + NL + "Navigation bar styles" + NL + "*/"},
                   {BUG_ID + FS + "stylesheet.css",
          -                "body {" + NL + "    background-color:#ffffff;" + NL +
          -                "    color:#353833;" + NL +
          -                "    font-family:Arial, Helvetica, sans-serif;" + NL +
          -                "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
          +            "body {" + NL + "    background-color:#ffffff;" + NL +
          +            "    color:#353833;" + NL +
          +            "    font-family:Arial, Helvetica, sans-serif;" + NL +
          +            "    font-size:76%;" + NL + "    margin:0;" + NL + "}"},
                   {BUG_ID + FS + "stylesheet.css",
          -                "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
          +            "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
          +        {BUG_ID + FS + "stylesheet.css",
          +            ".overviewSummary caption, .packageSummary caption, " +
          +            ".contentContainer ul.blockList li.blockList caption, " +
          +            ".summary caption, .classUseContainer caption, " +
          +            ".constantValuesContainer caption {" + NL +
          +            "    position:relative;" + NL +
          +            "    text-align:left;" + NL +
          +            "    background-repeat:no-repeat;" + NL +
          +            "    color:#FFFFFF;" + NL +
          +            "    font-weight:bold;" + NL +
          +            "    clear:none;" + NL +
          +            "    overflow:hidden;" + NL +
          +            "    padding:0px;" + NL +
          +            "    margin:0px;" + NL +
          +            "    white-space:pre;" + NL +
          +            "}"},
                   // Test whether a link to the stylesheet file is inserted properly
                   // in the class documentation.
                   {BUG_ID + FS + "pkg" + FS + "A.html",
          -                ""}
          +            ""}
               };
               private static final String[][] NEGATED_TEST = {
                   {BUG_ID + FS + "stylesheet.css",
          -                "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
          +            "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
               };
           
               /**
          diff --git a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
          index d5f67301b60..77cc77876b5 100644
          --- a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
          +++ b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java
          @@ -21,9 +21,8 @@
            * questions.
            */
           
          -/**
          +/*
            * @test
          - * @bug 0000000
            * @summary Determine if proper warning messages are printed when know.
            * @author jamieh
            * @library ../lib/
          diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
          index 1d3baaa0d1c..61d5758bb5d 100644
          --- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
          +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java
          @@ -78,7 +78,7 @@ public class TestTypeAnnotations extends JavadocTester {
                       "typeannos\">@ClassParamA java.lang.String>"
                   },
                   {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html",
          -            "
           class ExtendsGeneric<K extends " +
          +            "
          class ExtendsGeneric<K extends " +
                       "@ClassParamA Unannotated< java.lang.String>>"
                   },
                   {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html",
          -            "
           class TwoBounds<K extends class TwoBounds<K extends " +
                       "@ClassParamA java.lang.String,V extends @ClassParamB" +
          diff --git a/langtools/test/tools/javac/6360970/T6360970.java b/langtools/test/tools/javac/6360970/T6360970.java
          new file mode 100644
          index 00000000000..58936f41e21
          --- /dev/null
          +++ b/langtools/test/tools/javac/6360970/T6360970.java
          @@ -0,0 +1,25 @@
          +/*
          + * @test /nodynamiccopyright/
          + * @bug 6360970
          + * @summary javac erroneously accept ambiguous field reference
          + * @compile/fail/ref=T6360970.out -XDrawDiagnostics T6360970.java
          + */
          +class T6360970 {
          +    interface A {
          +        int i = 1;
          +    }
          +
          +    interface B {
          +        int i = 2;
          +    }
          +
          +    interface C extends A, B { }
          +
          +    static class D {
          +        public static final int i = 0;
          +    }
          +
          +    static class E extends D implements C { }
          +
          +    int i = E.i; //ambiguous
          +}
          diff --git a/langtools/test/tools/javac/6360970/T6360970.out b/langtools/test/tools/javac/6360970/T6360970.out
          new file mode 100644
          index 00000000000..fa81e937c8a
          --- /dev/null
          +++ b/langtools/test/tools/javac/6360970/T6360970.out
          @@ -0,0 +1,2 @@
          +T6360970.java:24:14: compiler.err.ref.ambiguous: i, kindname.variable, i, T6360970.D, kindname.variable, i, T6360970.A
          +1 error
          diff --git a/langtools/test/tools/javac/6567415/T6567415.java b/langtools/test/tools/javac/6567415/T6567415.java
          index a308d286b35..18a92550b6a 100644
          --- a/langtools/test/tools/javac/6567415/T6567415.java
          +++ b/langtools/test/tools/javac/6567415/T6567415.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          diff --git a/langtools/test/tools/javac/6758789/T6758789b.out b/langtools/test/tools/javac/6758789/T6758789b.out
          index 5393f9add90..5bdb51c22cd 100644
          --- a/langtools/test/tools/javac/6758789/T6758789b.out
          +++ b/langtools/test/tools/javac/6758789/T6758789b.out
          @@ -1,5 +1,5 @@
          -T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo
           T6758789b.java:16:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo, T6758789a.Foo, kindname.class, T6758789a
          +T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo
           - compiler.err.warnings.and.werror
           1 error
           2 warnings
          diff --git a/langtools/test/tools/javac/8015701/AnonymousParameters.java b/langtools/test/tools/javac/8015701/AnonymousParameters.java
          new file mode 100644
          index 00000000000..746b2b9696a
          --- /dev/null
          +++ b/langtools/test/tools/javac/8015701/AnonymousParameters.java
          @@ -0,0 +1,89 @@
          +/*
          + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + *
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + *
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/*
          + * @test
          + * @bug 8015701
          + * @summary javac should generate method parameters correctly.
          + * @compile -parameters AnonymousParameters.java
          + * @run main AnonymousParameters
          + */
          +import java.lang.Class;
          +import java.lang.reflect.Constructor;
          +import java.lang.reflect.Parameter;
          +import java.util.concurrent.Callable;
          +
          +public class AnonymousParameters {
          +
          +    String[] names = {
          +        "this$0",
          +        "val$message"
          +    };
          +
          +    public static void main(String... args) throws Exception {
          +        new AnonymousParameters().run();
          +    }
          +
          +    void run() throws Exception {
          +        Class cls = new ParameterNames().makeInner("hello").getClass();
          +        Constructor ctor = cls.getDeclaredConstructors()[0];
          +        Parameter[] params = ctor.getParameters();
          +
          +        if(params.length == 2) {
          +            for(int i = 0; i < 2; i++) {
          +                System.err.println("Testing parameter " + params[i].getName());
          +                if(!params[i].getName().equals(names[i]))
          +                    error("Expected parameter name " + names[i] +
          +                          " got " + params[i].getName());
          +            }
          +        } else
          +            error("Expected 2 parameters");
          +
          +        if(0 != errors)
          +            throw new Exception("MethodParameters test failed with " +
          +                                errors + " errors");
          +    }
          +
          +    void error(String msg) {
          +        System.err.println("Error: " + msg);
          +        errors++;
          +    }
          +
          +    int errors;
          +}
          +
          +class ParameterNames {
          +
          +    public Callable makeInner(final String message) {
          +        return new Callable()  {
          +            public String call() throws Exception {
          +                return message;
          +            }
          +        };
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        ParameterNames test = new ParameterNames();
          +        System.out.println(test.makeInner("Hello").call());
          +    }
          +}
          diff --git a/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java
          new file mode 100644
          index 00000000000..ec1caf3523c
          --- /dev/null
          +++ b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.java
          @@ -0,0 +1,94 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 6356530
          + * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
          + * @compile/fail/ref=FinalVariableAssignedToInCatchBlockTest.out -XDrawDiagnostics FinalVariableAssignedToInCatchBlockTest.java
          + */
          +
          +import java.io.IOException;
          +
          +public class FinalVariableAssignedToInCatchBlockTest {
          +    public void m1(int o)
          +    {
          +        final int i;
          +        try {
          +            if (o == 1) {
          +                throw new IOException();
          +            } else if (o == 2) {
          +                throw new InterruptedException();
          +            } else {
          +                throw new Exception();
          +            }
          +        } catch (IOException e) {
          +            i = 1;
          +        } catch (InterruptedException ie) {
          +            i = 2;
          +        } catch (Exception e) {
          +            i = 3;
          +        } finally {
          +            i = 4;
          +        }
          +    }
          +
          +    public void m2(int o)
          +    {
          +        final int i;
          +        try {
          +            if (o == 1) {
          +                throw new IOException();
          +            } else if (o == 2) {
          +                throw new InterruptedException();
          +            } else {
          +                throw new Exception();
          +            }
          +        } catch (IOException e) {
          +            i = 1;
          +        } catch (InterruptedException ie) {
          +            i = 2;
          +        } catch (Exception e) {
          +            i = 3;
          +        }
          +    }
          +
          +    public void m3(int o) throws Exception
          +    {
          +        final int i;
          +        try {
          +            if (o == 1) {
          +                throw new IOException();
          +            } else if (o == 2) {
          +                throw new InterruptedException();
          +            } else {
          +                throw new Exception();
          +            }
          +        } catch (IOException e) {
          +            i = 1;
          +        } catch (InterruptedException ie) {
          +            i = 2;
          +        }
          +        i = 3;
          +    }
          +}
          diff --git a/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out
          new file mode 100644
          index 00000000000..58ed58efe31
          --- /dev/null
          +++ b/langtools/test/tools/javac/T6326693/FinalVariableAssignedToInCatchBlockTest.out
          @@ -0,0 +1,3 @@
          +FinalVariableAssignedToInCatchBlockTest.java:52:13: compiler.err.var.might.already.be.assigned: i
          +FinalVariableAssignedToInCatchBlockTest.java:92:9: compiler.err.var.might.already.be.assigned: i
          +2 errors
          diff --git a/langtools/test/tools/javac/T6725036.java b/langtools/test/tools/javac/T6725036.java
          index b27ad886d13..24ea34798da 100644
          --- a/langtools/test/tools/javac/T6725036.java
          +++ b/langtools/test/tools/javac/T6725036.java
          @@ -24,6 +24,7 @@
           /*
            * @test
            * @bug 6725036
          + * @ignore 8016760: failure of regression test langtools/tools/javac/T6725036.java
            * @summary javac returns incorrect value for lastModifiedTime() when
            *          source is a zip file archive
            */
          diff --git a/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java b/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java
          new file mode 100644
          index 00000000000..8557f99a383
          --- /dev/null
          +++ b/langtools/test/tools/javac/T7008643/InlinedFinallyConfuseDebuggersTest.java
          @@ -0,0 +1,117 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 7008643
          + * @summary inlined finally clauses confuse debuggers
          + * @library /tools/javac/lib
          + * @build ToolBox
          + * @run main InlinedFinallyConfuseDebuggersTest
          + */
          +
          +import java.io.File;
          +import java.nio.file.Paths;
          +
          +import com.sun.tools.classfile.ClassFile;
          +import com.sun.tools.classfile.Code_attribute;
          +import com.sun.tools.classfile.LineNumberTable_attribute;
          +import com.sun.tools.classfile.Method;
          +import com.sun.tools.javac.util.Assert;
          +
          +public class InlinedFinallyConfuseDebuggersTest {
          +
          +    static final String testSource =
          +    /* 01 */        "public class InlinedFinallyTest {\n" +
          +    /* 02 */        "    void lookForThisMethod(int value) {\n" +
          +    /* 03 */        "        try {\n" +
          +    /* 04 */        "            if (value > 0) {\n" +
          +    /* 05 */        "                System.out.println(\"if\");\n" +
          +    /* 06 */        "                return;\n" +
          +    /* 07 */        "            }\n" +
          +    /* 08 */        "        } finally {\n" +
          +    /* 09 */        "            System.out.println(\"finally\");\n" +
          +    /* 10 */        "        }\n" +
          +    /* 11 */        "    }\n" +
          +    /* 12 */        "}";
          +
          +    static final int[][] expectedLNT = {
          +    //  {line-number, start-pc},
          +        {4,           0},       //if (value > 0) {
          +        {5,           4},       //    System.out.println("if");
          +        {9,           12},      //System.out.println("finally");
          +        {6,           20},      //    return;
          +        {9,           21},      //System.out.println("finally");
          +        {10,          29},
          +        {9,           32},      //System.out.println("finally");
          +        {11,          43},
          +    };
          +
          +    static final String methodToLookFor = "lookForThisMethod";
          +
          +    public static void main(String[] args) throws Exception {
          +        new InlinedFinallyConfuseDebuggersTest().run();
          +    }
          +
          +    void run() throws Exception {
          +        compileTestClass();
          +        checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
          +                "InlinedFinallyTest.class").toUri()), methodToLookFor);
          +    }
          +
          +    void compileTestClass() throws Exception {
          +        ToolBox.JavaToolArgs javacSuccessArgs =
          +                new ToolBox.JavaToolArgs().setSources(testSource);
          +        ToolBox.javac(javacSuccessArgs);
          +    }
          +
          +    void checkClassFile(final File cfile, String methodToFind) throws Exception {
          +        ClassFile classFile = ClassFile.read(cfile);
          +        boolean methodFound = false;
          +        for (Method method : classFile.methods) {
          +            if (method.getName(classFile.constant_pool).equals(methodToFind)) {
          +                methodFound = true;
          +                Code_attribute code = (Code_attribute) method.attributes.get("Code");
          +                LineNumberTable_attribute lnt =
          +                        (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
          +                Assert.check(lnt.line_number_table_length == expectedLNT.length,
          +                        "The LineNumberTable found has a length different to the expected one");
          +                int i = 0;
          +                for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
          +                    Assert.check(entry.line_number == expectedLNT[i][0] &&
          +                            entry.start_pc == expectedLNT[i][1],
          +                            "LNT entry at pos " + i + " differ from expected." +
          +                            "Found " + entry.line_number + ":" + entry.start_pc +
          +                            ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
          +                    i++;
          +                }
          +            }
          +        }
          +        Assert.check(methodFound, "The seek method was not found");
          +    }
          +
          +    void error(String msg) {
          +        throw new AssertionError(msg);
          +    }
          +
          +}
          diff --git a/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.java b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.java
          new file mode 100644
          index 00000000000..2a66ad45d97
          --- /dev/null
          +++ b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.java
          @@ -0,0 +1,32 @@
          +/*
          + * @test /nodynamiccopyright/
          + * @bug     8016099
          + * @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes )
          + * @compile UncheckedWarningRegressionTest.java
          + * @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java
          + */
          +
          +public class UncheckedWarningRegressionTest {
          +     void suppressedWarningsFinalInitializer() {
          +        @SuppressWarnings("unchecked")
          +        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
          +    }
          +
          +    final Object[] FINAL_EMPTY_ARRAY = {};
          +
          +     void finalInitializer() {
          +        T[] tt = (T[]) FINAL_EMPTY_ARRAY;
          +    }
          +
          +     void suppressedWarningsNonFinalInitializer() {
          +        @SuppressWarnings("unchecked")
          +        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
          +    }
          +
          +    Object[] NON_FINAL_EMPTY_ARRAY = {};
          +
          +     void nonFinalInitializer() {
          +        T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
          +    }
          +
          +}
          diff --git a/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.out b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.out
          new file mode 100644
          index 00000000000..05bd6f7423e
          --- /dev/null
          +++ b/langtools/test/tools/javac/T8016099/UncheckedWarningRegressionTest.out
          @@ -0,0 +1,5 @@
          +UncheckedWarningRegressionTest.java:18:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
          +UncheckedWarningRegressionTest.java:29:24: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), java.lang.Object[], T[]
          +- compiler.err.warnings.and.werror
          +1 error
          +2 warnings
          diff --git a/langtools/test/tools/javac/VersionOpt.java b/langtools/test/tools/javac/VersionOpt.java
          index 285489c5d67..560d47dda62 100644
          --- a/langtools/test/tools/javac/VersionOpt.java
          +++ b/langtools/test/tools/javac/VersionOpt.java
          @@ -1,6 +1,6 @@
           
           /*
          - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -61,7 +61,7 @@ public class VersionOpt {
                       javaHome = javaHome.getParentFile();
                   File toolsJar = new File(new File(javaHome, "lib"), "tools.jar");
           
          -        if (!javacHome.equals(toolsJar.toURI().toString())){
          +        if (!javacHome.equalsIgnoreCase(toolsJar.toURI().toString())) {
                       System.err.println("javac not found in tools.jar: " + javacHome);
                       System.err.println("rest of test skipped");
                       return;
          diff --git a/langtools/test/tools/javac/api/6437999/T6437999.java b/langtools/test/tools/javac/api/6437999/T6437999.java
          index db2f46a3e7a..2fbe3211fb9 100644
          --- a/langtools/test/tools/javac/api/6437999/T6437999.java
          +++ b/langtools/test/tools/javac/api/6437999/T6437999.java
          @@ -33,11 +33,28 @@
            */
           
           import java.io.File;
          +import java.io.IOException;
           import java.nio.charset.Charset;
          +import java.nio.file.Files;
          +import java.util.ArrayList;
           import java.util.Collections;
          +import java.util.List;
           import javax.tools.*;
          +import static java.nio.file.StandardOpenOption.*;
           
           public class T6437999 extends ToolTester {
          +    final File testFile = new File("Utf8.java");
          +    T6437999() throws IOException {
          +        createTestFile();
          +    }
          +    final void createTestFile() throws IOException {
          +        List scratch = new ArrayList<>();
          +        scratch.add("// @author Peter von der Ah" + (char) 0xe9);
          +        scratch.add("class Utf8{}");
          +        Files.write(testFile.toPath(), scratch, Charset.forName("UTF-8"),
          +                CREATE, TRUNCATE_EXISTING);
          +    }
          +
               static class MyDiagnosticListener implements DiagnosticListener {
                   boolean error = false;
                   public void report(Diagnostic diagnostic) {
          @@ -55,7 +72,7 @@ public class T6437999 extends ToolTester {
                   dl.error = false;
                   fm = getFileManager(tool, dl, Charset.forName("ASCII"));
                   fm.handleOption("-source", sourceLevel.iterator());
          -        files = fm.getJavaFileObjects(new File(test_src, "Utf8.java"));
          +        files = fm.getJavaFileObjects(testFile);
                   tool.getTask(null, fm, null, null, null, files).call();
                   if (!dl.error)
                       throw new AssertionError("No error in ASCII mode");
          @@ -63,12 +80,12 @@ public class T6437999 extends ToolTester {
                   dl.error = false;
                   fm = getFileManager(tool, dl, Charset.forName("UTF-8"));
                   fm.handleOption("-source", sourceLevel.iterator());
          -        files = fm.getJavaFileObjects(new File(test_src, "Utf8.java"));
          +        files = fm.getJavaFileObjects(testFile);
                   task = tool.getTask(null, fm, null, null, null, files);
                   if (dl.error)
                       throw new AssertionError("Error in UTF-8 mode");
               }
          -    public static void main(String... args) {
          +    public static void main(String... args) throws IOException {
                   new T6437999().test(args);
               }
           }
          diff --git a/langtools/test/tools/javac/api/T6306137.java b/langtools/test/tools/javac/api/T6306137.java
          index b291114ed9b..c17283c99d8 100644
          --- a/langtools/test/tools/javac/api/T6306137.java
          +++ b/langtools/test/tools/javac/api/T6306137.java
          @@ -27,12 +27,18 @@
            * @summary JSR 199: encoding option doesn't affect standard file manager
            * @compile -encoding utf-8 T6306137.java
            * @run main T6306137
          - * @author  Peter von der Ahé
          + * @author  Peter von der Ah\u00e9
            */
           
           import java.io.File;
          +import java.io.IOException;
          +import java.nio.charset.Charset;
          +import java.nio.file.Files;
          +import java.util.ArrayList;
           import java.util.Arrays;
          +import java.util.List;
           import javax.tools.*;
          +import static java.nio.file.StandardOpenOption.*;
           
           public class T6306137 {
               boolean error;
          @@ -40,8 +46,9 @@ public class T6306137 {
               final JavaCompiler compiler;
               Iterable files;
               DiagnosticListener dl;
          +    final File testFile = new File("Utf8.java");
           
          -    T6306137() {
          +    T6306137() throws IOException {
                   dl = new DiagnosticListener() {
                           public void report(Diagnostic message) {
                               if (message.getKind() == Diagnostic.Kind.ERROR)
          @@ -56,11 +63,17 @@ public class T6306137 {
                   };
                   compiler = ToolProvider.getSystemJavaCompiler();
                   fm = compiler.getStandardFileManager(dl, null, null);
          -        String srcdir = System.getProperty("test.src");
                   files =
          -            fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6306137.java")));
          +            fm.getJavaFileObjectsFromFiles(Arrays.asList(testFile));
          +        createTestFile();
          +    }
          +    final void createTestFile() throws IOException {
          +        List scratch = new ArrayList<>();
          +        scratch.add("// @author Peter von der Ah" + (char)0xe9);
          +        scratch.add("class Utf8{}");
          +        Files.write(testFile.toPath(), scratch, Charset.forName("UTF-8"),
          +                CREATE, TRUNCATE_EXISTING);
               }
          -
               void test(String encoding, boolean good) {
                   error = false;
                   Iterable args = Arrays.asList("-source", "6", "-encoding", encoding, "-d", ".");
          @@ -74,7 +87,7 @@ public class T6306137 {
                   }
               }
           
          -    public static void main(String[] args) {
          +    public static void main(String[] args) throws IOException {
                   T6306137 self = new T6306137();
                   self.test("utf-8", true);
                   self.test("ascii", false);
          diff --git a/langtools/test/tools/javac/constDebug/ConstDebugTest.java b/langtools/test/tools/javac/constDebug/ConstDebugTest.java
          index 6939d8f3836..20a4bf513cf 100644
          --- a/langtools/test/tools/javac/constDebug/ConstDebugTest.java
          +++ b/langtools/test/tools/javac/constDebug/ConstDebugTest.java
          @@ -25,26 +25,25 @@
            * @test
            * @bug 4645152 4785453
            * @summary javac compiler incorrectly inserts  when -g is specified
          - * @library /tools/javac/lib
          - * @build ToolBox
            * @run compile -g ConstDebugTest.java
            * @run main ConstDebugTest
            */
          +import java.nio.file.Paths;
          +import com.sun.tools.classfile.ClassFile;
          +import com.sun.tools.classfile.Method;
           
          -//original test: test/tools/javac/constDebug/ConstDebug.sh
           public class ConstDebugTest {
           
               public static final long l = 12;
           
               public static void main(String args[]) throws Exception {
          -//        "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -g -d . -classpath .${PS}${TESTSRC} $1.java 2> ${TMP1}
          -//        if "${TESTJAVA}${FS}bin${FS}javap" $1.class | grep clinit; then fail
          -        ToolBox.JavaToolArgs javapArgs =
          -                new ToolBox.JavaToolArgs().setAllArgs("-v",
          -                "-classpath", System.getProperty("test.classes"), "ConstDebugTest.class");
          -        if (ToolBox.javap(javapArgs).contains("clinit")) {
          -            throw new AssertionError(
          -                "javac should not create a  method for ConstDebugTest class");
          +        ClassFile classFile = ClassFile.read(Paths.get(System.getProperty("test.classes"),
          +                ConstDebugTest.class.getSimpleName() + ".class"));
          +        for (Method method: classFile.methods) {
          +            if (method.getName(classFile.constant_pool).equals("")) {
          +                throw new AssertionError(
          +                    "javac should not create a  method for ConstDebugTest class");
          +            }
                   }
               }
           
          diff --git a/langtools/test/tools/javac/api/6437999/Utf8.java b/langtools/test/tools/javac/diags/examples/LambdaStat.java
          similarity index 84%
          rename from langtools/test/tools/javac/api/6437999/Utf8.java
          rename to langtools/test/tools/javac/diags/examples/LambdaStat.java
          index a2504b03171..2eb894a54dd 100644
          --- a/langtools/test/tools/javac/api/6437999/Utf8.java
          +++ b/langtools/test/tools/javac/diags/examples/LambdaStat.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -21,7 +21,9 @@
            * questions.
            */
           
          -/**
          - * @author Peter von der Ahé
          - */
          -class Utf8 {}
          +// key: compiler.note.lambda.stat
          +// options: -XDdumpLambdaToMethodStats
          +
          +class LambdaStat {
          +    Runnable r = ()->{};
          +}
          diff --git a/langtools/test/tools/javac/diags/examples/MrefStat.java b/langtools/test/tools/javac/diags/examples/MrefStat.java
          new file mode 100644
          index 00000000000..d87e66546fa
          --- /dev/null
          +++ b/langtools/test/tools/javac/diags/examples/MrefStat.java
          @@ -0,0 +1,31 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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.note.mref.stat
          +// options: -XDdumpLambdaToMethodStats
          +
          +class MrefStat {
          +    Runnable r = MrefStat::m;
          +
          +    static void m() { }
          +}
          diff --git a/langtools/test/tools/javac/diags/examples/MrefStat.java.rej b/langtools/test/tools/javac/diags/examples/MrefStat.java.rej
          new file mode 100644
          index 00000000000..f5286e5a2d2
          --- /dev/null
          +++ b/langtools/test/tools/javac/diags/examples/MrefStat.java.rej
          @@ -0,0 +1,34 @@
          +--- MrefStat.java
          ++++ MrefStat.java
          +@@ -0,0 +1,31 @@
          ++/*
          ++ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          ++ *
          ++ * This code is free software; you can redistribute it and/or modify it
          ++ * under the terms of the GNU General Public License version 2 only, as
          ++ * published by the Free Software Foundation.
          ++ *
          ++ * 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.note.mref.stat
          ++// options: -XDdumpLambdaToMethodStats
          ++
          ++class MrefStat {
          ++    Runnable r = MrefStat::m;
          ++    
          ++    static void m() { }
          ++}
          diff --git a/langtools/test/tools/javac/diags/examples/MrefStat1.java b/langtools/test/tools/javac/diags/examples/MrefStat1.java
          new file mode 100644
          index 00000000000..6318e3c755f
          --- /dev/null
          +++ b/langtools/test/tools/javac/diags/examples/MrefStat1.java
          @@ -0,0 +1,34 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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.note.mref.stat.1
          +// options: -XDdumpLambdaToMethodStats
          +
          +class MrefStat1 {
          +
          +    void m() { }
          +
          +    static class Sub extends MrefStat1 {
          +        Runnable r = super::m;
          +    }
          +}
          diff --git a/langtools/test/tools/javac/diags/examples/MrefStat1.java.rej b/langtools/test/tools/javac/diags/examples/MrefStat1.java.rej
          new file mode 100644
          index 00000000000..b247270db53
          --- /dev/null
          +++ b/langtools/test/tools/javac/diags/examples/MrefStat1.java.rej
          @@ -0,0 +1,37 @@
          +--- MrefStat1.java
          ++++ MrefStat1.java
          +@@ -0,0 +1,34 @@
          ++/*
          ++ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          ++ *
          ++ * This code is free software; you can redistribute it and/or modify it
          ++ * under the terms of the GNU General Public License version 2 only, as
          ++ * published by the Free Software Foundation.
          ++ *
          ++ * 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.note.mref.stat.1
          ++// options: -XDdumpLambdaToMethodStats
          ++
          ++class MrefStat1 {    
          ++    
          ++    void m() { }
          ++    
          ++    static class Sub extends MrefStat1 {
          ++        Runnable r = super::m;
          ++    }
          ++}
          diff --git a/langtools/test/tools/javac/foreach/7139681/T7139681neg.java b/langtools/test/tools/javac/foreach/7139681/T7139681neg.java
          new file mode 100644
          index 00000000000..e5b34a5f2d1
          --- /dev/null
          +++ b/langtools/test/tools/javac/foreach/7139681/T7139681neg.java
          @@ -0,0 +1,16 @@
          +/*
          + * @test /nodynamiccopyright/
          + * @bug 7139681
          + * @summary Enhanced for loop: local variable scope inconsistent with JLS
          + *
          + * @compile/fail/ref=T7139681neg.out -XDrawDiagnostics T7139681neg.java
          + */
          +class T7139681neg {
          +    void testArray() {
          +        for (int a : a) { }
          +    }
          +
          +    void testIterable() {
          +        for (Integer b : b) { }
          +    }
          +}
          diff --git a/langtools/test/tools/javac/foreach/7139681/T7139681neg.out b/langtools/test/tools/javac/foreach/7139681/T7139681neg.out
          new file mode 100644
          index 00000000000..f900f9d2035
          --- /dev/null
          +++ b/langtools/test/tools/javac/foreach/7139681/T7139681neg.out
          @@ -0,0 +1,3 @@
          +T7139681neg.java:10:22: compiler.err.cant.resolve.location: kindname.variable, a, , , (compiler.misc.location: kindname.class, T7139681neg, null)
          +T7139681neg.java:14:26: compiler.err.cant.resolve.location: kindname.variable, b, , , (compiler.misc.location: kindname.class, T7139681neg, null)
          +2 errors
          diff --git a/langtools/test/tools/javac/foreach/7139681/T7139681pos.java b/langtools/test/tools/javac/foreach/7139681/T7139681pos.java
          new file mode 100644
          index 00000000000..bca79e9ba80
          --- /dev/null
          +++ b/langtools/test/tools/javac/foreach/7139681/T7139681pos.java
          @@ -0,0 +1,46 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 7139681
          + * @summary Enhanced for loop: local variable scope inconsistent with JLS
          + *
          + * @compile T7139681pos.java
          + */
          +class T7139681pos {
          +    int[] a;
          +    Iterable b;
          +
          +    void testArray() {
          +        for (int a : a) {
          +            int a2 = a;
          +        }
          +    }
          +
          +    void testIterable() {
          +        for (Integer b : b) {
          +            Integer b2 = b;
          +        }
          +    }
          +}
          diff --git a/langtools/test/tools/javac/generics/7015430/T7015430.out b/langtools/test/tools/javac/generics/7015430/T7015430.out
          index 109bfe7da7f..6e33877e05e 100644
          --- a/langtools/test/tools/javac/generics/7015430/T7015430.out
          +++ b/langtools/test/tools/javac/generics/7015430/T7015430.out
          @@ -1,15 +1,15 @@
          -T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:41:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          -T7015430.java:50:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
          +T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:50:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          -T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
          +T7015430.java:50:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:68:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          -T7015430.java:77:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
          +T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:77:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          -T7015430.java:104:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
          +T7015430.java:77:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:104:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          -T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
          +T7015430.java:104:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:113:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, , java.lang.Iterable, java.lang.Iterable, kindname.class, T7015430
          +T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable
           T7015430.java:41:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
           T7015430.java:68:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
           T7015430.java:95:15: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
          diff --git a/langtools/test/tools/javac/generics/7151802/T7151802.out b/langtools/test/tools/javac/generics/7151802/T7151802.out
          index 94f82828b91..dd708d6e91f 100644
          --- a/langtools/test/tools/javac/generics/7151802/T7151802.out
          +++ b/langtools/test/tools/javac/generics/7151802/T7151802.out
          @@ -1,9 +1,9 @@
           T7151802.java:14:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get1, Z, T7151802.Foo, kindname.class, T7151802
          -T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo
           T7151802.java:22:30: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get3, T7151802.Foo, T7151802.Foo, kindname.class, T7151802
          +T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo
           T7151802.java:30:36: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get5, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T7151802
          -T7151802.java:38:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo
           T7151802.java:38:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get7, T7151802.Foo, T7151802.Foo, kindname.class, T7151802
          +T7151802.java:38:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo
           - compiler.err.warnings.and.werror
           1 error
           6 warnings
          diff --git a/langtools/test/tools/javac/generics/inference/6718364/T6718364.out b/langtools/test/tools/javac/generics/inference/6718364/T6718364.out
          index d637c1fbbeb..a7a70c6b9d9 100644
          --- a/langtools/test/tools/javac/generics/inference/6718364/T6718364.out
          +++ b/langtools/test/tools/javac/generics/inference/6718364/T6718364.out
          @@ -1,3 +1,3 @@
          -T6718364.java:13:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6718364.X, T6718364.X
           T6718364.java:13:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6718364.X,T, T6718364.X>,T6718364.X, kindname.class, T6718364
          +T6718364.java:13:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6718364.X, T6718364.X
           2 warnings
          diff --git a/langtools/test/tools/javac/generics/inference/7177306/T7177306a.out b/langtools/test/tools/javac/generics/inference/7177306/T7177306a.out
          index c455d2463ca..4a21e562164 100644
          --- a/langtools/test/tools/javac/generics/inference/7177306/T7177306a.out
          +++ b/langtools/test/tools/javac/generics/inference/7177306/T7177306a.out
          @@ -1,5 +1,5 @@
          -T7177306a.java:13:34: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List
           T7177306a.java:13:33: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, java.util.List, java.util.List, kindname.class, T7177306a
          +T7177306a.java:13:34: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List
           T7177306a.java:13:33: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7177306a, T7177306a
           - compiler.err.warnings.and.werror
           1 error
          diff --git a/langtools/test/tools/javac/generics/rawOverride/T8008627.java b/langtools/test/tools/javac/generics/rawOverride/T8008627.java
          new file mode 100644
          index 00000000000..425cd63b92d
          --- /dev/null
          +++ b/langtools/test/tools/javac/generics/rawOverride/T8008627.java
          @@ -0,0 +1,47 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8008627
          + * @summary Compiler mishandles three-way return-type-substitutability
          + * @compile T8008627.java
          + */
          +
          +class T8008627 {
          +
          +    interface I {
          +        Object m(Iterable l);
          +    }
          +
          +    interface J {
          +        S m(Iterable l);
          +    }
          +
          +    interface K {
          +        T m(Iterable l);
          +    }
          +
          +    @FunctionalInterface
          +    interface Functional extends I, J, K {}
          +}
          diff --git a/langtools/test/tools/javac/lambda/LambdaConv01.java b/langtools/test/tools/javac/lambda/LambdaConv01.java
          index 73436c2f509..582c99fd383 100644
          --- a/langtools/test/tools/javac/lambda/LambdaConv01.java
          +++ b/langtools/test/tools/javac/lambda/LambdaConv01.java
          @@ -67,7 +67,7 @@ public class LambdaConv01 {
                   assertTrue(3 == f1.foo());
                   //Covariant returns:
                   TU f2 = (Integer x) -> x;
          -        assertTrue(3 == f2.foo(3));
          +        assertTrue(3 == f2.foo(3).intValue());
                   //Method resolution with boxing:
                   int res = LambdaConv01.exec((Integer x) -> x, 3);
                   assertTrue(3 == res);
          @@ -86,7 +86,7 @@ public class LambdaConv01 {
                   assertTrue(3 == f1.foo());
                   //Covariant returns:
                   TU f2 = (Integer x) -> x;
          -        assertTrue(3 == f2.foo(3));
          +        assertTrue(3 == f2.foo(3).intValue());
                   //Method resolution with boxing:
                   int res = LambdaConv01.exec((Integer x) -> x, 3);
                   assertTrue(3 == res);
          @@ -105,7 +105,7 @@ public class LambdaConv01 {
                   assertTrue(3 == f1.foo());
                   //Covariant returns:
                   TU f2 = (Integer x) -> x;
          -        assertTrue(3 == f2.foo(3));
          +        assertTrue(3 == f2.foo(3).intValue());
                   //Method resolution with boxing:
                   int res = LambdaConv01.exec((Integer x) -> x, 3);
                   assertTrue(3 == res);
          @@ -124,7 +124,7 @@ public class LambdaConv01 {
                   assertTrue(3 == f1.foo());
                   //Covariant returns:
                   TU f2 = (Integer x) -> x;
          -        assertTrue(3 == f2.foo(3));
          +        assertTrue(3 == f2.foo(3).intValue());
                   //Method resolution with boxing:
                   int res = LambdaConv01.exec((Integer x) -> x, 3);
                   assertTrue(3 == res);
          diff --git a/langtools/test/tools/javac/lambda/LambdaExpr15.java b/langtools/test/tools/javac/lambda/LambdaExpr15.java
          index fd5f4e14bf0..af00ee5c5d8 100644
          --- a/langtools/test/tools/javac/lambda/LambdaExpr15.java
          +++ b/langtools/test/tools/javac/lambda/LambdaExpr15.java
          @@ -48,7 +48,7 @@ public class LambdaExpr15 {
                       new Object() {
                           String get() { return ""; }
                       };
          -            assertTrue(t == 1);
          +            assertTrue((Integer)t == 1);
                   };
                   ba1.apply(1);
           
          @@ -58,7 +58,7 @@ public class LambdaExpr15 {
                           String get() { return ""; }
                       };
                       new A();
          -            assertTrue(t == 2);
          +            assertTrue((Integer)t == 2);
                   };
                   ba2.apply(2);
                   assertTrue(assertionCount == 2);
          diff --git a/langtools/test/tools/javac/lambda/LambdaScope05.java b/langtools/test/tools/javac/lambda/LambdaScope05.java
          new file mode 100644
          index 00000000000..0fbb4a20576
          --- /dev/null
          +++ b/langtools/test/tools/javac/lambda/LambdaScope05.java
          @@ -0,0 +1,31 @@
          +/*
          + * @test /nodynamiccopyright/
          + * @bug 8015648
          + * @summary Duplicate variable in lambda causes javac crash
          + * @compile/fail/ref=LambdaScope05.out -XDrawDiagnostics LambdaScope05.java
          + */
          +
          +class LambdaScope05 {
          +    interface VoidFun1 {
          +        void m(int i);
          +    }
          +
          +    static Runnable r1 = () -> { VoidFun1 p = p -> { }; };
          +    Runnable r2 = () -> { VoidFun1 p = p -> { }; };
          +
          +    static {
          +        Runnable r = () -> { VoidFun1 p = p -> { }; };
          +    }
          +
          +    {
          +        Runnable r = () -> { VoidFun1 p = p -> { }; };
          +    }
          +
          +    static void m_static() {
          +        Runnable r = () -> { VoidFun1 p = p -> { }; };
          +    }
          +
          +    void m() {
          +        Runnable r = () -> { VoidFun1 p = p -> { }; };
          +    }
          +}
          diff --git a/langtools/test/tools/javac/lambda/LambdaScope05.out b/langtools/test/tools/javac/lambda/LambdaScope05.out
          new file mode 100644
          index 00000000000..722e29d9be9
          --- /dev/null
          +++ b/langtools/test/tools/javac/lambda/LambdaScope05.out
          @@ -0,0 +1,7 @@
          +LambdaScope05.java:13:47: compiler.err.already.defined.in.clinit: kindname.variable, p, kindname.static.init, kindname.class, LambdaScope05
          +LambdaScope05.java:14:40: compiler.err.already.defined.in.clinit: kindname.variable, p, kindname.instance.init, kindname.class, LambdaScope05
          +LambdaScope05.java:17:43: compiler.err.already.defined.in.clinit: kindname.variable, p, kindname.static.init, kindname.class, LambdaScope05
          +LambdaScope05.java:21:43: compiler.err.already.defined.in.clinit: kindname.variable, p, kindname.instance.init, kindname.class, LambdaScope05
          +LambdaScope05.java:25:43: compiler.err.already.defined: kindname.variable, p, kindname.method, m_static()
          +LambdaScope05.java:29:43: compiler.err.already.defined: kindname.variable, p, kindname.method, m()
          +6 errors
          diff --git a/langtools/test/tools/javac/lambda/TargetType74.java b/langtools/test/tools/javac/lambda/TargetType74.java
          new file mode 100644
          index 00000000000..ffd8dbf888c
          --- /dev/null
          +++ b/langtools/test/tools/javac/lambda/TargetType74.java
          @@ -0,0 +1,39 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8015432
          + * @summary javac crashes with stack overflow when method called recursively from nested generic call
          + * @compile TargetType74.java
          + */
          +class TargetType74 {
          +
          +    static class LazySeq { }
          +
          +     LazySeq cons(LazySeq tailFun) { return null; }
          +
          +    > LazySeq mergeSorted(LazySeq a) {
          +        return cons(mergeSorted(a));
          +    }
          +}
          diff --git a/langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java b/langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java
          new file mode 100644
          index 00000000000..7a1d06a0982
          --- /dev/null
          +++ b/langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java
          @@ -0,0 +1,192 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8013576
          + * @summary Add stat support to LambdaToMethod
          + * @library ../lib
          + * @build JavacTestingAbstractThreadedTest
          + * @run main/othervm TestLambdaToMethodStats
          + */
          +
          +// use /othervm to avoid jtreg timeout issues (CODETOOLS-7900047)
          +// see JDK-8006746
          +
          +import java.net.URI;
          +import java.util.Arrays;
          +
          +import javax.tools.Diagnostic;
          +import javax.tools.JavaFileObject;
          +import javax.tools.SimpleJavaFileObject;
          +
          +import com.sun.source.util.JavacTask;
          +import com.sun.tools.javac.api.ClientCodeWrapper;
          +import com.sun.tools.javac.util.JCDiagnostic;
          +
          +public class TestLambdaToMethodStats
          +    extends JavacTestingAbstractThreadedTest
          +    implements Runnable {
          +
          +    enum ExprKind {
          +        LAMBDA("()->null"),
          +        MREF1("this::g"),
          +        MREF2("this::h");
          +
          +        String exprStr;
          +
          +        ExprKind(String exprStr) {
          +            this.exprStr = exprStr;
          +        }
          +    }
          +
          +    enum TargetKind {
          +        IMPLICIT(""),
          +        SERIALIZABLE("(A & java.io.Serializable)");
          +
          +        String targetStr;
          +
          +        TargetKind(String targetStr) {
          +            this.targetStr = targetStr;
          +        }
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        for (ExprKind ek : ExprKind.values()) {
          +            for (TargetKind tk : TargetKind.values()) {
          +                pool.execute(new TestLambdaToMethodStats(ek, tk));
          +            }
          +        }
          +
          +        checkAfterExec(true);
          +    }
          +
          +    ExprKind ek;
          +    TargetKind tk;
          +    JavaSource source;
          +    DiagnosticChecker diagChecker;
          +
          +
          +    TestLambdaToMethodStats(ExprKind ek, TargetKind tk) {
          +        this.ek = ek;
          +        this.tk = tk;
          +        this.source = new JavaSource();
          +        this.diagChecker = new DiagnosticChecker();
          +    }
          +
          +    class JavaSource extends SimpleJavaFileObject {
          +
          +        String template = "interface A {\n" +
          +                          "   Object o();\n" +
          +                          "}\n" +
          +                          "class Test {\n" +
          +                          "   A a = #C#E;\n" +
          +                          "   Object g() { return null; }\n" +
          +                          "   Object h(Object... o) { return null; }\n" +
          +                          "}";
          +
          +        String source;
          +
          +        public JavaSource() {
          +            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
          +            source = template.replaceAll("#E", ek.exprStr)
          +                    .replaceAll("#C", tk.targetStr);
          +        }
          +
          +        @Override
          +        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
          +            return source;
          +        }
          +    }
          +
          +    public void run() {
          +        JavacTask ct = (JavacTask)comp.getTask(null, fm.get(), diagChecker,
          +                Arrays.asList("-XDdumpLambdaToMethodStats"),
          +                null, Arrays.asList(source));
          +        try {
          +            ct.generate();
          +        } catch (Throwable ex) {
          +            throw new
          +                AssertionError("Error thron when analyzing the following source:\n" +
          +                    source.getCharContent(true));
          +        }
          +        check();
          +    }
          +
          +    void check() {
          +        checkCount.incrementAndGet();
          +
          +        boolean error = diagChecker.lambda !=
          +                (ek == ExprKind.LAMBDA);
          +
          +        error |= diagChecker.bridge !=
          +                (ek == ExprKind.MREF2);
          +
          +        error |= diagChecker.altMetafactory !=
          +                (tk == TargetKind.SERIALIZABLE);
          +
          +        if (error) {
          +            throw new AssertionError("Bad stat diagnostic found for source\n" +
          +                    "lambda = " + diagChecker.lambda + "\n" +
          +                    "bridge = " + diagChecker.bridge + "\n" +
          +                    "altMF = " + diagChecker.altMetafactory + "\n" +
          +                    source.source);
          +        }
          +    }
          +
          +    static class DiagnosticChecker
          +        implements javax.tools.DiagnosticListener {
          +
          +        boolean altMetafactory;
          +        boolean bridge;
          +        boolean lambda;
          +
          +        public void report(Diagnostic diagnostic) {
          +            try {
          +                if (diagnostic.getKind() == Diagnostic.Kind.NOTE) {
          +                    switch (diagnostic.getCode()) {
          +                        case "compiler.note.lambda.stat":
          +                            lambda = true;
          +                            break;
          +                        case "compiler.note.mref.stat":
          +                            lambda = false;
          +                            bridge = false;
          +                            break;
          +                        case "compiler.note.mref.stat.1":
          +                            lambda = false;
          +                            bridge = true;
          +                            break;
          +                        default:
          +                            throw new AssertionError("unexpected note: " + diagnostic.getCode());
          +                    }
          +                    ClientCodeWrapper.DiagnosticSourceUnwrapper dsu =
          +                        (ClientCodeWrapper.DiagnosticSourceUnwrapper)diagnostic;
          +                    altMetafactory = (Boolean)dsu.d.getArgs()[0];
          +                }
          +            } catch (RuntimeException t) {
          +                t.printStackTrace();
          +                throw t;
          +            }
          +        }
          +    }
          +}
          diff --git a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.java b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.java
          index 7bbefb64607..2dd6b31800e 100644
          --- a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.java
          +++ b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.java
          @@ -13,7 +13,7 @@ interface Bar1 { Integer getAge(String s);}
           interface Foo1Bar1 extends Foo1, Bar1 {} //types Bar1 and Foo1 are incompatible; both define getAge(String), but with unrelated return types
           
           interface AC extends A, C {} //name clash: getOldest(List) in C and getOldest(List) in A have the same erasure, yet neither overrides the other
          -interface ABC extends A, B, C {} //name clash: getOldest(List) in C and getOldest(List) in A have the same erasure, yet neither overrides the other
          +interface ABC extends A, B, C {} //ok - raw override
           interface AD extends A, D {} //name clash: getOldest(List) in D and getOldest(List) in A have the same erasure, yet neither overrides the other
           
           interface Foo2 { void m(T arg);}
          diff --git a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.out b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.out
          index 00da6787e4e..b44b64cbeb9 100644
          --- a/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.out
          +++ b/langtools/test/tools/javac/lambda/funcInterfaces/NonSAM2.out
          @@ -1,6 +1,5 @@
           NonSAM2.java:13:1: compiler.err.types.incompatible.diff.ret: Bar1, Foo1, getAge(java.lang.String)
           NonSAM2.java:15:1: compiler.err.name.clash.same.erasure.no.override: getOldest(java.util.List), C, getOldest(java.util.List), A
          -NonSAM2.java:16:1: compiler.err.name.clash.same.erasure.no.override: getOldest(java.util.List), C, getOldest(java.util.List), A
           NonSAM2.java:17:1: compiler.err.name.clash.same.erasure.no.override: getOldest(java.util.List), D, getOldest(java.util.List), A
           NonSAM2.java:21:1: compiler.err.name.clash.same.erasure.no.override: m(S), Bar2, m(T), Foo2
          -5 errors
          +4 errors
          diff --git a/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java b/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java
          index 8ab215afbdb..2dbe880a50b 100644
          --- a/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java
          +++ b/langtools/test/tools/javac/lambda/typeInference/InferenceTest2b.java
          @@ -64,7 +64,7 @@ public class InferenceTest2b {
           
               void m2(SAM6 s) {
                   System.out.println("m2()");
          -        assertTrue(s.m6(1, 2) == 1);
          +        assertTrue(s.m6(1, 2).equals(Integer.valueOf(1)));
               }
           
               void m3(SAM6 s) {
          diff --git a/langtools/test/tools/javac/limits/NestedClassConstructorArgs.java b/langtools/test/tools/javac/limits/NestedClassConstructorArgs.java
          new file mode 100644
          index 00000000000..9b56b6f0e01
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/NestedClassConstructorArgs.java
          @@ -0,0 +1,45 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8014230
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main NestedClassConstructorArgs
          + */
          +
          +public class NestedClassConstructorArgs extends NumArgsTest {
          +    private static final NumArgsTest.NestingDef[] nesting = {
          +        classNesting("Inner")
          +    };
          +
          +    private NestedClassConstructorArgs() {
          +        super(253, "NestedClassConstructorArgs", "Inner", nesting);
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new NestedClassConstructorArgs().runTest();
          +    }
          +}
          +
          diff --git a/langtools/test/tools/javac/limits/NestedClassMethodArgs.java b/langtools/test/tools/javac/limits/NestedClassMethodArgs.java
          new file mode 100644
          index 00000000000..762ef186d8f
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/NestedClassMethodArgs.java
          @@ -0,0 +1,45 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8014230
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main NestedClassMethodArgs
          + */
          +
          +public class NestedClassMethodArgs extends NumArgsTest {
          +    private static final NumArgsTest.NestingDef[] nesting = {
          +        classNesting("Inner")
          +    };
          +
          +    private NestedClassMethodArgs() {
          +        super(254, "void", "test", "NestedClassMethodArgs", nesting);
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new NestedClassMethodArgs().runTest();
          +    }
          +}
          +
          diff --git a/langtools/test/tools/javac/limits/NumArgs1.java b/langtools/test/tools/javac/limits/NumArgs1.java
          deleted file mode 100644
          index fe009046bcb..00000000000
          --- a/langtools/test/tools/javac/limits/NumArgs1.java
          +++ /dev/null
          @@ -1,552 +0,0 @@
          -/*
          - * Copyright (c) 2002, 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 4309152
          - * @summary Compiler silently generates bytecode that exceeds VM limits
          - * @author gafter
          - *
          - * @compile/fail NumArgs1.java
          - */
          -
          -class NumArgs1 {
          -    void f(
          -           // T1 this,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255,
          -           int x256
          -    ) {}
          -
          -    static
          -    void g(
          -           int x1,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255,
          -           int x256
          -    ) {}
          -}
          diff --git a/langtools/test/tools/javac/limits/NumArgs2.java b/langtools/test/tools/javac/limits/NumArgs2.java
          deleted file mode 100644
          index 7692a9bf4c1..00000000000
          --- a/langtools/test/tools/javac/limits/NumArgs2.java
          +++ /dev/null
          @@ -1,550 +0,0 @@
          -/*
          - * Copyright (c) 2002, 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 4309152
          - * @summary Compiler silently generates bytecode that exceeds VM limits
          - * @author gafter
          - *
          - * @compile NumArgs2.java
          - */
          -
          -class NumArgs2 {
          -    void f(
          -           // This this,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255
          -    ) {}
          -
          -    static
          -    void g(
          -           int x1,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255
          -    ) {}
          -}
          diff --git a/langtools/test/tools/javac/limits/NumArgs3.java b/langtools/test/tools/javac/limits/NumArgs3.java
          deleted file mode 100644
          index c200b1a0f9e..00000000000
          --- a/langtools/test/tools/javac/limits/NumArgs3.java
          +++ /dev/null
          @@ -1,292 +0,0 @@
          -/*
          - * Copyright (c) 2002, 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 4309152
          - * @summary Compiler silently generates bytecode that exceeds VM limits
          - * @author gafter
          - *
          - * @compile/fail NumArgs3.java
          - */
          -
          -class NumArgs3 {
          -    void NumArgs3(
          -           // T1 this,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255,
          -           int x256
          -    ) {}
          -}
          diff --git a/langtools/test/tools/javac/limits/NumArgs4.java b/langtools/test/tools/javac/limits/NumArgs4.java
          deleted file mode 100644
          index 73234dd79eb..00000000000
          --- a/langtools/test/tools/javac/limits/NumArgs4.java
          +++ /dev/null
          @@ -1,291 +0,0 @@
          -/*
          - * Copyright (c) 2002, 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 4309152
          - * @summary Compiler silently generates bytecode that exceeds VM limits
          - * @author gafter
          - *
          - * @compile NumArgs4.java
          - */
          -
          -class NumArgs4 {
          -    void NumArgs4(
          -           // T1 this,
          -           int x2,
          -           int x3,
          -           int x4,
          -           int x5,
          -           int x6,
          -           int x7,
          -           int x8,
          -           int x9,
          -           int x10,
          -           int x11,
          -           int x12,
          -           int x13,
          -           int x14,
          -           int x15,
          -           int x16,
          -           int x17,
          -           int x18,
          -           int x19,
          -           int x20,
          -           int x21,
          -           int x22,
          -           int x23,
          -           int x24,
          -           int x25,
          -           int x26,
          -           int x27,
          -           int x28,
          -           int x29,
          -           int x30,
          -           int x31,
          -           int x32,
          -           int x33,
          -           int x34,
          -           int x35,
          -           int x36,
          -           int x37,
          -           int x38,
          -           int x39,
          -           int x40,
          -           int x41,
          -           int x42,
          -           int x43,
          -           int x44,
          -           int x45,
          -           int x46,
          -           int x47,
          -           int x48,
          -           int x49,
          -           int x50,
          -           int x51,
          -           int x52,
          -           int x53,
          -           int x54,
          -           int x55,
          -           int x56,
          -           int x57,
          -           int x58,
          -           int x59,
          -           int x60,
          -           int x61,
          -           int x62,
          -           int x63,
          -           int x64,
          -           int x65,
          -           int x66,
          -           int x67,
          -           int x68,
          -           int x69,
          -           int x70,
          -           int x71,
          -           int x72,
          -           int x73,
          -           int x74,
          -           int x75,
          -           int x76,
          -           int x77,
          -           int x78,
          -           int x79,
          -           int x80,
          -           int x81,
          -           int x82,
          -           int x83,
          -           int x84,
          -           int x85,
          -           int x86,
          -           int x87,
          -           int x88,
          -           int x89,
          -           int x90,
          -           int x91,
          -           int x92,
          -           int x93,
          -           int x94,
          -           int x95,
          -           int x96,
          -           int x97,
          -           int x98,
          -           int x99,
          -           int x100,
          -           int x101,
          -           int x102,
          -           int x103,
          -           int x104,
          -           int x105,
          -           int x106,
          -           int x107,
          -           int x108,
          -           int x109,
          -           int x110,
          -           int x111,
          -           int x112,
          -           int x113,
          -           int x114,
          -           int x115,
          -           int x116,
          -           int x117,
          -           int x118,
          -           int x119,
          -           int x120,
          -           int x121,
          -           int x122,
          -           int x123,
          -           int x124,
          -           int x125,
          -           int x126,
          -           int x127,
          -           int x128,
          -           int x129,
          -           int x130,
          -           int x131,
          -           int x132,
          -           int x133,
          -           int x134,
          -           int x135,
          -           int x136,
          -           int x137,
          -           int x138,
          -           int x139,
          -           int x140,
          -           int x141,
          -           int x142,
          -           int x143,
          -           int x144,
          -           int x145,
          -           int x146,
          -           int x147,
          -           int x148,
          -           int x149,
          -           int x150,
          -           int x151,
          -           int x152,
          -           int x153,
          -           int x154,
          -           int x155,
          -           int x156,
          -           int x157,
          -           int x158,
          -           int x159,
          -           int x160,
          -           int x161,
          -           int x162,
          -           int x163,
          -           int x164,
          -           int x165,
          -           int x166,
          -           int x167,
          -           int x168,
          -           int x169,
          -           int x170,
          -           int x171,
          -           int x172,
          -           int x173,
          -           int x174,
          -           int x175,
          -           int x176,
          -           int x177,
          -           int x178,
          -           int x179,
          -           int x180,
          -           int x181,
          -           int x182,
          -           int x183,
          -           int x184,
          -           int x185,
          -           int x186,
          -           int x187,
          -           int x188,
          -           int x189,
          -           int x190,
          -           int x191,
          -           int x192,
          -           int x193,
          -           int x194,
          -           int x195,
          -           int x196,
          -           int x197,
          -           int x198,
          -           int x199,
          -           int x200,
          -           int x201,
          -           int x202,
          -           int x203,
          -           int x204,
          -           int x205,
          -           int x206,
          -           int x207,
          -           int x208,
          -           int x209,
          -           int x210,
          -           int x211,
          -           int x212,
          -           int x213,
          -           int x214,
          -           int x215,
          -           int x216,
          -           int x217,
          -           int x218,
          -           int x219,
          -           int x220,
          -           int x221,
          -           int x222,
          -           int x223,
          -           int x224,
          -           int x225,
          -           int x226,
          -           int x227,
          -           int x228,
          -           int x229,
          -           int x230,
          -           int x231,
          -           int x232,
          -           int x233,
          -           int x234,
          -           int x235,
          -           int x236,
          -           int x237,
          -           int x238,
          -           int x239,
          -           int x240,
          -           int x241,
          -           int x242,
          -           int x243,
          -           int x244,
          -           int x245,
          -           int x246,
          -           int x247,
          -           int x248,
          -           int x249,
          -           int x250,
          -           int x251,
          -           int x252,
          -           int x253,
          -           int x254,
          -           int x255
          -    ) {}
          -}
          diff --git a/langtools/test/tools/javac/limits/NumArgsTest.java b/langtools/test/tools/javac/limits/NumArgsTest.java
          new file mode 100644
          index 00000000000..751df98d999
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/NumArgsTest.java
          @@ -0,0 +1,269 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 com.sun.tools.javac.util.*;
          +import com.sun.tools.javac.api.*;
          +import com.sun.tools.javac.file.*;
          +import java.io.*;
          +import java.util.*;
          +import javax.tools.*;
          +
          +// More general parameter limit testing framework, and designed so
          +// that it could be expanded into a general limits-testing framework
          +// in the future.
          +public class NumArgsTest {
          +
          +    private static final NumArgsTest.NestingDef[] NO_NESTING = {};
          +
          +    // threshold is named as such because "threshold" args is expected
          +    // to pass, and "threshold" + 1 args is expected to fail.
          +    private final int threshold;
          +    private final boolean isStaticMethod;
          +    private final String result;
          +    private final String testName;
          +    private final String methodName;
          +    private final NestingDef[] nesting;
          +    private final File testdir;
          +    private final JavacTool tool = JavacTool.create();
          +    private final JavacFileManager fm =
          +        tool.getStandardFileManager(null, null, null);
          +    private int errors = 0;
          +
          +    public NumArgsTest(final int threshold,
          +                       final boolean isStaticMethod,
          +                       final String result,
          +                       final String methodName,
          +                       final String testName,
          +                       final NestingDef[] nesting) {
          +        this.threshold = threshold;
          +        this.isStaticMethod = isStaticMethod;
          +        this.result = result;
          +        this.methodName = methodName;
          +        this.testName = testName;
          +        this.nesting = nesting;
          +        testdir = new File(testName);
          +        testdir.mkdir();
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final boolean isStaticMethod,
          +                       final String result,
          +                       final String methodName,
          +                       final String testName) {
          +        this(threshold, isStaticMethod, result, methodName,
          +             testName, NO_NESTING);
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final String result,
          +                       final String methodName,
          +                       final String testName,
          +                       final NestingDef[] nesting) {
          +        this(threshold, false, result, methodName, testName, nesting);
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final String result,
          +                       final String methodName,
          +                       final String testName) {
          +        this(threshold, false, result, methodName, testName, NO_NESTING);
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final String testName,
          +                       final NestingDef[] nesting) {
          +        this(threshold, null, null, testName, nesting);
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final String testName) {
          +        this(threshold, null, null, testName, NO_NESTING);
          +    }
          +
          +    public NumArgsTest(final int threshold,
          +                       final String testName,
          +                       final String constructorName,
          +                       final NestingDef[] nesting) {
          +        this(threshold, null, constructorName, testName, nesting);
          +    }
          +
          +    protected void writeArgs(final int num, final PrintWriter stream)
          +        throws IOException {
          +        stream.print("int x1");
          +        for(int i = 1; i < num; i++)
          +            stream.print(", int x" + (i + 1));
          +    }
          +
          +    protected void writeMethod(final int num,
          +                               final String name,
          +                               final PrintWriter stream)
          +        throws IOException {
          +        stream.write("public ");
          +        if (isStaticMethod) stream.write("static ");
          +        if (result == null)
          +            stream.write("");
          +        else {
          +            stream.write(result);
          +            stream.write(" ");
          +        }
          +        stream.write(name);
          +        stream.write("(");
          +        writeArgs(num, stream);
          +        stream.write(") {}\n");
          +    }
          +
          +    protected void writeJavaFile(final int num,
          +                                 final boolean pass,
          +                                 final PrintWriter stream)
          +        throws IOException {
          +        final String fullName = testName + (pass ? "Pass" : "Fail");
          +        stream.write("public class ");
          +        stream.write(fullName);
          +        stream.write(" {\n");
          +        for(int i = 0; i < nesting.length; i++)
          +            nesting[i].writeBefore(stream);
          +        if (null == methodName)
          +            writeMethod(num, fullName, stream);
          +        else
          +            writeMethod(num, methodName, stream);
          +        for(int i = nesting.length - 1; i >= 0; i--)
          +            nesting[i].writeAfter(stream);
          +        stream.write("}\n");
          +    }
          +
          +    public void runTest() throws Exception {
          +        // Run the pass test
          +        final String passTestName = testName + "Pass.java";
          +        final StringWriter passBody = new StringWriter();
          +        final PrintWriter passStream = new PrintWriter(passBody);
          +        final File passFile = new File(testdir, passTestName);
          +        final FileWriter passWriter = new FileWriter(passFile);
          +
          +        writeJavaFile(threshold, true, passStream);
          +        passStream.close();
          +        passWriter.write(passBody.toString());
          +        passWriter.close();
          +
          +        final StringWriter passSW = new StringWriter();
          +        final String[] passArgs = { passFile.toString() };
          +        final Iterable passFiles =
          +            fm.getJavaFileObjectsFromFiles(Arrays.asList(passFile));
          +        final JavaCompiler.CompilationTask passTask =
          +            tool.getTask(passSW, fm, null, null, null, passFiles);
          +
          +        if (!passTask.call()) {
          +            errors++;
          +            System.err.println("Compilation unexpectedly failed. Body:\n" +
          +                               passBody);
          +            System.err.println("Output:\n" + passSW.toString());
          +        }
          +
          +        // Run the fail test
          +        final String failTestName = testName + "Fail.java";
          +        final StringWriter failBody = new StringWriter();
          +        final PrintWriter failStream = new PrintWriter(failBody);
          +        final File failFile = new File(testdir, failTestName);
          +        final FileWriter failWriter = new FileWriter(failFile);
          +
          +        writeJavaFile(threshold + 1, false, failStream);
          +        failStream.close();
          +        failWriter.write(failBody.toString());
          +        failWriter.close();
          +
          +        final StringWriter failSW = new StringWriter();
          +        final TestDiagnosticHandler failDiag =
          +            new TestDiagnosticHandler("compiler.err.limit.parameters");
          +        final Iterable failFiles =
          +            fm.getJavaFileObjectsFromFiles(Arrays.asList(failFile));
          +        final JavaCompiler.CompilationTask failTask =
          +            tool.getTask(failSW,
          +                         tool.getStandardFileManager(null, null, null),
          +                         failDiag,
          +                         null,
          +                         null,
          +                         failFiles);
          +
          +        if (failTask.call()) {
          +            errors++;
          +            System.err.println("Compilation unexpectedly succeeded.");
          +            System.err.println("Input:\n" + failBody);
          +        }
          +
          +        if (!failDiag.sawError) {
          +            errors++;
          +            System.err.println("Did not see expected compile error.");
          +        }
          +
          +        if (errors != 0)
          +            throw new RuntimeException("Test failed with " +
          +                                       errors + " errors");
          +    }
          +
          +    public static NestingDef classNesting(final String name) {
          +        return new NestedClassBuilder(name, false);
          +    }
          +
          +    public static NestingDef classNesting(final String name,
          +                                          final boolean isStatic) {
          +        return new NestedClassBuilder(name, isStatic);
          +    }
          +
          +    protected interface NestingDef {
          +        public abstract void writeBefore(final PrintWriter stream);
          +        public abstract void writeAfter(final PrintWriter stream);
          +    }
          +
          +    private static class NestedClassBuilder implements NestingDef {
          +        private final String name;
          +        private final boolean isStatic;
          +        public NestedClassBuilder(final String name, final boolean isStatic) {
          +            this.name = name;
          +            this.isStatic = isStatic;
          +        }
          +        public void writeBefore(final PrintWriter stream) {
          +            stream.write("public ");
          +            if (isStatic) stream.write("static");
          +            stream.write(" class ");
          +            stream.write(name);
          +            stream.write(" {\n");
          +        }
          +        public void writeAfter(final PrintWriter stream) {
          +            stream.write("}\n");
          +        }
          +    }
          +
          +    public class TestDiagnosticHandler implements DiagnosticListener {
          +        public boolean sawError;
          +        public final String target;
          +
          +        public TestDiagnosticHandler(final String target) {
          +            this.target = target;
          +        }
          +
          +        public void report(final Diagnostic diag) {
          +            if (diag.getCode().equals(target))
          +                sawError = true;
          +        }
          +    }
          +
          +}
          diff --git a/langtools/test/tools/javac/limits/StaticNestedClassConstructorArgs.java b/langtools/test/tools/javac/limits/StaticNestedClassConstructorArgs.java
          new file mode 100644
          index 00000000000..393a37b433e
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/StaticNestedClassConstructorArgs.java
          @@ -0,0 +1,45 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8014230
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main StaticNestedClassConstructorArgs
          + */
          +
          +public class StaticNestedClassConstructorArgs extends NumArgsTest {
          +    private static final NumArgsTest.NestingDef[] nesting = {
          +        classNesting("StaticInner", true)
          +    };
          +
          +    private StaticNestedClassConstructorArgs() {
          +        super(254, "StaticNestedClassConstructorArgs", "StaticInner", nesting);
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new StaticNestedClassConstructorArgs().runTest();
          +    }
          +}
          +
          diff --git a/langtools/test/tools/javac/limits/TopLevelClassConstructorArgs.java b/langtools/test/tools/javac/limits/TopLevelClassConstructorArgs.java
          new file mode 100644
          index 00000000000..ee567d6030e
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/TopLevelClassConstructorArgs.java
          @@ -0,0 +1,40 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 4309152
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main TopLevelClassConstructorArgs
          + */
          +
          +public class TopLevelClassConstructorArgs extends NumArgsTest {
          +    private TopLevelClassConstructorArgs() {
          +        super(254, "TopLevelClassConstructorArgs");
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new TopLevelClassConstructorArgs().runTest();
          +    }
          +}
          diff --git a/langtools/test/tools/javac/limits/TopLevelClassMethodArgs.java b/langtools/test/tools/javac/limits/TopLevelClassMethodArgs.java
          new file mode 100644
          index 00000000000..7ae66c9108f
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/TopLevelClassMethodArgs.java
          @@ -0,0 +1,40 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 4309152
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main TopLevelClassMethodArgs
          + */
          +
          +public class TopLevelClassMethodArgs extends NumArgsTest {
          +    private TopLevelClassMethodArgs() {
          +        super(254, "void", "test", "TopLevelClassMethodArgs");
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new TopLevelClassMethodArgs().runTest();
          +    }
          +}
          diff --git a/langtools/test/tools/javac/limits/TopLevelClassStaticMethodArgs.java b/langtools/test/tools/javac/limits/TopLevelClassStaticMethodArgs.java
          new file mode 100644
          index 00000000000..f905157dc54
          --- /dev/null
          +++ b/langtools/test/tools/javac/limits/TopLevelClassStaticMethodArgs.java
          @@ -0,0 +1,40 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 4309152
          + * @summary Compiler silently generates bytecode that exceeds VM limits
          + * @compile NumArgsTest.java
          + * @run main TopLevelClassStaticMethodArgs
          + */
          +
          +public class TopLevelClassStaticMethodArgs extends NumArgsTest {
          +    private TopLevelClassStaticMethodArgs() {
          +        super(255, true, "void", "test", "TopLevelClassStaticMethodArgs");
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new TopLevelClassStaticMethodArgs().runTest();
          +    }
          +}
          diff --git a/langtools/test/tools/javac/literals/UnderscoreLiterals.java b/langtools/test/tools/javac/literals/UnderscoreLiterals.java
          index 410450cad0e..0e669acedee 100644
          --- a/langtools/test/tools/javac/literals/UnderscoreLiterals.java
          +++ b/langtools/test/tools/javac/literals/UnderscoreLiterals.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -42,6 +42,12 @@ public class UnderscoreLiterals {
                   test(1_0_0, 100);
                   test(1__0__0, 100);
                   test(123_456_789, 123456789);
          +        test(2_147_483_647, Integer.MAX_VALUE);
          +        test(-2_147_483_648, Integer.MIN_VALUE);
          +        test(32_767, Short.MAX_VALUE);
          +        test(-32_768, Short.MIN_VALUE);
          +        test(1_2_7, Byte.MAX_VALUE);
          +        test(-1_2_8, Byte.MIN_VALUE);
           
                   // long
                   test(1l, 1l);
          @@ -51,6 +57,8 @@ public class UnderscoreLiterals {
                   test(1_0_0l, 100l);
                   test(1__0__0l, 100l);
                   test(123_456_789l, 123456789l);
          +        test(9_223_372_036_854_775_807l, Long.MAX_VALUE);
          +        test(-9_223_372_036_854_775_808l, Long.MIN_VALUE);
           
                   // float
                   test(.1f, .1f);
          @@ -80,6 +88,8 @@ public class UnderscoreLiterals {
                   test(1_1.1_0_0f, 1_1.100f);
                   test(1_1.1__0__0f, 1_1.100f);
                   test(1_1.123_456_789f, 1_1.123456789f);
          +        test(3.4_028_235E38f, Float.MAX_VALUE);
          +        test(1.4E-4_5f, Float.MIN_VALUE);
           
                   // double
                   test(.1d, .1d);
          @@ -109,6 +119,8 @@ public class UnderscoreLiterals {
                   test(1_1.1_0_0d, 1_1.100d);
                   test(1_1.1__0__0d, 1_1.100d);
                   test(1_1.123_456_789d, 1_1.123456789d);
          +        test(1.797_6_9_3_1_348_623_157E3_08, Double.MAX_VALUE);
          +        test(4.9E-3_24, Double.MIN_VALUE);
           
                   // binary
                   test(0b1, 1);
          @@ -118,6 +130,14 @@ public class UnderscoreLiterals {
                   test(0b1_0_0, 4);
                   test(0b1__0__0, 4);
                   test(0b0001_0010_0011, 0x123);
          +        test(0b111_1111_1111_1111_1111_1111_1111_1111, Integer.MAX_VALUE);
          +        test(0b1000_0000_0000_0000_0000_0000_0000_0000, Integer.MIN_VALUE);
          +        test(0b111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111l, Long.MAX_VALUE);
          +        test(0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000l, Long.MIN_VALUE);
          +        test(0b111_1111_1111_1111, Short.MAX_VALUE);
          +        test((short)-0b1000_0000_0000_0000, Short.MIN_VALUE);
          +        test(0b111_1111, Byte.MAX_VALUE);
          +        test((byte)-0b1000_0000, Byte.MIN_VALUE);
           
                   // octal
                   test(01, 1);
          @@ -133,6 +153,14 @@ public class UnderscoreLiterals {
                   test(0_1_0_0, 64);
                   test(0_1__0__0, 64);
                   test(0_001_002_003, 01002003);
          +        test(0177_7777_7777, Integer.MAX_VALUE);
          +        test(-0200_0000_0000, Integer.MIN_VALUE);
          +        test(077_77_77_77_77_7_77_77_77_77_77l, Long.MAX_VALUE);
          +        test(-010_00_00_00_00_00_00_00_00_00_00l, Long.MIN_VALUE);
          +        test((short)07_77_77, Short.MAX_VALUE);
          +        test((short)-010_00_00, Short.MIN_VALUE);
          +        test(01_77, Byte.MAX_VALUE);
          +        test((byte)-02_00, Byte.MIN_VALUE);
           
                   // hexadecimal
                   test(0x1, 1);
          @@ -142,6 +170,18 @@ public class UnderscoreLiterals {
                   test(0x1_0_0, 256);
                   test(0x1__0__0, 256);
                   test(0x01_02_03_04, 0x1020304);
          +        test(0x7f_ff_ff_ff, Integer.MAX_VALUE);
          +        test(0x80_00_00_00, Integer.MIN_VALUE);
          +        test(0x1.f_ff_ffep127f, Float.MAX_VALUE);
          +        test(0x0.00_00_02p-126f, Float.MIN_VALUE);
          +        test(0x1.f__ff_ff_ff_ff_ff_ffp1_023, Double.MAX_VALUE);
          +        test(0x0.000_000_000_000_1p-1_022, Double.MIN_VALUE);
          +        test(0x7f_ff_ff_ff_ff_ff_ff_ffl, Long.MAX_VALUE);
          +        test(0x80_00_00_00_00_00_00_00l, Long.MIN_VALUE);
          +        test(0x7f_ff, Short.MAX_VALUE);
          +        test((short)0x80_00, Short.MIN_VALUE);
          +        test(0x7_f, Byte.MAX_VALUE);
          +        test((byte)0x8_0, Byte.MIN_VALUE);
           
                   // misc
                   long creditCardNumber = 1234_5678_9012_3456L;
          diff --git a/langtools/test/tools/javac/parser/SingleCommaAnnotationValue.java b/langtools/test/tools/javac/parser/SingleCommaAnnotationValue.java
          new file mode 100644
          index 00000000000..53a3a55b486
          --- /dev/null
          +++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValue.java
          @@ -0,0 +1,39 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8012722
          + * @summary Single comma in array initializer should parse
          + * @compile SingleCommaAnnotationValue.java
          + */
          +
          +public class SingleCommaAnnotationValue {
          +    @Foo({}) void a() { }
          +    @Foo({,}) void b() { }
          +    @Foo({0}) void c() { }
          +    @Foo({0,}) void d() { }
          +    @Foo({0,0}) void e() { }
          +    @Foo({0,0,}) void f() { }
          +}
          +@interface Foo { int[] value(); }
          diff --git a/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.java b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.java
          new file mode 100644
          index 00000000000..4467d98ba71
          --- /dev/null
          +++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.java
          @@ -0,0 +1,36 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8012722
          + * @summary Single comma in array initializer should parse
          + * @compile/fail/ref=SingleCommaAnnotationValueFail.out -XDrawDiagnostics
          + * SingleCommaAnnotationValueFail.java
          + */
          +
          +public class SingleCommaAnnotationValueFail {
          +    // Non-example
          +    @Foo({,0}) void a() { }
          +}
          +@interface Foo { int[] value(); }
          diff --git a/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out
          new file mode 100644
          index 00000000000..10a8f4dce7c
          --- /dev/null
          +++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out
          @@ -0,0 +1,6 @@
          +SingleCommaAnnotationValueFail.java:34:12: compiler.err.expected: '}'
          +SingleCommaAnnotationValueFail.java:34:13: compiler.err.illegal.start.of.type
          +SingleCommaAnnotationValueFail.java:34:14: compiler.err.expected: token.identifier
          +SingleCommaAnnotationValueFail.java:34:15: compiler.err.expected: ';'
          +SingleCommaAnnotationValueFail.java:34:21: compiler.err.invalid.meth.decl.ret.type.req
          +5 errors
          diff --git a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java
          index 71367233484..6ba6ff689e6 100644
          --- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java
          +++ b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java
          @@ -30,11 +30,13 @@
            * @build   JavacTestingAbstractProcessor
            * @compile TestElementsAnnotatedWith.java
            * @compile InheritedAnnotation.java
          + * @compile TpAnno.java
            * @compile -processor TestElementsAnnotatedWith -proc:only SurfaceAnnotations.java
            * @compile -processor TestElementsAnnotatedWith -proc:only BuriedAnnotations.java
            * @compile -processor TestElementsAnnotatedWith -proc:only Part1.java Part2.java
            * @compile -processor TestElementsAnnotatedWith -proc:only C2.java
            * @compile -processor TestElementsAnnotatedWith -proc:only Foo.java
          + * @compile -processor TestElementsAnnotatedWith -proc:only TypeParameterAnnotations.java
            * @compile Foo.java
            * @compile/process -processor TestElementsAnnotatedWith -proc:only Foo
            */
          diff --git a/langtools/test/tools/javac/processing/environment/round/TpAnno.java b/langtools/test/tools/javac/processing/environment/round/TpAnno.java
          new file mode 100644
          index 00000000000..c8cf52c30c9
          --- /dev/null
          +++ b/langtools/test/tools/javac/processing/environment/round/TpAnno.java
          @@ -0,0 +1,29 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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.lang.annotation.*;
          +import static java.lang.annotation.RetentionPolicy.*;
          +
          +@Retention(RUNTIME)
          +@Target(ElementType.TYPE_PARAMETER)
          +public @interface TpAnno {}
          diff --git a/langtools/test/tools/javac/processing/environment/round/TypeParameterAnnotations.java b/langtools/test/tools/javac/processing/environment/round/TypeParameterAnnotations.java
          new file mode 100644
          index 00000000000..0b3ef05ceef
          --- /dev/null
          +++ b/langtools/test/tools/javac/processing/environment/round/TypeParameterAnnotations.java
          @@ -0,0 +1,37 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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.
          + */
          +
          +/**
          + * Class to hold annotations for ElementsAnnotatedWithTest.
          + */
          +
          +@AnnotatedElementInfo(annotationName="TpAnno",
          +                      expectedSize=4,
          +                      names={"T", "A", "B", "C"})
          +public class TypeParameterAnnotations<@TpAnno T>  {
          +    private <@TpAnno A> TypeParameterAnnotations(A a) {;}
          +
          +    public <@TpAnno B> void foo(B b) {return;}
          +
          +    public static <@TpAnno C> void bar(C b) {return;}
          +}
          diff --git a/langtools/test/tools/javac/resolve/ResolveHarness.java b/langtools/test/tools/javac/resolve/ResolveHarness.java
          index 8db063cdf09..5f761c3b351 100644
          --- a/langtools/test/tools/javac/resolve/ResolveHarness.java
          +++ b/langtools/test/tools/javac/resolve/ResolveHarness.java
          @@ -32,6 +32,8 @@
           
           import com.sun.source.util.JavacTask;
           import com.sun.tools.javac.api.ClientCodeWrapper.DiagnosticSourceUnwrapper;
          +import com.sun.tools.javac.code.Flags;
          +import com.sun.tools.javac.code.Symbol;
           import com.sun.tools.javac.code.Type.MethodType;
           import com.sun.tools.javac.util.JCDiagnostic;
           
          @@ -154,7 +156,7 @@ public class ResolveHarness implements javax.tools.DiagnosticListener entry : candidatesMap.entrySet()) {
                       if (!seenCandidates.contains(entry.getKey())) {
          -                error("Redundant @Candidate annotation on method " + entry.getKey().elem);
          +                error("Redundant @Candidate annotation on method " + entry.getKey().elem + " sig = " + entry.getKey().elem.asType());
                       }
                   }
               }
          @@ -250,7 +252,7 @@ public class ResolveHarness implements javax.tools.DiagnosticListener diagnostic) {
                       Element siteSym = getSiteSym(diagnostic);
                       if (siteSym.getSimpleName().length() != 0 &&
          -                    siteSym.getAnnotation(TraceResolve.class) == null) {
          +                    ((Symbol)siteSym).outermostClass().getAnnotation(TraceResolve.class) == null) {
                           return;
                       }
                       int candidateIdx = 0;
          @@ -308,7 +310,11 @@ public class ResolveHarness implements javax.tools.DiagnosticListener diagnostic) {
          -            Element methodSym = methodSym(diagnostic);
          +            Symbol methodSym = (Symbol)methodSym(diagnostic);
          +            if ((methodSym.flags() & Flags.GENERATEDCONSTR) != 0) {
          +                //skip resolution of default constructor (put there by javac)
          +                return;
          +            }
                       Candidate c = getCandidateAtPos(methodSym,
                               asJCDiagnostic(diagnostic).getLineNumber(),
                               asJCDiagnostic(diagnostic).getColumnNumber());
          @@ -470,23 +476,10 @@ public class ResolveHarness implements javax.tools.DiagnosticListener.");
          -                String replacedName = predefTranslationMap.get(e.getSimpleName().toString());
          -                buf.append(e.toString().replace(e.getSimpleName().toString(), replacedName));
          -            } else if (e.getSimpleName().toString().startsWith("_")) {
          -                buf.append(".");
          -                buf.append(e.toString());
          -            } else {
          -                while (e != null) {
          -                    buf.append(e.toString());
          -                    e = e.getEnclosingElement();
          -                }
          -                buf.append(jfo.getName());
          -            }
          -            return buf.toString();
          +            String simpleName = e.getSimpleName().toString();
          +            String opName = predefTranslationMap.get(simpleName);
          +            String name = opName != null ? opName : simpleName;
          +            return name + e.asType();
                   }
           
                   @Override
          diff --git a/langtools/test/tools/javac/resolve/tests/AbstractMerge.java b/langtools/test/tools/javac/resolve/tests/AbstractMerge.java
          new file mode 100644
          index 00000000000..e6feb08949b
          --- /dev/null
          +++ b/langtools/test/tools/javac/resolve/tests/AbstractMerge.java
          @@ -0,0 +1,107 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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.
          + */
          +@TraceResolve
          +class AbstractMerge {
          +
          +    interface A {
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m1();
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m2();
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m3();
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m4();
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m5();
          +        @Candidate(applicable=Phase.BASIC)
          +        java.io.Serializable m6();
          +    }
          +
          +    interface B {
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m1();
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m2();
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m3();
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m4();
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m5();
          +        @Candidate(applicable=Phase.BASIC)
          +        Cloneable m6();
          +    }
          +
          +    interface C {
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m1();
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m2();
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m3();
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m4();
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m5();
          +        @Candidate(applicable=Phase.BASIC, mostSpecific=true)
          +        Object[] m6();
          +    }
          +
          +    interface ABC extends A, B, C { }
          +    interface ACB extends A, C, B { }
          +    interface BAC extends B, A, C { }
          +    interface BCA extends B, C, A { }
          +    interface CAB extends C, A, B { }
          +    interface CBA extends C, B, A { }
          +
          +    {
          +        ABC abc = null;
          +        abc.m1();
          +    }
          +
          +    {
          +        ACB acb = null;
          +        acb.m2();
          +    }
          +
          +    {
          +        BAC bac = null;
          +        bac.m3();
          +    }
          +
          +    {
          +        BCA bca = null;
          +        bca.m4();
          +    }
          +
          +    {
          +        CAB cab = null;
          +        cab.m5();
          +    }
          +
          +    {
          +        CBA cba = null;
          +        cba.m6();
          +    }
          +}
          diff --git a/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java b/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java
          index 2574c61ab55..9bf72a3fa53 100644
          --- a/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java
          +++ b/langtools/test/tools/javac/resolve/tests/InnerOverOuter.java
          @@ -21,7 +21,7 @@
            * questions.
            */
           
          -@TraceResolve
          +@TraceResolve(keys={"compiler.err.cant.apply.symbol"})
           class Test {
           
               //no annotation here - this should NOT even be considered!
          @@ -30,7 +30,6 @@ class Test {
               //no annotation here - this should NOT even be considered!
               void m(Object... o) { }
           
          -    @TraceResolve(keys={"compiler.err.cant.apply.symbol"})
               class Inner {
                   @Candidate
                   void m(String s) {
          diff --git a/langtools/test/tools/javac/types/TestComparisons.java b/langtools/test/tools/javac/types/TestComparisons.java
          new file mode 100644
          index 00000000000..46f267b0401
          --- /dev/null
          +++ b/langtools/test/tools/javac/types/TestComparisons.java
          @@ -0,0 +1,362 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8013357
          + * @summary javac should correctly enforce binary comparison rules.
          + */
          +import com.sun.tools.javac.code.Type;
          +import com.sun.tools.javac.code.Type.*;
          +import com.sun.tools.javac.code.Symbol.*;
          +import java.io.*;
          +import java.lang.reflect.Array;
          +import java.util.EnumSet;
          +
          +public class TestComparisons {
          +
          +    private int errors = 0;
          +    private int testnum = 0;
          +
          +    static final File testdir = new File("8013357");
          +
          +    private enum CompareType {
          +        BYTE_PRIM("byte"),
          +        SHORT_PRIM("short"),
          +        CHAR_PRIM("char"),
          +        INTEGER_PRIM("int"),
          +        LONG_PRIM("long"),
          +        FLOAT_PRIM("float"),
          +        DOUBLE_PRIM("double"),
          +        BOOLEAN_PRIM("boolean"),
          +
          +        BYTE("Byte"),
          +        SHORT("Short"),
          +        CHAR("Character"),
          +        INTEGER("Integer"),
          +        LONG("Long"),
          +        FLOAT("Float"),
          +        DOUBLE("Double"),
          +        BOOLEAN("Boolean"),
          +
          +        BYTE_SUPER("List", true),
          +        SHORT_SUPER("List", true),
          +        CHAR_SUPER("List", true),
          +        INTEGER_SUPER("List", true),
          +        LONG_SUPER("List", true),
          +        FLOAT_SUPER("List", true),
          +        DOUBLE_SUPER("List", true),
          +        BOOLEAN_SUPER("List", true),
          +
          +        OBJECT("Object"),
          +        NUMBER("Number"),
          +        STRING("String");
          +
          +        public final boolean isList;
          +        public final String name;
          +
          +        private CompareType(final String name, final boolean isList) {
          +            this.isList = isList;
          +            this.name = name;
          +        }
          +
          +        private CompareType(final String name) {
          +            this(name, false);
          +        }
          +    }
          +
          +    // The integers here refer to which subsection of JLS 15.21 is in
          +    // effect.  0 means no comparison is allowed.
          +    private static final int truthtab[][] = {
          +        // byte, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // short, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // char, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // int, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // long, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // float, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // double, comparable to itself, any numeric type, or any boxed
          +        // numeric type.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          1, 1, 1, 1, 1, 1, 1, 0, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // boolean, comparable only to itself and Boolean.
          +        { 0, 0, 0, 0, 0, 0, 0, 2, // Primitives
          +          0, 0, 0, 0, 0, 0, 0, 2, // Boxed primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Captures
          +          0, 0, 0                 // Reference types
          +        },
          +        // Byte, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          3, 0, 0, 0, 0, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Short, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 3, 0, 0, 0, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Character, comparable to itself, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 0, 3, 0, 0, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 0, 0                 // Reference types
          +        },
          +        // Int, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 0, 0, 3, 0, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Long, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 0, 0, 0, 3, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Float, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 0, 0, 0, 0, 3, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Double, comparable to itself, Number, Object, any numeric primitive,
          +        // and any captures.
          +        { 1, 1, 1, 1, 1, 1, 1, 0, // Primitives
          +          0, 0, 0, 0, 0, 0, 3, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // Boolean, to itself, any capture, Object, and boolean.
          +        { 0, 0, 0, 0, 0, 0, 0, 2, // Primitives
          +          0, 0, 0, 0, 0, 0, 0, 2, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 0, 0                 // Reference types
          +        },
          +        // Byte supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Short supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Character supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Integer supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Long supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Float supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Double supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Boolean supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Object, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 3                 // Reference types
          +        },
          +        // Number, comparable to Object, any of its subclasses.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          3, 3, 0, 3, 3, 3, 3, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 3, 0                 // Reference types
          +        },
          +        // String supertype wildcard, comparable to any reference type.
          +        // and any captures.
          +        { 0, 0, 0, 0, 0, 0, 0, 0, // Primitives
          +          0, 0, 0, 0, 0, 0, 0, 0, // Boxed primitives
          +          3, 3, 3, 3, 3, 3, 3, 3, // Captures
          +          3, 0, 3                 // Reference types
          +        }
          +    };
          +
          +    private void assert_compile_fail(final File file, final String body) {
          +        final String filename = file.getPath();
          +        final String[] args = { filename };
          +        final StringWriter sw = new StringWriter();
          +        final PrintWriter pw = new PrintWriter(sw);
          +        final int rc = com.sun.tools.javac.Main.compile(args, pw);
          +        pw.close();
          +        if (rc == 0) {
          +            System.err.println("Compilation of " + file.getName() +
          +                               " didn't fail as expected.\nFile:\n" +
          +                               body + "\nOutput:\n" + sw.toString());
          +            errors++;
          +        }
          +    }
          +
          +    private void assert_compile_succeed(final File file, final String body) {
          +        final String filename = file.getPath();
          +        final String[] args = { filename };
          +        final StringWriter sw = new StringWriter();
          +        final PrintWriter pw = new PrintWriter(sw);
          +        final int rc = com.sun.tools.javac.Main.compile(args, pw);
          +        pw.close();
          +        if (rc != 0) {
          +            System.err.println("Compilation of " + file.getName() +
          +                               " didn't succeed as expected.\nFile:\n" +
          +                               body + "\nOutput:\n" +
          +                               sw.toString());
          +            errors++;
          +        }
          +    }
          +
          +    private String makeBody(final int num,
          +                            final CompareType left,
          +                            final CompareType right) {
          +        return "import java.util.List;\n" +
          +            "public class Test" + num + " {\n" +
          +            "    public boolean test(" + left.name +
          +            " left, " + right.name + " right) {\n" +
          +            "        return left" + (left.isList ? ".get(0)" : "") +
          +            " == right" + (right.isList ? ".get(0)" : "") + ";\n" +
          +            "    }\n" +
          +            "}\n";
          +    }
          +
          +    private File writeFile(final String filename,
          +                           final String body)
          +        throws IOException {
          +        final File f = new File(testdir, filename);
          +        f.getParentFile().mkdirs();
          +        final FileWriter out = new FileWriter(f);
          +        out.write(body);
          +        out.close();
          +        return f;
          +    }
          +
          +    private void test(final CompareType left, final CompareType right)
          +        throws IOException {
          +        final int num = testnum++;
          +        final String filename = "Test" + num + ".java";
          +        final String body = makeBody(num, left, right);
          +        final File file = writeFile(filename, body);
          +        if (truthtab[left.ordinal()][right.ordinal()] != 0)
          +            assert_compile_succeed(file, body);
          +        else
          +            assert_compile_fail(file, body);
          +    }
          +
          +    void run() throws Exception {
          +        testdir.mkdir();
          +
          +        for(CompareType left : CompareType.values())
          +            for(CompareType right : CompareType.values())
          +                test(left, right);
          +
          +        if (errors != 0)
          +            throw new Exception("ObjectZeroCompare test failed with " +
          +                                errors + " errors.");
          +    }
          +
          +    public static void main(String... args) throws Exception {
          +        new TestComparisons().run();
          +    }
          +}
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java
          index 07ed640a415..d5c3660fb72 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java
          @@ -23,6 +23,7 @@
           
           /**
            * @test
          + * @bug 7153951
            * @compile ClassUsingAnotherAuxiliary.java NotAClassName.java
            * @compile -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
            * @compile/fail/ref=ClassUsingAnotherAuxiliary.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out
          index 57123508721..5df6bdb1b0d 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out
          @@ -1,4 +1,4 @@
          -ClassUsingAnotherAuxiliary.java:32:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AnAuxiliaryClass, NotAClassName.java
          +ClassUsingAnotherAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AnAuxiliaryClass, NotAClassName.java
           - compiler.err.warnings.and.werror
           1 error
           1 warning
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java
          index 9d22ba780e7..605eb8017cb 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java
          @@ -23,6 +23,7 @@
           
           /**
            * @test
          + * @bug 7153951
            * @clean ClassUsingAuxiliary ClassWithAuxiliary AuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClassEither
            * @run compile ClassUsingAuxiliary.java ClassWithAuxiliary.java
            * @run compile/fail/ref=ClassUsingAuxiliary1.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAuxiliary.java ClassWithAuxiliary.java
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out
          index e0f30900377..d319c0b08e3 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out
          @@ -1,4 +1,4 @@
          -ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
          +ClassUsingAuxiliary.java:34:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
           - compiler.err.warnings.and.werror
           1 error
           1 warning
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out
          index e0f30900377..d319c0b08e3 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out
          @@ -1,4 +1,4 @@
          -ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
          +ClassUsingAuxiliary.java:34:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
           - compiler.err.warnings.and.werror
           1 error
           1 warning
          diff --git a/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java b/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java
          index fdc5a8fad71..398315dcb4b 100644
          --- a/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java
          +++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java
          @@ -29,16 +29,17 @@
           
           /*
            * @test
          + * @bug 7153951
            * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java ClassWithAuxiliary.java
            * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java
            */
           
           class SelfClassWithAux {
          -    Aux aux;
          +    AuxClass aux;
               ClassWithAuxiliary.NotAnAuxiliaryClass alfa;
               ClassWithAuxiliary.NotAnAuxiliaryClassEither beta;
           }
           
          -class Aux {
          -    Aux aux;
          +class AuxClass {
          +    AuxClass aux;
           }
          diff --git a/langtools/test/tools/javap/8006334/JavapTaskCtorFailWithNPE.java b/langtools/test/tools/javap/8006334/JavapTaskCtorFailWithNPE.java
          index 1ba5f9a106b..84e4f737ef6 100644
          --- a/langtools/test/tools/javap/8006334/JavapTaskCtorFailWithNPE.java
          +++ b/langtools/test/tools/javap/8006334/JavapTaskCtorFailWithNPE.java
          @@ -66,8 +66,7 @@ public class JavapTaskCtorFailWithNPE {
                   JavaFileManager fm = JavapFileManager.create(dc, pw);
                   JavapTask t = new JavapTask(pw, fm, dc, null,
                           Arrays.asList(classToCheck.getPath()));
          -        boolean ok = t.run();
          -        if (!ok)
          +        if (t.run() != 0)
                       throw new Error("javap failed unexpectedly");
           
                   List> diags = dc.getDiagnostics();
          diff --git a/langtools/test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java b/langtools/test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java
          new file mode 100644
          index 00000000000..06e94963faf
          --- /dev/null
          +++ b/langtools/test/tools/javap/8007907/JavapReturns0AfterClassNotFoundTest.java
          @@ -0,0 +1,75 @@
          +/*
          + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * 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 8007907
          + * @summary javap, method com.sun.tools.javap.Main.run returns 0 even in case
          + * of class not found error
          + */
          +
          +import java.io.IOException;
          +import java.io.PrintWriter;
          +import java.io.StringWriter;
          +
          +public class JavapReturns0AfterClassNotFoundTest {
          +
          +    static final String fileNotFoundErrorMsg =
          +            "Error:  class not found: Unexisting.class";
          +    static final String exitCodeClassNotFoundAssertionMsg =
          +            "Javap's exit code for class not found should be 1";
          +    static final String classNotFoundMsgAssertionMsg =
          +            "Javap's error message for class not found is incorrect";
          +
          +    public static void main(String args[]) throws Exception {
          +        new JavapReturns0AfterClassNotFoundTest().run();
          +    }
          +
          +    void run() throws IOException {
          +        check(exitCodeClassNotFoundAssertionMsg, classNotFoundMsgAssertionMsg,
          +                fileNotFoundErrorMsg, "-v", "Unexisting.class");
          +    }
          +
          +    void check(String exitCodeAssertionMsg, String errMsgAssertionMsg,
          +            String expectedErrMsg, String... params) {
          +        int result;
          +        StringWriter s;
          +        String out;
          +        try (PrintWriter pw = new PrintWriter(s = new StringWriter())) {
          +            result = com.sun.tools.javap.Main.run(params, pw);
          +            //no line separator, no problem
          +            out = s.toString().trim();
          +        }
          +        if (result != 1) {
          +            System.out.println("actual exit code " + result);
          +            throw new AssertionError(exitCodeAssertionMsg);
          +        }
          +
          +        if (!out.equals(expectedErrMsg)) {
          +            System.out.println("actual " + out);
          +            System.out.println("expected " + expectedErrMsg);
          +            throw new AssertionError(errMsgAssertionMsg);
          +        }
          +    }
          +
          +}
          diff --git a/langtools/test/tools/javap/T4777949.java b/langtools/test/tools/javap/T4777949.java
          index 4dcc551b341..af81b2b4f53 100644
          --- a/langtools/test/tools/javap/T4777949.java
          +++ b/langtools/test/tools/javap/T4777949.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -87,11 +87,11 @@ public class T4777949 {
                   PrintWriter pw = new PrintWriter(sw);
                   JavaFileManager fm = JavapFileManager.create(dc, pw);
                   JavapTask t = new JavapTask(pw, fm, dc, args, classes);
          -        boolean ok = t.run();
          +        int ok = t.run();
           
                   List> diags = dc.getDiagnostics();
           
          -        if (!ok)
          +        if (ok != 0)
                       error("javap failed unexpectedly");
           
                   System.err.println("args=" + args + " classes=" + classes + "\n"
          diff --git a/langtools/test/tools/javap/T7190862.java b/langtools/test/tools/javap/T7190862.java
          index b7b57daa2f7..8a40ac481c7 100644
          --- a/langtools/test/tools/javap/T7190862.java
          +++ b/langtools/test/tools/javap/T7190862.java
          @@ -96,8 +96,7 @@ public class T7190862 {
                   PrintWriter pw = new PrintWriter(sw);
                   JavaFileManager fm = JavapFileManager.create(dc, pw);
                   JavapTask t = new JavapTask(pw, fm, dc, args, classes);
          -        boolean ok = t.run();
          -        if (!ok)
          +        if (t.run() != 0)
                       throw new Error("javap failed unexpectedly");
           
                   List> diags = dc.getDiagnostics();
          diff --git a/nashorn/.hgtags b/nashorn/.hgtags
          index 61080945c4f..cbbd166c330 100644
          --- a/nashorn/.hgtags
          +++ b/nashorn/.hgtags
          @@ -204,3 +204,6 @@ e0378f0a50dafdcfb7b04f6401d320f89884baa1 jdk8-b85
           dee23cce5235b594a96d3361b65eacc97bd5a583 jdk8-b92
           ddbf41575a2bdb12ccb9f91e169018bf04073038 jdk8-b93
           d92b756bc73966f1bfd111f44f3216cea3bba129 jdk8-b94
          +cbc9926f5b40a24025c1e15d8870157d651a9ff7 jdk8-b95
          +d6bd440ac5b97bb1205b6c3274569c1cfe626723 jdk8-b96
          +1bf1d6ce30427e1f9dc1ada18db409d1f14d99fe jdk8-b97
          diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
          index 808f2658046..bc6bb4b2db2 100644
          --- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
          +++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
          @@ -166,11 +166,11 @@ public class ClassGenerator {
                   mi.putStatic(className, MAP_FIELD_NAME, MAP_DESC);
                   mi.loadClass(className);
                   mi.invokeStatic(MAP_TYPE, MAP_NEWMAP, MAP_NEWMAP_DESC);
          -        mi.storeLocal(0);
          +        // stack: PropertyMap
               }
           
               static void emitStaticInitSuffix(final MethodGenerator mi, final String className) {
          -        mi.loadLocal(0);
          +        // stack: PropertyMap
                   mi.putStatic(className, MAP_FIELD_NAME, MAP_DESC);
                   mi.returnVoid();
                   mi.computeMaxs();
          @@ -278,7 +278,7 @@ public class ClassGenerator {
           
               static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo memInfo) {
                   final String propertyName = memInfo.getName();
          -        mi.loadLocal(0);
          +        // stack: PropertyMap
                   mi.loadLiteral(propertyName);
                   // setup flags
                   mi.push(memInfo.getAttributes());
          @@ -293,12 +293,12 @@ public class ClassGenerator {
                       mi.visitLdcInsn(new Handle(H_INVOKEVIRTUAL, className, javaName, setterDesc(memInfo)));
                   }
                   mi.invokeStatic(LOOKUP_TYPE, LOOKUP_NEWPROPERTY, LOOKUP_NEWPROPERTY_DESC);
          -        mi.storeLocal(0);
          +        // stack: PropertyMap
               }
           
               static void linkerAddGetterSetter(final MethodGenerator mi, final String className, final MemberInfo getter, final MemberInfo setter) {
                   final String propertyName = getter.getName();
          -        mi.loadLocal(0);
          +        // stack: PropertyMap
                   mi.loadLiteral(propertyName);
                   // setup flags
                   mi.push(getter.getAttributes());
          @@ -313,7 +313,7 @@ public class ClassGenerator {
                               setter.getJavaName(), setter.getJavaDesc()));
                   }
                   mi.invokeStatic(LOOKUP_TYPE, LOOKUP_NEWPROPERTY, LOOKUP_NEWPROPERTY_DESC);
          -        mi.storeLocal(0);
          +        // stack: PropertyMap
               }
           
               static ScriptClassInfo getScriptClassInfo(final String fileName) throws IOException {
          diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
          index d140585f499..ffeb90bea3e 100644
          --- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
          +++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
          @@ -159,10 +159,14 @@ public class ScriptClassInstrumentor extends ClassVisitor {
                       public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) {
                           if (isConstructor && opcode == INVOKESPECIAL &&
                                   INIT.equals(name) && SCRIPTOBJECT_TYPE.equals(owner)) {
          -                    super.visitFieldInsn(GETSTATIC, scriptClassInfo.getJavaName(),
          -                            MAP_FIELD_NAME, MAP_DESC);
          -                    super.visitMethodInsn(INVOKESPECIAL, SCRIPTOBJECT_TYPE, INIT,
          -                            SCRIPTOBJECT_INIT_DESC);
          +
          +                    // replace call to empty super-constructor with one passing PropertyMap argument
          +                    if (DEFAULT_INIT_DESC.equals(desc)) {
          +                        super.visitFieldInsn(GETSTATIC, scriptClassInfo.getJavaName(), MAP_FIELD_NAME, MAP_DESC);
          +                        super.visitMethodInsn(INVOKESPECIAL, SCRIPTOBJECT_TYPE, INIT, SCRIPTOBJECT_INIT_DESC);
          +                    } else {
          +                        super.visitMethodInsn(opcode, owner, name, desc);
          +                    }
           
                               if (memberCount > 0) {
                                   // initialize @Property fields if needed
          @@ -223,7 +227,7 @@ public class ScriptClassInstrumentor extends ClassVisitor {
                           ClassGenerator.addSetter(cv, className, memInfo);
                       }
                   }
          -        ClassGenerator.addMapField(this);
          +        // omit addMapField() since instance classes already define a static PropertyMap field
               }
           
               void emitGettersSetters() {
          diff --git a/nashorn/docs/JavaScriptingProgrammersGuide.html b/nashorn/docs/JavaScriptingProgrammersGuide.html
          index a9803f7fd81..18ae823d82e 100644
          --- a/nashorn/docs/JavaScriptingProgrammersGuide.html
          +++ b/nashorn/docs/JavaScriptingProgrammersGuide.html
          @@ -227,6 +227,16 @@ access the variable - for example, it can call public methods on
           it. Note that the syntax to access Java objects, methods and fields
           is dependent on the scripting language. JavaScript supports the
           most "natural" Java-like syntax.

          +

          +Nashorn script engine pre-defines two global variables named "context" +and "engine". The "context" variable is of type javax.script.ScriptContext +and refers to the current ScriptContext instance passed to script engine's +eval method. The "engine" variable is of type javax.script.ScriptEngine and +refers to the current nashorn script engine instance evaluating the script. +Both of these variables are non-writable, non-enumerable and non-configurable +- which implies script code can not write overwrite the value, for..loop iteration +on global object will not iterate these variables and these variables can not be +deleted by script.

          
           // ScriptVars.java
           
          diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
          index 7c05e789fe9..7e2d999d328 100644
          --- a/nashorn/make/build.xml
          +++ b/nashorn/make/build.xml
          @@ -124,7 +124,7 @@
               
             
           
          -  
          +  
               
                 
                 
          @@ -139,7 +139,13 @@
                 
               
             
          -  
          +
          +  
          +    
          +    
          +    
          +  
          +
             
               Builds the javafx shell.
               
          @@ -238,7 +244,7 @@
               
               
               
          -    
          +
               
               
               
          @@ -462,24 +468,24 @@
             
             
               
          -     
          +    
           
               
          -        
          +    
               
               
           
               
          -        
          +    
               
           
               
          -     
          +    
               
               
           
               
          -     
          +    
               
               
           
          diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties
          index 2e3839b6732..66bbdbebab7 100644
          --- a/nashorn/make/project.properties
          +++ b/nashorn/make/project.properties
          @@ -193,7 +193,8 @@ test262-test-sys-prop.test.js.enable.strict.mode=true
           
           # list of test262 test dirs to be excluded
           test262-test-sys-prop.test.js.exclude.dir=\
          -    ${test262.suite.dir}/intl402/
          +    ${test262.suite.dir}/intl402/ \
          +    ${test262.suite.dir}/bestPractice/ 
           
           test262-test-sys-prop.test.failed.list.file=${build.dir}/test/failedTests
           
          diff --git a/nashorn/samples/test.js b/nashorn/samples/test.js
          index e2f8c934c92..ecdaf846d86 100644
          --- a/nashorn/samples/test.js
          +++ b/nashorn/samples/test.js
          @@ -1,21 +1,21 @@
           /*
            * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          - * 
          + *
            * Redistribution and use in source and binary forms, with or without
            * modification, are permitted provided that the following conditions
            * are met:
          - * 
          + *
            *   - Redistributions of source code must retain the above copyright
            *     notice, this list of conditions and the following disclaimer.
          - * 
          + *
            *   - Redistributions in binary form must reproduce the above copyright
            *     notice, this list of conditions and the following disclaimer in the
            *     documentation and/or other materials provided with the distribution.
          - * 
          + *
            *   - Neither the name of Oracle nor the names of its
            *     contributors may be used to endorse or promote products derived
            *     from this software without specific prior written permission.
          - * 
          + *
            * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
            * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
            * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
          @@ -30,3 +30,4 @@
            */
           
           print("Hello World");
          +
          diff --git a/nashorn/src/jdk/nashorn/api/scripting/JSObject.java b/nashorn/src/jdk/nashorn/api/scripting/JSObject.java
          index 583e8f7a199..4f3a8e88f93 100644
          --- a/nashorn/src/jdk/nashorn/api/scripting/JSObject.java
          +++ b/nashorn/src/jdk/nashorn/api/scripting/JSObject.java
          @@ -30,13 +30,23 @@ package jdk.nashorn.api.scripting;
            */
           public abstract class JSObject {
               /**
          -     * Call a JavaScript method
          +     * Call a JavaScript function
                *
          -     * @param methodName name of method
          +     * @param functionName name of function
                * @param args arguments to method
                * @return result of call
                */
          -    public abstract Object call(String methodName, Object args[]);
          +    public abstract Object call(String functionName, Object... args);
          +
          +    /**
          +     * Call a JavaScript method as a constructor. This is equivalent to
          +     * calling new obj.Method(arg1, arg2...) in JavaScript.
          +     *
          +     * @param functionName name of function
          +     * @param args arguments to method
          +     * @return result of constructor call
          +     */
          +    public abstract Object newObject(String functionName, Object... args);
           
               /**
                * Evaluate a JavaScript expression
          diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java
          index d1d47b1dc08..3cd687cce08 100644
          --- a/nashorn/src/jdk/nashorn/api/scripting/NashornException.java
          +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornException.java
          @@ -25,6 +25,9 @@
           
           package jdk.nashorn.api.scripting;
           
          +import java.util.ArrayList;
          +import java.util.List;
          +import jdk.nashorn.internal.codegen.CompilerConstants;
           import jdk.nashorn.internal.runtime.ECMAErrors;
           
           /**
          @@ -136,4 +139,53 @@ public abstract class NashornException extends RuntimeException {
                   return column;
               }
           
          +    /**
          +     * Returns array javascript stack frames from the given exception object.
          +     *
          +     * @param exception exception from which stack frames are retrieved and filtered
          +     * @return array of javascript stack frames
          +     */
          +    public static StackTraceElement[] getScriptFrames(final Throwable exception) {
          +        final StackTraceElement[] frames = ((Throwable)exception).getStackTrace();
          +        final List filtered = new ArrayList<>();
          +        for (final StackTraceElement st : frames) {
          +            if (ECMAErrors.isScriptFrame(st)) {
          +                final String className = "<" + st.getFileName() + ">";
          +                String methodName = st.getMethodName();
          +                if (methodName.equals(CompilerConstants.RUN_SCRIPT.symbolName())) {
          +                    methodName = "";
          +                }
          +                filtered.add(new StackTraceElement(className, methodName,
          +                        st.getFileName(), st.getLineNumber()));
          +            }
          +        }
          +        return filtered.toArray(new StackTraceElement[filtered.size()]);
          +    }
          +
          +    /**
          +     * Return a formatted script stack trace string with frames information separated by '\n'
          +     *
          +     * @param exception exception for which script stack string is returned
          +     * @return formatted stack trace string
          +     */
          +    public static String getScriptStackString(final Throwable exception) {
          +        final StringBuilder buf = new StringBuilder();
          +        final StackTraceElement[] frames = getScriptFrames((Throwable)exception);
          +        for (final StackTraceElement st : frames) {
          +            buf.append("\tat ");
          +            buf.append(st.getMethodName());
          +            buf.append(" (");
          +            buf.append(st.getFileName());
          +            buf.append(':');
          +            buf.append(st.getLineNumber());
          +            buf.append(")\n");
          +        }
          +        final int len = buf.length();
          +        // remove trailing '\n'
          +        if (len > 0) {
          +            assert buf.charAt(len - 1) == '\n';
          +            buf.deleteCharAt(len - 1);
          +        }
          +        return buf.toString();
          +    }
           }
          diff --git a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
          index 283e36e9e33..d38e63c88b8 100644
          --- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
          +++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
          @@ -34,6 +34,7 @@ import java.io.InputStreamReader;
           import java.io.Reader;
           import java.lang.reflect.Method;
           import java.net.URL;
          +import java.nio.charset.Charset;
           import java.security.AccessController;
           import java.security.PrivilegedAction;
           import java.security.PrivilegedActionException;
          @@ -70,9 +71,12 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
               private final ScriptEngineFactory factory;
               private final Context             nashornContext;
               private final ScriptObject        global;
          +    // initialized bit late to be made 'final'. Property object for "context"
          +    // property of global object
          +    private Property                  contextProperty;
           
               // default options passed to Nashorn Options object
          -    private static final String[] DEFAULT_OPTIONS = new String[] { "-scripting", "-af", "-doe" };
          +    private static final String[] DEFAULT_OPTIONS = new String[] { "-scripting", "-doe" };
           
               NashornScriptEngine(final NashornScriptEngineFactory factory, final ClassLoader appLoader) {
                   this(factory, DEFAULT_OPTIONS, appLoader);
          @@ -121,7 +125,8 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
                   try {
                       if (reader instanceof URLReader) {
                           final URL url = ((URLReader)reader).getURL();
          -                return evalImpl(compileImpl(new Source(url.toString(), url), ctxt), ctxt);
          +                final Charset cs = ((URLReader)reader).getCharset();
          +                return evalImpl(compileImpl(new Source(url.toString(), url, cs), ctxt), ctxt);
                       }
                       return evalImpl(Source.readFully(reader), ctxt);
                   } catch (final IOException e) {
          @@ -279,13 +284,16 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
           
                   nashornContext.initGlobal(newGlobal);
           
          +        final int NON_ENUMERABLE_CONSTANT = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE;
                   // current ScriptContext exposed as "context"
          -        newGlobal.addOwnProperty("context", Property.NOT_ENUMERABLE, UNDEFINED);
          +        // "context" is non-writable from script - but script engine still
          +        // needs to set it and so save the context Property object
          +        contextProperty = newGlobal.addOwnProperty("context", NON_ENUMERABLE_CONSTANT, UNDEFINED);
                   // current ScriptEngine instance exposed as "engine". We added @SuppressWarnings("LeakingThisInConstructor") as
                   // NetBeans identifies this assignment as such a leak - this is a false positive as we're setting this property
                   // in the Global of a Context we just created - both the Context and the Global were just created and can not be
                   // seen from another thread outside of this constructor.
          -        newGlobal.addOwnProperty("engine", Property.NOT_ENUMERABLE, this);
          +        newGlobal.addOwnProperty("engine", NON_ENUMERABLE_CONSTANT, this);
                   // global script arguments with undefined value
                   newGlobal.addOwnProperty("arguments", Property.NOT_ENUMERABLE, UNDEFINED);
                   // file name default is null
          @@ -320,9 +328,10 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
           
               // scripts should see "context" and "engine" as variables
               private void setContextVariables(final ScriptContext ctxt) {
          -        ctxt.setAttribute("context", ctxt, ScriptContext.ENGINE_SCOPE);
                   final ScriptObject ctxtGlobal = getNashornGlobalFrom(ctxt);
          -        ctxtGlobal.set("context", ctxt, false);
          +        // set "context" global variable via contextProperty - because this
          +        // property is non-writable
          +        contextProperty.setObjectValue(ctxtGlobal, ctxtGlobal, ctxt, false);
                   Object args = ScriptObjectMirror.unwrap(ctxt.getAttribute("arguments"), ctxtGlobal);
                   if (args == null || args == UNDEFINED) {
                       args = ScriptRuntime.EMPTY_ARRAY;
          diff --git a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java
          index 7428a8f67f0..c7dbab5a184 100644
          --- a/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java
          +++ b/nashorn/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java
          @@ -102,7 +102,7 @@ public final class ScriptObjectMirror extends JSObject implements Bindings {
           
               // JSObject methods
               @Override
          -    public Object call(final String methodName, final Object args[]) {
          +    public Object call(final String functionName, final Object... args) {
                   final ScriptObject oldGlobal = NashornScriptEngine.getNashornGlobal();
                   final boolean globalChanged = (oldGlobal != global);
           
          @@ -111,9 +111,9 @@ public final class ScriptObjectMirror extends JSObject implements Bindings {
                           NashornScriptEngine.setNashornGlobal(global);
                       }
           
          -            final Object val = sobj.get(methodName);
          +            final Object val = functionName == null? sobj : sobj.get(functionName);
                       if (! (val instanceof ScriptFunction)) {
          -                throw new RuntimeException("No such method: " + methodName);
          +                throw new RuntimeException("No such function " + ((functionName != null)? functionName : ""));
                       }
           
                       final Object[] modArgs = globalChanged? wrapArray(args, oldGlobal) : args;
          @@ -129,6 +129,34 @@ public final class ScriptObjectMirror extends JSObject implements Bindings {
                   }
               }
           
          +    @Override
          +    public Object newObject(final String functionName, final Object... args) {
          +        final ScriptObject oldGlobal = NashornScriptEngine.getNashornGlobal();
          +        final boolean globalChanged = (oldGlobal != global);
          +
          +        try {
          +            if (globalChanged) {
          +                NashornScriptEngine.setNashornGlobal(global);
          +            }
          +
          +            final Object val = functionName == null? sobj : sobj.get(functionName);
          +            if (! (val instanceof ScriptFunction)) {
          +                throw new RuntimeException("not a constructor " + ((functionName != null)? functionName : ""));
          +            }
          +
          +            final Object[] modArgs = globalChanged? wrapArray(args, oldGlobal) : args;
          +            return wrap(ScriptRuntime.checkAndConstruct((ScriptFunction)val, unwrapArray(modArgs, global)), global);
          +        } catch (final RuntimeException | Error e) {
          +            throw e;
          +        } catch (final Throwable t) {
          +            throw new RuntimeException(t);
          +        } finally {
          +            if (globalChanged) {
          +                NashornScriptEngine.setNashornGlobal(oldGlobal);
          +            }
          +        }
          +    }
          +
               @Override
               public Object eval(final String s) {
                   return inGlobal(new Callable() {
          @@ -342,6 +370,184 @@ public final class ScriptObjectMirror extends JSObject implements Bindings {
                   });
               }
           
          +    // Support for ECMAScript Object API on mirrors
          +
          +    /**
          +     * Return the __proto__ of this object.
          +     * @return __proto__ object.
          +     */
          +    public Object getProto() {
          +        return inGlobal(new Callable() {
          +            @Override public Object call() {
          +                return wrap(getScriptObject().getProto(), global);
          +            }
          +        });
          +    }
          +
          +    /**
          +     * ECMA 8.12.1 [[GetOwnProperty]] (P)
          +     *
          +     * @param key property key
          +     *
          +     * @return Returns the Property Descriptor of the named own property of this
          +     * object, or undefined if absent.
          +     */
          +    public Object getOwnPropertyDescriptor(final String key) {
          +        return inGlobal(new Callable() {
          +            @Override public Object call() {
          +                return wrap(getScriptObject().getOwnPropertyDescriptor(key), global);
          +            }
          +        });
          +    }
          +
          +    /**
          +     * return an array of own property keys associated with the object.
          +     *
          +     * @param all True if to include non-enumerable keys.
          +     * @return Array of keys.
          +     */
          +    public String[] getOwnKeys(final boolean all) {
          +        return inGlobal(new Callable() {
          +            @Override public String[] call() {
          +                return getScriptObject().getOwnKeys(all);
          +            }
          +        });
          +    }
          +
          +    /**
          +     * Flag this script object as non extensible
          +     *
          +     * @return the object after being made non extensible
          +     */
          +    public ScriptObjectMirror preventExtensions() {
          +        return inGlobal(new Callable() {
          +            @Override public ScriptObjectMirror call() {
          +                getScriptObject().preventExtensions();
          +                return ScriptObjectMirror.this;
          +            }
          +        });
          +    }
          +
          +    /**
          +     * Check if this script object is extensible
          +     * @return true if extensible
          +     */
          +    public boolean isExtensible() {
          +        return inGlobal(new Callable() {
          +            @Override public Boolean call() {
          +                return getScriptObject().isExtensible();
          +            }
          +        });
          +    }
          +
          +    /**
          +     * ECMAScript 15.2.3.8 - seal implementation
          +     * @return the sealed script object
          +     */
          +    public ScriptObjectMirror seal() {
          +        return inGlobal(new Callable() {
          +            @Override public ScriptObjectMirror call() {
          +                getScriptObject().seal();
          +                return ScriptObjectMirror.this;
          +            }
          +        });
          +    }
          +
          +    /**
          +     * Check whether this script object is sealed
          +     * @return true if sealed
          +     */
          +    public boolean isSealed() {
          +        return inGlobal(new Callable() {
          +            @Override public Boolean call() {
          +                return getScriptObject().isSealed();
          +            }
          +        });
          +    }
          +
          +    /**
          +     * ECMA 15.2.39 - freeze implementation. Freeze this script object
          +     * @return the frozen script object
          +     */
          +    public ScriptObjectMirror freeze() {
          +        return inGlobal(new Callable() {
          +            @Override public ScriptObjectMirror call() {
          +                getScriptObject().freeze();
          +                return ScriptObjectMirror.this;
          +            }
          +        });
          +    }
          +
          +    /**
          +     * Check whether this script object is frozen
          +     * @return true if frozen
          +     */
          +    public boolean isFrozen() {
          +        return inGlobal(new Callable() {
          +            @Override public Boolean call() {
          +                return getScriptObject().isFrozen();
          +            }
          +        });
          +    }
          +
          +    // ECMAScript instanceof check
          +
          +    /**
          +     * Checking whether a script object is an instance of another by
          +     * walking the proto chain
          +     *
          +     * @param instance instace to check
          +     * @return true if 'instance' is an instance of this object
          +     */
          +    public boolean isInstance(final ScriptObjectMirror instance) {
          +        // if not belongs to my global scope, return false
          +        if (instance == null || global != instance.global) {
          +            return false;
          +        }
          +
          +        return inGlobal(new Callable() {
          +            @Override public Boolean call() {
          +                return getScriptObject().isInstance(instance.getScriptObject());
          +            }
          +        });
          +    }
          +
          +    /**
          +     * Utility to check if given object is ECMAScript undefined value
          +     *
          +     * @param obj object to check
          +     * @return true if 'obj' is ECMAScript undefined value
          +     */
          +    public static boolean isUndefined(final Object obj) {
          +        return obj == ScriptRuntime.UNDEFINED;
          +    }
          +
          +    /**
          +     * is this a function object?
          +     *
          +     * @return if this mirror wraps a ECMAScript function instance
          +     */
          +    public boolean isFunction() {
          +        return getScriptObject() instanceof ScriptFunction;
          +    }
          +
          +    /**
          +     * is this a 'use strict' function object?
          +     *
          +     * @return true if this mirror represents a ECMAScript 'use strict' function
          +     */
          +    public boolean isStrictFunction() {
          +        return isFunction() && ((ScriptFunction)getScriptObject()).isStrict();
          +    }
          +
          +    /**
          +     * is this an array object?
          +     *
          +     * @return if this mirror wraps a ECMAScript array object
          +     */
          +    public boolean isArray() {
          +        return getScriptObject().isArray();
          +    }
           
               // These are public only so that Context can access these.
           
          diff --git a/nashorn/src/jdk/nashorn/api/scripting/URLReader.java b/nashorn/src/jdk/nashorn/api/scripting/URLReader.java
          index d21d6263611..13f69843d5a 100644
          --- a/nashorn/src/jdk/nashorn/api/scripting/URLReader.java
          +++ b/nashorn/src/jdk/nashorn/api/scripting/URLReader.java
          @@ -25,10 +25,12 @@
           
           package jdk.nashorn.api.scripting;
           
          +import java.io.CharArrayReader;
           import java.io.IOException;
          -import java.io.InputStreamReader;
           import java.io.Reader;
           import java.net.URL;
          +import java.nio.charset.Charset;
          +import jdk.nashorn.internal.runtime.Source;
           
           /**
            * A Reader that reads from a URL. Used to make sure that the reader
          @@ -36,7 +38,10 @@ import java.net.URL;
            */
           public final class URLReader extends Reader {
               // underlying URL
          -    private URL url;
          +    private final URL url;
          +    // Charset used to convert
          +    private final Charset cs;
          +
               // lazily initialized underlying reader for URL
               private Reader reader;
           
          @@ -44,9 +49,35 @@ public final class URLReader extends Reader {
                * Constructor
                *
                * @param url URL for this URLReader
          +     * @throws NullPointerException if url is null
                */
               public URLReader(final URL url) {
          +        this(url, (Charset)null);
          +    }
          +
          +    /**
          +     * Constructor
          +     *
          +     * @param url URL for this URLReader
          +     * @param charsetName  Name of the Charset used to convert bytes to chars
          +     * @throws NullPointerException if url is null
          +     */
          +    public URLReader(final URL url, final String charsetName) {
          +        this(url, Charset.forName(charsetName));
          +    }
          +
          +    /**
          +     * Constructor
          +     *
          +     * @param url URL for this URLReader
          +     * @param cs  Charset used to convert bytes to chars
          +     * @throws NullPointerException if url is null
          +     */
          +    public URLReader(final URL url, final Charset cs) {
          +        // null check
          +        url.getClass();
                   this.url = url;
          +        this.cs  = cs;
               }
           
               @Override
          @@ -67,11 +98,20 @@ public final class URLReader extends Reader {
                   return url;
               }
           
          +    /**
          +     * Charset used by this reader
          +     *
          +     * @return the Chartset used to convert bytes to chars
          +     */
          +    public Charset getCharset() {
          +        return cs;
          +    }
          +
               // lazily initialize char array reader using URL content
               private Reader getReader() throws IOException {
                   synchronized (lock) {
                       if (reader == null) {
          -                reader = new InputStreamReader(url.openStream());
          +                reader = new CharArrayReader(Source.readFully(url, cs));
                       }
                   }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java
          index d0b5a00a77c..3a442a7d8f2 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/Attr.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/Attr.java
          @@ -35,6 +35,7 @@ import static jdk.nashorn.internal.codegen.CompilerConstants.SCOPE;
           import static jdk.nashorn.internal.codegen.CompilerConstants.SWITCH_TAG_PREFIX;
           import static jdk.nashorn.internal.codegen.CompilerConstants.THIS;
           import static jdk.nashorn.internal.codegen.CompilerConstants.VARARGS;
          +import static jdk.nashorn.internal.ir.Symbol.IS_ALWAYS_DEFINED;
           import static jdk.nashorn.internal.ir.Symbol.IS_CONSTANT;
           import static jdk.nashorn.internal.ir.Symbol.IS_FUNCTION_SELF;
           import static jdk.nashorn.internal.ir.Symbol.IS_GLOBAL;
          @@ -128,6 +129,8 @@ final class Attr extends NodeOperatorVisitor {
           
               private final Deque returnTypes;
           
          +    private int catchNestingLevel;
          +
               private static final DebugLogger LOG   = new DebugLogger("attr");
               private static final boolean     DEBUG = LOG.isEnabled();
           
          @@ -169,14 +172,14 @@ final class Attr extends NodeOperatorVisitor {
                   if (functionNode.isVarArg()) {
                       initCompileConstant(VARARGS, body, IS_PARAM | IS_INTERNAL, Type.OBJECT_ARRAY);
                       if (functionNode.needsArguments()) {
          -                initCompileConstant(ARGUMENTS, body, IS_VAR | IS_INTERNAL, Type.typeFor(ScriptObject.class));
          +                initCompileConstant(ARGUMENTS, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.typeFor(ScriptObject.class));
                           addLocalDef(ARGUMENTS.symbolName());
                       }
                   }
           
                   initParameters(functionNode, body);
          -        initCompileConstant(SCOPE, body, IS_VAR | IS_INTERNAL, Type.typeFor(ScriptObject.class));
          -        initCompileConstant(RETURN, body, IS_VAR | IS_INTERNAL, Type.OBJECT);
          +        initCompileConstant(SCOPE, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.typeFor(ScriptObject.class));
          +        initCompileConstant(RETURN, body, IS_VAR | IS_INTERNAL | IS_ALWAYS_DEFINED, Type.OBJECT);
               }
           
           
          @@ -202,18 +205,52 @@ final class Attr extends NodeOperatorVisitor {
               private void acceptDeclarations(final FunctionNode functionNode, final Block body) {
                   // This visitor will assign symbol to all declared variables, except function declarations (which are taken care
                   // in a separate step above) and "var" declarations in for loop initializers.
          +        //
          +        // It also handles the case that a variable can be undefined, e.g
          +        // if (cond) {
          +        //    x = x.y;
          +        // }
          +        // var x = 17;
          +        //
          +        // by making sure that no identifier has been found earlier in the body than the
          +        // declaration - if such is the case the identifier is flagged as caBeUndefined to
          +        // be safe if it turns into a local var. Otherwise corrupt bytecode results
          +
                   body.accept(new NodeVisitor(new LexicalContext()) {
          +            private final Set uses = new HashSet<>();
          +            private final Set canBeUndefined = new HashSet<>();
          +
                       @Override
                       public boolean enterFunctionNode(final FunctionNode nestedFn) {
                           return false;
                       }
           
          +            @Override
          +            public Node leaveIdentNode(final IdentNode identNode) {
          +                uses.add(identNode.getName());
          +                return identNode;
          +            }
          +
          +            @Override
          +            public boolean enterVarNode(final VarNode varNode) {
          +                final String name = varNode.getName().getName();
          +                //if this is used the var node symbol needs to be tagged as can be undefined
          +                if (uses.contains(name)) {
          +                    canBeUndefined.add(name);
          +                }
          +                return true;
          +            }
          +
                       @Override
                       public Node leaveVarNode(final VarNode varNode) {
                           // any declared symbols that aren't visited need to be typed as well, hence the list
                           if (varNode.isStatement()) {
                               final IdentNode ident  = varNode.getName();
                               final Symbol    symbol = defineSymbol(body, ident.getName(), IS_VAR);
          +                    if (canBeUndefined.contains(ident.getName())) {
          +                        symbol.setType(Type.OBJECT);
          +                        symbol.setCanBeUndefined();
          +                    }
                               functionNode.addDeclaredSymbol(symbol);
                               if (varNode.isFunctionDeclaration()) {
                                   newType(symbol, FunctionNode.FUNCTION_TYPE);
          @@ -286,10 +323,12 @@ final class Attr extends NodeOperatorVisitor {
                   final Block     block     = lc.getCurrentBlock();
           
                   start(catchNode);
          +        catchNestingLevel++;
           
                   // define block-local exception variable
          -        final Symbol def = defineSymbol(block, exception.getName(), IS_VAR | IS_LET);
          -        newType(def, Type.OBJECT);
          +        final Symbol def = defineSymbol(block, exception.getName(), IS_VAR | IS_LET | IS_ALWAYS_DEFINED);
          +        newType(def, Type.OBJECT); //we can catch anything, not just ecma exceptions
          +
                   addLocalDef(exception.getName());
           
                   return true;
          @@ -300,6 +339,9 @@ final class Attr extends NodeOperatorVisitor {
                   final IdentNode exception = catchNode.getException();
                   final Block  block        = lc.getCurrentBlock();
                   final Symbol symbol       = findSymbol(block, exception.getName());
          +
          +        catchNestingLevel--;
          +
                   assert symbol != null;
                   return end(catchNode.setException((IdentNode)exception.setSymbol(lc, symbol)));
               }
          @@ -509,9 +551,19 @@ final class Attr extends NodeOperatorVisitor {
                           assert lc.getFunctionBody(functionNode).getExistingSymbol(CALLEE.symbolName()) != null;
                           lc.setFlag(functionNode.getBody(), Block.NEEDS_SELF_SYMBOL);
                           newType(symbol, FunctionNode.FUNCTION_TYPE);
          -            } else if (!identNode.isInitializedHere()) { // NASHORN-448
          -                // here is a use outside the local def scope
          -                if (!isLocalDef(name)) {
          +            } else if (!identNode.isInitializedHere()) {
          +                /*
          +                 * See NASHORN-448, JDK-8016235
          +                 *
          +                 * Here is a use outside the local def scope
          +                 * the inCatch check is a conservative approach to handle things that might have only been
          +                 * defined in the try block, but with variable declarations, which due to JavaScript rules
          +                 * have to be lifted up into the function scope outside the try block anyway, but as the
          +                 * flow can fault at almost any place in the try block and get us to the catch block, all we
          +                 * know is that we have a declaration, not a definition. This can be made better and less
          +                 * conservative once we superimpose a CFG onto the AST.
          +                 */
          +                if (!isLocalDef(name) || inCatch()) {
                               newType(symbol, Type.OBJECT);
                               symbol.setCanBeUndefined();
                           }
          @@ -538,6 +590,10 @@ final class Attr extends NodeOperatorVisitor {
                   return end(identNode.setSymbol(lc, symbol));
               }
           
          +    private boolean inCatch() {
          +        return catchNestingLevel > 0;
          +    }
          +
               /**
                * If the symbol isn't already a scope symbol, and it is either not local to the current function, or it is being
                * referenced from within a with block, we force it to be a scope symbol.
          @@ -550,26 +606,26 @@ final class Attr extends NodeOperatorVisitor {
               }
           
               private boolean symbolNeedsToBeScope(Symbol symbol) {
          -        if(symbol.isThis() || symbol.isInternal()) {
          +        if (symbol.isThis() || symbol.isInternal()) {
                       return false;
                   }
                   boolean previousWasBlock = false;
          -        for(final Iterator it = lc.getAllNodes(); it.hasNext();) {
          +        for (final Iterator it = lc.getAllNodes(); it.hasNext();) {
                       final LexicalContextNode node = it.next();
          -            if(node instanceof FunctionNode) {
          +            if (node instanceof FunctionNode) {
                           // We reached the function boundary without seeing a definition for the symbol - it needs to be in
                           // scope.
                           return true;
          -            } else if(node instanceof WithNode) {
          -                if(previousWasBlock) {
          +            } else if (node instanceof WithNode) {
          +                if (previousWasBlock) {
                               // We reached a WithNode; the symbol must be scoped. Note that if the WithNode was not immediately
                               // preceded by a block, this means we're currently processing its expression, not its body,
                               // therefore it doesn't count.
                               return true;
                           }
                           previousWasBlock = false;
          -            } else if(node instanceof Block) {
          -                if(((Block)node).getExistingSymbol(symbol.getName()) == symbol) {
          +            } else if (node instanceof Block) {
          +                if (((Block)node).getExistingSymbol(symbol.getName()) == symbol) {
                               // We reached the block that defines the symbol without reaching either the function boundary, or a
                               // WithNode. The symbol need not be scoped.
                               return false;
          @@ -1666,8 +1722,8 @@ final class Attr extends NodeOperatorVisitor {
               }
           
               private void pushLocalsBlock() {
          -        localDefs.push(localDefs.isEmpty() ? new HashSet() : new HashSet<>(localDefs.peek()));
          -        localUses.push(localUses.isEmpty() ? new HashSet() : new HashSet<>(localUses.peek()));
          +        localDefs.push(new HashSet<>(localDefs.peek()));
          +        localUses.push(new HashSet<>(localUses.peek()));
               }
           
               private void popLocals() {
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java b/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java
          index 2d379183fd5..09c6a0651cb 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/ClassEmitter.java
          @@ -165,7 +165,8 @@ public class ClassEmitter implements Emitter {
               /**
                * Constructor from the compiler
                *
          -     * @param compiler      Compiler
          +     * @param env           Script environment
          +     * @param sourceName    Source name
                * @param unitClassName Compile unit class name.
                * @param strictMode    Should we generate this method in strict mode
                */
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
          index e66e288801d..414d1bb8bc3 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
          @@ -244,7 +244,7 @@ final class CodeGenerator extends NodeOperatorVisitor extends ObjectCreator {
                       final T      value  = valueIter.next();
           
                       if (symbol != null && value != null) {
          -                final int index = ArrayIndex.getArrayIndexNoThrow(key);
          +                final int index = ArrayIndex.getArrayIndex(key);
           
                           if (index < 0) {
                               putField(method, key, symbol.getFieldIndex(), value);
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java b/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
          index 153e0367f3f..609fac9b3ff 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/MapCreator.java
          @@ -79,7 +79,7 @@ public class MapCreator {
                       final String key    = keys[i];
                       final Symbol symbol = symbols[i];
           
          -            if (symbol != null && !ArrayIndex.isIndexKey(key)) {
          +            if (symbol != null && !ArrayIndex.isIntArrayIndex(key)) {
                           properties.add(new AccessorProperty(key, getPropertyFlags(symbol, hasArguments), structure, symbol.getFieldIndex()));
                       }
                   }
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
          index 172c1035426..934df7a6820 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
          @@ -82,13 +82,13 @@ public final class ObjectClassGenerator {
                * Debug field logger
                * Should we print debugging information for fields when they are generated and getters/setters are called?
                */
          -    public static final DebugLogger LOG          = new DebugLogger("fields", "nashorn.fields.debug");
          +    public static final DebugLogger LOG = new DebugLogger("fields", "nashorn.fields.debug");
           
               /**
                * is field debugging enabled. Several modules in codegen and properties use this, hence
                * public access.
                */
          -    public static final boolean     DEBUG_FIELDS = LOG.isEnabled();
          +    public static final boolean DEBUG_FIELDS = LOG.isEnabled();
           
               /**
                * Should the runtime only use java.lang.Object slots for fields? If this is false, the representation
          diff --git a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java
          index 57b0212a59b..ab32a779703 100644
          --- a/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java
          +++ b/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java
          @@ -36,6 +36,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.DUP_X2;
           import static jdk.internal.org.objectweb.asm.Opcodes.IALOAD;
           import static jdk.internal.org.objectweb.asm.Opcodes.IASTORE;
           import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
          +import static jdk.internal.org.objectweb.asm.Opcodes.LALOAD;
           import static jdk.internal.org.objectweb.asm.Opcodes.LASTORE;
           import static jdk.internal.org.objectweb.asm.Opcodes.NEWARRAY;
           import static jdk.internal.org.objectweb.asm.Opcodes.POP;
          @@ -43,6 +44,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.POP2;
           import static jdk.internal.org.objectweb.asm.Opcodes.SWAP;
           import static jdk.internal.org.objectweb.asm.Opcodes.T_DOUBLE;
           import static jdk.internal.org.objectweb.asm.Opcodes.T_INT;
          +import static jdk.internal.org.objectweb.asm.Opcodes.T_LONG;
           
           import java.lang.invoke.MethodHandle;
           import java.util.Collections;
          @@ -729,19 +731,19 @@ public abstract class Type implements Comparable, BytecodeOps {
           
                   @Override
                   public Type aload(final MethodVisitor method) {
          -            method.visitInsn(IALOAD);
          -            return INT;
          +            method.visitInsn(LALOAD);
          +            return LONG;
                   }
           
                   @Override
                   public Type newarray(final MethodVisitor method) {
          -            method.visitIntInsn(NEWARRAY, T_INT);
          +            method.visitIntInsn(NEWARRAY, T_LONG);
                       return this;
                   }
           
                   @Override
                   public Type getElementType() {
          -            return INT;
          +            return LONG;
                   }
               };
           
          diff --git a/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java b/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java
          index a86a327ea6c..71c80a6b04f 100644
          --- a/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java
          +++ b/nashorn/src/jdk/nashorn/internal/ir/BlockLexicalContext.java
          @@ -63,6 +63,7 @@ public class BlockLexicalContext extends LexicalContext {
                   return sstack.pop();
               }
           
          +    @SuppressWarnings("unchecked")
               @Override
               public  T pop(final T node) {
                   T expected = node;
          diff --git a/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java b/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java
          index ea07cb4bcb3..171df8e3403 100644
          --- a/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java
          +++ b/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java
          @@ -86,7 +86,7 @@ public abstract class BreakableNode extends LexicalContextNode {
           
               /**
                * Return the labels associated with this node. Breakable nodes that
          -     * aren't LoopNodes only have a break label -> the location immediately
          +     * aren't LoopNodes only have a break label - the location immediately
                * afterwards the node in code
                * @return list of labels representing locations around this node
                */
          diff --git a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
          index c34f9d94c5b..a7cea66a256 100644
          --- a/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
          +++ b/nashorn/src/jdk/nashorn/internal/ir/LiteralNode.java
          @@ -621,8 +621,10 @@ public abstract class LiteralNode extends Node implements PropertyKey {
                       elementType = Type.INT;
                       analyzeElements();
           
          -            if (elementType == Type.INT) {
          +            if (elementType.isInteger()) {
                           presetIntArray();
          +            } else if (elementType.isLong()) {
          +                presetLongArray();
                       } else if (elementType.isNumeric()) {
                           presetNumberArray();
                       } else {
          @@ -649,6 +651,25 @@ public abstract class LiteralNode extends Node implements PropertyKey {
                       postsets = Arrays.copyOf(computed, nComputed);
                   }
           
          +        private void presetLongArray() {
          +            final long[] array = new long[value.length];
          +            final int[] computed = new int[value.length];
          +            int nComputed = 0;
          +
          +            for (int i = 0; i < value.length; i++) {
          +                final Object element = objectAsConstant(value[i]);
          +
          +                if (element instanceof Number) {
          +                    array[i] = ((Number)element).longValue();
          +                } else {
          +                    computed[nComputed++] = i;
          +                }
          +            }
          +
          +            presets = array;
          +            postsets = Arrays.copyOf(computed, nComputed);
          +        }
          +
                   private void presetNumberArray() {
                       final double[] array = new double[value.length];
                       final int[] computed = new int[value.length];
          @@ -746,6 +767,8 @@ public abstract class LiteralNode extends Node implements PropertyKey {
                   public Type getType() {
                       if (elementType.isInteger()) {
                           return Type.INT_ARRAY;
          +            } else if (elementType.isLong()) {
          +                return Type.LONG_ARRAY;
                       } else if (elementType.isNumeric()) {
                           return Type.NUMBER_ARRAY;
                       } else {
          diff --git a/nashorn/src/jdk/nashorn/internal/ir/Symbol.java b/nashorn/src/jdk/nashorn/internal/ir/Symbol.java
          index d26fe561627..7c1839024aa 100644
          --- a/nashorn/src/jdk/nashorn/internal/ir/Symbol.java
          +++ b/nashorn/src/jdk/nashorn/internal/ir/Symbol.java
          @@ -55,23 +55,25 @@ public final class Symbol implements Comparable {
               public static final int KINDMASK = (1 << 3) - 1; // Kinds are represented by lower three bits
           
               /** Is this scope */
          -    public static final int IS_SCOPE         = 1 << 4;
          +    public static final int IS_SCOPE             = 1 <<  4;
               /** Is this a this symbol */
          -    public static final int IS_THIS          = 1 << 5;
          +    public static final int IS_THIS              = 1 <<  5;
               /** Can this symbol ever be undefined */
          -    public static final int CAN_BE_UNDEFINED = 1 << 6;
          +    public static final int CAN_BE_UNDEFINED     = 1 <<  6;
          +    /** Is this symbol always defined? */
          +    public static final int IS_ALWAYS_DEFINED    = 1 <<  8;
               /** Can this symbol ever have primitive types */
          -    public static final int CAN_BE_PRIMITIVE = 1 << 7;
          +    public static final int CAN_BE_PRIMITIVE     = 1 <<  9;
               /** Is this a let */
          -    public static final int IS_LET           = 1 << 8;
          +    public static final int IS_LET               = 1 << 10;
               /** Is this an internal symbol, never represented explicitly in source code */
          -    public static final int IS_INTERNAL      = 1 << 9;
          +    public static final int IS_INTERNAL          = 1 << 11;
               /** Is this a function self-reference symbol */
          -    public static final int IS_FUNCTION_SELF = 1 << 10;
          +    public static final int IS_FUNCTION_SELF     = 1 << 12;
               /** Is this a specialized param? */
          -    public static final int IS_SPECIALIZED_PARAM = 1 << 11;
          +    public static final int IS_SPECIALIZED_PARAM = 1 << 13;
               /** Is this symbol a shared temporary? */
          -    public static final int IS_SHARED = 1 << 12;
          +    public static final int IS_SHARED            = 1 << 14;
           
               /** Null or name identifying symbol. */
               private final String name;
          @@ -384,7 +386,7 @@ public final class Symbol implements Comparable {
                 * Mark this symbol as one being shared by multiple expressions. The symbol must be a temporary.
                 */
                public void setIsShared() {
          -         if(!isShared()) {
          +         if (!isShared()) {
                        assert isTemp();
                        trace("SET IS SHARED");
                        flags |= IS_SHARED;
          @@ -416,6 +418,14 @@ public final class Symbol implements Comparable {
                   return (flags & KINDMASK) == IS_PARAM;
               }
           
          +    /**
          +     * Check if this symbol is always defined, which overrides all canBeUndefined tags
          +     * @return true if always defined
          +     */
          +    public boolean isAlwaysDefined() {
          +        return isParam() || (flags & IS_ALWAYS_DEFINED) == IS_ALWAYS_DEFINED;
          +    }
          +
               /**
                * Get the range for this symbol
                * @return range for symbol
          @@ -462,7 +472,9 @@ public final class Symbol implements Comparable {
                */
               public void setCanBeUndefined() {
                   assert type.isObject() : type;
          -        if(!canBeUndefined()) {
          +        if (isAlwaysDefined()) {
          +            return;
          +        } else if (!canBeUndefined()) {
                       assert !isShared();
                       flags |= CAN_BE_UNDEFINED;
                   }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java b/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java
          index 73397b59f82..d2d80b2f5a8 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/AccessorPropertyDescriptor.java
          @@ -34,6 +34,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.PropertyDescriptor;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -63,16 +64,19 @@ public final class AccessorPropertyDescriptor extends ScriptObject implements Pr
               @Property
               public Object set;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               AccessorPropertyDescriptor() {
                   this(false, false, UNDEFINED, UNDEFINED);
               }
           
               AccessorPropertyDescriptor(final boolean configurable, final boolean enumerable, final Object get, final Object set) {
          +        super(Global.objectPrototype(), $nasgenmap$);
                   this.configurable = configurable;
                   this.enumerable   = enumerable;
                   this.get          = get;
                   this.set          = set;
          -        setProto(Global.objectPrototype());
               }
           
               @Override
          @@ -138,18 +142,16 @@ public final class AccessorPropertyDescriptor extends ScriptObject implements Pr
           
               @Override
               public PropertyDescriptor fillFrom(final ScriptObject sobj) {
          -        final boolean strict = isStrictContext();
          -
                   if (sobj.has(CONFIGURABLE)) {
                       this.configurable = JSType.toBoolean(sobj.get(CONFIGURABLE));
                   } else {
          -            delete(CONFIGURABLE, strict);
          +            delete(CONFIGURABLE, false);
                   }
           
                   if (sobj.has(ENUMERABLE)) {
                       this.enumerable = JSType.toBoolean(sobj.get(ENUMERABLE));
                   } else {
          -            delete(ENUMERABLE, strict);
          +            delete(ENUMERABLE, false);
                   }
           
                   if (sobj.has(GET)) {
          @@ -160,7 +162,7 @@ public final class AccessorPropertyDescriptor extends ScriptObject implements Pr
                           throw typeError("not.a.function", ScriptRuntime.safeToString(getter));
                       }
                   } else {
          -            delete(GET, strict);
          +            delete(GET, false);
                   }
           
                   if (sobj.has(SET)) {
          @@ -171,7 +173,7 @@ public final class AccessorPropertyDescriptor extends ScriptObject implements Pr
                           throw typeError("not.a.function", ScriptRuntime.safeToString(setter));
                       }
                   } else {
          -            delete(SET, strict);
          +            delete(SET, false);
                   }
           
                   return this;
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java b/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
          index d85b31cbae6..312d521c65e 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/ArrayBufferView.java
          @@ -29,13 +29,19 @@ import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Getter;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          +import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
          +
           @ScriptClass("ArrayBufferView")
           abstract class ArrayBufferView extends ScriptObject {
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               ArrayBufferView(final NativeArrayBuffer buffer, final int byteOffset, final int elementLength) {
                   checkConstructorArgs(buffer, byteOffset, elementLength);
                   this.setProto(getPrototype());
          @@ -305,11 +311,11 @@ abstract class ArrayBufferView extends ScriptObject {
                       dst = factory.construct(length);
                   } else if (arg0 instanceof NativeArray) {
                       // Constructor(type[] array)
          -            length = (int) (((NativeArray) arg0).getArray().length() & 0x7fff_ffff);
          +            length = lengthToInt(((NativeArray) arg0).getArray().length());
                       dst = factory.construct(length);
                   } else {
                       // Constructor(unsigned long length)
          -            length = JSType.toInt32(arg0);
          +            length = lengthToInt(JSType.toInt64(arg0));
                       return factory.construct(length);
                   }
           
          @@ -354,6 +360,13 @@ abstract class ArrayBufferView extends ScriptObject {
                   }
               }
           
          +    private static int lengthToInt(final long length) {
          +        if (length > Integer.MAX_VALUE || length < 0) {
          +            throw rangeError("inappropriate.array.buffer.length", JSType.toString(length));
          +        }
          +        return (int) (length & Integer.MAX_VALUE);
          +    }
          +
               protected static Object subarrayImpl(final Object self, final Object begin0, final Object end0) {
                   final ArrayBufferView arrayView = ((ArrayBufferView)self);
                   final int elementLength = arrayView.elementLength();
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java b/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java
          index e5f7de318ab..8ac4397712e 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/DataPropertyDescriptor.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.PropertyDescriptor;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
          @@ -61,16 +62,19 @@ public final class DataPropertyDescriptor extends ScriptObject implements Proper
               @Property
               public Object value;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               DataPropertyDescriptor() {
                   this(false, false, false, UNDEFINED);
               }
           
               DataPropertyDescriptor(final boolean configurable, final boolean enumerable, final boolean writable, final Object value) {
          +        super(Global.objectPrototype(), $nasgenmap$);
                   this.configurable = configurable;
                   this.enumerable   = enumerable;
                   this.writable     = writable;
                   this.value        = value;
          -        setProto(Global.objectPrototype());
               }
           
           
          @@ -136,29 +140,28 @@ public final class DataPropertyDescriptor extends ScriptObject implements Proper
           
               @Override
               public PropertyDescriptor fillFrom(final ScriptObject sobj) {
          -        final boolean strict = isStrictContext();
                   if (sobj.has(CONFIGURABLE)) {
                       this.configurable = JSType.toBoolean(sobj.get(CONFIGURABLE));
                   } else {
          -            delete(CONFIGURABLE, strict);
          +            delete(CONFIGURABLE, false);
                   }
           
                   if (sobj.has(ENUMERABLE)) {
                       this.enumerable = JSType.toBoolean(sobj.get(ENUMERABLE));
                   } else {
          -            delete(ENUMERABLE, strict);
          +            delete(ENUMERABLE, false);
                   }
           
                   if (sobj.has(WRITABLE)) {
                       this.writable = JSType.toBoolean(sobj.get(WRITABLE));
                   } else {
          -            delete(WRITABLE, strict);
          +            delete(WRITABLE, false);
                   }
           
                   if (sobj.has(VALUE)) {
                       this.value = sobj.get(VALUE);
                   } else {
          -            delete(VALUE, strict);
          +            delete(VALUE, false);
                   }
           
                   return this;
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java b/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java
          index 31afc307fc2..d6e9cf6058f 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java
          @@ -30,6 +30,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.PropertyDescriptor;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -51,14 +52,17 @@ public final class GenericPropertyDescriptor extends ScriptObject implements Pro
               @Property
               public Object enumerable;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               GenericPropertyDescriptor() {
                   this(false, false);
               }
           
               GenericPropertyDescriptor(final boolean configurable, final boolean enumerable) {
          +        super(Global.objectPrototype(), $nasgenmap$);
                   this.configurable = configurable;
                   this.enumerable   = enumerable;
          -        setProto(Global.objectPrototype());
               }
           
               @Override
          @@ -124,17 +128,16 @@ public final class GenericPropertyDescriptor extends ScriptObject implements Pro
           
               @Override
               public PropertyDescriptor fillFrom(final ScriptObject sobj) {
          -        final boolean strict = isStrictContext();
                   if (sobj.has(CONFIGURABLE)) {
                       this.configurable = JSType.toBoolean(sobj.get(CONFIGURABLE));
                   } else {
          -            delete(CONFIGURABLE, strict);
          +            delete(CONFIGURABLE, false);
                   }
           
                   if (sobj.has(ENUMERABLE)) {
                       this.enumerable = JSType.toBoolean(sobj.get(ENUMERABLE));
                   } else {
          -            delete(ENUMERABLE, strict);
          +            delete(ENUMERABLE, false);
                   }
           
                   return this;
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/Global.java b/nashorn/src/jdk/nashorn/internal/objects/Global.java
          index 04daa8b58cc..5644c510642 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/Global.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/Global.java
          @@ -25,9 +25,9 @@
           
           package jdk.nashorn.internal.objects;
           
          +import static jdk.nashorn.internal.lookup.Lookup.MH;
           import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
          -import static jdk.nashorn.internal.lookup.Lookup.MH;
           
           import java.io.IOException;
           import java.io.PrintWriter;
          @@ -37,11 +37,13 @@ import java.lang.ref.SoftReference;
           import java.lang.reflect.Field;
           import java.security.AccessController;
           import java.security.PrivilegedAction;
          +import java.util.Arrays;
           import java.util.LinkedHashMap;
           import java.util.List;
           import java.util.Map;
           import jdk.internal.dynalink.linker.GuardedInvocation;
           import jdk.internal.dynalink.linker.LinkRequest;
          +import jdk.nashorn.internal.lookup.MethodHandleFactory;
           import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
          @@ -51,8 +53,10 @@ import jdk.nashorn.internal.runtime.GlobalFunctions;
           import jdk.nashorn.internal.runtime.GlobalObject;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.NativeJavaPackage;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptEnvironment;
           import jdk.nashorn.internal.runtime.PropertyDescriptor;
          +import jdk.nashorn.internal.runtime.arrays.ArrayData;
           import jdk.nashorn.internal.runtime.regexp.RegExpResult;
           import jdk.nashorn.internal.runtime.Scope;
           import jdk.nashorn.internal.runtime.ScriptFunction;
          @@ -372,11 +376,14 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
               private static final MethodHandle PRINT             = findOwnMH("print",             Object.class, Object.class, Object[].class);
               private static final MethodHandle PRINTLN           = findOwnMH("println",           Object.class, Object.class, Object[].class);
               private static final MethodHandle LOAD              = findOwnMH("load",              Object.class, Object.class, Object.class);
          -    private static final MethodHandle LOADWITHNEWGLOBAL = findOwnMH("loadWithNewGlobal", Object.class, Object.class, Object.class);
          +    private static final MethodHandle LOADWITHNEWGLOBAL = findOwnMH("loadWithNewGlobal", Object.class, Object.class, Object[].class);
               private static final MethodHandle EXIT              = findOwnMH("exit",              Object.class, Object.class, Object.class);
           
               private final Context context;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               /**
                * Constructor
                *
          @@ -429,15 +436,6 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                   return instance().context;
               }
           
          -    /**
          -     * Script access check for strict mode
          -     *
          -     * @return true if strict mode enabled in {@link Global#getThisContext()}
          -     */
          -    static boolean isStrict() {
          -        return getEnv()._strict;
          -    }
          -
               // GlobalObject interface implementation
           
               @Override
          @@ -491,7 +489,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
           
               @Override
               public ScriptObject newObject() {
          -        return newEmptyInstance();
          +        return new JO(getObjectPrototype());
               }
           
               @Override
          @@ -615,14 +613,12 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
               public PropertyDescriptor newAccessorDescriptor(final Object get, final Object set, final boolean configurable, final boolean enumerable) {
                   final AccessorPropertyDescriptor desc = new AccessorPropertyDescriptor(configurable, enumerable, get == null ? UNDEFINED : get, set == null ? UNDEFINED : set);
           
          -        final boolean strict = context.getEnv()._strict;
          -
                   if (get == null) {
          -            desc.delete(PropertyDescriptor.GET, strict);
          +            desc.delete(PropertyDescriptor.GET, false);
                   }
           
                   if (set == null) {
          -            desc.delete(PropertyDescriptor.SET, strict);
          +            desc.delete(PropertyDescriptor.SET, false);
                   }
           
                   return desc;
          @@ -750,16 +746,21 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
               /**
                * Global loadWithNewGlobal implementation - Nashorn extension
                *
          -     * @param self    scope
          -     * @param source  source to load
          +     * @param self scope
          +     * @param args from plus (optional) arguments to be passed to the loaded script
                *
          -     * @return result of load (undefined)
          +     * @return result of load (may be undefined)
                *
                * @throws IOException if source could not be read
                */
          -    public static Object loadWithNewGlobal(final Object self, final Object source) throws IOException {
          +    public static Object loadWithNewGlobal(final Object self, final Object...args) throws IOException {
                   final Global global = Global.instance();
          -        return global.context.loadWithNewGlobal(source);
          +        final int length = args.length;
          +        final boolean hasArgs = 0 < length;
          +        final Object from = hasArgs ? args[0] : UNDEFINED;
          +        final Object[] arguments = hasArgs ? Arrays.copyOfRange(args, 1, length) : args;
          +
          +        return global.context.loadWithNewGlobal(from, arguments);
               }
           
               /**
          @@ -1246,7 +1247,17 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                * @return the new array
                */
               public static NativeArray allocate(final Object[] initial) {
          -        return new NativeArray(initial);
          +        ArrayData arrayData = ArrayData.allocate(initial);
          +
          +        for (int index = 0; index < initial.length; index++) {
          +            final Object value = initial[index];
          +
          +            if (value == ScriptRuntime.EMPTY) {
          +                arrayData = arrayData.delete(index);
          +            }
          +        }
          +
          +        return new NativeArray(arrayData);
               }
           
               /**
          @@ -1256,7 +1267,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                * @return the new array
                */
               public static NativeArray allocate(final double[] initial) {
          -        return new NativeArray(initial);
          +        return new NativeArray(ArrayData.allocate(initial));
               }
           
               /**
          @@ -1266,7 +1277,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                * @return the new array
                */
               public static NativeArray allocate(final long[] initial) {
          -        return new NativeArray(initial);
          +        return new NativeArray(ArrayData.allocate(initial));
               }
           
               /**
          @@ -1276,7 +1287,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                * @return the new array
                */
               public static NativeArray allocate(final int[] initial) {
          -        return new NativeArray(initial);
          +        return new NativeArray(ArrayData.allocate(initial));
               }
           
               /**
          @@ -1333,9 +1344,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                * @return New empty object.
                */
               public static ScriptObject newEmptyInstance() {
          -        final ScriptObject sobj = new JO();
          -        sobj.setProto(objectPrototype());
          -        return sobj;
          +        return Global.instance().newObject();
               }
           
               /**
          @@ -1479,7 +1488,6 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                   // Error objects
                   this.builtinError = (ScriptFunction)initConstructor("Error");
                   final ScriptObject errorProto = getErrorPrototype();
          -        final boolean strict = Global.isStrict();
           
                   // Nashorn specific accessors on Error.prototype - stack, lineNumber, columnNumber and fileName
                   final ScriptFunction getStack = ScriptFunctionImpl.makeFunction("getStack", NativeError.GET_STACK);
          @@ -1497,10 +1505,10 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
           
                   // ECMA 15.11.4.2 Error.prototype.name
                   // Error.prototype.name = "Error";
          -        errorProto.set(NativeError.NAME, "Error", strict);
          +        errorProto.set(NativeError.NAME, "Error", false);
                   // ECMA 15.11.4.3 Error.prototype.message
                   // Error.prototype.message = "";
          -        errorProto.set(NativeError.MESSAGE, "", strict);
          +        errorProto.set(NativeError.MESSAGE, "", false);
           
                   this.builtinEvalError = initErrorSubtype("EvalError", errorProto);
                   this.builtinRangeError = initErrorSubtype("RangeError", errorProto);
          @@ -1513,9 +1521,8 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
               private ScriptFunction initErrorSubtype(final String name, final ScriptObject errorProto) {
                   final ScriptObject cons = initConstructor(name);
                   final ScriptObject prototype = ScriptFunction.getPrototype(cons);
          -        final boolean strict = Global.isStrict();
          -        prototype.set(NativeError.NAME, name, strict);
          -        prototype.set(NativeError.MESSAGE, "", strict);
          +        prototype.set(NativeError.NAME, name, false);
          +        prototype.set(NativeError.MESSAGE, "", false);
                   prototype.setProto(errorProto);
                   return (ScriptFunction)cons;
               }
          @@ -1551,7 +1558,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                   addOwnProperty("echo", Attribute.NOT_ENUMERABLE, value);
           
                   // Nashorn extension: global.$OPTIONS (scripting-mode-only)
          -        final ScriptObject options = newEmptyInstance();
          +        final ScriptObject options = newObject();
                   final ScriptEnvironment scriptEnv = context.getEnv();
                   copyOptions(options, scriptEnv);
                   addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, options);
          @@ -1560,7 +1567,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                   if (System.getSecurityManager() == null) {
                       // do not fill $ENV if we have a security manager around
                       // Retrieve current state of ENV variables.
          -            final ScriptObject env = newEmptyInstance();
          +            final ScriptObject env = newObject();
                       env.putAll(System.getenv());
                       addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, env);
                   } else {
          @@ -1724,7 +1731,7 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
                   // 
                   builtinFunction.setProto(anon);
                   builtinFunction.setPrototype(anon);
          -        anon.set("constructor", builtinFunction, anon.isStrict());
          +        anon.set("constructor", builtinFunction, false);
                   anon.deleteOwnProperty(anon.getMap().findProperty("prototype"));
           
                   // now initialize Object
          @@ -1787,7 +1794,11 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
           
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          -        return MH.findStatic(MethodHandles.publicLookup(), Global.class, name, MH.type(rtype, types));
          +        try {
          +            return MethodHandles.lookup().findStatic(Global.class, name, MH.type(rtype, types));
          +        } catch (final NoSuchMethodException | IllegalAccessException e) {
          +            throw new MethodHandleFactory.LookupException(e);
          +        }
               }
           
               RegExpResult getLastRegExpResult() {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java b/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java
          index efab674b1df..456284d8cfe 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java
          @@ -25,10 +25,9 @@
           
           package jdk.nashorn.internal.objects;
           
          +import static jdk.nashorn.internal.lookup.Lookup.MH;
           import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndexNoThrow;
          -import static jdk.nashorn.internal.lookup.Lookup.MH;
           
           import java.lang.invoke.MethodHandle;
           import java.lang.invoke.MethodHandles;
          @@ -43,6 +42,7 @@ import jdk.nashorn.internal.runtime.ScriptRuntime;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
           import jdk.nashorn.internal.lookup.Lookup;
          +import jdk.nashorn.internal.lookup.MethodHandleFactory;
           
           /**
            * ECMA 10.6 Arguments Object.
          @@ -61,13 +61,13 @@ public final class NativeArguments extends ScriptObject {
               private static final MethodHandle G$CALLEE = findOwnMH("G$callee", Object.class, Object.class);
               private static final MethodHandle S$CALLEE = findOwnMH("S$callee", void.class, Object.class, Object.class);
           
          -    private static final PropertyMap nasgenmap$;
          +    private static final PropertyMap map$;
           
               static {
                   PropertyMap map = PropertyMap.newMap(NativeArguments.class);
                   map = Lookup.newProperty(map, "length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH);
                   map = Lookup.newProperty(map, "callee", Property.NOT_ENUMERABLE, G$CALLEE, S$CALLEE);
          -        nasgenmap$ = map;
          +        map$ = map;
               }
           
               private Object length;
          @@ -76,8 +76,8 @@ public final class NativeArguments extends ScriptObject {
               // This is lazily initialized - only when delete is invoked at all
               private BitSet deleted;
           
          -    NativeArguments(final Object[] arguments, final Object callee, final int numParams) {
          -        super(nasgenmap$);
          +    NativeArguments(final ScriptObject proto, final Object[] arguments, final Object callee, final int numParams) {
          +        super(proto, map$);
                   setIsArguments();
           
                   setArray(ArrayData.allocate(arguments));
          @@ -102,9 +102,6 @@ public final class NativeArguments extends ScriptObject {
                   }
                   System.arraycopy(arguments, 0, newValues, 0, Math.min(newValues.length, arguments.length));
                   this.namedArgs = ArrayData.allocate(newValues);
          -
          -        // set Object.prototype as __proto__
          -        this.setProto(Global.objectPrototype());
               }
           
               @Override
          @@ -126,109 +123,109 @@ public final class NativeArguments extends ScriptObject {
               @Override
               public void setArgument(final int key, final Object value) {
                   if (namedArgs.has(key)) {
          -            namedArgs.set(key, value, false);
          +            namedArgs = namedArgs.set(key, value, false);
                   }
               }
           
               @Override
               public int getInt(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getInt(index) : super.getInt(key);
               }
           
               @Override
               public int getInt(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getInt(index) : super.getInt(key);
               }
           
               @Override
               public int getInt(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getInt(index) : super.getInt(key);
               }
           
               @Override
               public int getInt(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getInt(index) : super.getInt(key);
               }
           
               @Override
               public long getLong(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getLong(index) : super.getLong(key);
               }
           
               @Override
               public long getLong(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getLong(index) : super.getLong(key);
               }
           
               @Override
               public long getLong(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getLong(index) : super.getLong(key);
               }
           
               @Override
               public long getLong(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getLong(index) : super.getLong(key);
               }
           
               @Override
               public double getDouble(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getDouble(index) : super.getDouble(key);
               }
           
               @Override
               public double getDouble(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getDouble(index) : super.getDouble(key);
               }
           
               @Override
               public double getDouble(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getDouble(index) : super.getDouble(key);
               }
           
               @Override
               public double getDouble(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getDouble(index) : super.getDouble(key);
               }
           
               @Override
               public Object get(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getObject(index) : super.get(key);
               }
           
               @Override
               public Object get(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getObject(index) : super.get(key);
               }
           
               @Override
               public Object get(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getObject(index) : super.get(key);
               }
           
               @Override
               public Object get(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) ? namedArgs.getObject(index) : super.get(key);
               }
           
               @Override
               public void set(final Object key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -238,7 +235,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final Object key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -248,7 +245,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final Object key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -258,7 +255,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final Object key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -268,7 +265,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final double key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -278,7 +275,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final double key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -288,7 +285,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final double key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -298,7 +295,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final double key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -308,7 +305,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final long key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -318,7 +315,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final long key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -328,7 +325,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final long key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -338,7 +335,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final long key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -348,7 +345,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final int key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -358,7 +355,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final int key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -368,7 +365,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final int key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -378,7 +375,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public void set(final int key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (isMapped(index)) {
                       namedArgs = namedArgs.set(index, value, strict);
                   } else {
          @@ -388,55 +385,55 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public boolean has(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.has(key);
               }
           
               @Override
               public boolean has(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.has(key);
               }
           
               @Override
               public boolean has(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.has(key);
               }
           
               @Override
               public boolean has(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.has(key);
               }
           
               @Override
               public boolean hasOwnProperty(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.hasOwnProperty(key);
               }
           
               @Override
               public boolean hasOwnProperty(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.hasOwnProperty(key);
               }
           
               @Override
               public boolean hasOwnProperty(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.hasOwnProperty(key);
               }
           
               @Override
               public boolean hasOwnProperty(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isMapped(index) || super.hasOwnProperty(key);
               }
           
               @Override
               public boolean delete(final int key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final boolean success = super.delete(key, strict);
                   if (success && namedArgs.has(index)) {
                       setDeleted(index);
          @@ -446,7 +443,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public boolean delete(final long key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final boolean success = super.delete(key, strict);
                   if (success && namedArgs.has(index)) {
                       setDeleted(index);
          @@ -456,7 +453,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public boolean delete(final double key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final boolean success = super.delete(key, strict);
                   if (success && namedArgs.has(index)) {
                       setDeleted(index);
          @@ -466,7 +463,7 @@ public final class NativeArguments extends ScriptObject {
           
               @Override
               public boolean delete(final Object key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final boolean success = super.delete(key, strict);
                   if (success && namedArgs.has(index)) {
                       setDeleted(index);
          @@ -480,7 +477,7 @@ public final class NativeArguments extends ScriptObject {
                */
               @Override
               public boolean defineOwnProperty(final String key, final Object propertyDesc, final boolean reject) {
          -        final int index = ArrayIndex.getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (index >= 0) {
                       final boolean allowed = super.defineOwnProperty(key, propertyDesc, false);
                       if (!allowed) {
          @@ -553,7 +550,8 @@ public final class NativeArguments extends ScriptObject {
               public static ScriptObject allocate(final Object[] arguments, final ScriptFunction callee, final int numParams) {
                   // Strict functions won't always have a callee for arguments, and will pass null instead.
                   final boolean isStrict = callee == null || callee.isStrict();
          -        return isStrict ? new NativeStrictArguments(arguments, numParams) : new NativeArguments(arguments, callee, numParams);
          +        final ScriptObject proto = Global.objectPrototype();
          +        return isStrict ? new NativeStrictArguments(proto, arguments, numParams) : new NativeArguments(proto, arguments, callee, numParams);
               }
           
               /**
          @@ -625,7 +623,11 @@ public final class NativeArguments extends ScriptObject {
               }
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          -        return MH.findStatic(MethodHandles.publicLookup(), NativeArguments.class, name, MH.type(rtype, types));
          +        try {
          +            return MethodHandles.lookup().findStatic(NativeArguments.class, name, MH.type(rtype, types));
          +        } catch (final NoSuchMethodException | IllegalAccessException e) {
          +            throw new MethodHandleFactory.LookupException(e);
          +        }
               }
           
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
          index 9736376bc9b..1af79785d9c 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
          @@ -39,6 +39,7 @@ import java.util.Collections;
           import java.util.Comparator;
           import java.util.Iterator;
           import java.util.List;
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
           import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
          @@ -49,6 +50,7 @@ import jdk.nashorn.internal.objects.annotations.SpecializedConstructor;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.PropertyDescriptor;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -81,6 +83,8 @@ public final class NativeArray extends ScriptObject {
           
               private static final InvokeByName TO_LOCALE_STRING = new InvokeByName("toLocaleString", ScriptObject.class, String.class);
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
           
               /*
                * Constructors.
          @@ -118,15 +122,15 @@ public final class NativeArray extends ScriptObject {
                       if (value == ScriptRuntime.EMPTY) {
                           arrayData = arrayData.delete(index);
                       } else {
          -                arrayData = arrayData.set(index, value, isStrictContext());
          +                arrayData = arrayData.set(index, value, false);
                       }
                   }
           
                   this.setArray(arrayData);
               }
           
          -    private NativeArray(final ArrayData arrayData) {
          -        setProto(Global.instance().getArrayPrototype());
          +    NativeArray(final ArrayData arrayData) {
          +        super(Global.instance().getArrayPrototype(), $nasgenmap$);
                   this.setArray(arrayData);
                   this.setIsArray();
               }
          @@ -158,6 +162,11 @@ public final class NativeArray extends ScriptObject {
           
                   // Step 3
                   if ("length".equals(key)) {
          +            // check for length being made non-writable
          +            if (desc.has(WRITABLE) && !desc.isWritable()) {
          +                setIsLengthNotWritable();
          +            }
          +
                       // Step 3a
                       if (!desc.has(VALUE)) {
                           return super.defineOwnProperty("length", desc, reject);
          @@ -228,7 +237,7 @@ public final class NativeArray extends ScriptObject {
                   }
           
                   // Step 4a
          -        final int index = ArrayIndex.getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (ArrayIndex.isValidArrayIndex(index)) {
                       final long longIndex = ArrayIndex.toLongIndex(index);
                       // Step 4b
          @@ -286,7 +295,8 @@ public final class NativeArray extends ScriptObject {
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object isArray(final Object self, final Object arg) {
                   return isArray(arg) || (arg == Global.instance().getArrayPrototype())
          -                || (arg instanceof NativeRegExpExecResult);
          +                || (arg instanceof NativeRegExpExecResult)
          +                || (arg instanceof ScriptObjectMirror && ((ScriptObjectMirror)arg).isArray());
               }
           
               /**
          @@ -603,7 +613,6 @@ public final class NativeArray extends ScriptObject {
               public static Object pop(final Object self) {
                   try {
                       final ScriptObject sobj = (ScriptObject)self;
          -            final boolean strict    = sobj.isStrictContext();
           
                       if (bulkable(sobj)) {
                           return sobj.getArray().pop();
          @@ -612,15 +621,15 @@ public final class NativeArray extends ScriptObject {
                       final long len = JSType.toUint32(sobj.getLength());
           
                       if (len == 0) {
          -                sobj.set("length", 0, strict);
          +                sobj.set("length", 0, true);
                           return ScriptRuntime.UNDEFINED;
                       }
           
                       final long   index   = len - 1;
                       final Object element = sobj.get(index);
           
          -            sobj.delete(index, strict);
          -            sobj.set("length", index, strict);
          +            sobj.delete(index, true);
          +            sobj.set("length", index, true);
           
                       return element;
                   } catch (final ClassCastException | NullPointerException e) {
          @@ -639,11 +648,10 @@ public final class NativeArray extends ScriptObject {
               public static Object push(final Object self, final Object... args) {
                   try {
                       final ScriptObject sobj   = (ScriptObject)self;
          -            final boolean      strict = sobj.isStrictContext();
           
                       if (bulkable(sobj)) {
                           if (sobj.getArray().length() + args.length <= JSType.MAX_UINT) {
          -                    final ArrayData newData = sobj.getArray().push(sobj.isStrictContext(), args);
          +                    final ArrayData newData = sobj.getArray().push(true, args);
                               sobj.setArray(newData);
                               return newData.length();
                           }
          @@ -652,9 +660,9 @@ public final class NativeArray extends ScriptObject {
           
                       long len = JSType.toUint32(sobj.getLength());
                       for (final Object element : args) {
          -                sobj.set(len++, element, strict);
          +                sobj.set(len++, element, true);
                       }
          -            sobj.set("length", len, strict);
          +            sobj.set("length", len, true);
           
                       return len;
                   } catch (final ClassCastException | NullPointerException e) {
          @@ -672,7 +680,6 @@ public final class NativeArray extends ScriptObject {
               public static Object reverse(final Object self) {
                   try {
                       final ScriptObject sobj   = (ScriptObject)self;
          -            final boolean      strict = sobj.isStrictContext();
                       final long         len    = JSType.toUint32(sobj.getLength());
                       final long         middle = len / 2;
           
          @@ -684,14 +691,14 @@ public final class NativeArray extends ScriptObject {
                           final boolean upperExists = sobj.has(upper);
           
                           if (lowerExists && upperExists) {
          -                    sobj.set(lower, upperValue, strict);
          -                    sobj.set(upper, lowerValue, strict);
          +                    sobj.set(lower, upperValue, true);
          +                    sobj.set(upper, lowerValue, true);
                           } else if (!lowerExists && upperExists) {
          -                    sobj.set(lower, upperValue, strict);
          -                    sobj.delete(upper, strict);
          +                    sobj.set(lower, upperValue, true);
          +                    sobj.delete(upper, true);
                           } else if (lowerExists && !upperExists) {
          -                    sobj.delete(lower, strict);
          -                    sobj.set(upper, lowerValue, strict);
          +                    sobj.delete(lower, true);
          +                    sobj.set(upper, lowerValue, true);
                           }
                       }
                       return sobj;
          @@ -717,7 +724,6 @@ public final class NativeArray extends ScriptObject {
                   }
           
                   final ScriptObject sobj   = (ScriptObject) obj;
          -        final boolean      strict = Global.isStrict();
           
                   long len = JSType.toUint32(sobj.getLength());
           
          @@ -728,15 +734,15 @@ public final class NativeArray extends ScriptObject {
                           sobj.getArray().shiftLeft(1);
                       } else {
                           for (long k = 1; k < len; k++) {
          -                    sobj.set(k - 1, sobj.get(k), strict);
          +                    sobj.set(k - 1, sobj.get(k), true);
                           }
                       }
          -            sobj.delete(--len, strict);
          +            sobj.delete(--len, true);
                   } else {
                       len = 0;
                   }
           
          -        sobj.set("length", len, strict);
          +        sobj.set("length", len, true);
           
                   return first;
               }
          @@ -770,7 +776,7 @@ public final class NativeArray extends ScriptObject {
           
                   final NativeArray copy = new NativeArray(0);
                   for (long n = 0; k < finale; n++, k++) {
          -            copy.defineOwnProperty((int) n, sobj.get(k));
          +            copy.defineOwnProperty(ArrayIndex.getArrayIndex(n), sobj.get(k));
                   }
           
                   return copy;
          @@ -833,31 +839,32 @@ public final class NativeArray extends ScriptObject {
               public static Object sort(final Object self, final Object comparefn) {
                   try {
                       final ScriptObject sobj    = (ScriptObject) self;
          -            final boolean      strict  = sobj.isStrictContext();
                       final long         len     = JSType.toUint32(sobj.getLength());
          +            ArrayData          array   = sobj.getArray();
           
                       if (len > 1) {
                           // Get only non-missing elements. Missing elements go at the end
                           // of the sorted array. So, just don't copy these to sort input.
          -
                           final ArrayList src = new ArrayList<>();
          -                for (int i = 0; i < (int)len; i++) {
          -                    if (sobj.has(i)) {
          -                        src.add(sobj.get(i));
          +                for (long i = 0; i < len; i = array.nextIndex(i)) {
          +                    if (array.has((int) i)) {
          +                        src.add(array.getObject((int) i));
                               }
                           }
           
                           final Object[] sorted = sort(src.toArray(), comparefn);
           
                           for (int i = 0; i < sorted.length; i++) {
          -                    sobj.set(i, sorted[i], strict);
          +                    array = array.set(i, sorted[i], true);
                           }
           
                           // delete missing elements - which are at the end of sorted array
          -                for (int j = sorted.length; j < (int)len; j++) {
          -                    sobj.delete(j, strict);
          +                if (sorted.length != len) {
          +                    array = array.delete(sorted.length, len - 1);
                           }
          -            }
          +
          +                sobj.setArray(array);
          +           }
           
                       return sobj;
                   } catch (final ClassCastException | NullPointerException e) {
          @@ -893,7 +900,6 @@ public final class NativeArray extends ScriptObject {
                   }
           
                   final ScriptObject sobj                = (ScriptObject)obj;
          -        final boolean      strict              = Global.isStrict();
                   final long         len                 = JSType.toUint32(sobj.getLength());
                   final long         relativeStart       = JSType.toLong(start);
           
          @@ -906,7 +912,7 @@ public final class NativeArray extends ScriptObject {
                       final long from = actualStart + k;
           
                       if (sobj.has(from)) {
          -                array.defineOwnProperty((int) k, sobj.get(from));
          +                array.defineOwnProperty(ArrayIndex.getArrayIndex(k), sobj.get(from));
                       }
                   }
           
          @@ -916,14 +922,14 @@ public final class NativeArray extends ScriptObject {
                           final long to   = k + items.length;
           
                           if (sobj.has(from)) {
          -                    sobj.set(to, sobj.get(from), strict);
          +                    sobj.set(to, sobj.get(from), true);
                           } else {
          -                    sobj.delete(to, strict);
          +                    sobj.delete(to, true);
                           }
                       }
           
                       for (long k = len; k > (len - actualDeleteCount + items.length); k--) {
          -                sobj.delete(k - 1, strict);
          +                sobj.delete(k - 1, true);
                       }
                   } else if (items.length > actualDeleteCount) {
                       for (long k = len - actualDeleteCount; k > actualStart; k--) {
          @@ -932,20 +938,20 @@ public final class NativeArray extends ScriptObject {
           
                           if (sobj.has(from)) {
                               final Object fromValue = sobj.get(from);
          -                    sobj.set(to, fromValue, strict);
          +                    sobj.set(to, fromValue, true);
                           } else {
          -                    sobj.delete(to, strict);
          +                    sobj.delete(to, true);
                           }
                       }
                   }
           
                   long k = actualStart;
                   for (int i = 0; i < items.length; i++, k++) {
          -            sobj.set(k, items[i], strict);
          +            sobj.set(k, items[i], true);
                   }
           
                   final long newLength = len - actualDeleteCount + items.length;
          -        sobj.set("length", newLength, strict);
          +        sobj.set("length", newLength, true);
           
                   return array;
               }
          @@ -966,7 +972,6 @@ public final class NativeArray extends ScriptObject {
                   }
           
                   final ScriptObject sobj   = (ScriptObject)obj;
          -        final boolean      strict = Global.isStrict();
                   final long         len    = JSType.toUint32(sobj.getLength());
           
                   if (items == null) {
          @@ -977,7 +982,7 @@ public final class NativeArray extends ScriptObject {
                       sobj.getArray().shiftRight(items.length);
           
                       for (int j = 0; j < items.length; j++) {
          -                sobj.setArray(sobj.getArray().set(j, items[j], sobj.isStrictContext()));
          +                sobj.setArray(sobj.getArray().set(j, items[j], true));
                       }
                   } else {
                       for (long k = len; k > 0; k--) {
          @@ -986,19 +991,19 @@ public final class NativeArray extends ScriptObject {
           
                           if (sobj.has(from)) {
                               final Object fromValue = sobj.get(from);
          -                    sobj.set(to, fromValue, strict);
          +                    sobj.set(to, fromValue, true);
                           } else {
          -                    sobj.delete(to, strict);
          +                    sobj.delete(to, true);
                           }
                       }
           
                       for (int j = 0; j < items.length; j++) {
          -                sobj.set(j, items[j], strict);
          +                 sobj.set(j, items[j], true);
                       }
                   }
           
                   final long newLength = len + items.length;
          -        sobj.set("length", newLength, strict);
          +        sobj.set("length", newLength, true);
           
                   return newLength;
               }
          @@ -1143,7 +1148,7 @@ public final class NativeArray extends ScriptObject {
                       @Override
                       protected boolean forEach(final Object val, final long i) throws Throwable {
                           final Object r = MAP_CALLBACK_INVOKER.invokeExact(callbackfn, thisArg, val, i, self);
          -                result.defineOwnProperty((int)index, r);
          +                result.defineOwnProperty(ArrayIndex.getArrayIndex(index), r);
                           return true;
                       }
           
          @@ -1172,7 +1177,7 @@ public final class NativeArray extends ScriptObject {
                       @Override
                       protected boolean forEach(final Object val, final long i) throws Throwable {
                           if ((boolean)FILTER_CALLBACK_INVOKER.invokeExact(callbackfn, thisArg, val, i, self)) {
          -                    result.defineOwnProperty((int)(to++), val);
          +                    result.defineOwnProperty(ArrayIndex.getArrayIndex(to++), val);
                           }
                           return true;
                       }
          @@ -1241,7 +1246,7 @@ public final class NativeArray extends ScriptObject {
                * @return true if optimizable
                */
               private static boolean bulkable(final ScriptObject self) {
          -        return self.isArray() && !hasInheritedArrayEntries(self);
          +        return self.isArray() && !hasInheritedArrayEntries(self) && !self.isLengthNotWritable();
               }
           
               private static boolean hasInheritedArrayEntries(final ScriptObject self) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java b/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java
          index 542b2aebb46..f122bfca8f5 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArrayBuffer.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Getter;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
           
          @@ -39,6 +40,9 @@ import jdk.nashorn.internal.runtime.ScriptRuntime;
           final class NativeArrayBuffer extends ScriptObject {
               private final byte[] buffer;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               @Constructor(arity = 1)
               public static Object constructor(final boolean newObj, final Object self, final Object... args) {
                   if (args.length == 0) {
          @@ -49,8 +53,8 @@ final class NativeArrayBuffer extends ScriptObject {
               }
           
               protected NativeArrayBuffer(final byte[] byteArray) {
          +        super(Global.instance().getArrayBufferPrototype(), $nasgenmap$);
                   this.buffer = byteArray;
          -        this.setProto(Global.instance().getArrayBufferPrototype());
               }
           
               protected NativeArrayBuffer(final int byteLength) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java b/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java
          index a63f0d48287..bfbbb3d73d7 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeBoolean.java
          @@ -37,6 +37,7 @@ import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
           import jdk.nashorn.internal.lookup.MethodHandleFactory;
          @@ -52,13 +53,16 @@ public final class NativeBoolean extends ScriptObject {
           
               final static MethodHandle WRAPFILTER = findWrapFilter();
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeBoolean(final boolean value) {
                   this(value, Global.instance().getBooleanPrototype());
               }
           
               private NativeBoolean(final boolean value, final ScriptObject proto) {
          +        super(proto, $nasgenmap$);
                   this.value = value;
          -        this.setProto(proto);
               }
           
               @Override
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
          index ef01d74b252..3a7d0ef3535 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDate.java
          @@ -42,6 +42,7 @@ import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.parser.DateParser;
           import jdk.nashorn.internal.runtime.ConsString;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptEnvironment;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
          @@ -100,16 +101,19 @@ public final class NativeDate extends ScriptObject {
               private double time;
               private final TimeZone timezone;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeDate() {
                   this(System.currentTimeMillis());
               }
           
               NativeDate(final double time) {
          +        super(Global.instance().getDatePrototype(), $nasgenmap$);
                   final ScriptEnvironment env = Global.getEnv();
           
                   this.time = time;
                   this.timezone = env._timezone;
          -        this.setProto(Global.instance().getDatePrototype());
               }
           
               @Override
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java
          index 337f2e3d5b1..afcf7b2bfc2 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java
          @@ -47,8 +47,12 @@ import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
            */
           @ScriptClass("Debug")
           public final class NativeDebug extends ScriptObject {
          +
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeDebug() {
          -        this.setProto(Global.objectPrototype());
          +        super(Global.objectPrototype(), $nasgenmap$);
               }
           
               @Override
          @@ -187,7 +191,7 @@ public final class NativeDebug extends ScriptObject {
                   out.println("Scope count " + ScriptObject.getScopeCount());
                   out.println("ScriptObject listeners added " + PropertyListenerManager.getListenersAdded());
                   out.println("ScriptObject listeners removed " + PropertyListenerManager.getListenersRemoved());
          -        out.println("ScriptFunction count " + ScriptObject.getCount());
          +        out.println("ScriptFunction constructor calls " + ScriptFunction.getConstructorCount());
                   out.println("ScriptFunction invokes " + ScriptFunction.getInvokes());
                   out.println("ScriptFunction allocations " + ScriptFunction.getAllocations());
                   out.println("PropertyMap count " + PropertyMap.getCount());
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeError.java
          index 5473c8ef5c7..07f5d65aa7b 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeError.java
          @@ -30,18 +30,17 @@ import static jdk.nashorn.internal.lookup.Lookup.MH;
           
           import java.lang.invoke.MethodHandle;
           import java.lang.invoke.MethodHandles;
          -import java.util.ArrayList;
          -import java.util.List;
          -import jdk.nashorn.internal.codegen.CompilerConstants;
          +import jdk.nashorn.api.scripting.NashornException;
          +import jdk.nashorn.internal.lookup.MethodHandleFactory;
           import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          -import jdk.nashorn.internal.runtime.ECMAErrors;
           import jdk.nashorn.internal.runtime.ECMAException;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
           
          @@ -85,12 +84,15 @@ public final class NativeError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeError(final Object msg) {
          -        this.setProto(Global.instance().getErrorPrototype());
          +        super(Global.instance().getErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          @@ -113,6 +115,21 @@ public final class NativeError extends ScriptObject {
                   return new NativeError(msg);
               }
           
          +    /**
          +     * Nashorn extension: Error.captureStackTrace. Capture stack trace at the point of call into the Error object provided.
          +     *
          +     * @param self self reference
          +     * @return undefined
          +     */
          +    @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
          +    public static Object captureStackTrace(final Object self, final Object errorObj) {
          +        Global.checkObject(errorObj);
          +        final ScriptObject sobj = (ScriptObject)errorObj;
          +        final ECMAException exp = new ECMAException(sobj, null);
          +        sobj.set("stack", getScriptStackString(sobj, exp), false);
          +        return UNDEFINED;
          +    }
          +
               /**
                * Nashorn extension: Error.dumpStack
                * dumps the stack of the current thread.
          @@ -142,6 +159,30 @@ public final class NativeError extends ScriptObject {
                   return ECMAException.printStackTrace((ScriptObject)self);
               }
           
          +    /**
          +     * Nashorn extension: Error.prototype.getStackTrace()
          +     * "stack" property is an array typed value containing {@link StackTraceElement}
          +     * objects of JavaScript stack frames.
          +     *
          +     * @param self  self reference
          +     *
          +     * @return      stack trace as a script array.
          +     */
          +    @Function(attributes = Attribute.NOT_ENUMERABLE)
          +    public static Object getStackTrace(final Object self) {
          +        Global.checkObject(self);
          +        final ScriptObject sobj = (ScriptObject)self;
          +        final Object exception = ECMAException.getException(sobj);
          +        Object[] res;
          +        if (exception instanceof Throwable) {
          +            res = NashornException.getScriptFrames((Throwable)exception);
          +        } else {
          +            res = ScriptRuntime.EMPTY_ARRAY;
          +        }
          +
          +        return new NativeArray(res);
          +    }
          +
               /**
                * Nashorn extension: Error.prototype.lineNumber
                *
          @@ -166,7 +207,7 @@ public final class NativeError extends ScriptObject {
               public static Object setLineNumber(final Object self, final Object value) {
                   Global.checkObject(self);
                   final ScriptObject sobj = (ScriptObject)self;
          -        sobj.set(LINENUMBER, value, Global.isStrict());
          +        sobj.set(LINENUMBER, value, false);
                   return value;
               }
           
          @@ -194,7 +235,7 @@ public final class NativeError extends ScriptObject {
               public static Object setColumnNumber(final Object self, final Object value) {
                   Global.checkObject(self);
                   final ScriptObject sobj = (ScriptObject)self;
          -        sobj.set(COLUMNNUMBER, value, Global.isStrict());
          +        sobj.set(COLUMNNUMBER, value, false);
                   return value;
               }
           
          @@ -222,14 +263,14 @@ public final class NativeError extends ScriptObject {
               public static Object setFileName(final Object self, final Object value) {
                   Global.checkObject(self);
                   final ScriptObject sobj = (ScriptObject)self;
          -        sobj.set(FILENAME, value, Global.isStrict());
          +        sobj.set(FILENAME, value, false);
                   return value;
               }
           
               /**
                * Nashorn extension: Error.prototype.stack
          -     * "stack" property is an array typed value containing {@link StackTraceElement}
          -     * objects of JavaScript stack frames.
          +     * "stack" property is a string typed value containing JavaScript stack frames.
          +     * Each frame information is separated bv "\n" character.
                *
                * @param self  self reference
                *
          @@ -243,27 +284,11 @@ public final class NativeError extends ScriptObject {
                   }
           
                   final Object exception = ECMAException.getException(sobj);
          -        Object[] res;
                   if (exception instanceof Throwable) {
          -            final StackTraceElement[] frames = ((Throwable)exception).getStackTrace();
          -            final List filtered = new ArrayList<>();
          -            for (final StackTraceElement st : frames) {
          -                if (ECMAErrors.isScriptFrame(st)) {
          -                    final String className = "<" + st.getFileName() + ">";
          -                    String methodName = st.getMethodName();
          -                    if (methodName.equals(CompilerConstants.RUN_SCRIPT.symbolName())) {
          -                        methodName = "";
          -                    }
          -                    filtered.add(new StackTraceElement(className, methodName,
          -                            st.getFileName(), st.getLineNumber()));
          -                }
          -            }
          -            res = filtered.toArray();
          +            return getScriptStackString(sobj, (Throwable)exception);
                   } else {
          -            res = ScriptRuntime.EMPTY_ARRAY;
          +            return "";
                   }
          -
          -        return new NativeArray(res);
               }
           
               /**
          @@ -278,7 +303,7 @@ public final class NativeError extends ScriptObject {
               public static Object setStack(final Object self, final Object value) {
                   Global.checkObject(self);
                   final ScriptObject sobj = (ScriptObject)self;
          -        sobj.set(STACK, value, Global.isStrict());
          +        sobj.set(STACK, value, false);
                   return value;
               }
           
          @@ -328,6 +353,14 @@ public final class NativeError extends ScriptObject {
               }
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          -        return MH.findStatic(MethodHandles.publicLookup(), NativeError.class, name, MH.type(rtype, types));
          +        try {
          +            return MethodHandles.lookup().findStatic(NativeError.class, name, MH.type(rtype, types));
          +        } catch (final NoSuchMethodException | IllegalAccessException e) {
          +            throw new MethodHandleFactory.LookupException(e);
          +        }
          +    }
          +
          +    private static String getScriptStackString(final ScriptObject sobj, final Throwable exp) {
          +        return JSType.toString(sobj) + "\n" + NashornException.getScriptStackString(exp);
               }
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java
          index a33fb0db351..2b88f7dc90a 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeEvalError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -52,14 +53,17 @@ public final class NativeEvalError extends ScriptObject {
           
               /** ECMA 15.1.1.1 message property */
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
          -
               public Object message;
          +
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeEvalError(final Object msg) {
          -        this.setProto(Global.instance().getEvalErrorPrototype());
          +        super(Global.instance().getEvalErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java
          index d59a4d6fdb9..beb7d50e542 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat32Array.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -46,6 +47,9 @@ public final class NativeFloat32Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 4;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java
          index 0f10a867d81..3451e31527c 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFloat64Array.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -46,6 +47,9 @@ public final class NativeFloat64Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 8;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java b/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java
          index 528b120a853..7df1b521027 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeFunction.java
          @@ -29,6 +29,7 @@ import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
           
           import java.util.List;
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
           import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
          @@ -37,6 +38,7 @@ import jdk.nashorn.internal.parser.Parser;
           import jdk.nashorn.internal.runtime.Context;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.ParserException;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -51,6 +53,10 @@ import jdk.nashorn.internal.runtime.Source;
            */
           @ScriptClass("Function")
           public final class NativeFunction {
          +
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               // do *not* create me!
               private NativeFunction() {
               }
          @@ -102,6 +108,16 @@ public final class NativeFunction {
                       list.toArray(args = new Object[list.size()]);
                   } else if (array == null || array == UNDEFINED) {
                       args = ScriptRuntime.EMPTY_ARRAY;
          +        } else if (array instanceof ScriptObjectMirror) {
          +            // look for array-like ScriptObjectMirror object
          +            final ScriptObjectMirror mirror = (ScriptObjectMirror)array;
          +            final Object       len  = mirror.containsKey("length")? mirror.getMember("length") : Integer.valueOf(0);
          +            final int n = (int)JSType.toUint32(len);
          +
          +            args = new Object[n];
          +            for (int i = 0; i < args.length; i++) {
          +                args[i] = mirror.containsKey(i)? mirror.getSlot(i) : UNDEFINED;
          +            }
                   } else {
                       throw typeError("function.apply.expects.array");
                   }
          @@ -216,7 +232,7 @@ public final class NativeFunction {
           
                   final Global global = Global.instance();
           
          -        return Global.directEval(global, sb.toString(), global, "", Global.isStrict());
          +        return Global.directEval(global, sb.toString(), global, "", global.isStrictContext());
               }
           
               private static void checkFunctionParameters(final String params) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java
          index d6c5349efd5..d05c69d70a5 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt16Array.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -39,6 +40,10 @@ import jdk.nashorn.internal.runtime.arrays.ArrayData;
            */
           @ScriptClass("Int16Array")
           public final class NativeInt16Array extends ArrayBufferView {
          +
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               /**
                * The size in bytes of each element in the array.
                */
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java
          index a814eb61de1..596b935cb7d 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt32Array.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -45,6 +46,9 @@ public final class NativeInt32Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 4;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java
          index ec43bfc8e18..f1a9b7f7100 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeInt8Array.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -45,6 +46,9 @@ public final class NativeInt8Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 1;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java b/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java
          index 153db769f9b..5db4a1fddac 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSAdapter.java
          @@ -42,6 +42,7 @@ import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.FindProperty;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -142,9 +143,12 @@ public final class NativeJSAdapter extends ScriptObject {
           
               private static final MethodHandle IS_JSADAPTOR = findOwnMH("isJSAdaptor", boolean.class, Object.class, Object.class, MethodHandle.class, Object.class, ScriptFunction.class);
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeJSAdapter(final ScriptObject proto, final Object overrides, final ScriptObject adaptee) {
          +        super(proto, $nasgenmap$);
                   this.adaptee = wrapAdaptee(adaptee);
          -        this.setProto(proto);
                   if (overrides instanceof ScriptObject) {
                       this.overrides = true;
                       final ScriptObject sobj = (ScriptObject)overrides;
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java b/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java
          index b3d6d873264..3270bc84cd6 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJSON.java
          @@ -42,6 +42,7 @@ import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.ConsString;
           import jdk.nashorn.internal.runtime.JSONFunctions;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator;
          @@ -58,9 +59,11 @@ public final class NativeJSON extends ScriptObject {
               private static final MethodHandle REPLACER_INVOKER = Bootstrap.createDynamicInvoker("dyn:call", Object.class,
                       ScriptFunction.class, ScriptObject.class, Object.class, Object.class);
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
           
               NativeJSON() {
          -        this.setProto(Global.objectPrototype());
          +        super(Global.objectPrototype(), $nasgenmap$);
               }
           
               /**
          @@ -158,7 +161,7 @@ public final class NativeJSON extends ScriptObject {
                   state.gap = gap;
           
                   final ScriptObject wrapper = Global.newEmptyInstance();
          -        wrapper.set("", value, Global.isStrict());
          +        wrapper.set("", value, false);
           
                   return str("", wrapper, state);
               }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java b/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java
          index 207be97938e..7a9ec38fe87 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJava.java
          @@ -40,6 +40,7 @@ import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.ListAdapter;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
           
          @@ -52,6 +53,9 @@ import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
           @ScriptClass("Java")
           public final class NativeJava {
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private NativeJava() {
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java b/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java
          index 88d0e6a3473..9d4c15ac4d1 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeJavaImporter.java
          @@ -34,6 +34,7 @@ import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.runtime.NativeJavaPackage;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -55,9 +56,12 @@ import jdk.nashorn.internal.runtime.ScriptObject;
           public final class NativeJavaImporter extends ScriptObject {
               private final Object[] args;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeJavaImporter(final Object[] args) {
          +        super(Global.instance().getJavaImporterPrototype(), $nasgenmap$);
                   this.args = args;
          -        this.setProto(Global.instance().getJavaImporterPrototype());
               }
           
               @Override
          @@ -121,7 +125,7 @@ public final class NativeJavaImporter extends ScriptObject {
                   final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
                   final Object value = createProperty(name);
                   if(value != null) {
          -            set(name, value, isStrictContext());
          +            set(name, value, false);
                       return true;
                   }
                   return false;
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java b/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java
          index 9b1f226ed2c..2b093548315 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeMath.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -41,8 +42,11 @@ import jdk.nashorn.internal.runtime.ScriptObject;
           @ScriptClass("Math")
           public final class NativeMath extends ScriptObject {
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeMath() {
          -        this.setProto(Global.objectPrototype());
          +        super(Global.objectPrototype(), $nasgenmap$);
               }
           
               /** ECMA 15.8.1.1 - E, always a double constant. Not writable or configurable */
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java b/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java
          index edb83f06d18..94a7cca1a4d 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeNumber.java
          @@ -45,6 +45,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
           import jdk.nashorn.internal.lookup.MethodHandleFactory;
          @@ -83,15 +84,18 @@ public final class NativeNumber extends ScriptObject {
               private final boolean isInt;
               private final boolean isLong;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeNumber(final double value) {
                   this(value, Global.instance().getNumberPrototype());
               }
           
               private NativeNumber(final double value, final ScriptObject proto) {
          +        super(proto, $nasgenmap$);
                   this.value = value;
                   this.isInt  = isRepresentableAsInt(value);
                   this.isLong = isRepresentableAsLong(value);
          -        this.setProto(proto);
               }
           
               @Override
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
          index 5162d89b391..1034034506b 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeObject.java
          @@ -28,12 +28,15 @@ package jdk.nashorn.internal.objects;
           import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
           
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
           import jdk.nashorn.internal.objects.annotations.Attribute;
           import jdk.nashorn.internal.objects.annotations.Constructor;
           import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.ECMAException;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -51,9 +54,16 @@ import jdk.nashorn.internal.runtime.linker.InvokeByName;
           public final class NativeObject {
               private static final InvokeByName TO_STRING = new InvokeByName("toString", ScriptObject.class);
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private NativeObject() {
               }
           
          +    private static ECMAException notAnObject(final Object obj) {
          +        return typeError("not.an.object", ScriptRuntime.safeToString(obj));
          +    }
          +
               /**
                * ECMA 15.2.3.2 Object.getPrototypeOf ( O )
                *
          @@ -63,9 +73,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object getPrototypeOf(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -
          -        return ((ScriptObject)obj).getProto();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).getProto();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).getProto();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -78,12 +92,19 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object getOwnPropertyDescriptor(final Object self, final Object obj, final Object prop) {
          -        Global.checkObject(obj);
          +        if (obj instanceof ScriptObject) {
          +            final String       key  = JSType.toString(prop);
          +            final ScriptObject sobj = (ScriptObject)obj;
           
          -        final String       key  = JSType.toString(prop);
          -        final ScriptObject sobj = (ScriptObject)obj;
          +            return sobj.getOwnPropertyDescriptor(key);
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            final String       key  = JSType.toString(prop);
          +            final ScriptObjectMirror sobjMirror = (ScriptObjectMirror)obj;
           
          -        return sobj.getOwnPropertyDescriptor(key);
          +            return sobjMirror.getOwnPropertyDescriptor(key);
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -95,9 +116,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object getOwnPropertyNames(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -
          -        return new NativeArray(((ScriptObject)obj).getOwnKeys(true));
          +        if (obj instanceof ScriptObject) {
          +            return new NativeArray(((ScriptObject)obj).getOwnKeys(true));
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return new NativeArray(((ScriptObjectMirror)obj).getOwnKeys(true));
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -175,8 +200,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object seal(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).seal();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).seal();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).seal();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
           
          @@ -189,8 +219,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object freeze(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).freeze();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).freeze();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).freeze();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -202,8 +237,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object preventExtensions(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).preventExtensions();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).preventExtensions();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).preventExtensions();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -215,8 +255,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object isSealed(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).isSealed();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).isSealed();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).isSealed();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -228,8 +273,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object isFrozen(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).isFrozen();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).isFrozen();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).isFrozen();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -241,8 +291,13 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object isExtensible(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        return ((ScriptObject)obj).isExtensible();
          +        if (obj instanceof ScriptObject) {
          +            return ((ScriptObject)obj).isExtensible();
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            return ((ScriptObjectMirror)obj).isExtensible();
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          @@ -254,9 +309,15 @@ public final class NativeObject {
                */
               @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
               public static Object keys(final Object self, final Object obj) {
          -        Global.checkObject(obj);
          -        final ScriptObject sobj = (ScriptObject)obj;
          -        return new NativeArray(sobj.getOwnKeys(false));
          +        if (obj instanceof ScriptObject) {
          +            final ScriptObject sobj = (ScriptObject)obj;
          +            return new NativeArray(sobj.getOwnKeys(false));
          +        } else if (obj instanceof ScriptObjectMirror) {
          +            final ScriptObjectMirror sobjMirror = (ScriptObjectMirror)obj;
          +            return new NativeArray(sobjMirror.getOwnKeys(false));
          +        } else {
          +            throw notAnObject(obj);
          +        }
               }
           
               /**
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java
          index dcdd517edd2..faf68f871f7 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRangeError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -54,12 +55,15 @@ public final class NativeRangeError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeRangeError(final Object msg) {
          -        setProto(Global.instance().getRangeErrorPrototype());
          +        super(Global.instance().getRangeErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java
          index a3ae89e8013..954eed641f5 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeReferenceError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -54,12 +55,15 @@ public final class NativeReferenceError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeReferenceError(final Object msg) {
          -        this.setProto(Global.instance().getReferenceErrorPrototype());
          +        super(Global.instance().getReferenceErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java
          index 8b469bc1ced..bec8b37db0a 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java
          @@ -43,6 +43,7 @@ import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.BitVector;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.ParserException;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.regexp.RegExp;
           import jdk.nashorn.internal.runtime.regexp.RegExpFactory;
           import jdk.nashorn.internal.runtime.regexp.RegExpResult;
          @@ -66,6 +67,9 @@ public final class NativeRegExp extends ScriptObject {
               // Reference to global object needed to support static RegExp properties
               private Global globalObject;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeRegExp(final String input, final String flagString) {
                   try {
                       this.regexp = RegExpFactory.create(input, flagString);
          @@ -641,26 +645,19 @@ public final class NativeRegExp extends ScriptObject {
                       return string;
                   }
           
          -        /*
          -         * $$ -> $
          -         * $& -> the matched substring
          -         * $` -> the portion of string that preceeds matched substring
          -         * $' -> the portion of string that follows the matched substring
          -         * $n -> the nth capture, where n is [1-9] and $n is NOT followed by a decimal digit
          -         * $nn -> the nnth capture, where nn is a two digit decimal number [01-99].
          -         */
          -        String replace = replacement;
          -
                   if (!regexp.isGlobal()) {
                       if (!matcher.search(0)) {
                           return string;
                       }
           
                       final StringBuilder sb = new StringBuilder();
          +            sb.append(string, 0, matcher.start());
          +
                       if (function != null) {
          -                replace = callReplaceValue(function, matcher, string);
          +                sb.append(callReplaceValue(function, matcher, string));
          +            } else {
          +                appendReplacement(matcher, string, replacement, sb);
                       }
          -            appendReplacement(matcher, string, replace, sb, 0);
                       sb.append(string, matcher.end(), string.length());
                       return sb.toString();
                   }
          @@ -676,12 +673,13 @@ public final class NativeRegExp extends ScriptObject {
                   final StringBuilder sb = new StringBuilder();
           
                   do {
          +            sb.append(string, thisIndex, matcher.start());
                       if (function != null) {
          -                replace = callReplaceValue(function, matcher, string);
          +                sb.append(callReplaceValue(function, matcher, string));
          +            } else {
          +                appendReplacement(matcher, string, replacement, sb);
                       }
           
          -            appendReplacement(matcher, string, replace, sb, thisIndex);
          -
                       // ECMA 15.5.4.10 String.prototype.match(regexp)
                       thisIndex = matcher.end();
                       if (thisIndex == previousLastIndex) {
          @@ -697,10 +695,19 @@ public final class NativeRegExp extends ScriptObject {
                   return sb.toString();
               }
           
          -    private void appendReplacement(final RegExpMatcher matcher, final String text, final String replacement, final StringBuilder sb, final int lastAppendPosition) {
          -        // Process substitution string to replace group references with groups
          +    private void appendReplacement(final RegExpMatcher matcher, final String text, final String replacement, final StringBuilder sb) {
          +        /*
          +         * Process substitution patterns:
          +         *
          +         * $$ -> $
          +         * $& -> the matched substring
          +         * $` -> the portion of string that preceeds matched substring
          +         * $' -> the portion of string that follows the matched substring
          +         * $n -> the nth capture, where n is [1-9] and $n is NOT followed by a decimal digit
          +         * $nn -> the nnth capture, where nn is a two digit decimal number [01-99].
          +         */
          +
                   int cursor = 0;
          -        final StringBuilder result = new StringBuilder();
                   Object[] groups = null;
           
                   while (cursor < replacement.length()) {
          @@ -732,37 +739,33 @@ public final class NativeRegExp extends ScriptObject {
                                   }
                                   // Append group if matched.
                                   if (groups[refNum] != UNDEFINED) {
          -                            result.append((String) groups[refNum]);
          +                            sb.append((String) groups[refNum]);
                                   }
                               } else { // $0. ignore.
                                   assert refNum == 0;
          -                        result.append("$0");
          +                        sb.append("$0");
                               }
                           } else if (nextChar == '$') {
          -                    result.append('$');
          +                    sb.append('$');
                               cursor++;
                           } else if (nextChar == '&') {
          -                    result.append(matcher.group());
          +                    sb.append(matcher.group());
                               cursor++;
                           } else if (nextChar == '`') {
          -                    result.append(text.substring(0, matcher.start()));
          +                    sb.append(text, 0, matcher.start());
                               cursor++;
                           } else if (nextChar == '\'') {
          -                    result.append(text.substring(matcher.end()));
          +                    sb.append(text, matcher.end(), text.length());
                               cursor++;
                           } else {
                               // unknown substitution or $n with n>m. skip.
          -                    result.append('$');
          +                    sb.append('$');
                           }
                       } else {
          -                result.append(nextChar);
          +                sb.append(nextChar);
                           cursor++;
                       }
                   }
          -        // Append the intervening text
          -        sb.append(text, lastAppendPosition, matcher.start());
          -        // Append the match substitution
          -        sb.append(result);
               }
           
               private String callReplaceValue(final ScriptFunction function, final RegExpMatcher matcher, final String string) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java
          index a88f69c74e0..667205528ed 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExpExecResult.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Setter;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.regexp.RegExpResult;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
          @@ -49,14 +50,22 @@ public final class NativeRegExpExecResult extends ScriptObject {
               @Property
               public Object input;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeRegExpExecResult(final RegExpResult result) {
          -        setProto(Global.instance().getArrayPrototype());
          +        super(Global.instance().getArrayPrototype(), $nasgenmap$);
                   setIsArray();
                   this.setArray(ArrayData.allocate(result.getGroups().clone()));
                   this.index = result.getIndex();
                   this.input = result.getInput();
               }
           
          +    @Override
          +    public String getClassName() {
          +        return "Array";
          +    }
          +
               /**
                * Length getter
                * @param self self reference
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java
          index a643c190c5c..cf434f9fce4 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeStrictArguments.java
          @@ -37,6 +37,7 @@ import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           import jdk.nashorn.internal.lookup.Lookup;
          +import jdk.nashorn.internal.lookup.MethodHandleFactory;
           
           /**
            * ECMA 10.6 Arguments Object.
          @@ -50,22 +51,24 @@ public final class NativeStrictArguments extends ScriptObject {
               private static final MethodHandle S$LENGTH = findOwnMH("S$length", void.class, Object.class, Object.class);
           
               // property map for strict mode arguments object
          -    private static final PropertyMap nasgenmap$;
          +    private static final PropertyMap map$;
           
               static {
                   PropertyMap map = PropertyMap.newMap(NativeStrictArguments.class);
                   map = Lookup.newProperty(map, "length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH);
                   // In strict mode, the caller and callee properties should throw TypeError
          -        map = ScriptFunctionImpl.newThrowerProperty(map, "caller");
          -        map = ScriptFunctionImpl.newThrowerProperty(map, "callee");
          -        nasgenmap$ = map;
          +        // Need to add properties directly to map since slots are assigned speculatively by newUserAccessors.
          +        final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE;
          +        map = map.addProperty(map.newUserAccessors("caller", flags));
          +        map = map.addProperty(map.newUserAccessors("callee", flags));
          +        map$ = map;
               }
           
               private Object   length;
               private final Object[] namedArgs;
           
          -    NativeStrictArguments(final Object[] values, final int numParams) {
          -        super(nasgenmap$);
          +    NativeStrictArguments(final ScriptObject proto, final Object[] values, final int numParams) {
          +        super(proto, map$);
                   setIsArguments();
           
                   final ScriptFunction func = ScriptFunctionImpl.getTypeErrorThrower();
          @@ -83,8 +86,6 @@ public final class NativeStrictArguments extends ScriptObject {
                       Arrays.fill(namedArgs, UNDEFINED);
                   }
                   System.arraycopy(values, 0, namedArgs, 0, Math.min(namedArgs.length, values.length));
          -
          -        this.setProto(Global.objectPrototype());
               }
           
               @Override
          @@ -142,6 +143,10 @@ public final class NativeStrictArguments extends ScriptObject {
               }
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          -        return MH.findStatic(MethodHandles.publicLookup(), NativeStrictArguments.class, name, MH.type(rtype, types));
          +        try {
          +            return MethodHandles.lookup().findStatic(NativeStrictArguments.class, name, MH.type(rtype, types));
          +        } catch (final NoSuchMethodException | IllegalAccessException e) {
          +            throw new MethodHandleFactory.LookupException(e);
          +        }
               }
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeString.java b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java
          index df4aa1bff38..a5b9ea83e54 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeString.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeString.java
          @@ -29,7 +29,6 @@ import static jdk.nashorn.internal.lookup.Lookup.MH;
           import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           import static jdk.nashorn.internal.runtime.JSType.isRepresentableAsInt;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndexNoThrow;
           
           import java.lang.invoke.MethodHandle;
           import java.lang.invoke.MethodHandles;
          @@ -53,6 +52,7 @@ import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.ConsString;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -71,14 +71,17 @@ public final class NativeString extends ScriptObject {
           
               static final MethodHandle WRAPFILTER = findWrapFilter();
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeString(final CharSequence value) {
                   this(value, Global.instance().getStringPrototype());
               }
           
               private NativeString(final CharSequence value, final ScriptObject proto) {
          +        super(proto, $nasgenmap$);
                   assert value instanceof String || value instanceof ConsString;
                   this.value = value;
          -        this.setProto(proto);
               }
           
               @Override
          @@ -156,7 +159,7 @@ public final class NativeString extends ScriptObject {
               @SuppressWarnings("unused")
               private static Object get(final Object self, final Object key) {
                   final CharSequence cs = JSType.toCharSequence(self);
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (index >= 0 && index < cs.length()) {
                       return String.valueOf(cs.charAt(index));
                   }
          @@ -191,7 +194,7 @@ public final class NativeString extends ScriptObject {
               // String characters can be accessed with array-like indexing..
               @Override
               public Object get(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (index >= 0 && index < value.length()) {
                       return String.valueOf(value.charAt(index));
                   }
          @@ -284,7 +287,7 @@ public final class NativeString extends ScriptObject {
           
               @Override
               public boolean has(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.has(key);
               }
           
          @@ -295,19 +298,19 @@ public final class NativeString extends ScriptObject {
           
               @Override
               public boolean has(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.has(key);
               }
           
               @Override
               public boolean has(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.has(key);
               }
           
               @Override
               public boolean hasOwnProperty(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.hasOwnProperty(key);
               }
           
          @@ -318,13 +321,13 @@ public final class NativeString extends ScriptObject {
           
               @Override
               public boolean hasOwnProperty(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.hasOwnProperty(key);
               }
           
               @Override
               public boolean hasOwnProperty(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return isValid(index) || super.hasOwnProperty(key);
               }
           
          @@ -335,19 +338,19 @@ public final class NativeString extends ScriptObject {
           
               @Override
               public boolean delete(final long key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return checkDeleteIndex(index, strict)? false : super.delete(key, strict);
               }
           
               @Override
               public boolean delete(final double key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return checkDeleteIndex(index, strict)? false : super.delete(key, strict);
               }
           
               @Override
               public boolean delete(final Object key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   return checkDeleteIndex(index, strict)? false : super.delete(key, strict);
               }
           
          @@ -364,7 +367,7 @@ public final class NativeString extends ScriptObject {
           
               @Override
               public Object getOwnPropertyDescriptor(final String key) {
          -        final int index = ArrayIndex.getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   if (index >= 0 && index < value.length()) {
                       final Global global = Global.instance();
                       return global.newDataDescriptor(String.valueOf(value.charAt(index)), false, true, false);
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java
          index db54c48397e..d7d04bbaa6e 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeSyntaxError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -54,12 +55,15 @@ public final class NativeSyntaxError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeSyntaxError(final Object msg) {
          -        this.setProto(Global.instance().getSyntaxErrorPrototype());
          +        super(Global.instance().getSyntaxErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java
          index 5e87fbb2676..c811a530569 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeTypeError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -54,12 +55,15 @@ public final class NativeTypeError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeTypeError(final Object msg) {
          -        this.setProto(Global.instance().getTypeErrorPrototype());
          +        super(Global.instance().getTypeErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            delete(NativeError.MESSAGE, Global.isStrict());
          +            delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java b/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java
          index 958c14acd81..80df6c28529 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeURIError.java
          @@ -33,6 +33,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
           /**
          @@ -53,12 +54,15 @@ public final class NativeURIError extends ScriptObject {
               @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
               public Object message;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               NativeURIError(final Object msg) {
          -        this.setProto(Global.instance().getURIErrorPrototype());
          +        super(Global.instance().getURIErrorPrototype(), $nasgenmap$);
                   if (msg != UNDEFINED) {
                       this.instMessage = JSType.toString(msg);
                   } else {
          -            this.delete(NativeError.MESSAGE, Global.isStrict());
          +            this.delete(NativeError.MESSAGE, false);
                   }
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java
          index 13ce347461e..39c19131280 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint16Array.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -45,6 +46,9 @@ public final class NativeUint16Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 2;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java
          index fb45c2821be..37102bae590 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint32Array.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -46,6 +47,9 @@ public final class NativeUint32Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 4;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteBegin, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java
          index 6cebcdb9c5f..aa6f89bec67 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8Array.java
          @@ -31,6 +31,7 @@ import jdk.nashorn.internal.objects.annotations.Function;
           import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -45,6 +46,9 @@ public final class NativeUint8Array extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 1;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
          index de171caa8a4..4467c856f06 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/NativeUint8ClampedArray.java
          @@ -32,6 +32,7 @@ import jdk.nashorn.internal.objects.annotations.Property;
           import jdk.nashorn.internal.objects.annotations.ScriptClass;
           import jdk.nashorn.internal.objects.annotations.Where;
           import jdk.nashorn.internal.runtime.JSType;
          +import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
           
          @@ -46,6 +47,9 @@ public final class NativeUint8ClampedArray extends ArrayBufferView {
               @Property(attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_WRITABLE | Attribute.NOT_CONFIGURABLE, where = Where.CONSTRUCTOR)
               public static final int BYTES_PER_ELEMENT = 1;
           
          +    // initialized by nasgen
          +    private static PropertyMap $nasgenmap$;
          +
               private static final Factory FACTORY = new Factory(BYTES_PER_ELEMENT) {
                   @Override
                   public ArrayBufferView construct(final NativeArrayBuffer buffer, final int byteOffset, final int length) {
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java b/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
          index edcc3274064..3a7205f9bba 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
          @@ -35,6 +35,7 @@ import jdk.nashorn.internal.runtime.PropertyMap;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptObject;
           import jdk.nashorn.internal.lookup.Lookup;
          +import jdk.nashorn.internal.lookup.MethodHandleFactory;
           
           /**
            * Instances of this class serve as "prototype" object for script functions.
          @@ -43,7 +44,7 @@ import jdk.nashorn.internal.lookup.Lookup;
            *
            */
           public class PrototypeObject extends ScriptObject {
          -    private static final PropertyMap nasgenmap$;
          +    private static final PropertyMap map$;
           
               private Object constructor;
           
          @@ -53,11 +54,11 @@ public class PrototypeObject extends ScriptObject {
               static {
                   PropertyMap map = PropertyMap.newMap(PrototypeObject.class);
                   map = Lookup.newProperty(map, "constructor", Property.NOT_ENUMERABLE, GET_CONSTRUCTOR, SET_CONSTRUCTOR);
          -        nasgenmap$ = map;
          +        map$ = map;
               }
           
               PrototypeObject() {
          -        this(nasgenmap$);
          +        this(map$);
               }
           
               /**
          @@ -66,12 +67,12 @@ public class PrototypeObject extends ScriptObject {
                * @param map property map
                */
               public PrototypeObject(final PropertyMap map) {
          -        super(map != nasgenmap$ ? map.addAll(nasgenmap$) : nasgenmap$);
          +        super(map != map$ ? map.addAll(map$) : map$);
                   setProto(Global.objectPrototype());
               }
           
               PrototypeObject(final ScriptFunction func) {
          -        this();
          +        this(map$);
                   this.constructor = func;
               }
           
          @@ -106,6 +107,10 @@ public class PrototypeObject extends ScriptObject {
               }
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          -        return MH.findStatic(MethodHandles.publicLookup(), PrototypeObject.class, name, MH.type(rtype, types));
          +        try {
          +            return MethodHandles.lookup().findStatic(PrototypeObject.class, name, MH.type(rtype, types));
          +        } catch (final NoSuchMethodException | IllegalAccessException e) {
          +            throw new MethodHandleFactory.LookupException(e);
          +        }
               }
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
          index 23a13f25931..6834ef4b701 100644
          --- a/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
          +++ b/nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java
          @@ -51,7 +51,7 @@ public class ScriptFunctionImpl extends ScriptFunction {
               // property map for bound functions
               private static final PropertyMap boundfunctionmap$;
               // property map for non-strict, non-bound functions.
          -    private static final PropertyMap nasgenmap$;
          +    private static final PropertyMap map$;
           
               // Marker object for lazily initialized prototype object
               private static final Object LAZY_PROTOTYPE = new Object();
          @@ -65,7 +65,7 @@ public class ScriptFunctionImpl extends ScriptFunction {
                * @param specs specialized versions of this method, if available, null otherwise
                */
               ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final MethodHandle[] specs) {
          -        super(name, invokeHandle, nasgenmap$, null, specs, false, true, true);
          +        super(name, invokeHandle, map$, null, specs, false, true, true);
                   init();
               }
           
          @@ -79,7 +79,7 @@ public class ScriptFunctionImpl extends ScriptFunction {
                * @param specs specialized versions of this method, if available, null otherwise
                */
               ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final PropertyMap map, final MethodHandle[] specs) {
          -        super(name, invokeHandle, map.addAll(nasgenmap$), null, specs, false, true, true);
          +        super(name, invokeHandle, map.addAll(map$), null, specs, false, true, true);
                   init();
               }
           
          @@ -124,8 +124,8 @@ public class ScriptFunctionImpl extends ScriptFunction {
                   map = Lookup.newProperty(map, "prototype", Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE, G$PROTOTYPE, S$PROTOTYPE);
                   map = Lookup.newProperty(map, "length",    Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$LENGTH, null);
                   map = Lookup.newProperty(map, "name",      Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE | Property.NOT_WRITABLE, G$NAME, null);
          -        nasgenmap$ = map;
          -        strictmodemap$ = createStrictModeMap(nasgenmap$);
          +        map$ = map;
          +        strictmodemap$ = createStrictModeMap(map$);
                   boundfunctionmap$ = createBoundFunctionMap(strictmodemap$);
               }
           
          @@ -149,19 +149,17 @@ public class ScriptFunctionImpl extends ScriptFunction {
                   return typeErrorThrower;
               }
           
          -    // add a new property that throws TypeError on get as well as set
          -    static synchronized PropertyMap newThrowerProperty(final PropertyMap map, final String name) {
          -        return map.newProperty(name, Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE, -1,
          -                Lookup.TYPE_ERROR_THROWER_GETTER, Lookup.TYPE_ERROR_THROWER_SETTER);
          -    }
          -
          -    private static PropertyMap createStrictModeMap(final PropertyMap functionMap) {
          -        return newThrowerProperty(newThrowerProperty(functionMap, "arguments"), "caller");
          +    private static PropertyMap createStrictModeMap(PropertyMap map) {
          +        final int flags = Property.NOT_ENUMERABLE | Property.NOT_CONFIGURABLE;
          +        // Need to add properties directly to map since slots are assigned speculatively by newUserAccessors.
          +        map = map.addProperty(map.newUserAccessors("arguments", flags));
          +        map = map.addProperty(map.newUserAccessors("caller", flags));
          +        return map;
               }
           
               // Choose the map based on strict mode!
               private static PropertyMap getMap(final boolean strict) {
          -        return strict ? strictmodemap$ : nasgenmap$;
          +        return strict ? strictmodemap$ : map$;
               }
           
               private static PropertyMap createBoundFunctionMap(final PropertyMap strictModeMap) {
          @@ -260,12 +258,15 @@ public class ScriptFunctionImpl extends ScriptFunction {
                   this.setProto(Global.instance().getFunctionPrototype());
                   this.prototype = LAZY_PROTOTYPE;
           
          -        if (isStrict()) {
          -            final ScriptFunction func = getTypeErrorThrower();
          -            // We have to fill user accessor functions late as these are stored
          -            // in this object rather than in the PropertyMap of this object.
          -            setUserAccessors("arguments", func, func);
          -            setUserAccessors("caller", func, func);
          +        // We have to fill user accessor functions late as these are stored
          +        // in this object rather than in the PropertyMap of this object.
          +
          +        if (findProperty("arguments", true) != null) {
          +            setUserAccessors("arguments", getTypeErrorThrower(), getTypeErrorThrower());
          +        }
          +
          +        if (findProperty("caller", true) != null) {
          +            setUserAccessors("caller", getTypeErrorThrower(), getTypeErrorThrower());
                   }
               }
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java b/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java
          index aa9234efaed..f1e68f66481 100644
          --- a/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java
          +++ b/nashorn/src/jdk/nashorn/internal/parser/JSONParser.java
          @@ -54,10 +54,9 @@ public class JSONParser extends AbstractParser {
                * Constructor
                * @param source  the source
                * @param errors  the error manager
          -     * @param strict  are we in strict mode
                */
          -    public JSONParser(final Source source, final ErrorManager errors, final boolean strict) {
          -        super(source, errors, strict);
          +    public JSONParser(final Source source, final ErrorManager errors) {
          +        super(source, errors, false);
               }
           
               /**
          @@ -135,6 +134,7 @@ public class JSONParser extends AbstractParser {
                           return ch == '\"';
                       }
           
          +            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONWhiteSpace
                       @Override
                       protected boolean isWhitespace(final char ch) {
                           return Lexer.isJsonWhitespace(ch);
          @@ -144,6 +144,99 @@ public class JSONParser extends AbstractParser {
                       protected boolean isEOL(final char ch) {
                           return Lexer.isJsonEOL(ch);
                       }
          +
          +            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONNumber
          +            @Override
          +            protected void scanNumber() {
          +                // Record beginning of number.
          +                final int startPosition = position;
          +                // Assume value is a decimal.
          +                TokenType valueType = TokenType.DECIMAL;
          +
          +                // floating point can't start with a "." with no leading digit before
          +                if (ch0 == '.') {
          +                    error(Lexer.message("json.invalid.number"), STRING, position, limit);
          +                }
          +
          +                // First digit of number.
          +                int digit = convertDigit(ch0, 10);
          +
          +                // skip first digit
          +                skip(1);
          +
          +                if (digit != 0) {
          +                    // Skip over remaining digits.
          +                    while (convertDigit(ch0, 10) != -1) {
          +                        skip(1);
          +                    }
          +                }
          +
          +                if (ch0 == '.' || ch0 == 'E' || ch0 == 'e') {
          +                    // Must be a double.
          +                    if (ch0 == '.') {
          +                        // Skip period.
          +                        skip(1);
          +
          +                        boolean mantissa = false;
          +                        // Skip mantissa.
          +                        while (convertDigit(ch0, 10) != -1) {
          +                            mantissa = true;
          +                            skip(1);
          +                        }
          +
          +                        if (! mantissa) {
          +                            // no digit after "."
          +                            error(Lexer.message("json.invalid.number"), STRING, position, limit);
          +                        }
          +                    }
          +
          +                    // Detect exponent.
          +                    if (ch0 == 'E' || ch0 == 'e') {
          +                        // Skip E.
          +                        skip(1);
          +                        // Detect and skip exponent sign.
          +                        if (ch0 == '+' || ch0 == '-') {
          +                            skip(1);
          +                        }
          +                        boolean exponent = false;
          +                        // Skip exponent.
          +                        while (convertDigit(ch0, 10) != -1) {
          +                            exponent = true;
          +                            skip(1);
          +                        }
          +
          +                        if (! exponent) {
          +                            // no digit after "E"
          +                            error(Lexer.message("json.invalid.number"), STRING, position, limit);
          +                        }
          +                    }
          +
          +                    valueType = TokenType.FLOATING;
          +                }
          +
          +                // Add number token.
          +                add(valueType, startPosition);
          +            }
          +
          +            // ECMA 15.12.1.1 The JSON Lexical Grammar - JSONEscapeCharacter
          +            @Override
          +            protected boolean isEscapeCharacter(final char ch) {
          +                switch (ch) {
          +                    case '"':
          +                    case '/':
          +                    case '\\':
          +                    case 'b':
          +                    case 'f':
          +                    case 'n':
          +                    case 'r':
          +                    case 't':
          +                    // could be unicode escape
          +                    case 'u':
          +                        return true;
          +                    default:
          +                        return false;
          +                }
          +            }
                   };
           
                   k = -1;
          diff --git a/nashorn/src/jdk/nashorn/internal/parser/Lexer.java b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java
          index d9ebb365e11..ecf67962015 100644
          --- a/nashorn/src/jdk/nashorn/internal/parser/Lexer.java
          +++ b/nashorn/src/jdk/nashorn/internal/parser/Lexer.java
          @@ -648,7 +648,7 @@ public class Lexer extends Scanner {
                *
                * @return The converted digit or -1 if invalid.
                */
          -    private static int convertDigit(final char ch, final int base) {
          +    protected static int convertDigit(final char ch, final int base) {
                   int digit;
           
                   if ('0' <= ch && ch <= '9') {
          @@ -666,43 +666,54 @@ public class Lexer extends Scanner {
           
           
               /**
          -     * Get the value of a numeric sequence.
          -     *
          -     * @param base  Numeric base.
          -     * @param max   Maximum number of digits.
          -     * @param skip  Skip over escape first.
          -     * @param check Tells whether to throw error if a digit is invalid for the given base.
          -     * @param type  Type of token to report against.
          +     * Get the value of a hexadecimal numeric sequence.
                *
          +     * @param length Number of digits.
          +     * @param type   Type of token to report against.
                * @return Value of sequence or < 0 if no digits.
                */
          -    private int valueOfSequence(final int base, final int max, final boolean skip, final boolean check, final TokenType type) {
          -        assert base == 16 || base == 8 : "base other than 16 or 8";
          -        final boolean isHex = base == 16;
          -        final int shift = isHex ? 4 : 3;
          +    private int hexSequence(final int length, final TokenType type) {
                   int value = 0;
           
          -        if (skip) {
          -            skip(2);
          -        }
          -
          -        for (int i = 0; i < max; i++) {
          -            final int digit = convertDigit(ch0, base);
          +        for (int i = 0; i < length; i++) {
          +            final int digit = convertDigit(ch0, 16);
           
                       if (digit == -1) {
          -                if (check) {
          -                    error(Lexer.message("invalid." + (isHex ? "hex" : "octal")), type, position, limit);
          -                }
          +                error(Lexer.message("invalid.hex"), type, position, limit);
                           return i == 0 ? -1 : value;
                       }
           
          -            value = value << shift | digit;
          +            value = digit | value << 4;
                       skip(1);
                   }
           
                   return value;
               }
           
          +    /**
          +     * Get the value of an octal numeric sequence. This parses up to 3 digits with a maximum value of 255.
          +     *
          +     * @return Value of sequence.
          +     */
          +    private int octalSequence() {
          +        int value = 0;
          +
          +        for (int i = 0; i < 3; i++) {
          +            final int digit = convertDigit(ch0, 8);
          +
          +            if (digit == -1) {
          +                break;
          +            }
          +            value = digit | value << 3;
          +            skip(1);
          +
          +            if (i == 1 && value >= 32) {
          +                break;
          +            }
          +        }
          +        return value;
          +    }
          +
               /**
                * Convert a string to a JavaScript identifier.
                *
          @@ -724,7 +735,8 @@ public class Lexer extends Scanner {
                   while (!atEOF() && position < end && !isEOL(ch0)) {
                       // If escape character.
                       if (ch0 == '\\' && ch1 == 'u') {
          -                final int ch = valueOfSequence(16, 4, true, true, TokenType.IDENT);
          +                skip(2);
          +                final int ch = hexSequence(4, TokenType.IDENT);
                           if (isWhitespace((char)ch)) {
                               return null;
                           }
          @@ -815,7 +827,7 @@ public class Lexer extends Scanner {
                               }
                               reset(afterSlash);
                               // Octal sequence.
          -                    final int ch = valueOfSequence(8, 3, false, false, STRING);
          +                    final int ch = octalSequence();
           
                               if (ch < 0) {
                                   sb.append('\\');
          @@ -862,7 +874,7 @@ public class Lexer extends Scanner {
                               break;
                           case 'x': {
                               // Hex sequence.
          -                    final int ch = valueOfSequence(16, 2, false, true, STRING);
          +                    final int ch = hexSequence(2, STRING);
           
                               if (ch < 0) {
                                   sb.append('\\');
          @@ -874,7 +886,7 @@ public class Lexer extends Scanner {
                               break;
                           case 'u': {
                               // Unicode sequence.
          -                    final int ch = valueOfSequence(16, 4, false, true, STRING);
          +                    final int ch = hexSequence(4, STRING);
           
                               if (ch < 0) {
                                   sb.append('\\');
          @@ -907,8 +919,9 @@ public class Lexer extends Scanner {
           
               /**
                * Scan over a string literal.
          +     * @param add true if we nare not just scanning but should actually modify the token stream
                */
          -    private void scanString(final boolean add) {
          +    protected void scanString(final boolean add) {
                   // Type of string.
                   TokenType type = STRING;
                   // Record starting quote.
          @@ -925,6 +938,9 @@ public class Lexer extends Scanner {
                       if (ch0 == '\\') {
                           type = ESCSTRING;
                           skip(1);
          +                if (! isEscapeCharacter(ch0)) {
          +                    error(Lexer.message("invalid.escape.char"), STRING, position, limit);
          +                }
                           if (isEOL(ch0)) {
                               // Multiline string literal
                               skipEOL(false);
          @@ -978,6 +994,16 @@ public class Lexer extends Scanner {
                   }
               }
           
          +    /**
          +     * Is the given character a valid escape char after "\" ?
          +     *
          +     * @param ch character to be checked
          +     * @return if the given character is valid after "\"
          +     */
          +    protected boolean isEscapeCharacter(final char ch) {
          +        return true;
          +    }
          +
               /**
                * Convert string to number.
                *
          @@ -1024,7 +1050,7 @@ public class Lexer extends Scanner {
               /**
                * Scan a number.
                */
          -    private void scanNumber() {
          +    protected void scanNumber() {
                   // Record beginning of number.
                   final int start = position;
                   // Assume value is a decimal.
          @@ -1090,6 +1116,10 @@ public class Lexer extends Scanner {
                       }
                   }
           
          +        if (Character.isJavaIdentifierStart(ch0)) {
          +            error(Lexer.message("missing.space.after.number"), type, position, 1);
          +        }
          +
                   // Add number token.
                   add(type, start);
               }
          @@ -1178,7 +1208,8 @@ public class Lexer extends Scanner {
           
                   // Make sure first character is valid start character.
                   if (ch0 == '\\' && ch1 == 'u') {
          -            final int ch = valueOfSequence(16, 4, true, true, TokenType.IDENT);
          +            skip(2);
          +            final int ch = hexSequence(4, TokenType.IDENT);
           
                       if (!Character.isJavaIdentifierStart(ch)) {
                           error(Lexer.message("illegal.identifier.character"), TokenType.IDENT, start, position);
          @@ -1191,7 +1222,8 @@ public class Lexer extends Scanner {
                   // Make sure remaining characters are valid part characters.
                   while (!atEOF()) {
                       if (ch0 == '\\' && ch1 == 'u') {
          -                final int ch = valueOfSequence(16, 4, true, true, TokenType.IDENT);
          +                skip(2);
          +                final int ch = hexSequence(4, TokenType.IDENT);
           
                           if (!Character.isJavaIdentifierPart(ch)) {
                               error(Lexer.message("illegal.identifier.character"), TokenType.IDENT, start, position);
          @@ -1583,7 +1615,13 @@ public class Lexer extends Scanner {
                   return null;
               }
           
          -    private static String message(final String msgId, final String... args) {
          +    /**
          +     * Get the correctly localized error message for a given message id format arguments
          +     * @param msgId message id
          +     * @param args  format arguments
          +     * @return message
          +     */
          +    protected static String message(final String msgId, final String... args) {
                   return ECMAErrors.getMessage("lexer.error." + msgId, args);
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/parser/Parser.java b/nashorn/src/jdk/nashorn/internal/parser/Parser.java
          index ee90b8d9111..181dcf83dd4 100644
          --- a/nashorn/src/jdk/nashorn/internal/parser/Parser.java
          +++ b/nashorn/src/jdk/nashorn/internal/parser/Parser.java
          @@ -535,15 +535,12 @@ loop:
                       if (!(lhs instanceof AccessNode ||
                             lhs instanceof IndexNode ||
                             lhs instanceof IdentNode)) {
          -                if (env._early_lvalue_error) {
          -                    throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
          -                }
          -                return referenceError(lhs, rhs);
          +                return referenceError(lhs, rhs, env._early_lvalue_error);
                       }
           
                       if (lhs instanceof IdentNode) {
                           if (!checkIdentLValue((IdentNode)lhs)) {
          -                    return referenceError(lhs, rhs);
          +                    return referenceError(lhs, rhs, false);
                           }
                           verifyStrictIdent((IdentNode)lhs, "assignment");
                       }
          @@ -767,8 +764,6 @@ loop:
                   case LBRACE:
                       block();
                       break;
          -        case RBRACE:
          -            break;
                   case VAR:
                       variableStatement(true);
                       break;
          @@ -1267,6 +1262,7 @@ loop:
                   case RBRACE:
                   case SEMICOLON:
                   case EOL:
          +        case EOF:
                       break;
           
                   default:
          @@ -1314,6 +1310,7 @@ loop:
                   case RBRACE:
                   case SEMICOLON:
                   case EOL:
          +        case EOF:
                       break;
           
                   default:
          @@ -1368,6 +1365,7 @@ loop:
                   case RBRACE:
                   case SEMICOLON:
                   case EOL:
          +        case EOF:
                       break;
           
                   default:
          @@ -1403,6 +1401,7 @@ loop:
                   case RBRACE:
                   case SEMICOLON:
                   case EOL:
          +        case EOF:
                       break;
           
                   default:
          @@ -1928,7 +1927,7 @@ loop:
           
                   // Object context.
                   // Prepare to accumulate elements.
          -       // final List elements = new ArrayList<>();
          +        // final List elements = new ArrayList<>();
                   final Map map = new LinkedHashMap<>();
           
                   // Create a block for the object literal.
          @@ -1941,6 +1940,9 @@ loop:
                               break loop;
           
                           case COMMARIGHT:
          +                    if (commaSeen) {
          +                        throw error(AbstractParser.message("expected.property.id", type.getNameOrType()));
          +                    }
                               next();
                               commaSeen = true;
                               break;
          @@ -2403,7 +2405,7 @@ loop:
                       verifyStrictIdent(name, "function name");
                   } else if (isStatement) {
                       // Nashorn extension: anonymous function statements
          -            if (env._no_syntax_extensions || !env._anon_functions) {
          +            if (env._no_syntax_extensions) {
                           expect(IDENT);
                       }
                   }
          @@ -2566,7 +2568,7 @@ loop:
                            */
           
                           // just expression as function body
          -                final Node expr = expression();
          +                final Node expr = assignmentExpression(true);
                           assert lc.getCurrentBlock() == lc.getFunctionBody(functionNode);
                           // create a return statement - this creates code in itself and does not need to be
                           // wrapped into an ExecuteNode
          @@ -2612,7 +2614,10 @@ loop:
                   }
               }
           
          -    private static RuntimeNode referenceError(final Node lhs, final Node rhs) {
          +    private RuntimeNode referenceError(final Node lhs, final Node rhs, final boolean earlyError) {
          +        if (earlyError) {
          +            throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
          +        }
                   final ArrayList args = new ArrayList<>();
                   args.add(lhs);
                   if (rhs == null) {
          @@ -2690,18 +2695,18 @@ loop:
                       final Node lhs = leftHandSideExpression();
                       // ++, -- without operand..
                       if (lhs == null) {
          -                // error would have been issued when looking for 'lhs'
          -                return null;
          +                throw error(AbstractParser.message("expected.lvalue", type.getNameOrType()));
                       }
          +
                       if (!(lhs instanceof AccessNode ||
                             lhs instanceof IndexNode ||
                             lhs instanceof IdentNode)) {
          -                return referenceError(lhs, null);
          +                return referenceError(lhs, null, env._early_lvalue_error);
                       }
           
                       if (lhs instanceof IdentNode) {
                           if (!checkIdentLValue((IdentNode)lhs)) {
          -                    return referenceError(lhs, null);
          +                    return referenceError(lhs, null, false);
                           }
                           verifyStrictIdent((IdentNode)lhs, "operand for " + opType.getName() + " operator");
                       }
          @@ -2720,16 +2725,21 @@ loop:
                       case DECPREFIX:
                           final TokenType opType = type;
                           final Node lhs = expression;
          +                // ++, -- without operand..
          +                if (lhs == null) {
          +                    throw error(AbstractParser.message("expected.lvalue", type.getNameOrType()));
          +                }
          +
                           if (!(lhs instanceof AccessNode ||
                              lhs instanceof IndexNode ||
                              lhs instanceof IdentNode)) {
                               next();
          -                    return referenceError(lhs, null);
          +                    return referenceError(lhs, null, env._early_lvalue_error);
                           }
                           if (lhs instanceof IdentNode) {
                               if (!checkIdentLValue((IdentNode)lhs)) {
                                   next();
          -                        return referenceError(lhs, null);
          +                        return referenceError(lhs, null, false);
                               }
                               verifyStrictIdent((IdentNode)lhs, "operand for " + opType.getName() + " operator");
                           }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
          index 13e9e1ce3bd..bfdfa71995d 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
          @@ -288,7 +288,7 @@ public class AccessorProperty extends Property {
               }
           
               @Override
          -    protected void setObjectValue(final ScriptObject self, final ScriptObject owner, final Object value, final boolean strict)  {
          +    public void setObjectValue(final ScriptObject self, final ScriptObject owner, final Object value, final boolean strict)  {
                   if (isSpill()) {
                       self.spill[getSlot()] = value;
                   } else {
          @@ -303,7 +303,7 @@ public class AccessorProperty extends Property {
               }
           
               @Override
          -    protected Object getObjectValue(final ScriptObject self, final ScriptObject owner) {
          +    public Object getObjectValue(final ScriptObject self, final ScriptObject owner) {
                   if (isSpill()) {
                       return self.spill[getSlot()];
                   }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Context.java b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
          index d0e3b0200da..b39eb44a179 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
          @@ -46,6 +46,7 @@ import java.security.CodeSource;
           import java.security.Permissions;
           import java.security.PrivilegedAction;
           import java.security.ProtectionDomain;
          +import java.util.Map;
           import jdk.internal.org.objectweb.asm.ClassReader;
           import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
           import jdk.nashorn.api.scripting.ScriptObjectMirror;
          @@ -100,13 +101,7 @@ public final class Context {
               /** Is Context global debug mode enabled ? */
               public static final boolean DEBUG = Options.getBooleanProperty("nashorn.debug");
           
          -    private static final ThreadLocal currentGlobal =
          -        new ThreadLocal() {
          -            @Override
          -            protected ScriptObject initialValue() {
          -                 return null;
          -            }
          -        };
          +    private static final ThreadLocal currentGlobal = new ThreadLocal<>();
           
               /**
                * Get the current global scope
          @@ -188,7 +183,7 @@ public final class Context {
               private final ScriptEnvironment env;
           
               /** is this context in strict mode? Cached from env. as this is used heavily. */
          -    public final boolean _strict;
          +    final boolean _strict;
           
               /** class loader to resolve classes from script. */
               private final ClassLoader  appLoader;
          @@ -482,6 +477,13 @@ public final class Context {
                           final String name   = JSType.toString(sobj.get("name"));
                           source = new Source(name, script);
                       }
          +        } else if (src instanceof Map) {
          +            final Map map = (Map)src;
          +            if (map.containsKey("script") && map.containsKey("name")) {
          +                final String script = JSType.toString(map.get("script"));
          +                final String name   = JSType.toString(map.get("name"));
          +                source = new Source(name, script);
          +            }
                   }
           
                   if (source != null) {
          @@ -496,12 +498,13 @@ public final class Context {
                * expression, after creating a new global scope.
                *
                * @param from source expression for script
          +     * @param args (optional) arguments to be passed to the loaded script
                *
                * @return return value for load call (undefined)
                *
                * @throws IOException if source cannot be found or loaded
                */
          -    public Object loadWithNewGlobal(final Object from) throws IOException {
          +    public Object loadWithNewGlobal(final Object from, final Object...args) throws IOException {
                   final ScriptObject oldGlobal = getGlobalTrusted();
                   final ScriptObject newGlobal = AccessController.doPrivileged(new PrivilegedAction() {
                      @Override
          @@ -518,6 +521,9 @@ public final class Context {
                   });
                   setGlobalTrusted(newGlobal);
           
          +        final Object[] wrapped = args == null? ScriptRuntime.EMPTY_ARRAY :  ScriptObjectMirror.wrapArray(args, newGlobal);
          +        newGlobal.put("arguments", ((GlobalObject)newGlobal).wrapAsObject(wrapped));
          +
                   try {
                       return ScriptObjectMirror.wrap(load(newGlobal, from), newGlobal);
                   } finally {
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java b/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java
          index 16165fe9caa..c14accb7c4e 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/FindProperty.java
          @@ -89,7 +89,7 @@ public final class FindProperty {
                   MethodHandle setter = property.getSetter(type, getOwner().getMap());
                   if (property instanceof UserAccessorProperty) {
                       final UserAccessorProperty uc = (UserAccessorProperty) property;
          -            setter = MH.insertArguments(setter, 0, (isInherited() ? getOwner() : null),
          +            setter = MH.insertArguments(setter, 0, isInherited() ? getOwner() : null,
                               uc.getSetterSlot(), strict? property.getKey() : null);
                   }
           
          @@ -109,7 +109,7 @@ public final class FindProperty {
                * @return appropriate receiver
                */
               public ScriptObject getGetterReceiver() {
          -        return property != null && property.hasGetterFunction() ? self : prototype;
          +        return property != null && property.hasGetterFunction(prototype) ? self : prototype;
               }
           
              /**
          @@ -117,7 +117,7 @@ public final class FindProperty {
                * @return appropriate receiver
                */
               public ScriptObject getSetterReceiver() {
          -        return property != null && property.hasSetterFunction() ? self : prototype;
          +        return property != null && property.hasSetterFunction(prototype) ? self : prototype;
               }
           
               /**
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java b/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java
          index 713aa69d3ce..59a9d5ede03 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/FunctionScope.java
          @@ -54,9 +54,8 @@ public class FunctionScope extends ScriptObject implements Scope {
                * @param arguments   arguments
                */
               public FunctionScope(final PropertyMap map, final ScriptObject callerScope, final Object arguments) {
          -        super(map);
          +        super(callerScope, map);
                   this.arguments = arguments;
          -        setProto(callerScope);
                   setIsScope();
               }
           
          @@ -67,9 +66,8 @@ public class FunctionScope extends ScriptObject implements Scope {
                * @param callerScope caller scope
                */
               public FunctionScope(final PropertyMap map, final ScriptObject callerScope) {
          -        super(map);
          +        super(callerScope, map);
                   this.arguments = null;
          -        setProto(callerScope);
                   setIsScope();
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java b/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
          index 98b79150ebd..04211fc6707 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/GlobalFunctions.java
          @@ -373,11 +373,16 @@ loop:
                           sb.append(ch);
                       } else if (ch < 256) {
                           sb.append('%');
          -                final byte b = (byte)ch;
          -                sb.append(Integer.toHexString(b & 0xFF).toUpperCase(Locale.ENGLISH));
          +                if (ch < 16) {
          +                    sb.append('0');
          +                }
          +                sb.append(Integer.toHexString(ch).toUpperCase(Locale.ENGLISH));
                       } else {
                           sb.append("%u");
          -                sb.append(Integer.toHexString(ch & 0xFFFF).toUpperCase(Locale.ENGLISH));
          +                if (ch < 4096) {
          +                    sb.append('0');
          +                }
          +                sb.append(Integer.toHexString(ch).toUpperCase(Locale.ENGLISH));
                       }
                   }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java b/nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java
          index c296a87accc..2895cb85644 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/JSONFunctions.java
          @@ -25,9 +25,6 @@
           
           package jdk.nashorn.internal.runtime;
           
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndexNoThrow;
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.isValidArrayIndex;
          -
           import java.lang.invoke.MethodHandle;
           import java.util.Iterator;
           import jdk.nashorn.internal.ir.LiteralNode;
          @@ -37,6 +34,7 @@ import jdk.nashorn.internal.ir.PropertyNode;
           import jdk.nashorn.internal.ir.UnaryNode;
           import jdk.nashorn.internal.parser.JSONParser;
           import jdk.nashorn.internal.parser.TokenType;
          +import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
           import jdk.nashorn.internal.runtime.linker.Bootstrap;
           
           /**
          @@ -66,13 +64,9 @@ public final class JSONFunctions {
                */
               public static Object parse(final Object text, final Object reviver) {
                   final String     str     = JSType.toString(text);
          -        final Context    context = Context.getContextTrusted();
                   final JSONParser parser  = new JSONParser(
                           new Source("", str),
          -                new Context.ThrowErrorManager(),
          -                (context != null) ?
          -                    context.getEnv()._strict :
          -                    false);
          +                new Context.ThrowErrorManager());
           
                   Node node;
           
          @@ -107,7 +101,6 @@ public final class JSONFunctions {
                   final Object val = holder.get(name);
                   if (val instanceof ScriptObject) {
                       final ScriptObject     valueObj = (ScriptObject)val;
          -            final boolean          strict   = valueObj.isStrictContext();
                       final Iterator iter     = valueObj.propertyIterator();
           
                       while (iter.hasNext()) {
          @@ -115,9 +108,9 @@ public final class JSONFunctions {
                           final Object newElement = walk(valueObj, key, reviver);
           
                           if (newElement == ScriptRuntime.UNDEFINED) {
          -                    valueObj.delete(key, strict);
          +                    valueObj.delete(key, false);
                           } else {
          -                    setPropertyValue(valueObj, key, newElement, strict);
          +                    setPropertyValue(valueObj, key, newElement, false);
                           }
                       }
                   }
          @@ -170,14 +163,13 @@ public final class JSONFunctions {
                   } else if (node instanceof ObjectNode) {
                       final ObjectNode   objNode  = (ObjectNode) node;
                       final ScriptObject object   = ((GlobalObject)global).newObject();
          -            final boolean      strict   = global.isStrictContext();
           
                       for (final PropertyNode pNode: objNode.getElements()) {
                           final Node         valueNode = pNode.getValue();
           
                           final String name = pNode.getKeyName();
                           final Object value = convertNode(global, valueNode);
          -                setPropertyValue(object, name, value, strict);
          +                setPropertyValue(object, name, value, false);
                       }
           
                       return object;
          @@ -192,8 +184,8 @@ public final class JSONFunctions {
           
               // add a new property if does not exist already, or else set old property
               private static void setPropertyValue(final ScriptObject sobj, final String name, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(name);
          -        if (isValidArrayIndex(index)) {
          +        final int index = ArrayIndex.getArrayIndex(name);
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       // array index key
                       sobj.defineOwnProperty(index, value);
                   } else if (sobj.getMap().findProperty(name) != null) {
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/JSType.java b/nashorn/src/jdk/nashorn/internal/runtime/JSType.java
          index 8f1f1e9e616..9507f0d3205 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/JSType.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/JSType.java
          @@ -911,7 +911,7 @@ public enum JSType {
           
                   for (int i = start; i < length ; i++) {
                       if (digit(chars[i], radix) == -1) {
          -                break;
          +                return Double.NaN;
                       }
                       pos++;
                   }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java b/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java
          index 883ff85cf1f..145afac6a26 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/NativeJavaPackage.java
          @@ -199,7 +199,6 @@ public final class NativeJavaPackage extends ScriptObject {
                   final String fullName     = name.isEmpty() ? propertyName : name + "." + propertyName;
           
                   final Context context = getContext();
          -        final boolean strict  = context._strict;
           
                   Class javaClass = null;
                   try {
          @@ -209,9 +208,9 @@ public final class NativeJavaPackage extends ScriptObject {
                   }
           
                   if (javaClass == null) {
          -            set(propertyName, new NativeJavaPackage(fullName, getProto()), strict);
          +            set(propertyName, new NativeJavaPackage(fullName, getProto()), false);
                   } else {
          -            set(propertyName, StaticClass.forClass(javaClass), strict);
          +            set(propertyName, StaticClass.forClass(javaClass), false);
                   }
           
                   return super.lookup(desc, request);
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Property.java b/nashorn/src/jdk/nashorn/internal/runtime/Property.java
          index a5e46016a00..e2cc6cdec21 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/Property.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/Property.java
          @@ -180,17 +180,19 @@ public abstract class Property {
           
               /**
                * Check whether this property has a user defined getter function. See {@link UserAccessorProperty}
          +     * @param obj object containing getter
                * @return true if getter function exists, false is default
                */
          -    public boolean hasGetterFunction() {
          +    public boolean hasGetterFunction(final ScriptObject obj) {
                   return false;
               }
           
               /**
                * Check whether this property has a user defined setter function. See {@link UserAccessorProperty}
          +     * @param obj object containing setter
                * @return true if getter function exists, false is default
                */
          -    public boolean hasSetterFunction() {
          +    public boolean hasSetterFunction(final ScriptObject obj) {
                   return false;
               }
           
          @@ -363,7 +365,7 @@ public abstract class Property {
                * @param value the new property value
                * @param strict is this a strict setter?
                */
          -    protected abstract void setObjectValue(ScriptObject self, ScriptObject owner, Object value, boolean strict);
          +    public abstract void setObjectValue(ScriptObject self, ScriptObject owner, Object value, boolean strict);
           
               /**
                * Set the Object value of this property from {@code owner}. This allows to bypass creation of the
          @@ -373,7 +375,7 @@ public abstract class Property {
                * @param owner the owner object
                * @return  the property value
                */
          -    protected abstract Object getObjectValue(ScriptObject self, ScriptObject owner);
          +    public abstract Object getObjectValue(ScriptObject self, ScriptObject owner);
           
               /**
                * Abstract method for retrieving the setter for the property. We do not know
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java b/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java
          index a0c2f8237f6..34db0cb3877 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyListenerManager.java
          @@ -61,7 +61,7 @@ public class PropertyListenerManager implements PropertyListener {
                *
                * @param listener The property listener that is added.
                */
          -    public final void addPropertyListener(final PropertyListener listener) {
          +    public synchronized final void addPropertyListener(final PropertyListener listener) {
                   if (listeners == null) {
                       listeners = new WeakHashMap<>();
                   }
          @@ -77,7 +77,7 @@ public class PropertyListenerManager implements PropertyListener {
                *
                * @param listener The property listener that is removed.
                */
          -    public final void removePropertyListener(final PropertyListener listener) {
          +    public synchronized final void removePropertyListener(final PropertyListener listener) {
                   if (listeners != null) {
                       if (Context.DEBUG) {
                           listenersRemoved++;
          @@ -92,7 +92,7 @@ public class PropertyListenerManager implements PropertyListener {
                * @param object The ScriptObject to which property was added.
                * @param prop The property being added.
                */
          -    protected final void notifyPropertyAdded(final ScriptObject object, final Property prop) {
          +    protected synchronized final void notifyPropertyAdded(final ScriptObject object, final Property prop) {
                   if (listeners != null) {
                       for (PropertyListener listener : listeners.keySet()) {
                           listener.propertyAdded(object, prop);
          @@ -106,7 +106,7 @@ public class PropertyListenerManager implements PropertyListener {
                * @param object The ScriptObject from which property was deleted.
                * @param prop The property being deleted.
                */
          -    protected final void notifyPropertyDeleted(final ScriptObject object, final Property prop) {
          +    protected synchronized final void notifyPropertyDeleted(final ScriptObject object, final Property prop) {
                   if (listeners != null) {
                       for (PropertyListener listener : listeners.keySet()) {
                           listener.propertyDeleted(object, prop);
          @@ -121,7 +121,7 @@ public class PropertyListenerManager implements PropertyListener {
                * @param oldProp The old property being replaced.
                * @param newProp The new property that replaces the old property.
                */
          -    protected final void notifyPropertyModified(final ScriptObject object, final Property oldProp, final Property newProp) {
          +    protected synchronized final void notifyPropertyModified(final ScriptObject object, final Property oldProp, final Property newProp) {
                   if (listeners != null) {
                       for (PropertyListener listener : listeners.keySet()) {
                           listener.propertyModified(object, oldProp, newProp);
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
          index 077218d3f4f..e03a3ef836e 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
          @@ -25,6 +25,8 @@
           
           package jdk.nashorn.internal.runtime;
           
          +import jdk.nashorn.internal.scripts.JO;
          +
           import static jdk.nashorn.internal.runtime.PropertyHashMap.EMPTY_HASHMAP;
           
           import java.lang.invoke.MethodHandle;
          @@ -95,7 +97,6 @@ public final class PropertyMap implements Iterable, PropertyListener {
                */
               private PropertyMap(final PropertyHashMap properties, final int fieldCount, final int fieldMaximum) {
                   this.properties   = properties;
          -        this.hashCode     = computeHashCode();
                   this.fieldCount   = fieldCount;
                   this.fieldMaximum = fieldMaximum;
           
          @@ -125,7 +126,6 @@ public final class PropertyMap implements Iterable, PropertyListener {
                   this.spillLength  = propertyMap.spillLength;
                   this.fieldCount   = propertyMap.fieldCount;
                   this.fieldMaximum = propertyMap.fieldMaximum;
          -        this.hashCode     = computeHashCode();
           
                   if (Context.DEBUG) {
                       count++;
          @@ -168,7 +168,7 @@ public final class PropertyMap implements Iterable, PropertyListener {
                */
               public static PropertyMap newMap(final Class structure, final Collection properties, final int fieldCount, final int fieldMaximum) {
                   // Reduce the number of empty maps in the context.
          -        if (structure == jdk.nashorn.internal.scripts.JO.class) {
          +        if (structure == JO.class) {
                       return EMPTY_MAP;
                   }
           
          @@ -304,7 +304,7 @@ public final class PropertyMap implements Iterable, PropertyListener {
                *
                * @return New {@link PropertyMap} with {@link Property} added.
                */
          -    PropertyMap addProperty(final Property property) {
          +    public PropertyMap addProperty(final Property property) {
                   PropertyMap newMap = checkHistory(property);
           
                   if (newMap == null) {
          @@ -385,6 +385,21 @@ public final class PropertyMap implements Iterable, PropertyListener {
                   return newMap;
               }
           
          +    /*
          +     * Make a new UserAccessorProperty property. getter and setter functions are stored in
          +     * this ScriptObject and slot values are used in property object. Note that slots
          +     * are assigned speculatively and should be added to map before adding other
          +     * properties.
          +     */
          +    public UserAccessorProperty newUserAccessors(final String key, final int propertyFlags) {
          +        int oldSpillLength = spillLength;
          +
          +        final int getterSlot = oldSpillLength++;
          +        final int setterSlot = oldSpillLength++;
          +
          +        return new UserAccessorProperty(key, propertyFlags, getterSlot, setterSlot);
          +    }
          +
               /**
                * Find a property in the map.
                *
          @@ -610,6 +625,9 @@ public final class PropertyMap implements Iterable, PropertyListener {
           
               @Override
               public int hashCode() {
          +        if (hashCode == 0 && !properties.isEmpty()) {
          +            hashCode = computeHashCode();
          +        }
                   return hashCode;
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java
          index 2ca897db98a..f04dedf05c9 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptEnvironment.java
          @@ -56,9 +56,6 @@ public final class ScriptEnvironment {
               /** Current Options object. */
               private final Options options;
           
          -    /** Always allow functions as statements */
          -    public final boolean _anon_functions;
          -
               /** Size of the per-global Class cache size */
               public final int     _class_cache_size;
           
          @@ -192,7 +189,6 @@ public final class ScriptEnvironment {
                   this.namespace = new Namespace();
                   this.options = options;
           
          -        _anon_functions       = options.getBoolean("anon.functions");
                   _class_cache_size     = options.getInteger("class.cache.size");
                   _compile_only         = options.getBoolean("compile.only");
                   _debug_lines          = options.getBoolean("debug.lines");
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java
          index 26e6270a4f2..5dca0e26978 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunction.java
          @@ -202,6 +202,16 @@ public abstract class ScriptFunction extends ScriptObject {
                   return data.invoke(this, self, arguments);
               }
           
          +    /**
          +     * Execute this script function as a constructor.
          +     * @param arguments  Call arguments.
          +     * @return Newly constructed result.
          +     * @throws Throwable if there is an exception/error with the invocation or thrown from it
          +     */
          +    Object construct(final Object... arguments) throws Throwable {
          +        return data.construct(this, arguments);
          +    }
          +
               /**
                * Allocate function. Called from generated {@link ScriptObject} code
                * for allocation as a factory method
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
          index f98817c8ee6..673c0152ecf 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
          @@ -216,6 +216,12 @@ public abstract class ScriptFunctionData {
                   return composeGenericMethod(code.mostGeneric().getInvoker());
               }
           
          +    final MethodHandle getGenericConstructor() {
          +        ensureCodeGenerated();
          +        ensureConstructor(code.mostGeneric());
          +        return composeGenericMethod(code.mostGeneric().getConstructor());
          +    }
          +
               private CompiledFunction getBest(final MethodType callSiteType) {
                   ensureCodeGenerated();
                   return code.best(callSiteType);
          @@ -535,10 +541,74 @@ public abstract class ScriptFunctionData {
                   }
               }
           
          +    Object construct(final ScriptFunction fn, final Object... arguments) throws Throwable {
          +        final MethodHandle mh = getGenericConstructor();
          +
          +        final Object[]     args       = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
          +
          +        if (isVarArg(mh)) {
          +            if (needsCallee(mh)) {
          +                return mh.invokeExact(fn, args);
          +            }
          +            return mh.invokeExact(args);
          +        }
          +
          +        final int paramCount = mh.type().parameterCount();
          +        if (needsCallee(mh)) {
          +            switch (paramCount) {
          +            case 1:
          +                return mh.invokeExact(fn);
          +            case 2:
          +                return mh.invokeExact(fn, getArg(args, 0));
          +            case 3:
          +                return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1));
          +            case 4:
          +                return mh.invokeExact(fn, getArg(args, 0), getArg(args, 1), getArg(args, 2));
          +            default:
          +                return mh.invokeWithArguments(withArguments(fn, paramCount, args));
          +            }
          +        }
          +
          +        switch (paramCount) {
          +        case 0:
          +            return mh.invokeExact();
          +        case 1:
          +            return mh.invokeExact(getArg(args, 0));
          +        case 2:
          +            return mh.invokeExact(getArg(args, 0), getArg(args, 1));
          +        case 3:
          +            return mh.invokeExact(getArg(args, 0), getArg(args, 1), getArg(args, 2));
          +        default:
          +            return mh.invokeWithArguments(withArguments(null, paramCount, args));
          +        }
          +    }
          +
               private static Object getArg(final Object[] args, final int i) {
                   return i < args.length ? args[i] : UNDEFINED;
               }
           
          +    private static Object[] withArguments(final ScriptFunction fn, final int argCount, final Object[] args) {
          +        final Object[] finalArgs = new Object[argCount];
          +
          +        int nextArg = 0;
          +        if (fn != null) {
          +            //needs callee
          +            finalArgs[nextArg++] = fn;
          +        }
          +
          +        // Don't add more args that there is argCount in the handle (including self and callee).
          +        for (int i = 0; i < args.length && nextArg < argCount;) {
          +            finalArgs[nextArg++] = args[i++];
          +        }
          +
          +        // If we have fewer args than argCount, pad with undefined.
          +        while (nextArg < argCount) {
          +            finalArgs[nextArg++] = UNDEFINED;
          +        }
          +
          +        return finalArgs;
          +    }
          +
               private static Object[] withArguments(final ScriptFunction fn, final Object self, final int argCount, final Object[] args) {
                   final Object[] finalArgs = new Object[argCount];
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
          index 331687ad3c9..1a081a1b2d5 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
          @@ -37,8 +37,6 @@ import static jdk.nashorn.internal.runtime.PropertyDescriptor.SET;
           import static jdk.nashorn.internal.runtime.PropertyDescriptor.VALUE;
           import static jdk.nashorn.internal.runtime.PropertyDescriptor.WRITABLE;
           import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.getArrayIndexNoThrow;
          -import static jdk.nashorn.internal.runtime.arrays.ArrayIndex.isValidArrayIndex;
           
           import java.lang.invoke.MethodHandle;
           import java.lang.invoke.MethodHandles;
          @@ -65,6 +63,7 @@ import jdk.nashorn.internal.lookup.MethodHandleFactory;
           import jdk.nashorn.internal.objects.AccessorPropertyDescriptor;
           import jdk.nashorn.internal.objects.DataPropertyDescriptor;
           import jdk.nashorn.internal.runtime.arrays.ArrayData;
          +import jdk.nashorn.internal.runtime.arrays.ArrayIndex;
           import jdk.nashorn.internal.runtime.linker.Bootstrap;
           import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
           import jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor;
          @@ -106,6 +105,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               /** Is this a prototype PropertyMap? */
               public static final int IS_PROTOTYPE   = 0b0000_1000;
           
          +    /** Is length property not-writable? */
          +    public static final int IS_LENGTH_NOT_WRITABLE = 0b0001_0000;
          +
               /** Spill growth rate - by how many elements does {@link ScriptObject#spill} when full */
               public static final int SPILL_RATE = 8;
           
          @@ -168,13 +170,30 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                   }
           
                   this.arrayData = ArrayData.EMPTY_ARRAY;
          +        this.setMap(map == null ? PropertyMap.newMap(getClass()) : map);
          +    }
           
          -        if (map == null) {
          -            this.setMap(PropertyMap.newMap(getClass()));
          -            return;
          +    /**
          +     * Constructor that directly sets the prototype to {@code proto} and property map to
          +     * {@code map} without invalidating the map as calling {@link #setProto(ScriptObject)}
          +     * would do. This should only be used for objects that are always constructed with the
          +     * same combination of prototype and property map.
          +     *
          +     * @param proto the prototype object
          +     * @param map intial {@link PropertyMap}
          +     */
          +    protected ScriptObject(final ScriptObject proto, final PropertyMap map) {
          +        if (Context.DEBUG) {
          +            ScriptObject.count++;
                   }
           
          -        this.setMap(map);
          +        this.arrayData = ArrayData.EMPTY_ARRAY;
          +        this.setMap(map == null ? PropertyMap.newMap(getClass()) : map);
          +        this.proto = proto;
          +
          +        if (proto != null) {
          +            proto.setIsPrototype();
          +        }
               }
           
               /**
          @@ -333,7 +352,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                       return global.newDataDescriptor(getWithProperty(property), configurable, enumerable, writable);
                   }
           
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -444,7 +463,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                       if (newValue && property != null) {
                           // Temporarily clear flags.
                           property = modifyOwnProperty(property, 0);
          -                set(key, value, getContext()._strict);
          +                set(key, value, false);
                       }
           
                       if (property == null) {
          @@ -533,21 +552,23 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * from any object in proto chain such as Array.prototype, Object.prototype.
                * This method directly sets a particular element value in the current object.
                *
          -     * @param index index key for property
          +     * @param index key for property
                * @param value value to define
                */
               protected final void defineOwnProperty(final int index, final Object value) {
          -        if (index >= getArray().length()) {
          +        assert ArrayIndex.isValidArrayIndex(index) : "invalid array index";
          +        final long longIndex = ArrayIndex.toLongIndex(index);
          +        if (longIndex >= getArray().length()) {
                       // make array big enough to hold..
          -            setArray(getArray().ensure(index));
          +            setArray(getArray().ensure(longIndex));
                   }
                   setArray(getArray().set(index, value, false));
               }
           
               private void checkIntegerKey(final String key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       final ArrayData data = getArray();
           
                       if (data.has(index)) {
          @@ -557,7 +578,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               private void removeArraySlot(final String key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -773,30 +794,18 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               public final Property modifyOwnProperty(final Property oldProperty, final int propertyFlags, final ScriptFunction getter, final ScriptFunction setter) {
                   Property newProperty;
                   if (oldProperty instanceof UserAccessorProperty) {
          -            // re-use the slots of the old user accessor property.
                       final UserAccessorProperty uc = (UserAccessorProperty) oldProperty;
          -
          -            int getterSlot = uc.getGetterSlot();
          -            // clear the old getter and set the new getter
          +            final int getterSlot = uc.getGetterSlot();
          +            final int setterSlot = uc.getSetterSlot();
                       setSpill(getterSlot, getter);
          -            // if getter function is null, flag the slot to be negative (less by 1)
          -            if (getter == null) {
          -                getterSlot = -getterSlot - 1;
          -            }
          -
          -            int setterSlot = uc.getSetterSlot();
          -            // clear the old setter and set the new setter
                       setSpill(setterSlot, setter);
          -            // if setter function is null, flag the slot to be negative (less by 1)
          -            if (setter == null) {
          -                setterSlot = -setterSlot - 1;
          +
          +            // if just flipping getter and setter with new functions, no need to change property or map
          +            if (uc.flags == propertyFlags) {
          +                return oldProperty;
                       }
           
                       newProperty = new UserAccessorProperty(oldProperty.getKey(), propertyFlags, getterSlot, setterSlot);
          -            // if just flipping getter and setter with new functions, no need to change property or map
          -            if (oldProperty.equals(newProperty)) {
          -                return oldProperty;
          -            }
                   } else {
                       // erase old property value and create new user accessor property
                       erasePropertyValue(oldProperty);
          @@ -858,12 +867,10 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                */
               public final void setUserAccessors(final String key, final ScriptFunction getter, final ScriptFunction setter) {
                   final Property oldProperty = getMap().findProperty(key);
          -        if (oldProperty != null) {
          -            final UserAccessorProperty newProperty = newUserAccessors(oldProperty.getKey(), oldProperty.getFlags(), getter, setter);
          -            modifyOwnProperty(oldProperty, newProperty);
          +        if (oldProperty instanceof UserAccessorProperty) {
          +            modifyOwnProperty(oldProperty, oldProperty.getFlags(), getter, setter);
                   } else {
          -            final UserAccessorProperty newProperty = newUserAccessors(key, 0, getter, setter);
          -            addOwnProperty(newProperty);
          +            addOwnProperty(newUserAccessors(key, oldProperty != null ? oldProperty.getFlags() : 0, getter, setter));
                   }
               }
           
          @@ -997,7 +1004,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * @param value the value to write at the given index
                */
               public void setArgument(final int key, final Object value) {
          -        set(key, value, getContext()._strict);
          +        set(key, value, false);
               }
           
               /**
          @@ -1104,7 +1111,8 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               /**
          -     * return a List of own keys associated with the object.
          +     * return an array of own property keys associated with the object.
          +     *
                * @param all True if to include non-enumerable keys.
                * @return Array of keys.
                */
          @@ -1205,7 +1213,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * the proto chain
                *
                * @param instance instace to check
          -     * @return true if instance of instance
          +     * @return true if 'instance' is an instance of this object
                */
               public boolean isInstance(final ScriptObject instance) {
                   return false;
          @@ -1276,20 +1284,36 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                *
                * @return {@code true} if is prototype
                */
          -    public boolean isPrototype() {
          +    public final boolean isPrototype() {
                   return (flags & IS_PROTOTYPE) != 0;
               }
           
               /**
                * Flag this object as having a prototype.
                */
          -    public void setIsPrototype() {
          +    public final void setIsPrototype() {
                   if (proto != null && !isPrototype()) {
                       proto.addPropertyListener(this);
                   }
                   flags |= IS_PROTOTYPE;
               }
           
          +    /**
          +     * Check if this object has non-writable length property
          +     *
          +     * @return {@code true} if 'length' property is non-writable
          +     */
          +    public final boolean isLengthNotWritable() {
          +        return (flags & IS_LENGTH_NOT_WRITABLE) != 0;
          +    }
          +
          +    /**
          +     * Flag this object as having non-writable length property
          +     */
          +    public void setIsLengthNotWritable() {
          +        flags |= IS_LENGTH_NOT_WRITABLE;
          +    }
          +
               /**
                * Get the {@link ArrayData} for this ScriptObject if it is an array
                * @return array data
          @@ -1362,7 +1386,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               /**
                * Check whether this ScriptObject is frozen
          -     * @return true if frozed
          +     * @return true if frozen
                */
               public boolean isFrozen() {
                   return getMap().isFrozen();
          @@ -1392,7 +1416,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * (java.util.Map-like method to help ScriptObjectMirror implementation)
                */
               public void clear() {
          -        final boolean strict = getContext()._strict;
          +        final boolean strict = isStrictContext();
                   final Iterator iter = propertyIterator();
                   while (iter.hasNext()) {
                       delete(iter.next(), strict);
          @@ -1480,7 +1504,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                */
               public Object put(final Object key, final Object value) {
                   final Object oldValue = get(key);
          -        set(key, value, getContext()._strict);
          +        set(key, value, isStrictContext());
                   return oldValue;
               }
           
          @@ -1492,7 +1516,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * @param otherMap a {@literal } map of properties to add
                */
               public void putAll(final Map otherMap) {
          -        final boolean strict = getContext()._strict;
          +        final boolean strict = isStrictContext();
                   for (final Map.Entry entry : otherMap.entrySet()) {
                       set(entry.getKey(), entry.getValue(), strict);
                   }
          @@ -1507,7 +1531,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                */
               public Object remove(final Object key) {
                   final Object oldValue = get(key);
          -        delete(key, getContext()._strict);
          +        delete(key, isStrictContext());
                   return oldValue;
               }
           
          @@ -1519,7 +1543,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * @return if the delete was successful or not
                */
               public boolean delete(final Object key) {
          -        return delete(key, getContext()._strict);
          +        return delete(key, isStrictContext());
               }
           
               /**
          @@ -1691,7 +1715,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
                       final ScriptObject prototype = find.getOwner();
           
          -            if (!property.hasGetterFunction()) {
          +            if (!property.hasGetterFunction(prototype)) {
                           methodHandle = bindTo(methodHandle, prototype);
                       }
                       return new GuardedInvocation(methodHandle, getMap().getProtoGetSwitchPoint(proto, name), guard);
          @@ -2221,7 +2245,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                      return;
                  }
           
          -       final boolean isStrict = getContext()._strict;
          +       final boolean isStrict = isStrictContext();
           
                  if (newLength > arrayLength) {
                      setArray(getArray().ensure(newLength - 1));
          @@ -2238,7 +2262,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               private int getInt(final int index, final String key) {
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                        for (ScriptObject object = this; ; ) {
                           final FindProperty find = object.findProperty(key, false, false, this);
           
          @@ -2269,7 +2293,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public int getInt(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2281,7 +2305,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public int getInt(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2293,7 +2317,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public int getInt(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2315,7 +2339,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               private long getLong(final int index, final String key) {
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject object = this; ; ) {
                           final FindProperty find = object.findProperty(key, false, false, this);
           
          @@ -2346,7 +2370,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public long getLong(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2358,7 +2382,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public long getLong(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2370,7 +2394,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public long getLong(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2392,7 +2416,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               private double getDouble(final int index, final String key) {
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject object = this; ; ) {
                           final FindProperty find = object.findProperty(key, false, false, this);
           
          @@ -2423,7 +2447,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public double getDouble(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2435,7 +2459,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public double getDouble(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2447,7 +2471,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public double getDouble(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2469,7 +2493,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
               }
           
               private Object get(final int index, final String key) {
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject object = this; ; ) {
                           final FindProperty find = object.findProperty(key, false, false, this);
           
          @@ -2500,7 +2524,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public Object get(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2512,7 +2536,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public Object get(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2524,7 +2548,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public Object get(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -2640,9 +2664,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final Object key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2657,9 +2681,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final Object key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2674,9 +2698,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final Object key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2691,9 +2715,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final Object key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2711,9 +2735,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final double key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2728,9 +2752,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final double key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2745,9 +2769,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final double key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2762,9 +2786,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final double key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2779,9 +2803,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final long key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2796,9 +2820,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final long key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2813,9 +2837,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final long key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2830,9 +2854,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final long key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2847,9 +2871,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final int key, final int value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2864,9 +2888,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final int key, final long value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2881,9 +2905,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final int key, final double value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2898,9 +2922,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public void set(final int key, final Object value, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       if (getArray().has(index)) {
                           setArray(getArray().set(index, value, strict));
                       } else {
          @@ -2915,9 +2939,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean has(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject self = this; self != null; self = self.getProto()) {
                           if (self.getArray().has(index)) {
                               return true;
          @@ -2932,9 +2956,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean has(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject self = this; self != null; self = self.getProto()) {
                           if (self.getArray().has(index)) {
                               return true;
          @@ -2949,9 +2973,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean has(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject self = this; self != null; self = self.getProto()) {
                           if (self.getArray().has(index)) {
                               return true;
          @@ -2966,9 +2990,9 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean has(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
          -        if (isValidArrayIndex(index)) {
          +        if (ArrayIndex.isValidArrayIndex(index)) {
                       for (ScriptObject self = this; self != null; self = self.getProto()) {
                           if (self.getArray().has(index)) {
                               return true;
          @@ -2983,7 +3007,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean hasOwnProperty(final Object key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
                   if (getArray().has(index)) {
                       return true;
          @@ -2996,7 +3020,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean hasOwnProperty(final int key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
                   if (getArray().has(index)) {
                       return true;
          @@ -3009,7 +3033,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean hasOwnProperty(final long key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
                   if (getArray().has(index)) {
                       return true;
          @@ -3022,7 +3046,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean hasOwnProperty(final double key) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
           
                   if (getArray().has(index)) {
                       return true;
          @@ -3035,7 +3059,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean delete(final int key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -3051,7 +3075,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean delete(final long key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -3067,7 +3091,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean delete(final double key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -3083,7 +3107,7 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
           
               @Override
               public boolean delete(final Object key, final boolean strict) {
          -        final int index = getArrayIndexNoThrow(key);
          +        final int index = ArrayIndex.getArrayIndex(key);
                   final ArrayData array = getArray();
           
                   if (array.has(index)) {
          @@ -3123,49 +3147,30 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
                * Make a new UserAccessorProperty property. getter and setter functions are stored in
                * this ScriptObject and slot values are used in property object.
                */
          -    private UserAccessorProperty newUserAccessors(final String key, final int propertyFlags, final ScriptFunction getter, final ScriptFunction setter) {
          -        int oldSpillLength = getMap().getSpillLength();
          +    protected final UserAccessorProperty newUserAccessors(final String key, final int propertyFlags, final ScriptFunction getter, final ScriptFunction setter) {
          +        final UserAccessorProperty property = getMap().newUserAccessors(key, propertyFlags);
          +        setSpill(property.getGetterSlot(), getter);
          +        setSpill(property.getSetterSlot(), setter);
           
          -        int getterSlot = oldSpillLength++;
          -        setSpill(getterSlot, getter);
          -        // if getter function is null, flag the slot to be negative (less by 1)
          -        if (getter == null) {
          -            getterSlot = -getterSlot - 1;
          -        }
          -
          -        int setterSlot = oldSpillLength++;
          -
          -        setSpill(setterSlot, setter);
          -        // if setter function is null, flag the slot to be negative (less by 1)
          -        if (setter == null) {
          -            setterSlot = -setterSlot - 1;
          -        }
          -
          -        return new UserAccessorProperty(key, propertyFlags, getterSlot, setterSlot);
          +        return property;
               }
           
          -    private void setSpill(final int slot, final Object value) {
          -        if (slot >= 0) {
          -            final int index = slot;
          -            if (spill == null) {
          -                // create new spill.
          -                spill = new Object[Math.max(index + 1, SPILL_RATE)];
          -            } else if (index >= spill.length) {
          -                // grow spill as needed
          -                final Object[] newSpill = new Object[index + 1];
          -                System.arraycopy(spill, 0, newSpill, 0, spill.length);
          -                spill = newSpill;
          -            }
          -
          -            spill[index] = value;
          +    protected final void setSpill(final int slot, final Object value) {
          +        if (spill == null) {
          +            // create new spill.
          +            spill = new Object[Math.max(slot + 1, SPILL_RATE)];
          +        } else if (slot >= spill.length) {
          +            // grow spill as needed
          +            final Object[] newSpill = new Object[slot + 1];
          +            System.arraycopy(spill, 0, newSpill, 0, spill.length);
          +            spill = newSpill;
                   }
          +
          +        spill[slot] = value;
               }
           
          -    // user accessors are either stored in spill array slots
          -    // get the accessor value using slot number. Note that slot is spill array index.
          -    Object getSpill(final int slot) {
          -        final int index = slot;
          -        return (index < 0 || (index >= spill.length)) ? null : spill[index];
          +    protected Object getSpill(final int slot) {
          +        return spill != null && slot < spill.length ? spill[slot] : null;
               }
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
          index d5ab68b2ed2..15c915cf0e4 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptRuntime.java
          @@ -120,6 +120,17 @@ public final class ScriptRuntime {
                   return deflt;
               }
           
          +    /**
          +     * Converts a switch tag value to a simple integer. deflt value if it can't.
          +     *
          +     * @param tag   Switch statement tag value.
          +     * @param deflt default to use if not convertible.
          +     * @return int tag value (or deflt.)
          +     */
          +    public static int switchTagAsInt(final boolean tag, final int deflt) {
          +        return deflt;
          +    }
          +
               /**
                * Converts a switch tag value to a simple integer. deflt value if it can't.
                *
          @@ -360,6 +371,47 @@ public final class ScriptRuntime {
                   }
               }
           
          +    /**
          +     * Check that the target function is associated with current Context.
          +     * And also make sure that 'self', if ScriptObject, is from current context.
          +     *
          +     * Call a function as a constructor given args.
          +     *
          +     * @param target ScriptFunction object.
          +     * @param args   Call arguments.
          +     * @return Constructor call result.
          +     */
          +    public static Object checkAndConstruct(final ScriptFunction target, final Object... args) {
          +        final ScriptObject global = Context.getGlobalTrusted();
          +        if (! (global instanceof GlobalObject)) {
          +            throw new IllegalStateException("No current global set");
          +        }
          +
          +        if (target.getContext() != global.getContext()) {
          +            throw new IllegalArgumentException("'target' function is not from current Context");
          +        }
          +
          +        // all in order - call real 'construct'
          +        return construct(target, args);
          +    }
          +
          +    /*
          +     * Call a script function as a constructor with given args.
          +     *
          +     * @param target ScriptFunction object.
          +     * @param args   Call arguments.
          +     * @return Constructor call result.
          +     */
          +    public static Object construct(final ScriptFunction target, final Object... args) {
          +        try {
          +            return target.construct(args);
          +        } catch (final RuntimeException | Error e) {
          +            throw e;
          +        } catch (final Throwable t) {
          +            throw new RuntimeException(t);
          +        }
          +    }
          +
               /**
                * Generic implementation of ECMA 9.12 - SameValue algorithm
                *
          @@ -825,6 +877,13 @@ public final class ScriptRuntime {
                       return ((StaticClass)clazz).getRepresentedClass().isInstance(obj);
                   }
           
          +        if (clazz instanceof ScriptObjectMirror) {
          +            if (obj instanceof ScriptObjectMirror) {
          +                return ((ScriptObjectMirror)clazz).isInstance((ScriptObjectMirror)obj);
          +            }
          +            return false;
          +        }
          +
                   throw typeError("instanceof.on.non.object");
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java
          index ee1639d01a5..6bd0479f2aa 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptingFunctions.java
          @@ -221,10 +221,9 @@ public final class ScriptingFunctions {
                   final String err = errBuffer.toString();
           
                   // Set globals for secondary results.
          -        final boolean isStrict = global.isStrictContext();
          -        global.set(OUT_NAME, out, isStrict);
          -        global.set(ERR_NAME, err, isStrict);
          -        global.set(EXIT_NAME, exit, isStrict);
          +        global.set(OUT_NAME, out, false);
          +        global.set(ERR_NAME, err, false);
          +        global.set(EXIT_NAME, exit, false);
           
                   // Propagate exception if present.
                   for (int i = 0; i < exception.length; i++) {
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java b/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java
          index a6dfce0f5fd..777254d831c 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/SetMethodCreator.java
          @@ -151,9 +151,10 @@ final class SetMethodCreator {
                   assert methodHandle != null;
                   assert property     != null;
           
          +        final ScriptObject prototype = find.getOwner();
                   final MethodHandle boundHandle;
          -        if (!property.hasSetterFunction() && find.isInherited()) {
          -            boundHandle = ScriptObject.bindTo(methodHandle, find.getOwner());
          +        if (!property.hasSetterFunction(prototype) && find.isInherited()) {
          +            boundHandle = ScriptObject.bindTo(methodHandle, prototype);
                   } else {
                       boundHandle = methodHandle;
                   }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Source.java b/nashorn/src/jdk/nashorn/internal/runtime/Source.java
          index 24c041a81aa..b5033e95534 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/Source.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/Source.java
          @@ -116,7 +116,20 @@ public final class Source {
                * @throws IOException if source cannot be loaded
                */
               public Source(final String name, final URL url) throws IOException {
          -        this(name, baseURL(url, null), readFully(url.openStream()), url);
          +        this(name, baseURL(url, null), readFully(url), url);
          +    }
          +
          +    /**
          +     * Constructor
          +     *
          +     * @param name  source name
          +     * @param url   url from which source can be loaded
          +     * @param cs    Charset used to convert bytes to chars
          +     *
          +     * @throws IOException if source cannot be loaded
          +     */
          +    public Source(final String name, final URL url, final Charset cs) throws IOException {
          +        this(name, baseURL(url, null), readFully(url, cs), url);
               }
           
               /**
          @@ -131,6 +144,19 @@ public final class Source {
                   this(name, dirName(file, null), readFully(file), getURLFromFile(file));
               }
           
          +    /**
          +     * Constructor
          +     *
          +     * @param name  source name
          +     * @param file  file from which source can be loaded
          +     * @param cs    Charset used to convert bytes to chars
          +     *
          +     * @throws IOException if source cannot be loaded
          +     */
          +    public Source(final String name, final File file, final Charset cs) throws IOException {
          +        this(name, dirName(file, null), readFully(file, cs), getURLFromFile(file));
          +    }
          +
               @Override
               public boolean equals(final Object obj) {
                   if (this == obj) {
          @@ -343,6 +369,53 @@ public final class Source {
                   return byteToCharArray(Files.readAllBytes(file.toPath()));
               }
           
          +    /**
          +     * Read all of the source until end of file. Return it as char array
          +     *
          +     * @param file  source file
          +     * @param cs Charset used to convert bytes to chars
          +     * @return source as content
          +     *
          +     * @throws IOException if source could not be read
          +     */
          +    public static char[] readFully(final File file, final Charset cs) throws IOException {
          +        if (!file.isFile()) {
          +            throw new IOException(file + " is not a file"); //TODO localize?
          +        }
          +
          +        final byte[] buf = Files.readAllBytes(file.toPath());
          +        if (cs != null) {
          +            return new String(buf, cs).toCharArray();
          +        } else {
          +            return byteToCharArray(buf);
          +        }
          +    }
          +
          +    /**
          +     * Read all of the source until end of stream from the given URL. Return it as char array
          +     *
          +     * @param url URL to read content from
          +     * @return source as content
          +     *
          +     * @throws IOException if source could not be read
          +     */
          +    public static char[] readFully(final URL url) throws IOException {
          +        return readFully(url.openStream());
          +    }
          +
          +    /**
          +     * Read all of the source until end of file. Return it as char array
          +     *
          +     * @param url URL to read content from
          +     * @param cs Charset used to convert bytes to chars
          +     * @return source as content
          +     *
          +     * @throws IOException if source could not be read
          +     */
          +    public static char[] readFully(final URL url, final Charset cs) throws IOException {
          +        return readFully(url.openStream(), cs);
          +    }
          +
               /**
                * Get the base url. This is currently used for testing only
                * @param url a URL
          @@ -391,6 +464,14 @@ public final class Source {
                   return (idx != -1)? name.substring(0, idx + 1) : defaultValue;
               }
           
          +    private static char[] readFully(final InputStream is, final Charset cs) throws IOException {
          +        if (cs != null) {
          +            return new String(readBytes(is), cs).toCharArray();
          +        } else {
          +            return readFully(is);
          +        }
          +    }
          +
               private static char[] readFully(final InputStream is) throws IOException {
                   return byteToCharArray(readBytes(is));
               }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/URIUtils.java b/nashorn/src/jdk/nashorn/internal/runtime/URIUtils.java
          index 448d72c364f..2321353fbaa 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/URIUtils.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/URIUtils.java
          @@ -27,8 +27,6 @@ package jdk.nashorn.internal.runtime;
           
           import static jdk.nashorn.internal.runtime.ECMAErrors.uriError;
           
          -import java.io.UnsupportedEncodingException;
          -
           /**
            * URI handling global functions. ECMA 15.1.3 URI Handling Function Properties
            *
          @@ -127,6 +125,7 @@ public final class URIUtils {
           
                       k += 2;
                       char C;
          +            // Most significant bit is zero
                       if ((B & 0x80) == 0) {
                           C = (char) B;
                           if (!component && URI_RESERVED.indexOf(C) >= 0) {
          @@ -137,49 +136,68 @@ public final class URIUtils {
                               sb.append(C);
                           }
                       } else {
          -                int n;
          -                for (n = 1; n < 6; n++) {
          -                    if (((B << n) & 0x80) == 0) {
          -                        break;
          -                    }
          -                }
          +                // n is utf8 length, V is codepoint and minV is lower bound
          +                int n, V, minV;
           
          -                if (n == 1 || n > 4) {
          +                if ((B & 0xC0) == 0x80) {
          +                    // 10xxxxxx - illegal first byte
          +                    return error(string, k);
          +                } else if ((B & 0x20) == 0) {
          +                    // 110xxxxx 10xxxxxx
          +                    n = 2;
          +                    V = B & 0x1F;
          +                    minV = 0x80;
          +                } else if ((B & 0x10) == 0) {
          +                    // 1110xxxx 10xxxxxx 10xxxxxx
          +                    n = 3;
          +                    V = B & 0x0F;
          +                    minV = 0x800;
          +                } else if ((B & 0x08) == 0) {
          +                    // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
          +                    n = 4;
          +                    V = B & 0x07;
          +                    minV = 0x10000;
          +                } else if ((B & 0x04) == 0) {
          +                    // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
          +                    n = 5;
          +                    V =  B & 0x03;
          +                    minV = 0x200000;
          +                } else if ((B & 0x02) == 0) {
          +                    // 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
          +                    n = 6;
          +                    V = B & 0x01;
          +                    minV = 0x4000000;
          +                } else {
                               return error(string, k);
                           }
           
          -                if ((k + (3 * (n - 1))) >= len) {
          +                // check bound for sufficient chars
          +                if (k + (3*(n-1)) >= len) {
                               return error(string, k);
                           }
           
          -                final byte[] bbuf = new byte[n];
          -                bbuf[0] = (byte) B;
          -
                           for (int j = 1; j < n; j++) {
                               k++;
                               if (string.charAt(k) != '%') {
                                   return error(string, k);
                               }
           
          -                    if (k + 2 == len) {
          -                        return error(string, k);
          -                    }
          -
                               B = toHexByte(string.charAt(k + 1), string.charAt(k + 2));
                               if (B < 0 || (B & 0xC0) != 0x80) {
                                   return error(string, k + 1);
                               }
           
          +                    V = (V << 6) | (B & 0x3F);
                               k += 2;
          -                    bbuf[j] = (byte) B;
                           }
           
          -                int V;
          -                try {
          -                    V = ucs4Char(bbuf);
          -                } catch (final Exception e) {
          -                    throw uriError(e, "bad.uri", string, Integer.toString(k));
          +                // Check for overlongs and invalid codepoints.
          +                // The high and low surrogate halves used by UTF-16
          +                // (U+D800 through U+DFFF) are not legal Unicode values.
          +                if ((V < minV) || (V >= 0xD800 && V <= 0xDFFF)) {
          +                    V = Integer.MAX_VALUE;
                           }
          +
                           if (V < 0x10000) {
                               C = (char) V;
                               if (!component && URI_RESERVED.indexOf(C) >= 0) {
          @@ -224,10 +242,6 @@ public final class URIUtils {
                   return -1;
               }
           
          -    private static int ucs4Char(final byte[] utf8) throws UnsupportedEncodingException {
          -        return new String(utf8, "UTF-8").codePointAt(0);
          -    }
          -
               private static String toHexEscape(final int u0) {
                   int u = u0;
                   int len;
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/UserAccessorProperty.java b/nashorn/src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
          index 5159e6537b0..1dc64311545 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
          @@ -96,19 +96,19 @@ public final class UserAccessorProperty extends Property {
               }
           
               /**
          -     * Return getter slot for this UserAccessorProperty. Slots start with first embed field.
          +     * Return getter spill slot for this UserAccessorProperty.
                * @return getter slot
                */
               public int getGetterSlot() {
          -        return getterSlot < 0 ? -getterSlot - 1 : getterSlot;
          +        return getterSlot;
               }
           
               /**
          -     * Return setter slot for this UserAccessorProperty. Slots start with first embed field.
          +     * Return setter spill slot for this UserAccessorProperty.
                * @return setter slot
                */
               public int getSetterSlot() {
          -        return setterSlot < 0 ? -setterSlot - 1 : setterSlot;
          +        return setterSlot;
               }
           
               @Override
          @@ -124,7 +124,7 @@ public final class UserAccessorProperty extends Property {
           
                   final UserAccessorProperty uc = (UserAccessorProperty) other;
                   return getterSlot == uc.getterSlot && setterSlot == uc.setterSlot;
          -     }
          +    }
           
               @Override
               public int hashCode() {
          @@ -136,34 +136,26 @@ public final class UserAccessorProperty extends Property {
                */
               @Override
               public int getSpillCount() {
          -        // calculate how many spill array slots used by this propery.
          -        int count = 0;
          -        if (getGetterSlot() >= 0) {
          -            count++;
          -        }
          -        if (getSetterSlot() >= 0) {
          -            count++;
          -        }
          -        return count;
          +        return 2;
               }
           
               @Override
          -    public boolean hasGetterFunction() {
          -        return getterSlot > -1;
          +    public boolean hasGetterFunction(final ScriptObject obj) {
          +        return obj.getSpill(getterSlot) != null;
               }
           
               @Override
          -    public boolean hasSetterFunction() {
          -        return setterSlot > -1;
          +    public boolean hasSetterFunction(final ScriptObject obj) {
          +        return obj.getSpill(setterSlot) != null;
               }
           
               @Override
          -    protected Object getObjectValue(final ScriptObject self, final ScriptObject owner) {
          +    public Object getObjectValue(final ScriptObject self, final ScriptObject owner) {
                   return userAccessorGetter(owner, getGetterSlot(), self);
               }
           
               @Override
          -    protected void setObjectValue(final ScriptObject self, final ScriptObject owner, final Object value, final boolean strict) {
          +    public void setObjectValue(final ScriptObject self, final ScriptObject owner, final Object value, final boolean strict) {
                   userAccessorSetter(owner, getSetterSlot(), strict ? getKey() : null, self, value);
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
          index fca724a8bf3..d11059b275d 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java
          @@ -294,6 +294,29 @@ public abstract class ArrayData {
                */
               public abstract ArrayData set(int index, double value, boolean strict);
           
          +    /**
          +     * Set an empty value at a given index. Should only affect Object array.
          +     *
          +     * @param index the index
          +     * @return new array data (or same)
          +     */
          +    public ArrayData setEmpty(final int index) {
          +        // Do nothing.
          +        return this;
          +    }
          +
          +    /**
          +     * Set an empty value for a given range. Should only affect Object array.
          +     *
          +     * @param lo range low end
          +     * @param hi range high end
          +     * @return new array data (or same)
          +     */
          +    public ArrayData setEmpty(final long lo, final long hi) {
          +        // Do nothing.
          +        return this;
          +    }
          +
               /**
                * Get an int value from a given index
                *
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java
          index c347ed70e8b..7a20f788fda 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java
          @@ -128,6 +128,18 @@ abstract class ArrayFilter extends ArrayData {
                   return this;
               }
           
          +    @Override
          +    public ArrayData setEmpty(final int index) {
          +        underlying.setEmpty(index);
          +        return this;
          +    }
          +
          +    @Override
          +    public ArrayData setEmpty(final long lo, final long hi) {
          +        underlying.setEmpty(lo, hi);
          +        return this;
          +    }
          +
               @Override
               public int getInt(final int index) {
                   return underlying.getInt(index);
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
          index 531c56b50f8..f59229c40ec 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIndex.java
          @@ -44,7 +44,7 @@ public final class ArrayIndex {
               /**
                * Fast conversion of non-negative integer string to long.
                * @param key Key as a string.
          -     * @return long value of string or -1.
          +     * @return long value of string or {@code -1} if string does not represent a valid index.
                */
               private static long fromString(final String key) {
                   long value = 0;
          @@ -52,7 +52,7 @@ public final class ArrayIndex {
           
                   // Check for empty string or leading 0
                   if (length == 0 || (length > 1 && key.charAt(0) == '0')) {
          -            return -1;
          +            return INVALID_ARRAY_INDEX;
                   }
           
                   // Fast toNumber.
          @@ -61,7 +61,7 @@ public final class ArrayIndex {
           
                       // If not a digit.
                       if (digit < '0' || digit > '9') {
          -                return -1;
          +                return INVALID_ARRAY_INDEX;
                       }
           
                       // Insert digit.
          @@ -69,7 +69,7 @@ public final class ArrayIndex {
           
                       // Check for overflow (need to catch before wrap around.)
                       if (value > MAX_ARRAY_INDEX) {
          -                return -1;
          +                return INVALID_ARRAY_INDEX;
                       }
                   }
           
          @@ -81,136 +81,78 @@ public final class ArrayIndex {
                * routine needs to perform quickly since all keys are tested with it.
                *
                * @param  key key to check for array index
          -     * @return valid array index, or negative value if not valid
          +     * @return the array index, or {@code -1} if {@code key} does not represent a valid index.
          +     *         Note that negative return values other than {@code -1} are considered valid and can be converted to
          +     *         the actual index using {@link #toLongIndex(int)}.
                */
          -    public static int getArrayIndexNoThrow(final Object key) {
          +    public static int getArrayIndex(final Object key) {
                   if (key instanceof Integer) {
          -            return getArrayIndexNoThrow(((Integer)key).intValue());
          +            return getArrayIndex(((Integer) key).intValue());
                   } else if (key instanceof Number) {
          -            return getArrayIndexNoThrow(((Number)key).doubleValue());
          +            return getArrayIndex(((Number) key).doubleValue());
                   } else if (key instanceof String) {
          -            return (int)fromString((String)key);
          +            return (int)fromString((String) key);
                   } else if (key instanceof ConsString) {
                       return (int)fromString(key.toString());
                   }
           
          -        return -1;
          +        return INVALID_ARRAY_INDEX;
               }
           
               /**
          -     * Returns a valid array index in an int, if the object represents one
          +     * Returns a valid array index in an int, if the long represents one.
                *
                * @param key key to check
          -     * @return array index for key
          -     * @throws InvalidArrayIndexException if not a valid array index key
          +     * @return the array index, or {@code -1} if long is not a valid array index.
          +     *         Note that negative return values other than {@code -1} are considered valid and can be converted to
          +     *         the actual index using {@link #toLongIndex(int)}.
                */
          -    public static int getArrayIndex(final Object key) throws InvalidArrayIndexException {
          -        final int index = getArrayIndexNoThrow(key);
          -        if (index != -1) {
          -            return index;
          -        }
          -
          -        throw new InvalidArrayIndexException(key);
          -    }
          -
          -    /**
          -     * Returns a valid array index in an int, if the long represents one
          -     *
          -     * @param key key to check
          -     * @return valid index or a negative value if long is not a valid array index
          -     */
          -    public static int getArrayIndexNoThrow(final long key) {
          +    public static int getArrayIndex(final long key) {
                   if (key >= 0 && key <= MAX_ARRAY_INDEX) {
                       return (int)key;
                   }
           
          -        return -1;
          -    }
          -
          -    /**
          -     * Returns a valid array index in an int, if the long represents one
          -     *
          -     * @param key key to check
          -     * @return valid index for the long
          -     * @throws InvalidArrayIndexException if long is not a valid array index
          -     */
          -    public static int getArrayIndex(final long key) throws InvalidArrayIndexException {
          -        final int index = getArrayIndexNoThrow(key);
          -        if (index != -1) {
          -            return index;
          -        }
          -
          -        throw new InvalidArrayIndexException(key);
          +        return INVALID_ARRAY_INDEX;
               }
           
           
               /**
          -     * Return a valid index for this double, if it represents one
          +     * Return a valid index for this double, if it represents one.
                *
                * Doubles that aren't representable exactly as longs/ints aren't working
                * array indexes, however, array[1.1] === array["1.1"] in JavaScript.
                *
                * @param key the key to check
          -     * @return the array index this double represents or a negative value if this isn't an index
          +     * @return the array index this double represents or {@code -1} if this isn't a valid index.
          +     *         Note that negative return values other than {@code -1} are considered valid and can be converted to
          +     *         the actual index using {@link #toLongIndex(int)}.
                */
          -    public static int getArrayIndexNoThrow(final double key) {
          +    public static int getArrayIndex(final double key) {
                   if (JSType.isRepresentableAsInt(key)) {
                       final int intKey = (int)key;
                       if (intKey >= 0) {
                           return intKey;
                       }
                   } else if (JSType.isRepresentableAsLong(key)) {
          -            return getArrayIndexNoThrow((long)key);
          +            return getArrayIndex((long) key);
                   }
           
          -        return -1;
          +        return INVALID_ARRAY_INDEX;
               }
           
          -    /**
          -     * Return a valid array index for this double, if it represents one
          -     *
          -     * Doubles that aren't representable exactly as longs/ints aren't working
          -     * array indexes, however, array[1.1] === array["1.1"] in JavaScript.
          -     *
          -     * @param key the key to check
          -     * @return the array index this double represents
          -     * @throws InvalidArrayIndexException if this isn't an array index
          -     */
          -    public static int getArrayIndex(final double key) throws InvalidArrayIndexException {
          -        final int index = getArrayIndexNoThrow(key);
          -        if (index != -1) {
          -            return index;
          -        }
          -
          -        throw new InvalidArrayIndexException(key);
          -    }
           
               /**
          -     * Return a valid array index for this string, if it represents one
          +     * Return a valid array index for this string, if it represents one.
                *
                * @param key the key to check
          -     * @return the array index this string represents or a negative value if this isn't an index
          +     * @return the array index this string represents or {@code -1} if this isn't a valid index.
          +     *         Note that negative return values other than {@code -1} are considered valid and can be converted to
          +     *         the actual index using {@link #toLongIndex(int)}.
                */
          -    public static int getArrayIndexNoThrow(final String key) {
          +    public static int getArrayIndex(final String key) {
                   return (int)fromString(key);
               }
           
          -    /**
          -     * Return a valid array index for this string, if it represents one
          -     *
          -     * @param key the key to check
          -     * @return the array index this string represents
          -     * @throws InvalidArrayIndexException if the string isn't an array index
          -     */
          -    public static int getArrayIndex(final String key) throws InvalidArrayIndexException {
          -        final int index = getArrayIndexNoThrow(key);
          -        if (index != -1) {
          -            return index;
          -        }
          -
          -        throw new InvalidArrayIndexException(key);
          -    }
          -
               /**
                * Check whether an index is valid as an array index. This check only tests if
                * it is the special "invalid array index" type, not if it is e.g. less than zero
          @@ -226,7 +168,7 @@ public final class ArrayIndex {
               /**
                * Convert an index to a long value. This basically amounts to ANDing it
                * with {@link JSType#MAX_UINT}, as the maximum array index in JavaScript
          -     * is 0xffffffff
          +     * is 0xfffffffe
                *
                * @param index index to convert to long form
                * @return index as uint32 in a long
          @@ -236,14 +178,14 @@ public final class ArrayIndex {
               }
           
               /**
          -     * Check whether a key string can be used as a valid numeric array index in
          -     * JavaScript
          +     * Check whether a key string represents a valid array index in JavaScript and is small enough
          +     * to fit into a positive int.
                *
                * @param key the key
          -     * @return true if key works as a valid numeric array index
          +     * @return true if key works as a valid int array index
                */
          -    public static boolean isIndexKey(final String key) {
          -       return ArrayIndex.getArrayIndexNoThrow(key) >= 0;
          +    public static boolean isIntArrayIndex(final String key) {
          +        return getArrayIndex(key) >= 0;
               }
           }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
          index e250c748a62..71d4d15205e 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayIterator.java
          @@ -83,6 +83,6 @@ public class ArrayIterator extends ArrayLikeIterator {
           
               @Override
               public void remove() {
          -        array.delete(index, array.isStrictContext());
          +        array.delete(index, false);
               }
           }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayLikeIterator.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayLikeIterator.java
          index 48505f4471e..70f74d8e342 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayLikeIterator.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ArrayLikeIterator.java
          @@ -26,6 +26,7 @@
           package jdk.nashorn.internal.runtime.arrays;
           
           import java.util.Iterator;
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
           import jdk.nashorn.internal.runtime.JSType;
           import jdk.nashorn.internal.runtime.ScriptObject;
           
          @@ -125,6 +126,10 @@ abstract public class ArrayLikeIterator implements Iterator {
                       return new MapIterator((ScriptObject)obj, includeUndefined);
                   }
           
          +        if (obj instanceof ScriptObjectMirror) {
          +            return new ScriptObjectMirrorIterator((ScriptObjectMirror)obj, includeUndefined);
          +        }
          +
                   return new EmptyArrayLikeIterator();
               }
           
          @@ -146,6 +151,10 @@ abstract public class ArrayLikeIterator implements Iterator {
                       return new ReverseMapIterator((ScriptObject)obj, includeUndefined);
                   }
           
          +        if (obj instanceof ScriptObjectMirror) {
          +            return new ReverseScriptObjectMirrorIterator((ScriptObjectMirror)obj, includeUndefined);
          +        }
          +
                   assert !obj.getClass().isArray();
           
                   return new EmptyArrayLikeIterator();
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java
          index 57bea4cf1e6..b5f1f16d024 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java
          @@ -142,6 +142,7 @@ final class DeletedArrayFilter extends ArrayFilter {
                   final long longIndex = ArrayIndex.toLongIndex(index);
                   assert longIndex >= 0 && longIndex < length();
                   deleted.set(longIndex);
          +        underlying.setEmpty(index);
                   return this;
               }
           
          @@ -149,6 +150,7 @@ final class DeletedArrayFilter extends ArrayFilter {
               public ArrayData delete(final long fromIndex, final long toIndex) {
                   assert fromIndex >= 0 && fromIndex <= toIndex && toIndex < length();
                   deleted.setRange(fromIndex, toIndex + 1);
          +        underlying.setEmpty(fromIndex, toIndex);
                   return this;
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java
          index 588252ac4f2..29c443bae10 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java
          @@ -202,6 +202,8 @@ final class DeletedRangeArrayFilter extends ArrayFilter {
               @Override
               public ArrayData delete(final int index) {
                   final long longIndex = ArrayIndex.toLongIndex(index);
          +        underlying.setEmpty(index);
          +
                   if (longIndex + 1 == lo) {
                       lo = longIndex;
                   } else if (longIndex - 1 == hi) {
          @@ -220,6 +222,7 @@ final class DeletedRangeArrayFilter extends ArrayFilter {
                   }
                   lo = Math.min(fromIndex, lo);
                   hi = Math.max(toIndex, hi);
          +        underlying.setEmpty(lo, hi);
                   return this;
               }
           
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/IteratorAction.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/IteratorAction.java
          index 7568f41b766..91b20e5d222 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/IteratorAction.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/IteratorAction.java
          @@ -27,6 +27,7 @@ package jdk.nashorn.internal.runtime.arrays;
           
           import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
           
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
           import jdk.nashorn.internal.runtime.Context;
           import jdk.nashorn.internal.runtime.ScriptFunction;
           import jdk.nashorn.internal.runtime.ScriptRuntime;
          @@ -96,12 +97,18 @@ public abstract class IteratorAction {
                * @return result of apply
                */
               public final T apply() {
          -        if (!(callbackfn instanceof ScriptFunction)) {
          +        final boolean strict;
          +        if (callbackfn instanceof ScriptFunction) {
          +            strict = ((ScriptFunction)callbackfn).isStrict();
          +        } else if (callbackfn instanceof ScriptObjectMirror &&
          +            ((ScriptObjectMirror)callbackfn).isFunction()) {
          +            strict = ((ScriptObjectMirror)callbackfn).isStrictFunction();
          +        } else {
                       throw typeError("not.a.function", ScriptRuntime.safeToString(callbackfn));
                   }
          -        final ScriptFunction func = ((ScriptFunction)callbackfn);
          +
                   // for non-strict callback, need to translate undefined thisArg to be global object
          -        thisArg = (thisArg == ScriptRuntime.UNDEFINED && !func.isStrict()) ? Context.getGlobal() : thisArg;
          +        thisArg = (thisArg == ScriptRuntime.UNDEFINED && !strict)? Context.getGlobal() : thisArg;
           
                   applyLoopBegin(iter);
                   final boolean reverse = iter.isReverse();
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java
          index cb1e2fa03ba..4b1f58a430a 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java
          @@ -138,6 +138,18 @@ final class ObjectArrayData extends ArrayData {
                   return this;
               }
           
          +    @Override
          +    public ArrayData setEmpty(final int index) {
          +        array[index] = ScriptRuntime.EMPTY;
          +        return this;
          +    }
          +
          +    @Override
          +    public ArrayData setEmpty(final long lo, final long hi) {
          +        Arrays.fill(array, (int)Math.max(lo, 0L), (int)Math.min(hi, (long)Integer.MAX_VALUE), ScriptRuntime.EMPTY);
          +        return this;
          +    }
          +
               @Override
               public int getInt(final int index) {
                   return JSType.toInt32(array[index]);
          @@ -165,11 +177,13 @@ final class ObjectArrayData extends ArrayData {
           
               @Override
               public ArrayData delete(final int index) {
          +        setEmpty(index);
                   return new DeletedRangeArrayFilter(this, index, index);
               }
           
               @Override
               public ArrayData delete(final long fromIndex, final long toIndex) {
          +        setEmpty(fromIndex, toIndex);
                   return new DeletedRangeArrayFilter(this, fromIndex, toIndex);
               }
           
          @@ -181,7 +195,7 @@ final class ObjectArrayData extends ArrayData {
           
                   final int newLength = (int) (length() - 1);
                   final Object elem = array[newLength];
          -        array[newLength] = 0;
          +        setEmpty(newLength);
                   setLength(newLength);
                   return elem;
               }
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ReverseScriptObjectMirrorIterator.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ReverseScriptObjectMirrorIterator.java
          new file mode 100644
          index 00000000000..1e3e4000cdb
          --- /dev/null
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ReverseScriptObjectMirrorIterator.java
          @@ -0,0 +1,56 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.  Oracle designates this
          + * particular file as subject to the "Classpath" exception as provided
          + * by Oracle in the LICENSE file that accompanied this code.
          + *
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + *
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + *
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +package jdk.nashorn.internal.runtime.arrays;
          +
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
          +import jdk.nashorn.internal.runtime.JSType;
          +
          +/**
          + * Reverse iterator over a ScriptObjectMirror
          + */
          +final class ReverseScriptObjectMirrorIterator extends ScriptObjectMirrorIterator {
          +
          +    ReverseScriptObjectMirrorIterator(final ScriptObjectMirror obj, final boolean includeUndefined) {
          +        super(obj, includeUndefined);
          +        this.index = JSType.toUint32(obj.containsKey("length")? obj.getMember("length") : 0) - 1;
          +    }
          +
          +    @Override
          +    public boolean isReverse() {
          +        return true;
          +    }
          +
          +    @Override
          +    protected boolean indexInArray() {
          +        return index >= 0;
          +    }
          +
          +    @Override
          +    protected long bumpIndex() {
          +        return index--;
          +    }
          +}
          +
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/ScriptObjectMirrorIterator.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ScriptObjectMirrorIterator.java
          new file mode 100644
          index 00000000000..a7bef158f57
          --- /dev/null
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/ScriptObjectMirrorIterator.java
          @@ -0,0 +1,81 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.  Oracle designates this
          + * particular file as subject to the "Classpath" exception as provided
          + * by Oracle in the LICENSE file that accompanied this code.
          + *
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + *
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + *
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +package jdk.nashorn.internal.runtime.arrays;
          +
          +import java.util.NoSuchElementException;
          +import jdk.nashorn.api.scripting.ScriptObjectMirror;
          +import jdk.nashorn.internal.runtime.JSType;
          +
          +/**
          + * Iterator over a ScriptObjectMirror
          + */
          +class ScriptObjectMirrorIterator extends ArrayLikeIterator {
          +
          +    protected final ScriptObjectMirror obj;
          +    private final long length;
          +
          +    ScriptObjectMirrorIterator(final ScriptObjectMirror obj, final boolean includeUndefined) {
          +        super(includeUndefined);
          +        this.obj    = obj;
          +        this.length = JSType.toUint32(obj.containsKey("length")? obj.getMember("length") : 0);
          +        this.index  = 0;
          +    }
          +
          +    protected boolean indexInArray() {
          +        return index < length;
          +    }
          +
          +    @Override
          +    public long getLength() {
          +        return length;
          +    }
          +
          +    @Override
          +    public boolean hasNext() {
          +        if (length == 0L) {
          +            return false; //return empty string if toUint32(length) == 0
          +        }
          +
          +        while (indexInArray()) {
          +            if (obj.containsKey(index) || includeUndefined) {
          +                break;
          +            }
          +            bumpIndex();
          +        }
          +
          +        return indexInArray();
          +    }
          +
          +    @Override
          +    public Object next() {
          +        if (indexInArray()) {
          +            return obj.get(bumpIndex());
          +        }
          +
          +        throw new NoSuchElementException();
          +    }
          +}
          +
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java b/nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java
          index 04ac661f8b7..0ccbb23c535 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java
          @@ -61,13 +61,15 @@ class SparseArrayData extends ArrayData {
           
               @Override
               public Object[] asObjectArray() {
          -        final Object[] objArray = new Object[Math.min((int) length(), Integer.MAX_VALUE)];
          +        final int length = (int) Math.min(length(), Integer.MAX_VALUE);
          +        final int underlyingLength = (int) Math.min(length, underlying.length());
          +        final Object[] objArray = new Object[length];
           
          -        for (int i = 0; i < underlying.length(); i++) {
          +        for (int i = 0; i < underlyingLength; i++) {
                       objArray[i] = underlying.getObject(i);
                   }
           
          -        Arrays.fill(objArray, (int) underlying.length(), objArray.length, ScriptRuntime.UNDEFINED);
          +        Arrays.fill(objArray, underlyingLength, length, ScriptRuntime.UNDEFINED);
           
                   for (final Map.Entry entry : sparseMap.entrySet()) {
                       final long key = entry.getKey();
          @@ -201,6 +203,18 @@ class SparseArrayData extends ArrayData {
                   return this;
               }
           
          +    @Override
          +    public ArrayData setEmpty(final int index) {
          +        underlying.setEmpty(index);
          +        return this;
          +    }
          +
          +    @Override
          +    public ArrayData setEmpty(final long lo, final long hi) {
          +        underlying.setEmpty(lo, hi);
          +        return this;
          +    }
          +
               @Override
               public int getInt(final int index) {
                   if (index >= 0 && index < maxDenseLength) {
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java b/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
          index edd75e4dafd..1b7eb66b4e9 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JSObjectLinker.java
          @@ -45,44 +45,14 @@ import jdk.nashorn.api.scripting.JSObject;
            * as ScriptObjects from other Nashorn contexts.
            */
           final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
          -   /**
          -     * Instances of this class are used to represent a method member of a JSObject
          -     */
          -    private static final class JSObjectMethod {
          -        // The name of the JSObject method property
          -        private final String name;
          -
          -        JSObjectMethod(final String name) {
          -            this.name = name;
          -        }
          -
          -        String getName() {
          -            return name;
          -        }
          -
          -        static GuardedInvocation lookup(final CallSiteDescriptor desc) {
          -            final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
          -            switch (operator) {
          -                case "call": {
          -                    // collect everything except the first two - JSObjectMethod instance and the actual 'self'
          -                    final int paramCount = desc.getMethodType().parameterCount();
          -                    final MethodHandle caller = MH.asCollector(JSOBJECTMETHOD_CALL, Object[].class, paramCount - 2);
          -                    return new GuardedInvocation(caller, null, IS_JSOBJECTMETHOD_GUARD);
          -                }
          -                default:
          -                    return null;
          -            }
          -        }
          -    }
          -
               @Override
               public boolean canLinkType(final Class type) {
                   return canLinkTypeStatic(type);
               }
           
               static boolean canLinkTypeStatic(final Class type) {
          -        // can link JSObject and JSObjectMethod
          -        return JSObject.class.isAssignableFrom(type) || JSObjectMethod.class.isAssignableFrom(type);
          +        // can link JSObject
          +        return JSObject.class.isAssignableFrom(type);
               }
           
               @Override
          @@ -99,8 +69,6 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
                   final GuardedInvocation inv;
                   if (self instanceof JSObject) {
                       inv = lookup(desc);
          -        } else if (self instanceof JSObjectMethod) {
          -            inv = JSObjectMethod.lookup(desc);
                   } else {
                       throw new AssertionError(); // Should never reach here.
                   }
          @@ -115,7 +83,7 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
                       case "getProp":
                       case "getElem":
                       case "getMethod":
          -                return c > 2 ? findGetMethod(desc, operator) : findGetIndexMethod();
          +                return c > 2 ? findGetMethod(desc) : findGetIndexMethod();
                       case "setProp":
                       case "setElem":
                           return c > 2 ? findSetMethod(desc) : findSetIndexMethod();
          @@ -123,15 +91,14 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
                       case "callMethod":
                           return findCallMethod(desc, operator);
                       case "new":
          +                return findNewMethod(desc);
                       default:
                           return null;
                   }
               }
           
          -    private static GuardedInvocation findGetMethod(final CallSiteDescriptor desc, final String operator) {
          -        // if "getMethod" then return JSObjectMethod object - which just holds the name of the method
          -        // subsequently, link on dyn:call for JSObjectMethod will actually call that method
          -        final MethodHandle getter = MH.insertArguments("getMethod".equals(operator)? JSOBJECT_GETMETHOD : JSOBJECT_GET, 1, desc.getNameToken(2));
          +    private static GuardedInvocation findGetMethod(final CallSiteDescriptor desc) {
          +        final MethodHandle getter = MH.insertArguments(JSOBJECT_GET, 1, desc.getNameToken(2));
                   return new GuardedInvocation(getter, null, IS_JSOBJECT_GUARD);
               }
           
          @@ -156,9 +123,9 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
                   return new GuardedInvocation(func, null, IS_JSOBJECT_GUARD);
               }
           
          -    @SuppressWarnings("unused")
          -    private static boolean isJSObjectMethod(final Object self) {
          -        return self instanceof JSObjectMethod;
          +    private static GuardedInvocation findNewMethod(final CallSiteDescriptor desc) {
          +        MethodHandle func = MH.asCollector(JSOBJECT_NEW, Object[].class, desc.getMethodType().parameterCount() - 1);
          +        return new GuardedInvocation(func, null, IS_JSOBJECT_GUARD);
               }
           
               @SuppressWarnings("unused")
          @@ -166,12 +133,6 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
                   return self instanceof JSObject;
               }
           
          -
          -    @SuppressWarnings("unused")
          -    private static Object getMethod(final Object jsobj, final Object key) {
          -        return new JSObjectMethod(Objects.toString(key));
          -    }
          -
               @SuppressWarnings("unused")
               private static Object get(final Object jsobj, final Object key) {
                   if (key instanceof String) {
          @@ -200,11 +161,8 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
               }
           
               @SuppressWarnings("unused")
          -    private static Object jsObjectMethodCall(final Object jsObjMethod, final Object jsobj, final Object... args) {
          -        // we have JSObjectMethod, JSObject and args. Get method name from JSObjectMethod instance
          -        final String methodName = ((JSObjectMethod)jsObjMethod).getName();
          -        // call the method on JSObject
          -        return ((JSObject)jsobj).call(methodName, args);
          +    private static Object newObject(final Object jsobj, final Object... args) {
          +        return ((JSObject)jsobj).newObject(null, args);
               }
           
               private static int getIndex(final Number n) {
          @@ -214,13 +172,11 @@ final class JSObjectLinker implements TypeBasedGuardingDynamicLinker {
           
               private static final MethodHandleFunctionality MH = MethodHandleFactory.getFunctionality();
           
          -    private static final MethodHandle IS_JSOBJECTMETHOD_GUARD = findOwnMH("isJSObjectMethod", boolean.class, Object.class);
               private static final MethodHandle IS_JSOBJECT_GUARD = findOwnMH("isJSObject", boolean.class, Object.class);
          -    private static final MethodHandle JSOBJECT_GETMETHOD = findOwnMH("getMethod", Object.class, Object.class, Object.class);
               private static final MethodHandle JSOBJECT_GET = findOwnMH("get", Object.class, Object.class, Object.class);
               private static final MethodHandle JSOBJECT_PUT = findOwnMH("put", Void.TYPE, Object.class, Object.class, Object.class);
               private static final MethodHandle JSOBJECT_CALL = findOwnMH("call", Object.class, Object.class, Object.class, Object[].class);
          -    private static final MethodHandle JSOBJECTMETHOD_CALL = findOwnMH("jsObjectMethodCall", Object.class, Object.class, Object.class, Object[].class);
          +    private static final MethodHandle JSOBJECT_NEW = findOwnMH("newObject", Object.class, Object.class, Object[].class);
           
               private static MethodHandle findOwnMH(final String name, final Class rtype, final Class... types) {
                   final Class   own = JSObjectLinker.class;
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties b/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties
          index b8d9e5e3c82..83c0a5abb00 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Messages.properties
          @@ -25,9 +25,11 @@
           lexer.error.edit.string.missing.brace=Edit string expression missing closing brace
           lexer.error.here.missing.end.marker=Here string missing end marker "{0}"
           lexer.error.missing.close.quote=Missing close quote
          +lexer.error.missing.space.after.number=Missing space after numeric literal
           lexer.error.invalid.hex=Invalid hex digit
          -lexer.error.invalid.octal=Invalid octal digit
           lexer.error.strict.no.octal=cannot use octal escapes in strict mode
          +lexer.error.json.invalid.number=Invalid JSON number format
          +lexer.error.invalid.escape.char=Invalid escape character
           lexer.error.illegal.identifier.character=Illegal character in identifier
           
           parser.error.illegal.continue.stmt=Illegal continue statement
          @@ -40,6 +42,8 @@ parser.error.expected.literal=Expected a literal but found {0}
           parser.error.expected.operand=Expected an operand but found {0}
           parser.error.expected.stmt=Expected statement but found {0}
           parser.error.expected.comma=Expected comma but found {0}
          +parser.error.expected.property.id=Expected property id but found {0}
          +parser.error.expected.lvalue=Expected l-value but found {0}
           parser.error.expected=Expected {0} but found {1}
           parser.error.invalid.return=Invalid return statement
           parser.error.no.func.decl.here=Function declarations can only occur at program or function body level. You should use a function expression here instead.
          @@ -127,6 +131,7 @@ type.error.method.not.constructor=Java method {0} can't be used as a constructor
           type.error.env.not.object=$ENV must be an Object.
           type.error.unsupported.java.to.type=Unsupported Java.to target type {0}.
           range.error.inappropriate.array.length=inappropriate array length: {0}
          +range.error.inappropriate.array.buffer.length=inappropriate array buffer length: {0}
           range.error.invalid.fraction.digits=fractionDigits argument to {0} must be in [0, 20]
           range.error.invalid.precision=precision argument toPrecision() must be in [1, 21]
           range.error.invalid.radix=radix argument must be in [2, 36]
          diff --git a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties b/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties
          index 4dd6df6f75c..4d7be62b2de 100644
          --- a/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties
          +++ b/nashorn/src/jdk/nashorn/internal/runtime/resources/Options.properties
          @@ -59,7 +59,7 @@ nashorn.options.D.key = nashorn.option.D
           ## is_undocumented - should this option never appear in the online help. defaults to no.
           ## desc - description of what the option does
           ## default - default value of the option. e.g. debug.lines is true by default. Not set means option not available by default
          -## dependency - does this arg imply another arg, e.g. scripting -> anon-functions
          +## dependency - does this arg imply another arg.
           ## confict - does this arg conflict with another arg e.g trace && instrument
           ## value_next_arg - is the opton's value passed as next argument in command line?
           ##
          @@ -77,16 +77,9 @@ nashorn.option.xhelp = {                               \
               desc="Print extended help for command line flags." \
           }
           
          -nashorn.option.anon.functions = {                \
          -    name="--anon-functions",                     \
          -    short_name="-af",                            \
          -    is_undocumented=true,                        \
          -    desc="Always allow functions as statements." \
          -}
          -
           nashorn.option.class.cache.size ={                            \
               name="--class-cache-size",                                \
          -    short_name="--ccs",                                       \
          +    short_name="-ccs",                                        \
               desc="Size of the Class cache size per global scope.",    \
               is_undocumented=true,                                     \
               type=Integer,                                             \
          @@ -201,10 +194,10 @@ nashorn.option.loader.per.compile = {              \
           
           nashorn.option.no.syntax.extensions = {            \
               name="--no-syntax-extensions",                 \
          -    short_name="--nse",                            \
          +    short_name="-nse",                             \
               is_undocumented=true,                          \
               desc="No non-standard syntax extensions",      \
          -    default=-anon-functions=false                  \
          +    default=false                                  \
           }
           
           nashorn.option.package = {                                     \
          @@ -296,8 +289,7 @@ nashorn.option.strict = {              \
           
           nashorn.option.scripting = {            \
               name="-scripting",                  \
          -    desc="Enable scripting features.",	\
          -    dependency="--anon-functions=true"  \
          +    desc="Enable scripting features."   \
           }
           
           nashorn.option.specialize.calls = {                                                \
          diff --git a/nashorn/src/jdk/nashorn/internal/scripts/JO.java b/nashorn/src/jdk/nashorn/internal/scripts/JO.java
          index d698a2637ce..b31df1ae6f1 100644
          --- a/nashorn/src/jdk/nashorn/internal/scripts/JO.java
          +++ b/nashorn/src/jdk/nashorn/internal/scripts/JO.java
          @@ -32,11 +32,14 @@ import jdk.nashorn.internal.runtime.ScriptObject;
            * Empty object class.
            */
           public class JO extends ScriptObject {
          +
          +    private static final PropertyMap map$ = PropertyMap.newMap(JO.class);
          +
               /**
                * Constructor
                */
               public JO() {
          -        super(PropertyMap.newMap(JO.class));
          +        super(map$);
               }
           
               /**
          @@ -48,6 +51,15 @@ public class JO extends ScriptObject {
                   super(map);
               }
           
          +    /**
          +     * Constructor given an initial prototype using the default property map
          +     *
          +     * @param proto the prototype object
          +     */
          +    public JO(final ScriptObject proto) {
          +        super(proto, map$);
          +    }
          +
               /**
                * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
                *
          diff --git a/nashorn/test/examples/array-micro.js b/nashorn/test/examples/array-micro.js
          new file mode 100644
          index 00000000000..075e78d8c30
          --- /dev/null
          +++ b/nashorn/test/examples/array-micro.js
          @@ -0,0 +1,114 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * 
          + * Redistribution and use in source and binary forms, with or without
          + * modification, are permitted provided that the following conditions
          + * are met:
          + * 
          + *   - Redistributions of source code must retain the above copyright
          + *     notice, this list of conditions and the following disclaimer.
          + * 
          + *   - Redistributions in binary form must reproduce the above copyright
          + *     notice, this list of conditions and the following disclaimer in the
          + *     documentation and/or other materials provided with the distribution.
          + * 
          + *   - Neither the name of Oracle nor the names of its
          + *     contributors may be used to endorse or promote products derived
          + *     from this software without specific prior written permission.
          + * 
          + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
          + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
          + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
          + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
          + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
          + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
          + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
          + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
          + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
          + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
          + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
          + */
          +
          +
          +
          +function bench(name, func) {
          +    var start = Date.now();
          +    for (var iter = 0; iter < 5e6; iter++) {
          +        func();
          +    }
          +    print((Date.now() - start) + "\t" + name);
          +}
          +
          +bench("[]", function() {
          +    [];
          +    [];
          +    [];
          +});
          +
          +bench("[1, 2, 3]", function() {
          +    [1, 2, 3];
          +    [1, 2, 3];
          +    [1, 2, 3];
          +});
          +
          +bench("[1 .. 20]", function() {
          +    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
          +    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
          +    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
          +});
          +
          +bench("new Array()", function() {
          +    new Array();
          +    new Array();
          +    new Array();
          +});
          +
          +
          +bench("new Array(1, 2, 3)", function() {
          +    new Array(1, 2, 3);
          +    new Array(1, 2, 3);
          +    new Array(1, 2, 3);
          +});
          +
          +bench("new Array(10)", function() {
          +    new Array(10);
          +    new Array(10);
          +    new Array(10);
          +});
          +
          +var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
          +
          +bench("get", function() {
          +    array[0];
          +    array[3];
          +    array[6];
          +});
          +
          +bench("set", function() {
          +    array[0] = 0;
          +    array[3] = 3;
          +    array[6] = 6;
          +});
          +
          +var all = function(e) { return true; };
          +var none = function(e) { return false; };
          +
          +bench("filter all", function() {
          +    array.filter(all);
          +});
          +
          +bench("filter none", function() {
          +    array.filter(none);
          +});
          +
          +var up = function(a, b) { return a > b ? 1 : -1; };
          +var down = function(a, b) { return a < b ? 1 : -1; };
          +
          +bench("sort up", function() {
          +    [1, 2, 3, 4].sort(up);
          +});
          +
          +bench("sort down", function() {
          +    [1, 2, 3, 4].sort(down);
          +});
          +
          diff --git a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp b/nashorn/test/script/basic/JDK-8010697.js
          similarity index 55%
          rename from hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
          rename to nashorn/test/script/basic/JDK-8010697.js
          index e13dc36700e..c1b8e572937 100644
          --- a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp
          +++ b/nashorn/test/script/basic/JDK-8010697.js
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
            * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
            *
            * This code is free software; you can redistribute it and/or modify it
          @@ -19,29 +19,41 @@
            * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
            * or visit www.oracle.com if you need additional information or have any
            * questions.
          - *
            */
           
          -#include "precompiled.hpp"
          -#include "asm/macroAssembler.hpp"
          -#include "runtime/os.hpp"
          -#include "runtime/threadLocalStorage.hpp"
          +/**
          + * JDK-8010697: DeletedArrayFilter seems to leak memory
          + *
          + * @test
          + * @run
          + */
           
          -#include 
          +var N = 1000;
           
          -void MacroAssembler::read_ccr_trap(Register ccr_save) {
          -  // No implementation
          -  breakpoint_trap();
          +var array = new Array(N);
          +var WeakReferenceArray = Java.type("java.lang.ref.WeakReference[]");
          +var refArray = new WeakReferenceArray(N);
          +
          +for (var i = 0; i < N; i ++) {
          +    var object = new java.lang.Object();
          +    array[i] = object;
          +    refArray[i] = new java.lang.ref.WeakReference(object);
           }
           
          -void MacroAssembler::write_ccr_trap(Register ccr_save, Register scratch1, Register scratch2) {
          -  // No implementation
          -  breakpoint_trap();
          +object = null;
          +
          +for (var i = 0; i < N; i ++) {
          +    delete array[i];
           }
           
          -void MacroAssembler::flush_windows_trap() { trap(SP_TRAP_FWIN); }
          -void MacroAssembler::clean_windows_trap() { trap(SP_TRAP_CWIN); }
          +java.lang.System.gc();
          +java.lang.System.gc();
           
          -// Use software breakpoint trap until we figure out how to do this on Linux
          -void MacroAssembler::get_psr_trap()       { trap(SP_TRAP_SBPT); }
          -void MacroAssembler::set_psr_trap()       { trap(SP_TRAP_SBPT); }
          +for (var i = 0; i < N; i ++) {
          +    if (refArray[i].get() != null) {
          +        print("Reference found at " + i);
          +        exit(0);
          +    }
          +}
          +
          +print("All references gone");
          diff --git a/nashorn/test/script/basic/JDK-8010697.js.EXPECTED b/nashorn/test/script/basic/JDK-8010697.js.EXPECTED
          new file mode 100644
          index 00000000000..fe74109082d
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8010697.js.EXPECTED
          @@ -0,0 +1 @@
          +All references gone
          diff --git a/nashorn/test/script/basic/JDK-8010732.js b/nashorn/test/script/basic/JDK-8010732.js
          new file mode 100644
          index 00000000000..166acb9e774
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8010732.js
          @@ -0,0 +1,48 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + *
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + *
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8010732: BigDecimal, BigInteger and Long handling in nashorn
          + *
          + * @test
          + * @run
          + */
          +
          +var x = new java.math.BigDecimal(1111.5);
          +var y = new java.math.BigDecimal(2222.5);
          +
          +print(x);
          +print(y);
          +
          +print(x + y);
          +print(x - y);
          +print(x * y);
          +print(x / y);
          +print(Math.sin(x));
          +
          +print(x.toString());
          +print(y.toString());
          +print(x.class);
          +print(y.class);
          +print(x.doubleValue() + y.doubleValue());
          +
          diff --git a/nashorn/test/script/basic/JDK-8010732.js.EXPECTED b/nashorn/test/script/basic/JDK-8010732.js.EXPECTED
          new file mode 100644
          index 00000000000..5df1cb1d956
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8010732.js.EXPECTED
          @@ -0,0 +1,12 @@
          +1111.5
          +2222.5
          +3334
          +-1111
          +2470308.75
          +0.5001124859392576
          +-0.5841231854504038
          +1111.5
          +2222.5
          +class java.math.BigDecimal
          +class java.math.BigDecimal
          +3334
          diff --git a/nashorn/test/script/basic/JDK-8011893.js b/nashorn/test/script/basic/JDK-8011893.js
          new file mode 100644
          index 00000000000..28382d2fa95
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8011893.js
          @@ -0,0 +1,51 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8011893: JS Object builtin prototype is not thread safe
          + *
          + * @test
          + * @run
          + */
          +
          +var a = {};
          +var thread = new java.lang.Thread(new java.lang.Runnable() {
          +    run: function() {
          +        print("Thread starts");
          +        for (var i = 0; i < 1000000; i++) {
          +            // Unsubscribe to builtin, subscribe to new proto
          +            var b = Object.create(a);
          +        }
          +        print("Thread done");
          +    }
          +});
          +
          +print("Main starts");
          +thread.start();
          +for (var j = 0; j < 1000000; j++) {
          +    // Subscribe to builtin prototype.
          +    a = {};
          +}
          +
          +thread.join();
          +print("Main done");
          diff --git a/nashorn/test/script/basic/JDK-8011893.js.EXPECTED b/nashorn/test/script/basic/JDK-8011893.js.EXPECTED
          new file mode 100644
          index 00000000000..2ba98e33bc1
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8011893.js.EXPECTED
          @@ -0,0 +1,4 @@
          +Main starts
          +Thread starts
          +Thread done
          +Main done
          diff --git a/nashorn/test/script/basic/JDK-8012164.js b/nashorn/test/script/basic/JDK-8012164.js
          index 6416cfadfdb..62bb09c4b23 100644
          --- a/nashorn/test/script/basic/JDK-8012164.js
          +++ b/nashorn/test/script/basic/JDK-8012164.js
          @@ -37,8 +37,9 @@ function error() {
             try {
                 throw new Error('foo');
             } catch (e) {
          -      for (i in e.stack) {
          -          printFrame(e.stack[i]);
          +      var frames = e.getStackTrace();
          +      for (i in frames) {
          +          printFrame(frames[i]);
                 }
             }
           }
          diff --git a/nashorn/test/script/basic/JDK-8012164.js.EXPECTED b/nashorn/test/script/basic/JDK-8012164.js.EXPECTED
          index e70edea3c8e..9912edcd509 100644
          --- a/nashorn/test/script/basic/JDK-8012164.js.EXPECTED
          +++ b/nashorn/test/script/basic/JDK-8012164.js.EXPECTED
          @@ -1,3 +1,3 @@
           .error(test/script/basic/JDK-8012164.js:38)
           .func(test/script/basic/JDK-8012164.js:33)
          -.(test/script/basic/JDK-8012164.js:46)
          +.(test/script/basic/JDK-8012164.js:47)
          diff --git a/nashorn/test/script/basic/JDK-8012291.js b/nashorn/test/script/basic/JDK-8012291.js
          new file mode 100644
          index 00000000000..b902df4788a
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8012291.js
          @@ -0,0 +1,48 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8012291: NativeArray is inconsistent in using long for length and index in some places and int for the same in other places
          + *
          + * @test
          + * @run
          + */
          +
          +// Make sure JSON parser correctly handles large array keys
          +var obj = JSON.parse('{"4294967294": 1}');
          +print(obj[4294967294]);
          +
          +// Make sure Array.prototype.sort handles large index correctly
          +obj.length = 4294967295;
          +Array.prototype.sort.call(obj);
          +print(obj[0]);
          +print(obj[4294967294]);
          +print(obj.length);
          +
          +var arr = [];
          +arr[4294967294] = 1;
          +try {
          +    new Int32Array(arr);
          +} catch (e) {
          +    print(e);
          +}
          diff --git a/nashorn/test/script/basic/JDK-8012291.js.EXPECTED b/nashorn/test/script/basic/JDK-8012291.js.EXPECTED
          new file mode 100644
          index 00000000000..7d723f1d6cb
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8012291.js.EXPECTED
          @@ -0,0 +1,5 @@
          +1
          +1
          +undefined
          +4294967295
          +RangeError: inappropriate array buffer length: 4294967295
          diff --git a/nashorn/test/script/basic/JDK-8014781.js b/nashorn/test/script/basic/JDK-8014781.js
          new file mode 100644
          index 00000000000..3c6d7d88a46
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8014781.js
          @@ -0,0 +1,40 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8014781: support Error.captureStackTrace
          + *
          + * @test
          + * @run
          + */
          +
          +function MyError() {
          +    Error.captureStackTrace(this);
          +}
          +
          +function func() {
          +    return new MyError();
          +}
          +
          +var e = func();
          +print(e.stack.replace(/\\/g, '/'));
          diff --git a/nashorn/test/script/basic/JDK-8014781.js.EXPECTED b/nashorn/test/script/basic/JDK-8014781.js.EXPECTED
          new file mode 100644
          index 00000000000..d3586c0ee67
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8014781.js.EXPECTED
          @@ -0,0 +1,4 @@
          +[object Object]
          +	at MyError (test/script/basic/JDK-8014781.js:32)
          +	at func (test/script/basic/JDK-8014781.js:36)
          +	at  (test/script/basic/JDK-8014781.js:39)
          diff --git a/nashorn/test/script/basic/JDK-8015346.js b/nashorn/test/script/basic/JDK-8015346.js
          new file mode 100644
          index 00000000000..2365cc82c67
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015346.js
          @@ -0,0 +1,53 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015346: JSON parsing issues with escaped strings, octal, decimal numbers *
          + * @test
          + * @run
          + */
          +
          +function checkJSON(str) {
          +    try {
          +        JSON.parse(str);
          +        fail("should have thrown SyntaxError for JSON.parse on " + str);
          +    } catch (e) {
          +        if (! (e instanceof SyntaxError)) {
          +            fail("Expected SyntaxError, but got " + e);
          +        }
          +    }
          +}
          +
          +// invalid escape in a string
          +checkJSON('"\\a"')
          +
          +// invalid floating point number patterns
          +checkJSON("1.")
          +checkJSON(".8")
          +checkJSON("2.3e+")
          +checkJSON("0.3E+")
          +
          +// octal, hexadecimal not allowed
          +checkJSON("08")
          +checkJSON("06")
          +checkJSON('0x3')
          diff --git a/nashorn/test/script/basic/JDK-8015347.js b/nashorn/test/script/basic/JDK-8015347.js
          new file mode 100644
          index 00000000000..d5a8ba318c0
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015347.js
          @@ -0,0 +1,39 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015347: Parsing issue with decodeURIComponent
          + *
          + * @test
          + * @run
          + */
          +
          +try {
          +    decodeURIComponent("%C0%80");
          +    fail("Should have thrown URIError");
          +} catch (e) {
          +    if (! (e instanceof URIError)) {
          +        fail("Expected URIError, but got " + e);
          +    }
          +}
          +
          diff --git a/nashorn/test/script/basic/JDK-8015355.js b/nashorn/test/script/basic/JDK-8015355.js
          new file mode 100644
          index 00000000000..bc39d8d981c
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015355.js
          @@ -0,0 +1,122 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015355: Array.prototype functions don't honour non-writable length and / or index properties
          + * 
          + * @test
          + * @run
          + */
          +
          +function fail(msg) {
          +    print(msg);
          +}
          +
          +function check(callback) {
          +    try {
          +        callback();
          +        fail("TypeError expected for " + callback);
          +    } catch (e) {
          +        if (! (e instanceof TypeError)) {
          +            fail("TypeError expected, got " + e);
          +        }
          +    }
          +}
          +
          +var array = Object.defineProperty([],"length", { writable: false });
          +
          +check(function() {
          +    array.push(0)
          +});
          +
          +check(function() {
          +    array.pop()
          +});
          +
          +check(function() {
          +    Object.defineProperty([,,],"0",{ writable: false }).reverse();
          +});
          +
          +check(function() {
          +    array.shift()
          +});
          +
          +check(function() {
          +    array.splice(0)
          +});
          +
          +check(function() {
          +    array.unshift()
          +});
          +
          +// try the above via call
          +
          +check(function() {
          +    Array.prototype.push.call(array, 0);
          +});
          +
          +check(function() {
          +    Array.prototype.pop.call(array);
          +});
          +
          +check(function() {
          +    Array.prototype.shift.call(array);
          +});
          +
          +check(function() {
          +    Array.prototype.unshift.call(array);
          +});
          +
          +check(function() {
          +    Array.prototype.splice.call(array, 0);
          +});
          +
          +check(function() {
          +    Array.prototype.reverse.call(Object.defineProperty([,,],"0",{ writable: false }));
          +});
          +
          +// try the above via apply
          +
          +check(function() {
          +    Array.prototype.push.apply(array, [ 0 ]);
          +});
          +
          +check(function() {
          +    Array.prototype.pop.apply(array);
          +});
          +
          +check(function() {
          +    Array.prototype.shift.apply(array);
          +});
          +
          +check(function() {
          +    Array.prototype.unshift.apply(array);
          +});
          +
          +check(function() {
          +    Array.prototype.splice.apply(array, [ 0 ]);
          +});
          +
          +check(function() {
          +    Array.prototype.reverse.apply(Object.defineProperty([,,],"0",{ writable: false }));
          +});
          diff --git a/nashorn/test/script/basic/JDK-8015357.js b/nashorn/test/script/basic/JDK-8015357.js
          new file mode 100644
          index 00000000000..b6c94537d98
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015357.js
          @@ -0,0 +1,37 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015357: a = []; a[0x7fffffff]=1; a.sort()[0] should evaluate to 1 instead of undefined
          + *
          + * @test
          + * @run
          + */
          +
          +var a = []; 
          +a[0x7fffffff]=1; 
          +
          +if (a.sort()[0] != 1) {
          +    fail("a.sort()[0] != 1");
          +}
          +
          diff --git a/nashorn/test/script/basic/JDK-8015892.js b/nashorn/test/script/basic/JDK-8015892.js
          new file mode 100644
          index 00000000000..a6ab4c8b428
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015892.js
          @@ -0,0 +1,38 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015892.js : use before definition with valid declaration that turns into
          + * local var must be "canBeUndefined"
          + *
          + * @test
          + * @run
          + */
          +
          +function doIt() { 
          +    if (something) { 
          +	x = x.obj; 
          +    } else { 
          +	var x = "x"; 
          +    } 
          +} 
          diff --git a/nashorn/test/script/basic/JDK-8015959.js b/nashorn/test/script/basic/JDK-8015959.js
          new file mode 100644
          index 00000000000..c5322e3e149
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015959.js
          @@ -0,0 +1,54 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015959: Can't call foreign constructor
          + *
          + * @test
          + * @run
          + */
          +
          +function check(global) {
          +    var obj = new global.Point(344, 12);
          +    print("obj.x " + obj.x);
          +    print("obj.y " + obj.y);
          +    print("obj instanceof global.Point? " + (obj instanceof global.Point))
          +
          +    var P = global.Point;
          +    var p = new P(343, 54);
          +    print("p.x " + p.x);
          +    print("p.y " + p.y);
          +    print("p instanceof P? " + (p instanceof P))
          +}
          +
          +print("check with loadWithNewGlobal");
          +check(loadWithNewGlobal({
          +   name: "myscript",
          +   script: "function Point(x, y) { this.x = x; this.y = y }; this"
          +}));
          +
          +print("check with script engine");
          +var m = new javax.script.ScriptEngineManager();
          +var e = m.getEngineByName('nashorn');
          +check(e.eval("function Point(x, y) { this.x = x; this.y = y }; this"));
          +
          diff --git a/nashorn/test/script/basic/JDK-8015959.js.EXPECTED b/nashorn/test/script/basic/JDK-8015959.js.EXPECTED
          new file mode 100644
          index 00000000000..e5a00a9540d
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015959.js.EXPECTED
          @@ -0,0 +1,14 @@
          +check with loadWithNewGlobal
          +obj.x 344
          +obj.y 12
          +obj instanceof global.Point? true
          +p.x 343
          +p.y 54
          +p instanceof P? true
          +check with script engine
          +obj.x 344
          +obj.y 12
          +obj instanceof global.Point? true
          +p.x 343
          +p.y 54
          +p instanceof P? true
          diff --git a/nashorn/test/script/basic/JDK-8015969.js b/nashorn/test/script/basic/JDK-8015969.js
          new file mode 100644
          index 00000000000..a9813773dfa
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8015969.js
          @@ -0,0 +1,75 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8015969: Needs to enforce and document that global "context" and "engine" can't be modified when running via jsr223
          + *
          + * @test
          + * @option -scripting
          + * @run
          + */
          +
          +var m = new javax.script.ScriptEngineManager();
          +var e = m.getEngineByName("nashorn");
          +
          +e.eval(<",
          +   script:
          +        " print(arguments[0]); "+
          +        " print(arguments[1]); " +
          +        " print(arguments[2].foo); " +
          +        " print(arguments[3])"
          +   },
          +  "hello", 23, { foo: 33}, jmap
          +);
          diff --git a/nashorn/test/script/basic/JDK-8016239.js.EXPECTED b/nashorn/test/script/basic/JDK-8016239.js.EXPECTED
          new file mode 100644
          index 00000000000..3ed10c072a3
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016239.js.EXPECTED
          @@ -0,0 +1,4 @@
          +hello
          +23
          +33
          +{foo=bar}
          diff --git a/nashorn/test/script/basic/JDK-8016518.js b/nashorn/test/script/basic/JDK-8016518.js
          new file mode 100644
          index 00000000000..a468483aa9d
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016518.js
          @@ -0,0 +1,38 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8016518: Parsing of octal string escapes is broken
          + *
          + * @test
          + * @run
          + */
          +
          +print("\471".charCodeAt(0));
          +print("\471".charCodeAt(1));
          +
          +print("\377".length);
          +print("\377".charCodeAt(0));
          +print("\400".length);
          +print("\400".charCodeAt(0));
          +print("\400".charCodeAt(1));
          diff --git a/nashorn/test/script/basic/JDK-8016518.js.EXPECTED b/nashorn/test/script/basic/JDK-8016518.js.EXPECTED
          new file mode 100644
          index 00000000000..49989864189
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016518.js.EXPECTED
          @@ -0,0 +1,7 @@
          +39
          +49
          +1
          +255
          +2
          +32
          +48
          diff --git a/nashorn/test/script/basic/JDK-8016528.js b/nashorn/test/script/basic/JDK-8016528.js
          new file mode 100644
          index 00000000000..ede2fd833d0
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016528.js
          @@ -0,0 +1,33 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + *
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + *
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + *
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + *
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8016528: Hex code from escape() should be padded
          + *
          + * @test
          + * @run
          + */
          +
          +for (var i = 0; i < 8192; i++) {
          +    print(escape(String.fromCharCode(i)));
          +}
          diff --git a/nashorn/test/script/basic/JDK-8016528.js.EXPECTED b/nashorn/test/script/basic/JDK-8016528.js.EXPECTED
          new file mode 100644
          index 00000000000..77c8ededb2a
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016528.js.EXPECTED
          @@ -0,0 +1,8192 @@
          +%00
          +%01
          +%02
          +%03
          +%04
          +%05
          +%06
          +%07
          +%08
          +%09
          +%0A
          +%0B
          +%0C
          +%0D
          +%0E
          +%0F
          +%10
          +%11
          +%12
          +%13
          +%14
          +%15
          +%16
          +%17
          +%18
          +%19
          +%1A
          +%1B
          +%1C
          +%1D
          +%1E
          +%1F
          +%20
          +%21
          +%22
          +%23
          +%24
          +%25
          +%26
          +%27
          +%28
          +%29
          +*
          ++
          +%2C
          +-
          +.
          +/
          +0
          +1
          +2
          +3
          +4
          +5
          +6
          +7
          +8
          +9
          +%3A
          +%3B
          +%3C
          +%3D
          +%3E
          +%3F
          +@
          +A
          +B
          +C
          +D
          +E
          +F
          +G
          +H
          +I
          +J
          +K
          +L
          +M
          +N
          +O
          +P
          +Q
          +R
          +S
          +T
          +U
          +V
          +W
          +X
          +Y
          +Z
          +%5B
          +%5C
          +%5D
          +%5E
          +_
          +%60
          +a
          +b
          +c
          +d
          +e
          +f
          +g
          +h
          +i
          +j
          +k
          +l
          +m
          +n
          +o
          +p
          +q
          +r
          +s
          +t
          +u
          +v
          +w
          +x
          +y
          +z
          +%7B
          +%7C
          +%7D
          +%7E
          +%7F
          +%80
          +%81
          +%82
          +%83
          +%84
          +%85
          +%86
          +%87
          +%88
          +%89
          +%8A
          +%8B
          +%8C
          +%8D
          +%8E
          +%8F
          +%90
          +%91
          +%92
          +%93
          +%94
          +%95
          +%96
          +%97
          +%98
          +%99
          +%9A
          +%9B
          +%9C
          +%9D
          +%9E
          +%9F
          +%A0
          +%A1
          +%A2
          +%A3
          +%A4
          +%A5
          +%A6
          +%A7
          +%A8
          +%A9
          +%AA
          +%AB
          +%AC
          +%AD
          +%AE
          +%AF
          +%B0
          +%B1
          +%B2
          +%B3
          +%B4
          +%B5
          +%B6
          +%B7
          +%B8
          +%B9
          +%BA
          +%BB
          +%BC
          +%BD
          +%BE
          +%BF
          +%C0
          +%C1
          +%C2
          +%C3
          +%C4
          +%C5
          +%C6
          +%C7
          +%C8
          +%C9
          +%CA
          +%CB
          +%CC
          +%CD
          +%CE
          +%CF
          +%D0
          +%D1
          +%D2
          +%D3
          +%D4
          +%D5
          +%D6
          +%D7
          +%D8
          +%D9
          +%DA
          +%DB
          +%DC
          +%DD
          +%DE
          +%DF
          +%E0
          +%E1
          +%E2
          +%E3
          +%E4
          +%E5
          +%E6
          +%E7
          +%E8
          +%E9
          +%EA
          +%EB
          +%EC
          +%ED
          +%EE
          +%EF
          +%F0
          +%F1
          +%F2
          +%F3
          +%F4
          +%F5
          +%F6
          +%F7
          +%F8
          +%F9
          +%FA
          +%FB
          +%FC
          +%FD
          +%FE
          +%FF
          +%u0100
          +%u0101
          +%u0102
          +%u0103
          +%u0104
          +%u0105
          +%u0106
          +%u0107
          +%u0108
          +%u0109
          +%u010A
          +%u010B
          +%u010C
          +%u010D
          +%u010E
          +%u010F
          +%u0110
          +%u0111
          +%u0112
          +%u0113
          +%u0114
          +%u0115
          +%u0116
          +%u0117
          +%u0118
          +%u0119
          +%u011A
          +%u011B
          +%u011C
          +%u011D
          +%u011E
          +%u011F
          +%u0120
          +%u0121
          +%u0122
          +%u0123
          +%u0124
          +%u0125
          +%u0126
          +%u0127
          +%u0128
          +%u0129
          +%u012A
          +%u012B
          +%u012C
          +%u012D
          +%u012E
          +%u012F
          +%u0130
          +%u0131
          +%u0132
          +%u0133
          +%u0134
          +%u0135
          +%u0136
          +%u0137
          +%u0138
          +%u0139
          +%u013A
          +%u013B
          +%u013C
          +%u013D
          +%u013E
          +%u013F
          +%u0140
          +%u0141
          +%u0142
          +%u0143
          +%u0144
          +%u0145
          +%u0146
          +%u0147
          +%u0148
          +%u0149
          +%u014A
          +%u014B
          +%u014C
          +%u014D
          +%u014E
          +%u014F
          +%u0150
          +%u0151
          +%u0152
          +%u0153
          +%u0154
          +%u0155
          +%u0156
          +%u0157
          +%u0158
          +%u0159
          +%u015A
          +%u015B
          +%u015C
          +%u015D
          +%u015E
          +%u015F
          +%u0160
          +%u0161
          +%u0162
          +%u0163
          +%u0164
          +%u0165
          +%u0166
          +%u0167
          +%u0168
          +%u0169
          +%u016A
          +%u016B
          +%u016C
          +%u016D
          +%u016E
          +%u016F
          +%u0170
          +%u0171
          +%u0172
          +%u0173
          +%u0174
          +%u0175
          +%u0176
          +%u0177
          +%u0178
          +%u0179
          +%u017A
          +%u017B
          +%u017C
          +%u017D
          +%u017E
          +%u017F
          +%u0180
          +%u0181
          +%u0182
          +%u0183
          +%u0184
          +%u0185
          +%u0186
          +%u0187
          +%u0188
          +%u0189
          +%u018A
          +%u018B
          +%u018C
          +%u018D
          +%u018E
          +%u018F
          +%u0190
          +%u0191
          +%u0192
          +%u0193
          +%u0194
          +%u0195
          +%u0196
          +%u0197
          +%u0198
          +%u0199
          +%u019A
          +%u019B
          +%u019C
          +%u019D
          +%u019E
          +%u019F
          +%u01A0
          +%u01A1
          +%u01A2
          +%u01A3
          +%u01A4
          +%u01A5
          +%u01A6
          +%u01A7
          +%u01A8
          +%u01A9
          +%u01AA
          +%u01AB
          +%u01AC
          +%u01AD
          +%u01AE
          +%u01AF
          +%u01B0
          +%u01B1
          +%u01B2
          +%u01B3
          +%u01B4
          +%u01B5
          +%u01B6
          +%u01B7
          +%u01B8
          +%u01B9
          +%u01BA
          +%u01BB
          +%u01BC
          +%u01BD
          +%u01BE
          +%u01BF
          +%u01C0
          +%u01C1
          +%u01C2
          +%u01C3
          +%u01C4
          +%u01C5
          +%u01C6
          +%u01C7
          +%u01C8
          +%u01C9
          +%u01CA
          +%u01CB
          +%u01CC
          +%u01CD
          +%u01CE
          +%u01CF
          +%u01D0
          +%u01D1
          +%u01D2
          +%u01D3
          +%u01D4
          +%u01D5
          +%u01D6
          +%u01D7
          +%u01D8
          +%u01D9
          +%u01DA
          +%u01DB
          +%u01DC
          +%u01DD
          +%u01DE
          +%u01DF
          +%u01E0
          +%u01E1
          +%u01E2
          +%u01E3
          +%u01E4
          +%u01E5
          +%u01E6
          +%u01E7
          +%u01E8
          +%u01E9
          +%u01EA
          +%u01EB
          +%u01EC
          +%u01ED
          +%u01EE
          +%u01EF
          +%u01F0
          +%u01F1
          +%u01F2
          +%u01F3
          +%u01F4
          +%u01F5
          +%u01F6
          +%u01F7
          +%u01F8
          +%u01F9
          +%u01FA
          +%u01FB
          +%u01FC
          +%u01FD
          +%u01FE
          +%u01FF
          +%u0200
          +%u0201
          +%u0202
          +%u0203
          +%u0204
          +%u0205
          +%u0206
          +%u0207
          +%u0208
          +%u0209
          +%u020A
          +%u020B
          +%u020C
          +%u020D
          +%u020E
          +%u020F
          +%u0210
          +%u0211
          +%u0212
          +%u0213
          +%u0214
          +%u0215
          +%u0216
          +%u0217
          +%u0218
          +%u0219
          +%u021A
          +%u021B
          +%u021C
          +%u021D
          +%u021E
          +%u021F
          +%u0220
          +%u0221
          +%u0222
          +%u0223
          +%u0224
          +%u0225
          +%u0226
          +%u0227
          +%u0228
          +%u0229
          +%u022A
          +%u022B
          +%u022C
          +%u022D
          +%u022E
          +%u022F
          +%u0230
          +%u0231
          +%u0232
          +%u0233
          +%u0234
          +%u0235
          +%u0236
          +%u0237
          +%u0238
          +%u0239
          +%u023A
          +%u023B
          +%u023C
          +%u023D
          +%u023E
          +%u023F
          +%u0240
          +%u0241
          +%u0242
          +%u0243
          +%u0244
          +%u0245
          +%u0246
          +%u0247
          +%u0248
          +%u0249
          +%u024A
          +%u024B
          +%u024C
          +%u024D
          +%u024E
          +%u024F
          +%u0250
          +%u0251
          +%u0252
          +%u0253
          +%u0254
          +%u0255
          +%u0256
          +%u0257
          +%u0258
          +%u0259
          +%u025A
          +%u025B
          +%u025C
          +%u025D
          +%u025E
          +%u025F
          +%u0260
          +%u0261
          +%u0262
          +%u0263
          +%u0264
          +%u0265
          +%u0266
          +%u0267
          +%u0268
          +%u0269
          +%u026A
          +%u026B
          +%u026C
          +%u026D
          +%u026E
          +%u026F
          +%u0270
          +%u0271
          +%u0272
          +%u0273
          +%u0274
          +%u0275
          +%u0276
          +%u0277
          +%u0278
          +%u0279
          +%u027A
          +%u027B
          +%u027C
          +%u027D
          +%u027E
          +%u027F
          +%u0280
          +%u0281
          +%u0282
          +%u0283
          +%u0284
          +%u0285
          +%u0286
          +%u0287
          +%u0288
          +%u0289
          +%u028A
          +%u028B
          +%u028C
          +%u028D
          +%u028E
          +%u028F
          +%u0290
          +%u0291
          +%u0292
          +%u0293
          +%u0294
          +%u0295
          +%u0296
          +%u0297
          +%u0298
          +%u0299
          +%u029A
          +%u029B
          +%u029C
          +%u029D
          +%u029E
          +%u029F
          +%u02A0
          +%u02A1
          +%u02A2
          +%u02A3
          +%u02A4
          +%u02A5
          +%u02A6
          +%u02A7
          +%u02A8
          +%u02A9
          +%u02AA
          +%u02AB
          +%u02AC
          +%u02AD
          +%u02AE
          +%u02AF
          +%u02B0
          +%u02B1
          +%u02B2
          +%u02B3
          +%u02B4
          +%u02B5
          +%u02B6
          +%u02B7
          +%u02B8
          +%u02B9
          +%u02BA
          +%u02BB
          +%u02BC
          +%u02BD
          +%u02BE
          +%u02BF
          +%u02C0
          +%u02C1
          +%u02C2
          +%u02C3
          +%u02C4
          +%u02C5
          +%u02C6
          +%u02C7
          +%u02C8
          +%u02C9
          +%u02CA
          +%u02CB
          +%u02CC
          +%u02CD
          +%u02CE
          +%u02CF
          +%u02D0
          +%u02D1
          +%u02D2
          +%u02D3
          +%u02D4
          +%u02D5
          +%u02D6
          +%u02D7
          +%u02D8
          +%u02D9
          +%u02DA
          +%u02DB
          +%u02DC
          +%u02DD
          +%u02DE
          +%u02DF
          +%u02E0
          +%u02E1
          +%u02E2
          +%u02E3
          +%u02E4
          +%u02E5
          +%u02E6
          +%u02E7
          +%u02E8
          +%u02E9
          +%u02EA
          +%u02EB
          +%u02EC
          +%u02ED
          +%u02EE
          +%u02EF
          +%u02F0
          +%u02F1
          +%u02F2
          +%u02F3
          +%u02F4
          +%u02F5
          +%u02F6
          +%u02F7
          +%u02F8
          +%u02F9
          +%u02FA
          +%u02FB
          +%u02FC
          +%u02FD
          +%u02FE
          +%u02FF
          +%u0300
          +%u0301
          +%u0302
          +%u0303
          +%u0304
          +%u0305
          +%u0306
          +%u0307
          +%u0308
          +%u0309
          +%u030A
          +%u030B
          +%u030C
          +%u030D
          +%u030E
          +%u030F
          +%u0310
          +%u0311
          +%u0312
          +%u0313
          +%u0314
          +%u0315
          +%u0316
          +%u0317
          +%u0318
          +%u0319
          +%u031A
          +%u031B
          +%u031C
          +%u031D
          +%u031E
          +%u031F
          +%u0320
          +%u0321
          +%u0322
          +%u0323
          +%u0324
          +%u0325
          +%u0326
          +%u0327
          +%u0328
          +%u0329
          +%u032A
          +%u032B
          +%u032C
          +%u032D
          +%u032E
          +%u032F
          +%u0330
          +%u0331
          +%u0332
          +%u0333
          +%u0334
          +%u0335
          +%u0336
          +%u0337
          +%u0338
          +%u0339
          +%u033A
          +%u033B
          +%u033C
          +%u033D
          +%u033E
          +%u033F
          +%u0340
          +%u0341
          +%u0342
          +%u0343
          +%u0344
          +%u0345
          +%u0346
          +%u0347
          +%u0348
          +%u0349
          +%u034A
          +%u034B
          +%u034C
          +%u034D
          +%u034E
          +%u034F
          +%u0350
          +%u0351
          +%u0352
          +%u0353
          +%u0354
          +%u0355
          +%u0356
          +%u0357
          +%u0358
          +%u0359
          +%u035A
          +%u035B
          +%u035C
          +%u035D
          +%u035E
          +%u035F
          +%u0360
          +%u0361
          +%u0362
          +%u0363
          +%u0364
          +%u0365
          +%u0366
          +%u0367
          +%u0368
          +%u0369
          +%u036A
          +%u036B
          +%u036C
          +%u036D
          +%u036E
          +%u036F
          +%u0370
          +%u0371
          +%u0372
          +%u0373
          +%u0374
          +%u0375
          +%u0376
          +%u0377
          +%u0378
          +%u0379
          +%u037A
          +%u037B
          +%u037C
          +%u037D
          +%u037E
          +%u037F
          +%u0380
          +%u0381
          +%u0382
          +%u0383
          +%u0384
          +%u0385
          +%u0386
          +%u0387
          +%u0388
          +%u0389
          +%u038A
          +%u038B
          +%u038C
          +%u038D
          +%u038E
          +%u038F
          +%u0390
          +%u0391
          +%u0392
          +%u0393
          +%u0394
          +%u0395
          +%u0396
          +%u0397
          +%u0398
          +%u0399
          +%u039A
          +%u039B
          +%u039C
          +%u039D
          +%u039E
          +%u039F
          +%u03A0
          +%u03A1
          +%u03A2
          +%u03A3
          +%u03A4
          +%u03A5
          +%u03A6
          +%u03A7
          +%u03A8
          +%u03A9
          +%u03AA
          +%u03AB
          +%u03AC
          +%u03AD
          +%u03AE
          +%u03AF
          +%u03B0
          +%u03B1
          +%u03B2
          +%u03B3
          +%u03B4
          +%u03B5
          +%u03B6
          +%u03B7
          +%u03B8
          +%u03B9
          +%u03BA
          +%u03BB
          +%u03BC
          +%u03BD
          +%u03BE
          +%u03BF
          +%u03C0
          +%u03C1
          +%u03C2
          +%u03C3
          +%u03C4
          +%u03C5
          +%u03C6
          +%u03C7
          +%u03C8
          +%u03C9
          +%u03CA
          +%u03CB
          +%u03CC
          +%u03CD
          +%u03CE
          +%u03CF
          +%u03D0
          +%u03D1
          +%u03D2
          +%u03D3
          +%u03D4
          +%u03D5
          +%u03D6
          +%u03D7
          +%u03D8
          +%u03D9
          +%u03DA
          +%u03DB
          +%u03DC
          +%u03DD
          +%u03DE
          +%u03DF
          +%u03E0
          +%u03E1
          +%u03E2
          +%u03E3
          +%u03E4
          +%u03E5
          +%u03E6
          +%u03E7
          +%u03E8
          +%u03E9
          +%u03EA
          +%u03EB
          +%u03EC
          +%u03ED
          +%u03EE
          +%u03EF
          +%u03F0
          +%u03F1
          +%u03F2
          +%u03F3
          +%u03F4
          +%u03F5
          +%u03F6
          +%u03F7
          +%u03F8
          +%u03F9
          +%u03FA
          +%u03FB
          +%u03FC
          +%u03FD
          +%u03FE
          +%u03FF
          +%u0400
          +%u0401
          +%u0402
          +%u0403
          +%u0404
          +%u0405
          +%u0406
          +%u0407
          +%u0408
          +%u0409
          +%u040A
          +%u040B
          +%u040C
          +%u040D
          +%u040E
          +%u040F
          +%u0410
          +%u0411
          +%u0412
          +%u0413
          +%u0414
          +%u0415
          +%u0416
          +%u0417
          +%u0418
          +%u0419
          +%u041A
          +%u041B
          +%u041C
          +%u041D
          +%u041E
          +%u041F
          +%u0420
          +%u0421
          +%u0422
          +%u0423
          +%u0424
          +%u0425
          +%u0426
          +%u0427
          +%u0428
          +%u0429
          +%u042A
          +%u042B
          +%u042C
          +%u042D
          +%u042E
          +%u042F
          +%u0430
          +%u0431
          +%u0432
          +%u0433
          +%u0434
          +%u0435
          +%u0436
          +%u0437
          +%u0438
          +%u0439
          +%u043A
          +%u043B
          +%u043C
          +%u043D
          +%u043E
          +%u043F
          +%u0440
          +%u0441
          +%u0442
          +%u0443
          +%u0444
          +%u0445
          +%u0446
          +%u0447
          +%u0448
          +%u0449
          +%u044A
          +%u044B
          +%u044C
          +%u044D
          +%u044E
          +%u044F
          +%u0450
          +%u0451
          +%u0452
          +%u0453
          +%u0454
          +%u0455
          +%u0456
          +%u0457
          +%u0458
          +%u0459
          +%u045A
          +%u045B
          +%u045C
          +%u045D
          +%u045E
          +%u045F
          +%u0460
          +%u0461
          +%u0462
          +%u0463
          +%u0464
          +%u0465
          +%u0466
          +%u0467
          +%u0468
          +%u0469
          +%u046A
          +%u046B
          +%u046C
          +%u046D
          +%u046E
          +%u046F
          +%u0470
          +%u0471
          +%u0472
          +%u0473
          +%u0474
          +%u0475
          +%u0476
          +%u0477
          +%u0478
          +%u0479
          +%u047A
          +%u047B
          +%u047C
          +%u047D
          +%u047E
          +%u047F
          +%u0480
          +%u0481
          +%u0482
          +%u0483
          +%u0484
          +%u0485
          +%u0486
          +%u0487
          +%u0488
          +%u0489
          +%u048A
          +%u048B
          +%u048C
          +%u048D
          +%u048E
          +%u048F
          +%u0490
          +%u0491
          +%u0492
          +%u0493
          +%u0494
          +%u0495
          +%u0496
          +%u0497
          +%u0498
          +%u0499
          +%u049A
          +%u049B
          +%u049C
          +%u049D
          +%u049E
          +%u049F
          +%u04A0
          +%u04A1
          +%u04A2
          +%u04A3
          +%u04A4
          +%u04A5
          +%u04A6
          +%u04A7
          +%u04A8
          +%u04A9
          +%u04AA
          +%u04AB
          +%u04AC
          +%u04AD
          +%u04AE
          +%u04AF
          +%u04B0
          +%u04B1
          +%u04B2
          +%u04B3
          +%u04B4
          +%u04B5
          +%u04B6
          +%u04B7
          +%u04B8
          +%u04B9
          +%u04BA
          +%u04BB
          +%u04BC
          +%u04BD
          +%u04BE
          +%u04BF
          +%u04C0
          +%u04C1
          +%u04C2
          +%u04C3
          +%u04C4
          +%u04C5
          +%u04C6
          +%u04C7
          +%u04C8
          +%u04C9
          +%u04CA
          +%u04CB
          +%u04CC
          +%u04CD
          +%u04CE
          +%u04CF
          +%u04D0
          +%u04D1
          +%u04D2
          +%u04D3
          +%u04D4
          +%u04D5
          +%u04D6
          +%u04D7
          +%u04D8
          +%u04D9
          +%u04DA
          +%u04DB
          +%u04DC
          +%u04DD
          +%u04DE
          +%u04DF
          +%u04E0
          +%u04E1
          +%u04E2
          +%u04E3
          +%u04E4
          +%u04E5
          +%u04E6
          +%u04E7
          +%u04E8
          +%u04E9
          +%u04EA
          +%u04EB
          +%u04EC
          +%u04ED
          +%u04EE
          +%u04EF
          +%u04F0
          +%u04F1
          +%u04F2
          +%u04F3
          +%u04F4
          +%u04F5
          +%u04F6
          +%u04F7
          +%u04F8
          +%u04F9
          +%u04FA
          +%u04FB
          +%u04FC
          +%u04FD
          +%u04FE
          +%u04FF
          +%u0500
          +%u0501
          +%u0502
          +%u0503
          +%u0504
          +%u0505
          +%u0506
          +%u0507
          +%u0508
          +%u0509
          +%u050A
          +%u050B
          +%u050C
          +%u050D
          +%u050E
          +%u050F
          +%u0510
          +%u0511
          +%u0512
          +%u0513
          +%u0514
          +%u0515
          +%u0516
          +%u0517
          +%u0518
          +%u0519
          +%u051A
          +%u051B
          +%u051C
          +%u051D
          +%u051E
          +%u051F
          +%u0520
          +%u0521
          +%u0522
          +%u0523
          +%u0524
          +%u0525
          +%u0526
          +%u0527
          +%u0528
          +%u0529
          +%u052A
          +%u052B
          +%u052C
          +%u052D
          +%u052E
          +%u052F
          +%u0530
          +%u0531
          +%u0532
          +%u0533
          +%u0534
          +%u0535
          +%u0536
          +%u0537
          +%u0538
          +%u0539
          +%u053A
          +%u053B
          +%u053C
          +%u053D
          +%u053E
          +%u053F
          +%u0540
          +%u0541
          +%u0542
          +%u0543
          +%u0544
          +%u0545
          +%u0546
          +%u0547
          +%u0548
          +%u0549
          +%u054A
          +%u054B
          +%u054C
          +%u054D
          +%u054E
          +%u054F
          +%u0550
          +%u0551
          +%u0552
          +%u0553
          +%u0554
          +%u0555
          +%u0556
          +%u0557
          +%u0558
          +%u0559
          +%u055A
          +%u055B
          +%u055C
          +%u055D
          +%u055E
          +%u055F
          +%u0560
          +%u0561
          +%u0562
          +%u0563
          +%u0564
          +%u0565
          +%u0566
          +%u0567
          +%u0568
          +%u0569
          +%u056A
          +%u056B
          +%u056C
          +%u056D
          +%u056E
          +%u056F
          +%u0570
          +%u0571
          +%u0572
          +%u0573
          +%u0574
          +%u0575
          +%u0576
          +%u0577
          +%u0578
          +%u0579
          +%u057A
          +%u057B
          +%u057C
          +%u057D
          +%u057E
          +%u057F
          +%u0580
          +%u0581
          +%u0582
          +%u0583
          +%u0584
          +%u0585
          +%u0586
          +%u0587
          +%u0588
          +%u0589
          +%u058A
          +%u058B
          +%u058C
          +%u058D
          +%u058E
          +%u058F
          +%u0590
          +%u0591
          +%u0592
          +%u0593
          +%u0594
          +%u0595
          +%u0596
          +%u0597
          +%u0598
          +%u0599
          +%u059A
          +%u059B
          +%u059C
          +%u059D
          +%u059E
          +%u059F
          +%u05A0
          +%u05A1
          +%u05A2
          +%u05A3
          +%u05A4
          +%u05A5
          +%u05A6
          +%u05A7
          +%u05A8
          +%u05A9
          +%u05AA
          +%u05AB
          +%u05AC
          +%u05AD
          +%u05AE
          +%u05AF
          +%u05B0
          +%u05B1
          +%u05B2
          +%u05B3
          +%u05B4
          +%u05B5
          +%u05B6
          +%u05B7
          +%u05B8
          +%u05B9
          +%u05BA
          +%u05BB
          +%u05BC
          +%u05BD
          +%u05BE
          +%u05BF
          +%u05C0
          +%u05C1
          +%u05C2
          +%u05C3
          +%u05C4
          +%u05C5
          +%u05C6
          +%u05C7
          +%u05C8
          +%u05C9
          +%u05CA
          +%u05CB
          +%u05CC
          +%u05CD
          +%u05CE
          +%u05CF
          +%u05D0
          +%u05D1
          +%u05D2
          +%u05D3
          +%u05D4
          +%u05D5
          +%u05D6
          +%u05D7
          +%u05D8
          +%u05D9
          +%u05DA
          +%u05DB
          +%u05DC
          +%u05DD
          +%u05DE
          +%u05DF
          +%u05E0
          +%u05E1
          +%u05E2
          +%u05E3
          +%u05E4
          +%u05E5
          +%u05E6
          +%u05E7
          +%u05E8
          +%u05E9
          +%u05EA
          +%u05EB
          +%u05EC
          +%u05ED
          +%u05EE
          +%u05EF
          +%u05F0
          +%u05F1
          +%u05F2
          +%u05F3
          +%u05F4
          +%u05F5
          +%u05F6
          +%u05F7
          +%u05F8
          +%u05F9
          +%u05FA
          +%u05FB
          +%u05FC
          +%u05FD
          +%u05FE
          +%u05FF
          +%u0600
          +%u0601
          +%u0602
          +%u0603
          +%u0604
          +%u0605
          +%u0606
          +%u0607
          +%u0608
          +%u0609
          +%u060A
          +%u060B
          +%u060C
          +%u060D
          +%u060E
          +%u060F
          +%u0610
          +%u0611
          +%u0612
          +%u0613
          +%u0614
          +%u0615
          +%u0616
          +%u0617
          +%u0618
          +%u0619
          +%u061A
          +%u061B
          +%u061C
          +%u061D
          +%u061E
          +%u061F
          +%u0620
          +%u0621
          +%u0622
          +%u0623
          +%u0624
          +%u0625
          +%u0626
          +%u0627
          +%u0628
          +%u0629
          +%u062A
          +%u062B
          +%u062C
          +%u062D
          +%u062E
          +%u062F
          +%u0630
          +%u0631
          +%u0632
          +%u0633
          +%u0634
          +%u0635
          +%u0636
          +%u0637
          +%u0638
          +%u0639
          +%u063A
          +%u063B
          +%u063C
          +%u063D
          +%u063E
          +%u063F
          +%u0640
          +%u0641
          +%u0642
          +%u0643
          +%u0644
          +%u0645
          +%u0646
          +%u0647
          +%u0648
          +%u0649
          +%u064A
          +%u064B
          +%u064C
          +%u064D
          +%u064E
          +%u064F
          +%u0650
          +%u0651
          +%u0652
          +%u0653
          +%u0654
          +%u0655
          +%u0656
          +%u0657
          +%u0658
          +%u0659
          +%u065A
          +%u065B
          +%u065C
          +%u065D
          +%u065E
          +%u065F
          +%u0660
          +%u0661
          +%u0662
          +%u0663
          +%u0664
          +%u0665
          +%u0666
          +%u0667
          +%u0668
          +%u0669
          +%u066A
          +%u066B
          +%u066C
          +%u066D
          +%u066E
          +%u066F
          +%u0670
          +%u0671
          +%u0672
          +%u0673
          +%u0674
          +%u0675
          +%u0676
          +%u0677
          +%u0678
          +%u0679
          +%u067A
          +%u067B
          +%u067C
          +%u067D
          +%u067E
          +%u067F
          +%u0680
          +%u0681
          +%u0682
          +%u0683
          +%u0684
          +%u0685
          +%u0686
          +%u0687
          +%u0688
          +%u0689
          +%u068A
          +%u068B
          +%u068C
          +%u068D
          +%u068E
          +%u068F
          +%u0690
          +%u0691
          +%u0692
          +%u0693
          +%u0694
          +%u0695
          +%u0696
          +%u0697
          +%u0698
          +%u0699
          +%u069A
          +%u069B
          +%u069C
          +%u069D
          +%u069E
          +%u069F
          +%u06A0
          +%u06A1
          +%u06A2
          +%u06A3
          +%u06A4
          +%u06A5
          +%u06A6
          +%u06A7
          +%u06A8
          +%u06A9
          +%u06AA
          +%u06AB
          +%u06AC
          +%u06AD
          +%u06AE
          +%u06AF
          +%u06B0
          +%u06B1
          +%u06B2
          +%u06B3
          +%u06B4
          +%u06B5
          +%u06B6
          +%u06B7
          +%u06B8
          +%u06B9
          +%u06BA
          +%u06BB
          +%u06BC
          +%u06BD
          +%u06BE
          +%u06BF
          +%u06C0
          +%u06C1
          +%u06C2
          +%u06C3
          +%u06C4
          +%u06C5
          +%u06C6
          +%u06C7
          +%u06C8
          +%u06C9
          +%u06CA
          +%u06CB
          +%u06CC
          +%u06CD
          +%u06CE
          +%u06CF
          +%u06D0
          +%u06D1
          +%u06D2
          +%u06D3
          +%u06D4
          +%u06D5
          +%u06D6
          +%u06D7
          +%u06D8
          +%u06D9
          +%u06DA
          +%u06DB
          +%u06DC
          +%u06DD
          +%u06DE
          +%u06DF
          +%u06E0
          +%u06E1
          +%u06E2
          +%u06E3
          +%u06E4
          +%u06E5
          +%u06E6
          +%u06E7
          +%u06E8
          +%u06E9
          +%u06EA
          +%u06EB
          +%u06EC
          +%u06ED
          +%u06EE
          +%u06EF
          +%u06F0
          +%u06F1
          +%u06F2
          +%u06F3
          +%u06F4
          +%u06F5
          +%u06F6
          +%u06F7
          +%u06F8
          +%u06F9
          +%u06FA
          +%u06FB
          +%u06FC
          +%u06FD
          +%u06FE
          +%u06FF
          +%u0700
          +%u0701
          +%u0702
          +%u0703
          +%u0704
          +%u0705
          +%u0706
          +%u0707
          +%u0708
          +%u0709
          +%u070A
          +%u070B
          +%u070C
          +%u070D
          +%u070E
          +%u070F
          +%u0710
          +%u0711
          +%u0712
          +%u0713
          +%u0714
          +%u0715
          +%u0716
          +%u0717
          +%u0718
          +%u0719
          +%u071A
          +%u071B
          +%u071C
          +%u071D
          +%u071E
          +%u071F
          +%u0720
          +%u0721
          +%u0722
          +%u0723
          +%u0724
          +%u0725
          +%u0726
          +%u0727
          +%u0728
          +%u0729
          +%u072A
          +%u072B
          +%u072C
          +%u072D
          +%u072E
          +%u072F
          +%u0730
          +%u0731
          +%u0732
          +%u0733
          +%u0734
          +%u0735
          +%u0736
          +%u0737
          +%u0738
          +%u0739
          +%u073A
          +%u073B
          +%u073C
          +%u073D
          +%u073E
          +%u073F
          +%u0740
          +%u0741
          +%u0742
          +%u0743
          +%u0744
          +%u0745
          +%u0746
          +%u0747
          +%u0748
          +%u0749
          +%u074A
          +%u074B
          +%u074C
          +%u074D
          +%u074E
          +%u074F
          +%u0750
          +%u0751
          +%u0752
          +%u0753
          +%u0754
          +%u0755
          +%u0756
          +%u0757
          +%u0758
          +%u0759
          +%u075A
          +%u075B
          +%u075C
          +%u075D
          +%u075E
          +%u075F
          +%u0760
          +%u0761
          +%u0762
          +%u0763
          +%u0764
          +%u0765
          +%u0766
          +%u0767
          +%u0768
          +%u0769
          +%u076A
          +%u076B
          +%u076C
          +%u076D
          +%u076E
          +%u076F
          +%u0770
          +%u0771
          +%u0772
          +%u0773
          +%u0774
          +%u0775
          +%u0776
          +%u0777
          +%u0778
          +%u0779
          +%u077A
          +%u077B
          +%u077C
          +%u077D
          +%u077E
          +%u077F
          +%u0780
          +%u0781
          +%u0782
          +%u0783
          +%u0784
          +%u0785
          +%u0786
          +%u0787
          +%u0788
          +%u0789
          +%u078A
          +%u078B
          +%u078C
          +%u078D
          +%u078E
          +%u078F
          +%u0790
          +%u0791
          +%u0792
          +%u0793
          +%u0794
          +%u0795
          +%u0796
          +%u0797
          +%u0798
          +%u0799
          +%u079A
          +%u079B
          +%u079C
          +%u079D
          +%u079E
          +%u079F
          +%u07A0
          +%u07A1
          +%u07A2
          +%u07A3
          +%u07A4
          +%u07A5
          +%u07A6
          +%u07A7
          +%u07A8
          +%u07A9
          +%u07AA
          +%u07AB
          +%u07AC
          +%u07AD
          +%u07AE
          +%u07AF
          +%u07B0
          +%u07B1
          +%u07B2
          +%u07B3
          +%u07B4
          +%u07B5
          +%u07B6
          +%u07B7
          +%u07B8
          +%u07B9
          +%u07BA
          +%u07BB
          +%u07BC
          +%u07BD
          +%u07BE
          +%u07BF
          +%u07C0
          +%u07C1
          +%u07C2
          +%u07C3
          +%u07C4
          +%u07C5
          +%u07C6
          +%u07C7
          +%u07C8
          +%u07C9
          +%u07CA
          +%u07CB
          +%u07CC
          +%u07CD
          +%u07CE
          +%u07CF
          +%u07D0
          +%u07D1
          +%u07D2
          +%u07D3
          +%u07D4
          +%u07D5
          +%u07D6
          +%u07D7
          +%u07D8
          +%u07D9
          +%u07DA
          +%u07DB
          +%u07DC
          +%u07DD
          +%u07DE
          +%u07DF
          +%u07E0
          +%u07E1
          +%u07E2
          +%u07E3
          +%u07E4
          +%u07E5
          +%u07E6
          +%u07E7
          +%u07E8
          +%u07E9
          +%u07EA
          +%u07EB
          +%u07EC
          +%u07ED
          +%u07EE
          +%u07EF
          +%u07F0
          +%u07F1
          +%u07F2
          +%u07F3
          +%u07F4
          +%u07F5
          +%u07F6
          +%u07F7
          +%u07F8
          +%u07F9
          +%u07FA
          +%u07FB
          +%u07FC
          +%u07FD
          +%u07FE
          +%u07FF
          +%u0800
          +%u0801
          +%u0802
          +%u0803
          +%u0804
          +%u0805
          +%u0806
          +%u0807
          +%u0808
          +%u0809
          +%u080A
          +%u080B
          +%u080C
          +%u080D
          +%u080E
          +%u080F
          +%u0810
          +%u0811
          +%u0812
          +%u0813
          +%u0814
          +%u0815
          +%u0816
          +%u0817
          +%u0818
          +%u0819
          +%u081A
          +%u081B
          +%u081C
          +%u081D
          +%u081E
          +%u081F
          +%u0820
          +%u0821
          +%u0822
          +%u0823
          +%u0824
          +%u0825
          +%u0826
          +%u0827
          +%u0828
          +%u0829
          +%u082A
          +%u082B
          +%u082C
          +%u082D
          +%u082E
          +%u082F
          +%u0830
          +%u0831
          +%u0832
          +%u0833
          +%u0834
          +%u0835
          +%u0836
          +%u0837
          +%u0838
          +%u0839
          +%u083A
          +%u083B
          +%u083C
          +%u083D
          +%u083E
          +%u083F
          +%u0840
          +%u0841
          +%u0842
          +%u0843
          +%u0844
          +%u0845
          +%u0846
          +%u0847
          +%u0848
          +%u0849
          +%u084A
          +%u084B
          +%u084C
          +%u084D
          +%u084E
          +%u084F
          +%u0850
          +%u0851
          +%u0852
          +%u0853
          +%u0854
          +%u0855
          +%u0856
          +%u0857
          +%u0858
          +%u0859
          +%u085A
          +%u085B
          +%u085C
          +%u085D
          +%u085E
          +%u085F
          +%u0860
          +%u0861
          +%u0862
          +%u0863
          +%u0864
          +%u0865
          +%u0866
          +%u0867
          +%u0868
          +%u0869
          +%u086A
          +%u086B
          +%u086C
          +%u086D
          +%u086E
          +%u086F
          +%u0870
          +%u0871
          +%u0872
          +%u0873
          +%u0874
          +%u0875
          +%u0876
          +%u0877
          +%u0878
          +%u0879
          +%u087A
          +%u087B
          +%u087C
          +%u087D
          +%u087E
          +%u087F
          +%u0880
          +%u0881
          +%u0882
          +%u0883
          +%u0884
          +%u0885
          +%u0886
          +%u0887
          +%u0888
          +%u0889
          +%u088A
          +%u088B
          +%u088C
          +%u088D
          +%u088E
          +%u088F
          +%u0890
          +%u0891
          +%u0892
          +%u0893
          +%u0894
          +%u0895
          +%u0896
          +%u0897
          +%u0898
          +%u0899
          +%u089A
          +%u089B
          +%u089C
          +%u089D
          +%u089E
          +%u089F
          +%u08A0
          +%u08A1
          +%u08A2
          +%u08A3
          +%u08A4
          +%u08A5
          +%u08A6
          +%u08A7
          +%u08A8
          +%u08A9
          +%u08AA
          +%u08AB
          +%u08AC
          +%u08AD
          +%u08AE
          +%u08AF
          +%u08B0
          +%u08B1
          +%u08B2
          +%u08B3
          +%u08B4
          +%u08B5
          +%u08B6
          +%u08B7
          +%u08B8
          +%u08B9
          +%u08BA
          +%u08BB
          +%u08BC
          +%u08BD
          +%u08BE
          +%u08BF
          +%u08C0
          +%u08C1
          +%u08C2
          +%u08C3
          +%u08C4
          +%u08C5
          +%u08C6
          +%u08C7
          +%u08C8
          +%u08C9
          +%u08CA
          +%u08CB
          +%u08CC
          +%u08CD
          +%u08CE
          +%u08CF
          +%u08D0
          +%u08D1
          +%u08D2
          +%u08D3
          +%u08D4
          +%u08D5
          +%u08D6
          +%u08D7
          +%u08D8
          +%u08D9
          +%u08DA
          +%u08DB
          +%u08DC
          +%u08DD
          +%u08DE
          +%u08DF
          +%u08E0
          +%u08E1
          +%u08E2
          +%u08E3
          +%u08E4
          +%u08E5
          +%u08E6
          +%u08E7
          +%u08E8
          +%u08E9
          +%u08EA
          +%u08EB
          +%u08EC
          +%u08ED
          +%u08EE
          +%u08EF
          +%u08F0
          +%u08F1
          +%u08F2
          +%u08F3
          +%u08F4
          +%u08F5
          +%u08F6
          +%u08F7
          +%u08F8
          +%u08F9
          +%u08FA
          +%u08FB
          +%u08FC
          +%u08FD
          +%u08FE
          +%u08FF
          +%u0900
          +%u0901
          +%u0902
          +%u0903
          +%u0904
          +%u0905
          +%u0906
          +%u0907
          +%u0908
          +%u0909
          +%u090A
          +%u090B
          +%u090C
          +%u090D
          +%u090E
          +%u090F
          +%u0910
          +%u0911
          +%u0912
          +%u0913
          +%u0914
          +%u0915
          +%u0916
          +%u0917
          +%u0918
          +%u0919
          +%u091A
          +%u091B
          +%u091C
          +%u091D
          +%u091E
          +%u091F
          +%u0920
          +%u0921
          +%u0922
          +%u0923
          +%u0924
          +%u0925
          +%u0926
          +%u0927
          +%u0928
          +%u0929
          +%u092A
          +%u092B
          +%u092C
          +%u092D
          +%u092E
          +%u092F
          +%u0930
          +%u0931
          +%u0932
          +%u0933
          +%u0934
          +%u0935
          +%u0936
          +%u0937
          +%u0938
          +%u0939
          +%u093A
          +%u093B
          +%u093C
          +%u093D
          +%u093E
          +%u093F
          +%u0940
          +%u0941
          +%u0942
          +%u0943
          +%u0944
          +%u0945
          +%u0946
          +%u0947
          +%u0948
          +%u0949
          +%u094A
          +%u094B
          +%u094C
          +%u094D
          +%u094E
          +%u094F
          +%u0950
          +%u0951
          +%u0952
          +%u0953
          +%u0954
          +%u0955
          +%u0956
          +%u0957
          +%u0958
          +%u0959
          +%u095A
          +%u095B
          +%u095C
          +%u095D
          +%u095E
          +%u095F
          +%u0960
          +%u0961
          +%u0962
          +%u0963
          +%u0964
          +%u0965
          +%u0966
          +%u0967
          +%u0968
          +%u0969
          +%u096A
          +%u096B
          +%u096C
          +%u096D
          +%u096E
          +%u096F
          +%u0970
          +%u0971
          +%u0972
          +%u0973
          +%u0974
          +%u0975
          +%u0976
          +%u0977
          +%u0978
          +%u0979
          +%u097A
          +%u097B
          +%u097C
          +%u097D
          +%u097E
          +%u097F
          +%u0980
          +%u0981
          +%u0982
          +%u0983
          +%u0984
          +%u0985
          +%u0986
          +%u0987
          +%u0988
          +%u0989
          +%u098A
          +%u098B
          +%u098C
          +%u098D
          +%u098E
          +%u098F
          +%u0990
          +%u0991
          +%u0992
          +%u0993
          +%u0994
          +%u0995
          +%u0996
          +%u0997
          +%u0998
          +%u0999
          +%u099A
          +%u099B
          +%u099C
          +%u099D
          +%u099E
          +%u099F
          +%u09A0
          +%u09A1
          +%u09A2
          +%u09A3
          +%u09A4
          +%u09A5
          +%u09A6
          +%u09A7
          +%u09A8
          +%u09A9
          +%u09AA
          +%u09AB
          +%u09AC
          +%u09AD
          +%u09AE
          +%u09AF
          +%u09B0
          +%u09B1
          +%u09B2
          +%u09B3
          +%u09B4
          +%u09B5
          +%u09B6
          +%u09B7
          +%u09B8
          +%u09B9
          +%u09BA
          +%u09BB
          +%u09BC
          +%u09BD
          +%u09BE
          +%u09BF
          +%u09C0
          +%u09C1
          +%u09C2
          +%u09C3
          +%u09C4
          +%u09C5
          +%u09C6
          +%u09C7
          +%u09C8
          +%u09C9
          +%u09CA
          +%u09CB
          +%u09CC
          +%u09CD
          +%u09CE
          +%u09CF
          +%u09D0
          +%u09D1
          +%u09D2
          +%u09D3
          +%u09D4
          +%u09D5
          +%u09D6
          +%u09D7
          +%u09D8
          +%u09D9
          +%u09DA
          +%u09DB
          +%u09DC
          +%u09DD
          +%u09DE
          +%u09DF
          +%u09E0
          +%u09E1
          +%u09E2
          +%u09E3
          +%u09E4
          +%u09E5
          +%u09E6
          +%u09E7
          +%u09E8
          +%u09E9
          +%u09EA
          +%u09EB
          +%u09EC
          +%u09ED
          +%u09EE
          +%u09EF
          +%u09F0
          +%u09F1
          +%u09F2
          +%u09F3
          +%u09F4
          +%u09F5
          +%u09F6
          +%u09F7
          +%u09F8
          +%u09F9
          +%u09FA
          +%u09FB
          +%u09FC
          +%u09FD
          +%u09FE
          +%u09FF
          +%u0A00
          +%u0A01
          +%u0A02
          +%u0A03
          +%u0A04
          +%u0A05
          +%u0A06
          +%u0A07
          +%u0A08
          +%u0A09
          +%u0A0A
          +%u0A0B
          +%u0A0C
          +%u0A0D
          +%u0A0E
          +%u0A0F
          +%u0A10
          +%u0A11
          +%u0A12
          +%u0A13
          +%u0A14
          +%u0A15
          +%u0A16
          +%u0A17
          +%u0A18
          +%u0A19
          +%u0A1A
          +%u0A1B
          +%u0A1C
          +%u0A1D
          +%u0A1E
          +%u0A1F
          +%u0A20
          +%u0A21
          +%u0A22
          +%u0A23
          +%u0A24
          +%u0A25
          +%u0A26
          +%u0A27
          +%u0A28
          +%u0A29
          +%u0A2A
          +%u0A2B
          +%u0A2C
          +%u0A2D
          +%u0A2E
          +%u0A2F
          +%u0A30
          +%u0A31
          +%u0A32
          +%u0A33
          +%u0A34
          +%u0A35
          +%u0A36
          +%u0A37
          +%u0A38
          +%u0A39
          +%u0A3A
          +%u0A3B
          +%u0A3C
          +%u0A3D
          +%u0A3E
          +%u0A3F
          +%u0A40
          +%u0A41
          +%u0A42
          +%u0A43
          +%u0A44
          +%u0A45
          +%u0A46
          +%u0A47
          +%u0A48
          +%u0A49
          +%u0A4A
          +%u0A4B
          +%u0A4C
          +%u0A4D
          +%u0A4E
          +%u0A4F
          +%u0A50
          +%u0A51
          +%u0A52
          +%u0A53
          +%u0A54
          +%u0A55
          +%u0A56
          +%u0A57
          +%u0A58
          +%u0A59
          +%u0A5A
          +%u0A5B
          +%u0A5C
          +%u0A5D
          +%u0A5E
          +%u0A5F
          +%u0A60
          +%u0A61
          +%u0A62
          +%u0A63
          +%u0A64
          +%u0A65
          +%u0A66
          +%u0A67
          +%u0A68
          +%u0A69
          +%u0A6A
          +%u0A6B
          +%u0A6C
          +%u0A6D
          +%u0A6E
          +%u0A6F
          +%u0A70
          +%u0A71
          +%u0A72
          +%u0A73
          +%u0A74
          +%u0A75
          +%u0A76
          +%u0A77
          +%u0A78
          +%u0A79
          +%u0A7A
          +%u0A7B
          +%u0A7C
          +%u0A7D
          +%u0A7E
          +%u0A7F
          +%u0A80
          +%u0A81
          +%u0A82
          +%u0A83
          +%u0A84
          +%u0A85
          +%u0A86
          +%u0A87
          +%u0A88
          +%u0A89
          +%u0A8A
          +%u0A8B
          +%u0A8C
          +%u0A8D
          +%u0A8E
          +%u0A8F
          +%u0A90
          +%u0A91
          +%u0A92
          +%u0A93
          +%u0A94
          +%u0A95
          +%u0A96
          +%u0A97
          +%u0A98
          +%u0A99
          +%u0A9A
          +%u0A9B
          +%u0A9C
          +%u0A9D
          +%u0A9E
          +%u0A9F
          +%u0AA0
          +%u0AA1
          +%u0AA2
          +%u0AA3
          +%u0AA4
          +%u0AA5
          +%u0AA6
          +%u0AA7
          +%u0AA8
          +%u0AA9
          +%u0AAA
          +%u0AAB
          +%u0AAC
          +%u0AAD
          +%u0AAE
          +%u0AAF
          +%u0AB0
          +%u0AB1
          +%u0AB2
          +%u0AB3
          +%u0AB4
          +%u0AB5
          +%u0AB6
          +%u0AB7
          +%u0AB8
          +%u0AB9
          +%u0ABA
          +%u0ABB
          +%u0ABC
          +%u0ABD
          +%u0ABE
          +%u0ABF
          +%u0AC0
          +%u0AC1
          +%u0AC2
          +%u0AC3
          +%u0AC4
          +%u0AC5
          +%u0AC6
          +%u0AC7
          +%u0AC8
          +%u0AC9
          +%u0ACA
          +%u0ACB
          +%u0ACC
          +%u0ACD
          +%u0ACE
          +%u0ACF
          +%u0AD0
          +%u0AD1
          +%u0AD2
          +%u0AD3
          +%u0AD4
          +%u0AD5
          +%u0AD6
          +%u0AD7
          +%u0AD8
          +%u0AD9
          +%u0ADA
          +%u0ADB
          +%u0ADC
          +%u0ADD
          +%u0ADE
          +%u0ADF
          +%u0AE0
          +%u0AE1
          +%u0AE2
          +%u0AE3
          +%u0AE4
          +%u0AE5
          +%u0AE6
          +%u0AE7
          +%u0AE8
          +%u0AE9
          +%u0AEA
          +%u0AEB
          +%u0AEC
          +%u0AED
          +%u0AEE
          +%u0AEF
          +%u0AF0
          +%u0AF1
          +%u0AF2
          +%u0AF3
          +%u0AF4
          +%u0AF5
          +%u0AF6
          +%u0AF7
          +%u0AF8
          +%u0AF9
          +%u0AFA
          +%u0AFB
          +%u0AFC
          +%u0AFD
          +%u0AFE
          +%u0AFF
          +%u0B00
          +%u0B01
          +%u0B02
          +%u0B03
          +%u0B04
          +%u0B05
          +%u0B06
          +%u0B07
          +%u0B08
          +%u0B09
          +%u0B0A
          +%u0B0B
          +%u0B0C
          +%u0B0D
          +%u0B0E
          +%u0B0F
          +%u0B10
          +%u0B11
          +%u0B12
          +%u0B13
          +%u0B14
          +%u0B15
          +%u0B16
          +%u0B17
          +%u0B18
          +%u0B19
          +%u0B1A
          +%u0B1B
          +%u0B1C
          +%u0B1D
          +%u0B1E
          +%u0B1F
          +%u0B20
          +%u0B21
          +%u0B22
          +%u0B23
          +%u0B24
          +%u0B25
          +%u0B26
          +%u0B27
          +%u0B28
          +%u0B29
          +%u0B2A
          +%u0B2B
          +%u0B2C
          +%u0B2D
          +%u0B2E
          +%u0B2F
          +%u0B30
          +%u0B31
          +%u0B32
          +%u0B33
          +%u0B34
          +%u0B35
          +%u0B36
          +%u0B37
          +%u0B38
          +%u0B39
          +%u0B3A
          +%u0B3B
          +%u0B3C
          +%u0B3D
          +%u0B3E
          +%u0B3F
          +%u0B40
          +%u0B41
          +%u0B42
          +%u0B43
          +%u0B44
          +%u0B45
          +%u0B46
          +%u0B47
          +%u0B48
          +%u0B49
          +%u0B4A
          +%u0B4B
          +%u0B4C
          +%u0B4D
          +%u0B4E
          +%u0B4F
          +%u0B50
          +%u0B51
          +%u0B52
          +%u0B53
          +%u0B54
          +%u0B55
          +%u0B56
          +%u0B57
          +%u0B58
          +%u0B59
          +%u0B5A
          +%u0B5B
          +%u0B5C
          +%u0B5D
          +%u0B5E
          +%u0B5F
          +%u0B60
          +%u0B61
          +%u0B62
          +%u0B63
          +%u0B64
          +%u0B65
          +%u0B66
          +%u0B67
          +%u0B68
          +%u0B69
          +%u0B6A
          +%u0B6B
          +%u0B6C
          +%u0B6D
          +%u0B6E
          +%u0B6F
          +%u0B70
          +%u0B71
          +%u0B72
          +%u0B73
          +%u0B74
          +%u0B75
          +%u0B76
          +%u0B77
          +%u0B78
          +%u0B79
          +%u0B7A
          +%u0B7B
          +%u0B7C
          +%u0B7D
          +%u0B7E
          +%u0B7F
          +%u0B80
          +%u0B81
          +%u0B82
          +%u0B83
          +%u0B84
          +%u0B85
          +%u0B86
          +%u0B87
          +%u0B88
          +%u0B89
          +%u0B8A
          +%u0B8B
          +%u0B8C
          +%u0B8D
          +%u0B8E
          +%u0B8F
          +%u0B90
          +%u0B91
          +%u0B92
          +%u0B93
          +%u0B94
          +%u0B95
          +%u0B96
          +%u0B97
          +%u0B98
          +%u0B99
          +%u0B9A
          +%u0B9B
          +%u0B9C
          +%u0B9D
          +%u0B9E
          +%u0B9F
          +%u0BA0
          +%u0BA1
          +%u0BA2
          +%u0BA3
          +%u0BA4
          +%u0BA5
          +%u0BA6
          +%u0BA7
          +%u0BA8
          +%u0BA9
          +%u0BAA
          +%u0BAB
          +%u0BAC
          +%u0BAD
          +%u0BAE
          +%u0BAF
          +%u0BB0
          +%u0BB1
          +%u0BB2
          +%u0BB3
          +%u0BB4
          +%u0BB5
          +%u0BB6
          +%u0BB7
          +%u0BB8
          +%u0BB9
          +%u0BBA
          +%u0BBB
          +%u0BBC
          +%u0BBD
          +%u0BBE
          +%u0BBF
          +%u0BC0
          +%u0BC1
          +%u0BC2
          +%u0BC3
          +%u0BC4
          +%u0BC5
          +%u0BC6
          +%u0BC7
          +%u0BC8
          +%u0BC9
          +%u0BCA
          +%u0BCB
          +%u0BCC
          +%u0BCD
          +%u0BCE
          +%u0BCF
          +%u0BD0
          +%u0BD1
          +%u0BD2
          +%u0BD3
          +%u0BD4
          +%u0BD5
          +%u0BD6
          +%u0BD7
          +%u0BD8
          +%u0BD9
          +%u0BDA
          +%u0BDB
          +%u0BDC
          +%u0BDD
          +%u0BDE
          +%u0BDF
          +%u0BE0
          +%u0BE1
          +%u0BE2
          +%u0BE3
          +%u0BE4
          +%u0BE5
          +%u0BE6
          +%u0BE7
          +%u0BE8
          +%u0BE9
          +%u0BEA
          +%u0BEB
          +%u0BEC
          +%u0BED
          +%u0BEE
          +%u0BEF
          +%u0BF0
          +%u0BF1
          +%u0BF2
          +%u0BF3
          +%u0BF4
          +%u0BF5
          +%u0BF6
          +%u0BF7
          +%u0BF8
          +%u0BF9
          +%u0BFA
          +%u0BFB
          +%u0BFC
          +%u0BFD
          +%u0BFE
          +%u0BFF
          +%u0C00
          +%u0C01
          +%u0C02
          +%u0C03
          +%u0C04
          +%u0C05
          +%u0C06
          +%u0C07
          +%u0C08
          +%u0C09
          +%u0C0A
          +%u0C0B
          +%u0C0C
          +%u0C0D
          +%u0C0E
          +%u0C0F
          +%u0C10
          +%u0C11
          +%u0C12
          +%u0C13
          +%u0C14
          +%u0C15
          +%u0C16
          +%u0C17
          +%u0C18
          +%u0C19
          +%u0C1A
          +%u0C1B
          +%u0C1C
          +%u0C1D
          +%u0C1E
          +%u0C1F
          +%u0C20
          +%u0C21
          +%u0C22
          +%u0C23
          +%u0C24
          +%u0C25
          +%u0C26
          +%u0C27
          +%u0C28
          +%u0C29
          +%u0C2A
          +%u0C2B
          +%u0C2C
          +%u0C2D
          +%u0C2E
          +%u0C2F
          +%u0C30
          +%u0C31
          +%u0C32
          +%u0C33
          +%u0C34
          +%u0C35
          +%u0C36
          +%u0C37
          +%u0C38
          +%u0C39
          +%u0C3A
          +%u0C3B
          +%u0C3C
          +%u0C3D
          +%u0C3E
          +%u0C3F
          +%u0C40
          +%u0C41
          +%u0C42
          +%u0C43
          +%u0C44
          +%u0C45
          +%u0C46
          +%u0C47
          +%u0C48
          +%u0C49
          +%u0C4A
          +%u0C4B
          +%u0C4C
          +%u0C4D
          +%u0C4E
          +%u0C4F
          +%u0C50
          +%u0C51
          +%u0C52
          +%u0C53
          +%u0C54
          +%u0C55
          +%u0C56
          +%u0C57
          +%u0C58
          +%u0C59
          +%u0C5A
          +%u0C5B
          +%u0C5C
          +%u0C5D
          +%u0C5E
          +%u0C5F
          +%u0C60
          +%u0C61
          +%u0C62
          +%u0C63
          +%u0C64
          +%u0C65
          +%u0C66
          +%u0C67
          +%u0C68
          +%u0C69
          +%u0C6A
          +%u0C6B
          +%u0C6C
          +%u0C6D
          +%u0C6E
          +%u0C6F
          +%u0C70
          +%u0C71
          +%u0C72
          +%u0C73
          +%u0C74
          +%u0C75
          +%u0C76
          +%u0C77
          +%u0C78
          +%u0C79
          +%u0C7A
          +%u0C7B
          +%u0C7C
          +%u0C7D
          +%u0C7E
          +%u0C7F
          +%u0C80
          +%u0C81
          +%u0C82
          +%u0C83
          +%u0C84
          +%u0C85
          +%u0C86
          +%u0C87
          +%u0C88
          +%u0C89
          +%u0C8A
          +%u0C8B
          +%u0C8C
          +%u0C8D
          +%u0C8E
          +%u0C8F
          +%u0C90
          +%u0C91
          +%u0C92
          +%u0C93
          +%u0C94
          +%u0C95
          +%u0C96
          +%u0C97
          +%u0C98
          +%u0C99
          +%u0C9A
          +%u0C9B
          +%u0C9C
          +%u0C9D
          +%u0C9E
          +%u0C9F
          +%u0CA0
          +%u0CA1
          +%u0CA2
          +%u0CA3
          +%u0CA4
          +%u0CA5
          +%u0CA6
          +%u0CA7
          +%u0CA8
          +%u0CA9
          +%u0CAA
          +%u0CAB
          +%u0CAC
          +%u0CAD
          +%u0CAE
          +%u0CAF
          +%u0CB0
          +%u0CB1
          +%u0CB2
          +%u0CB3
          +%u0CB4
          +%u0CB5
          +%u0CB6
          +%u0CB7
          +%u0CB8
          +%u0CB9
          +%u0CBA
          +%u0CBB
          +%u0CBC
          +%u0CBD
          +%u0CBE
          +%u0CBF
          +%u0CC0
          +%u0CC1
          +%u0CC2
          +%u0CC3
          +%u0CC4
          +%u0CC5
          +%u0CC6
          +%u0CC7
          +%u0CC8
          +%u0CC9
          +%u0CCA
          +%u0CCB
          +%u0CCC
          +%u0CCD
          +%u0CCE
          +%u0CCF
          +%u0CD0
          +%u0CD1
          +%u0CD2
          +%u0CD3
          +%u0CD4
          +%u0CD5
          +%u0CD6
          +%u0CD7
          +%u0CD8
          +%u0CD9
          +%u0CDA
          +%u0CDB
          +%u0CDC
          +%u0CDD
          +%u0CDE
          +%u0CDF
          +%u0CE0
          +%u0CE1
          +%u0CE2
          +%u0CE3
          +%u0CE4
          +%u0CE5
          +%u0CE6
          +%u0CE7
          +%u0CE8
          +%u0CE9
          +%u0CEA
          +%u0CEB
          +%u0CEC
          +%u0CED
          +%u0CEE
          +%u0CEF
          +%u0CF0
          +%u0CF1
          +%u0CF2
          +%u0CF3
          +%u0CF4
          +%u0CF5
          +%u0CF6
          +%u0CF7
          +%u0CF8
          +%u0CF9
          +%u0CFA
          +%u0CFB
          +%u0CFC
          +%u0CFD
          +%u0CFE
          +%u0CFF
          +%u0D00
          +%u0D01
          +%u0D02
          +%u0D03
          +%u0D04
          +%u0D05
          +%u0D06
          +%u0D07
          +%u0D08
          +%u0D09
          +%u0D0A
          +%u0D0B
          +%u0D0C
          +%u0D0D
          +%u0D0E
          +%u0D0F
          +%u0D10
          +%u0D11
          +%u0D12
          +%u0D13
          +%u0D14
          +%u0D15
          +%u0D16
          +%u0D17
          +%u0D18
          +%u0D19
          +%u0D1A
          +%u0D1B
          +%u0D1C
          +%u0D1D
          +%u0D1E
          +%u0D1F
          +%u0D20
          +%u0D21
          +%u0D22
          +%u0D23
          +%u0D24
          +%u0D25
          +%u0D26
          +%u0D27
          +%u0D28
          +%u0D29
          +%u0D2A
          +%u0D2B
          +%u0D2C
          +%u0D2D
          +%u0D2E
          +%u0D2F
          +%u0D30
          +%u0D31
          +%u0D32
          +%u0D33
          +%u0D34
          +%u0D35
          +%u0D36
          +%u0D37
          +%u0D38
          +%u0D39
          +%u0D3A
          +%u0D3B
          +%u0D3C
          +%u0D3D
          +%u0D3E
          +%u0D3F
          +%u0D40
          +%u0D41
          +%u0D42
          +%u0D43
          +%u0D44
          +%u0D45
          +%u0D46
          +%u0D47
          +%u0D48
          +%u0D49
          +%u0D4A
          +%u0D4B
          +%u0D4C
          +%u0D4D
          +%u0D4E
          +%u0D4F
          +%u0D50
          +%u0D51
          +%u0D52
          +%u0D53
          +%u0D54
          +%u0D55
          +%u0D56
          +%u0D57
          +%u0D58
          +%u0D59
          +%u0D5A
          +%u0D5B
          +%u0D5C
          +%u0D5D
          +%u0D5E
          +%u0D5F
          +%u0D60
          +%u0D61
          +%u0D62
          +%u0D63
          +%u0D64
          +%u0D65
          +%u0D66
          +%u0D67
          +%u0D68
          +%u0D69
          +%u0D6A
          +%u0D6B
          +%u0D6C
          +%u0D6D
          +%u0D6E
          +%u0D6F
          +%u0D70
          +%u0D71
          +%u0D72
          +%u0D73
          +%u0D74
          +%u0D75
          +%u0D76
          +%u0D77
          +%u0D78
          +%u0D79
          +%u0D7A
          +%u0D7B
          +%u0D7C
          +%u0D7D
          +%u0D7E
          +%u0D7F
          +%u0D80
          +%u0D81
          +%u0D82
          +%u0D83
          +%u0D84
          +%u0D85
          +%u0D86
          +%u0D87
          +%u0D88
          +%u0D89
          +%u0D8A
          +%u0D8B
          +%u0D8C
          +%u0D8D
          +%u0D8E
          +%u0D8F
          +%u0D90
          +%u0D91
          +%u0D92
          +%u0D93
          +%u0D94
          +%u0D95
          +%u0D96
          +%u0D97
          +%u0D98
          +%u0D99
          +%u0D9A
          +%u0D9B
          +%u0D9C
          +%u0D9D
          +%u0D9E
          +%u0D9F
          +%u0DA0
          +%u0DA1
          +%u0DA2
          +%u0DA3
          +%u0DA4
          +%u0DA5
          +%u0DA6
          +%u0DA7
          +%u0DA8
          +%u0DA9
          +%u0DAA
          +%u0DAB
          +%u0DAC
          +%u0DAD
          +%u0DAE
          +%u0DAF
          +%u0DB0
          +%u0DB1
          +%u0DB2
          +%u0DB3
          +%u0DB4
          +%u0DB5
          +%u0DB6
          +%u0DB7
          +%u0DB8
          +%u0DB9
          +%u0DBA
          +%u0DBB
          +%u0DBC
          +%u0DBD
          +%u0DBE
          +%u0DBF
          +%u0DC0
          +%u0DC1
          +%u0DC2
          +%u0DC3
          +%u0DC4
          +%u0DC5
          +%u0DC6
          +%u0DC7
          +%u0DC8
          +%u0DC9
          +%u0DCA
          +%u0DCB
          +%u0DCC
          +%u0DCD
          +%u0DCE
          +%u0DCF
          +%u0DD0
          +%u0DD1
          +%u0DD2
          +%u0DD3
          +%u0DD4
          +%u0DD5
          +%u0DD6
          +%u0DD7
          +%u0DD8
          +%u0DD9
          +%u0DDA
          +%u0DDB
          +%u0DDC
          +%u0DDD
          +%u0DDE
          +%u0DDF
          +%u0DE0
          +%u0DE1
          +%u0DE2
          +%u0DE3
          +%u0DE4
          +%u0DE5
          +%u0DE6
          +%u0DE7
          +%u0DE8
          +%u0DE9
          +%u0DEA
          +%u0DEB
          +%u0DEC
          +%u0DED
          +%u0DEE
          +%u0DEF
          +%u0DF0
          +%u0DF1
          +%u0DF2
          +%u0DF3
          +%u0DF4
          +%u0DF5
          +%u0DF6
          +%u0DF7
          +%u0DF8
          +%u0DF9
          +%u0DFA
          +%u0DFB
          +%u0DFC
          +%u0DFD
          +%u0DFE
          +%u0DFF
          +%u0E00
          +%u0E01
          +%u0E02
          +%u0E03
          +%u0E04
          +%u0E05
          +%u0E06
          +%u0E07
          +%u0E08
          +%u0E09
          +%u0E0A
          +%u0E0B
          +%u0E0C
          +%u0E0D
          +%u0E0E
          +%u0E0F
          +%u0E10
          +%u0E11
          +%u0E12
          +%u0E13
          +%u0E14
          +%u0E15
          +%u0E16
          +%u0E17
          +%u0E18
          +%u0E19
          +%u0E1A
          +%u0E1B
          +%u0E1C
          +%u0E1D
          +%u0E1E
          +%u0E1F
          +%u0E20
          +%u0E21
          +%u0E22
          +%u0E23
          +%u0E24
          +%u0E25
          +%u0E26
          +%u0E27
          +%u0E28
          +%u0E29
          +%u0E2A
          +%u0E2B
          +%u0E2C
          +%u0E2D
          +%u0E2E
          +%u0E2F
          +%u0E30
          +%u0E31
          +%u0E32
          +%u0E33
          +%u0E34
          +%u0E35
          +%u0E36
          +%u0E37
          +%u0E38
          +%u0E39
          +%u0E3A
          +%u0E3B
          +%u0E3C
          +%u0E3D
          +%u0E3E
          +%u0E3F
          +%u0E40
          +%u0E41
          +%u0E42
          +%u0E43
          +%u0E44
          +%u0E45
          +%u0E46
          +%u0E47
          +%u0E48
          +%u0E49
          +%u0E4A
          +%u0E4B
          +%u0E4C
          +%u0E4D
          +%u0E4E
          +%u0E4F
          +%u0E50
          +%u0E51
          +%u0E52
          +%u0E53
          +%u0E54
          +%u0E55
          +%u0E56
          +%u0E57
          +%u0E58
          +%u0E59
          +%u0E5A
          +%u0E5B
          +%u0E5C
          +%u0E5D
          +%u0E5E
          +%u0E5F
          +%u0E60
          +%u0E61
          +%u0E62
          +%u0E63
          +%u0E64
          +%u0E65
          +%u0E66
          +%u0E67
          +%u0E68
          +%u0E69
          +%u0E6A
          +%u0E6B
          +%u0E6C
          +%u0E6D
          +%u0E6E
          +%u0E6F
          +%u0E70
          +%u0E71
          +%u0E72
          +%u0E73
          +%u0E74
          +%u0E75
          +%u0E76
          +%u0E77
          +%u0E78
          +%u0E79
          +%u0E7A
          +%u0E7B
          +%u0E7C
          +%u0E7D
          +%u0E7E
          +%u0E7F
          +%u0E80
          +%u0E81
          +%u0E82
          +%u0E83
          +%u0E84
          +%u0E85
          +%u0E86
          +%u0E87
          +%u0E88
          +%u0E89
          +%u0E8A
          +%u0E8B
          +%u0E8C
          +%u0E8D
          +%u0E8E
          +%u0E8F
          +%u0E90
          +%u0E91
          +%u0E92
          +%u0E93
          +%u0E94
          +%u0E95
          +%u0E96
          +%u0E97
          +%u0E98
          +%u0E99
          +%u0E9A
          +%u0E9B
          +%u0E9C
          +%u0E9D
          +%u0E9E
          +%u0E9F
          +%u0EA0
          +%u0EA1
          +%u0EA2
          +%u0EA3
          +%u0EA4
          +%u0EA5
          +%u0EA6
          +%u0EA7
          +%u0EA8
          +%u0EA9
          +%u0EAA
          +%u0EAB
          +%u0EAC
          +%u0EAD
          +%u0EAE
          +%u0EAF
          +%u0EB0
          +%u0EB1
          +%u0EB2
          +%u0EB3
          +%u0EB4
          +%u0EB5
          +%u0EB6
          +%u0EB7
          +%u0EB8
          +%u0EB9
          +%u0EBA
          +%u0EBB
          +%u0EBC
          +%u0EBD
          +%u0EBE
          +%u0EBF
          +%u0EC0
          +%u0EC1
          +%u0EC2
          +%u0EC3
          +%u0EC4
          +%u0EC5
          +%u0EC6
          +%u0EC7
          +%u0EC8
          +%u0EC9
          +%u0ECA
          +%u0ECB
          +%u0ECC
          +%u0ECD
          +%u0ECE
          +%u0ECF
          +%u0ED0
          +%u0ED1
          +%u0ED2
          +%u0ED3
          +%u0ED4
          +%u0ED5
          +%u0ED6
          +%u0ED7
          +%u0ED8
          +%u0ED9
          +%u0EDA
          +%u0EDB
          +%u0EDC
          +%u0EDD
          +%u0EDE
          +%u0EDF
          +%u0EE0
          +%u0EE1
          +%u0EE2
          +%u0EE3
          +%u0EE4
          +%u0EE5
          +%u0EE6
          +%u0EE7
          +%u0EE8
          +%u0EE9
          +%u0EEA
          +%u0EEB
          +%u0EEC
          +%u0EED
          +%u0EEE
          +%u0EEF
          +%u0EF0
          +%u0EF1
          +%u0EF2
          +%u0EF3
          +%u0EF4
          +%u0EF5
          +%u0EF6
          +%u0EF7
          +%u0EF8
          +%u0EF9
          +%u0EFA
          +%u0EFB
          +%u0EFC
          +%u0EFD
          +%u0EFE
          +%u0EFF
          +%u0F00
          +%u0F01
          +%u0F02
          +%u0F03
          +%u0F04
          +%u0F05
          +%u0F06
          +%u0F07
          +%u0F08
          +%u0F09
          +%u0F0A
          +%u0F0B
          +%u0F0C
          +%u0F0D
          +%u0F0E
          +%u0F0F
          +%u0F10
          +%u0F11
          +%u0F12
          +%u0F13
          +%u0F14
          +%u0F15
          +%u0F16
          +%u0F17
          +%u0F18
          +%u0F19
          +%u0F1A
          +%u0F1B
          +%u0F1C
          +%u0F1D
          +%u0F1E
          +%u0F1F
          +%u0F20
          +%u0F21
          +%u0F22
          +%u0F23
          +%u0F24
          +%u0F25
          +%u0F26
          +%u0F27
          +%u0F28
          +%u0F29
          +%u0F2A
          +%u0F2B
          +%u0F2C
          +%u0F2D
          +%u0F2E
          +%u0F2F
          +%u0F30
          +%u0F31
          +%u0F32
          +%u0F33
          +%u0F34
          +%u0F35
          +%u0F36
          +%u0F37
          +%u0F38
          +%u0F39
          +%u0F3A
          +%u0F3B
          +%u0F3C
          +%u0F3D
          +%u0F3E
          +%u0F3F
          +%u0F40
          +%u0F41
          +%u0F42
          +%u0F43
          +%u0F44
          +%u0F45
          +%u0F46
          +%u0F47
          +%u0F48
          +%u0F49
          +%u0F4A
          +%u0F4B
          +%u0F4C
          +%u0F4D
          +%u0F4E
          +%u0F4F
          +%u0F50
          +%u0F51
          +%u0F52
          +%u0F53
          +%u0F54
          +%u0F55
          +%u0F56
          +%u0F57
          +%u0F58
          +%u0F59
          +%u0F5A
          +%u0F5B
          +%u0F5C
          +%u0F5D
          +%u0F5E
          +%u0F5F
          +%u0F60
          +%u0F61
          +%u0F62
          +%u0F63
          +%u0F64
          +%u0F65
          +%u0F66
          +%u0F67
          +%u0F68
          +%u0F69
          +%u0F6A
          +%u0F6B
          +%u0F6C
          +%u0F6D
          +%u0F6E
          +%u0F6F
          +%u0F70
          +%u0F71
          +%u0F72
          +%u0F73
          +%u0F74
          +%u0F75
          +%u0F76
          +%u0F77
          +%u0F78
          +%u0F79
          +%u0F7A
          +%u0F7B
          +%u0F7C
          +%u0F7D
          +%u0F7E
          +%u0F7F
          +%u0F80
          +%u0F81
          +%u0F82
          +%u0F83
          +%u0F84
          +%u0F85
          +%u0F86
          +%u0F87
          +%u0F88
          +%u0F89
          +%u0F8A
          +%u0F8B
          +%u0F8C
          +%u0F8D
          +%u0F8E
          +%u0F8F
          +%u0F90
          +%u0F91
          +%u0F92
          +%u0F93
          +%u0F94
          +%u0F95
          +%u0F96
          +%u0F97
          +%u0F98
          +%u0F99
          +%u0F9A
          +%u0F9B
          +%u0F9C
          +%u0F9D
          +%u0F9E
          +%u0F9F
          +%u0FA0
          +%u0FA1
          +%u0FA2
          +%u0FA3
          +%u0FA4
          +%u0FA5
          +%u0FA6
          +%u0FA7
          +%u0FA8
          +%u0FA9
          +%u0FAA
          +%u0FAB
          +%u0FAC
          +%u0FAD
          +%u0FAE
          +%u0FAF
          +%u0FB0
          +%u0FB1
          +%u0FB2
          +%u0FB3
          +%u0FB4
          +%u0FB5
          +%u0FB6
          +%u0FB7
          +%u0FB8
          +%u0FB9
          +%u0FBA
          +%u0FBB
          +%u0FBC
          +%u0FBD
          +%u0FBE
          +%u0FBF
          +%u0FC0
          +%u0FC1
          +%u0FC2
          +%u0FC3
          +%u0FC4
          +%u0FC5
          +%u0FC6
          +%u0FC7
          +%u0FC8
          +%u0FC9
          +%u0FCA
          +%u0FCB
          +%u0FCC
          +%u0FCD
          +%u0FCE
          +%u0FCF
          +%u0FD0
          +%u0FD1
          +%u0FD2
          +%u0FD3
          +%u0FD4
          +%u0FD5
          +%u0FD6
          +%u0FD7
          +%u0FD8
          +%u0FD9
          +%u0FDA
          +%u0FDB
          +%u0FDC
          +%u0FDD
          +%u0FDE
          +%u0FDF
          +%u0FE0
          +%u0FE1
          +%u0FE2
          +%u0FE3
          +%u0FE4
          +%u0FE5
          +%u0FE6
          +%u0FE7
          +%u0FE8
          +%u0FE9
          +%u0FEA
          +%u0FEB
          +%u0FEC
          +%u0FED
          +%u0FEE
          +%u0FEF
          +%u0FF0
          +%u0FF1
          +%u0FF2
          +%u0FF3
          +%u0FF4
          +%u0FF5
          +%u0FF6
          +%u0FF7
          +%u0FF8
          +%u0FF9
          +%u0FFA
          +%u0FFB
          +%u0FFC
          +%u0FFD
          +%u0FFE
          +%u0FFF
          +%u1000
          +%u1001
          +%u1002
          +%u1003
          +%u1004
          +%u1005
          +%u1006
          +%u1007
          +%u1008
          +%u1009
          +%u100A
          +%u100B
          +%u100C
          +%u100D
          +%u100E
          +%u100F
          +%u1010
          +%u1011
          +%u1012
          +%u1013
          +%u1014
          +%u1015
          +%u1016
          +%u1017
          +%u1018
          +%u1019
          +%u101A
          +%u101B
          +%u101C
          +%u101D
          +%u101E
          +%u101F
          +%u1020
          +%u1021
          +%u1022
          +%u1023
          +%u1024
          +%u1025
          +%u1026
          +%u1027
          +%u1028
          +%u1029
          +%u102A
          +%u102B
          +%u102C
          +%u102D
          +%u102E
          +%u102F
          +%u1030
          +%u1031
          +%u1032
          +%u1033
          +%u1034
          +%u1035
          +%u1036
          +%u1037
          +%u1038
          +%u1039
          +%u103A
          +%u103B
          +%u103C
          +%u103D
          +%u103E
          +%u103F
          +%u1040
          +%u1041
          +%u1042
          +%u1043
          +%u1044
          +%u1045
          +%u1046
          +%u1047
          +%u1048
          +%u1049
          +%u104A
          +%u104B
          +%u104C
          +%u104D
          +%u104E
          +%u104F
          +%u1050
          +%u1051
          +%u1052
          +%u1053
          +%u1054
          +%u1055
          +%u1056
          +%u1057
          +%u1058
          +%u1059
          +%u105A
          +%u105B
          +%u105C
          +%u105D
          +%u105E
          +%u105F
          +%u1060
          +%u1061
          +%u1062
          +%u1063
          +%u1064
          +%u1065
          +%u1066
          +%u1067
          +%u1068
          +%u1069
          +%u106A
          +%u106B
          +%u106C
          +%u106D
          +%u106E
          +%u106F
          +%u1070
          +%u1071
          +%u1072
          +%u1073
          +%u1074
          +%u1075
          +%u1076
          +%u1077
          +%u1078
          +%u1079
          +%u107A
          +%u107B
          +%u107C
          +%u107D
          +%u107E
          +%u107F
          +%u1080
          +%u1081
          +%u1082
          +%u1083
          +%u1084
          +%u1085
          +%u1086
          +%u1087
          +%u1088
          +%u1089
          +%u108A
          +%u108B
          +%u108C
          +%u108D
          +%u108E
          +%u108F
          +%u1090
          +%u1091
          +%u1092
          +%u1093
          +%u1094
          +%u1095
          +%u1096
          +%u1097
          +%u1098
          +%u1099
          +%u109A
          +%u109B
          +%u109C
          +%u109D
          +%u109E
          +%u109F
          +%u10A0
          +%u10A1
          +%u10A2
          +%u10A3
          +%u10A4
          +%u10A5
          +%u10A6
          +%u10A7
          +%u10A8
          +%u10A9
          +%u10AA
          +%u10AB
          +%u10AC
          +%u10AD
          +%u10AE
          +%u10AF
          +%u10B0
          +%u10B1
          +%u10B2
          +%u10B3
          +%u10B4
          +%u10B5
          +%u10B6
          +%u10B7
          +%u10B8
          +%u10B9
          +%u10BA
          +%u10BB
          +%u10BC
          +%u10BD
          +%u10BE
          +%u10BF
          +%u10C0
          +%u10C1
          +%u10C2
          +%u10C3
          +%u10C4
          +%u10C5
          +%u10C6
          +%u10C7
          +%u10C8
          +%u10C9
          +%u10CA
          +%u10CB
          +%u10CC
          +%u10CD
          +%u10CE
          +%u10CF
          +%u10D0
          +%u10D1
          +%u10D2
          +%u10D3
          +%u10D4
          +%u10D5
          +%u10D6
          +%u10D7
          +%u10D8
          +%u10D9
          +%u10DA
          +%u10DB
          +%u10DC
          +%u10DD
          +%u10DE
          +%u10DF
          +%u10E0
          +%u10E1
          +%u10E2
          +%u10E3
          +%u10E4
          +%u10E5
          +%u10E6
          +%u10E7
          +%u10E8
          +%u10E9
          +%u10EA
          +%u10EB
          +%u10EC
          +%u10ED
          +%u10EE
          +%u10EF
          +%u10F0
          +%u10F1
          +%u10F2
          +%u10F3
          +%u10F4
          +%u10F5
          +%u10F6
          +%u10F7
          +%u10F8
          +%u10F9
          +%u10FA
          +%u10FB
          +%u10FC
          +%u10FD
          +%u10FE
          +%u10FF
          +%u1100
          +%u1101
          +%u1102
          +%u1103
          +%u1104
          +%u1105
          +%u1106
          +%u1107
          +%u1108
          +%u1109
          +%u110A
          +%u110B
          +%u110C
          +%u110D
          +%u110E
          +%u110F
          +%u1110
          +%u1111
          +%u1112
          +%u1113
          +%u1114
          +%u1115
          +%u1116
          +%u1117
          +%u1118
          +%u1119
          +%u111A
          +%u111B
          +%u111C
          +%u111D
          +%u111E
          +%u111F
          +%u1120
          +%u1121
          +%u1122
          +%u1123
          +%u1124
          +%u1125
          +%u1126
          +%u1127
          +%u1128
          +%u1129
          +%u112A
          +%u112B
          +%u112C
          +%u112D
          +%u112E
          +%u112F
          +%u1130
          +%u1131
          +%u1132
          +%u1133
          +%u1134
          +%u1135
          +%u1136
          +%u1137
          +%u1138
          +%u1139
          +%u113A
          +%u113B
          +%u113C
          +%u113D
          +%u113E
          +%u113F
          +%u1140
          +%u1141
          +%u1142
          +%u1143
          +%u1144
          +%u1145
          +%u1146
          +%u1147
          +%u1148
          +%u1149
          +%u114A
          +%u114B
          +%u114C
          +%u114D
          +%u114E
          +%u114F
          +%u1150
          +%u1151
          +%u1152
          +%u1153
          +%u1154
          +%u1155
          +%u1156
          +%u1157
          +%u1158
          +%u1159
          +%u115A
          +%u115B
          +%u115C
          +%u115D
          +%u115E
          +%u115F
          +%u1160
          +%u1161
          +%u1162
          +%u1163
          +%u1164
          +%u1165
          +%u1166
          +%u1167
          +%u1168
          +%u1169
          +%u116A
          +%u116B
          +%u116C
          +%u116D
          +%u116E
          +%u116F
          +%u1170
          +%u1171
          +%u1172
          +%u1173
          +%u1174
          +%u1175
          +%u1176
          +%u1177
          +%u1178
          +%u1179
          +%u117A
          +%u117B
          +%u117C
          +%u117D
          +%u117E
          +%u117F
          +%u1180
          +%u1181
          +%u1182
          +%u1183
          +%u1184
          +%u1185
          +%u1186
          +%u1187
          +%u1188
          +%u1189
          +%u118A
          +%u118B
          +%u118C
          +%u118D
          +%u118E
          +%u118F
          +%u1190
          +%u1191
          +%u1192
          +%u1193
          +%u1194
          +%u1195
          +%u1196
          +%u1197
          +%u1198
          +%u1199
          +%u119A
          +%u119B
          +%u119C
          +%u119D
          +%u119E
          +%u119F
          +%u11A0
          +%u11A1
          +%u11A2
          +%u11A3
          +%u11A4
          +%u11A5
          +%u11A6
          +%u11A7
          +%u11A8
          +%u11A9
          +%u11AA
          +%u11AB
          +%u11AC
          +%u11AD
          +%u11AE
          +%u11AF
          +%u11B0
          +%u11B1
          +%u11B2
          +%u11B3
          +%u11B4
          +%u11B5
          +%u11B6
          +%u11B7
          +%u11B8
          +%u11B9
          +%u11BA
          +%u11BB
          +%u11BC
          +%u11BD
          +%u11BE
          +%u11BF
          +%u11C0
          +%u11C1
          +%u11C2
          +%u11C3
          +%u11C4
          +%u11C5
          +%u11C6
          +%u11C7
          +%u11C8
          +%u11C9
          +%u11CA
          +%u11CB
          +%u11CC
          +%u11CD
          +%u11CE
          +%u11CF
          +%u11D0
          +%u11D1
          +%u11D2
          +%u11D3
          +%u11D4
          +%u11D5
          +%u11D6
          +%u11D7
          +%u11D8
          +%u11D9
          +%u11DA
          +%u11DB
          +%u11DC
          +%u11DD
          +%u11DE
          +%u11DF
          +%u11E0
          +%u11E1
          +%u11E2
          +%u11E3
          +%u11E4
          +%u11E5
          +%u11E6
          +%u11E7
          +%u11E8
          +%u11E9
          +%u11EA
          +%u11EB
          +%u11EC
          +%u11ED
          +%u11EE
          +%u11EF
          +%u11F0
          +%u11F1
          +%u11F2
          +%u11F3
          +%u11F4
          +%u11F5
          +%u11F6
          +%u11F7
          +%u11F8
          +%u11F9
          +%u11FA
          +%u11FB
          +%u11FC
          +%u11FD
          +%u11FE
          +%u11FF
          +%u1200
          +%u1201
          +%u1202
          +%u1203
          +%u1204
          +%u1205
          +%u1206
          +%u1207
          +%u1208
          +%u1209
          +%u120A
          +%u120B
          +%u120C
          +%u120D
          +%u120E
          +%u120F
          +%u1210
          +%u1211
          +%u1212
          +%u1213
          +%u1214
          +%u1215
          +%u1216
          +%u1217
          +%u1218
          +%u1219
          +%u121A
          +%u121B
          +%u121C
          +%u121D
          +%u121E
          +%u121F
          +%u1220
          +%u1221
          +%u1222
          +%u1223
          +%u1224
          +%u1225
          +%u1226
          +%u1227
          +%u1228
          +%u1229
          +%u122A
          +%u122B
          +%u122C
          +%u122D
          +%u122E
          +%u122F
          +%u1230
          +%u1231
          +%u1232
          +%u1233
          +%u1234
          +%u1235
          +%u1236
          +%u1237
          +%u1238
          +%u1239
          +%u123A
          +%u123B
          +%u123C
          +%u123D
          +%u123E
          +%u123F
          +%u1240
          +%u1241
          +%u1242
          +%u1243
          +%u1244
          +%u1245
          +%u1246
          +%u1247
          +%u1248
          +%u1249
          +%u124A
          +%u124B
          +%u124C
          +%u124D
          +%u124E
          +%u124F
          +%u1250
          +%u1251
          +%u1252
          +%u1253
          +%u1254
          +%u1255
          +%u1256
          +%u1257
          +%u1258
          +%u1259
          +%u125A
          +%u125B
          +%u125C
          +%u125D
          +%u125E
          +%u125F
          +%u1260
          +%u1261
          +%u1262
          +%u1263
          +%u1264
          +%u1265
          +%u1266
          +%u1267
          +%u1268
          +%u1269
          +%u126A
          +%u126B
          +%u126C
          +%u126D
          +%u126E
          +%u126F
          +%u1270
          +%u1271
          +%u1272
          +%u1273
          +%u1274
          +%u1275
          +%u1276
          +%u1277
          +%u1278
          +%u1279
          +%u127A
          +%u127B
          +%u127C
          +%u127D
          +%u127E
          +%u127F
          +%u1280
          +%u1281
          +%u1282
          +%u1283
          +%u1284
          +%u1285
          +%u1286
          +%u1287
          +%u1288
          +%u1289
          +%u128A
          +%u128B
          +%u128C
          +%u128D
          +%u128E
          +%u128F
          +%u1290
          +%u1291
          +%u1292
          +%u1293
          +%u1294
          +%u1295
          +%u1296
          +%u1297
          +%u1298
          +%u1299
          +%u129A
          +%u129B
          +%u129C
          +%u129D
          +%u129E
          +%u129F
          +%u12A0
          +%u12A1
          +%u12A2
          +%u12A3
          +%u12A4
          +%u12A5
          +%u12A6
          +%u12A7
          +%u12A8
          +%u12A9
          +%u12AA
          +%u12AB
          +%u12AC
          +%u12AD
          +%u12AE
          +%u12AF
          +%u12B0
          +%u12B1
          +%u12B2
          +%u12B3
          +%u12B4
          +%u12B5
          +%u12B6
          +%u12B7
          +%u12B8
          +%u12B9
          +%u12BA
          +%u12BB
          +%u12BC
          +%u12BD
          +%u12BE
          +%u12BF
          +%u12C0
          +%u12C1
          +%u12C2
          +%u12C3
          +%u12C4
          +%u12C5
          +%u12C6
          +%u12C7
          +%u12C8
          +%u12C9
          +%u12CA
          +%u12CB
          +%u12CC
          +%u12CD
          +%u12CE
          +%u12CF
          +%u12D0
          +%u12D1
          +%u12D2
          +%u12D3
          +%u12D4
          +%u12D5
          +%u12D6
          +%u12D7
          +%u12D8
          +%u12D9
          +%u12DA
          +%u12DB
          +%u12DC
          +%u12DD
          +%u12DE
          +%u12DF
          +%u12E0
          +%u12E1
          +%u12E2
          +%u12E3
          +%u12E4
          +%u12E5
          +%u12E6
          +%u12E7
          +%u12E8
          +%u12E9
          +%u12EA
          +%u12EB
          +%u12EC
          +%u12ED
          +%u12EE
          +%u12EF
          +%u12F0
          +%u12F1
          +%u12F2
          +%u12F3
          +%u12F4
          +%u12F5
          +%u12F6
          +%u12F7
          +%u12F8
          +%u12F9
          +%u12FA
          +%u12FB
          +%u12FC
          +%u12FD
          +%u12FE
          +%u12FF
          +%u1300
          +%u1301
          +%u1302
          +%u1303
          +%u1304
          +%u1305
          +%u1306
          +%u1307
          +%u1308
          +%u1309
          +%u130A
          +%u130B
          +%u130C
          +%u130D
          +%u130E
          +%u130F
          +%u1310
          +%u1311
          +%u1312
          +%u1313
          +%u1314
          +%u1315
          +%u1316
          +%u1317
          +%u1318
          +%u1319
          +%u131A
          +%u131B
          +%u131C
          +%u131D
          +%u131E
          +%u131F
          +%u1320
          +%u1321
          +%u1322
          +%u1323
          +%u1324
          +%u1325
          +%u1326
          +%u1327
          +%u1328
          +%u1329
          +%u132A
          +%u132B
          +%u132C
          +%u132D
          +%u132E
          +%u132F
          +%u1330
          +%u1331
          +%u1332
          +%u1333
          +%u1334
          +%u1335
          +%u1336
          +%u1337
          +%u1338
          +%u1339
          +%u133A
          +%u133B
          +%u133C
          +%u133D
          +%u133E
          +%u133F
          +%u1340
          +%u1341
          +%u1342
          +%u1343
          +%u1344
          +%u1345
          +%u1346
          +%u1347
          +%u1348
          +%u1349
          +%u134A
          +%u134B
          +%u134C
          +%u134D
          +%u134E
          +%u134F
          +%u1350
          +%u1351
          +%u1352
          +%u1353
          +%u1354
          +%u1355
          +%u1356
          +%u1357
          +%u1358
          +%u1359
          +%u135A
          +%u135B
          +%u135C
          +%u135D
          +%u135E
          +%u135F
          +%u1360
          +%u1361
          +%u1362
          +%u1363
          +%u1364
          +%u1365
          +%u1366
          +%u1367
          +%u1368
          +%u1369
          +%u136A
          +%u136B
          +%u136C
          +%u136D
          +%u136E
          +%u136F
          +%u1370
          +%u1371
          +%u1372
          +%u1373
          +%u1374
          +%u1375
          +%u1376
          +%u1377
          +%u1378
          +%u1379
          +%u137A
          +%u137B
          +%u137C
          +%u137D
          +%u137E
          +%u137F
          +%u1380
          +%u1381
          +%u1382
          +%u1383
          +%u1384
          +%u1385
          +%u1386
          +%u1387
          +%u1388
          +%u1389
          +%u138A
          +%u138B
          +%u138C
          +%u138D
          +%u138E
          +%u138F
          +%u1390
          +%u1391
          +%u1392
          +%u1393
          +%u1394
          +%u1395
          +%u1396
          +%u1397
          +%u1398
          +%u1399
          +%u139A
          +%u139B
          +%u139C
          +%u139D
          +%u139E
          +%u139F
          +%u13A0
          +%u13A1
          +%u13A2
          +%u13A3
          +%u13A4
          +%u13A5
          +%u13A6
          +%u13A7
          +%u13A8
          +%u13A9
          +%u13AA
          +%u13AB
          +%u13AC
          +%u13AD
          +%u13AE
          +%u13AF
          +%u13B0
          +%u13B1
          +%u13B2
          +%u13B3
          +%u13B4
          +%u13B5
          +%u13B6
          +%u13B7
          +%u13B8
          +%u13B9
          +%u13BA
          +%u13BB
          +%u13BC
          +%u13BD
          +%u13BE
          +%u13BF
          +%u13C0
          +%u13C1
          +%u13C2
          +%u13C3
          +%u13C4
          +%u13C5
          +%u13C6
          +%u13C7
          +%u13C8
          +%u13C9
          +%u13CA
          +%u13CB
          +%u13CC
          +%u13CD
          +%u13CE
          +%u13CF
          +%u13D0
          +%u13D1
          +%u13D2
          +%u13D3
          +%u13D4
          +%u13D5
          +%u13D6
          +%u13D7
          +%u13D8
          +%u13D9
          +%u13DA
          +%u13DB
          +%u13DC
          +%u13DD
          +%u13DE
          +%u13DF
          +%u13E0
          +%u13E1
          +%u13E2
          +%u13E3
          +%u13E4
          +%u13E5
          +%u13E6
          +%u13E7
          +%u13E8
          +%u13E9
          +%u13EA
          +%u13EB
          +%u13EC
          +%u13ED
          +%u13EE
          +%u13EF
          +%u13F0
          +%u13F1
          +%u13F2
          +%u13F3
          +%u13F4
          +%u13F5
          +%u13F6
          +%u13F7
          +%u13F8
          +%u13F9
          +%u13FA
          +%u13FB
          +%u13FC
          +%u13FD
          +%u13FE
          +%u13FF
          +%u1400
          +%u1401
          +%u1402
          +%u1403
          +%u1404
          +%u1405
          +%u1406
          +%u1407
          +%u1408
          +%u1409
          +%u140A
          +%u140B
          +%u140C
          +%u140D
          +%u140E
          +%u140F
          +%u1410
          +%u1411
          +%u1412
          +%u1413
          +%u1414
          +%u1415
          +%u1416
          +%u1417
          +%u1418
          +%u1419
          +%u141A
          +%u141B
          +%u141C
          +%u141D
          +%u141E
          +%u141F
          +%u1420
          +%u1421
          +%u1422
          +%u1423
          +%u1424
          +%u1425
          +%u1426
          +%u1427
          +%u1428
          +%u1429
          +%u142A
          +%u142B
          +%u142C
          +%u142D
          +%u142E
          +%u142F
          +%u1430
          +%u1431
          +%u1432
          +%u1433
          +%u1434
          +%u1435
          +%u1436
          +%u1437
          +%u1438
          +%u1439
          +%u143A
          +%u143B
          +%u143C
          +%u143D
          +%u143E
          +%u143F
          +%u1440
          +%u1441
          +%u1442
          +%u1443
          +%u1444
          +%u1445
          +%u1446
          +%u1447
          +%u1448
          +%u1449
          +%u144A
          +%u144B
          +%u144C
          +%u144D
          +%u144E
          +%u144F
          +%u1450
          +%u1451
          +%u1452
          +%u1453
          +%u1454
          +%u1455
          +%u1456
          +%u1457
          +%u1458
          +%u1459
          +%u145A
          +%u145B
          +%u145C
          +%u145D
          +%u145E
          +%u145F
          +%u1460
          +%u1461
          +%u1462
          +%u1463
          +%u1464
          +%u1465
          +%u1466
          +%u1467
          +%u1468
          +%u1469
          +%u146A
          +%u146B
          +%u146C
          +%u146D
          +%u146E
          +%u146F
          +%u1470
          +%u1471
          +%u1472
          +%u1473
          +%u1474
          +%u1475
          +%u1476
          +%u1477
          +%u1478
          +%u1479
          +%u147A
          +%u147B
          +%u147C
          +%u147D
          +%u147E
          +%u147F
          +%u1480
          +%u1481
          +%u1482
          +%u1483
          +%u1484
          +%u1485
          +%u1486
          +%u1487
          +%u1488
          +%u1489
          +%u148A
          +%u148B
          +%u148C
          +%u148D
          +%u148E
          +%u148F
          +%u1490
          +%u1491
          +%u1492
          +%u1493
          +%u1494
          +%u1495
          +%u1496
          +%u1497
          +%u1498
          +%u1499
          +%u149A
          +%u149B
          +%u149C
          +%u149D
          +%u149E
          +%u149F
          +%u14A0
          +%u14A1
          +%u14A2
          +%u14A3
          +%u14A4
          +%u14A5
          +%u14A6
          +%u14A7
          +%u14A8
          +%u14A9
          +%u14AA
          +%u14AB
          +%u14AC
          +%u14AD
          +%u14AE
          +%u14AF
          +%u14B0
          +%u14B1
          +%u14B2
          +%u14B3
          +%u14B4
          +%u14B5
          +%u14B6
          +%u14B7
          +%u14B8
          +%u14B9
          +%u14BA
          +%u14BB
          +%u14BC
          +%u14BD
          +%u14BE
          +%u14BF
          +%u14C0
          +%u14C1
          +%u14C2
          +%u14C3
          +%u14C4
          +%u14C5
          +%u14C6
          +%u14C7
          +%u14C8
          +%u14C9
          +%u14CA
          +%u14CB
          +%u14CC
          +%u14CD
          +%u14CE
          +%u14CF
          +%u14D0
          +%u14D1
          +%u14D2
          +%u14D3
          +%u14D4
          +%u14D5
          +%u14D6
          +%u14D7
          +%u14D8
          +%u14D9
          +%u14DA
          +%u14DB
          +%u14DC
          +%u14DD
          +%u14DE
          +%u14DF
          +%u14E0
          +%u14E1
          +%u14E2
          +%u14E3
          +%u14E4
          +%u14E5
          +%u14E6
          +%u14E7
          +%u14E8
          +%u14E9
          +%u14EA
          +%u14EB
          +%u14EC
          +%u14ED
          +%u14EE
          +%u14EF
          +%u14F0
          +%u14F1
          +%u14F2
          +%u14F3
          +%u14F4
          +%u14F5
          +%u14F6
          +%u14F7
          +%u14F8
          +%u14F9
          +%u14FA
          +%u14FB
          +%u14FC
          +%u14FD
          +%u14FE
          +%u14FF
          +%u1500
          +%u1501
          +%u1502
          +%u1503
          +%u1504
          +%u1505
          +%u1506
          +%u1507
          +%u1508
          +%u1509
          +%u150A
          +%u150B
          +%u150C
          +%u150D
          +%u150E
          +%u150F
          +%u1510
          +%u1511
          +%u1512
          +%u1513
          +%u1514
          +%u1515
          +%u1516
          +%u1517
          +%u1518
          +%u1519
          +%u151A
          +%u151B
          +%u151C
          +%u151D
          +%u151E
          +%u151F
          +%u1520
          +%u1521
          +%u1522
          +%u1523
          +%u1524
          +%u1525
          +%u1526
          +%u1527
          +%u1528
          +%u1529
          +%u152A
          +%u152B
          +%u152C
          +%u152D
          +%u152E
          +%u152F
          +%u1530
          +%u1531
          +%u1532
          +%u1533
          +%u1534
          +%u1535
          +%u1536
          +%u1537
          +%u1538
          +%u1539
          +%u153A
          +%u153B
          +%u153C
          +%u153D
          +%u153E
          +%u153F
          +%u1540
          +%u1541
          +%u1542
          +%u1543
          +%u1544
          +%u1545
          +%u1546
          +%u1547
          +%u1548
          +%u1549
          +%u154A
          +%u154B
          +%u154C
          +%u154D
          +%u154E
          +%u154F
          +%u1550
          +%u1551
          +%u1552
          +%u1553
          +%u1554
          +%u1555
          +%u1556
          +%u1557
          +%u1558
          +%u1559
          +%u155A
          +%u155B
          +%u155C
          +%u155D
          +%u155E
          +%u155F
          +%u1560
          +%u1561
          +%u1562
          +%u1563
          +%u1564
          +%u1565
          +%u1566
          +%u1567
          +%u1568
          +%u1569
          +%u156A
          +%u156B
          +%u156C
          +%u156D
          +%u156E
          +%u156F
          +%u1570
          +%u1571
          +%u1572
          +%u1573
          +%u1574
          +%u1575
          +%u1576
          +%u1577
          +%u1578
          +%u1579
          +%u157A
          +%u157B
          +%u157C
          +%u157D
          +%u157E
          +%u157F
          +%u1580
          +%u1581
          +%u1582
          +%u1583
          +%u1584
          +%u1585
          +%u1586
          +%u1587
          +%u1588
          +%u1589
          +%u158A
          +%u158B
          +%u158C
          +%u158D
          +%u158E
          +%u158F
          +%u1590
          +%u1591
          +%u1592
          +%u1593
          +%u1594
          +%u1595
          +%u1596
          +%u1597
          +%u1598
          +%u1599
          +%u159A
          +%u159B
          +%u159C
          +%u159D
          +%u159E
          +%u159F
          +%u15A0
          +%u15A1
          +%u15A2
          +%u15A3
          +%u15A4
          +%u15A5
          +%u15A6
          +%u15A7
          +%u15A8
          +%u15A9
          +%u15AA
          +%u15AB
          +%u15AC
          +%u15AD
          +%u15AE
          +%u15AF
          +%u15B0
          +%u15B1
          +%u15B2
          +%u15B3
          +%u15B4
          +%u15B5
          +%u15B6
          +%u15B7
          +%u15B8
          +%u15B9
          +%u15BA
          +%u15BB
          +%u15BC
          +%u15BD
          +%u15BE
          +%u15BF
          +%u15C0
          +%u15C1
          +%u15C2
          +%u15C3
          +%u15C4
          +%u15C5
          +%u15C6
          +%u15C7
          +%u15C8
          +%u15C9
          +%u15CA
          +%u15CB
          +%u15CC
          +%u15CD
          +%u15CE
          +%u15CF
          +%u15D0
          +%u15D1
          +%u15D2
          +%u15D3
          +%u15D4
          +%u15D5
          +%u15D6
          +%u15D7
          +%u15D8
          +%u15D9
          +%u15DA
          +%u15DB
          +%u15DC
          +%u15DD
          +%u15DE
          +%u15DF
          +%u15E0
          +%u15E1
          +%u15E2
          +%u15E3
          +%u15E4
          +%u15E5
          +%u15E6
          +%u15E7
          +%u15E8
          +%u15E9
          +%u15EA
          +%u15EB
          +%u15EC
          +%u15ED
          +%u15EE
          +%u15EF
          +%u15F0
          +%u15F1
          +%u15F2
          +%u15F3
          +%u15F4
          +%u15F5
          +%u15F6
          +%u15F7
          +%u15F8
          +%u15F9
          +%u15FA
          +%u15FB
          +%u15FC
          +%u15FD
          +%u15FE
          +%u15FF
          +%u1600
          +%u1601
          +%u1602
          +%u1603
          +%u1604
          +%u1605
          +%u1606
          +%u1607
          +%u1608
          +%u1609
          +%u160A
          +%u160B
          +%u160C
          +%u160D
          +%u160E
          +%u160F
          +%u1610
          +%u1611
          +%u1612
          +%u1613
          +%u1614
          +%u1615
          +%u1616
          +%u1617
          +%u1618
          +%u1619
          +%u161A
          +%u161B
          +%u161C
          +%u161D
          +%u161E
          +%u161F
          +%u1620
          +%u1621
          +%u1622
          +%u1623
          +%u1624
          +%u1625
          +%u1626
          +%u1627
          +%u1628
          +%u1629
          +%u162A
          +%u162B
          +%u162C
          +%u162D
          +%u162E
          +%u162F
          +%u1630
          +%u1631
          +%u1632
          +%u1633
          +%u1634
          +%u1635
          +%u1636
          +%u1637
          +%u1638
          +%u1639
          +%u163A
          +%u163B
          +%u163C
          +%u163D
          +%u163E
          +%u163F
          +%u1640
          +%u1641
          +%u1642
          +%u1643
          +%u1644
          +%u1645
          +%u1646
          +%u1647
          +%u1648
          +%u1649
          +%u164A
          +%u164B
          +%u164C
          +%u164D
          +%u164E
          +%u164F
          +%u1650
          +%u1651
          +%u1652
          +%u1653
          +%u1654
          +%u1655
          +%u1656
          +%u1657
          +%u1658
          +%u1659
          +%u165A
          +%u165B
          +%u165C
          +%u165D
          +%u165E
          +%u165F
          +%u1660
          +%u1661
          +%u1662
          +%u1663
          +%u1664
          +%u1665
          +%u1666
          +%u1667
          +%u1668
          +%u1669
          +%u166A
          +%u166B
          +%u166C
          +%u166D
          +%u166E
          +%u166F
          +%u1670
          +%u1671
          +%u1672
          +%u1673
          +%u1674
          +%u1675
          +%u1676
          +%u1677
          +%u1678
          +%u1679
          +%u167A
          +%u167B
          +%u167C
          +%u167D
          +%u167E
          +%u167F
          +%u1680
          +%u1681
          +%u1682
          +%u1683
          +%u1684
          +%u1685
          +%u1686
          +%u1687
          +%u1688
          +%u1689
          +%u168A
          +%u168B
          +%u168C
          +%u168D
          +%u168E
          +%u168F
          +%u1690
          +%u1691
          +%u1692
          +%u1693
          +%u1694
          +%u1695
          +%u1696
          +%u1697
          +%u1698
          +%u1699
          +%u169A
          +%u169B
          +%u169C
          +%u169D
          +%u169E
          +%u169F
          +%u16A0
          +%u16A1
          +%u16A2
          +%u16A3
          +%u16A4
          +%u16A5
          +%u16A6
          +%u16A7
          +%u16A8
          +%u16A9
          +%u16AA
          +%u16AB
          +%u16AC
          +%u16AD
          +%u16AE
          +%u16AF
          +%u16B0
          +%u16B1
          +%u16B2
          +%u16B3
          +%u16B4
          +%u16B5
          +%u16B6
          +%u16B7
          +%u16B8
          +%u16B9
          +%u16BA
          +%u16BB
          +%u16BC
          +%u16BD
          +%u16BE
          +%u16BF
          +%u16C0
          +%u16C1
          +%u16C2
          +%u16C3
          +%u16C4
          +%u16C5
          +%u16C6
          +%u16C7
          +%u16C8
          +%u16C9
          +%u16CA
          +%u16CB
          +%u16CC
          +%u16CD
          +%u16CE
          +%u16CF
          +%u16D0
          +%u16D1
          +%u16D2
          +%u16D3
          +%u16D4
          +%u16D5
          +%u16D6
          +%u16D7
          +%u16D8
          +%u16D9
          +%u16DA
          +%u16DB
          +%u16DC
          +%u16DD
          +%u16DE
          +%u16DF
          +%u16E0
          +%u16E1
          +%u16E2
          +%u16E3
          +%u16E4
          +%u16E5
          +%u16E6
          +%u16E7
          +%u16E8
          +%u16E9
          +%u16EA
          +%u16EB
          +%u16EC
          +%u16ED
          +%u16EE
          +%u16EF
          +%u16F0
          +%u16F1
          +%u16F2
          +%u16F3
          +%u16F4
          +%u16F5
          +%u16F6
          +%u16F7
          +%u16F8
          +%u16F9
          +%u16FA
          +%u16FB
          +%u16FC
          +%u16FD
          +%u16FE
          +%u16FF
          +%u1700
          +%u1701
          +%u1702
          +%u1703
          +%u1704
          +%u1705
          +%u1706
          +%u1707
          +%u1708
          +%u1709
          +%u170A
          +%u170B
          +%u170C
          +%u170D
          +%u170E
          +%u170F
          +%u1710
          +%u1711
          +%u1712
          +%u1713
          +%u1714
          +%u1715
          +%u1716
          +%u1717
          +%u1718
          +%u1719
          +%u171A
          +%u171B
          +%u171C
          +%u171D
          +%u171E
          +%u171F
          +%u1720
          +%u1721
          +%u1722
          +%u1723
          +%u1724
          +%u1725
          +%u1726
          +%u1727
          +%u1728
          +%u1729
          +%u172A
          +%u172B
          +%u172C
          +%u172D
          +%u172E
          +%u172F
          +%u1730
          +%u1731
          +%u1732
          +%u1733
          +%u1734
          +%u1735
          +%u1736
          +%u1737
          +%u1738
          +%u1739
          +%u173A
          +%u173B
          +%u173C
          +%u173D
          +%u173E
          +%u173F
          +%u1740
          +%u1741
          +%u1742
          +%u1743
          +%u1744
          +%u1745
          +%u1746
          +%u1747
          +%u1748
          +%u1749
          +%u174A
          +%u174B
          +%u174C
          +%u174D
          +%u174E
          +%u174F
          +%u1750
          +%u1751
          +%u1752
          +%u1753
          +%u1754
          +%u1755
          +%u1756
          +%u1757
          +%u1758
          +%u1759
          +%u175A
          +%u175B
          +%u175C
          +%u175D
          +%u175E
          +%u175F
          +%u1760
          +%u1761
          +%u1762
          +%u1763
          +%u1764
          +%u1765
          +%u1766
          +%u1767
          +%u1768
          +%u1769
          +%u176A
          +%u176B
          +%u176C
          +%u176D
          +%u176E
          +%u176F
          +%u1770
          +%u1771
          +%u1772
          +%u1773
          +%u1774
          +%u1775
          +%u1776
          +%u1777
          +%u1778
          +%u1779
          +%u177A
          +%u177B
          +%u177C
          +%u177D
          +%u177E
          +%u177F
          +%u1780
          +%u1781
          +%u1782
          +%u1783
          +%u1784
          +%u1785
          +%u1786
          +%u1787
          +%u1788
          +%u1789
          +%u178A
          +%u178B
          +%u178C
          +%u178D
          +%u178E
          +%u178F
          +%u1790
          +%u1791
          +%u1792
          +%u1793
          +%u1794
          +%u1795
          +%u1796
          +%u1797
          +%u1798
          +%u1799
          +%u179A
          +%u179B
          +%u179C
          +%u179D
          +%u179E
          +%u179F
          +%u17A0
          +%u17A1
          +%u17A2
          +%u17A3
          +%u17A4
          +%u17A5
          +%u17A6
          +%u17A7
          +%u17A8
          +%u17A9
          +%u17AA
          +%u17AB
          +%u17AC
          +%u17AD
          +%u17AE
          +%u17AF
          +%u17B0
          +%u17B1
          +%u17B2
          +%u17B3
          +%u17B4
          +%u17B5
          +%u17B6
          +%u17B7
          +%u17B8
          +%u17B9
          +%u17BA
          +%u17BB
          +%u17BC
          +%u17BD
          +%u17BE
          +%u17BF
          +%u17C0
          +%u17C1
          +%u17C2
          +%u17C3
          +%u17C4
          +%u17C5
          +%u17C6
          +%u17C7
          +%u17C8
          +%u17C9
          +%u17CA
          +%u17CB
          +%u17CC
          +%u17CD
          +%u17CE
          +%u17CF
          +%u17D0
          +%u17D1
          +%u17D2
          +%u17D3
          +%u17D4
          +%u17D5
          +%u17D6
          +%u17D7
          +%u17D8
          +%u17D9
          +%u17DA
          +%u17DB
          +%u17DC
          +%u17DD
          +%u17DE
          +%u17DF
          +%u17E0
          +%u17E1
          +%u17E2
          +%u17E3
          +%u17E4
          +%u17E5
          +%u17E6
          +%u17E7
          +%u17E8
          +%u17E9
          +%u17EA
          +%u17EB
          +%u17EC
          +%u17ED
          +%u17EE
          +%u17EF
          +%u17F0
          +%u17F1
          +%u17F2
          +%u17F3
          +%u17F4
          +%u17F5
          +%u17F6
          +%u17F7
          +%u17F8
          +%u17F9
          +%u17FA
          +%u17FB
          +%u17FC
          +%u17FD
          +%u17FE
          +%u17FF
          +%u1800
          +%u1801
          +%u1802
          +%u1803
          +%u1804
          +%u1805
          +%u1806
          +%u1807
          +%u1808
          +%u1809
          +%u180A
          +%u180B
          +%u180C
          +%u180D
          +%u180E
          +%u180F
          +%u1810
          +%u1811
          +%u1812
          +%u1813
          +%u1814
          +%u1815
          +%u1816
          +%u1817
          +%u1818
          +%u1819
          +%u181A
          +%u181B
          +%u181C
          +%u181D
          +%u181E
          +%u181F
          +%u1820
          +%u1821
          +%u1822
          +%u1823
          +%u1824
          +%u1825
          +%u1826
          +%u1827
          +%u1828
          +%u1829
          +%u182A
          +%u182B
          +%u182C
          +%u182D
          +%u182E
          +%u182F
          +%u1830
          +%u1831
          +%u1832
          +%u1833
          +%u1834
          +%u1835
          +%u1836
          +%u1837
          +%u1838
          +%u1839
          +%u183A
          +%u183B
          +%u183C
          +%u183D
          +%u183E
          +%u183F
          +%u1840
          +%u1841
          +%u1842
          +%u1843
          +%u1844
          +%u1845
          +%u1846
          +%u1847
          +%u1848
          +%u1849
          +%u184A
          +%u184B
          +%u184C
          +%u184D
          +%u184E
          +%u184F
          +%u1850
          +%u1851
          +%u1852
          +%u1853
          +%u1854
          +%u1855
          +%u1856
          +%u1857
          +%u1858
          +%u1859
          +%u185A
          +%u185B
          +%u185C
          +%u185D
          +%u185E
          +%u185F
          +%u1860
          +%u1861
          +%u1862
          +%u1863
          +%u1864
          +%u1865
          +%u1866
          +%u1867
          +%u1868
          +%u1869
          +%u186A
          +%u186B
          +%u186C
          +%u186D
          +%u186E
          +%u186F
          +%u1870
          +%u1871
          +%u1872
          +%u1873
          +%u1874
          +%u1875
          +%u1876
          +%u1877
          +%u1878
          +%u1879
          +%u187A
          +%u187B
          +%u187C
          +%u187D
          +%u187E
          +%u187F
          +%u1880
          +%u1881
          +%u1882
          +%u1883
          +%u1884
          +%u1885
          +%u1886
          +%u1887
          +%u1888
          +%u1889
          +%u188A
          +%u188B
          +%u188C
          +%u188D
          +%u188E
          +%u188F
          +%u1890
          +%u1891
          +%u1892
          +%u1893
          +%u1894
          +%u1895
          +%u1896
          +%u1897
          +%u1898
          +%u1899
          +%u189A
          +%u189B
          +%u189C
          +%u189D
          +%u189E
          +%u189F
          +%u18A0
          +%u18A1
          +%u18A2
          +%u18A3
          +%u18A4
          +%u18A5
          +%u18A6
          +%u18A7
          +%u18A8
          +%u18A9
          +%u18AA
          +%u18AB
          +%u18AC
          +%u18AD
          +%u18AE
          +%u18AF
          +%u18B0
          +%u18B1
          +%u18B2
          +%u18B3
          +%u18B4
          +%u18B5
          +%u18B6
          +%u18B7
          +%u18B8
          +%u18B9
          +%u18BA
          +%u18BB
          +%u18BC
          +%u18BD
          +%u18BE
          +%u18BF
          +%u18C0
          +%u18C1
          +%u18C2
          +%u18C3
          +%u18C4
          +%u18C5
          +%u18C6
          +%u18C7
          +%u18C8
          +%u18C9
          +%u18CA
          +%u18CB
          +%u18CC
          +%u18CD
          +%u18CE
          +%u18CF
          +%u18D0
          +%u18D1
          +%u18D2
          +%u18D3
          +%u18D4
          +%u18D5
          +%u18D6
          +%u18D7
          +%u18D8
          +%u18D9
          +%u18DA
          +%u18DB
          +%u18DC
          +%u18DD
          +%u18DE
          +%u18DF
          +%u18E0
          +%u18E1
          +%u18E2
          +%u18E3
          +%u18E4
          +%u18E5
          +%u18E6
          +%u18E7
          +%u18E8
          +%u18E9
          +%u18EA
          +%u18EB
          +%u18EC
          +%u18ED
          +%u18EE
          +%u18EF
          +%u18F0
          +%u18F1
          +%u18F2
          +%u18F3
          +%u18F4
          +%u18F5
          +%u18F6
          +%u18F7
          +%u18F8
          +%u18F9
          +%u18FA
          +%u18FB
          +%u18FC
          +%u18FD
          +%u18FE
          +%u18FF
          +%u1900
          +%u1901
          +%u1902
          +%u1903
          +%u1904
          +%u1905
          +%u1906
          +%u1907
          +%u1908
          +%u1909
          +%u190A
          +%u190B
          +%u190C
          +%u190D
          +%u190E
          +%u190F
          +%u1910
          +%u1911
          +%u1912
          +%u1913
          +%u1914
          +%u1915
          +%u1916
          +%u1917
          +%u1918
          +%u1919
          +%u191A
          +%u191B
          +%u191C
          +%u191D
          +%u191E
          +%u191F
          +%u1920
          +%u1921
          +%u1922
          +%u1923
          +%u1924
          +%u1925
          +%u1926
          +%u1927
          +%u1928
          +%u1929
          +%u192A
          +%u192B
          +%u192C
          +%u192D
          +%u192E
          +%u192F
          +%u1930
          +%u1931
          +%u1932
          +%u1933
          +%u1934
          +%u1935
          +%u1936
          +%u1937
          +%u1938
          +%u1939
          +%u193A
          +%u193B
          +%u193C
          +%u193D
          +%u193E
          +%u193F
          +%u1940
          +%u1941
          +%u1942
          +%u1943
          +%u1944
          +%u1945
          +%u1946
          +%u1947
          +%u1948
          +%u1949
          +%u194A
          +%u194B
          +%u194C
          +%u194D
          +%u194E
          +%u194F
          +%u1950
          +%u1951
          +%u1952
          +%u1953
          +%u1954
          +%u1955
          +%u1956
          +%u1957
          +%u1958
          +%u1959
          +%u195A
          +%u195B
          +%u195C
          +%u195D
          +%u195E
          +%u195F
          +%u1960
          +%u1961
          +%u1962
          +%u1963
          +%u1964
          +%u1965
          +%u1966
          +%u1967
          +%u1968
          +%u1969
          +%u196A
          +%u196B
          +%u196C
          +%u196D
          +%u196E
          +%u196F
          +%u1970
          +%u1971
          +%u1972
          +%u1973
          +%u1974
          +%u1975
          +%u1976
          +%u1977
          +%u1978
          +%u1979
          +%u197A
          +%u197B
          +%u197C
          +%u197D
          +%u197E
          +%u197F
          +%u1980
          +%u1981
          +%u1982
          +%u1983
          +%u1984
          +%u1985
          +%u1986
          +%u1987
          +%u1988
          +%u1989
          +%u198A
          +%u198B
          +%u198C
          +%u198D
          +%u198E
          +%u198F
          +%u1990
          +%u1991
          +%u1992
          +%u1993
          +%u1994
          +%u1995
          +%u1996
          +%u1997
          +%u1998
          +%u1999
          +%u199A
          +%u199B
          +%u199C
          +%u199D
          +%u199E
          +%u199F
          +%u19A0
          +%u19A1
          +%u19A2
          +%u19A3
          +%u19A4
          +%u19A5
          +%u19A6
          +%u19A7
          +%u19A8
          +%u19A9
          +%u19AA
          +%u19AB
          +%u19AC
          +%u19AD
          +%u19AE
          +%u19AF
          +%u19B0
          +%u19B1
          +%u19B2
          +%u19B3
          +%u19B4
          +%u19B5
          +%u19B6
          +%u19B7
          +%u19B8
          +%u19B9
          +%u19BA
          +%u19BB
          +%u19BC
          +%u19BD
          +%u19BE
          +%u19BF
          +%u19C0
          +%u19C1
          +%u19C2
          +%u19C3
          +%u19C4
          +%u19C5
          +%u19C6
          +%u19C7
          +%u19C8
          +%u19C9
          +%u19CA
          +%u19CB
          +%u19CC
          +%u19CD
          +%u19CE
          +%u19CF
          +%u19D0
          +%u19D1
          +%u19D2
          +%u19D3
          +%u19D4
          +%u19D5
          +%u19D6
          +%u19D7
          +%u19D8
          +%u19D9
          +%u19DA
          +%u19DB
          +%u19DC
          +%u19DD
          +%u19DE
          +%u19DF
          +%u19E0
          +%u19E1
          +%u19E2
          +%u19E3
          +%u19E4
          +%u19E5
          +%u19E6
          +%u19E7
          +%u19E8
          +%u19E9
          +%u19EA
          +%u19EB
          +%u19EC
          +%u19ED
          +%u19EE
          +%u19EF
          +%u19F0
          +%u19F1
          +%u19F2
          +%u19F3
          +%u19F4
          +%u19F5
          +%u19F6
          +%u19F7
          +%u19F8
          +%u19F9
          +%u19FA
          +%u19FB
          +%u19FC
          +%u19FD
          +%u19FE
          +%u19FF
          +%u1A00
          +%u1A01
          +%u1A02
          +%u1A03
          +%u1A04
          +%u1A05
          +%u1A06
          +%u1A07
          +%u1A08
          +%u1A09
          +%u1A0A
          +%u1A0B
          +%u1A0C
          +%u1A0D
          +%u1A0E
          +%u1A0F
          +%u1A10
          +%u1A11
          +%u1A12
          +%u1A13
          +%u1A14
          +%u1A15
          +%u1A16
          +%u1A17
          +%u1A18
          +%u1A19
          +%u1A1A
          +%u1A1B
          +%u1A1C
          +%u1A1D
          +%u1A1E
          +%u1A1F
          +%u1A20
          +%u1A21
          +%u1A22
          +%u1A23
          +%u1A24
          +%u1A25
          +%u1A26
          +%u1A27
          +%u1A28
          +%u1A29
          +%u1A2A
          +%u1A2B
          +%u1A2C
          +%u1A2D
          +%u1A2E
          +%u1A2F
          +%u1A30
          +%u1A31
          +%u1A32
          +%u1A33
          +%u1A34
          +%u1A35
          +%u1A36
          +%u1A37
          +%u1A38
          +%u1A39
          +%u1A3A
          +%u1A3B
          +%u1A3C
          +%u1A3D
          +%u1A3E
          +%u1A3F
          +%u1A40
          +%u1A41
          +%u1A42
          +%u1A43
          +%u1A44
          +%u1A45
          +%u1A46
          +%u1A47
          +%u1A48
          +%u1A49
          +%u1A4A
          +%u1A4B
          +%u1A4C
          +%u1A4D
          +%u1A4E
          +%u1A4F
          +%u1A50
          +%u1A51
          +%u1A52
          +%u1A53
          +%u1A54
          +%u1A55
          +%u1A56
          +%u1A57
          +%u1A58
          +%u1A59
          +%u1A5A
          +%u1A5B
          +%u1A5C
          +%u1A5D
          +%u1A5E
          +%u1A5F
          +%u1A60
          +%u1A61
          +%u1A62
          +%u1A63
          +%u1A64
          +%u1A65
          +%u1A66
          +%u1A67
          +%u1A68
          +%u1A69
          +%u1A6A
          +%u1A6B
          +%u1A6C
          +%u1A6D
          +%u1A6E
          +%u1A6F
          +%u1A70
          +%u1A71
          +%u1A72
          +%u1A73
          +%u1A74
          +%u1A75
          +%u1A76
          +%u1A77
          +%u1A78
          +%u1A79
          +%u1A7A
          +%u1A7B
          +%u1A7C
          +%u1A7D
          +%u1A7E
          +%u1A7F
          +%u1A80
          +%u1A81
          +%u1A82
          +%u1A83
          +%u1A84
          +%u1A85
          +%u1A86
          +%u1A87
          +%u1A88
          +%u1A89
          +%u1A8A
          +%u1A8B
          +%u1A8C
          +%u1A8D
          +%u1A8E
          +%u1A8F
          +%u1A90
          +%u1A91
          +%u1A92
          +%u1A93
          +%u1A94
          +%u1A95
          +%u1A96
          +%u1A97
          +%u1A98
          +%u1A99
          +%u1A9A
          +%u1A9B
          +%u1A9C
          +%u1A9D
          +%u1A9E
          +%u1A9F
          +%u1AA0
          +%u1AA1
          +%u1AA2
          +%u1AA3
          +%u1AA4
          +%u1AA5
          +%u1AA6
          +%u1AA7
          +%u1AA8
          +%u1AA9
          +%u1AAA
          +%u1AAB
          +%u1AAC
          +%u1AAD
          +%u1AAE
          +%u1AAF
          +%u1AB0
          +%u1AB1
          +%u1AB2
          +%u1AB3
          +%u1AB4
          +%u1AB5
          +%u1AB6
          +%u1AB7
          +%u1AB8
          +%u1AB9
          +%u1ABA
          +%u1ABB
          +%u1ABC
          +%u1ABD
          +%u1ABE
          +%u1ABF
          +%u1AC0
          +%u1AC1
          +%u1AC2
          +%u1AC3
          +%u1AC4
          +%u1AC5
          +%u1AC6
          +%u1AC7
          +%u1AC8
          +%u1AC9
          +%u1ACA
          +%u1ACB
          +%u1ACC
          +%u1ACD
          +%u1ACE
          +%u1ACF
          +%u1AD0
          +%u1AD1
          +%u1AD2
          +%u1AD3
          +%u1AD4
          +%u1AD5
          +%u1AD6
          +%u1AD7
          +%u1AD8
          +%u1AD9
          +%u1ADA
          +%u1ADB
          +%u1ADC
          +%u1ADD
          +%u1ADE
          +%u1ADF
          +%u1AE0
          +%u1AE1
          +%u1AE2
          +%u1AE3
          +%u1AE4
          +%u1AE5
          +%u1AE6
          +%u1AE7
          +%u1AE8
          +%u1AE9
          +%u1AEA
          +%u1AEB
          +%u1AEC
          +%u1AED
          +%u1AEE
          +%u1AEF
          +%u1AF0
          +%u1AF1
          +%u1AF2
          +%u1AF3
          +%u1AF4
          +%u1AF5
          +%u1AF6
          +%u1AF7
          +%u1AF8
          +%u1AF9
          +%u1AFA
          +%u1AFB
          +%u1AFC
          +%u1AFD
          +%u1AFE
          +%u1AFF
          +%u1B00
          +%u1B01
          +%u1B02
          +%u1B03
          +%u1B04
          +%u1B05
          +%u1B06
          +%u1B07
          +%u1B08
          +%u1B09
          +%u1B0A
          +%u1B0B
          +%u1B0C
          +%u1B0D
          +%u1B0E
          +%u1B0F
          +%u1B10
          +%u1B11
          +%u1B12
          +%u1B13
          +%u1B14
          +%u1B15
          +%u1B16
          +%u1B17
          +%u1B18
          +%u1B19
          +%u1B1A
          +%u1B1B
          +%u1B1C
          +%u1B1D
          +%u1B1E
          +%u1B1F
          +%u1B20
          +%u1B21
          +%u1B22
          +%u1B23
          +%u1B24
          +%u1B25
          +%u1B26
          +%u1B27
          +%u1B28
          +%u1B29
          +%u1B2A
          +%u1B2B
          +%u1B2C
          +%u1B2D
          +%u1B2E
          +%u1B2F
          +%u1B30
          +%u1B31
          +%u1B32
          +%u1B33
          +%u1B34
          +%u1B35
          +%u1B36
          +%u1B37
          +%u1B38
          +%u1B39
          +%u1B3A
          +%u1B3B
          +%u1B3C
          +%u1B3D
          +%u1B3E
          +%u1B3F
          +%u1B40
          +%u1B41
          +%u1B42
          +%u1B43
          +%u1B44
          +%u1B45
          +%u1B46
          +%u1B47
          +%u1B48
          +%u1B49
          +%u1B4A
          +%u1B4B
          +%u1B4C
          +%u1B4D
          +%u1B4E
          +%u1B4F
          +%u1B50
          +%u1B51
          +%u1B52
          +%u1B53
          +%u1B54
          +%u1B55
          +%u1B56
          +%u1B57
          +%u1B58
          +%u1B59
          +%u1B5A
          +%u1B5B
          +%u1B5C
          +%u1B5D
          +%u1B5E
          +%u1B5F
          +%u1B60
          +%u1B61
          +%u1B62
          +%u1B63
          +%u1B64
          +%u1B65
          +%u1B66
          +%u1B67
          +%u1B68
          +%u1B69
          +%u1B6A
          +%u1B6B
          +%u1B6C
          +%u1B6D
          +%u1B6E
          +%u1B6F
          +%u1B70
          +%u1B71
          +%u1B72
          +%u1B73
          +%u1B74
          +%u1B75
          +%u1B76
          +%u1B77
          +%u1B78
          +%u1B79
          +%u1B7A
          +%u1B7B
          +%u1B7C
          +%u1B7D
          +%u1B7E
          +%u1B7F
          +%u1B80
          +%u1B81
          +%u1B82
          +%u1B83
          +%u1B84
          +%u1B85
          +%u1B86
          +%u1B87
          +%u1B88
          +%u1B89
          +%u1B8A
          +%u1B8B
          +%u1B8C
          +%u1B8D
          +%u1B8E
          +%u1B8F
          +%u1B90
          +%u1B91
          +%u1B92
          +%u1B93
          +%u1B94
          +%u1B95
          +%u1B96
          +%u1B97
          +%u1B98
          +%u1B99
          +%u1B9A
          +%u1B9B
          +%u1B9C
          +%u1B9D
          +%u1B9E
          +%u1B9F
          +%u1BA0
          +%u1BA1
          +%u1BA2
          +%u1BA3
          +%u1BA4
          +%u1BA5
          +%u1BA6
          +%u1BA7
          +%u1BA8
          +%u1BA9
          +%u1BAA
          +%u1BAB
          +%u1BAC
          +%u1BAD
          +%u1BAE
          +%u1BAF
          +%u1BB0
          +%u1BB1
          +%u1BB2
          +%u1BB3
          +%u1BB4
          +%u1BB5
          +%u1BB6
          +%u1BB7
          +%u1BB8
          +%u1BB9
          +%u1BBA
          +%u1BBB
          +%u1BBC
          +%u1BBD
          +%u1BBE
          +%u1BBF
          +%u1BC0
          +%u1BC1
          +%u1BC2
          +%u1BC3
          +%u1BC4
          +%u1BC5
          +%u1BC6
          +%u1BC7
          +%u1BC8
          +%u1BC9
          +%u1BCA
          +%u1BCB
          +%u1BCC
          +%u1BCD
          +%u1BCE
          +%u1BCF
          +%u1BD0
          +%u1BD1
          +%u1BD2
          +%u1BD3
          +%u1BD4
          +%u1BD5
          +%u1BD6
          +%u1BD7
          +%u1BD8
          +%u1BD9
          +%u1BDA
          +%u1BDB
          +%u1BDC
          +%u1BDD
          +%u1BDE
          +%u1BDF
          +%u1BE0
          +%u1BE1
          +%u1BE2
          +%u1BE3
          +%u1BE4
          +%u1BE5
          +%u1BE6
          +%u1BE7
          +%u1BE8
          +%u1BE9
          +%u1BEA
          +%u1BEB
          +%u1BEC
          +%u1BED
          +%u1BEE
          +%u1BEF
          +%u1BF0
          +%u1BF1
          +%u1BF2
          +%u1BF3
          +%u1BF4
          +%u1BF5
          +%u1BF6
          +%u1BF7
          +%u1BF8
          +%u1BF9
          +%u1BFA
          +%u1BFB
          +%u1BFC
          +%u1BFD
          +%u1BFE
          +%u1BFF
          +%u1C00
          +%u1C01
          +%u1C02
          +%u1C03
          +%u1C04
          +%u1C05
          +%u1C06
          +%u1C07
          +%u1C08
          +%u1C09
          +%u1C0A
          +%u1C0B
          +%u1C0C
          +%u1C0D
          +%u1C0E
          +%u1C0F
          +%u1C10
          +%u1C11
          +%u1C12
          +%u1C13
          +%u1C14
          +%u1C15
          +%u1C16
          +%u1C17
          +%u1C18
          +%u1C19
          +%u1C1A
          +%u1C1B
          +%u1C1C
          +%u1C1D
          +%u1C1E
          +%u1C1F
          +%u1C20
          +%u1C21
          +%u1C22
          +%u1C23
          +%u1C24
          +%u1C25
          +%u1C26
          +%u1C27
          +%u1C28
          +%u1C29
          +%u1C2A
          +%u1C2B
          +%u1C2C
          +%u1C2D
          +%u1C2E
          +%u1C2F
          +%u1C30
          +%u1C31
          +%u1C32
          +%u1C33
          +%u1C34
          +%u1C35
          +%u1C36
          +%u1C37
          +%u1C38
          +%u1C39
          +%u1C3A
          +%u1C3B
          +%u1C3C
          +%u1C3D
          +%u1C3E
          +%u1C3F
          +%u1C40
          +%u1C41
          +%u1C42
          +%u1C43
          +%u1C44
          +%u1C45
          +%u1C46
          +%u1C47
          +%u1C48
          +%u1C49
          +%u1C4A
          +%u1C4B
          +%u1C4C
          +%u1C4D
          +%u1C4E
          +%u1C4F
          +%u1C50
          +%u1C51
          +%u1C52
          +%u1C53
          +%u1C54
          +%u1C55
          +%u1C56
          +%u1C57
          +%u1C58
          +%u1C59
          +%u1C5A
          +%u1C5B
          +%u1C5C
          +%u1C5D
          +%u1C5E
          +%u1C5F
          +%u1C60
          +%u1C61
          +%u1C62
          +%u1C63
          +%u1C64
          +%u1C65
          +%u1C66
          +%u1C67
          +%u1C68
          +%u1C69
          +%u1C6A
          +%u1C6B
          +%u1C6C
          +%u1C6D
          +%u1C6E
          +%u1C6F
          +%u1C70
          +%u1C71
          +%u1C72
          +%u1C73
          +%u1C74
          +%u1C75
          +%u1C76
          +%u1C77
          +%u1C78
          +%u1C79
          +%u1C7A
          +%u1C7B
          +%u1C7C
          +%u1C7D
          +%u1C7E
          +%u1C7F
          +%u1C80
          +%u1C81
          +%u1C82
          +%u1C83
          +%u1C84
          +%u1C85
          +%u1C86
          +%u1C87
          +%u1C88
          +%u1C89
          +%u1C8A
          +%u1C8B
          +%u1C8C
          +%u1C8D
          +%u1C8E
          +%u1C8F
          +%u1C90
          +%u1C91
          +%u1C92
          +%u1C93
          +%u1C94
          +%u1C95
          +%u1C96
          +%u1C97
          +%u1C98
          +%u1C99
          +%u1C9A
          +%u1C9B
          +%u1C9C
          +%u1C9D
          +%u1C9E
          +%u1C9F
          +%u1CA0
          +%u1CA1
          +%u1CA2
          +%u1CA3
          +%u1CA4
          +%u1CA5
          +%u1CA6
          +%u1CA7
          +%u1CA8
          +%u1CA9
          +%u1CAA
          +%u1CAB
          +%u1CAC
          +%u1CAD
          +%u1CAE
          +%u1CAF
          +%u1CB0
          +%u1CB1
          +%u1CB2
          +%u1CB3
          +%u1CB4
          +%u1CB5
          +%u1CB6
          +%u1CB7
          +%u1CB8
          +%u1CB9
          +%u1CBA
          +%u1CBB
          +%u1CBC
          +%u1CBD
          +%u1CBE
          +%u1CBF
          +%u1CC0
          +%u1CC1
          +%u1CC2
          +%u1CC3
          +%u1CC4
          +%u1CC5
          +%u1CC6
          +%u1CC7
          +%u1CC8
          +%u1CC9
          +%u1CCA
          +%u1CCB
          +%u1CCC
          +%u1CCD
          +%u1CCE
          +%u1CCF
          +%u1CD0
          +%u1CD1
          +%u1CD2
          +%u1CD3
          +%u1CD4
          +%u1CD5
          +%u1CD6
          +%u1CD7
          +%u1CD8
          +%u1CD9
          +%u1CDA
          +%u1CDB
          +%u1CDC
          +%u1CDD
          +%u1CDE
          +%u1CDF
          +%u1CE0
          +%u1CE1
          +%u1CE2
          +%u1CE3
          +%u1CE4
          +%u1CE5
          +%u1CE6
          +%u1CE7
          +%u1CE8
          +%u1CE9
          +%u1CEA
          +%u1CEB
          +%u1CEC
          +%u1CED
          +%u1CEE
          +%u1CEF
          +%u1CF0
          +%u1CF1
          +%u1CF2
          +%u1CF3
          +%u1CF4
          +%u1CF5
          +%u1CF6
          +%u1CF7
          +%u1CF8
          +%u1CF9
          +%u1CFA
          +%u1CFB
          +%u1CFC
          +%u1CFD
          +%u1CFE
          +%u1CFF
          +%u1D00
          +%u1D01
          +%u1D02
          +%u1D03
          +%u1D04
          +%u1D05
          +%u1D06
          +%u1D07
          +%u1D08
          +%u1D09
          +%u1D0A
          +%u1D0B
          +%u1D0C
          +%u1D0D
          +%u1D0E
          +%u1D0F
          +%u1D10
          +%u1D11
          +%u1D12
          +%u1D13
          +%u1D14
          +%u1D15
          +%u1D16
          +%u1D17
          +%u1D18
          +%u1D19
          +%u1D1A
          +%u1D1B
          +%u1D1C
          +%u1D1D
          +%u1D1E
          +%u1D1F
          +%u1D20
          +%u1D21
          +%u1D22
          +%u1D23
          +%u1D24
          +%u1D25
          +%u1D26
          +%u1D27
          +%u1D28
          +%u1D29
          +%u1D2A
          +%u1D2B
          +%u1D2C
          +%u1D2D
          +%u1D2E
          +%u1D2F
          +%u1D30
          +%u1D31
          +%u1D32
          +%u1D33
          +%u1D34
          +%u1D35
          +%u1D36
          +%u1D37
          +%u1D38
          +%u1D39
          +%u1D3A
          +%u1D3B
          +%u1D3C
          +%u1D3D
          +%u1D3E
          +%u1D3F
          +%u1D40
          +%u1D41
          +%u1D42
          +%u1D43
          +%u1D44
          +%u1D45
          +%u1D46
          +%u1D47
          +%u1D48
          +%u1D49
          +%u1D4A
          +%u1D4B
          +%u1D4C
          +%u1D4D
          +%u1D4E
          +%u1D4F
          +%u1D50
          +%u1D51
          +%u1D52
          +%u1D53
          +%u1D54
          +%u1D55
          +%u1D56
          +%u1D57
          +%u1D58
          +%u1D59
          +%u1D5A
          +%u1D5B
          +%u1D5C
          +%u1D5D
          +%u1D5E
          +%u1D5F
          +%u1D60
          +%u1D61
          +%u1D62
          +%u1D63
          +%u1D64
          +%u1D65
          +%u1D66
          +%u1D67
          +%u1D68
          +%u1D69
          +%u1D6A
          +%u1D6B
          +%u1D6C
          +%u1D6D
          +%u1D6E
          +%u1D6F
          +%u1D70
          +%u1D71
          +%u1D72
          +%u1D73
          +%u1D74
          +%u1D75
          +%u1D76
          +%u1D77
          +%u1D78
          +%u1D79
          +%u1D7A
          +%u1D7B
          +%u1D7C
          +%u1D7D
          +%u1D7E
          +%u1D7F
          +%u1D80
          +%u1D81
          +%u1D82
          +%u1D83
          +%u1D84
          +%u1D85
          +%u1D86
          +%u1D87
          +%u1D88
          +%u1D89
          +%u1D8A
          +%u1D8B
          +%u1D8C
          +%u1D8D
          +%u1D8E
          +%u1D8F
          +%u1D90
          +%u1D91
          +%u1D92
          +%u1D93
          +%u1D94
          +%u1D95
          +%u1D96
          +%u1D97
          +%u1D98
          +%u1D99
          +%u1D9A
          +%u1D9B
          +%u1D9C
          +%u1D9D
          +%u1D9E
          +%u1D9F
          +%u1DA0
          +%u1DA1
          +%u1DA2
          +%u1DA3
          +%u1DA4
          +%u1DA5
          +%u1DA6
          +%u1DA7
          +%u1DA8
          +%u1DA9
          +%u1DAA
          +%u1DAB
          +%u1DAC
          +%u1DAD
          +%u1DAE
          +%u1DAF
          +%u1DB0
          +%u1DB1
          +%u1DB2
          +%u1DB3
          +%u1DB4
          +%u1DB5
          +%u1DB6
          +%u1DB7
          +%u1DB8
          +%u1DB9
          +%u1DBA
          +%u1DBB
          +%u1DBC
          +%u1DBD
          +%u1DBE
          +%u1DBF
          +%u1DC0
          +%u1DC1
          +%u1DC2
          +%u1DC3
          +%u1DC4
          +%u1DC5
          +%u1DC6
          +%u1DC7
          +%u1DC8
          +%u1DC9
          +%u1DCA
          +%u1DCB
          +%u1DCC
          +%u1DCD
          +%u1DCE
          +%u1DCF
          +%u1DD0
          +%u1DD1
          +%u1DD2
          +%u1DD3
          +%u1DD4
          +%u1DD5
          +%u1DD6
          +%u1DD7
          +%u1DD8
          +%u1DD9
          +%u1DDA
          +%u1DDB
          +%u1DDC
          +%u1DDD
          +%u1DDE
          +%u1DDF
          +%u1DE0
          +%u1DE1
          +%u1DE2
          +%u1DE3
          +%u1DE4
          +%u1DE5
          +%u1DE6
          +%u1DE7
          +%u1DE8
          +%u1DE9
          +%u1DEA
          +%u1DEB
          +%u1DEC
          +%u1DED
          +%u1DEE
          +%u1DEF
          +%u1DF0
          +%u1DF1
          +%u1DF2
          +%u1DF3
          +%u1DF4
          +%u1DF5
          +%u1DF6
          +%u1DF7
          +%u1DF8
          +%u1DF9
          +%u1DFA
          +%u1DFB
          +%u1DFC
          +%u1DFD
          +%u1DFE
          +%u1DFF
          +%u1E00
          +%u1E01
          +%u1E02
          +%u1E03
          +%u1E04
          +%u1E05
          +%u1E06
          +%u1E07
          +%u1E08
          +%u1E09
          +%u1E0A
          +%u1E0B
          +%u1E0C
          +%u1E0D
          +%u1E0E
          +%u1E0F
          +%u1E10
          +%u1E11
          +%u1E12
          +%u1E13
          +%u1E14
          +%u1E15
          +%u1E16
          +%u1E17
          +%u1E18
          +%u1E19
          +%u1E1A
          +%u1E1B
          +%u1E1C
          +%u1E1D
          +%u1E1E
          +%u1E1F
          +%u1E20
          +%u1E21
          +%u1E22
          +%u1E23
          +%u1E24
          +%u1E25
          +%u1E26
          +%u1E27
          +%u1E28
          +%u1E29
          +%u1E2A
          +%u1E2B
          +%u1E2C
          +%u1E2D
          +%u1E2E
          +%u1E2F
          +%u1E30
          +%u1E31
          +%u1E32
          +%u1E33
          +%u1E34
          +%u1E35
          +%u1E36
          +%u1E37
          +%u1E38
          +%u1E39
          +%u1E3A
          +%u1E3B
          +%u1E3C
          +%u1E3D
          +%u1E3E
          +%u1E3F
          +%u1E40
          +%u1E41
          +%u1E42
          +%u1E43
          +%u1E44
          +%u1E45
          +%u1E46
          +%u1E47
          +%u1E48
          +%u1E49
          +%u1E4A
          +%u1E4B
          +%u1E4C
          +%u1E4D
          +%u1E4E
          +%u1E4F
          +%u1E50
          +%u1E51
          +%u1E52
          +%u1E53
          +%u1E54
          +%u1E55
          +%u1E56
          +%u1E57
          +%u1E58
          +%u1E59
          +%u1E5A
          +%u1E5B
          +%u1E5C
          +%u1E5D
          +%u1E5E
          +%u1E5F
          +%u1E60
          +%u1E61
          +%u1E62
          +%u1E63
          +%u1E64
          +%u1E65
          +%u1E66
          +%u1E67
          +%u1E68
          +%u1E69
          +%u1E6A
          +%u1E6B
          +%u1E6C
          +%u1E6D
          +%u1E6E
          +%u1E6F
          +%u1E70
          +%u1E71
          +%u1E72
          +%u1E73
          +%u1E74
          +%u1E75
          +%u1E76
          +%u1E77
          +%u1E78
          +%u1E79
          +%u1E7A
          +%u1E7B
          +%u1E7C
          +%u1E7D
          +%u1E7E
          +%u1E7F
          +%u1E80
          +%u1E81
          +%u1E82
          +%u1E83
          +%u1E84
          +%u1E85
          +%u1E86
          +%u1E87
          +%u1E88
          +%u1E89
          +%u1E8A
          +%u1E8B
          +%u1E8C
          +%u1E8D
          +%u1E8E
          +%u1E8F
          +%u1E90
          +%u1E91
          +%u1E92
          +%u1E93
          +%u1E94
          +%u1E95
          +%u1E96
          +%u1E97
          +%u1E98
          +%u1E99
          +%u1E9A
          +%u1E9B
          +%u1E9C
          +%u1E9D
          +%u1E9E
          +%u1E9F
          +%u1EA0
          +%u1EA1
          +%u1EA2
          +%u1EA3
          +%u1EA4
          +%u1EA5
          +%u1EA6
          +%u1EA7
          +%u1EA8
          +%u1EA9
          +%u1EAA
          +%u1EAB
          +%u1EAC
          +%u1EAD
          +%u1EAE
          +%u1EAF
          +%u1EB0
          +%u1EB1
          +%u1EB2
          +%u1EB3
          +%u1EB4
          +%u1EB5
          +%u1EB6
          +%u1EB7
          +%u1EB8
          +%u1EB9
          +%u1EBA
          +%u1EBB
          +%u1EBC
          +%u1EBD
          +%u1EBE
          +%u1EBF
          +%u1EC0
          +%u1EC1
          +%u1EC2
          +%u1EC3
          +%u1EC4
          +%u1EC5
          +%u1EC6
          +%u1EC7
          +%u1EC8
          +%u1EC9
          +%u1ECA
          +%u1ECB
          +%u1ECC
          +%u1ECD
          +%u1ECE
          +%u1ECF
          +%u1ED0
          +%u1ED1
          +%u1ED2
          +%u1ED3
          +%u1ED4
          +%u1ED5
          +%u1ED6
          +%u1ED7
          +%u1ED8
          +%u1ED9
          +%u1EDA
          +%u1EDB
          +%u1EDC
          +%u1EDD
          +%u1EDE
          +%u1EDF
          +%u1EE0
          +%u1EE1
          +%u1EE2
          +%u1EE3
          +%u1EE4
          +%u1EE5
          +%u1EE6
          +%u1EE7
          +%u1EE8
          +%u1EE9
          +%u1EEA
          +%u1EEB
          +%u1EEC
          +%u1EED
          +%u1EEE
          +%u1EEF
          +%u1EF0
          +%u1EF1
          +%u1EF2
          +%u1EF3
          +%u1EF4
          +%u1EF5
          +%u1EF6
          +%u1EF7
          +%u1EF8
          +%u1EF9
          +%u1EFA
          +%u1EFB
          +%u1EFC
          +%u1EFD
          +%u1EFE
          +%u1EFF
          +%u1F00
          +%u1F01
          +%u1F02
          +%u1F03
          +%u1F04
          +%u1F05
          +%u1F06
          +%u1F07
          +%u1F08
          +%u1F09
          +%u1F0A
          +%u1F0B
          +%u1F0C
          +%u1F0D
          +%u1F0E
          +%u1F0F
          +%u1F10
          +%u1F11
          +%u1F12
          +%u1F13
          +%u1F14
          +%u1F15
          +%u1F16
          +%u1F17
          +%u1F18
          +%u1F19
          +%u1F1A
          +%u1F1B
          +%u1F1C
          +%u1F1D
          +%u1F1E
          +%u1F1F
          +%u1F20
          +%u1F21
          +%u1F22
          +%u1F23
          +%u1F24
          +%u1F25
          +%u1F26
          +%u1F27
          +%u1F28
          +%u1F29
          +%u1F2A
          +%u1F2B
          +%u1F2C
          +%u1F2D
          +%u1F2E
          +%u1F2F
          +%u1F30
          +%u1F31
          +%u1F32
          +%u1F33
          +%u1F34
          +%u1F35
          +%u1F36
          +%u1F37
          +%u1F38
          +%u1F39
          +%u1F3A
          +%u1F3B
          +%u1F3C
          +%u1F3D
          +%u1F3E
          +%u1F3F
          +%u1F40
          +%u1F41
          +%u1F42
          +%u1F43
          +%u1F44
          +%u1F45
          +%u1F46
          +%u1F47
          +%u1F48
          +%u1F49
          +%u1F4A
          +%u1F4B
          +%u1F4C
          +%u1F4D
          +%u1F4E
          +%u1F4F
          +%u1F50
          +%u1F51
          +%u1F52
          +%u1F53
          +%u1F54
          +%u1F55
          +%u1F56
          +%u1F57
          +%u1F58
          +%u1F59
          +%u1F5A
          +%u1F5B
          +%u1F5C
          +%u1F5D
          +%u1F5E
          +%u1F5F
          +%u1F60
          +%u1F61
          +%u1F62
          +%u1F63
          +%u1F64
          +%u1F65
          +%u1F66
          +%u1F67
          +%u1F68
          +%u1F69
          +%u1F6A
          +%u1F6B
          +%u1F6C
          +%u1F6D
          +%u1F6E
          +%u1F6F
          +%u1F70
          +%u1F71
          +%u1F72
          +%u1F73
          +%u1F74
          +%u1F75
          +%u1F76
          +%u1F77
          +%u1F78
          +%u1F79
          +%u1F7A
          +%u1F7B
          +%u1F7C
          +%u1F7D
          +%u1F7E
          +%u1F7F
          +%u1F80
          +%u1F81
          +%u1F82
          +%u1F83
          +%u1F84
          +%u1F85
          +%u1F86
          +%u1F87
          +%u1F88
          +%u1F89
          +%u1F8A
          +%u1F8B
          +%u1F8C
          +%u1F8D
          +%u1F8E
          +%u1F8F
          +%u1F90
          +%u1F91
          +%u1F92
          +%u1F93
          +%u1F94
          +%u1F95
          +%u1F96
          +%u1F97
          +%u1F98
          +%u1F99
          +%u1F9A
          +%u1F9B
          +%u1F9C
          +%u1F9D
          +%u1F9E
          +%u1F9F
          +%u1FA0
          +%u1FA1
          +%u1FA2
          +%u1FA3
          +%u1FA4
          +%u1FA5
          +%u1FA6
          +%u1FA7
          +%u1FA8
          +%u1FA9
          +%u1FAA
          +%u1FAB
          +%u1FAC
          +%u1FAD
          +%u1FAE
          +%u1FAF
          +%u1FB0
          +%u1FB1
          +%u1FB2
          +%u1FB3
          +%u1FB4
          +%u1FB5
          +%u1FB6
          +%u1FB7
          +%u1FB8
          +%u1FB9
          +%u1FBA
          +%u1FBB
          +%u1FBC
          +%u1FBD
          +%u1FBE
          +%u1FBF
          +%u1FC0
          +%u1FC1
          +%u1FC2
          +%u1FC3
          +%u1FC4
          +%u1FC5
          +%u1FC6
          +%u1FC7
          +%u1FC8
          +%u1FC9
          +%u1FCA
          +%u1FCB
          +%u1FCC
          +%u1FCD
          +%u1FCE
          +%u1FCF
          +%u1FD0
          +%u1FD1
          +%u1FD2
          +%u1FD3
          +%u1FD4
          +%u1FD5
          +%u1FD6
          +%u1FD7
          +%u1FD8
          +%u1FD9
          +%u1FDA
          +%u1FDB
          +%u1FDC
          +%u1FDD
          +%u1FDE
          +%u1FDF
          +%u1FE0
          +%u1FE1
          +%u1FE2
          +%u1FE3
          +%u1FE4
          +%u1FE5
          +%u1FE6
          +%u1FE7
          +%u1FE8
          +%u1FE9
          +%u1FEA
          +%u1FEB
          +%u1FEC
          +%u1FED
          +%u1FEE
          +%u1FEF
          +%u1FF0
          +%u1FF1
          +%u1FF2
          +%u1FF3
          +%u1FF4
          +%u1FF5
          +%u1FF6
          +%u1FF7
          +%u1FF8
          +%u1FF9
          +%u1FFA
          +%u1FFB
          +%u1FFC
          +%u1FFD
          +%u1FFE
          +%u1FFF
          diff --git a/nashorn/test/script/basic/JDK-8016542.js b/nashorn/test/script/basic/JDK-8016542.js
          new file mode 100644
          index 00000000000..6aeae2643bd
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016542.js
          @@ -0,0 +1,37 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8016542: String.prototype.replace called with function argument should not replace $ patterns
          + *
          + * @test
          + * @run
          + */
          +
          +print("abc".replace("a", "$&"));
          +print("abc".replace("b", "$&"));
          +print("abc".replace("c", "$&"));
          +
          +print("abc".replace("a", function(){return "$&"}));
          +print("abc".replace("b", function(){return "$&"}));
          +print("abc".replace("c", function(){return "$&"}));
          diff --git a/nashorn/test/script/basic/JDK-8016542.js.EXPECTED b/nashorn/test/script/basic/JDK-8016542.js.EXPECTED
          new file mode 100644
          index 00000000000..f0bd21def69
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016542.js.EXPECTED
          @@ -0,0 +1,6 @@
          +abc
          +abc
          +abc
          +$&bc
          +a$&c
          +ab$&
          diff --git a/nashorn/test/script/basic/JDK-8016618.js b/nashorn/test/script/basic/JDK-8016618.js
          new file mode 100644
          index 00000000000..1b35db7621b
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8016618.js
          @@ -0,0 +1,132 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8016618: script mirror object access should be improved
          + *
          + * @test
          + * @option -scripting
          + * @option -strict
          + * @run
          + */
          +
          +var global = loadWithNewGlobal({
          +    name: "code",
          +    script: <>e>>>0;
          +    var x = [z];
          +}
          diff --git a/nashorn/test/script/basic/JDK-8017950.js b/nashorn/test/script/basic/JDK-8017950.js
          new file mode 100644
          index 00000000000..c84eacc57f0
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8017950.js
          @@ -0,0 +1,47 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8017950: error.stack should be a string rather than an array
          + *
          + * @test
          + * @run
          + */
          +
          +function func() {
          +    try {
          +        throw new Error();
          +    } catch (e){
          +        print(e.stack.replace(/\\/g, '/'))
          +    }
          +}
          +
          +function f() { 
          +    func()
          +}
          +
          +function g() {
          +    f()
          +}
          +
          +g()
          diff --git a/nashorn/test/script/basic/JDK-8017950.js.EXPECTED b/nashorn/test/script/basic/JDK-8017950.js.EXPECTED
          new file mode 100644
          index 00000000000..8c34d21343f
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8017950.js.EXPECTED
          @@ -0,0 +1,5 @@
          +Error
          +	at func (test/script/basic/JDK-8017950.js:33)
          +	at f (test/script/basic/JDK-8017950.js:40)
          +	at g (test/script/basic/JDK-8017950.js:44)
          +	at  (test/script/basic/JDK-8017950.js:47)
          diff --git a/nashorn/test/script/basic/JDK-8019226.js b/nashorn/test/script/basic/JDK-8019226.js
          new file mode 100644
          index 00000000000..3a1cf2f901b
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019226.js
          @@ -0,0 +1,39 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019226: line number not generated for first statement if it is on the same function declaration line 
          + *
          + * @test
          + * @run
          + */
          +
          +function func1() { func2() }
          +
          +function func2() { throw new Error("failed!") }
          +
          +try {
          +    func1()
          +} catch (e) {
          +    print(e.stack.replace(/\\/g, '/'))
          +}
          diff --git a/nashorn/test/script/basic/JDK-8019226.js.EXPECTED b/nashorn/test/script/basic/JDK-8019226.js.EXPECTED
          new file mode 100644
          index 00000000000..002a3ddbf0e
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019226.js.EXPECTED
          @@ -0,0 +1,4 @@
          +Error: failed!
          +	at func2 (test/script/basic/JDK-8019226.js:33)
          +	at func1 (test/script/basic/JDK-8019226.js:31)
          +	at  (test/script/basic/JDK-8019226.js:36)
          diff --git a/nashorn/test/script/basic/JDK-8019473.js b/nashorn/test/script/basic/JDK-8019473.js
          new file mode 100644
          index 00000000000..5001f3d7311
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019473.js
          @@ -0,0 +1,62 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019473: Parser issues related to functions and blocks
          + *
          + * @test
          + * @run
          + */
          +
          +function checkNoError(code) {
          +    try {
          +        Function(code);
          +    } catch (e) {
          +        print("no error expected for: " + code + " , got " + e);
          +    }
          +}
          +
          +// implicit newlines at EOF should be accepted
          +checkNoError("for(;;) continue")
          +checkNoError("return")
          +checkNoError("yield")
          +checkNoError("for(;;) break")
          +
          +function checkError(code) {
          +    try {
          +        eval(code);
          +        print("SyntaxError expected for: " + code);
          +    } catch (e) {
          +        if (! (e instanceof SyntaxError)) {
          +            fail("SyntaxError expected, got " + e);
          +        }
          +    }
          +}
          +
          +checkError("function f() { case0: }");
          +checkError("function f() { if(0) }");
          +checkError("function f() { if(0); else }");
          +checkError("function f() { while(0) }");
          +
          +// comma expression as closure expression
          +checkError("function sq(x) x, x*x");
          diff --git a/nashorn/test/script/basic/JDK-8019478.js b/nashorn/test/script/basic/JDK-8019478.js
          new file mode 100644
          index 00000000000..f5e2a645214
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019478.js
          @@ -0,0 +1,33 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019478: Object.prototype.toString.call(/a/.exec("a")) === "[object Array]" should be true
          + *
          + * @test
          + * @run
          + */
          +
          +if (Object.prototype.toString.call(/a/.exec("a")) !== "[object Array]") {
          +    fail("Object.prototype.toString.call(/a/.exec('a')) !== '[object Array]'");
          +}
          diff --git a/nashorn/test/script/basic/JDK-8019482.js b/nashorn/test/script/basic/JDK-8019482.js
          new file mode 100644
          index 00000000000..09f91e42ea9
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019482.js
          @@ -0,0 +1,41 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019482: Number("0x0.0p0") should evaluate to NaN
          + *
          + * @test
          + * @run
          + */
          +
          +function checkHexLiteral(str) {
          +    if (! isNaN(Number(str))) {
          +        fail("Number(" + str + ") is not NaN");
          +    }
          +}
          +
          +checkHexLiteral("0x0.0");
          +checkHexLiteral("0x0.0p");
          +checkHexLiteral("0x12tu");
          +checkHexLiteral("0x12.2e22");
          +checkHexLiteral("0xtu");
          diff --git a/nashorn/test/script/basic/JDK-8019488.js b/nashorn/test/script/basic/JDK-8019488.js
          new file mode 100644
          index 00000000000..0cb58e9087f
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019488.js
          @@ -0,0 +1,68 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019488: switch on literals result in NoSuchMethodError or VerifyError
          + *
          + * @test
          + * @run
          + */
          +
          +switch("") {
          +    case 0:
          +        break
          +}
          +
          +switch(true) {
          +    case 0:
          +        print("0"); break;
          +    case 1:
          +        print("1"); break;
          +}
          +
          +switch(false) {
          +    case 0:
          +        print("0"); break;
          +    case 1:
          +        print("1"); break;
          +}
          +
          +switch([]) {
          +    case 1:
          +        print("1");
          +}
          +
          +switch (undefined) {
          +    case 0:
          +        print("0");
          +}
          +
          +switch (null) {
          +    case 0:
          +        print("0");
          +}
          +
          +switch({}) {
          +    case 1:
          +        print("1");
          +}
          diff --git a/nashorn/test/script/basic/JDK-8019508.js b/nashorn/test/script/basic/JDK-8019508.js
          new file mode 100644
          index 00000000000..d23035c638a
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019508.js
          @@ -0,0 +1,56 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019508: Comma handling in object literal parsing is wrong
          + *
          + * @test
          + * @run
          + */
          +
          +function checkObjLiteral(str) {
          +    try {
          +        eval(str);
          +        fail("SyntaxError expected for: " + str);
          +    } catch (e) {
          +        if (! (e instanceof SyntaxError)) {
          +            fail("expected SyntaxError, got " + e);
          +        }
          +        print(e.message.replace(/\\/g, '/'));
          +    }
          +}
          +
          +// only comma
          +checkObjLiteral("({,})");
          +
          +// starting with comma
          +checkObjLiteral("({, a:2 })");
          +
          +// consecutive commas
          +checkObjLiteral("({a:3,,})");
          +
          +// missing comma
          +checkObjLiteral("({a:3 b:2}");
          +
          +// single trailing comma is okay!
          +var obj = { a: 3, };
          diff --git a/nashorn/test/script/basic/JDK-8019508.js.EXPECTED b/nashorn/test/script/basic/JDK-8019508.js.EXPECTED
          new file mode 100644
          index 00000000000..d5f81409803
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019508.js.EXPECTED
          @@ -0,0 +1,12 @@
          +test/script/basic/JDK-8019508.js#33:1:2 Expected property id but found ,
          +({,})
          +  ^
          +test/script/basic/JDK-8019508.js#33:1:2 Expected property id but found ,
          +({, a:2 })
          +  ^
          +test/script/basic/JDK-8019508.js#33:1:6 Expected property id but found ,
          +({a:3,,})
          +      ^
          +test/script/basic/JDK-8019508.js#33:1:6 Expected comma but found ident
          +({a:3 b:2}
          +      ^
          diff --git a/nashorn/test/script/basic/JDK-8019553.js b/nashorn/test/script/basic/JDK-8019553.js
          new file mode 100644
          index 00000000000..d754618718a
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019553.js
          @@ -0,0 +1,43 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8019553:  NPE on illegal l-value for increment and decrement
          + *
          + * @test
          + * @run
          + */
          +
          +function check(str) {
          +    try {
          +        eval(str);
          +        fail("SyntaxError expected for: " + str);
          +    } catch (e) {
          +        print(e.toString().replace(/\\/g, '/'));
          +    }
          +}
          +
          +check("++ +3");
          +check("++ -7");
          +check("-- +2");
          +check("-- -8");
          diff --git a/nashorn/test/script/basic/JDK-8019553.js.EXPECTED b/nashorn/test/script/basic/JDK-8019553.js.EXPECTED
          new file mode 100644
          index 00000000000..78d22beac0f
          --- /dev/null
          +++ b/nashorn/test/script/basic/JDK-8019553.js.EXPECTED
          @@ -0,0 +1,12 @@
          +SyntaxError: test/script/basic/JDK-8019553.js#33:1:3 Expected l-value but found +
          +++ +3
          +   ^
          +SyntaxError: test/script/basic/JDK-8019553.js#33:1:3 Expected l-value but found -
          +++ -7
          +   ^
          +SyntaxError: test/script/basic/JDK-8019553.js#33:1:3 Expected l-value but found +
          +-- +2
          +   ^
          +SyntaxError: test/script/basic/JDK-8019553.js#33:1:3 Expected l-value but found -
          +-- -8
          +   ^
          diff --git a/nashorn/test/script/basic/NASHORN-109.js b/nashorn/test/script/basic/NASHORN-109.js
          index b05e0f12e50..4667feb21de 100644
          --- a/nashorn/test/script/basic/NASHORN-109.js
          +++ b/nashorn/test/script/basic/NASHORN-109.js
          @@ -33,8 +33,9 @@ try {
                   throw new Error("error");
               }
           } catch (e) {
          -    for (i in e.stack) { 
          -        print(e.stack[i].methodName + ' ' + e.stack[i].lineNumber);
          +    var frames = e.getStackTrace();
          +    for (i in frames) {
          +        print(frames[i].methodName + ' ' + frames[i].lineNumber);
               }
           }
           
          diff --git a/nashorn/test/script/basic/NASHORN-296.js b/nashorn/test/script/basic/NASHORN-296.js
          index cbb752fbcaa..26338e60f56 100644
          --- a/nashorn/test/script/basic/NASHORN-296.js
          +++ b/nashorn/test/script/basic/NASHORN-296.js
          @@ -33,7 +33,7 @@ function test(name) {
                   load({ script: 'throw new Error()', name: name });
               } catch(e) {
                   // normalize windows path separator to URL style
          -        var actual = e.stack[0].fileName;
          +        var actual = e.getStackTrace()[0].fileName;
                   if (actual !== name) {
                       fail("expected file name to be " + name +
                            ", actually got file name " + actual);
          @@ -48,6 +48,6 @@ test("com/oracle/node/sample.js");
           try {
               throw new Error();
           } catch (e) {
          -    test(e.stack[0].fileName.substring(6));
          +    test(e.getStackTrace()[0].fileName.substring(6));
           }
           
          diff --git a/nashorn/test/script/basic/NASHORN-51.js b/nashorn/test/script/basic/NASHORN-51.js
          index 044bce94062..bc41d79bebf 100644
          --- a/nashorn/test/script/basic/NASHORN-51.js
          +++ b/nashorn/test/script/basic/NASHORN-51.js
          @@ -35,28 +35,28 @@ for (i in literals) {
                   eval(literals[i] + "++");
                   print("ERROR!! post increment : " + literals[i]);
               } catch (e) {
          -        print(e);
          +        print(e.toString().replace(/\\/g, '/'));
               }
           
               try {
                   eval(literals[i] + "--");
                   print("ERROR!! post decrement : " + literals[i]);
               } catch (e) {
          -        print(e);
          +        print(e.toString().replace(/\\/g, '/'));
               }
           
               try {
                   eval("++" + literals[i]);
                   print("ERROR!! pre increment : " + literals[i]);
               } catch (e) {
          -        print(e);
          +        print(e.toString().replace(/\\/g, '/'));
               }
           
               try {
                   eval("--" + literals[i]);
                   print("ERROR!! pre decrement : " + literals[i]);
               } catch (e) {
          -        print(e);
          +        print(e.toString().replace(/\\/g, '/'));
               }
           }
           
          diff --git a/nashorn/test/script/basic/NASHORN-51.js.EXPECTED b/nashorn/test/script/basic/NASHORN-51.js.EXPECTED
          index 9fc05c3f1b4..9479f7e1995 100644
          --- a/nashorn/test/script/basic/NASHORN-51.js.EXPECTED
          +++ b/nashorn/test/script/basic/NASHORN-51.js.EXPECTED
          @@ -1,24 +1,72 @@
          -ReferenceError: "1" can not be used as the left-hand side of assignment
          -ReferenceError: "1" can not be used as the left-hand side of assignment
          -ReferenceError: "1" can not be used as the left-hand side of assignment
          -ReferenceError: "1" can not be used as the left-hand side of assignment
          -ReferenceError: "0" can not be used as the left-hand side of assignment
          -ReferenceError: "0" can not be used as the left-hand side of assignment
          -ReferenceError: "0" can not be used as the left-hand side of assignment
          -ReferenceError: "0" can not be used as the left-hand side of assignment
          -ReferenceError: "3.14" can not be used as the left-hand side of assignment
          -ReferenceError: "3.14" can not be used as the left-hand side of assignment
          -ReferenceError: "3.14" can not be used as the left-hand side of assignment
          -ReferenceError: "3.14" can not be used as the left-hand side of assignment
          -ReferenceError: "true" can not be used as the left-hand side of assignment
          -ReferenceError: "true" can not be used as the left-hand side of assignment
          -ReferenceError: "true" can not be used as the left-hand side of assignment
          -ReferenceError: "true" can not be used as the left-hand side of assignment
          -ReferenceError: "false" can not be used as the left-hand side of assignment
          -ReferenceError: "false" can not be used as the left-hand side of assignment
          -ReferenceError: "false" can not be used as the left-hand side of assignment
          -ReferenceError: "false" can not be used as the left-hand side of assignment
          -ReferenceError: "null" can not be used as the left-hand side of assignment
          -ReferenceError: "null" can not be used as the left-hand side of assignment
          -ReferenceError: "null" can not be used as the left-hand side of assignment
          -ReferenceError: "null" can not be used as the left-hand side of assignment
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +1++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +1--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++1
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--1
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +0++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +0--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++0
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--0
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +3.14++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +3.14--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++3.14
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--3.14
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +true++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +true--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++true
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--true
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +false++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +false--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++false
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--false
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#35:1:0 Invalid left hand side for assignment
          +null++
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#42:1:0 Invalid left hand side for assignment
          +null--
          +^
          +ReferenceError: test/script/basic/NASHORN-51.js#49:1:2 Invalid left hand side for assignment
          +++null
          +  ^
          +ReferenceError: test/script/basic/NASHORN-51.js#56:1:2 Invalid left hand side for assignment
          +--null
          +  ^
          diff --git a/nashorn/test/script/basic/errorstack.js b/nashorn/test/script/basic/errorstack.js
          index 7db53142c10..8fcd25a2e1b 100644
          --- a/nashorn/test/script/basic/errorstack.js
          +++ b/nashorn/test/script/basic/errorstack.js
          @@ -22,7 +22,7 @@
            */
           
           /**
          - * "stack" property of Error objects. (nashorn extension).
          + * "getStackTrace()" method of Error objects. (nashorn extension).
            *
            * @test
            * @run
          @@ -43,9 +43,9 @@ function func3() {
           try {
               func1();
           } catch (e) {
          -    // "stack" is java.lang.StackTraceElement object
          -    for (i in e.stack) {
          -        print(e.stack[i].methodName + " : " + e.stack[i].lineNumber);
          +    var frames = e.getStackTrace();
          +    for (i in frames) {
          +        print(frames[i].methodName + " : " + frames[i].lineNumber);
               }
           }
           
          diff --git a/nashorn/test/script/basic/moduleload.js b/nashorn/test/script/basic/moduleload.js
          index 628bfa24caf..633d2a1c644 100644
          --- a/nashorn/test/script/basic/moduleload.js
          +++ b/nashorn/test/script/basic/moduleload.js
          @@ -25,7 +25,6 @@
            * This loads "module.js" and calls the anonymous top-level function from it.
            *
            * @test
          - * @option --anon-functions
            * @run
            */
           
          diff --git a/nashorn/test/script/error/JDK-8016522.js b/nashorn/test/script/error/JDK-8016522.js
          new file mode 100644
          index 00000000000..e0832280a53
          --- /dev/null
          +++ b/nashorn/test/script/error/JDK-8016522.js
          @@ -0,0 +1,30 @@
          +/*
          + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
          + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
          + * 
          + * This code is free software; you can redistribute it and/or modify it
          + * under the terms of the GNU General Public License version 2 only, as
          + * published by the Free Software Foundation.
          + * 
          + * This code is distributed in the hope that it will be useful, but WITHOUT
          + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
          + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
          + * version 2 for more details (a copy is included in the LICENSE file that
          + * accompanied this code).
          + * 
          + * You should have received a copy of the GNU General Public License version
          + * 2 along with this work; if not, write to the Free Software Foundation,
          + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
          + * 
          + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
          + * or visit www.oracle.com if you need additional information or have any
          + * questions.
          + */
          +
          +/**
          + * JDK-8016522: Numeric literal must not be followed by IdentifierStart
          + *
          + * @test/compile-error
          + */
          +
          +3in {};
          diff --git a/nashorn/test/script/error/JDK-8016522.js.EXPECTED b/nashorn/test/script/error/JDK-8016522.js.EXPECTED
          new file mode 100644
          index 00000000000..3bfe59ef217
          --- /dev/null
          +++ b/nashorn/test/script/error/JDK-8016522.js.EXPECTED
          @@ -0,0 +1,3 @@
          +test/script/error/JDK-8016522.js:30:1 Missing space after numeric literal
          +3in {};
          + ^
          diff --git a/nashorn/test/script/error/NASHORN-57.js.EXPECTED b/nashorn/test/script/error/NASHORN-57.js.EXPECTED
          index 5a93b597c0e..c9c51de1292 100644
          --- a/nashorn/test/script/error/NASHORN-57.js.EXPECTED
          +++ b/nashorn/test/script/error/NASHORN-57.js.EXPECTED
          @@ -1,3 +1,3 @@
          -test/script/error/NASHORN-57.js:35:2 Expected statement but found ;
          +test/script/error/NASHORN-57.js:35:2 Expected l-value but found ;
           ++;
             ^
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java
          index 2cfdbf00046..b6e5bbcddc9 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/BooleanAccessTest.java
          @@ -39,7 +39,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.BooleanAccessTest
          - * @run testng jdk.nashorn.api.javaaccess.BooleanAccessTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.BooleanAccessTest
            */
           public class BooleanAccessTest {
           
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java
          index 69ca20c6c16..6de10a54783 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java
          @@ -42,7 +42,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.MethodAccessTest
          - * @run testng jdk.nashorn.api.javaaccess.MethodAccessTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.MethodAccessTest
            */
           public class MethodAccessTest {
           
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java
          index 21994960176..0b7cb027b61 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberAccessTest.java
          @@ -39,7 +39,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberAccessTest
          - * @run testng jdk.nashorn.api.javaaccess.NumberAccessTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.NumberAccessTest
            */
           public class NumberAccessTest {
           
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java
          index ae719e7fb62..0302259e95b 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/NumberBoxingTest.java
          @@ -38,7 +38,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.NumberBoxingTest
          - * @run testng jdk.nashorn.api.javaaccess.NumberBoxingTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.NumberBoxingTest
            */
           public class NumberBoxingTest {
           
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java
          index 7172051416c..2a51e7a9ce1 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/ObjectAccessTest.java
          @@ -38,7 +38,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.ObjectAccessTest
          - * @run testng jdk.nashorn.api.javaaccess.ObjectAccessTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.ObjectAccessTest
            */
           public class ObjectAccessTest {
           
          diff --git a/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java b/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java
          index 6a7713bd6a4..dd4b5020787 100644
          --- a/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java
          +++ b/nashorn/test/src/jdk/nashorn/api/javaaccess/StringAccessTest.java
          @@ -38,7 +38,7 @@ import org.testng.annotations.Test;
           /**
            * @test
            * @build jdk.nashorn.api.javaaccess.SharedObject jdk.nashorn.api.javaaccess.Person jdk.nashorn.api.javaaccess.StringAccessTest
          - * @run testng jdk.nashorn.api.javaaccess.StringAccessTest
          + * @run testng/othervm jdk.nashorn.api.javaaccess.StringAccessTest
            */
           public class StringAccessTest {