# HG changeset patch
# User thartmann
# Date 1432281033 -7200
# Node ID c6a387636aa5d9283859c9dc21142a4e66359b19
# Parent b455d36ef73c1fb51054fc01cba05ee013ba210d# Parent 6e9d62b1dbc3dbd884e21a43747dececd6198872
Merge
diff -r b455d36ef73c -r c6a387636aa5 .hgtags
--- a/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -306,3 +306,4 @@
ac3f5a39d4ff14d70c365e12cf5ec8f2abd52a04 jdk9-b61
e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62
989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63
+8ffdeabc7c2b9a8280bf46cae026ac46b4d31c26 jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 .hgtags-top-repo
--- a/.hgtags-top-repo Thu May 21 18:23:01 2015 +0300
+++ b/.hgtags-top-repo Fri May 22 09:50:33 2015 +0200
@@ -306,3 +306,4 @@
ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62
0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
+82cf9aab9a83e41c8194ba01af9666afdb856cbe jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/basics.m4
--- a/common/autoconf/basics.m4 Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/basics.m4 Fri May 22 09:50:33 2015 +0200
@@ -705,9 +705,9 @@
# is performed.
filtered_files=`$ECHO "$files_present" \
| $SED -e 's/config.log//g' \
- -e 's/confdefs.h//g' \
- -e 's/fixpath.exe//g' \
- -e 's/ //g' \
+ -e 's/configure.log//g' \
+ -e 's/confdefs.h//g' \
+ -e 's/ //g' \
| $TR -d '\n'`
if test "x$filtered_files" != x; then
AC_MSG_NOTICE([Current directory is $CURDIR.])
@@ -1054,3 +1054,29 @@
AC_SUBST(BASH_ARGS)
])
+
+# Code to run after AC_OUTPUT
+AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
+[
+ # Try to move config.log (generated by autoconf) to the configure-support directory.
+ if test -e ./config.log; then
+ $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
+ fi
+
+ # Rotate our log file (configure.log)
+ if test -e "$OUTPUT_ROOT/configure.log.old"; then
+ $RM -f "$OUTPUT_ROOT/configure.log.old"
+ fi
+ if test -e "$OUTPUT_ROOT/configure.log"; then
+ $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
+ fi
+
+ # Move configure.log from current directory to the build output root
+ if test -e ./configure.log; then
+ echo found it
+ $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
+ fi
+
+ # Make the compare script executable
+ $CHMOD +x $OUTPUT_ROOT/compare.sh
+])
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/configure
--- a/common/autoconf/configure Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/configure Fri May 22 09:50:33 2015 +0200
@@ -255,13 +255,10 @@
set -x
fi
-if test "x$conf_debug_configure" = xtrue; then
- # Turn on logging, but don't turn on twice when called recursive
- conf_debug_logfile=./debug-configure.log
- (exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile
-else
- ( . $conf_script_to_run "${conf_processed_arguments[@]}" )
-fi
+# Now transfer control to the script generated by autoconf. This is where the
+# main work is done.
+conf_logfile=./configure.log
+(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
conf_result_code=$?
###
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/configure.ac
--- a/common/autoconf/configure.ac Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/configure.ac Fri May 22 09:50:33 2015 +0200
@@ -265,15 +265,10 @@
# Create the actual output files. Now the main work of configure is done.
AC_OUTPUT
+
+# After AC_OUTPUT, we need to do final work
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
-
-# Try to move the config.log file to the output directory.
-if test -e ./config.log; then
- $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
-fi
-
-# Make the compare script executable
-$CHMOD +x $OUTPUT_ROOT/compare.sh
+BASIC_POST_CONFIG_OUTPUT
# Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/flags.m4
--- a/common/autoconf/flags.m4 Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/flags.m4 Fri May 22 09:50:33 2015 +0200
@@ -231,7 +231,6 @@
AC_SUBST(C_FLAG_REORDER)
AC_SUBST(CXX_FLAG_REORDER)
- AC_SUBST(SHARED_LIBRARY_FLAGS)
AC_SUBST(SET_EXECUTABLE_ORIGIN)
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
AC_SUBST(SET_SHARED_LIBRARY_NAME)
@@ -524,6 +523,10 @@
# CXXFLAGS_JDK - C++ Compiler flags
# COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ if test "x$OPENJDK_TARGET_CPU" = xx86; then
+ # Force compatibility with i586 on 32 bit intel platforms.
+ COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+ fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
@@ -900,6 +903,24 @@
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
+ AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
+ [do not consider native warnings to be an error @<:@enabled@:>@])])
+
+ AC_MSG_CHECKING([if native warnings are errors])
+ if test "x$enable_warnings_as_errors" = "xyes"; then
+ AC_MSG_RESULT([yes (explicitely set)])
+ WARNINGS_AS_ERRORS=true
+ elif test "x$enable_warnings_as_errors" = "xno"; then
+ AC_MSG_RESULT([no])
+ WARNINGS_AS_ERRORS=false
+ elif test "x$enable_warnings_as_errors" = "x"; then
+ AC_MSG_RESULT([yes (default)])
+ WARNINGS_AS_ERRORS=true
+ else
+ AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
+ fi
+ AC_SUBST(WARNINGS_AS_ERRORS)
+
case "${TOOLCHAIN_TYPE}" in
microsoft)
DISABLE_WARNING_PREFIX="-wd"
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/generated-configure.sh
--- a/common/autoconf/generated-configure.sh Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/generated-configure.sh Fri May 22 09:50:33 2015 +0200
@@ -684,6 +684,7 @@
ENABLE_DEBUG_SYMBOLS
CFLAGS_WARNINGS_ARE_ERRORS
DISABLE_WARNING_PREFIX
+WARNINGS_AS_ERRORS
COMPILER_SUPPORTS_TARGET_BITS_FLAG
ZERO_ARCHFLAG
LDFLAGS_TESTEXE_SUFFIX
@@ -727,7 +728,6 @@
SET_SHARED_LIBRARY_NAME
SET_SHARED_LIBRARY_ORIGIN
SET_EXECUTABLE_ORIGIN
-SHARED_LIBRARY_FLAGS
CXX_FLAG_REORDER
C_FLAG_REORDER
SYSROOT_LDFLAGS
@@ -1086,6 +1086,7 @@
with_extra_cflags
with_extra_cxxflags
with_extra_ldflags
+enable_warnings_as_errors
enable_debug_symbols
enable_zip_debug_info
enable_native_coverage
@@ -1852,6 +1853,9 @@
--enable-rmiconnector-iiop
enable the JMX RMIConnector iiop transport
[disabled]
+ --disable-warnings-as-errors
+ do not consider native warnings to be an error
+ [enabled]
--disable-debug-symbols disable generation of debug symbols [enabled]
--disable-zip-debug-info
disable zipping of debug-info files [enabled]
@@ -3496,6 +3500,9 @@
# Check for support for specific options in bash
+# Code to run after AC_OUTPUT
+
+
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4359,7 +4366,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1430918902
+DATE_WHEN_GENERATED=1431429776
###############################################################################
#
@@ -15335,9 +15342,9 @@
# is performed.
filtered_files=`$ECHO "$files_present" \
| $SED -e 's/config.log//g' \
- -e 's/confdefs.h//g' \
- -e 's/fixpath.exe//g' \
- -e 's/ //g' \
+ -e 's/configure.log//g' \
+ -e 's/confdefs.h//g' \
+ -e 's/ //g' \
| $TR -d '\n'`
if test "x$filtered_files" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
@@ -41761,7 +41768,6 @@
-
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
@@ -42029,6 +42035,10 @@
# CXXFLAGS_JDK - C++ Compiler flags
# COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ if test "x$OPENJDK_TARGET_CPU" = xx86; then
+ # Force compatibility with i586 on 32 bit intel platforms.
+ COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+ fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
@@ -42471,6 +42481,31 @@
+ # Check whether --enable-warnings-as-errors was given.
+if test "${enable_warnings_as_errors+set}" = set; then :
+ enableval=$enable_warnings_as_errors;
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5
+$as_echo_n "checking if native warnings are errors... " >&6; }
+ if test "x$enable_warnings_as_errors" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitely set)" >&5
+$as_echo "yes (explicitely set)" >&6; }
+ WARNINGS_AS_ERRORS=true
+ elif test "x$enable_warnings_as_errors" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ WARNINGS_AS_ERRORS=false
+ elif test "x$enable_warnings_as_errors" = "x"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
+$as_echo "yes (default)" >&6; }
+ WARNINGS_AS_ERRORS=true
+ else
+ as_fn_error $? "--enable-warnings-as-errors accepts no argument" "$LINENO" 5
+ fi
+
+
case "${TOOLCHAIN_TYPE}" in
microsoft)
DISABLE_WARNING_PREFIX="-wd"
@@ -54179,14 +54214,31 @@
fi
-
-# Try to move the config.log file to the output directory.
-if test -e ./config.log; then
- $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
-fi
-
-# Make the compare script executable
-$CHMOD +x $OUTPUT_ROOT/compare.sh
+# After AC_OUTPUT, we need to do final work
+
+
+ # Try to move config.log (generated by autoconf) to the configure-support directory.
+ if test -e ./config.log; then
+ $MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
+ fi
+
+ # Rotate our log file (configure.log)
+ if test -e "$OUTPUT_ROOT/configure.log.old"; then
+ $RM -f "$OUTPUT_ROOT/configure.log.old"
+ fi
+ if test -e "$OUTPUT_ROOT/configure.log"; then
+ $MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
+ fi
+
+ # Move configure.log from current directory to the build output root
+ if test -e ./configure.log; then
+ echo found it
+ $MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
+ fi
+
+ # Make the compare script executable
+ $CHMOD +x $OUTPUT_ROOT/compare.sh
+
# Finally output some useful information to the user
@@ -54280,14 +54332,20 @@
-if test -e "$OUTPUT_ROOT/config.log"; then
- $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
- if test $? -eq 0; then
- printf "The following warnings were produced. Repeated here for convenience:\n"
- # We must quote sed expression (using []) to stop m4 from eating the [].
- $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e 's/^configure:[0-9]*: //'
- printf "\n"
- fi
-fi
-
-
+ # Locate config.log.
+ if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
+ CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
+ elif test -e "./config.log"; then
+ CONFIG_LOG_PATH="."
+ fi
+
+ if test -e "$CONFIG_LOG_PATH/config.log"; then
+ $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
+ if test $? -eq 0; then
+ printf "The following warnings were produced. Repeated here for convenience:\n"
+ # We must quote sed expression (using []) to stop m4 from eating the [].
+ $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e 's/^configure:[0-9]*: //'
+ printf "\n"
+ fi
+ fi
+
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/help.m4
--- a/common/autoconf/help.m4 Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/help.m4 Fri May 22 09:50:33 2015 +0200
@@ -212,7 +212,7 @@
if test "x$TOOLCHAIN_VERSION" != "x"; then
print_version=" $TOOLCHAIN_VERSION"
fi
- printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
+ printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
@@ -263,14 +263,20 @@
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
[
-if test -e "$OUTPUT_ROOT/config.log"; then
- $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
- if test $? -eq 0; then
- printf "The following warnings were produced. Repeated here for convenience:\n"
- # We must quote sed expression (using []) to stop m4 from eating the [].
- $GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
- printf "\n"
+ # Locate config.log.
+ if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
+ CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
+ elif test -e "./config.log"; then
+ CONFIG_LOG_PATH="."
fi
-fi
+ if test -e "$CONFIG_LOG_PATH/config.log"; then
+ $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
+ if test $? -eq 0; then
+ printf "The following warnings were produced. Repeated here for convenience:\n"
+ # We must quote sed expression (using []) to stop m4 from eating the [].
+ $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
+ printf "\n"
+ fi
+ fi
])
diff -r b455d36ef73c -r c6a387636aa5 common/autoconf/spec.gmk.in
--- a/common/autoconf/spec.gmk.in Thu May 21 18:23:01 2015 +0300
+++ b/common/autoconf/spec.gmk.in Fri May 22 09:50:33 2015 +0200
@@ -321,6 +321,9 @@
DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
+# A global flag (true or false) determining if native warnings are considered errors.
+WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
+
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
# Tools that potentially need to be cross compilation aware.
@@ -394,9 +397,6 @@
LIPO:=@LIPO@
-# Command to create a shared library
-SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
-
# Options to linker to specify a mapfile.
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
diff -r b455d36ef73c -r c6a387636aa5 corba/.hgtags
--- a/corba/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/corba/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -306,3 +306,4 @@
d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61
d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62
0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63
+0a5e5a7c3539e8bde73d9fe55750e49a49cb8dac jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 hotspot/.hgtags
--- a/hotspot/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -466,3 +466,4 @@
715d2da5801c410746e92f08066d53bde1496286 jdk9-b61
1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62
2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63
+bf92b8db249cdfa5651ef954b6c0743a7e0ea4cd jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/aarch64.ad
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad Fri May 22 09:50:33 2015 +0200
@@ -810,9 +810,6 @@
bool unnecessary_volatile(const Node *barrier);
bool needs_releasing_store(const Node *store);
- // Use barrier instructions rather than load acquire / store
- // release.
- const bool UseBarriersForVolatile = false;
// Use barrier instructions for unsafe volatile gets rather than
// trying to identify an exact signature for them
const bool UseBarriersForUnsafeVolatileGet = false;
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp
--- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp Fri May 22 09:50:33 2015 +0200
@@ -98,8 +98,8 @@
product(bool, NearCpool, true, \
"constant pool is close to instructions") \
\
- notproduct(bool, UseAcqRelForVolatileFields, false, \
- "Use acquire and release insns for volatile fields") \
+ product(bool, UseBarriersForVolatile, false, \
+ "Use memory barriers to implement volatile accesses") \
\
product(bool, UseCRC32, false, \
"Use CRC32 instructions for CRC32 computation") \
@@ -117,8 +117,8 @@
product(bool, NearCpool, true, \
"constant pool is close to instructions") \
\
- notproduct(bool, UseAcqRelForVolatileFields, false, \
- "Use acquire and release insns for volatile fields") \
+ product(bool, UseBarriersForVolatile, false, \
+ "Use memory barriers to implement volatile accesses") \
product(bool, UseNeon, false, \
"Use Neon for CRC32 computation") \
product(bool, UseCRC32, false, \
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Fri May 22 09:50:33 2015 +0200
@@ -1314,7 +1314,7 @@
// case_array_offset_in_bytes()
movw(reg2, in_bytes(MultiBranchData::per_case_size()));
movw(rscratch1, in_bytes(MultiBranchData::case_array_offset()));
- maddw(index, index, reg2, rscratch1);
+ Assembler::maddw(index, index, reg2, rscratch1);
// Update the case count
increment_mdp_data_at(mdp,
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Fri May 22 09:50:33 2015 +0200
@@ -1625,7 +1625,7 @@
sdivw(result, ra, rb);
} else {
sdivw(scratch, ra, rb);
- msubw(result, scratch, rb, ra);
+ Assembler::msubw(result, scratch, rb, ra);
}
return idivl_offset;
@@ -1655,7 +1655,7 @@
sdiv(result, ra, rb);
} else {
sdiv(scratch, ra, rb);
- msub(result, scratch, rb, ra);
+ Assembler::msub(result, scratch, rb, ra);
}
return idivq_offset;
@@ -3787,14 +3787,6 @@
}
}
- bool MacroAssembler::use_acq_rel_for_volatile_fields() {
-#ifdef PRODUCT
- return false;
-#else
- return UseAcqRelForVolatileFields;
-#endif
- }
-
void MacroAssembler::build_frame(int framesize) {
if (framesize == 0) {
// Is this even possible?
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp Fri May 22 09:50:33 2015 +0200
@@ -405,6 +405,18 @@
umaddl(Rd, Rn, Rm, zr);
}
+#define WRAP(INSN) \
+ void INSN(Register Rd, Register Rn, Register Rm, Register Ra) { \
+ if ((VM_Version::cpu_cpuFeatures() & VM_Version::CPU_A53MAC) && Ra != zr) \
+ nop(); \
+ Assembler::INSN(Rd, Rn, Rm, Ra); \
+ }
+
+ WRAP(madd) WRAP(msub) WRAP(maddw) WRAP(msubw)
+ WRAP(smaddl) WRAP(smsubl) WRAP(umaddl) WRAP(umsubl)
+#undef WRAP
+
+
// macro assembly operations needed for aarch64
// first two private routines for loading 32 bit or 64 bit constants
@@ -1094,9 +1106,6 @@
address read_polling_page(Register r, address page, relocInfo::relocType rtype);
address read_polling_page(Register r, relocInfo::relocType rtype);
- // Used by aarch64.ad to control code generation
- static bool use_acq_rel_for_volatile_fields();
-
// CRC32 code for java.util.zip.CRC32::updateBytes() instrinsic.
void update_byte_crc32(Register crc, Register val, Register table);
void update_word_crc32(Register crc, Register v, Register tmp,
@@ -1150,10 +1159,6 @@
int offset, int size);
};
-// Used by aarch64.ad to control code generation
-#define treat_as_volatile(MEM_NODE) \
- (MacroAssembler::use_acq_rel_for_volatile_fields() ? (MEM_NODE)->is_volatile() : false)
-
#ifdef ASSERT
inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
#endif
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp Fri May 22 09:50:33 2015 +0200
@@ -59,6 +59,9 @@
int VM_Version::_cpu;
int VM_Version::_model;
+int VM_Version::_model2;
+int VM_Version::_variant;
+int VM_Version::_revision;
int VM_Version::_stepping;
int VM_Version::_cpuFeatures;
const char* VM_Version::_features_str = "";
@@ -122,13 +125,47 @@
char buf[512];
- strcpy(buf, "simd");
+ _cpuFeatures = auxv;
+
+ int cpu_lines = 0;
+ if (FILE *f = fopen("/proc/cpuinfo", "r")) {
+ char buf[128], *p;
+ while (fgets(buf, sizeof (buf), f) != NULL) {
+ if (p = strchr(buf, ':')) {
+ long v = strtol(p+1, NULL, 0);
+ if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
+ _cpu = v;
+ cpu_lines++;
+ } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
+ _variant = v;
+ } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
+ if (_model != v) _model2 = _model;
+ _model = v;
+ } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
+ _revision = v;
+ }
+ }
+ }
+ fclose(f);
+ }
+
+ // Enable vendor specific features
+ if (_cpu == CPU_CAVIUM && _variant == 0) _cpuFeatures |= CPU_DMB_ATOMICS;
+ if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _cpuFeatures |= CPU_A53MAC;
+ // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07)
+ // we assume the worst and assume we could be on a big little system and have
+ // undisclosed A53 cores which we could be swapped to at any stage
+ if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _cpuFeatures |= CPU_A53MAC;
+
+ sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision);
+ if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2);
+ if (auxv & HWCAP_ASIMD) strcat(buf, ", simd");
if (auxv & HWCAP_CRC32) strcat(buf, ", crc");
if (auxv & HWCAP_AES) strcat(buf, ", aes");
if (auxv & HWCAP_SHA1) strcat(buf, ", sha1");
if (auxv & HWCAP_SHA2) strcat(buf, ", sha256");
- _features_str = strdup(buf);
+ _features_str = os::strdup(buf);
if (FLAG_IS_DEFAULT(UseCRC32)) {
UseCRC32 = (auxv & HWCAP_CRC32) != 0;
@@ -202,6 +239,10 @@
UseMultiplyToLenIntrinsic = true;
}
+ if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) {
+ UseBarriersForVolatile = (_cpuFeatures & CPU_DMB_ATOMICS) != 0;
+ }
+
#ifdef COMPILER2
if (FLAG_IS_DEFAULT(OptoScheduling)) {
OptoScheduling = true;
diff -r b455d36ef73c -r c6a387636aa5 hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp
--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp Thu May 21 18:23:01 2015 +0300
+++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp Fri May 22 09:50:33 2015 +0200
@@ -34,6 +34,9 @@
protected:
static int _cpu;
static int _model;
+ static int _model2;
+ static int _variant;
+ static int _revision;
static int _stepping;
static int _cpuFeatures; // features returned by the "cpuid" instruction
// 0 if this instruction is not available
@@ -49,7 +52,40 @@
static void assert_is_initialized() {
}
+ enum {
+ CPU_ARM = 'A',
+ CPU_BROADCOM = 'B',
+ CPU_CAVIUM = 'C',
+ CPU_DEC = 'D',
+ CPU_INFINEON = 'I',
+ CPU_MOTOROLA = 'M',
+ CPU_NVIDIA = 'N',
+ CPU_AMCC = 'P',
+ CPU_QUALCOM = 'Q',
+ CPU_MARVELL = 'V',
+ CPU_INTEL = 'i',
+ } cpuFamily;
+
+ enum {
+ CPU_FP = (1<<0),
+ CPU_ASIMD = (1<<1),
+ CPU_EVTSTRM = (1<<2),
+ CPU_AES = (1<<3),
+ CPU_PMULL = (1<<4),
+ CPU_SHA1 = (1<<5),
+ CPU_SHA2 = (1<<6),
+ CPU_CRC32 = (1<<7),
+ CPU_A53MAC = (1 << 30),
+ CPU_DMB_ATOMICS = (1 << 31),
+ } cpuFeatureFlags;
+
static const char* cpu_features() { return _features_str; }
+ static int cpu_family() { return _cpu; }
+ static int cpu_model() { return _model; }
+ static int cpu_model2() { return _model2; }
+ static int cpu_variant() { return _variant; }
+ static int cpu_revision() { return _revision; }
+ static int cpu_cpuFeatures() { return _cpuFeatures; }
};
diff -r b455d36ef73c -r c6a387636aa5 jaxp/.hgtags
--- a/jaxp/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -306,3 +306,4 @@
f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62
4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63
+6f91749b5aaef1a171ec2254163233438d1071d1 jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java Fri May 22 09:50:33 2015 +0200
@@ -567,8 +567,12 @@
}
public NodeList makeNodeList(DTMAxisIterator iter) {
- // TODO: gather nodes from all DOMs ?
- return _main.makeNodeList(iter);
+ int index = iter.next();
+ if (index == DTM.NULL) {
+ return null;
+ }
+ iter.reset();
+ return _adapters[getDTMId(index)].makeNodeList(iter);
}
public String getLanguage(int node) {
diff -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java Fri May 22 09:50:33 2015 +0200
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
diff -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java Fri May 22 09:50:33 2015 +0200
@@ -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 -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java Fri May 22 09:50:33 2015 +0200
@@ -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 -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathEvaluationResult.java
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathEvaluationResult.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathEvaluationResult.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff -r b455d36ef73c -r c6a387636aa5 jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathNodes.java
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathNodes.java Thu May 21 18:23:01 2015 +0300
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathNodes.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff -r b455d36ef73c -r c6a387636aa5 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DocumentExtFunc.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/DocumentExtFunc.java Fri May 22 09:50:33 2015 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class DocumentExtFunc {
+
+ public static String test(NodeList list) {
+ Node node = list.item(0);
+ return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
+ }
+}
diff -r b455d36ef73c -r c6a387636aa5 jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/XSLTFunctionsTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/XSLTFunctionsTest.java Fri May 22 09:50:33 2015 +0200
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.xml.transform;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import static org.testng.Assert.assertEquals;
+
+/*
+ * @summary This class contains tests for XSLT functions.
+ */
+
+public class XSLTFunctionsTest {
+
+ /**
+ * @bug 8062518
+ * Verifies that a reference to the DTM created by XSLT document function is
+ * actually read from the DTM by an extension function.
+ * @param xml Content of xml file to process
+ * @param xsl stylesheet content that loads external document {@code externalDoc}
+ * with XSLT 'document' function and then reads it with
+ * DocumentExtFunc.test() function
+ * @param externalDoc Content of the external xml document
+ * @param expectedResult Expected transformation result
+ **/
+ @Test(dataProvider = "document")
+ public void testDocument(final String xml, final String xsl,
+ final String externalDoc, final String expectedResult) throws Exception {
+ // Prepare sources for transormation
+ Source src = new StreamSource(new StringReader(xml));
+ Source xslsrc = new StreamSource(new StringReader(xsl));
+
+ // Create factory and transformer
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Transformer t = tf.newTransformer( xslsrc );
+ t.setErrorListener(tf.getErrorListener());
+
+ // Set URI Resolver to return the newly constructed xml
+ // stream source object from xml test string
+ t.setURIResolver(new URIResolver() {
+ @Override
+ public Source resolve(String href, String base)
+ throws TransformerException {
+ if (href.contains("externalDoc")) {
+ return new StreamSource(new StringReader(externalDoc));
+ } else {
+ return new StreamSource(new StringReader(xml));
+ }
+ }
+ });
+
+ // Prepare output stream
+ StringWriter xmlResultString = new StringWriter();
+ StreamResult xmlResultStream = new StreamResult(xmlResultString);
+
+ //Transform the xml
+ t.transform(src, xmlResultStream);
+
+ // If the document can't be accessed and the bug is in place then
+ // reported exception will be thrown during transformation
+ System.out.println("Transformation result:"+xmlResultString.toString().trim());
+
+ // Check the result - it should contain two (node name, node values) entries -
+ // one for original document, another for a document created with
+ // call to 'document' function
+ assertEquals(xmlResultString.toString().trim(), expectedResult);
+ }
+
+ @DataProvider(name = "document")
+ public static Object[][] documentTestData() {
+ return new Object[][] {
+ {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult},
+ };
+ }
+
+ static final String documentTestXml = "Doc";
+
+ static final String documentTestExternalDoc = "External Doc";
+
+ static final String documentTestXsl = ""
+ + ""
+ + ""
+ + ""
+ + ""
+ + ""
+ + ""
+ + ""
+ + ""
+ + "";
+
+ static final String documentTesteExpectedResult = ""
+ + "[Test:Doc][Test:External Doc]";
+}
diff -r b455d36ef73c -r c6a387636aa5 jaxws/.hgtags
--- a/jaxws/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/jaxws/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -309,3 +309,4 @@
77f44848c44c003205490bf5ab88035233b65418 jdk9-b61
cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62
b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63
+df100399ed27d0eaa57c137ca99819a0fee66178 jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 jdk/.hgtags
--- a/jdk/.hgtags Thu May 21 18:23:01 2015 +0300
+++ b/jdk/.hgtags Fri May 22 09:50:33 2015 +0200
@@ -306,3 +306,4 @@
da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62
fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63
+7de8d036ad0980d988d1b9b4b4e6be555d9fbf98 jdk9-b64
diff -r b455d36ef73c -r c6a387636aa5 jdk/make/CompileDemos.gmk
--- a/jdk/make/CompileDemos.gmk Thu May 21 18:23:01 2015 +0300
+++ b/jdk/make/CompileDemos.gmk Fri May 22 09:50:33 2015 +0200
@@ -30,6 +30,7 @@
include JavaCompilation.gmk
include NativeCompilation.gmk
include SetupJavaCompilers.gmk
+include TextFileProcessing.gmk
# Prepare the find cache.
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
@@ -49,6 +50,15 @@
##################################################################################################
+# This rule will be depended on due to the MANIFEST line
+$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
+ SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
+ OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
+ REPLACEMENTS := \
+ @@RELEASE@@ => $(RELEASE) ; \
+ @@COMPANY_NAME@@ => $(COMPANY_NAME) , \
+))
+
define SetupAppletDemo
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
SETUP := GENERATE_USINGJDKBYTECODE, \
@@ -122,7 +132,7 @@
COPY := $(PATTERNS_TO_COPY) $(10), \
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
JARMAIN := $4, \
- MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
+ MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
EXTRA_MANIFEST_ATTR := $(11), \
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
EXCLUDE_FILES := $9, \
@@ -290,7 +300,7 @@
COPY := $(PATTERNS_TO_COPY), \
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
- MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
+ MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf))
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
endif
@@ -382,7 +392,7 @@
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
- MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
+ MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
COPY := README.txt Poller.c, \
JARMAIN := Client))
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/demo/share/applets.html
--- a/jdk/src/demo/share/applets.html Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/demo/share/applets.html Fri May 22 09:50:33 2015 +0200
@@ -56,8 +56,7 @@
The
-JavaTM Virtual Machine Tools Interface (JVM TI)
+Java™ Virtual Machine Tools Interface (JVM TI)
is a native tool interface provided in JDK 5.0 and newer.
Native libraries that use JVM TI and are loaded into the
Java Virtual Machine
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/lang/Boolean.java
--- a/jdk/src/java.base/share/classes/java/lang/Boolean.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/lang/Boolean.java Fri May 22 09:50:33 2015 +0200
@@ -230,13 +230,12 @@
}
/**
- * Returns {@code true} if and only if the system property
- * named by the argument exists and is equal to the string
- * {@code "true"}. (Beginning with version 1.0.2 of the
- * JavaTM platform, the test of
- * this string is case insensitive.) A system property is accessible
- * through {@code getProperty}, a method defined by the
- * {@code System} class.
+ * Returns {@code true} if and only if the system property named
+ * by the argument exists and is equal to the string {@code
+ * "true"}. (Beginning with version 1.0.2 of the Java™
+ * platform, the test of this string is case insensitive.) A
+ * system property is accessible through {@code getProperty}, a
+ * method defined by the {@code System} class.
*
* If there is no property with the specified name, or if the specified
* name is empty or null, then {@code false} is returned.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/lang/Character.java
--- a/jdk/src/java.base/share/classes/java/lang/Character.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/lang/Character.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -645,8 +645,14 @@
* @since 1.2
*/
public static final class UnicodeBlock extends Subset {
-
- private static Map map = new HashMap<>(256);
+ /**
+ * 510 - the expected number of enteties
+ * 0.75 - the default load factor of HashMap
+ */
+ private static final int INITIAL_CAPACITY =
+ (int)(510 / 0.75f + 1.0f);
+ private static Map map =
+ new HashMap<>(INITIAL_CAPACITY);
/**
* Creates a UnicodeBlock with the given identifier name.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/lang/Long.java
--- a/jdk/src/java.base/share/classes/java/lang/Long.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/lang/Long.java Fri May 22 09:50:33 2015 +0200
@@ -1708,7 +1708,7 @@
* @since 1.5
*/
public static int bitCount(long i) {
- // HD, Figure 5-14
+ // HD, Figure 5-2
i = i - ((i >>> 1) & 0x5555555555555555L);
i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/lang/String.java
--- a/jdk/src/java.base/share/classes/java/lang/String.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/lang/String.java Fri May 22 09:50:33 2015 +0200
@@ -179,7 +179,7 @@
* not affect the newly created string.
*
* @param value
- * Array that is the source of characters
+ * Array that is the source of characters
*
* @param offset
* The initial offset
@@ -208,7 +208,7 @@
if (offset > value.length - count) {
throw new StringIndexOutOfBoundsException(offset + count);
}
- this.value = Arrays.copyOfRange(value, offset, offset+count);
+ this.value = Arrays.copyOfRange(value, offset, offset + count);
}
/**
@@ -262,11 +262,11 @@
// Pass 1: Compute precise size of char[]
int n = count;
for (int i = offset; i < end; i++) {
- int c = codePoints[i];
- if (Character.isBmpCodePoint(c))
- continue;
- else if (Character.isValidCodePoint(c))
- n++;
+ int c = codePoints[i];
+ if (Character.isBmpCodePoint(c))
+ continue;
+ else if (Character.isValidCodePoint(c))
+ n++;
else throw new IllegalArgumentException(Integer.toString(c));
}
@@ -327,7 +327,7 @@
@Deprecated
public String(byte ascii[], int hibyte, int offset, int count) {
checkBounds(ascii, offset, count);
- char value[] = new char[count];
+ char[] value = new char[count];
if (hibyte == 0) {
for (int i = count; i-- > 0;) {
@@ -465,7 +465,7 @@
if (charset == null)
throw new NullPointerException("charset");
checkBounds(bytes, offset, length);
- this.value = StringCoding.decode(charset, bytes, offset, length);
+ this.value = StringCoding.decode(charset, bytes, offset, length);
}
/**
@@ -567,7 +567,7 @@
*
* @since 1.1
*/
- public String(byte bytes[]) {
+ public String(byte[] bytes) {
this(bytes, 0, bytes.length);
}
@@ -983,11 +983,10 @@
return true;
}
if (anObject instanceof String) {
- String anotherString = (String)anObject;
- int n = value.length;
- if (n == anotherString.value.length) {
- char v1[] = value;
- char v2[] = anotherString.value;
+ char[] v1 = value;
+ char[] v2 = ((String)anObject).value;
+ int n = v1.length;
+ if (n == v2.length) {
int i = 0;
while (n-- != 0) {
if (v1[i] != v2[i])
@@ -1020,8 +1019,8 @@
}
private boolean nonSyncContentEquals(AbstractStringBuilder sb) {
- char v1[] = value;
- char v2[] = sb.getValue();
+ char[] v1 = value;
+ char[] v2 = sb.getValue();
int n = v1.length;
if (n != sb.length()) {
return false;
@@ -1066,7 +1065,7 @@
return equals(cs);
}
// Argument is a generic CharSequence
- char v1[] = value;
+ char[] v1 = value;
int n = v1.length;
if (n != cs.length()) {
return false;
@@ -1156,20 +1155,18 @@
* lexicographically greater than the string argument.
*/
public int compareTo(String anotherString) {
- int len1 = value.length;
- int len2 = anotherString.value.length;
+ char[] v1 = value;
+ char[] v2 = anotherString.value;
+ int len1 = v1.length;
+ int len2 = v2.length;
int lim = Math.min(len1, len2);
- char v1[] = value;
- char v2[] = anotherString.value;
- int k = 0;
- while (k < lim) {
+ for (int k = 0; k < lim; k++) {
char c1 = v1[k];
char c2 = v2[k];
if (c1 != c2) {
return c1 - c2;
}
- k++;
}
return len1 - len2;
}
@@ -1278,14 +1275,14 @@
*/
public boolean regionMatches(int toffset, String other, int ooffset,
int len) {
- char ta[] = value;
+ char[] ta = value;
int to = toffset;
- char pa[] = other.value;
+ char[] pa = other.value;
int po = ooffset;
// Note: toffset, ooffset, or len might be near -1>>>1.
if ((ooffset < 0) || (toffset < 0)
- || (toffset > (long)value.length - len)
- || (ooffset > (long)other.value.length - len)) {
+ || (toffset > (long)ta.length - len)
+ || (ooffset > (long)pa.length - len)) {
return false;
}
while (len-- > 0) {
@@ -1348,14 +1345,14 @@
*/
public boolean regionMatches(boolean ignoreCase, int toffset,
String other, int ooffset, int len) {
- char ta[] = value;
+ char[] ta = value;
int to = toffset;
- char pa[] = other.value;
+ char[] pa = other.value;
int po = ooffset;
// Note: toffset, ooffset, or len might be near -1>>>1.
if ((ooffset < 0) || (toffset < 0)
- || (toffset > (long)value.length - len)
- || (ooffset > (long)other.value.length - len)) {
+ || (toffset > (long)ta.length - len)
+ || (ooffset > (long)pa.length - len)) {
return false;
}
while (len-- > 0) {
@@ -1405,13 +1402,13 @@
*
*/
public boolean startsWith(String prefix, int toffset) {
- char ta[] = value;
+ char[] ta = value;
int to = toffset;
- char pa[] = prefix.value;
+ char[] pa = prefix.value;
int po = 0;
- int pc = prefix.value.length;
+ int pc = pa.length;
// Note: toffset might be near -1>>>1.
- if ((toffset < 0) || (toffset > value.length - pc)) {
+ if ((toffset < 0) || (toffset > ta.length - pc)) {
return false;
}
while (--pc >= 0) {
@@ -1473,7 +1470,9 @@
for (char v : value) {
h = 31 * h + v;
}
- hash = h;
+ if (h != 0) {
+ hash = h;
+ }
}
return h;
}
@@ -1928,14 +1927,17 @@
* length of this {@code String} object.
*/
public String substring(int beginIndex) {
- if (beginIndex < 0) {
- throw new StringIndexOutOfBoundsException(beginIndex);
+ if (beginIndex <= 0) {
+ if (beginIndex < 0) {
+ throw new StringIndexOutOfBoundsException(beginIndex);
+ }
+ return this;
}
int subLen = value.length - beginIndex;
if (subLen < 0) {
throw new StringIndexOutOfBoundsException(subLen);
}
- return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
+ return new String(value, beginIndex, subLen);
}
/**
@@ -1961,8 +1963,13 @@
* {@code endIndex}.
*/
public String substring(int beginIndex, int endIndex) {
- if (beginIndex < 0) {
- throw new StringIndexOutOfBoundsException(beginIndex);
+ if (beginIndex <= 0) {
+ if (beginIndex < 0) {
+ throw new StringIndexOutOfBoundsException(beginIndex);
+ }
+ if (endIndex == value.length) {
+ return this;
+ }
}
if (endIndex > value.length) {
throw new StringIndexOutOfBoundsException(endIndex);
@@ -1971,8 +1978,7 @@
if (subLen < 0) {
throw new StringIndexOutOfBoundsException(subLen);
}
- return ((beginIndex == 0) && (endIndex == value.length)) ? this
- : new String(value, beginIndex, subLen);
+ return new String(value, beginIndex, subLen);
}
/**
@@ -2034,7 +2040,7 @@
return this;
}
int len = value.length;
- char buf[] = Arrays.copyOf(value, len + otherLen);
+ char[] buf = Arrays.copyOf(value, len + otherLen);
str.getChars(buf, len);
return new String(buf, true);
}
@@ -2070,9 +2076,9 @@
*/
public String replace(char oldChar, char newChar) {
if (oldChar != newChar) {
- int len = value.length;
+ char[] val = value; /* avoid getfield opcode */
+ int len = val.length;
int i = -1;
- char[] val = value; /* avoid getfield opcode */
while (++i < len) {
if (val[i] == oldChar) {
@@ -2080,7 +2086,7 @@
}
}
if (i < len) {
- char buf[] = new char[len];
+ char[] buf = new char[len];
for (int j = 0; j < i; j++) {
buf[j] = val[j];
}
@@ -2876,17 +2882,17 @@
* trailing white space.
*/
public String trim() {
- int len = value.length;
- int st = 0;
char[] val = value; /* avoid getfield opcode */
+ int end = val.length;
+ int beg = 0;
- while ((st < len) && (val[st] <= ' ')) {
- st++;
+ while ((beg < end) && (val[beg] <= ' ')) {
+ beg++;
}
- while ((st < len) && (val[len - 1] <= ' ')) {
- len--;
+ while ((beg < end) && (val[end - 1] <= ' ')) {
+ end--;
}
- return ((st > 0) || (len < value.length)) ? substring(st, len) : this;
+ return substring(beg, end);
}
/**
@@ -3081,7 +3087,7 @@
*/
public char[] toCharArray() {
// Cannot use Arrays.copyOf because of class initialization order issues
- char result[] = new char[value.length];
+ char[] result = new char[value.length];
System.arraycopy(value, 0, result, 0, value.length);
return result;
}
@@ -3266,8 +3272,7 @@
* as its single character the argument {@code c}.
*/
public static String valueOf(char c) {
- char data[] = {c};
- return new String(data, true);
+ return new String(new char[]{c}, true);
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java Fri May 22 09:50:33 2015 +0200
@@ -25,23 +25,24 @@
package java.security;
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import sun.misc.JavaSecurityAccess;
import sun.misc.JavaSecurityProtectionDomainAccess;
import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
+import sun.misc.SharedSecrets;
import sun.security.util.Debug;
import sun.security.util.SecurityConstants;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.SharedSecrets;
/**
- *
- *
- * This ProtectionDomain class encapsulates the characteristics of a domain,
+ * The ProtectionDomain class encapsulates the characteristics of a domain,
* which encloses a set of classes whose instances are granted a set
* of permissions when being executed on behalf of a given set of Principals.
*
@@ -58,6 +59,7 @@
*/
public class ProtectionDomain {
+
private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
private JavaSecurityAccessImpl() {
@@ -86,18 +88,33 @@
AccessController.getContext(), context);
}
- private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
- AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
+ private static AccessControlContext getCombinedACC(
+ AccessControlContext context, AccessControlContext stack) {
+ AccessControlContext acc =
+ new AccessControlContext(context, stack.getCombiner(), true);
return new AccessControlContext(stack.getContext(), acc).optimize();
}
}
static {
- // Set up JavaSecurityAccess in SharedSecrets
+ // setup SharedSecrets to allow access to doIntersectionPrivilege
+ // methods and ProtectionDomain cache
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
+ SharedSecrets.setJavaSecurityProtectionDomainAccess(
+ new JavaSecurityProtectionDomainAccess() {
+ @Override
+ public ProtectionDomainCache getProtectionDomainCache() {
+ return new PDCache();
+ }
+ });
}
+ /**
+ * Used for storing ProtectionDomains as keys in a Map.
+ */
+ static final class Key {}
+
/* CodeSource */
private CodeSource codesource ;
@@ -451,40 +468,104 @@
}
/**
- * Used for storing ProtectionDomains as keys in a Map.
+ * A cache of ProtectionDomains and their Permissions.
+ *
+ * This class stores ProtectionDomains as weak keys in a ConcurrentHashMap
+ * with additional support for checking and removing weak keys that are no
+ * longer in use.
*/
- final static class Key {}
-
- // A cache of ProtectionDomains and their Permissions
private static class PDCache implements ProtectionDomainCache {
- // We must wrap the PermissionCollection in a WeakReference as there
- // are some PermissionCollections which contain strong references
- // back to a ProtectionDomain and otherwise would never be removed
- // from the WeakHashMap
- private final Map>
- map = new WeakHashMap<>();
+ private final ConcurrentHashMap
+ pdMap = new ConcurrentHashMap<>();
+ private final ReferenceQueue queue = new ReferenceQueue<>();
@Override
- public synchronized void put(ProtectionDomain pd,
- PermissionCollection pc) {
- map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
+ public void put(ProtectionDomain pd, PermissionCollection pc) {
+ processQueue(queue, pdMap);
+ WeakProtectionDomainKey weakPd =
+ new WeakProtectionDomainKey(pd, queue);
+ pdMap.putIfAbsent(weakPd, pc);
}
@Override
- public synchronized PermissionCollection get(ProtectionDomain pd) {
- WeakReference ref =
- map.get(pd == null ? null : pd.key);
- return ref == null ? null : ref.get();
+ public PermissionCollection get(ProtectionDomain pd) {
+ processQueue(queue, pdMap);
+ WeakProtectionDomainKey weakPd =
+ new WeakProtectionDomainKey(pd, queue);
+ return pdMap.get(weakPd);
+ }
+
+ /**
+ * Removes weak keys from the map that have been enqueued
+ * on the reference queue and are no longer in use.
+ */
+ private static void processQueue(ReferenceQueue queue,
+ ConcurrentHashMap extends
+ WeakReference, ?> pdMap) {
+ Reference extends Key> ref;
+ while ((ref = queue.poll()) != null) {
+ pdMap.remove(ref);
+ }
}
}
- static {
- SharedSecrets.setJavaSecurityProtectionDomainAccess(
- new JavaSecurityProtectionDomainAccess() {
- @Override
- public ProtectionDomainCache getProtectionDomainCache() {
- return new PDCache();
- }
- });
+ /**
+ * A weak key for a ProtectionDomain.
+ */
+ private static class WeakProtectionDomainKey extends WeakReference {
+ /**
+ * Saved value of the referent's identity hash code, to maintain
+ * a consistent hash code after the referent has been cleared
+ */
+ private final int hash;
+
+ /**
+ * A key representing a null ProtectionDomain.
+ */
+ private static final Key NULL_KEY = new Key();
+
+ /**
+ * Create a new WeakProtectionDomain with the specified domain and
+ * registered with a queue.
+ */
+ WeakProtectionDomainKey(ProtectionDomain pd, ReferenceQueue rq) {
+ this((pd == null ? NULL_KEY : pd.key), rq);
+ }
+
+ private WeakProtectionDomainKey(Key key, ReferenceQueue rq) {
+ super(key, rq);
+ hash = key.hashCode();
+ }
+
+ /**
+ * Returns the identity hash code of the original referent.
+ */
+ @Override
+ public int hashCode() {
+ return hash;
+ }
+
+ /**
+ * Returns true if the given object is an identical
+ * WeakProtectionDomainKey instance, or, if this object's referent
+ * has not been cleared and the given object is another
+ * WeakProtectionDomainKey instance with an identical non-null
+ * referent as this one.
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (obj instanceof WeakProtectionDomainKey) {
+ Object referent = get();
+ return (referent != null) &&
+ (referent == ((WeakProtectionDomainKey)obj).get());
+ } else {
+ return false;
+ }
+ }
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java
--- a/jdk/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/security/cert/LDAPCertStoreParameters.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,12 @@
*
* This class is used to provide necessary configuration parameters (server
* name and port number) to implementations of the LDAP {@code CertStore}
- * algorithm.
+ * algorithm. However, if you are retrieving certificates or CRLs from
+ * an ldap URI as specified by RFC 5280, use the
+ * {@link java.security.cert.URICertStoreParameters URICertStoreParameters}
+ * instead as the URI may contain additional information such as the
+ * distinguished name that will help the LDAP CertStore find the specific
+ * certificates and CRLs.
*
* Concurrent Access
*
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java Fri May 22 09:50:33 2015 +0200
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.security.cert;
+
+import java.net.URI;
+
+/**
+ * Parameters used as input for {@code CertStore} algorithms which use
+ * information contained in a URI to retrieve certificates and CRLs.
+ *
+ * This class is used to provide necessary configuration parameters
+ * through a URI as defined in RFC 5280 to implementations of
+ * {@code CertStore} algorithms.
+ *
+ * Concurrent Access
+ *
+ * Unless otherwise specified, the methods defined in this class are not
+ * thread-safe. Multiple threads that need to access a single
+ * object concurrently should synchronize amongst themselves and
+ * provide the necessary locking. Multiple threads each manipulating
+ * separate objects need not synchronize.
+ *
+ * @since 1.9
+ * @see CertStore
+ * @see java.net.URI
+ */
+public final class URICertStoreParameters implements CertStoreParameters {
+
+ /**
+ * The uri, cannot be null
+ */
+ private final URI uri;
+
+ /*
+ * Hash code for this parameters.
+ */
+ private int myhash = -1;
+
+ /**
+ * Creates an instance of {@code URICertStoreParameters} with the
+ * specified URI.
+ *
+ * @param uri the URI which contains configuration information.
+ * @throws NullPointerException if {@code uri} is null
+ */
+ public URICertStoreParameters(URI uri) {
+ if (uri == null) {
+ throw new NullPointerException();
+ }
+ this.uri = uri;
+ }
+
+ /**
+ * Returns the URI used to construct this
+ * {@code URICertStoreParameters} object.
+ *
+ * @return the URI.
+ */
+ public URI getURI() {
+ return uri;
+ }
+
+ /**
+ * Returns a copy of this object. Changes to the copy will not affect
+ * the original and vice versa.
+ *
+ * @return the copy
+ */
+ @Override
+ public URICertStoreParameters clone() {
+ try {
+ return new URICertStoreParameters(uri);
+ } catch (NullPointerException e) {
+ /* Cannot happen */
+ throw new InternalError(e.toString(), e);
+ }
+ }
+
+ /**
+ * Returns a hash code value for this parameters object.
+ * The hash code is generated using the URI supplied at construction.
+ *
+ * @return a hash code value for this parameters.
+ */
+ @Override
+ public int hashCode() {
+ if (myhash == -1) {
+ myhash = uri.hashCode()*7;
+ }
+ return myhash;
+ }
+
+ /**
+ * Compares the specified object with this parameters object for equality.
+ * Two URICertStoreParameters are considered equal if the URIs used
+ * to construct them are equal.
+ *
+ * @param p the object to test for equality with this parameters.
+ *
+ * @return true if the specified object is equal to this parameters object.
+ */
+ @Override
+ public boolean equals(Object p) {
+ if (p == null || (!(p instanceof URICertStoreParameters))) {
+ return false;
+ }
+
+ if (p == this) {
+ return true;
+ }
+
+ URICertStoreParameters other = (URICertStoreParameters)p;
+ return uri.equals(other.getURI());
+ }
+
+ /**
+ * Returns a formatted string describing the parameters
+ * including the URI used to construct this object.
+ *
+ * @return a formatted string describing the parameters
+ */
+ @Override
+ public String toString() {
+ return "URICertStoreParameters: " + uri.toString();
+ }
+}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/text/ChoiceFormat.java
--- a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java Fri May 22 09:50:33 2015 +0200
@@ -490,7 +490,7 @@
}
/**
- * Equality comparision between two
+ * Equality comparison between two
*/
public boolean equals(Object obj) {
if (obj == null) return false;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java
--- a/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java Fri May 22 09:50:33 2015 +0200
@@ -85,7 +85,7 @@
*
* 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
+ * double and int versions differ from long version solely by
* replacing "long" (with case-matching)).
*/
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/Calendar.java
--- a/jdk/src/java.base/share/classes/java/util/Calendar.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/Calendar.java Fri May 22 09:50:33 2015 +0200
@@ -1172,7 +1172,7 @@
* {@code fieldValuePairs} that are pairs of a field and its value.
* For example,
*
* is equivalent to the sequence of the following
@@ -1298,7 +1298,7 @@
/**
* Sets the time zone parameter to the given {@code zone}. If no time
- * zone parameter is given to this {@code Caledar.Builder}, the
+ * zone parameter is given to this {@code Calendar.Builder}, the
* {@linkplain TimeZone#getDefault() default
* TimeZone} will be used in the {@link #build() build}
* method.
@@ -3316,7 +3316,7 @@
* @param field the calendar field
* @return the calendar field name
* @exception IndexOutOfBoundsException if field is negative,
- * equal to or greater then FIELD_COUNT.
+ * equal to or greater than {@code FIELD_COUNT}.
*/
static String getFieldName(int field) {
return FIELD_NAME[field];
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/Collection.java
--- a/jdk/src/java.base/share/classes/java/util/Collection.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/Collection.java Fri May 22 09:50:33 2015 +0200
@@ -537,7 +537,7 @@
* @implSpec
* The default implementation creates a
* late-binding spliterator
- * from the collections's {@code Iterator}. The spliterator inherits the
+ * from the collection's {@code Iterator}. The spliterator inherits the
* fail-fast properties of the collection's iterator.
*
* The created {@code Spliterator} reports {@link Spliterator#SIZED}.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/Locale.java
--- a/jdk/src/java.base/share/classes/java/util/Locale.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/Locale.java Fri May 22 09:50:33 2015 +0200
@@ -719,7 +719,7 @@
* created and cached.
*
* @param language lowercase 2 to 8 language code.
- * @param country uppercase two-letter ISO-3166 code and numric-3 UN M.49 area code.
+ * @param country uppercase two-letter ISO-3166 code and numeric-3 UN M.49 area code.
* @param variant vendor and browser specific code. See class description.
* @return the Locale instance requested
* @exception NullPointerException if any argument is null.
@@ -1236,7 +1236,7 @@
/**
* Package private method returning the Locale's LocaleExtensions,
* used by ResourceBundle.
- * @return locale exnteions of this Locale,
+ * @return locale extensions of this Locale,
* or {@code null} if no extensions are defined
*/
LocaleExtensions getLocaleExtensions() {
@@ -2609,7 +2609,7 @@
* href="./Locale.html#def_locale_extension">well-formed or an exception
* is thrown.
*
- *
Attribute comparision for removal is case-insensitive.
+ *
Attribute comparison for removal is case-insensitive.
*
* @param attribute the attribute
* @return This builder.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/TimeZone.java
--- a/jdk/src/java.base/share/classes/java/util/TimeZone.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/TimeZone.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -293,6 +293,7 @@
throw new NullPointerException();
}
this.ID = ID;
+ this.zoneId = null; // invalidate cache
}
/**
@@ -544,7 +545,23 @@
* @since 1.8
*/
public ZoneId toZoneId() {
+ ZoneId zId = zoneId;
+ if (zId == null) {
+ zoneId = zId = toZoneId0();
+ }
+ return zId;
+ }
+
+ private ZoneId toZoneId0() {
String id = getID();
+ TimeZone defaultZone = defaultTimeZone;
+ // are we not defaultTimeZone but our id is equal to default's?
+ if (defaultZone != this &&
+ defaultZone != null && id.equals(defaultZone.getID())) {
+ // delegate to default TZ which is effectively immutable
+ return defaultZone.toZoneId();
+ }
+ // derive it ourselves
if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
if ("EST".equals(id))
return ZoneId.of("America/New_York");
@@ -710,7 +727,12 @@
sm.checkPermission(new PropertyPermission
("user.timezone", "write"));
}
- defaultTimeZone = zone;
+ // by saving a defensive clone and returning a clone in getDefault() too,
+ // the defaultTimeZone instance is isolated from user code which makes it
+ // effectively immutable. This is important to avoid races when the
+ // following is evaluated in ZoneId.systemDefault():
+ // TimeZone.getDefault().toZoneId().
+ defaultTimeZone = (zone == null) ? null : (TimeZone) zone.clone();
}
/**
@@ -735,9 +757,7 @@
public Object clone()
{
try {
- TimeZone other = (TimeZone) super.clone();
- other.ID = ID;
- return other;
+ return super.clone();
} catch (CloneNotSupportedException e) {
throw new InternalError(e);
}
@@ -759,6 +779,12 @@
* @serial
*/
private String ID;
+
+ /**
+ * Cached {@link ZoneId} for this TimeZone
+ */
+ private transient ZoneId zoneId;
+
private static volatile TimeZone defaultTimeZone;
static final String GMT_ID = "GMT";
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/TreeMap.java
--- a/jdk/src/java.base/share/classes/java/util/TreeMap.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/TreeMap.java Fri May 22 09:50:33 2015 +0200
@@ -859,7 +859,7 @@
* Returns a {@link Set} view of the mappings contained in this map.
*
*
The set's iterator returns the entries in ascending key order. The
- * sets's spliterator is
+ * set's spliterator is
* late-binding,
* fail-fast, and additionally reports {@link Spliterator#SORTED} and
* {@link Spliterator#ORDERED} with an encounter order that is ascending key
@@ -2643,7 +2643,7 @@
* child, also serving as origin for the split-off spliterator.
* Left-hands are symmetric. Descending versions place the origin
* at the end and invert ascending split rules. This base class
- * is non-commital about directionality, or whether the top-level
+ * is non-committal about directionality, or whether the top-level
* spliterator covers the whole tree. This means that the actual
* split mechanics are located in subclasses. Some of the subclass
* trySplit methods are identical (except for return types), but
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java Fri May 22 09:50:33 2015 +0200
@@ -481,7 +481,7 @@
*
* Maintaining API and serialization compatibility with previous
* versions of this class introduces several oddities. Mainly: We
- * leave untouched but unused constructor arguments refering to
+ * leave untouched but unused constructor arguments referring to
* concurrencyLevel. We accept a loadFactor constructor argument,
* but apply it only to initial table capacity (which is the only
* time that we can guarantee to honor it.) We also declare an
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Fri May 22 09:50:33 2015 +0200
@@ -2710,7 +2710,7 @@
}
/**
- * Returns lowest absolute key (ignoring directonality).
+ * Returns lowest absolute key (ignoring directionality).
*/
K lowestKey() {
Comparator super K> cmp = m.comparator;
@@ -2722,7 +2722,7 @@
}
/**
- * Returns highest absolute key (ignoring directonality).
+ * Returns highest absolute key (ignoring directionality).
*/
K highestKey() {
Comparator super K> cmp = m.comparator;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
--- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java Fri May 22 09:50:33 2015 +0200
@@ -1328,13 +1328,16 @@
/**
* Number of times to spin-wait before blocking. The spins (in
* awaitRunStateLock and awaitWork) currently use randomized
- * spins. If/when MWAIT-like intrinsics becomes available, they
- * may allow quieter spinning. The value of SPINS must be a power
- * of two, at least 4. The current value causes spinning for a
- * small fraction of typical context-switch times, well worthwhile
- * given the typical likelihoods that blocking is not necessary.
+ * spins. Currently set to zero to reduce CPU usage.
+ *
+ * If greater than zero the value of SPINS must be a power
+ * of two, at least 4. A value of 2048 causes spinning for a
+ * small fraction of typical context-switch times.
+ *
+ * If/when MWAIT-like intrinsics becomes available, they
+ * may allow quieter spinning.
*/
- private static final int SPINS = 1 << 11;
+ private static final int SPINS = 0;
/**
* Increment for seed generators. See class ThreadLocal for
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html
--- a/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html Fri May 22 09:50:33 2015 +0200
@@ -47,8 +47,7 @@
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java Fri May 22 09:50:33 2015 +0200
@@ -145,12 +145,12 @@
/**
* ASCII character type array.
*
- * This array maps an ASCII (7 bit) character to the character type.
- * Possible character type values are: - ' ' for any kind of white
- * space character; - 'a' for any lower case alphabetical character
- * value; - 'A' for any upper case alphabetical character value;
- * - 'd' for any decimal digit character value; - 'z' for any
- * character less then ' ' except '\t', '\n', '\r'; An ASCII (7 bit)
+ * This array maps an ASCII (7 bit) character to the character type.
+ * Possible character type values are: - ' ' for any kind of white
+ * space character; - 'a' for any lower case alphabetical character
+ * value; - 'A' for any upper case alphabetical character value;
+ * - 'd' for any decimal digit character value; - 'z' for any
+ * character less than ' ' except '\t', '\n', '\r'; An ASCII (7 bit)
* character which does not fall in any category listed above is mapped to
* it self.
*/
@@ -158,11 +158,11 @@
/**
* NMTOKEN character type array.
*
- * This array maps an ASCII (7 bit) character to the character type.
- * Possible character type values are: - 0 for underscore ('_') or any
- * lower and upper case alphabetical character value; - 1 for colon
- * (':') character; - 2 for dash ('-') and dot ('.') or any decimal
- * digit character value; - 3 for any kind of white space character
+ * Possible character type values are: - 0 for underscore ('_') or any
+ * lower and upper case alphabetical character value; - 1 for colon
+ * (':') character; - 2 for dash ('-') and dot ('.') or any decimal
+ * digit character value; - 3 for any kind of white space character An ASCII (7 bit) character which does not fall in any category listed
* above is mapped to 0xff.
*/
@@ -1841,10 +1841,12 @@
/**
* Reads an attribute value.
*
- * The grammar which this method can read is:
- * eqstr := S "=" qstr
- * qstr := S ("'" string "'") |
- * ('"' string '"') This method resolves entities
+ * The grammar this method can read is:
+ *
+ * This method resolves entities
* inside a string unless the parser parses DTD.
*
* @param flag The '=' character forces the method to accept the '='
@@ -2633,7 +2635,7 @@
* Reports characters and empties the parser's buffer. This method is called
* only if parser is going to return control to the main loop. This means
* that this method may use parser buffer to report white space without
- * copeing characters to temporary buffer.
+ * copying characters to temporary buffer.
*/
protected abstract void bflash()
throws Exception;
@@ -2642,7 +2644,7 @@
* Reports white space characters and empties the parser's buffer. This
* method is called only if parser is going to return control to the main
* loop. This means that this method may use parser buffer to report white
- * space without copeing characters to temporary buffer.
+ * space without copying characters to temporary buffer.
*/
protected abstract void bflash_ws()
throws Exception;
@@ -3290,16 +3292,20 @@
}
/**
- * Maps a character to it's type.
+ * Maps a character to its type.
*
- * Possible character type values are: - ' ' for any kind of white
- * space character; - 'a' for any lower case alphabetical character
- * value; - 'A' for any upper case alphabetical character value;
- * - 'd' for any decimal digit character value; - 'z' for any
- * character less then ' ' except '\t', '\n', '\r'; - 'X' for any not
- * ASCII character; - 'Z' for EOS character. An ASCII (7 bit)
- * character which does not fall in any category listed above is mapped to
- * it self.
+ * Possible character type values are:
+ *
+ *
' ' - for any kind of whitespace character;
+ *
'a' - for any lower case alphabetical character value;
+ *
'A' - for any upper case alphabetical character value;
+ *
'd' - for any decimal digit character value;
+ *
'z' - for any character less than ' ' except '\t', '\n', '\r';
+ *
'X' - for any not ASCII character;
+ *
'Z' - for EOS character.
+ *
+ * An ASCII (7 bit) character which does not fall in any category
+ * listed above is mapped to itself.
*
* @param ch The character to map.
* @return The type of character.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java
--- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java Fri May 22 09:50:33 2015 +0200
@@ -649,7 +649,7 @@
* Reports characters and empties the parser's buffer. This method is called
* only if parser is going to return control to the main loop. This means
* that this method may use parser buffer to report white space without
- * copeing characters to temporary buffer.
+ * copying characters to temporary buffer.
*/
protected void bflash() throws SAXException {
if (mBuffIdx >= 0) {
@@ -663,7 +663,7 @@
* Reports white space characters and empties the parser's buffer. This
* method is called only if parser is going to return control to the main
* loop. This means that this method may use parser buffer to report white
- * space without copeing characters to temporary buffer.
+ * space without copying characters to temporary buffer.
*/
protected void bflash_ws() throws SAXException {
if (mBuffIdx >= 0) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/Cache.java
--- a/jdk/src/java.base/share/classes/sun/misc/Cache.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/Cache.java Fri May 22 09:50:33 2015 +0200
@@ -196,8 +196,8 @@
/**
* Gets the object associated with the specified key in the Cache.
* @param key the key in the hash table
- * @returns the element for the key or null if the key
- * is not defined in the hash table.
+ * @return the element for the key or null if the key
+ * is not defined in the hash table.
* @see Cache#put
*/
public synchronized Object get(Object key) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java
--- a/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java Fri May 22 09:50:33 2015 +0200
@@ -120,7 +120,7 @@
/**
* This method does an actual decode. It takes the decoded bytes and
* writes them to the OutputStream. The integer l tells the
- * method how many bytes are required. This is always <= bytesPerAtom().
+ * method how many bytes are required. This is always {@literal <=} bytesPerAtom().
*/
protected void decodeAtom(PushbackInputStream aStream, OutputStream bStream, int l) throws IOException {
throw new CEStreamExhausted();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java
--- a/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java Fri May 22 09:50:33 2015 +0200
@@ -68,7 +68,7 @@
* referenced in the See Also list below.
*
* @author Chuck McManis
- * @see CharacterDecoder;
+ * @see CharacterDecoder
* @see UCEncoder
* @see UUEncoder
* @see BASE64Encoder
@@ -107,7 +107,7 @@
/**
* Encode the suffix that ends every output line. By default
- * this method just prints a into the output stream.
+ * this method just prints a newline into the output stream.
*/
protected void encodeLineSuffix(OutputStream aStream) throws IOException {
pStream.println();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/ConditionLock.java
--- a/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java Fri May 22 09:50:33 2015 +0200
@@ -34,7 +34,7 @@
* with the lock() and unlock() methods. However if there is a thread
* waiting for the state variable to become a particular value and you
* simply call Unlock(), that thread will not be able to acquire the
- * lock until the state variable equals its desired value.
+ * lock until the state variable equals its desired value.
*
* @author Peter King
*/
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java
--- a/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java Fri May 22 09:50:33 2015 +0200
@@ -45,26 +45,26 @@
import sun.net.www.ParseUtil;
/**
- *
* This class checks dependent extensions a particular jar file may have
* declared through its manifest attributes.
- *
+ *
* Jar file declared dependent extensions through the extension-list
* attribute. The extension-list contains a list of keys used to
* fetch the other attributes describing the required extension.
* If key is the extension key declared in the extension-list
* attribute, the following describing attribute can be found in
- * the manifest :
- * key-Extension-Name: (Specification package name)
- * key-Specification-Version: (Specification-Version)
- * key-Implementation-Version: (Implementation-Version)
- * key-Implementation-Vendor-Id: (Imlementation-Vendor-Id)
- * key-Implementation-Version: (Implementation version)
- * key-Implementation-URL: (URL to download the requested extension)
+ * the manifest:
+ *
* Checks the dependencies of the jar file on installed extension.
- *
- * @param jarFile containing the attriutes declaring the dependencies
+ *
+ * @param jar containing the attributes declaring the dependencies
*/
public static boolean checkExtensionsDependencies(JarFile jar)
{
@@ -182,9 +178,8 @@
/*
- *
* Check that a particular dependency on an extension is satisfied.
- *
+ *
* @param extensionName is the key used for the attributes in the manifest
* @param attr is the attributes of the manifest file
*
@@ -204,10 +199,9 @@
}
/*
- *
* Check if a particular extension is part of the currently installed
* extensions.
- *
+ *
* @param extensionName is the key for the attributes in the manifest
* @param attr is the attributes of the manifest
*
@@ -262,11 +256,9 @@
}
/*
- *
* Check if the requested extension described by the attributes
* in the manifest under the key extensionName is compatible with
* the jar file.
- *
*
* @param extensionName key in the attribute list
* @param attr manifest file attributes
@@ -337,10 +329,8 @@
}
/*
- *
* An required extension is missing, if an ExtensionInstallationProvider is
* registered, delegate the installation of that particular extension to it.
- *
*
* @param reqInfo Missing extension information
* @param instInfo Older installed version information
@@ -380,11 +370,9 @@
}
/**
- *
* Checks if the extension, that is specified in the extension-list in
* the applet jar manifest, is already installed (i.e. exists in the
* extension directory).
- *
*
* @param extensionName extension name in the extension-list
*
@@ -428,9 +416,7 @@
}
/**
- *
* @return the java.ext.dirs property as a list of directory
- *
* Add the newly installed jar file to the extension class loader.
- *
*
* @param cl the current installed extension class loader
*
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java
--- a/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java Fri May 22 09:50:33 2015 +0200
@@ -45,9 +45,7 @@
public class ExtensionInfo {
/**
- *
* public static values returned by the isCompatible method
- *
*/
public static final int COMPATIBLE = 0;
public static final int REQUIRE_SPECIFICATION_UPGRADE = 1;
@@ -56,10 +54,8 @@
public static final int INCOMPATIBLE = 4;
/**
- *
* attributes fully describer an extension. The underlying described
* extension may be installed and requested.
- *
*/
public String title;
public String name;
@@ -76,15 +72,12 @@
/**
- *
* Create a new uninitialized extension information object
- *
*/
public ExtensionInfo() {
}
/**
- *
* Create and initialize an extension information object.
* The initialization uses the attributes passed as being
* the content of a manifest file to load the extension
@@ -93,7 +86,7 @@
* extension they may depend on, the extension key parameter
* is prepanded to the attribute name to make the key used
* to retrieve the attribute from the manifest file
- *
+ *
* @param extensionKey unique extension key in the manifest
* @param attr Attributes of a manifest file
*/
@@ -149,13 +142,11 @@
}
/**
- *
* @return true if the extension described by this extension information
* is compatible with the extension described by the extension
* information passed as a parameter
- *
*
- * @param the requested extension information to compare to
+ * @param ei the requested extension information to compare to
*/
public int isCompatibleWith(ExtensionInfo ei) {
@@ -204,10 +195,8 @@
}
/**
- *
* helper method to print sensible information on the undelying described
* extension
- *
*/
public String toString() {
return "Extension : title(" + title + "), name(" + name + "), spec vendor(" +
@@ -217,15 +206,15 @@
}
/*
- *
* helper method to compare two versions.
* version are in the x.y.z.t pattern.
- *
+ *
* @param source version to compare to
* @param target version used to compare against
- * @return < 0 if source < version
- * > 0 if source > version
- * = 0 if source = version
+ * @return
{@code
+ * < 0 if source < version
+ * > 0 if source > version
+ * = 0 if source = version}
* helper method to compare two versions.
* version are in the x.y.z.t pattern.
- *
+ *
* @param source version to compare to
* @param target version used to compare against
- * @return < 0 if source < version
- * > 0 if source > version
- * = 0 if source = version
+ * @return
{@code
+ * < 0 if source < version
+ * > 0 if source > version
+ * = 0 if source = version}
*/
private int strictCompareExtensionVersion(String source, String target)
throws NumberFormatException
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java
--- a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java Fri May 22 09:50:33 2015 +0200
@@ -384,8 +384,8 @@
* 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.
+ * {@code (highestWord & 0xf0000000) == 0}, but the next bit should be 1
+ * {@code (highestWord & 0x08000000) != 0}.
*
* @return The normalization bias.
*/
@@ -546,9 +546,9 @@
* 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.
+ * as an integer, {@code 0 <= q < 10}.
*
- * @param The divisor of this FDBigInteger.
+ * @param S The divisor of this FDBigInteger.
* @return q = (int)(this / S).
*/
/*@
@@ -685,7 +685,7 @@
*
* @param p5 The exponent of the power-of-five factor.
* @param p2 The exponent of the power-of-two factor.
- * @return
+ * @return The multiplication result.
*/
/*@
@ requires this.value() == 0 || p5 == 0 && p2 == 0;
@@ -931,11 +931,11 @@
/**
* Compares the parameter with this FDBigInteger. Returns an
* integer accordingly as:
- *
- * >0: this > other
- * 0: this == other
- * <0: this < other
- *
+ *
{@code
+ * > 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
@@ -974,11 +974,11 @@
* Compares this FDBigInteger with
* 5p5 * 2p2.
* Returns an integer accordingly as:
- *
- * >0: this > other
- * 0: this == other
- * <0: this < other
- *
+ *
{@code
+ * > 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
@@ -1011,11 +1011,11 @@
/**
* Compares this FDBigInteger with x + y. Returns a
* value according to the comparison as:
- *
+ *
{@code
* -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.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java
--- a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java Fri May 22 09:50:33 2015 +0200
@@ -154,7 +154,7 @@
/**
* Indicates the sign of the value.
- * @return value < 0.0.
+ * @return {@code value < 0.0}.
*/
public boolean isNegative();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/IOUtils.java
--- a/jdk/src/java.base/share/classes/sun/misc/IOUtils.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/IOUtils.java Fri May 22 09:50:33 2015 +0200
@@ -39,7 +39,7 @@
/**
* Read up to length of bytes from in
* until EOF is detected.
- * @param in input stream, must not be null
+ * @param is input stream, must not be null
* @param length number of bytes to read, -1 or Integer.MAX_VALUE means
* read as much as possible
* @param readAll if true, an EOFException will be thrown if not enough
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/JarFilter.java
--- a/jdk/src/java.base/share/classes/sun/misc/JarFilter.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/JarFilter.java Fri May 22 09:50:33 2015 +0200
@@ -29,10 +29,8 @@
import java.io.FilenameFilter;
/**
- *
* This class checks that only jar and zip files are included in the file list.
* This class is used in extension installation support (ExtensionDependency).
- *
*
* @deprecated this class will be removed in a future release.
* @author Michael Colburn
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java
--- a/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java Fri May 22 09:50:33 2015 +0200
@@ -91,14 +91,14 @@
* may be added to the delete on exit list by the application shutdown
* hooks.
*
- * @params slot the slot in the shutdown hook array, whose element
- * will be invoked in order during shutdown
- * @params registerShutdownInProgress true to allow the hook
- * to be registered even if the shutdown is in progress.
- * @params hook the hook to be registered
+ * @param slot the slot in the shutdown hook array, whose element
+ * will be invoked in order during shutdown
+ * @param registerShutdownInProgress true to allow the hook
+ * to be registered even if the shutdown is in progress.
+ * @param hook the hook to be registered
*
- * @throw IllegalStateException if shutdown is in progress and
- * the slot is not valid to register.
+ * @throws IllegalStateException if shutdown is in progress and
+ * the slot is not valid to register.
*/
void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/Perf.java
--- a/jdk/src/java.base/share/classes/sun/misc/Perf.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/Perf.java Fri May 22 09:50:33 2015 +0200
@@ -67,13 +67,13 @@
* AccessController.doPrivileged(PrivilegedAction).
*
Here is a suggested idiom for use of this class:
*
- *
* In the presence of a security manager, the MyTrustedClass
* class in the above example will need to be granted the
@@ -171,8 +171,7 @@
* The attach mode specifies the access permissions requested for the
* instrumentation buffer of the target virtual machine. The permitted
* access permissions are:
- *
- *
+ *
*
"r" - Read only access. This Java virtual machine has only
* read access to the instrumentation buffer for the target Java
* virtual machine.
@@ -180,7 +179,7 @@
* write access to the instrumentation buffer for the target Java virtual
* machine. This mode is currently not supported and is reserved for
* future enhancements.
- *
+ *
*
* @param lvmid an integer that uniquely identifies the
* target local Java virtual machine.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/PerfCounter.java
--- a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java Fri May 22 09:50:33 2015 +0200
@@ -37,7 +37,7 @@
* The perf counters will be created in the jvmstat perf buffer
* that the HotSpot VM creates. The default size is 32K and thus
* the number of counters is bounded. You can alter the size
- * with -XX:PerfDataMemorySize= option. If there is
+ * with {@code -XX:PerfDataMemorySize=} option. If there is
* insufficient memory in the jvmstat perf buffer, the C heap memory
* will be used and thus the application will continue to run if
* the counters added exceeds the buffer size but the counters
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java
--- a/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java Fri May 22 09:50:33 2015 +0200
@@ -51,10 +51,12 @@
*
* To automatically track startup performance in an app or applet,
* use the command-line parameter sun.perflog as follows:
+ *
{@code
* -Dsun.perflog[=file:]
+ * }
*
* where simply using the parameter with no value will enable output
- * to the console and a value of "file:" will cause
+ * to the console and a value of "{@code file:}" will cause
* that given filename to be created and used for all output.
*
* By default, times are measured using System.currentTimeMillis(). To use
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/Resource.java
--- a/jdk/src/java.base/share/classes/sun/misc/Resource.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/Resource.java Fri May 22 09:50:33 2015 +0200
@@ -154,7 +154,8 @@
/**
* Returns the Resource data as a ByteBuffer, but only if the input stream
- * was implemented on top of a ByteBuffer. Return null otherwise.
+ * was implemented on top of a ByteBuffer. Return {@code null} otherwise.
+ * @return Resource data or null.
*/
public ByteBuffer getByteBuffer() throws IOException {
InputStream in = cachedInputStream();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/Signal.java
--- a/jdk/src/java.base/share/classes/sun/misc/Signal.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/Signal.java Fri May 22 09:50:33 2015 +0200
@@ -50,7 +50,7 @@
* Signal objects are created based on their names. For example:
*
* new Signal("INT");
- *
+ *
* constructs a signal object corresponding to SIGINT, which is
* typically produced when the user presses Ctrl-C at the command line.
* The Signal constructor throws IllegalArgumentException
@@ -64,7 +64,7 @@
* }
* };
* Signal.handle(new Signal("INT"), handler);
- *
+ *
*
* @author Sheng Liang
* @author Bill Shannon
@@ -149,7 +149,7 @@
*
* @param sig a signal
* @param handler the handler to be registered with the given signal.
- * @result the old handler
+ * @return the old handler
* @exception IllegalArgumentException the signal is in use by the VM
* @see sun.misc.Signal#raise(Signal sig)
* @see sun.misc.SignalHandler
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/Unsafe.java
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java Fri May 22 09:50:33 2015 +0200
@@ -641,9 +641,9 @@
*
String: any object (not just a java.lang.String)
*
InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
*
- * @params hostClass context for linkage, access control, protection domain, and class loader
- * @params data bytes of a class file
- * @params cpPatches where non-null entries exist, they replace corresponding CP entries in data
+ * @param hostClass context for linkage, access control, protection domain, and class loader
+ * @param data bytes of a class file
+ * @param cpPatches where non-null entries exist, they replace corresponding CP entries in data
*/
public native Class> defineAnonymousClass(Class> hostClass, byte[] data, Object[] cpPatches);
@@ -808,9 +808,9 @@
* The system imposes a maximum of 3 samples, representing
* averages over the last 1, 5, and 15 minutes, respectively.
*
- * @params loadavg an array of double of size nelems
- * @params nelems the number of samples to be retrieved and
- * must be 1 to 3.
+ * @param loadavg an array of double of size nelems
+ * @param nelems the number of samples to be retrieved and
+ * must be 1 to 3.
*
* @return the number of samples actually retrieved; or -1
* if the load average is unobtainable.
@@ -1108,7 +1108,6 @@
*
* 8-byte atomicity is only guaranteed on platforms on which
* support atomic accesses to longs.
- *
*
* @param o Java heap object in which the value resides, if any, else
* null
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/VM.java
--- a/jdk/src/java.base/share/classes/sun/misc/VM.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/VM.java Fri May 22 09:50:33 2015 +0200
@@ -315,7 +315,7 @@
}
/*
- * Add n to the objects pending for finalization count.
+ * Add {@code n} to the objects pending for finalization count.
*
* @param n an integer value to be added to the objects pending
* for finalization count
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_de extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_es extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_fr extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_it extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_ja extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_ko extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_pt_BR extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_sv extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_zh_CN extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java
--- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java Fri May 22 09:50:33 2015 +0200
@@ -26,7 +26,7 @@
package sun.misc.resources;
/**
- *
This class represents the ResourceBundle
+ * This class represents the {@code ResourceBundle}
* for sun.misc.
*
* @author Michael Colburn
@@ -35,9 +35,9 @@
public class Messages_zh_TW extends java.util.ListResourceBundle {
/**
- * Returns the contents of this ResourceBundle.
- *
- * @return the contents of this ResourceBundle.
+ * Returns the contents of this {@code ResourceBundle}.
+ *
+ * @return the contents of this {@code ResourceBundle}.
*/
public Object[][] getContents() {
return contents;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri May 22 09:50:33 2015 +0200
@@ -983,7 +983,7 @@
SocketPermission p = URLtoSocketPermission(this.url);
if (p != null) {
try {
- AccessController.doPrivileged(
+ AccessController.doPrivilegedWithCombiner(
new PrivilegedExceptionAction<>() {
public Void run() throws IOException {
plainConnect0();
@@ -1244,7 +1244,7 @@
if (p != null) {
try {
- return AccessController.doPrivileged(
+ return AccessController.doPrivilegedWithCombiner(
new PrivilegedExceptionAction<>() {
public OutputStream run() throws IOException {
return getOutputStream0();
@@ -1422,7 +1422,7 @@
if (p != null) {
try {
- return AccessController.doPrivileged(
+ return AccessController.doPrivilegedWithCombiner(
new PrivilegedExceptionAction<>() {
public InputStream run() throws IOException {
return getInputStream0();
@@ -2565,7 +2565,7 @@
if (p != null) {
try {
- return AccessController.doPrivileged(
+ return AccessController.doPrivilegedWithCombiner(
new PrivilegedExceptionAction<>() {
public Boolean run() throws IOException {
return followRedirect0(loc, stat, locUrl0);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
--- a/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java Fri May 22 09:50:33 2015 +0200
@@ -378,7 +378,6 @@
dst[dp++] = repl[1];
continue;
}
- sp++;
}
if (bb > MAX_SINGLEBYTE) { // DoubleByte
dst[dp++] = (byte)(bb >> 8);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java
--- a/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java Fri May 22 09:50:33 2015 +0200
@@ -175,10 +175,10 @@
* @param in The source buffer, from which one more character
* will be consumed if c is a high surrogate
*
- * @returns Either a parsed UCS-4 character, in which case the isPair()
- * and increment() methods will return meaningful values, or
- * -1, in which case error() will return a descriptive result
- * object
+ * @return Either a parsed UCS-4 character, in which case the isPair()
+ * and increment() methods will return meaningful values, or
+ * -1, in which case error() will return a descriptive result
+ * object
*/
public int parse(char c, CharBuffer in) {
if (Character.isHighSurrogate(c)) {
@@ -216,10 +216,10 @@
* @param ip The input index
* @param il The input limit
*
- * @returns Either a parsed UCS-4 character, in which case the isPair()
- * and increment() methods will return meaningful values, or
- * -1, in which case error() will return a descriptive result
- * object
+ * @return Either a parsed UCS-4 character, in which case the isPair()
+ * and increment() methods will return meaningful values, or
+ * -1, in which case error() will return a descriptive result
+ * object
*/
public int parse(char c, char[] ia, int ip, int il) {
assert (ia[ip] == c);
@@ -280,9 +280,9 @@
* @param dst The destination buffer, to which one or two UTF-16
* characters will be written
*
- * @returns Either a positive count of the number of UTF-16 characters
- * written to the destination buffer, or -1, in which case
- * error() will return a descriptive result object
+ * @return Either a positive count of the number of UTF-16 characters
+ * written to the destination buffer, or -1, in which case
+ * error() will return a descriptive result object
*/
public int generate(int uc, int len, CharBuffer dst) {
if (Character.isBmpCodePoint(uc)) {
@@ -325,9 +325,9 @@
* @param dp The destination position
* @param dl The destination limit
*
- * @returns Either a positive count of the number of UTF-16 characters
- * written to the destination buffer, or -1, in which case
- * error() will return a descriptive result object
+ * @return Either a positive count of the number of UTF-16 characters
+ * written to the destination buffer, or -1, in which case
+ * error() will return a descriptive result object
*/
public int generate(int uc, int len, char[] da, int dp, int dl) {
if (Character.isBmpCodePoint(uc)) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java Fri May 22 09:50:33 2015 +0200
@@ -67,10 +67,6 @@
* in RFC 5280. The ValidationAlgorithm attribute notes the
* specification that this provider implements.
*
- * - LDAP is the CertStore type for LDAP repositories. The
- * LDAPSchema attribute notes the specification defining the
- * schema that this provider uses to find certificates and CRLs.
- *
* - JavaPolicy is the default file-based Policy type.
*
* - JavaLoginConfig is the default file-based LoginModule Configuration type.
@@ -275,9 +271,6 @@
/*
* CertStores
*/
- map.put("CertStore.LDAP",
- "sun.security.provider.certpath.ldap.LDAPCertStore");
- map.put("CertStore.LDAP LDAPSchema", "RFC2587");
map.put("CertStore.Collection",
"sun.security.provider.certpath.CollectionCertStore");
map.put("CertStore.com.sun.security.IndexedCollection",
@@ -310,7 +303,6 @@
map.put("KeyStore.JKS ImplementedIn", "Software");
map.put("CertPathValidator.PKIX ImplementedIn", "Software");
map.put("CertPathBuilder.PKIX ImplementedIn", "Software");
- map.put("CertStore.LDAP ImplementedIn", "Software");
map.put("CertStore.Collection ImplementedIn", "Software");
map.put("CertStore.com.sun.security.IndexedCollection ImplementedIn",
"Software");
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/CertStoreHelper.java Thu May 21 18:23:01 2015 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.security.AccessController;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import javax.security.auth.x500.X500Principal;
-import java.io.IOException;
-
-import sun.security.util.Cache;
-
-/**
- * Helper used by URICertStore and others when delegating to another CertStore
- * to fetch certs and CRLs.
- */
-
-public abstract class CertStoreHelper {
-
- private static final int NUM_TYPES = 2;
- private final static Map classMap = new HashMap<>(NUM_TYPES);
- static {
- classMap.put(
- "LDAP",
- "sun.security.provider.certpath.ldap.LDAPCertStoreHelper");
- classMap.put(
- "SSLServer",
- "sun.security.provider.certpath.ssl.SSLServerCertStoreHelper");
- };
- private static Cache cache
- = Cache.newSoftMemoryCache(NUM_TYPES);
-
- public static CertStoreHelper getInstance(final String type)
- throws NoSuchAlgorithmException
- {
- CertStoreHelper helper = cache.get(type);
- if (helper != null) {
- return helper;
- }
- final String cl = classMap.get(type);
- if (cl == null) {
- throw new NoSuchAlgorithmException(type + " not available");
- }
- try {
- helper = AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public CertStoreHelper run() throws ClassNotFoundException {
- try {
- Class> c = Class.forName(cl, true, null);
- CertStoreHelper csh
- = (CertStoreHelper)c.newInstance();
- cache.put(type, csh);
- return csh;
- } catch (InstantiationException |
- IllegalAccessException e) {
- throw new AssertionError(e);
- }
- }
- });
- return helper;
- } catch (PrivilegedActionException e) {
- throw new NoSuchAlgorithmException(type + " not available",
- e.getException());
- }
- }
-
- static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
- switch (type) {
- case "LDAP":
- case "SSLServer":
- try {
- CertStoreHelper csh = CertStoreHelper.getInstance(type);
- return csh.isCausedByNetworkIssue(cse);
- } catch (NoSuchAlgorithmException nsae) {
- return false;
- }
- case "URI":
- Throwable t = cse.getCause();
- return (t != null && t instanceof IOException);
- default:
- // we don't know about any other remote CertStore types
- return false;
- }
- }
-
- /**
- * Returns a CertStore using the given URI as parameters.
- */
- public abstract CertStore getCertStore(URI uri)
- throws NoSuchAlgorithmException, InvalidAlgorithmParameterException;
-
- /**
- * Wraps an existing X509CertSelector when needing to avoid DN matching
- * issues.
- */
- public abstract X509CertSelector wrap(X509CertSelector selector,
- X500Principal certSubject,
- String dn)
- throws IOException;
-
- /**
- * Wraps an existing X509CRLSelector when needing to avoid DN matching
- * issues.
- */
- public abstract X509CRLSelector wrap(X509CRLSelector selector,
- Collection certIssuers,
- String dn)
- throws IOException;
-
- /**
- * Returns true if the cause of the CertStoreException is a network
- * related issue.
- */
- public abstract boolean isCausedByNetworkIssue(CertStoreException e);
-}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/RevocationChecker.java Fri May 22 09:50:33 2015 +0200
@@ -466,6 +466,34 @@
stackedCerts, params.trustAnchors());
}
+ static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
+ boolean result;
+ Throwable t = cse.getCause();
+
+ switch (type) {
+ case "LDAP":
+ if (t != null) {
+ // These two exception classes are inside java.naming module
+ String cn = t.getClass().getName();
+ result = (cn.equals("javax.naming.ServiceUnavailableException") ||
+ cn.equals("javax.naming.CommunicationException"));
+ } else {
+ result = false;
+ }
+ break;
+ case "SSLServer":
+ result = (t != null && t instanceof IOException);
+ break;
+ case "URI":
+ result = (t != null && t instanceof IOException);
+ break;
+ default:
+ // we don't know about any other remote CertStore types
+ return false;
+ }
+ return result;
+ }
+
private void checkCRLs(X509Certificate cert, PublicKey prevKey,
X509Certificate prevCert, boolean signFlag,
boolean allowSeparateKey,
@@ -510,7 +538,7 @@
"CertStoreException: " + e.getMessage());
}
if (networkFailureException == null &&
- CertStoreHelper.isCausedByNetworkIssue(store.getType(),e)) {
+ isCausedByNetworkIssue(store.getType(),e)) {
// save this exception, we may need to throw it later
networkFailureException = new CertPathValidatorException(
"Unable to determine revocation status due to " +
@@ -557,8 +585,7 @@
} catch (CertStoreException e) {
if (e instanceof CertStoreTypeException) {
CertStoreTypeException cste = (CertStoreTypeException)e;
- if (CertStoreHelper.isCausedByNetworkIssue(cste.getType(),
- e)) {
+ if (isCausedByNetworkIssue(cste.getType(), e)) {
throw new CertPathValidatorException(
"Unable to determine revocation status due to " +
"network error", e, null, -1,
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/URICertStore.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,7 @@
import java.security.cert.CertStoreSpi;
import java.security.cert.CRLException;
import java.security.cert.CRLSelector;
+import java.security.cert.URICertStoreParameters;
import java.security.cert.X509Certificate;
import java.security.cert.X509CertSelector;
import java.security.cert.X509CRL;
@@ -118,9 +119,7 @@
// true if URI is ldap
private boolean ldap = false;
- private CertStoreHelper ldapHelper;
private CertStore ldapCertStore;
- private String ldapPath;
// Default maximum connect timeout in milliseconds (15 seconds)
// allowed when downloading CRLs
@@ -165,13 +164,8 @@
// if ldap URI, use an LDAPCertStore to fetch certs and CRLs
if (uri.getScheme().toLowerCase(Locale.ENGLISH).equals("ldap")) {
ldap = true;
- ldapHelper = CertStoreHelper.getInstance("LDAP");
- ldapCertStore = ldapHelper.getCertStore(uri);
- ldapPath = uri.getPath();
- // strip off leading '/'
- if (ldapPath.charAt(0) == '/') {
- ldapPath = ldapPath.substring(1);
- }
+ URICertStoreParameters lparams = new URICertStoreParameters(uri);
+ ldapCertStore = CertStore.getInstance("LDAP", lparams);
}
try {
factory = CertificateFactory.getInstance("X.509");
@@ -246,20 +240,10 @@
public synchronized Collection engineGetCertificates
(CertSelector selector) throws CertStoreException {
- // if ldap URI we wrap the CertSelector in an LDAPCertSelector to
- // avoid LDAP DN matching issues (see LDAPCertSelector for more info)
if (ldap) {
- X509CertSelector xsel = (X509CertSelector) selector;
- try {
- xsel = ldapHelper.wrap(xsel, xsel.getSubject(), ldapPath);
- } catch (IOException ioe) {
- throw new CertStoreException(ioe);
- }
- // Fetch the certificates via LDAP. LDAPCertStore has its own
// caching mechanism, see the class description for more info.
- // Safe cast since xsel is an X509 certificate selector.
return (Collection)
- ldapCertStore.getCertificates(xsel);
+ ldapCertStore.getCertificates(selector);
}
// Return the Certificates for this entry. It returns the cached value
@@ -356,20 +340,11 @@
public synchronized Collection engineGetCRLs(CRLSelector selector)
throws CertStoreException {
- // if ldap URI we wrap the CRLSelector in an LDAPCRLSelector to
- // avoid LDAP DN matching issues (see LDAPCRLSelector for more info)
if (ldap) {
- X509CRLSelector xsel = (X509CRLSelector) selector;
- try {
- xsel = ldapHelper.wrap(xsel, null, ldapPath);
- } catch (IOException ioe) {
- throw new CertStoreException(ioe);
- }
// Fetch the CRLs via LDAP. LDAPCertStore has its own
// caching mechanism, see the class description for more info.
- // Safe cast since xsel is an X509 certificate selector.
try {
- return (Collection) ldapCertStore.getCRLs(xsel);
+ return (Collection) ldapCertStore.getCRLs(selector);
} catch (CertStoreException cse) {
throw new PKIX.CertStoreTypeException("LDAP", cse);
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStore.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@
throw new UnsupportedOperationException();
}
- static CertStore getInstance(URI uri)
+ public static CertStore getInstance(URI uri)
throws InvalidAlgorithmParameterException
{
return new CS(new SSLServerCertStore(uri), null, "SSLServer", null);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/ssl/SSLServerCertStoreHelper.java Thu May 21 18:23:01 2015 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.provider.certpath.ssl;
-
-import java.io.IOException;
-import java.net.URI;
-import java.security.NoSuchAlgorithmException;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.cert.CertStore;
-import java.security.cert.CertStoreException;
-import java.security.cert.X509CertSelector;
-import java.security.cert.X509CRLSelector;
-import java.util.Collection;
-import javax.security.auth.x500.X500Principal;
-
-import sun.security.provider.certpath.CertStoreHelper;
-
-/**
- * SSL implementation of CertStoreHelper.
- */
-public final class SSLServerCertStoreHelper extends CertStoreHelper {
-
- @Override
- public CertStore getCertStore(URI uri)
- throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
- {
- return SSLServerCertStore.getInstance(uri);
- }
-
- @Override
- public X509CertSelector wrap(X509CertSelector selector,
- X500Principal certSubject,
- String ldapDN)
- throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public X509CRLSelector wrap(X509CRLSelector selector,
- Collection certIssuers,
- String ldapDN)
- throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isCausedByNetworkIssue(CertStoreException e) {
- Throwable t = e.getCause();
- return (t != null && t instanceof IOException);
- }
-}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java Fri May 22 09:50:33 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,9 @@
import java.security.cert.CRL;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;
+import java.security.cert.URICertStoreParameters;
+
+
import java.text.Collator;
import java.text.MessageFormat;
import java.util.*;
@@ -69,7 +72,7 @@
import sun.security.pkcs10.PKCS10;
import sun.security.pkcs10.PKCS10Attribute;
import sun.security.provider.X509Factory;
-import sun.security.provider.certpath.CertStoreHelper;
+import sun.security.provider.certpath.ssl.SSLServerCertStore;
import sun.security.util.Password;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
@@ -2208,14 +2211,10 @@
}
}
} else { // must be LDAP, and uri is not null
- // Lazily load LDAPCertStoreHelper if present
- CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
- String path = uri.getPath();
- if (path.charAt(0) == '/') path = path.substring(1);
- CertStore s = helper.getCertStore(uri);
- X509CRLSelector sel =
- helper.wrap(new X509CRLSelector(), null, path);
- return s.getCRLs(sel);
+ URICertStoreParameters params =
+ new URICertStoreParameters(uri);
+ CertStore s = CertStore.getInstance("LDAP", params);
+ return s.getCRLs(new X509CRLSelector());
}
}
@@ -2463,9 +2462,7 @@
out.println(rb.getString("Not.a.signed.jar.file"));
}
} else if (sslserver != null) {
- // Lazily load SSLCertStoreHelper if present
- CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
- CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
+ CertStore cs = SSLServerCertStore.getInstance(new URI("https://" + sslserver));
Collection extends Certificate> chain;
try {
chain = cs.getCertificates(null);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/AVA.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/AVA.java Fri May 22 09:50:33 2015 +0200
@@ -454,7 +454,7 @@
if (embeddedHex.size() > 0) {
// add space(s) before embedded hex bytes
for (int i = 0; i < spaceCount; i++) {
- temp.append(" ");
+ temp.append(' ');
}
spaceCount = 0;
@@ -472,7 +472,7 @@
} else {
// add space(s)
for (int i = 0; i < spaceCount; i++) {
- temp.append(" ");
+ temp.append(' ');
}
spaceCount = 0;
temp.append((char)c);
@@ -853,7 +853,7 @@
}
sbuffer.append(c);
}
- typeAndValue.append(sbuffer.toString());
+ typeAndValue.append(sbuffer);
}
return typeAndValue.toString();
}
@@ -1039,7 +1039,7 @@
StringBuilder retval = new StringBuilder(40);
retval.append(keyword);
- retval.append("=");
+ retval.append('=');
try {
String valStr = value.getAsString();
@@ -1147,9 +1147,11 @@
// Emit the string ... quote it if needed
// if string is already quoted, don't re-quote
if (!alreadyQuoted && quoteNeeded) {
- retval.append("\"" + sbuffer.toString() + "\"");
+ retval.append('\"')
+ .append(sbuffer)
+ .append('\"');
} else {
- retval.append(sbuffer.toString());
+ retval.append(sbuffer);
}
}
} catch (IOException e) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java Fri May 22 09:50:33 2015 +0200
@@ -196,17 +196,20 @@
* Return the object as a string.
*/
public String toString() {
- String s = super.toString() + "AuthorityKeyIdentifier [\n";
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("AuthorityKeyIdentifier [\n");
if (id != null) {
- s += id.toString(); // id already has a newline
+ sb.append(id); // id already has a newline
}
if (names != null) {
- s += names.toString() + "\n";
+ sb.append(names).append('\n');
}
if (serialNum != null) {
- s += serialNum.toString() + "\n";
+ sb.append(serialNum).append('\n');
}
- return (s + "]\n");
+ sb.append("]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java Fri May 22 09:50:33 2015 +0200
@@ -171,15 +171,11 @@
* Return user readable form of extension.
*/
public String toString() {
- String s = super.toString() + "BasicConstraints:[\n";
-
- s += ((ca) ? (" CA:true") : (" CA:false")) + "\n";
- if (pathLen >= 0) {
- s += " PathLen:" + pathLen + "\n";
- } else {
- s += " PathLen: undefined\n";
- }
- return (s + "]\n");
+ return super.toString() +
+ "BasicConstraints:[\n CA:" + ca +
+ "\n PathLen:" +
+ ((pathLen >= 0) ? String.valueOf(pathLen) : " undefined") +
+ "\n]\n";
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java Fri May 22 09:50:33 2015 +0200
@@ -231,8 +231,8 @@
distributionPoints = (List)obj;
} else {
throw new IOException("Attribute name [" + name +
- "] not recognized by " +
- "CertAttrSet:" + extensionName + ".");
+ "] not recognized by " +
+ "CertAttrSet:" + extensionName + '.');
}
encodeThis();
}
@@ -245,8 +245,8 @@
return distributionPoints;
} else {
throw new IOException("Attribute name [" + name +
- "] not recognized by " +
- "CertAttrSet:" + extensionName + ".");
+ "] not recognized by " +
+ "CertAttrSet:" + extensionName + '.');
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java Fri May 22 09:50:33 2015 +0200
@@ -146,8 +146,8 @@
}
crlNumber = (BigInteger)obj;
} else {
- throw new IOException("Attribute name not recognized by"
- + " CertAttrSet:" + extensionName + ".");
+ throw new IOException("Attribute name not recognized by" +
+ " CertAttrSet:" + extensionName + '.');
}
encodeThis();
}
@@ -172,8 +172,8 @@
if (name.equalsIgnoreCase(NUMBER)) {
crlNumber = null;
} else {
- throw new IOException("Attribute name not recognized by"
- + " CertAttrSet:" + extensionName + ".");
+ throw new IOException("Attribute name not recognized by" +
+ " CertAttrSet:" + extensionName + '.');
}
encodeThis();
}
@@ -182,10 +182,15 @@
* Returns a printable representation of the CRLNumberExtension.
*/
public String toString() {
- String s = super.toString() + extensionLabel + ": " +
- ((crlNumber == null) ? "" : Debug.toHexString(crlNumber))
- + "\n";
- return (s);
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append(extensionLabel)
+ .append(": ");
+ if (crlNumber != null) {
+ sb.append(Debug.toHexString(crlNumber));
+ }
+ sb.append('\n');
+ return sb.toString();
}
/**
@@ -195,7 +200,7 @@
* @exception IOException on encoding errors.
*/
public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
+ DerOutputStream tmp = new DerOutputStream();
encode(out, PKIXExtensions.CRLNumber_Id, true);
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/CertException.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/CertException.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CertException.java Fri May 22 09:50:33 2015 +0200
@@ -158,7 +158,7 @@
*/
public String toString()
{
- return "[Certificate Exception: " + getMessage() + "]";
+ return "[Certificate Exception: " + getMessage() + ']';
}
/**
@@ -168,6 +168,6 @@
{
return getVerfDescription()
+ ( (moreData != null)
- ? ( "\n (" + moreData + ")" ) : "" );
+ ? ( "\n (" + moreData + ')' ) : "" );
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java Fri May 22 09:50:33 2015 +0200
@@ -160,10 +160,12 @@
if (certPolicies == null) {
return "";
}
- StringBuilder sb = new StringBuilder(super.toString());
- sb.append("CertificatePolicies [\n");
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("CertificatePolicies [\n");
for (PolicyInformation info : certPolicies) {
- sb.append(info.toString());
+ sb.append(info);
}
sb.append("]\n");
return sb.toString();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java Fri May 22 09:50:33 2015 +0200
@@ -134,8 +134,8 @@
public String toString() {
if (notBefore == null || notAfter == null)
return "";
- return ("Validity: [From: " + notBefore.toString() +
- ",\n To: " + notAfter.toString() + "]");
+ return "Validity: [From: " + notBefore +
+ ",\n To: " + notAfter + ']';
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java Fri May 22 09:50:33 2015 +0200
@@ -380,23 +380,29 @@
*/
public String toString() {
StringBuilder sb = new StringBuilder();
+ sb.append("DistributionPoint:\n ");
if (fullName != null) {
- sb.append("DistributionPoint:\n " + fullName + "\n");
+ sb.append(fullName);
}
if (relativeName != null) {
- sb.append("DistributionPoint:\n " + relativeName + "\n");
+ sb.append(relativeName);
}
+ sb.append('\n');
if (reasonFlags != null) {
sb.append(" ReasonFlags:\n");
for (int i = 0; i < reasonFlags.length; i++) {
if (reasonFlags[i]) {
- sb.append(" " + reasonToString(i) + "\n");
+ sb.append(" ")
+ .append(reasonToString(i))
+ .append('\n');
}
}
}
if (crlIssuer != null) {
- sb.append(" CRLIssuer:" + crlIssuer + "\n");
+ sb.append(" CRLIssuer:")
+ .append(crlIssuer)
+ .append('\n');
}
return sb.toString();
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java Fri May 22 09:50:33 2015 +0200
@@ -230,13 +230,13 @@
*/
public String toString() {
StringBuilder sb = new StringBuilder();
+ sb.append("DistributionPointName:\n ");
if (fullName != null) {
- sb.append("DistributionPointName:\n " + fullName + "\n");
-
+ sb.append(fullName);
} else {
- sb.append("DistributionPointName:\n " + relativeName + "\n");
+ sb.append(relativeName);
}
-
+ sb.append('\n');
return sb.toString();
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java Fri May 22 09:50:33 2015 +0200
@@ -209,10 +209,15 @@
* Return the printable string.
*/
public String toString() {
- return ("EDIPartyName: " +
- ((assigner == null) ? "" :
- (" nameAssigner = " + assigner + ","))
- + " partyName = " + party);
+ StringBuilder sb = new StringBuilder("EDIPartyName: ");
+ if (assigner != null) {
+ sb.append(" nameAssigner = ")
+ .append(assigner)
+ .append(',');
+ }
+ sb.append(" partyName = ")
+ .append(party);
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/Extension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/Extension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/Extension.java Fri May 22 09:50:33 2015 +0200
@@ -219,13 +219,8 @@
* Returns the Extension in user readable form.
*/
public String toString() {
- String s = "ObjectId: " + extensionId.toString();
- if (critical) {
- s += " Criticality=true\n";
- } else {
- s += " Criticality=false\n";
- }
- return (s);
+ return "ObjectId: " + extensionId +
+ " Criticality=" + critical + '\n';
}
// Value to mix up the hash
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java Fri May 22 09:50:33 2015 +0200
@@ -127,15 +127,22 @@
* Return a printable string of the GeneralSubtree.
*/
public String toString() {
- String s = "\n GeneralSubtree: [\n" +
- " GeneralName: " + ((name == null) ? "" : name.toString()) +
- "\n Minimum: " + minimum;
- if (maximum == -1) {
- s += "\t Maximum: undefined";
- } else
- s += "\t Maximum: " + maximum;
- s += " ]\n";
- return (s);
+ StringBuilder sb = new StringBuilder();
+ sb.append("\n GeneralSubtree: [")
+ .append("\n GeneralName: ");
+ if (name != null) {
+ sb.append(name);
+ }
+ sb.append("\n Minimum: ")
+ .append(minimum)
+ .append("\n Maximum: ");
+ if (maximum == -1) {
+ sb.append("undefined");
+ } else {
+ sb.append(maximum);
+ }
+ sb.append(" ]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java Fri May 22 09:50:33 2015 +0200
@@ -124,8 +124,7 @@
* Return a printable string of the GeneralSubtree.
*/
public String toString() {
- String s = " GeneralSubtrees:\n" + trees.toString() + "\n";
- return s;
+ return " GeneralSubtrees:\n" + trees + '\n';
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java Fri May 22 09:50:33 2015 +0200
@@ -263,7 +263,7 @@
if (address.length == 8) {
byte[] mask = new byte[4];
System.arraycopy(address, 4, mask, 0, 4);
- name = name + "/" +
+ name = name + '/' +
InetAddress.getByAddress(mask).getHostAddress();
}
} else {
@@ -285,7 +285,7 @@
if (!ba.get(i))
break;
}
- name = name + "/" + i;
+ name = name + '/' + i;
// Verify remaining bits 0
for (; i < 16*8; i++) {
if (ba.get(i)) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java Fri May 22 09:50:33 2015 +0200
@@ -140,17 +140,20 @@
* Returns a printable representation of the IssuerAlternativeName.
*/
public String toString() {
-
- String result = super.toString() + "IssuerAlternativeName [\n";
- if(names == null) {
- result += " null\n";
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("IssuerAlternativeName [\n");
+ if (names == null) {
+ sb.append(" null\n");
} else {
- for(GeneralName name: names.names()) {
- result += " "+name+"\n";
+ for (GeneralName name : names.names()) {
+ sb.append(" ")
+ .append(name)
+ .append('\n');
}
}
- result += "]\n";
- return result;
+ sb.append("]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java Fri May 22 09:50:33 2015 +0200
@@ -441,9 +441,9 @@
* Returns the extension as user readable string.
*/
public String toString() {
-
- StringBuilder sb = new StringBuilder(super.toString());
- sb.append("IssuingDistributionPoint [\n ");
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("IssuingDistributionPoint [\n ");
if (distributionPoint != null) {
sb.append(distributionPoint);
@@ -453,23 +453,18 @@
sb.append(revocationReasons);
}
- sb.append((hasOnlyUserCerts)
- ? (" Only contains user certs: true")
- : (" Only contains user certs: false")).append("\n");
-
- sb.append((hasOnlyCACerts)
- ? (" Only contains CA certs: true")
- : (" Only contains CA certs: false")).append("\n");
-
- sb.append((hasOnlyAttributeCerts)
- ? (" Only contains attribute certs: true")
- : (" Only contains attribute certs: false")).append("\n");
-
- sb.append((isIndirectCRL)
- ? (" Indirect CRL: true")
- : (" Indirect CRL: false")).append("\n");
-
- sb.append("]\n");
+ sb.append(" Only contains user certs: ")
+ .append(hasOnlyUserCerts)
+ .append('\n')
+ .append(" Only contains CA certs: ")
+ .append(hasOnlyCACerts)
+ .append('\n')
+ .append(" Only contains attribute certs: ")
+ .append(hasOnlyAttributeCerts)
+ .append('\n')
+ .append(" Indirect CRL: ")
+ .append(isIndirectCRL)
+ .append("\n]\n");
return sb.toString();
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java Fri May 22 09:50:33 2015 +0200
@@ -214,12 +214,19 @@
* Return the printable string.
*/
public String toString() {
- return (super.toString() + "NameConstraints: [" +
- ((permitted == null) ? "" :
- ("\n Permitted:" + permitted.toString())) +
- ((excluded == null) ? "" :
- ("\n Excluded:" + excluded.toString()))
- + " ]\n");
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("NameConstraints: [");
+ if (permitted != null) {
+ sb.append("\n Permitted:")
+ .append(permitted);
+ }
+ if (excluded != null) {
+ sb.append("\n Excluded:")
+ .append(excluded);
+ }
+ sb.append(" ]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java Fri May 22 09:50:33 2015 +0200
@@ -175,19 +175,24 @@
* Return the extension as user readable string.
*/
public String toString() {
- String s;
- s = super.toString() + "PolicyConstraints: [" + " Require: ";
- if (require == -1)
- s += "unspecified;";
- else
- s += require + ";";
- s += "\tInhibit: ";
- if (inhibit == -1)
- s += "unspecified";
- else
- s += inhibit;
- s += " ]\n";
- return s;
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("PolicyConstraints: [")
+ .append(" Require: ");
+ if (require == -1) {
+ sb.append("unspecified;");
+ } else {
+ sb.append(require)
+ .append(';');
+ }
+ sb.append("\tInhibit: ");
+ if (inhibit == -1) {
+ sb.append("unspecified");
+ } else {
+ sb.append(inhibit);
+ }
+ sb.append(" ]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java Fri May 22 09:50:33 2015 +0200
@@ -258,9 +258,7 @@
* Return a printable representation of the PolicyInformation.
*/
public String toString() {
- StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString());
- s.append(policyQualifiers + " ]\n");
- return s.toString();
+ return " [" + policyIdentifier + policyQualifiers + " ]\n";
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java Fri May 22 09:50:33 2015 +0200
@@ -175,11 +175,22 @@
* Return the printable string.
*/
public String toString() {
- return(super.toString() +
- "PrivateKeyUsage: [\n" +
- ((notBefore == null) ? "" : "From: " + notBefore.toString() + ", ")
- + ((notAfter == null) ? "" : "To: " + notAfter.toString())
- + "]\n");
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString())
+ .append("PrivateKeyUsage: [\n");
+ if (notBefore != null) {
+ sb.append("From: ")
+ .append(notBefore);
+ if (notAfter != null) {
+ sb.append(", ");
+ }
+ }
+ if (notAfter != null) {
+ sb.append("To: ")
+ .append(notAfter);
+ }
+ sb.append("]\n");
+ return sb.toString();
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/RDN.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java Fri May 22 09:50:33 2015 +0200
@@ -348,14 +348,11 @@
return assertion[0].toString();
}
- StringBuilder sb = new StringBuilder();
+ StringJoiner sj = new StringJoiner(" + ");
for (int i = 0; i < assertion.length; i++) {
- if (i != 0) {
- sb.append(" + ");
- }
- sb.append(assertion[i].toString());
+ sj.add(assertion[i].toString());
}
- return sb.toString();
+ return sj.toString();
}
/*
@@ -376,14 +373,11 @@
return assertion[0].toRFC1779String(oidMap);
}
- StringBuilder sb = new StringBuilder();
+ StringJoiner sj = new StringJoiner(" + ");
for (int i = 0; i < assertion.length; i++) {
- if (i != 0) {
- sb.append(" + ");
- }
- sb.append(assertion[i].toRFC1779String(oidMap));
+ sj.add(assertion[i].toRFC1779String(oidMap));
}
- return sb.toString();
+ return sj.toString();
}
/*
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java Fri May 22 09:50:33 2015 +0200
@@ -101,7 +101,7 @@
* Return the SerialNumber as user readable string.
*/
public String toString() {
- return ("SerialNumber: [" + Debug.toHexString(serialNum) + "]");
+ return "SerialNumber: [" + Debug.toHexString(serialNum) + ']';
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java Fri May 22 09:50:33 2015 +0200
@@ -238,8 +238,8 @@
* Return the extension as user readable string.
*/
public String toString() {
- return super.toString() + "SubjectInfoAccess [\n "
- + accessDescriptions + "\n]\n";
+ return super.toString() +
+ "SubjectInfoAccess [\n " + accessDescriptions + "\n]\n";
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java Fri May 22 09:50:33 2015 +0200
@@ -115,8 +115,8 @@
* Returns a printable representation.
*/
public String toString() {
- return super.toString() + "SubjectKeyIdentifier [\n"
- + String.valueOf(id) + "]\n";
+ return super.toString() +
+ "SubjectKeyIdentifier [\n" + id + "]\n";
}
/**
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/X500Name.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java Fri May 22 09:50:33 2015 +0200
@@ -31,6 +31,7 @@
import java.security.AccessController;
import java.security.Principal;
import java.util.*;
+import java.util.StringJoiner;
import sun.security.util.*;
import javax.security.auth.x500.X500Principal;
@@ -689,14 +690,11 @@
* The encodings of adjoining RelativeDistinguishedNames are separated
* by a comma character (',' ASCII 44).
*/
- StringBuilder fullname = new StringBuilder(48);
+ StringJoiner sj = new StringJoiner(",");
for (int i = names.length - 1; i >= 0; i--) {
- if (i < names.length - 1) {
- fullname.append(',');
- }
- fullname.append(names[i].toRFC2253String(oidMap));
+ sj.add(names[i].toRFC2253String(oidMap));
}
- return fullname.toString();
+ return sj.toString();
}
public String getRFC2253CanonicalName() {
@@ -722,14 +720,11 @@
* The encodings of adjoining RelativeDistinguishedNames are separated
* by a comma character (',' ASCII 44).
*/
- StringBuilder fullname = new StringBuilder(48);
+ StringJoiner sj = new StringJoiner(",");
for (int i = names.length - 1; i >= 0; i--) {
- if (i < names.length - 1) {
- fullname.append(',');
- }
- fullname.append(names[i].toRFC2253String(true));
+ sj.add(names[i].toRFC2253String(true));
}
- canonicalDn = fullname.toString();
+ canonicalDn = sj.toString();
return canonicalDn;
}
@@ -1064,16 +1059,16 @@
return;
}
- StringBuilder sb = new StringBuilder(48);
- if (names != null) {
- for (int i = names.length - 1; i >= 0; i--) {
- if (i != names.length - 1) {
- sb.append(", ");
- }
- sb.append(names[i].toString());
- }
+ if (names == null) {
+ dn = "";
+ return;
}
- dn = sb.toString();
+
+ StringJoiner sj = new StringJoiner(", ");
+ for (int i = names.length - 1; i >= 0; i--) {
+ sj.add(names[i].toString());
+ }
+ dn = sj.toString();
}
/*
@@ -1090,16 +1085,15 @@
return names[0].toRFC1779String(oidMap);
}
- StringBuilder sb = new StringBuilder(48);
- if (names != null) {
- for (int i = names.length - 1; i >= 0; i--) {
- if (i != names.length - 1) {
- sb.append(", ");
- }
- sb.append(names[i].toRFC1779String(oidMap));
- }
+ if (names == null) {
+ return "";
}
- return sb.toString();
+
+ StringJoiner sj = new StringJoiner(", ");
+ for (int i = names.length - 1; i >= 0; i--) {
+ sj.add(names[i].toRFC1779String(oidMap));
+ }
+ return sj.toString();
}
/****************************************************************/
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java Fri May 22 09:50:33 2015 +0200
@@ -291,40 +291,47 @@
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append(serialNumber.toString());
- sb.append(" On: " + revocationDate.toString());
+ sb.append(serialNumber)
+ .append(" On: ")
+ .append(revocationDate);
if (certIssuer != null) {
- sb.append("\n Certificate issuer: " + certIssuer);
+ sb.append("\n Certificate issuer: ")
+ .append(certIssuer);
}
if (extensions != null) {
Collection allEntryExts = extensions.getAllExtensions();
Extension[] exts = allEntryExts.toArray(new Extension[0]);
- sb.append("\n CRL Entry Extensions: " + exts.length);
+ sb.append("\n CRL Entry Extensions: ")
+ .append(exts.length);
for (int i = 0; i < exts.length; i++) {
- sb.append("\n [" + (i+1) + "]: ");
+ sb.append("\n [")
+ .append(i+1)
+ .append("]: ");
Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
- sb.append(ext.toString());
+ sb.append(ext);
byte[] extValue = ext.getExtensionValue();
if (extValue != null) {
DerOutputStream out = new DerOutputStream();
out.putOctetString(extValue);
extValue = out.toByteArray();
HexDumpEncoder enc = new HexDumpEncoder();
- sb.append("Extension unknown: "
- + "DER encoded OCTET string =\n"
- + enc.encodeBuffer(extValue) + "\n");
+ sb.append("Extension unknown: ")
+ .append("DER encoded OCTET string =\n")
+ .append(enc.encodeBuffer(extValue))
+ .append('\n');
}
- } else
- sb.append(ext.toString()); //sub-class exists
+ } else {
+ sb.append(ext); //sub-class exists
+ }
} catch (Exception e) {
sb.append(", Error parsing this extension");
}
}
}
- sb.append("\n");
+ sb.append('\n');
return sb.toString();
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java Fri May 22 09:50:33 2015 +0200
@@ -537,47 +537,65 @@
*/
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("X.509 CRL v" + (version+1) + "\n");
+ sb.append("X.509 CRL v")
+ .append(version+1)
+ .append('\n');
if (sigAlgId != null)
- sb.append("Signature Algorithm: " + sigAlgId.toString() +
- ", OID=" + (sigAlgId.getOID()).toString() + "\n");
+ sb.append("Signature Algorithm: ")
+ .append(sigAlgId)
+ .append(", OID=")
+ .append(sigAlgId.getOID())
+ .append('\n');
if (issuer != null)
- sb.append("Issuer: " + issuer.toString() + "\n");
+ sb.append("Issuer: ")
+ .append(issuer)
+ .append('\n');
if (thisUpdate != null)
- sb.append("\nThis Update: " + thisUpdate.toString() + "\n");
+ sb.append("\nThis Update: ")
+ .append(thisUpdate)
+ .append('\n');
if (nextUpdate != null)
- sb.append("Next Update: " + nextUpdate.toString() + "\n");
+ sb.append("Next Update: ")
+ .append(nextUpdate)
+ .append('\n');
if (revokedList.isEmpty())
sb.append("\nNO certificates have been revoked\n");
else {
- sb.append("\nRevoked Certificates: " + revokedList.size());
+ sb.append("\nRevoked Certificates: ")
+ .append(revokedList.size());
int i = 1;
for (X509CRLEntry entry: revokedList) {
- sb.append("\n[" + i++ + "] " + entry.toString());
+ sb.append("\n[")
+ .append(i++)
+ .append("] ")
+ .append(entry);
}
}
if (extensions != null) {
Collection allExts = extensions.getAllExtensions();
Object[] objs = allExts.toArray();
- sb.append("\nCRL Extensions: " + objs.length);
+ sb.append("\nCRL Extensions: ")
+ .append(objs.length);
for (int i = 0; i < objs.length; i++) {
- sb.append("\n[" + (i+1) + "]: ");
+ sb.append("\n[").append(i+1).append("]: ");
Extension ext = (Extension)objs[i];
try {
- if (OIDMap.getClass(ext.getExtensionId()) == null) {
- sb.append(ext.toString());
- byte[] extValue = ext.getExtensionValue();
- if (extValue != null) {
- DerOutputStream out = new DerOutputStream();
- out.putOctetString(extValue);
- extValue = out.toByteArray();
- HexDumpEncoder enc = new HexDumpEncoder();
- sb.append("Extension unknown: "
- + "DER encoded OCTET string =\n"
- + enc.encodeBuffer(extValue) + "\n");
- }
- } else
- sb.append(ext.toString()); // sub-class exists
+ if (OIDMap.getClass(ext.getExtensionId()) == null) {
+ sb.append(ext);
+ byte[] extValue = ext.getExtensionValue();
+ if (extValue != null) {
+ DerOutputStream out = new DerOutputStream();
+ out.putOctetString(extValue);
+ extValue = out.toByteArray();
+ HexDumpEncoder enc = new HexDumpEncoder();
+ sb.append("Extension unknown: ")
+ .append("DER encoded OCTET string =\n")
+ .append(enc.encodeBuffer(extValue))
+ .append('\n');
+ }
+ } else {
+ sb.append(ext); // sub-class exists
+ }
} catch (Exception e) {
sb.append(", Error parsing this extension");
}
@@ -585,10 +603,12 @@
}
if (signature != null) {
HexDumpEncoder encoder = new HexDumpEncoder();
- sb.append("\nSignature:\n" + encoder.encodeBuffer(signature)
- + "\n");
- } else
+ sb.append("\nSignature:\n")
+ .append(encoder.encodeBuffer(signature))
+ .append('\n');
+ } else {
sb.append("NOT signed yet\n");
+ }
return sb.toString();
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java Fri May 22 09:50:33 2015 +0200
@@ -81,7 +81,7 @@
private static final long serialVersionUID = -3457612960190864406L;
- private static final String DOT = ".";
+ private static final char DOT = '.';
/**
* Public attribute names.
*/
@@ -799,17 +799,10 @@
if (info == null || algId == null || signature == null)
return "";
- StringBuilder sb = new StringBuilder();
-
- sb.append("[\n");
- sb.append(info.toString() + "\n");
- sb.append(" Algorithm: [" + algId.toString() + "]\n");
-
HexDumpEncoder encoder = new HexDumpEncoder();
- sb.append(" Signature:\n" + encoder.encodeBuffer(signature));
- sb.append("\n]");
-
- return sb.toString();
+ return "[\n" + info + '\n' +
+ " Algorithm: [" + algId + "]\n" +
+ " Signature:\n" + encoder.encodeBuffer(signature) + "\n]";
}
// the strongly typed gets, as per java.security.cert.X509Certificate
@@ -1941,31 +1934,30 @@
* only contains 0-9 and A-F. No small case, no colon.
*/
private String getCertificateFingerPrint(String mdAlg) {
- String fingerPrint = "";
try {
byte[] encCertInfo = getEncoded();
MessageDigest md = MessageDigest.getInstance(mdAlg);
byte[] digest = md.digest(encCertInfo);
- StringBuffer buf = new StringBuffer();
+ StringBuilder sb = new StringBuilder(digest.length * 2);
for (int i = 0; i < digest.length; i++) {
- byte2hex(digest[i], buf);
+ byte2hex(digest[i], sb);
}
- fingerPrint = buf.toString();
+ return sb.toString();
} catch (NoSuchAlgorithmException | CertificateEncodingException e) {
// ignored
}
- return fingerPrint;
+ return "";
}
/**
- * Converts a byte to hex digit and writes to the supplied buffer
+ * Converts a byte to hex digit and writes to the supplied builder
*/
- private static void byte2hex(byte b, StringBuffer buf) {
+ private static void byte2hex(byte b, StringBuilder buf) {
char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'A', 'B', 'C', 'D', 'E', 'F' };
int high = ((b & 0xf0) >> 4);
int low = (b & 0x0f);
- buf.append(hexChars[high]);
- buf.append(hexChars[low]);
+ buf.append(hexChars[high])
+ .append(hexChars[low]);
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java
--- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java Fri May 22 09:50:33 2015 +0200
@@ -299,55 +299,60 @@
}
StringBuilder sb = new StringBuilder();
- sb.append("[\n");
- sb.append(" " + version.toString() + "\n");
- sb.append(" Subject: " + subject.toString() + "\n");
- sb.append(" Signature Algorithm: " + algId.toString() + "\n");
- sb.append(" Key: " + pubKey.toString() + "\n");
- sb.append(" " + interval.toString() + "\n");
- sb.append(" Issuer: " + issuer.toString() + "\n");
- sb.append(" " + serialNum.toString() + "\n");
+ sb.append("[\n")
+ .append(" ").append(version).append('\n')
+ .append(" Subject: ").append(subject).append('\n')
+ .append(" Signature Algorithm: ").append(algId).append('\n')
+ .append(" Key: ").append(pubKey).append('\n')
+ .append(" ").append(interval).append('\n')
+ .append(" Issuer: ").append(issuer).append('\n')
+ .append(" ").append(serialNum).append('\n');
// optional v2, v3 extras
if (issuerUniqueId != null) {
- sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n");
+ sb.append(" Issuer Id:\n").append(issuerUniqueId).append('\n');
}
if (subjectUniqueId != null) {
- sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n");
+ sb.append(" Subject Id:\n").append(subjectUniqueId).append('\n');
}
if (extensions != null) {
Collection allExts = extensions.getAllExtensions();
Extension[] exts = allExts.toArray(new Extension[0]);
- sb.append("\nCertificate Extensions: " + exts.length);
+ sb.append("\nCertificate Extensions: ").append(exts.length);
for (int i = 0; i < exts.length; i++) {
- sb.append("\n[" + (i+1) + "]: ");
+ sb.append("\n[").append(i+1).append("]: ");
Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
- sb.append(ext.toString());
+ sb.append(ext);
byte[] extValue = ext.getExtensionValue();
if (extValue != null) {
DerOutputStream out = new DerOutputStream();
out.putOctetString(extValue);
extValue = out.toByteArray();
HexDumpEncoder enc = new HexDumpEncoder();
- sb.append("Extension unknown: "
- + "DER encoded OCTET string =\n"
- + enc.encodeBuffer(extValue) + "\n");
+ sb.append("Extension unknown: ")
+ .append("DER encoded OCTET string =\n")
+ .append(enc.encodeBuffer(extValue))
+ .append('\n');
}
- } else
- sb.append(ext.toString()); //sub-class exists
+ } else {
+ sb.append(ext); //sub-class exists
+ }
} catch (Exception e) {
sb.append(", Error parsing this extension");
}
}
Map invalid = extensions.getUnparseableExtensions();
if (invalid.isEmpty() == false) {
- sb.append("\nUnparseable certificate extensions: " + invalid.size());
+ sb.append("\nUnparseable certificate extensions: ")
+ .append(invalid.size());
int i = 1;
for (Extension ext : invalid.values()) {
- sb.append("\n[" + (i++) + "]: ");
- sb.append(ext);
+ sb.append("\n[")
+ .append(i++)
+ .append("]: ")
+ .append(ext);
}
}
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/CompactByteArray.java
--- a/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java Fri May 22 09:50:33 2015 +0200
@@ -49,7 +49,7 @@
* Han ideographs have the same value. However, lookup is much faster than a
* hash table.
* A compact array of any primitive data type serves two purposes:
- *
+ *
*
Fast access of the indexed values.
*
Smaller memory footprint.
*
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java
--- a/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java Fri May 22 09:50:33 2015 +0200
@@ -50,7 +50,7 @@
}
/**
- * Construct a new ComposedCharIter. The iterator will return
+ * Construct a new {@code ComposedCharIter}. The iterator will return
* all Unicode characters with canonical decompositions, excluding Korean
* Hangul characters.
*/
@@ -58,10 +58,10 @@
/**
* Returns the next precomposed Unicode character.
- * Repeated calls to next return all of the precomposed characters defined
+ * Repeated calls to {@code next} return all of the precomposed characters defined
* by Unicode, in ascending order. After all precomposed characters have
- * been returned, {@link #hasNext} will return false and further calls
- * to next will return {@link #DONE}.
+ * been returned, {@link #hasNext} will return {@code false} and further calls
+ * to {@code next} will return {@link #DONE}.
*/
public int next() {
if (curChar == decompNum - 1) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/Normalizer.java
--- a/jdk/src/java.base/share/classes/sun/text/Normalizer.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/Normalizer.java Fri May 22 09:50:33 2015 +0200
@@ -32,7 +32,7 @@
* This Normalizer is for Unicode 3.2 support for IDNA only.
* Developers should not use this class.
*
- * @ since 1.6
+ * @since 1.6
*/
public final class Normalizer {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java
--- a/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java Fri May 22 09:50:33 2015 +0200
@@ -81,14 +81,13 @@
*
*
General remarks about the API:
*
- * The "limit" of a sequence of characters is the position just after
+ * The "limit" of a sequence of characters is the position just after
* their last character, i.e., one more than that position.
*
*
- * Some of the API methods provide access to "runs". Such a
- * "run" is defined as a sequence of characters that are at the same
+ * Some of the API methods provide access to "runs". Such a
+ * "run" is defined as a sequence of characters that are at the same
* embedding level after performing the Bidi algorithm.
- *
*
*
Basic concept: paragraph
* A piece of text can be divided into several paragraphs by characters
@@ -141,7 +140,8 @@
* these special values are designed that way. Also, the implementation
* assumes that MAX_EXPLICIT_LEVEL is odd.
*
- *
See Also:
+ *
See Also:
+ *
*
{@link #LEVEL_DEFAULT_LTR}
*
{@link #LEVEL_DEFAULT_RTL}
*
{@link #LEVEL_OVERRIDE}
@@ -153,7 +153,8 @@
* Reordering mode values indicate which variant of the Bidi algorithm to
* use.
*
- *
*/
public class BidiBase {
@@ -2419,9 +2421,9 @@
* (same index) character if the level has the
* LEVEL_OVERRIDE bit set.
* Except for that bit, it must be
- * paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL,
+ * {@code paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL},
* with one exception: a level of zero may be specified for a
- * paragraph separator even if paraLevel>0 when multiple
+ * paragraph separator even if {@code paraLevel > 0} when multiple
* paragraphs are submitted in the same call to setPara().
* Caution: A reference to this array, not a copy
* of the levels, will be stored in the Bidi object;
@@ -2680,7 +2682,7 @@
* For example, in pure LTR text with numbers the numbers would get
* a resolved level of 2 higher than the surrounding text according to
* the algorithm. This implementation may set all resolved levels to
- * the same value in such a case.
+ * the same value in such a case.
*
* @param paragraph a paragraph of text with optional character and
* paragraph attribute information
@@ -2817,7 +2819,7 @@
}
/**
- * Get the index of a paragraph, given a position within the text.
+ * Get the index of a paragraph, given a position within the text.
*
* @param charIndex is the index of a character within the text, in the
* range [0..getProcessedLength()-1].
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java
--- a/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java Fri May 22 09:50:33 2015 +0200
@@ -42,7 +42,7 @@
/**
* A BidiRun represents a sequence of characters at the same embedding level.
* The Bidi algorithm decomposes a piece of text into sequences of characters
- * at the same embedding level, each such sequence is called a run.
+ * at the same embedding level, each such sequence is called a "run".
*
*
A BidiRun represents such a run by storing its essential properties,
* but does not duplicate the characters which form the run.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java Fri May 22 09:50:33 2015 +0200
@@ -65,7 +65,7 @@
/**
*
ICU data header reader method.
* Takes a ICU generated big-endian input stream, parse the ICU standard
- * file header and authenticates them.
+ * file header and authenticates them.
*
Header format:
*
*
Header size (char)
@@ -84,7 +84,7 @@
* [0] major [1] minor [2] milli [3] micro
*
Unicode version (4 bytes) this ICU is based on.
*
- *
+ *
*
* Example of use:
*
@@ -98,7 +98,7 @@
* System.out.println("This is not a ICU data file");
* }
*
- *
+ *
* @param inputStream input stream that contains the ICU data header
* @param dataFormatIDExpected Data format expected. An array of 4 bytes
* information about the data format.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java Fri May 22 09:50:33 2015 +0200
@@ -58,7 +58,7 @@
* trie.
* @param inputStream file input stream to a ICU data file, containing
* the trie
- * @param dataManipulate object which provides methods to parse the char
+ * @param datamanipulate object which provides methods to parse the char
* data
* @throws IOException thrown when data reading fails
* @draft 2.1
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java Fri May 22 09:50:33 2015 +0200
@@ -55,16 +55,16 @@
* In Unicode, this can be encoded as a single character (the
* "composed" form):
*
- *
+ *
* 00C1 LATIN CAPITAL LETTER A WITH ACUTE
- *
+ *
*
* or as two separate characters (the "decomposed" form):
*
- *
+ *
* 0041 LATIN CAPITAL LETTER A
* 0301 COMBINING ACUTE ACCENT
- *
+ *
*
* To a user of your program, however, both of these sequences should be
* treated as the same "user-level" character "A with acute accent". When you
@@ -76,17 +76,17 @@
*
* Similarly, the string "ffi" can be encoded as three separate letters:
*
- *
+ *
* 0066 LATIN SMALL LETTER F
* 0066 LATIN SMALL LETTER F
* 0069 LATIN SMALL LETTER I
- *
+ *
*
* or as the single character
*
- *
+ *
* FB03 LATIN SMALL LIGATURE FFI
- *
+ *
*
* The ffi ligature is not a distinct semantic character, and strictly speaking
* it shouldn't be in Unicode at all, but it was included for compatibility
@@ -555,12 +555,12 @@
//-------------------------------------------------------------------------
/**
- * Creates a new Normalizer object for iterating over the
+ * Creates a new {@code Normalizer} object for iterating over the
* normalized form of a given string.
*
- * The options parameter specifies which optional
- * Normalizer features are to be enabled for this object.
- *
+ * The {@code options} parameter specifies which optional
+ * {@code Normalizer} features are to be enabled for this object.
+ *
* @param str The string to be normalized. The normalization
* will start at the beginning of the string.
*
@@ -579,9 +579,9 @@
}
/**
- * Creates a new Normalizer object for iterating over the
+ * Creates a new {@code Normalizer} object for iterating over the
* normalized form of the given text.
- *
+ *
* @param iter The input text to be normalized. The normalization
* will start at the beginning of the string.
*
@@ -592,9 +592,9 @@
}
/**
- * Creates a new Normalizer object for iterating over the
+ * Creates a new {@code Normalizer} object for iterating over the
* normalized form of the given text.
- *
+ *
* @param iter The input text to be normalized. The normalization
* will start at the beginning of the string.
*
@@ -615,13 +615,13 @@
}
/**
- * Clones this Normalizer object. All properties of this
+ * Clones this {@code Normalizer} object. All properties of this
* object are duplicated in the new object, including the cloning of any
* {@link CharacterIterator} that was passed in to the constructor
* or to {@link #setText(CharacterIterator) setText}.
* However, the text storage underlying
- * the CharacterIterator is not duplicated unless the
- * iterator's clone method does so.
+ * the {@code CharacterIterator} is not duplicated unless the
+ * iterator's {@code clone} method does so.
* @stable ICU 2.8
*/
public Object clone() {
@@ -791,7 +791,7 @@
//-------------------------------------------------------------------------
/**
- * Return the current character in the normalized text->
+ * Return the current character in the normalized text.
* @return The codepoint as an int
* @stable ICU 2.8
*/
@@ -872,10 +872,10 @@
* while {@link #next} and {@link #previous} iterate through characters
* in the normalized output. This means that there is not
* necessarily a one-to-one correspondence between characters returned
- * by next and previous and the indices passed to and
- * returned from setIndex and {@link #getIndex}.
- *
- * @param index the desired index in the input text->
+ * by {@code next} and {@code previous} and the indices passed to and
+ * returned from {@code setIndex} and {@link #getIndex}.
+ *
+ * @param index the desired index in the input text.
*
* @return the first normalized character that is the result of iterating
* forward starting at the given index.
@@ -894,8 +894,8 @@
/**
* Retrieve the index of the start of the input text. This is the begin
- * index of the CharacterIterator or the start (i.e. 0) of the
- * String over which this Normalizer is iterating
+ * index of the {@code CharacterIterator} or the start (i.e. 0) of the
+ * {@code String} over which this {@code Normalizer} is iterating
* @deprecated ICU 2.2. Use startIndex() instead.
* @return The codepoint as an int
* @see #startIndex
@@ -907,8 +907,8 @@
/**
* Retrieve the index of the end of the input text. This is the end index
- * of the CharacterIterator or the length of the String
- * over which this Normalizer is iterating
+ * of the {@code CharacterIterator} or the length of the {@code String}
+ * over which this {@code Normalizer} is iterating
* @deprecated ICU 2.2. Use endIndex() instead.
* @return The codepoint as an int
* @see #endIndex
@@ -927,9 +927,9 @@
* Note: This method sets the position in the input, while
* {@link #next} and {@link #previous} iterate through characters in the
* output. This means that there is not necessarily a one-to-one
- * correspondence between characters returned by next and
- * previous and the indices passed to and returned from
- * setIndex and {@link #getIndex}.
+ * correspondence between characters returned by {@code next} and
+ * {@code previous} and the indices passed to and returned from
+ * {@code setIndex} and {@link #getIndex}.
* @return The current iteration position
* @stable ICU 2.8
*/
@@ -942,9 +942,9 @@
}
/**
- * Retrieve the index of the end of the input text-> This is the end index
- * of the CharacterIterator or the length of the String
- * over which this Normalizer is iterating
+ * Retrieve the index of the end of the input text. This is the end index
+ * of the {@code CharacterIterator} or the length of the {@code String}
+ * over which this {@code Normalizer} is iterating
* @return The current iteration position
* @stable ICU 2.8
*/
@@ -963,9 +963,9 @@
* return previously buffers characters in the old normalization mode
* until the iteration is able to re-sync at the next base character.
* It is safest to call {@link #setText setText()}, {@link #first},
- * {@link #last}, etc. after calling setMode.
- *
- * @param newMode the new mode for this Normalizer.
+ * {@link #last}, etc. after calling {@code setMode}.
+ *
+ * @param newMode the new mode for this {@code Normalizer}.
* The supported modes are:
*
*
{@link #COMPOSE} - Unicode canonical decompositiion
@@ -985,7 +985,7 @@
mode = newMode;
}
/**
- * Return the basic operation performed by this Normalizer
+ * Return the basic operation performed by this {@code Normalizer}
*
* @see #setMode
* @stable ICU 2.8
@@ -995,8 +995,8 @@
}
/**
- * Set the input text over which this Normalizer will iterate.
- * The iteration position is set to the beginning of the input text->
+ * Set the input text over which this {@code Normalizer} will iterate.
+ * The iteration position is set to the beginning of the input text.
* @param newText The new string to be normalized.
* @stable ICU 2.8
*/
@@ -1011,8 +1011,8 @@
}
/**
- * Set the input text over which this Normalizer will iterate.
- * The iteration position is set to the beginning of the input text->
+ * Set the input text over which this {@code Normalizer} will iterate.
+ * The iteration position is set to the beginning of the input text.
* @param newText The new string to be normalized.
* @stable ICU 2.8
*/
@@ -1571,7 +1571,7 @@
//
/**
- * Creates a new Normalizer object for iterating over the
+ * Creates a new {@code Normalizer} object for iterating over the
* normalized form of a given string.
*
* @param str The string to be normalized. The normalization
@@ -1646,7 +1646,6 @@
* perform further tests to arrive at a true/false result.
* @param str the input string to be checked to see if it is normalized
* @param form the normalization form
- * @param options the optional features to be enabled.
*/
public static boolean isNormalized(String str, Normalizer.Form form) {
return isNormalized(str, form, UNICODE_LATEST);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java Fri May 22 09:50:33 2015 +0200
@@ -38,12 +38,13 @@
package sun.text.normalizer;
/**
- *
Interface for enabling iteration over sets of ,
+ *
Interface for enabling iteration over sets of
+ * {@code },
* where index is the sorted integer index in ascending order and value, its
- * associated integer value.
+ * associated integer value.
*
The result for each iteration is the consecutive range of
- * with the same value. Result is represented by
- * where
+ * {@code } with the same value. Result is represented by
+ * {@code } where
*
*
start is the starting integer of the result range
*
limit is 1 after the maximum integer that follows start, such that
@@ -56,10 +57,10 @@
* Hence value(start) = value(start + 1) = .... = value(start + n) = .... =
* value(limit - 1). However value(start -1) != value(start) and
* value(limit) != value(start).
- *
+ *
*
Most implementations will be created by factory methods, such as the
* character type iterator in UCharacter.getTypeIterator. See example below.
- *
If there is no previous character (i.e. start == 0), use the
* following character
*
If there is no following character (i.e. the replaceable was
- * empty), use default metadata
+ * empty), use default metadata
*
If the code point U+FFFF is seen, it should be interpreted as
- * a special marker having no metadata
- *
+ * a special marker having no metadata
*
* If this is not the behavior, the subclass should document any differences.
*
@@ -111,10 +110,10 @@
* starting at index dstStart and ending at index
* dstStart + (srcLimit-srcStart) - 1.
*
- * @param srcStart the beginning index to copy, inclusive; 0
- * <= start <= limit.
+ * @param srcStart the beginning index to copy, inclusive;
+ * {@code 0 <= start <= limit}.
* @param srcLimit the ending index to copy, exclusive;
- * start <= limit <= length().
+ * {@code start <= limit <= length()}.
* @param dst the destination array.
* @param dstStart the start offset in the destination array.
* @stable ICU 2.0
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java Fri May 22 09:50:33 2015 +0200
@@ -109,10 +109,10 @@
* starting at index dstStart and ending at index
* dstStart + (srcLimit-srcStart) - 1.
*
- * @param srcStart the beginning index to copy, inclusive; 0
- * <= start <= limit.
+ * @param srcStart the beginning index to copy, inclusive;
+ * {@code 0 <= start <= limit}.
* @param srcLimit the ending index to copy, exclusive;
- * start <= limit <= length().
+ * {@code start <= limit <= length()}.
* @param dst the destination array.
* @param dstStart the start offset in the destination array.
* @stable ICU 2.0
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java Fri May 22 09:50:33 2015 +0200
@@ -150,14 +150,12 @@
}
/**
- *
Sets the currentIndex to the specified currentIndex in the text and returns that
+ * Sets the currentIndex to the specified currentIndex in the text and returns that
* single UTF16 character at currentIndex.
- * This assumes the text is stored as 16-bit code units.
+ * This assumes the text is stored as 16-bit code units.
* @param currentIndex the currentIndex within the text.
* @exception IllegalArgumentException is thrown if an invalid currentIndex is
* supplied. i.e. currentIndex is out of bounds.
- * @return the character at the specified currentIndex or DONE if the specified
- * currentIndex is equal to the end of the text.
*/
public void setIndex(int currentIndex) {
if (currentIndex < 0 || currentIndex > replaceable.length()) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java Fri May 22 09:50:33 2015 +0200
@@ -101,22 +101,25 @@
public static final int DONE = -1;
/**
- * Bitmask option to enable parsing of variable names. If (options &
- * PARSE_VARIABLES) != 0, then an embedded variable will be expanded to
+ * Bitmask option to enable parsing of variable names.
+ * If {@code (options & PARSE_VARIABLES) != 0},
+ * then an embedded variable will be expanded to
* its value. Variables are parsed using the SymbolTable API.
*/
public static final int PARSE_VARIABLES = 1;
/**
- * Bitmask option to enable parsing of escape sequences. If (options &
- * PARSE_ESCAPES) != 0, then an embedded escape sequence will be expanded
+ * Bitmask option to enable parsing of escape sequences.
+ * If {@code (options & PARSE_ESCAPES) != 0},
+ * then an embedded escape sequence will be expanded
* to its value. Escapes are parsed using Utility.unescapeAt().
*/
public static final int PARSE_ESCAPES = 2;
/**
- * Bitmask option to enable skipping of whitespace. If (options &
- * SKIP_WHITESPACE) != 0, then whitespace characters will be silently
+ * Bitmask option to enable skipping of whitespace.
+ * If {@code (options & SKIP_WHITESPACE) != 0},
+ * then whitespace characters will be silently
* skipped, as if they were not present in the input. Whitespace
* characters are defined by UCharacterProperty.isRuleWhiteSpace().
*/
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java Fri May 22 09:50:33 2015 +0200
@@ -78,7 +78,7 @@
/**
* Lookup the characters associated with this string and return it.
- * Return null if no such name exists. The resultant
+ * Return {@code null} if no such name exists. The resultant
* array may have length zero.
* @param s the symbolic name to lookup
* @return a char array containing the name's value, or null if
@@ -91,7 +91,7 @@
/**
* Lookup the UnicodeMatcher associated with the given character, and
- * return it. Return null if not found.
+ * return it. Return {@code null} if not found.
* @param ch a 32-bit code point from 0 to 0x10FFFF inclusive.
* @return the UnicodeMatcher object represented by the given
* character, or null if there is no mapping for ch.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java Fri May 22 09:50:33 2015 +0200
@@ -160,8 +160,10 @@
/**
* Lead surrogate code points' index displacement in the index array.
+ *
*/
protected static final int LEAD_INDEX_OFFSET_ = 0x2800 >> 5;
/**
@@ -191,7 +193,7 @@
/**
* Number of index (stage 1) entries per lead surrogate.
* Same as number of index entries for 1024 trail surrogates,
- * ==0x400>>INDEX_STAGE_1_SHIFT_
+ * {@code ==0x400>>INDEX_STAGE_1_SHIFT_}
*/
protected static final int SURROGATE_BLOCK_COUNT=(1<Class enabling iteration of the values in a Trie.
+ * Class enabling iteration of the values in a Trie.
*
Result of each iteration contains the interval of codepoints that have
- * the same value type and the value type itself.
+ * the same value type and the value type itself.
*
The comparison of each codepoint value is done via extract(), which the
- * default implementation is to return the value as it is.
+ * default implementation is to return the value as it is.
*
Method extract() can be overwritten to perform manipulations on
- * codepoint values in order to perform specialized comparison.
+ * codepoint values in order to perform specialized comparison.
*
TrieIterator is designed to be a generic iterator for the CharTrie
* and the IntTrie, hence to accommodate both types of data, the return
- * result will be in terms of int (32 bit) values.
- *
See com.ibm.icu.text.UCharacterTypeIterator for examples of use.
+ * result will be in terms of int (32 bit) values.
+ *
See com.ibm.icu.text.UCharacterTypeIterator for examples of use.
*
Notes for porting utrie_enum from icu4c to icu4j:
* Internally, icu4c's utrie_enum performs all iterations in its body. In Java
* sense, the caller will have to pass a object with a callback function
@@ -63,18 +63,17 @@
* the method extract(int) (equivalent to UTrieEnumValue). Independent of icu4j,
* the caller will have to code his own iteration and flesh out the task
* (equivalent to UTrieEnumRange) to be performed in the iteration loop.
- *
- *
There are basically 3 usage scenarios for porting:
+ *
+ *
There are basically 3 usage scenarios for porting:
*
1) UTrieEnumValue is the only implemented callback then just implement a
* subclass of TrieIterator and override the extract(int) method. The
* extract(int) method is analogus to UTrieEnumValue callback.
- *
+ *
*
2) UTrieEnumValue and UTrieEnumRange both are implemented then implement
- * a subclass of TrieIterator, override the extract method and iterate, e.g
- *
- *
utrie_enum(&normTrie, _enumPropertyStartsValue, _enumPropertyStartsRange,
- * set);
- * In Java :
+ * a subclass of TrieIterator, override the extract method and iterate, e.g.
+ * {@code utrie_enum(&normTrie, _enumPropertyStartsValue, _enumPropertyStartsRange,
+ * set);}
+ * In Java:
*
* class TrieIteratorImpl extends TrieIterator{
* public TrieIteratorImpl(Trie data){
@@ -90,17 +89,17 @@
* // port the implementation of _enumPropertyStartsRange
* }
*
- *
+ *
*
3) UTrieEnumRange is the only implemented callback then just implement
* the while loop, when utrie_enum is called
- *
{@code
* API access for C/POSIX character classes is as follows:
* - alpha: isUAlphabetic(c) or hasBinaryProperty(c, UProperty.ALPHABETIC)
* - lower: isULowercase(c) or hasBinaryProperty(c, UProperty.LOWERCASE)
@@ -142,7 +142,7 @@
* - cntrl: getType(c)==CONTROL
* - graph: hasBinaryProperty(c, UProperty.POSIX_GRAPH)
* - print: hasBinaryProperty(c, UProperty.POSIX_PRINT)
- *
+ * }
*
* The C/POSIX character classes are also available in UnicodeSet patterns,
* using patterns like [:graph:] or \p{graph}.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java Fri May 22 09:50:33 2015 +0200
@@ -200,8 +200,7 @@
* iterator obtained by calling getLength().
* Usage:
*
- *
- *
+ *
{@code
* UChacterIterator iter = new UCharacterIterator.getInstance(text);
* char[] buf = new char[iter.getLength()];
* iter.getText(buf);
@@ -217,15 +216,14 @@
* buf = new char[iter.getLength()];
* }
* }
- *
- *
+ * }
*
* @param fillIn an array of chars to fill with the underlying UTF-16 code
* units.
* @param offset the position within the array to start putting the data.
* @return the number of code units added to fillIn, as a convenience
* @exception IndexOutOfBounds exception if there is not enough
- * room after offset in the array, or if offset < 0.
+ * room after offset in the array, or if offset {@literal <} 0.
* @stable ICU 2.4
*/
public abstract int getText(char[] fillIn, int offset);
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java Fri May 22 09:50:33 2015 +0200
@@ -38,26 +38,26 @@
/**
*
Standalone utility class providing UTF16 character conversions and
- * indexing conversions.
+ * indexing conversions.
*
Code that uses strings alone rarely need modification.
* By design, UTF-16 does not allow overlap, so searching for strings is a safe
* operation. Similarly, concatenation is always safe. Substringing is safe if
* the start and end are both on UTF-32 boundaries. In normal code, the values
* for start and end are on those boundaries, since they arose from operations
* like searching. If not, the nearest UTF-32 boundaries can be determined
- * using bounds().
+ * using bounds().
* Examples:
*
The following examples illustrate use of some of these methods.
- *
+ *
{@code
* // iteration forwards: Original
- * for (int i = 0; i < s.length(); ++i) {
+ * for (int i = 0; i < s.length(); ++i) {
* char ch = s.charAt(i);
* doSomethingWith(ch);
* }
*
* // iteration forwards: Changes for UTF-32
* int ch;
- * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) {
+ * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) {
* ch = UTF16.charAt(s,i);
* doSomethingWith(ch);
* }
@@ -74,7 +74,7 @@
* ch = UTF16.charAt(s,i);
* doSomethingWith(ch);
* }
- *
+ * }
* Notes:
*
*
@@ -515,12 +515,12 @@
/**
*
Converts argument code point and returns a String object representing
- * the code point's value in UTF16 format.
+ * the code point's value in UTF16 format.
*
This method does not check for the validity of the codepoint, the
* results are not guaranteed if a invalid codepoint is passed as
- * argument.
+ * argument.
*
The result is a string whose length is 1 for non-supplementary code
- * points, 2 otherwise.
+ * points, 2 otherwise.
* @param ch code point
* @return string representation of the code point
*/
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java Fri May 22 09:50:33 2015 +0200
@@ -45,7 +45,8 @@
public interface UnicodeMatcher {
/**
- * The character at index i, where i < contextStart || i >= contextLimit,
+ * The character at index {@code i}, where
+ * {@code i < contextStart || i >= contextLimit},
* is ETHER. This allows explicit matching by rules and UnicodeSets
* of text outside the context. In traditional terms, this allows anchoring
* at the start and/or end.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java Fri May 22 09:50:33 2015 +0200
@@ -107,8 +107,8 @@
*
*
*
[a{ab}{ac}]
- *
The character 'a' and the multicharacter strings "ab" and
- * "ac"
+ *
The character 'a' and the multicharacter strings "ab" and
+ * "ac"
*
*
*
[\p{Lu}]
@@ -148,10 +148,10 @@
* literal. Thus "[a\\-b]", "[-ab]", and "[ab-]" all indicate the same
* set of three characters, 'a', 'b', and '-'.
*
- *
Sets may be intersected using the '&' operator or the asymmetric
+ *
Sets may be intersected using the {@literal '&'} operator or the asymmetric
* set difference may be taken using the '-' operator, for example,
- * "[[:L:]&[\\u0000-\\u0FFF]]" indicates the set of all Unicode letters
- * with values less than 4096. Operators ('&' and '|') have equal
+ * "{@code [[:L:]&[\\u0000-\\u0FFF]]}" indicates the set of all Unicode letters
+ * with values less than 4096. Operators ({@literal '&'} and '|') have equal
* precedence and bind left-to-right. Thus
* "[[:L:]-[a-z]-[\\u0100-\\u01FF]]" is equivalent to
* "[[[:L:]-[a-z]]-[\\u0100-\\u01FF]]". This only really matters for
@@ -166,7 +166,7 @@
* that is, U+0000 through 'a'-1 and 'z'+1 through U+10FFFF
*
[[pat1][pat2]]
*
The union of sets specified by pat1 and pat2
- *
[[pat1]&[pat2]]
+ *
[[pat1]&[pat2]]
*
The intersection of sets specified by pat1 and pat2
*
[[pat1]-[pat2]]
*
The asymmetric difference of sets specified by pat1 and
@@ -227,7 +227,7 @@
*
*
*
property :=
- *
a Unicode property set pattern
+ *
a Unicode property set pattern
*
*
*
@@ -337,8 +337,8 @@
}
/**
- * Constructs a set containing the given range. If end >
- * start then an empty set is created.
+ * Constructs a set containing the given range.
+ * If {@code end > start} then an empty set is created.
*
* @param start first character, inclusive, of range
* @param end last character, inclusive, of range
@@ -651,7 +651,7 @@
* Adds the specified multicharacter to this set if it is not already
* present. If this set already contains the multicharacter,
* the call leaves this set unchanged.
- * Thus "ch" => {"ch"}
+ * Thus {@code "ch" => {"ch"}}
* Warning: you cannot add an empty string ("") to a UnicodeSet.
* @param s the source string
* @return this object, for chaining
@@ -691,7 +691,7 @@
/**
* Complements the specified range in this set. Any character in
* the range will be removed if it is in this set, or will be
- * added if it is not in this set. If end > start
+ * added if it is not in this set. If {@code end > start}
* then an empty range is complemented, leaving the set unchanged.
*
* @param start first character, inclusive, of range to be removed
@@ -1698,8 +1698,8 @@
* Modifies this set to contain those code points which have the
* given value for the given property. Prior contents of this
* set are lost.
- * @param propertyAlias
- * @param valueAlias
+ * @param propertyAlias the property alias
+ * @param valueAlias the value alias
* @param symbols if not null, then symbols are first called to see if a property
* is available. If true, then everything else is skipped.
* @return this set
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java Fri May 22 09:50:33 2015 +0200
@@ -73,35 +73,35 @@
public class UnicodeSetIterator {
/**
- * Value of codepoint if the iterator points to a string.
- * If codepoint == IS_STRING, then examine
- * string for the current iteration result.
+ * Value of {@code codepoint} if the iterator points to a string.
+ * If {@code codepoint == IS_STRING}, then examine
+ * {@code string} for the current iteration result.
* @stable ICU 2.0
*/
public static int IS_STRING = -1;
/**
- * Current code point, or the special value IS_STRING, if
+ * Current code point, or the special value {@code IS_STRING}, if
* the iterator points to a string.
* @stable ICU 2.0
*/
public int codepoint;
/**
- * When iterating over ranges using nextRange(),
- * codepointEnd contains the inclusive end of the
- * iteration range, if codepoint != IS_STRING. If
- * iterating over code points using next(), or if
- * codepoint == IS_STRING, then the value of
- * codepointEnd is undefined.
+ * When iterating over ranges using {@code nextRange()},
+ * {@code codepointEnd} contains the inclusive end of the
+ * iteration range, if {@code codepoint != IS_STRING}. If
+ * iterating over code points using {@code next()}, or if
+ * {@code codepoint == IS_STRING}, then the value of
+ * {@code codepointEnd} is undefined.
* @stable ICU 2.0
*/
public int codepointEnd;
/**
- * If codepoint == IS_STRING, then string points
- * to the current string. If codepoint != IS_STRING, the
- * value of string is undefined.
+ * If {@code codepoint == IS_STRING}, then {@code string} points
+ * to the current string. If {@code codepoint != IS_STRING}, the
+ * value of {@code string} is undefined.
* @stable ICU 2.0
*/
public String string;
@@ -118,17 +118,17 @@
/**
* Returns the next element in the set, either a code point range
* or a string. If there are no more elements in the set, return
- * false. If codepoint == IS_STRING, the value is a
- * string in the string field. Otherwise the value is a
- * range of one or more code points from codepoint to
- * codepointeEnd inclusive.
+ * false. If {@code codepoint == IS_STRING}, the value is a
+ * string in the {@code string} field. Otherwise the value is a
+ * range of one or more code points from {@code codepoint} to
+ * {@code codepointeEnd} inclusive.
*
*
The order of iteration is all code points ranges in sorted
* order, followed by all strings sorted order. Ranges are
- * disjoint and non-contiguous. string is undefined
- * unless codepoint == IS_STRING. Do not mix calls to
- * next() and nextRange() without calling
- * reset() between them. The results of doing so are
+ * disjoint and non-contiguous. {@code string} is undefined
+ * unless {@code codepoint == IS_STRING}. Do not mix calls to
+ * {@code next()} and {@code nextRange()} without calling
+ * {@code reset()} between them. The results of doing so are
* undefined.
*
* @return true if there was another element in the set and this
@@ -162,8 +162,8 @@
/**
* Sets this iterator to visit the elements of the given set and
* resets it to the start of that set. The iterator is valid only
- * so long as set is valid.
- * @param set the set to iterate over.
+ * so long as {@code set} is valid.
+ * @param uset the set to iterate over.
* @stable ICU 2.0
*/
public void reset(UnicodeSet uset) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java Fri May 22 09:50:33 2015 +0200
@@ -227,7 +227,7 @@
/**
* Convert a integer to size width hex uppercase digits.
- * E.g., hex('a', 4, str) => "0041".
+ * E.g., {@code hex('a', 4, str) => "0041"}.
* Append the output to the given StringBuffer.
* If width is too small to fit, nothing will be appended to output.
*/
@@ -237,7 +237,7 @@
/**
* Convert a integer to size width (minimum) hex uppercase digits.
- * E.g., hex('a', 4, str) => "0041". If the integer requires more
+ * E.g., {@code hex('a', 4, str) => "0041"}. If the integer requires more
* than width digits, more will be used.
*/
public static String hex(int ch, int width) {
@@ -334,8 +334,8 @@
}
/**
- * Escape unprintable characters using uxxxx notation
- * for U+0000 to U+FFFF and Uxxxxxxxx for U+10000 and
+ * Escape unprintable characters using {@code uxxxx} notation
+ * for U+0000 to U+FFFF and {@code Uxxxxxxxx} for U+10000 and
* above. If the character is printable ASCII, then do nothing
* and return FALSE. Otherwise, append the escaped notation and
* return TRUE.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java Fri May 22 09:50:33 2015 +0200
@@ -53,7 +53,7 @@
* @param version version String in the format of "major.minor.milli.micro"
* or "major.minor.milli" or "major.minor" or "major",
* where major, minor, milli, micro are non-negative numbers
- * <= 255. If the trailing version numbers are
+ * {@literal <=} 255. If the trailing version numbers are
* not specified they are taken as 0s. E.g. Version "3.1" is
* equivalent to "3.1.0.0".
* @return an instance of VersionInfo with the argument version.
@@ -98,12 +98,12 @@
/**
* Returns an instance of VersionInfo with the argument version.
- * @param major major version, non-negative number <= 255.
- * @param minor minor version, non-negative number <= 255.
- * @param milli milli version, non-negative number <= 255.
- * @param micro micro version, non-negative number <= 255.
+ * @param major major version, non-negative number {@literal <=} 255.
+ * @param minor minor version, non-negative number {@literal <=} 255.
+ * @param milli milli version, non-negative number {@literal <=} 255.
+ * @param micro micro version, non-negative number {@literal <=} 255.
* @exception throws an IllegalArgumentException when either arguments are
- * negative or > 255
+ * negative or {@literal >} 255
* @stable ICU 2.6
*/
public static VersionInfo getInstance(int major, int minor, int milli,
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/share/conf/security/java.security
--- a/jdk/src/java.base/share/conf/security/java.security Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/share/conf/security/java.security Fri May 22 09:50:33 2015 +0200
@@ -78,6 +78,7 @@
security.provider.tbd=com.sun.security.sasl.Provider
security.provider.tbd=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.tbd=sun.security.smartcardio.SunPCSC
+security.provider.tbd=sun.security.provider.certpath.ldap.JdkLDAP
#ifdef windows
security.provider.tbd=sun.security.mscapi.SunMSCAPI
#endif
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java Fri May 22 09:50:33 2015 +0200
@@ -270,22 +270,6 @@
throw x;
}
- // fail if the file is a directory
- if (flags.read) {
- UnixException exc = null;
- try {
- if (UnixFileAttributes.get(fd).isDirectory()) {
- exc = new UnixException(EISDIR);
- }
- } catch (UnixException x) {
- exc = x;
- }
- if (exc != null) {
- close(fd);
- throw exc;
- }
- }
-
// unlink file immediately if delete on close. The spec is clear that
// an implementation cannot guarantee to unlink the correct file when
// replaced by an attacker after it is opened.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
--- a/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c Fri May 22 09:50:33 2015 +0200
@@ -148,6 +148,13 @@
jint fd = fdval(env, fdo);
int result = 0;
+#ifdef MACOSX
+ result = fcntl(fd, F_FULLFSYNC);
+ if (result == -1 && errno == ENOTSUP) {
+ /* Try fsync() in case F_FULLSYUNC is not implemented on the file system. */
+ result = fsync(fd);
+ }
+#else /* end MACOSX, begin not-MACOSX */
if (md == JNI_FALSE) {
result = fdatasync(fd);
} else {
@@ -163,9 +170,10 @@
if (getfl >= 0 && (getfl & O_ACCMODE) == O_RDONLY) {
return 0;
}
-#endif
+#endif /* _AIX */
result = fsync(fd);
}
+#endif /* not-MACOSX */
return handle(env, result, "Force failed");
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.base/windows/native/libjli/java_md.c
--- a/jdk/src/java.base/windows/native/libjli/java_md.c Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c Fri May 22 09:50:33 2015 +0200
@@ -990,6 +990,26 @@
return JNI_FALSE;
}
+int
+filterArgs(StdArg *stdargs, const int nargc, StdArg **pargv) {
+ StdArg* argv = NULL;
+ int nargs = 0;
+ int i;
+
+ /* Copy the non-vm args */
+ for (i = 0; i < nargc ; i++) {
+ const char *arg = stdargs[i].arg;
+ if (arg[0] == '-' && arg[1] == 'J')
+ continue;
+ argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
+ argv[nargs].arg = JLI_StringDup(arg);
+ argv[nargs].has_wildcard = stdargs[i].has_wildcard;
+ nargs++;
+ }
+ *pargv = argv;
+ return nargs;
+}
+
/*
* At this point we have the arguments to the application, and we need to
* check with original stdargs in order to compare which of these truly
@@ -1005,8 +1025,9 @@
char *ostart, *astart, **nargv;
jboolean needs_expansion = JNI_FALSE;
jmethodID mid;
- int stdargc;
+ int filteredargc, stdargc;
StdArg *stdargs;
+ StdArg *filteredargs;
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK0(cls);
@@ -1017,6 +1038,8 @@
stdargs = JLI_GetStdArgs();
stdargc = JLI_GetStdArgc();
+ filteredargc = filterArgs(stdargs, stdargc, &filteredargs);
+
// sanity check, this should never happen
if (argc > stdargc) {
JLI_TraceLauncher("Warning: app args is larger than the original, %d %d\n", argc, stdargc);
@@ -1025,8 +1048,8 @@
}
// sanity check, match the args we have, to the holy grail
- idx = stdargc - argc;
- ostart = stdargs[idx].arg;
+ idx = filteredargc - argc;
+ ostart = filteredargs[idx].arg;
astart = strv[0];
// sanity check, ensure that the first argument of the arrays are the same
if (JLI_StrCmp(ostart, astart) != 0) {
@@ -1039,8 +1062,8 @@
// make a copy of the args which will be expanded in java if required.
nargv = (char **)JLI_MemAlloc(argc * sizeof(char*));
for (i = 0, j = idx; i < argc; i++, j++) {
- jboolean arg_expand = (JLI_StrCmp(stdargs[j].arg, strv[i]) == 0)
- ? stdargs[j].has_wildcard
+ jboolean arg_expand = (JLI_StrCmp(filteredargs[j].arg, strv[i]) == 0)
+ ? filteredargs[j].has_wildcard
: JNI_FALSE;
if (needs_expansion == JNI_FALSE)
needs_expansion = arg_expand;
@@ -1077,5 +1100,6 @@
JLI_MemFree(nargv[i]);
}
JLI_MemFree(nargv);
+ JLI_MemFree(filteredargs);
return outArray;
}
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.logging/share/classes/java/util/logging/LogManager.java
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java Fri May 22 09:50:33 2015 +0200
@@ -33,6 +33,7 @@
import java.lang.ref.WeakReference;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.locks.ReentrantLock;
import sun.misc.JavaAWTAccess;
import sun.misc.ManagedLocalsThread;
import sun.misc.SharedSecrets;
@@ -180,10 +181,16 @@
// initialization has been done)
private volatile boolean readPrimordialConfiguration;
// Have we initialized global (root) handlers yet?
- // This gets set to false in readConfiguration
- private boolean initializedGlobalHandlers = true;
- // True if JVM death is imminent and the exit hook has been called.
- private boolean deathImminent;
+ // This gets set to STATE_UNINITIALIZED in readConfiguration
+ private static final int
+ STATE_INITIALIZED = 0, // initial state
+ STATE_INITIALIZING = 1,
+ STATE_READING_CONFIG = 2,
+ STATE_UNINITIALIZED = 3,
+ STATE_SHUTDOWN = 4; // terminal state
+ private volatile int globalHandlersState; // = STATE_INITIALIZED;
+ // A concurrency lock for reset(), readConfiguration() and Cleaner.
+ private final ReentrantLock configurationLock = new ReentrantLock();
// This list contains the loggers for which some handlers have been
// explicitly configured in the configuration file.
@@ -264,13 +271,12 @@
// before synchronized block. Otherwise deadlocks are possible.
LogManager mgr = manager;
- // If the global handlers haven't been initialized yet, we
- // don't want to initialize them just so we can close them!
- synchronized (LogManager.this) {
- // Note that death is imminent.
- deathImminent = true;
- initializedGlobalHandlers = true;
- }
+ // set globalHandlersState to STATE_SHUTDOWN atomically so that
+ // no attempts are made to (re)initialize the handlers or (re)read
+ // the configuration again. This is terminal state.
+ configurationLock.lock();
+ globalHandlersState = STATE_SHUTDOWN;
+ configurationLock.unlock();
// Do a reset to close all active handlers.
reset();
@@ -1314,8 +1320,14 @@
public void reset() throws SecurityException {
checkPermission();
+
List persistent;
- synchronized (this) {
+
+ // We don't want reset() and readConfiguration()
+ // to run in parallel
+ configurationLock.lock();
+ try {
+ // install new empty properties
props = new Properties();
// make sure we keep the loggers persistent until reset is done.
// Those are the loggers for which we previously created a
@@ -1323,26 +1335,41 @@
// from being gc'ed until those handlers are closed.
persistent = new ArrayList<>(closeOnResetLoggers);
closeOnResetLoggers.clear();
- // Since we are doing a reset we no longer want to initialize
- // the global handlers, if they haven't been initialized yet.
- initializedGlobalHandlers = true;
+
+ // if reset has been called from shutdown-hook (Cleaner),
+ // or if reset has been called from readConfiguration() which
+ // already holds the lock and will change the state itself,
+ // then do not change state here...
+ if (globalHandlersState != STATE_SHUTDOWN &&
+ globalHandlersState != STATE_READING_CONFIG) {
+ // ...else user called reset()...
+ // Since we are doing a reset we no longer want to initialize
+ // the global handlers, if they haven't been initialized yet.
+ globalHandlersState = STATE_INITIALIZED;
+ }
+
+ for (LoggerContext cx : contexts()) {
+ resetLoggerContext(cx);
+ }
+
+ persistent.clear();
+ } finally {
+ configurationLock.unlock();
}
- for (LoggerContext cx : contexts()) {
- Enumeration enum_ = cx.getLoggerNames();
- while (enum_.hasMoreElements()) {
- String name = enum_.nextElement();
- Logger logger = cx.findLogger(name);
- if (logger != null) {
- resetLogger(logger);
- }
+ }
+
+ private void resetLoggerContext(LoggerContext cx) {
+ Enumeration enum_ = cx.getLoggerNames();
+ while (enum_.hasMoreElements()) {
+ String name = enum_.nextElement();
+ Logger logger = cx.findLogger(name);
+ if (logger != null) {
+ resetLogger(logger);
}
}
- persistent.clear();
}
- // Private method to reset an individual target logger.
- private void resetLogger(Logger logger) {
- // Close all the Logger's handlers.
+ private void closeHandlers(Logger logger) {
Handler[] targets = logger.getHandlers();
for (Handler h : targets) {
logger.removeHandler(h);
@@ -1352,6 +1379,14 @@
// Problems closing a handler? Keep going...
}
}
+ }
+
+ // Private method to reset an individual target logger.
+ private void resetLogger(Logger logger) {
+ // Close all the Logger handlers.
+ closeHandlers(logger);
+
+ // Reset Logger level
String name = logger.getName();
if (name != null && name.equals("")) {
// This is the root logger.
@@ -1408,48 +1443,74 @@
*/
public void readConfiguration(InputStream ins) throws IOException, SecurityException {
checkPermission();
- reset();
- // Load the properties
+ // We don't want reset() and readConfiguration() to run
+ // in parallel.
+ configurationLock.lock();
try {
- props.load(ins);
- } catch (IllegalArgumentException x) {
- // props.load may throw an IllegalArgumentException if the stream
- // contains malformed Unicode escape sequences.
- // We wrap that in an IOException as readConfiguration is
- // specified to throw IOException if there are problems reading
- // from the stream.
- // Note: new IOException(x.getMessage(), x) allow us to get a more
- // concise error message than new IOException(x);
- throw new IOException(x.getMessage(), x);
+ if (globalHandlersState == STATE_SHUTDOWN) {
+ // already in terminal state: don't even bother
+ // to read the configuration
+ return;
+ }
+
+ // change state to STATE_READING_CONFIG to signal reset() to not change it
+ globalHandlersState = STATE_READING_CONFIG;
+ try {
+ // reset configuration which leaves globalHandlersState at STATE_READING_CONFIG
+ // so that while reading configuration, any ongoing logging requests block and
+ // wait for the outcome (see the end of this try statement)
+ reset();
+
+ try {
+ // Load the properties
+ props.load(ins);
+ } catch (IllegalArgumentException x) {
+ // props.load may throw an IllegalArgumentException if the stream
+ // contains malformed Unicode escape sequences.
+ // We wrap that in an IOException as readConfiguration is
+ // specified to throw IOException if there are problems reading
+ // from the stream.
+ // Note: new IOException(x.getMessage(), x) allow us to get a more
+ // concise error message than new IOException(x);
+ throw new IOException(x.getMessage(), x);
+ }
+
+ // Instantiate new configuration objects.
+ String names[] = parseClassNames("config");
+
+ for (String word : names) {
+ try {
+ Class> clz = ClassLoader.getSystemClassLoader().loadClass(word);
+ clz.newInstance();
+ } catch (Exception ex) {
+ System.err.println("Can't load config class \"" + word + "\"");
+ System.err.println("" + ex);
+ // ex.printStackTrace();
+ }
+ }
+
+ // Set levels on any pre-existing loggers, based on the new properties.
+ setLevelsOnExistingLoggers();
+
+ // Note that we need to reinitialize global handles when
+ // they are first referenced.
+ globalHandlersState = STATE_UNINITIALIZED;
+ } catch (Throwable t) {
+ // If there were any trouble, then set state to STATE_INITIALIZED
+ // so that no global handlers reinitialization is performed on not fully
+ // initialized configuration.
+ globalHandlersState = STATE_INITIALIZED;
+ // re-throw
+ throw t;
+ }
+ } finally {
+ configurationLock.unlock();
}
- // Instantiate new configuration objects.
- String names[] = parseClassNames("config");
-
- for (String word : names) {
- try {
- Class> clz = ClassLoader.getSystemClassLoader().loadClass(word);
- clz.newInstance();
- } catch (Exception ex) {
- System.err.println("Can't load config class \"" + word + "\"");
- System.err.println("" + ex);
- // ex.printStackTrace();
- }
- }
-
- // Set levels on any pre-existing loggers, based on the new properties.
- setLevelsOnExistingLoggers();
-
- try {
- invokeConfigurationListeners();
- } finally {
- // Note that we need to reinitialize global handles when
- // they are first referenced.
- synchronized (this) {
- initializedGlobalHandlers = false;
- }
- }
+ // should be called out of lock to avoid dead-lock situations
+ // when user code is involved
+ invokeConfigurationListeners();
}
/**
@@ -1576,20 +1637,41 @@
// Private method to load the global handlers.
// We do the real work lazily, when the global handlers
// are first used.
- private synchronized void initializeGlobalHandlers() {
- if (initializedGlobalHandlers) {
+ private void initializeGlobalHandlers() {
+ int state = globalHandlersState;
+ if (state == STATE_INITIALIZED ||
+ state == STATE_SHUTDOWN) {
+ // Nothing to do: return.
return;
}
- initializedGlobalHandlers = true;
-
- if (deathImminent) {
- // Aaargh...
- // The VM is shutting down and our exit hook has been called.
- // Avoid allocating global handlers.
- return;
+ // If we have not initialized global handlers yet (or need to
+ // reinitialize them), lets do it now (this case is indicated by
+ // globalHandlersState == STATE_UNINITIALIZED).
+ // If we are in the process of initializing global handlers we
+ // also need to lock & wait (this case is indicated by
+ // globalHandlersState == STATE_INITIALIZING).
+ // If we are in the process of reading configuration we also need to
+ // wait to see what the outcome will be (this case
+ // is indicated by globalHandlersState == STATE_READING_CONFIG)
+ // So in either case we need to wait for the lock.
+ configurationLock.lock();
+ try {
+ if (globalHandlersState != STATE_UNINITIALIZED) {
+ return; // recursive call or nothing to do
+ }
+ // set globalHandlersState to STATE_INITIALIZING first to avoid
+ // getting an infinite recursion when loadLoggerHandlers(...)
+ // is going to call addHandler(...)
+ globalHandlersState = STATE_INITIALIZING;
+ try {
+ loadLoggerHandlers(rootLogger, null, "handlers");
+ } finally {
+ globalHandlersState = STATE_INITIALIZED;
+ }
+ } finally {
+ configurationLock.unlock();
}
- loadLoggerHandlers(rootLogger, null, "handlers");
}
static final Permission controlPermission = new LoggingPermission("control", null);
@@ -1684,7 +1766,7 @@
// Private method to be called when the configuration has
// changed to apply any level settings to any pre-existing loggers.
- synchronized private void setLevelsOnExistingLoggers() {
+ private void setLevelsOnExistingLoggers() {
Enumeration> enum_ = props.propertyNames();
while (enum_.hasMoreElements()) {
String key = (String)enum_.nextElement();
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.logging/share/classes/java/util/logging/package.html
--- a/jdk/src/java.logging/share/classes/java/util/logging/package.html Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.logging/share/classes/java/util/logging/package.html Fri May 22 09:50:33 2015 +0200
@@ -30,8 +30,7 @@
Provides the classes and interfaces of
-the JavaTM 2
- platform's core logging facilities.
+the Java™ 2 platform's core logging facilities.
The central goal of the logging APIs is to support maintaining and servicing
software at customer sites.
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java
--- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java Fri May 22 09:50:33 2015 +0200
@@ -79,44 +79,46 @@
/**
*
A converter between Java types and the limited set of classes
- * defined by Open MBeans.
+ * defined by Open MBeans.
*
- *
A Java type is an instance of java.lang.reflect.Type. For our
+ *
A Java type is an instance of java.lang.reflect.Type. For our
* purposes, it is either a Class, such as String.class or int.class;
- * or a ParameterizedType, such as List or Map. On J2SE 1.4 and earlier, it can only be a Class.
+ * or a ParameterizedType, such as {@code List} or
+ * {@code Map}.
+ * On J2SE 1.4 and earlier, it can only be a Class.
*
- *
Each Type is associated with an DefaultMXBeanMappingFactory. The
- * DefaultMXBeanMappingFactory defines an OpenType corresponding to the Type, plus a
- * Java class corresponding to the OpenType. For example:
+ *
Each Type is associated with an DefaultMXBeanMappingFactory. The
+ * DefaultMXBeanMappingFactory defines an
+ * OpenType corresponding to the Type, plus a
+ * Java class corresponding to the OpenType. For example:
*
- *
Apart from simple types, arrays, and collections, Java types are
* converted through introspection into CompositeType. The Java type
* must have at least one getter (method such as "int getSize()" or
* "boolean isBig()"), and we must be able to deduce how to
* reconstruct an instance of the Java class from the values of the
- * getters using one of various heuristics.
+ * getters using one of various heuristics.
*
- * @since 1.6
+ * @since 1.6
*/
public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
static abstract class NonNullMXBeanMapping extends MXBeanMapping {
@@ -148,8 +150,8 @@
throws OpenDataException;
/**
- *
True if and only if this MXBeanMapping's toOpenValue and
- * fromOpenValue methods are the identity function.
+ * True if and only if this MXBeanMapping's toOpenValue and
+ * fromOpenValue methods are the identity function.
*/
boolean isIdentity() {
return false;
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java Fri May 22 09:50:33 2015 +0200
@@ -57,8 +57,8 @@
* rspOutgoing to inform that a response is sent out
* for the received request.
* @return the value of the termination flag:
- *
true if the connection is already being terminated,
- * false otherwise.
+ * true if the connection is already being terminated,
+ * false otherwise.
*/
public boolean reqIncoming() {
if (logger.traceOn()) {
@@ -80,8 +80,8 @@
/**
* Tells that a response is sent out for a received request.
* @return the value of the termination flag:
- *
true if the connection is already being terminated,
- * false otherwise.
+ * true if the connection is already being terminated,
+ * false otherwise.
*/
public boolean rspOutgoing() {
if (logger.traceOn()) {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java
--- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java Fri May 22 09:50:33 2015 +0200
@@ -55,17 +55,17 @@
public class EnvHelp {
/**
- *
Name of the attribute that specifies a default class loader
+ * Name of the attribute that specifies a default class loader
* object.
- * The value associated with this attribute is a ClassLoader object
+ * The value associated with this attribute is a ClassLoader object.
*/
private static final String DEFAULT_CLASS_LOADER =
JMXConnectorFactory.DEFAULT_CLASS_LOADER;
/**
- *
Name of the attribute that specifies a default class loader
- * ObjectName.
- * The value associated with this attribute is an ObjectName object
+ * Name of the attribute that specifies a default class loader
+ * ObjectName.
+ * The value associated with this attribute is an ObjectName object.
*/
private static final String DEFAULT_CLASS_LOADER_NAME =
JMXConnectorServerFactory.DEFAULT_CLASS_LOADER_NAME;
@@ -74,7 +74,6 @@
* Get the Connector Server default class loader.
*
* Returns:
- *
*
*
* The ClassLoader object found in env for
@@ -114,6 +113,7 @@
* jmx.remote.default.class.loader.name is specified
* but mbs is null.
*
+ *
* @exception InstanceNotFoundException if
* jmx.remote.default.class.loader.name is specified
* and the ClassLoader MBean is not found in mbs.
@@ -172,7 +172,6 @@
* Get the Connector Client default class loader.
*
* Returns:
- *
*
*
* The ClassLoader object found in env for
@@ -232,7 +231,7 @@
/**
* Returns the cause field of a {@code Throwable} object.
* The cause field can be got only if t has an
- * {@link Throwable#getCause()} method (JDK Version >= 1.4)
+ * {@link Throwable#getCause()} method (JDK Version {@literal >=} 1.4)
* @param t {@code Throwable} on which the cause must be set.
* @return the cause if getCause() succeeded and the got value is not
* null, otherwise return the t.
@@ -254,7 +253,7 @@
/**
- *
Name of the attribute that specifies the size of a notification
+ * Name of the attribute that specifies the size of a notification
* buffer for a connector server. The default value is 1000.
*/
public static final String BUFFER_SIZE_PROPERTY =
@@ -316,10 +315,10 @@
}
/**
- *
Name of the attribute that specifies the maximum number of
- * notifications that a client will fetch from its server.. The
+ * Name of the attribute that specifies the maximum number of
+ * notifications that a client will fetch from its server. The
* value associated with this attribute should be an
- * Integer object. The default value is 1000.
+ * {@code Integer} object. The default value is 1000.
*/
public static final String MAX_FETCH_NOTIFS =
"jmx.remote.x.notification.fetch.max";
@@ -334,10 +333,10 @@
}
/**
- *
Name of the attribute that specifies the timeout for a
+ * Name of the attribute that specifies the timeout for a
* client to fetch notifications from its server. The value
* associated with this attribute should be a Long
- * object. The default value is 60000 milliseconds.
+ * object. The default value is 60000 milliseconds.
*/
public static final String FETCH_TIMEOUT =
"jmx.remote.x.notification.fetch.timeout";
@@ -351,11 +350,12 @@
}
/**
- *
Name of the attribute that specifies an object that will check
+ * Name of the attribute that specifies an object that will check
* accesses to add/removeNotificationListener and also attempts to
* receive notifications. The value associated with this attribute
* should be a NotificationAccessController object.
- * The default value is null.
+ * The default value is null.
+ *
* This field is not public because of its com.sun dependency.
*/
public static final String NOTIF_ACCESS_CONTROLLER =
@@ -630,9 +630,9 @@
}
/**
- *
Name of the attribute that specifies the timeout to keep a
+ * Name of the attribute that specifies the timeout to keep a
* server side connection after answering last client request.
- * The default value is 120000 milliseconds.
+ * The default value is 120000 milliseconds.
*/
public static final String SERVER_CONNECTION_TIMEOUT =
"jmx.remote.x.server.connection.timeout";
@@ -646,9 +646,9 @@
}
/**
- *
Name of the attribute that specifies the period in
- * millisecond for a client to check its connection. The default
- * value is 60000 milliseconds.
+ * Name of the attribute that specifies the period in
+ * millisecond for a client to check its connection. The default
+ * value is 60000 milliseconds.
*/
public static final String CLIENT_CONNECTION_CHECK_PERIOD =
"jmx.remote.x.client.connection.check.period";
@@ -741,13 +741,13 @@
}
/**
- *
Name of the attribute that specifies whether a connector server
+ * Name of the attribute that specifies whether a connector server
* should not prevent the VM from exiting
*/
public static final String JMX_SERVER_DAEMON = "jmx.remote.x.daemon";
/**
- * Returns true if {@value SERVER_DAEMON} is specified in the {@code env}
+ * Returns true if {@value JMX_SERVER_DAEMON} is specified in the {@code env}
* as a key and its value is a String and it is equal to true ignoring case.
*
* @param env
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.management/share/classes/javax/management/package.html
--- a/jdk/src/java.management/share/classes/javax/management/package.html Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.management/share/classes/javax/management/package.html Fri May 22 09:50:33 2015 +0200
@@ -30,7 +30,7 @@
Provides the core classes for the Java Management Extensions.
The Java Management Extensions
- (JMXTM) API is a standard
+ (JMX™) API is a standard
API for management and monitoring. Typical uses include:
@@ -87,8 +87,7 @@
notion of Standard MBeans. A Standard MBean is one
whose attributes and operations are deduced from a Java
interface using certain naming patterns, similar to those used
- by JavaBeansTM. For
- example, consider an interface like this:
+ by JavaBeans™. For example, consider an interface like this:
public interface ConfigurationMBean {
diff -r b455d36ef73c -r c6a387636aa5 jdk/src/java.management/share/classes/javax/management/remote/package.html
--- a/jdk/src/java.management/share/classes/javax/management/remote/package.html Thu May 21 18:23:01 2015 +0300
+++ b/jdk/src/java.management/share/classes/javax/management/remote/package.html Fri May 22 09:50:33 2015 +0200
@@ -1,6 +1,6 @@
- JMXTM Remote API.
+ JMX™ Remote API.
- JMX(TM) "scandir" Example
+ JMX™ "scandir" Example
-
JavaTM Management Extensions (JMXTM) scandir Example
+
Java™ Management Extensions (JMX™) scandir Example
Another common best practice when you want
to improve interoperability is to use directly
the Notification base classes provided in the
- JMXTM API. Do not create your own
+ JMX™ API. Do not create your own
subclasses of these standard classes.
Indeed, if you code your own subclass, a generic
@@ -1974,7 +1974,7 @@
More information on SSL authentication can be obtained from the JavaTM Secure Socket Extension (JSSE) Reference Guide.
+ >Java™ Secure Socket Extension (JSSE) Reference Guide.
To start jconsole with our provided keystore and
truststore, go to the scandir example root directory and
@@ -2202,13 +2202,13 @@
JavaTM Secure Socket Extension (JSSE) Reference Guide:
- comprehensive documentation about the JavaTM Secure Socket
+ >Java™ Secure Socket Extension (JSSE) Reference Guide:
+ comprehensive documentation about the Java™ Secure Socket
Extension (JSSE)