diff --git a/.hgtags b/.hgtags index 5df287b11d4..b8d857ecd41 100644 --- a/.hgtags +++ b/.hgtags @@ -235,3 +235,5 @@ b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 +dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114 +3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index ef0f8b30804..263edf8e122 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -235,3 +235,5 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113 +4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114 +763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115 diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 1d51a304503..92d755af35f 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -514,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION], if test "x$IS_GNU_MAKE" = x; then AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.]) else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[[12]]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[[12]]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.]) else diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 8476ff7e448..edac17dcbc6 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -3865,7 +3865,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1382702260 +DATE_WHEN_GENERATED=1383151988 ############################################################################### # @@ -8323,7 +8323,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8680,7 +8680,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9034,7 +9034,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9393,7 +9393,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9746,7 +9746,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} diff --git a/corba/.hgtags b/corba/.hgtags index 6be005665d2..db7d697f130 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -235,3 +235,5 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113 +0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114 +8d07115924b7d703a5048adb24e8aba751442f13 jdk8-b115 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f794add23e0..9f29bef92ea 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -389,3 +389,7 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 +7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 +3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57 +9ebaac78a8a0061fb9597e07f806498cb626cdeb jdk8-b115 +e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58 diff --git a/hotspot/agent/src/os/bsd/ps_proc.c b/hotspot/agent/src/os/bsd/ps_proc.c index cf4a5d71d75..53cafe1f44e 100644 --- a/hotspot/agent/src/os/bsd/ps_proc.c +++ b/hotspot/agent/src/os/bsd/ps_proc.c @@ -131,7 +131,7 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void static bool ptrace_continue(pid_t pid, int signal) { // pass the signal to the process so we don't swallow it - if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) { + if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) { print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); return false; } @@ -434,7 +434,6 @@ static ps_prochandle_ops process_ops = { // attach to the process. One and only one exposed stuff struct ps_prochandle* Pgrab(pid_t pid) { struct ps_prochandle* ph = NULL; - thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { print_debug("can't allocate memory for ps_prochandle\n"); diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 95f420164ac..ef45285a489 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=56 +HS_BUILD_NUMBER=58 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp index 5750e5f587f..371b6aa7f71 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp @@ -365,7 +365,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; } diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index b229eb34105..7d1957212ce 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3526,8 +3526,12 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, delayed()->sub(Rtsp, Roffset, Rtsp); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { set((-i*offset)+STACK_BIAS, Rscratch); st(G0, Rtsp, Rscratch); } @@ -4099,15 +4103,19 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { void MacroAssembler::encode_klass_not_null(Register r) { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sub(r, G6_heapbase, r); - if (Universe::narrow_klass_shift() != 0) { - assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); - srlx(r, LogKlassAlignmentInBytes, r); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sub(r, G6_heapbase, r); + if (Universe::narrow_klass_shift() != 0) { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); + srlx(r, LogKlassAlignmentInBytes, r); + } + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(r, Universe::narrow_klass_shift(), r); } - reinit_heapbase(); } void MacroAssembler::encode_klass_not_null(Register src, Register dst) { @@ -4115,11 +4123,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { encode_klass_not_null(src); } else { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - set((intptr_t)Universe::narrow_klass_base(), dst); - sub(src, dst, dst); - if (Universe::narrow_klass_shift() != 0) { - srlx(dst, LogKlassAlignmentInBytes, dst); + if (Universe::narrow_klass_base() != NULL) { + set((intptr_t)Universe::narrow_klass_base(), dst); + sub(src, dst, dst); + if (Universe::narrow_klass_shift() != 0) { + srlx(dst, LogKlassAlignmentInBytes, dst); + } + } else { + // shift src into dst + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(src, Universe::narrow_klass_shift(), dst); } } } @@ -4129,14 +4142,16 @@ void MacroAssembler::encode_klass_not_null(Register src, Register dst) { // the instructions they generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // set + add + set - int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 + - insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); - if (Universe::narrow_klass_shift() == 0) { - return num_instrs * BytesPerInstWord; - } else { // sllx - return (num_instrs + 1) * BytesPerInstWord; + int num_instrs = 1; // shift src,dst or add + if (Universe::narrow_klass_base() != NULL) { + // set + add + set + num_instrs += insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + + insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); + if (Universe::narrow_klass_shift() != 0) { + num_instrs += 1; // sllx + } } + return num_instrs * BytesPerInstWord; } // !!! If the instructions that get generated here change then function @@ -4145,13 +4160,17 @@ void MacroAssembler::decode_klass_not_null(Register r) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - if (Universe::narrow_klass_shift() != 0) - sllx(r, LogKlassAlignmentInBytes, r); - add(r, G6_heapbase, r); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + if (Universe::narrow_klass_shift() != 0) + sllx(r, LogKlassAlignmentInBytes, r); + add(r, G6_heapbase, r); + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(r, Universe::narrow_klass_shift(), r); + } } void MacroAssembler::decode_klass_not_null(Register src, Register dst) { @@ -4161,16 +4180,21 @@ void MacroAssembler::decode_klass_not_null(Register src, Register dst) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - if (Universe::narrow_klass_shift() != 0) { - assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sllx(src, LogKlassAlignmentInBytes, dst); - add(dst, G6_heapbase, dst); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + if (Universe::narrow_klass_shift() != 0) { + assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sllx(src, LogKlassAlignmentInBytes, dst); + add(dst, G6_heapbase, dst); + reinit_heapbase(); + } else { + set((intptr_t)Universe::narrow_klass_base(), dst); + add(src, dst, dst); + } } else { - set((intptr_t)Universe::narrow_klass_base(), dst); - add(src, dst, dst); + // shift/mov src into dst. + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(src, Universe::narrow_klass_shift(), dst); } } } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index eea306b4130..9d3856245f2 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1660,12 +1660,16 @@ void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const { if (UseCompressedClassPointers) { assert(Universe::heap() != NULL, "java heap should be initialized"); st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass"); - st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); - if (Universe::narrow_klass_shift() != 0) { - st->print_cr("\tSLL R_G5,3,R_G5"); + if (Universe::narrow_klass_base() != 0) { + st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); + if (Universe::narrow_klass_shift() != 0) { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); + } + st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); + st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); + } else { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); } - st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); - st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); } else { st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check"); } @@ -2912,6 +2916,9 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{ __ bind(LSkip2); } + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + __ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg); __ br(Assembler::equal, true, Assembler::pn, Ldone); __ delayed()->mov(O7, result_reg); // result is difference in lengths @@ -2969,6 +2976,9 @@ enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI r Register chr1_reg = result_reg; Register chr2_reg = tmp1_reg; + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + //check for alignment and position the pointers to the ends __ or3(str1_reg, str2_reg, chr1_reg); __ andcc(chr1_reg, 0x3, chr1_reg); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index b6f8a5a5d1a..40847f8c2df 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -153,13 +153,9 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; - - Label cont; - address compiled_entry = __ pc(); - +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); + #if !defined(_LP64) && defined(COMPILER2) // All return values are where we want them, except for Longs. C2 returns // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. @@ -170,14 +166,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // do this here. Unfortunately if we did a rethrow we'd see an machepilog node // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - if (incoming_state == ltos) { + if (state == ltos) { __ srl (G1, 0, O1); __ srlx(G1, 32, O0); } #endif // !_LP64 && COMPILER2 - __ bind(cont); - // The callee returns with the stack possibly adjusted by adapter transition // We remove that possible adjustment here. // All interpreter local registers are untouched. Any result is passed back @@ -186,28 +180,17 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ mov(Llast_SP, SP); // Remove any adapter added stack space. - Label L_got_cache, L_giant_index; const Register cache = G3_scratch; - const Register size = G1_scratch; - if (EnableInvokeDynamic) { - __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. - __ cmp_and_br_short(G1_scratch, Bytecodes::_invokedynamic, Assembler::equal, Assembler::pn, L_giant_index); - } - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); - __ bind(L_got_cache); - __ ld_ptr(cache, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset(), size); - __ and3(size, 0xFF, size); // argument size in words - __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes - __ add(Lesp, size, Lesp); // pop arguments - __ dispatch_next(state, step); + const Register index = G1_scratch; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4)); - __ ba_short(L_got_cache); - } + const Register flags = cache; + __ ld_ptr(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset(), flags); + const Register parameter_size = flags; + __ and3(flags, ConstantPoolCacheEntry::parameter_size_mask, parameter_size); // argument size in words + __ sll(parameter_size, Interpreter::logStackElementSize, parameter_size); // each argument size in bytes + __ add(Lesp, parameter_size, Lesp); // pop arguments + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index c3e8b298d6e..92098113cca 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -2932,9 +2932,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); AddressLiteral table(table_addr); __ set(table, temp); __ sll(ra, LogBytesPerWord, ra); @@ -2984,7 +2982,7 @@ void TemplateTable::invokevirtual(int byte_no) { __ verify_oop(O0_recv); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift @@ -3026,7 +3024,7 @@ void TemplateTable::invokevfinal_helper(Register Rscratch, Register Rret) { __ profile_final_call(O4); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 308befddc77..4a30d597b3e 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1468,19 +1468,18 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { addr = new LIR_Address(src.result(), offset, type); } - if (data != dst) { - __ move(data, dst); - data = dst; - } + // Because we want a 2-arg form of xchg and xadd + __ move(data, dst); + if (x->is_add()) { - __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); } else { if (is_obj) { // Do the pre-write barrier, if any. pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, true /* do_load */, false /* patch */, NULL); } - __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); if (is_obj) { // Seems to be a precise address post_barrier(LIR_OprFact::address(addr), data); diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp index 1eef095b9a5..e669f5b6638 100644 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp @@ -367,7 +367,7 @@ address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicTyp return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index fcadd2ee9a3..b6f2438db83 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -196,7 +196,7 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread) void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(rsi, bcp_offset)); + load_unsigned_short(reg, Address(rsi, bcp_offset)); bswapl(reg); shrl(reg, 16); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index 7758d8fbcb5..520c872a604 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -192,7 +192,7 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp( Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(r13, bcp_offset)); + load_unsigned_short(reg, Address(r13, bcp_offset)); bswapl(reg); shrl(reg, 16); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index c39c50082aa..5059a386371 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1381,8 +1381,12 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { jcc(Assembler::greater, loop); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. movptr(Address(tmp, (-i*os::vm_page_size())), size ); @@ -5049,25 +5053,32 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { } void MacroAssembler::encode_klass_not_null(Register r) { - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); - // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - assert(r != r12_heapbase, "Encoding a klass in r12"); - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - subq(r, r12_heapbase); + if (Universe::narrow_klass_base() != NULL) { + // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. + assert(r != r12_heapbase, "Encoding a klass in r12"); + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + subq(r, r12_heapbase); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(r, LogKlassAlignmentInBytes); } - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + reinit_heapbase(); + } } void MacroAssembler::encode_klass_not_null(Register dst, Register src) { if (dst == src) { encode_klass_not_null(src); } else { - mov64(dst, (int64_t)Universe::narrow_klass_base()); - negq(dst); - addq(dst, src); + if (Universe::narrow_klass_base() != NULL) { + mov64(dst, (int64_t)Universe::narrow_klass_base()); + negq(dst); + addq(dst, src); + } else { + movptr(dst, src); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(dst, LogKlassAlignmentInBytes); @@ -5081,15 +5092,19 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) { // generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). - return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + if (Universe::narrow_klass_base() != NULL) { + // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). + return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + } else { + // longest load decode klass function, mov64, leaq + return 16; + } } // !!! If the instructions that get generated here change then function // instr_size_for_decode_klass_not_null() needs to get updated. void MacroAssembler::decode_klass_not_null(Register r) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); assert(r != r12_heapbase, "Decoding a klass in r12"); // Cannot assert, unverified entry point counts instructions (see .ad file) @@ -5100,14 +5115,15 @@ void MacroAssembler::decode_klass_not_null(Register r) { shlq(r, LogKlassAlignmentInBytes); } // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - addq(r, r12_heapbase); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + addq(r, r12_heapbase); + reinit_heapbase(); + } } void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); if (dst == src) { decode_klass_not_null(dst); @@ -5115,7 +5131,6 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. // Also do not verify_oop as this is called by verify_oop. - mov64(dst, (int64_t)Universe::narrow_klass_base()); if (Universe::narrow_klass_shift() != 0) { assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 880b7732a0b..c7fc0472677 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -150,13 +150,12 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); #ifdef COMPILER2 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { for (int i = 1; i < 8; i++) { __ ffree(i); } @@ -164,7 +163,7 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ empty_FPU_stack(); } #endif - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled"); } else { __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); @@ -172,12 +171,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, // In SSE mode, interpreter returns FP results in xmm0 but they need // to end up back on the FPU so it can operate on them. - if (incoming_state == ftos && UseSSE >= 1) { + if (state == ftos && UseSSE >= 1) { __ subptr(rsp, wordSize); __ movflt(Address(rsp, 0), xmm0); __ fld_s(Address(rsp, 0)); __ addptr(rsp, wordSize); - } else if (incoming_state == dtos && UseSSE >= 2) { + } else if (state == dtos && UseSSE >= 2) { __ subptr(rsp, 2*wordSize); __ movdbl(Address(rsp, 0), xmm0); __ fld_d(Address(rsp, 0)); @@ -194,32 +193,21 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - if (incoming_state == atos) { + if (state == atos) { Register mdp = rbx; Register tmp = rcx; __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset())); - __ andptr(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); - __ dispatch_next(state, step); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 39c49cc4346..ef1aa8409b9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -166,7 +166,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack @@ -183,27 +183,15 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, - in_bytes(ConstantPoolCache::base_offset()) + - 3 * wordSize)); - __ andl(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Address::times_8)); - __ dispatch_next(state, step); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); + __ dispatch_next(state, step); return entry; } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 6e6033b02b6..3c2ec9f426d 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -558,7 +558,7 @@ void TemplateTable::aload() { void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1552,7 +1552,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { InvocationCounter::counter_offset(); // Load up EDX with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) __ sarl(rdx, 16); LP64_ONLY(__ movslq(rdx, rdx)); @@ -2925,9 +2929,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr))); } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 8c49726e5ff..544019c7179 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -568,7 +568,7 @@ void TemplateTable::aload() { } void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1575,7 +1575,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { InvocationCounter::counter_offset(); // Load up edx with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) { @@ -2980,9 +2984,7 @@ void TemplateTable::prepare_invoke(int byte_no, ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ lea(rscratch1, table); __ movptr(flags, Address(rscratch1, flags, Address::times_ptr)); diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 42e88a7374b..27c9af71f17 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1006,7 +1006,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, istate->set_stack_limit(stack_base - method->max_stack() - 1); } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotCallThis(); return NULL; } diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 71b566fceb0..9a304c7f3fb 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -57,6 +57,8 @@ define_pd_global(bool, UseMembar, true); // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 0); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index d1afaabf74d..1bea78444a8 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -945,17 +945,15 @@ extern "C" Thread* get_thread() { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -3582,7 +3580,7 @@ void os::init(void) { Bsd::_main_thread = pthread_self(); Bsd::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); #ifdef __APPLE__ // XXXDARWIN diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 3aeb1b70484..1bb32901540 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1333,17 +1333,15 @@ void os::Linux::capture_initial_stack(size_t max_size) { // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); // nanosecond resolution } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -4750,7 +4748,7 @@ void os::init(void) { Linux::_main_thread = pthread_self(); Linux::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); // pthread_condattr initialization for monotonic clock int status; diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index ad3ebb2ead9..a1d7075af55 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -79,6 +79,15 @@ # include #endif +// needed by current_stack_region() workaround for Mavericks +#if defined(__APPLE__) +# include +# include +# include +# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 +# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 +#endif + #ifdef AMD64 #define SPELL_REG_SP "rsp" #define SPELL_REG_FP "rbp" @@ -828,6 +837,21 @@ static void current_stack_region(address * bottom, size_t * size) { pthread_t self = pthread_self(); void *stacktop = pthread_get_stackaddr_np(self); *size = pthread_get_stacksize_np(self); + // workaround for OS X 10.9.0 (Mavericks) + // pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages + if (pthread_main_np() == 1) { + if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) { + char kern_osrelease[256]; + size_t kern_osrelease_size = sizeof(kern_osrelease); + int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0); + if (ret == 0) { + // get the major number, atoi will ignore the minor amd micro portions of the version string + if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) { + *size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize()); + } + } + } + } *bottom = (address) stacktop - *size; #elif defined(__OpenBSD__) stack_t ss; diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index b56e2828636..ae3034bc969 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -122,7 +122,7 @@ void AbstractAssembler::bind(Label& L) { void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) { if (UseStackBanging) { // Each code entry causes one stack bang n pages down the stack where n - // is configurable by StackBangPages. The setting depends on the maximum + // is configurable by StackShadowPages. The setting depends on the maximum // depth of VM call stack or native before going back into java code, // since only java code can raise a stack overflow exception using the // stack banging mechanism. The VM and native code does not detect stack diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 75e827b3b43..26bb8d0227e 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1873,7 +1873,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // number of implementors for decl_interface is 0 or 1. If // it's 0 then no class implements decl_interface and there's // no point in inlining. - if (!holder->is_loaded() || decl_interface->nof_implementors() != 1) { + if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_default_methods()) { singleton = NULL; } } diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index b7c04dbe825..52dff2642c1 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1138,8 +1138,10 @@ IntervalUseKind LinearScan::use_kind_of_input_operand(LIR_Op* op, LIR_Opr opr) { } } } - - } else if (opr_type != T_LONG) { + // We want to sometimes use logical operations on pointers, in particular in GC barriers. + // Since 64bit logical operations do not current support operands on stack, we have to make sure + // T_OBJECT doesn't get spilled along with T_LONG. + } else if (opr_type != T_LONG LP64_ONLY(&& opr_type != T_OBJECT)) { // integer instruction (note: long operands must always be in register) switch (op->code()) { case lir_cmp: diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index d40e460dcf3..f4389da46a6 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -57,6 +57,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : _init_state = ik->init_state(); _nonstatic_field_size = ik->nonstatic_field_size(); _has_nonstatic_fields = ik->has_nonstatic_fields(); + _has_default_methods = ik->has_default_methods(); _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: _implementor = NULL; // we will fill these lazily diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index fdd93ddc58c..34eb84ccfeb 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -52,6 +52,7 @@ private: bool _has_finalizer; bool _has_subklass; bool _has_nonstatic_fields; + bool _has_default_methods; ciFlags _flags; jint _nonstatic_field_size; @@ -171,6 +172,11 @@ public: } } + bool has_default_methods() { + assert(is_loaded(), "must be loaded"); + return _has_default_methods; + } + ciInstanceKlass* get_canonical_holder(int offset); ciField* get_field_by_offset(int field_offset, bool is_static); ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static); diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 84c191e33bd..e3209ae1868 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -131,6 +131,17 @@ void ClassLoaderData::classes_do(void f(Klass * const)) { } } +void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) { + // Lock to avoid classes being modified/added/removed during iteration + MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); + for (Klass* k = _klasses; k != NULL; k = k->next_link()) { + // Do not filter ArrayKlass oops here... + if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) { + klass_closure->do_klass(k); + } + } +} + void ClassLoaderData::classes_do(void f(InstanceKlass*)) { for (Klass* k = _klasses; k != NULL; k = k->next_link()) { if (k->oop_is_instance()) { @@ -600,6 +611,12 @@ void ClassLoaderDataGraph::classes_do(void f(Klass* const)) { } } +void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) { + for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { + cld->loaded_classes_do(klass_closure); + } +} + void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) { diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index 6d5747483d4..cee114c75e0 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -78,6 +78,7 @@ class ClassLoaderDataGraph : public AllStatic { static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); static void classes_do(KlassClosure* klass_closure); static void classes_do(void f(Klass* const)); + static void loaded_classes_do(KlassClosure* klass_closure); static void classes_unloading_do(void f(Klass* const)); static bool do_unloading(BoolObjectClosure* is_alive); @@ -186,6 +187,7 @@ class ClassLoaderData : public CHeapObj { bool keep_alive() const { return _keep_alive; } bool is_alive(BoolObjectClosure* is_alive_closure) const; void classes_do(void f(Klass*)); + void loaded_classes_do(KlassClosure* klass_closure); void classes_do(void f(InstanceKlass*)); // Deallocate free list during class unloading. diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp index 6b3c910d67c..c05c58748d8 100644 --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp @@ -392,10 +392,16 @@ class MethodFamily : public ResourceObj { } GrowableArray qualified_methods; + int num_defaults = 0; + int default_index = -1; for (int i = 0; i < _members.length(); ++i) { Pair entry = _members.at(i); if (entry.second == QUALIFIED) { qualified_methods.append(entry.first); + default_index++; + if (entry.first->is_default_method()) { + num_defaults++; + } } } @@ -408,6 +414,9 @@ class MethodFamily : public ResourceObj { if (!method->is_abstract()) { _selected_target = qualified_methods.at(0); } + // If only one qualified method is default, select that + } else if (num_defaults == 1) { + _selected_target = qualified_methods.at(default_index); } else { _exception_message = generate_conflicts_message(&qualified_methods,CHECK); _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError(); diff --git a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp index 1f24042f5cb..20404879adb 100644 --- a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp +++ b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp @@ -27,6 +27,7 @@ #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "oops/metadata.hpp" +#include "prims/jvmtiImpl.hpp" #include "runtime/synchronizer.hpp" #include "runtime/thread.hpp" #include "utilities/growableArray.hpp" @@ -48,6 +49,7 @@ MetadataOnStackMark::MetadataOnStackMark() { Threads::metadata_do(Metadata::mark_on_stack); CodeCache::alive_nmethods_do(nmethod::mark_on_stack); CompileBroker::mark_on_stack(); + JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack); } MetadataOnStackMark::~MetadataOnStackMark() { diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index 85735a732fa..c6436364533 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -173,8 +173,6 @@ class SymbolPropertyTable; /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ \ - do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ - \ /* Preload boxing klasses */ \ do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ do_klass(Character_klass, java_lang_Character, Pre ) \ diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index bdfe2abd315..fb47df28267 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -780,6 +780,10 @@ CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) void CompileBroker::compilation_init() { _last_method_compiled[0] = '\0'; + // No need to initialize compilation system if we do not use it. + if (!UseCompiler) { + return; + } #ifndef SHARK // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple); diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 4d7647ce05a..0ebfd1cdf13 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -158,8 +158,8 @@ class AbstractInterpreter: AllStatic { // Runtime support // length = invoke bytecode length (to advance to next bytecode) - static address deopt_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } - static address return_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } static address rethrow_exception_entry() { return _rethrow_exception_entry; } diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 4997a443257..71f78840b95 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -78,7 +78,7 @@ class CppInterpreter: public AbstractInterpreter { static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length); + static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); #ifdef TARGET_ARCH_x86 diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index dfd8b5b145a..60246e9013d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -329,15 +329,21 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { //------------------------------------------------------------------------------------------------------------------------ // Deoptimization support -// If deoptimization happens, this function returns the point of next bytecode to continue execution +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - int bci = method->bci_from(bcp); - int length = -1; // initial value for debugging + + const int bci = method->bci_from(bcp); + // compute continuation length - length = Bytecodes::length_at(method, bcp); + const int length = Bytecodes::length_at(method, bcp); + // compute result type BasicType type = T_ILLEGAL; @@ -393,7 +399,7 @@ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address return is_top_frame ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length); + : Interpreter::return_entry(as_TosState(type), length, code); } // If deoptimization happens, this function returns the point where the interpreter reexecutes diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 9f7ed4c7e97..e3e89e8eed9 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -184,8 +184,9 @@ EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deo EntryPoint TemplateInterpreter::_continuation_entry; EntryPoint TemplateInterpreter::_safept_entry; -address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; -address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; DispatchTable TemplateInterpreter::_active_table; DispatchTable TemplateInterpreter::_normal_table; @@ -237,22 +238,37 @@ void TemplateInterpreterGenerator::generate_all() { #endif // !PRODUCT { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); for (int i = 0; i < Interpreter::number_of_return_entries; i++) { Interpreter::_return_entry[i] = EntryPoint( - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(atos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(ltos, i), - generate_return_entry_for(ftos, i), - generate_return_entry_for(dtos, i), - generate_return_entry_for(vtos, i) + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) ); } } + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + { CodeletMark cm(_masm, "earlyret entry points"); Interpreter::_earlyret_entry = EntryPoint( @@ -298,13 +314,6 @@ void TemplateInterpreterGenerator::generate_all() { } } - for (int j = 0; j < number_of_states; j++) { - const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; - int index = Interpreter::TosState_as_index(states[j]); - Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); - Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); - } - { CodeletMark cm(_masm, "continuation entry points"); Interpreter::_continuation_entry = EntryPoint( @@ -534,9 +543,46 @@ void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState t //------------------------------------------------------------------------------------------------------------------------ // Entry points -address TemplateInterpreter::return_entry(TosState state, int length) { +/** + * Returns the return entry table for the given invoke bytecode. + */ +address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return Interpreter::invoke_return_entry_table(); + case Bytecodes::_invokeinterface: + return Interpreter::invokeinterface_return_entry_table(); + case Bytecodes::_invokedynamic: + return Interpreter::invokedynamic_return_entry_table(); + default: + fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code))); + return NULL; + } +} + +/** + * Returns the return entry address for the given top-of-stack state and bytecode. + */ +address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); - return _return_entry[length].entry(state); + const int index = TosState_as_index(state); + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return _invoke_return_entry[index]; + case Bytecodes::_invokeinterface: + return _invokeinterface_return_entry[index]; + case Bytecodes::_invokedynamic: + return _invokedynamic_return_entry[index]; + default: + assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code))); + return _return_entry[length].entry(state); + } } diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 43fe4bdb1c0..838e2e08473 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -120,8 +120,9 @@ class TemplateInterpreter: public AbstractInterpreter { static EntryPoint _continuation_entry; static EntryPoint _safept_entry; - static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries - static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries + static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries + static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries + static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) @@ -161,12 +162,15 @@ class TemplateInterpreter: public AbstractInterpreter { static address* normal_table() { return _normal_table.table_for(); } // Support for invokes - static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } - static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } - static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table + static address* invoke_return_entry_table() { return _invoke_return_entry; } + static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } + static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } + static int TosState_as_index(TosState state); - static address return_entry (TosState state, int length); - static address deopt_entry (TosState state, int length); + static address* invoke_return_entry_table_for(Bytecodes::Code code); + + static address deopt_entry(TosState state, int length); + static address return_entry(TosState state, int length, Bytecodes::Code code); // Safepoint support static void notice_safepoints(); // stops the thread when reaching a safepoint diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index fb7bdc5b6c2..a80caa96409 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -53,7 +53,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { address generate_ClassCastException_handler(); address generate_ArrayIndexOutOfBounds_handler(const char* name); address generate_continuation_for(TosState state); - address generate_return_entry_for(TosState state, int step); + address generate_return_entry_for(TosState state, int step, size_t index_size); address generate_earlyret_entry_for(TosState state); address generate_deopt_entry_for(TosState state, int step); address generate_safept_entry_for(TosState state, address runtime_entry); diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 1877967408d..f9e3385eb22 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -56,7 +56,7 @@ size_t const allocation_from_dictionary_limit = 4 * K; MetaWord* last_allocated = 0; -size_t Metaspace::_class_metaspace_size; +size_t Metaspace::_compressed_class_space_size; // Used in declarations in SpaceManager and ChunkManager enum ChunkIndex { @@ -2843,6 +2843,8 @@ ChunkManager* Metaspace::_chunk_manager_class = NULL; #define VIRTUALSPACEMULTIPLIER 2 #ifdef _LP64 +static const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); + void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address cds_base) { // Figure out the narrow_klass_base and the narrow_klass_shift. The // narrow_klass_base is the lower of the metaspace base and the cds base @@ -2852,14 +2854,22 @@ void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address address higher_address; if (UseSharedSpaces) { higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); + (address)(metaspace_base + compressed_class_space_size())); lower_base = MIN2(metaspace_base, cds_base); } else { - higher_address = metaspace_base + class_metaspace_size(); + higher_address = metaspace_base + compressed_class_space_size(); lower_base = metaspace_base; + + uint64_t klass_encoding_max = UnscaledClassSpaceMax << LogKlassAlignmentInBytes; + // If compressed class space fits in lower 32G, we don't need a base. + if (higher_address <= (address)klass_encoding_max) { + lower_base = 0; // effectively lower base is zero. + } } + Universe::set_narrow_klass_base(lower_base); - if ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint) { + + if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) { Universe::set_narrow_klass_shift(0); } else { assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces"); @@ -2874,24 +2884,24 @@ bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cd assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); address lower_base = MIN2((address)metaspace_base, cds_base); address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); - return ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint); + (address)(metaspace_base + compressed_class_space_size())); + return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax); } // Try to allocate the metaspace at the requested addr. void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base) { assert(using_class_space(), "called improperly"); assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); - assert(class_metaspace_size() < KlassEncodingMetaspaceMax, + assert(compressed_class_space_size() < KlassEncodingMetaspaceMax, "Metaspace size is too big"); - assert_is_ptr_aligned(requested_addr, _reserve_alignment); - assert_is_ptr_aligned(cds_base, _reserve_alignment); - assert_is_size_aligned(class_metaspace_size(), _reserve_alignment); + assert_is_ptr_aligned(requested_addr, _reserve_alignment); + assert_is_ptr_aligned(cds_base, _reserve_alignment); + assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); // Don't use large pages for the class space. bool large_pages = false; - ReservedSpace metaspace_rs = ReservedSpace(class_metaspace_size(), + ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, requested_addr, 0); @@ -2906,7 +2916,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a while (!metaspace_rs.is_reserved() && (addr + increment > addr) && can_use_cds_with_metaspace_addr(addr + increment, cds_base)) { addr = addr + increment; - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, addr, 0); } } @@ -2917,11 +2927,11 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a // initialization has happened that depends on UseCompressedClassPointers. // So, UseCompressedClassPointers cannot be turned off at this point. if (!metaspace_rs.is_reserved()) { - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages); if (!metaspace_rs.is_reserved()) { vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes", - class_metaspace_size())); + compressed_class_space_size())); } } } @@ -2943,8 +2953,8 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT, Universe::narrow_klass_base(), Universe::narrow_klass_shift()); - gclog_or_tty->print_cr("Metaspace Size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, - class_metaspace_size(), metaspace_rs.base(), requested_addr); + gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, + compressed_class_space_size(), metaspace_rs.base(), requested_addr); } } @@ -3010,7 +3020,7 @@ void Metaspace::ergo_initialize() { MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, _commit_alignment); CompressedClassSpaceSize = restricted_align_down(CompressedClassSpaceSize, _reserve_alignment); - set_class_metaspace_size(CompressedClassSpaceSize); + set_compressed_class_space_size(CompressedClassSpaceSize); } void Metaspace::global_initialize() { @@ -3039,12 +3049,12 @@ void Metaspace::global_initialize() { } #ifdef _LP64 - if (cds_total + class_metaspace_size() > (uint64_t)max_juint) { + if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) { vm_exit_during_initialization("Unable to dump shared archive.", err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space (" SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed " - "klass limit: " SIZE_FORMAT, cds_total, class_metaspace_size(), - cds_total + class_metaspace_size(), (size_t)max_juint)); + "klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(), + cds_total + compressed_class_space_size(), UnscaledClassSpaceMax)); } // Set the compressed klass pointer base so that decoding of these pointers works @@ -3092,7 +3102,8 @@ void Metaspace::global_initialize() { cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment); allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address); } else { - allocate_metaspace_compressed_klass_ptrs((char *)CompressedKlassPointersBase, 0); + char* base = (char*)align_ptr_up(Universe::heap()->reserved_region().end(), _reserve_alignment); + allocate_metaspace_compressed_klass_ptrs(base, 0); } } #endif @@ -3354,6 +3365,11 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, return result; } +size_t Metaspace::class_chunk_size(size_t word_size) { + assert(using_class_space(), "Has to use class space"); + return class_vsm()->calc_chunk_size(word_size); +} + void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { // If result is still null, we are out of memory. if (Verbose && TraceMetadataChunkAllocation) { @@ -3365,9 +3381,19 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s MetaspaceAux::dump(gclog_or_tty); } + bool out_of_compressed_class_space = false; + if (is_class_space_allocation(mdtype)) { + Metaspace* metaspace = loader_data->metaspace_non_null(); + out_of_compressed_class_space = + MetaspaceAux::committed_bytes(Metaspace::ClassType) + + (metaspace->class_chunk_size(word_size) * BytesPerWord) > + CompressedClassSpaceSize; + } + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - const char* space_string = is_class_space_allocation(mdtype) ? "Compressed class space" : - "Metadata space"; + const char* space_string = out_of_compressed_class_space ? + "Compressed class space" : "Metaspace"; + report_java_out_of_memory(space_string); if (JvmtiExport::should_post_resource_exhausted()) { @@ -3380,7 +3406,7 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s vm_exit_during_initialization("OutOfMemoryError", space_string); } - if (is_class_space_allocation(mdtype)) { + if (out_of_compressed_class_space) { THROW_OOP(Universe::out_of_memory_error_class_metaspace()); } else { THROW_OOP(Universe::out_of_memory_error_metaspace()); diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index 974a1aac62d..c22d2170761 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -115,13 +115,13 @@ class Metaspace : public CHeapObj { static size_t align_word_size_up(size_t); // Aligned size of the metaspace. - static size_t _class_metaspace_size; + static size_t _compressed_class_space_size; - static size_t class_metaspace_size() { - return _class_metaspace_size; + static size_t compressed_class_space_size() { + return _compressed_class_space_size; } - static void set_class_metaspace_size(size_t metaspace_size) { - _class_metaspace_size = metaspace_size; + static void set_compressed_class_space_size(size_t size) { + _compressed_class_space_size = size; } static size_t _first_chunk_word_size; @@ -192,6 +192,8 @@ class Metaspace : public CHeapObj { AllocRecord * _alloc_record_head; AllocRecord * _alloc_record_tail; + size_t class_chunk_size(size_t word_size); + public: Metaspace(Mutex* lock, MetaspaceType type); @@ -252,6 +254,7 @@ class Metaspace : public CHeapObj { static bool is_class_space_allocation(MetadataType mdType) { return mdType == ClassType && using_class_space(); } + }; class MetaspaceAux : AllStatic { diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 1f632ae478f..043962c6304 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -677,13 +677,13 @@ jint universe_init() { // HeapBased - Use compressed oops with heap base + encoding. // 4Gb -static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); +static const uint64_t UnscaledOopHeapMax = (uint64_t(max_juint) + 1); // 32Gb -// OopEncodingHeapMax == NarrowOopHeapMax << LogMinObjAlignmentInBytes; +// OopEncodingHeapMax == UnscaledOopHeapMax << LogMinObjAlignmentInBytes; char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode) { assert(is_size_aligned((size_t)OopEncodingHeapMax, alignment), "Must be"); - assert(is_size_aligned((size_t)NarrowOopHeapMax, alignment), "Must be"); + assert(is_size_aligned((size_t)UnscaledOopHeapMax, alignment), "Must be"); assert(is_size_aligned(heap_size, alignment), "Must be"); uintx heap_base_min_address_aligned = align_size_up(HeapBaseMinAddress, alignment); @@ -702,20 +702,40 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // If the total size is small enough to allow UnscaledNarrowOop then // just use UnscaledNarrowOop. } else if ((total_size <= OopEncodingHeapMax) && (mode != HeapBasedNarrowOop)) { - if ((total_size <= NarrowOopHeapMax) && (mode == UnscaledNarrowOop) && + if ((total_size <= UnscaledOopHeapMax) && (mode == UnscaledNarrowOop) && (Universe::narrow_oop_shift() == 0)) { // Use 32-bits oops without encoding and // place heap's top on the 4Gb boundary - base = (NarrowOopHeapMax - heap_size); + base = (UnscaledOopHeapMax - heap_size); } else { // Can't reserve with NarrowOopShift == 0 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); + if (mode == UnscaledNarrowOop || - mode == ZeroBasedNarrowOop && total_size <= NarrowOopHeapMax) { + mode == ZeroBasedNarrowOop && total_size <= UnscaledOopHeapMax) { + // Use zero based compressed oops with encoding and // place heap's top on the 32Gb boundary in case // total_size > 4Gb or failed to reserve below 4Gb. - base = (OopEncodingHeapMax - heap_size); + uint64_t heap_top = OopEncodingHeapMax; + + // For small heaps, save some space for compressed class pointer + // space so it can be decoded with no base. + if (UseCompressedClassPointers && !UseSharedSpaces && + OopEncodingHeapMax <= 32*G) { + + uint64_t class_space = align_size_up(CompressedClassSpaceSize, alignment); + assert(is_size_aligned((size_t)OopEncodingHeapMax-class_space, + alignment), "difference must be aligned too"); + uint64_t new_top = OopEncodingHeapMax-class_space; + + if (total_size <= new_top) { + heap_top = new_top; + } + } + + // Align base to the adjusted top of the heap + base = heap_top - heap_size; } } } else { @@ -737,7 +757,7 @@ char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_O // Set to a non-NULL value so the ReservedSpace ctor computes // the correct no-access prefix. // The final value will be set in initialize_heap() below. - Universe::set_narrow_oop_base((address)NarrowOopHeapMax); + Universe::set_narrow_oop_base((address)UnscaledOopHeapMax); #ifdef _WIN64 if (UseLargePages) { // Cannot allocate guard pages for implicit checks in indexed @@ -833,7 +853,7 @@ jint Universe::initialize_heap() { Universe::set_narrow_oop_use_implicit_null_checks(true); } #endif // _WIN64 - if((uint64_t)Universe::heap()->reserved_region().end() > NarrowOopHeapMax) { + if((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) { // Can't reserve heap below 4Gb. Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); } else { @@ -1029,7 +1049,7 @@ bool universe_post_init() { Handle msg = java_lang_String::create_from_str("Java heap space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_java_heap, msg()); - msg = java_lang_String::create_from_str("Metadata space", CHECK_false); + msg = java_lang_String::create_from_str("Metaspace", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg()); msg = java_lang_String::create_from_str("Compressed class space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg()); diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index a8fa7b3ee0e..510102d4e35 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2393,15 +2393,38 @@ address InstanceKlass::static_field_addr(int offset) { const char* InstanceKlass::signature_name() const { + int hash_len = 0; + char hash_buf[40]; + + // If this is an anonymous class, append a hash to make the name unique + if (is_anonymous()) { + assert(EnableInvokeDynamic, "EnableInvokeDynamic was not set."); + intptr_t hash = (java_mirror() != NULL) ? java_mirror()->identity_hash() : 0; + sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash); + hash_len = (int)strlen(hash_buf); + } + + // Get the internal name as a c string const char* src = (const char*) (name()->as_C_string()); const int src_length = (int)strlen(src); - char* dest = NEW_RESOURCE_ARRAY(char, src_length + 3); - int src_index = 0; + + char* dest = NEW_RESOURCE_ARRAY(char, src_length + hash_len + 3); + + // Add L as type indicator int dest_index = 0; dest[dest_index++] = 'L'; - while (src_index < src_length) { + + // Add the actual class name + for (int src_index = 0; src_index < src_length; ) { dest[dest_index++] = src[src_index++]; } + + // If we have a hash, append it + for (int hash_index = 0; hash_index < hash_len; ) { + dest[dest_index++] = hash_buf[hash_index++]; + } + + // Add the semicolon and the NULL dest[dest_index++] = ';'; dest[dest_index] = '\0'; return dest; diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index c0b4a97fca0..7c292c3ffe5 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1515,7 +1515,10 @@ Bytecodes::Code Method::orig_bytecode_at(int bci) const { return bp->orig_bytecode(); } } - ShouldNotReachHere(); + { + ResourceMark rm; + fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci)); + } return Bytecodes::_shouldnotreachhere; } diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index a896532f5d3..99d3cec271b 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -848,6 +848,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr } #endif + NOT_PRODUCT( verify_barriers(); ) // Now that we know the size of all the monitors we can add a fixed slot // for the original deopt pc. @@ -3018,12 +3019,17 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { // Phi nodes shouldn't be moved. They would only match below if they // had the same control as the MathExactNode. The only time that // would happen is if the Phi is also an input to the MathExact - if (!out->is_Phi()) { - if (out->in(0) == NULL) { - out->set_req(0, non_throwing); - } else if (out->in(0) == ctrl) { - out->set_req(0, non_throwing); - } + // + // Cmp nodes shouldn't have control set at all. + if (out->is_Phi() || + out->is_Cmp()) { + continue; + } + + if (out->in(0) == NULL) { + out->set_req(0, non_throwing); + } else if (out->in(0) == ctrl) { + out->set_req(0, non_throwing); } } } @@ -3368,6 +3374,72 @@ void Compile::verify_graph_edges(bool no_dead_code) { } } } + +// Verify GC barriers consistency +// Currently supported: +// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) +void Compile::verify_barriers() { + if (UseG1GC) { + // Verify G1 pre-barriers + const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active()); + + ResourceArea *area = Thread::current()->resource_area(); + Unique_Node_List visited(area); + Node_List worklist(area); + // We're going to walk control flow backwards starting from the Root + worklist.push(_root); + while (worklist.size() > 0) { + Node* x = worklist.pop(); + if (x == NULL || x == top()) continue; + if (visited.member(x)) { + continue; + } else { + visited.push(x); + } + + if (x->is_Region()) { + for (uint i = 1; i < x->req(); i++) { + worklist.push(x->in(i)); + } + } else { + worklist.push(x->in(0)); + // We are looking for the pattern: + // /->ThreadLocal + // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset) + // \->ConI(0) + // We want to verify that the If and the LoadB have the same control + // See GraphKit::g1_write_barrier_pre() + if (x->is_If()) { + IfNode *iff = x->as_If(); + if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) { + CmpNode *cmp = iff->in(1)->in(1)->as_Cmp(); + if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0 + && cmp->in(1)->is_Load()) { + LoadNode* load = cmp->in(1)->as_Load(); + if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal + && load->in(2)->in(3)->is_Con() + && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) { + + Node* if_ctrl = iff->in(0); + Node* load_ctrl = load->in(0); + + if (if_ctrl != load_ctrl) { + // Skip possible CProj->NeverBranch in infinite loops + if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj) + && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) { + if_ctrl = if_ctrl->in(0)->in(0); + } + } + assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match"); + } + } + } + } + } + } + } +} + #endif // The Compile object keeps track of failure reasons separately from the ciEnv. diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 5eb340df651..5ad53e5d163 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -1148,6 +1148,9 @@ class Compile : public Phase { // graph is strongly connected from root in both directions. void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN; + // Verify GC barrier patterns + void verify_barriers() PRODUCT_RETURN; + // End-of-run dumps. static void print_statistics() PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 6a7ee628844..df6c29f5766 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -2006,9 +2006,9 @@ bool LibraryCallKit::inline_math_addExactI(bool is_increment) { Node* arg2 = NULL; if (is_increment) { - arg2 = intcon(1); + arg2 = intcon(1); } else { - arg2 = argument(1); + arg2 = argument(1); } Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) ); @@ -2056,7 +2056,7 @@ bool LibraryCallKit::inline_math_subtractExactL(bool is_decrement) { if (is_decrement) { arg2 = longcon(1); } else { - Node* arg2 = argument(2); // type long + arg2 = argument(2); // type long // argument(3) == TOP } diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 41c0a9d416d..75f35b7d896 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -713,6 +713,10 @@ bool IdealLoopTree::policy_unroll( PhaseIdealLoop *phase ) const { case Op_ModL: body_size += 30; break; case Op_DivL: body_size += 30; break; case Op_MulL: body_size += 10; break; + case Op_FlagsProj: + // Can't handle unrolling of loops containing + // nodes that generate a FlagsProj at the moment + return false; case Op_StrComp: case Op_StrEquals: case Op_StrIndexOf: @@ -1960,7 +1964,7 @@ void PhaseIdealLoop::do_range_check( IdealLoopTree *loop, Node_List &old_new ) { // Find loads off the surviving projection; remove their control edge for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { Node* cd = dp->fast_out(i); // Control-dependent node - if( cd->is_Load() ) { // Loads can now float around in the loop + if (cd->is_Load() && cd->depends_only_on_test()) { // Loads can now float around in the loop // Allow the load to float around in the loop, or before it // but NOT before the pre-loop. _igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index 9a009908453..88a05ad134d 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -204,6 +204,17 @@ public: protected: const Type* load_array_final_field(const TypeKlassPtr *tkls, ciKlass* klass) const; + // depends_only_on_test is almost always true, and needs to be almost always + // true to enable key hoisting & commoning optimizations. However, for the + // special case of RawPtr loads from TLS top & end, and other loads performed by + // GC barriers, the control edge carries the dependence preventing hoisting past + // a Safepoint instead of the memory edge. (An unfortunate consequence of having + // Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes + // which produce results (new raw memory state) inside of loops preventing all + // manner of other optimizations). Basically, it's ugly but so is the alternative. + // See comment in macro.cpp, around line 125 expand_allocate_common(). + virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } + }; //------------------------------LoadBNode-------------------------------------- @@ -370,16 +381,6 @@ public: virtual uint ideal_reg() const { return Op_RegP; } virtual int store_Opcode() const { return Op_StoreP; } virtual BasicType memory_type() const { return T_ADDRESS; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; @@ -393,16 +394,6 @@ public: virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreN; } virtual BasicType memory_type() const { return T_NARROWOOP; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; //------------------------------LoadKlassNode---------------------------------- diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp index 76de2ed16a1..2ad809d1a58 100644 --- a/hotspot/src/share/vm/opto/postaloc.cpp +++ b/hotspot/src/share/vm/opto/postaloc.cpp @@ -97,7 +97,8 @@ int PhaseChaitin::yank( Node *old, Block *current_block, Node_List *value, Node_ static bool expected_yanked_node(Node *old, Node *orig_old) { // This code is expected only next original nodes: // - load from constant table node which may have next data input nodes: - // MachConstantBase, Phi, MachTemp, MachSpillCopy + // MachConstantBase, MachTemp, MachSpillCopy + // - Phi nodes that are considered Junk // - load constant node which may have next data input nodes: // MachTemp, MachSpillCopy // - MachSpillCopy @@ -112,7 +113,9 @@ static bool expected_yanked_node(Node *old, Node *orig_old) { return (old == orig_old); } else if (old->is_MachTemp()) { return orig_old->is_Con(); - } else if (old->is_Phi() || old->is_MachConstantBase()) { + } else if (old->is_Phi()) { // Junk phi's + return true; + } else if (old->is_MachConstantBase()) { return (orig_old->is_Con() && orig_old->is_MachConstant()); } return false; @@ -522,11 +525,9 @@ void PhaseChaitin::post_allocate_copy_removal() { u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } if (u != NodeSentinel) { // Junk Phi. Remove - block->remove_node(j--); - phi_dex--; - _cfg.unmap_node_from_block(phi); phi->replace_by(u); - phi->disconnect_inputs(NULL, C); + j -= yank_if_dead(phi, block, &value, ®nd); + phi_dex--; continue; } // Note that if value[pidx] exists, then we merged no new values here diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index faf1555161f..3f628195f78 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -2787,13 +2787,11 @@ intptr_t TypeOopPtr::get_con() const { //-----------------------------filter------------------------------------------ // Do not allow interface-vs.-noninterface joins to collapse to top. -const Type *TypeOopPtr::filter( const Type *kills ) const { +const Type *TypeOopPtr::filter(const Type *kills) const { const Type* ft = join(kills); const TypeInstPtr* ftip = ft->isa_instptr(); const TypeInstPtr* ktip = kills->isa_instptr(); - const TypeKlassPtr* ftkp = ft->isa_klassptr(); - const TypeKlassPtr* ktkp = kills->isa_klassptr(); if (ft->empty()) { // Check for evil case of 'this' being a class and 'kills' expecting an @@ -2807,8 +2805,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { // uplift the type. if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) return kills; // Uplift to interface - if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) - return kills; // Uplift to interface return Type::TOP; // Canonical empty value } @@ -2825,14 +2821,6 @@ const Type *TypeOopPtr::filter( const Type *kills ) const { assert(!ftip->klass_is_exact(), "interface could not be exact"); return ktip->cast_to_ptr_type(ftip->ptr()); } - // Interface klass type could be exact in opposite to interface type, - // return it here instead of incorrect Constant ptr J/L/Object (6894807). - if (ftkp != NULL && ktkp != NULL && - ftkp->is_loaded() && ftkp->klass()->is_interface() && - !ftkp->klass_is_exact() && // Keep exact interface klass - ktkp->is_loaded() && !ktkp->klass()->is_interface()) { - return ktkp->cast_to_ptr_type(ftkp->ptr()); - } return ft; } @@ -4385,6 +4373,33 @@ bool TypeKlassPtr::singleton(void) const { return (_offset == 0) && !below_centerline(_ptr); } +// Do not allow interface-vs.-noninterface joins to collapse to top. +const Type *TypeKlassPtr::filter(const Type *kills) const { + // logic here mirrors the one from TypeOopPtr::filter. See comments + // there. + const Type* ft = join(kills); + const TypeKlassPtr* ftkp = ft->isa_klassptr(); + const TypeKlassPtr* ktkp = kills->isa_klassptr(); + + if (ft->empty()) { + if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) + return kills; // Uplift to interface + + return Type::TOP; // Canonical empty value + } + + // Interface klass type could be exact in opposite to interface type, + // return it here instead of incorrect Constant ptr J/L/Object (6894807). + if (ftkp != NULL && ktkp != NULL && + ftkp->is_loaded() && ftkp->klass()->is_interface() && + !ftkp->klass_is_exact() && // Keep exact interface klass + ktkp->is_loaded() && !ktkp->klass()->is_interface()) { + return ktkp->cast_to_ptr_type(ftkp->ptr()); + } + + return ft; +} + //----------------------compute_klass------------------------------------------ // Compute the defining klass for this class ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const { diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index e72baa96b1d..9810edfe724 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -63,7 +63,7 @@ class TypeRawPtr; class TypeOopPtr; class TypeInstPtr; class TypeAryPtr; -class TypeKlassPtr; +class TypeKlassPtr; class TypeMetadataPtr; //------------------------------Type------------------------------------------- @@ -1202,6 +1202,9 @@ public: virtual intptr_t get_con() const; + // Do not allow interface-vs.-noninterface joins to collapse to top. + virtual const Type *filter( const Type *kills ) const; + // Convenience common pre-built types. static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same diff --git a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp index 51cfb384ac9..f58a5a3d532 100644 --- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp @@ -29,8 +29,43 @@ #include "runtime/thread.hpp" +// The closure for GetLoadedClasses +class LoadedClassesClosure : public KlassClosure { +private: + Stack _classStack; + JvmtiEnv* _env; -// The closure for GetLoadedClasses and GetClassLoaderClasses +public: + LoadedClassesClosure(JvmtiEnv* env) { + _env = env; + } + + void do_klass(Klass* k) { + // Collect all jclasses + _classStack.push((jclass) _env->jni_reference(k->java_mirror())); + } + + int extract(jclass* result_list) { + // The size of the Stack will be 0 after extract, so get it here + int count = (int)_classStack.size(); + int i = count; + + // Pop all jclasses, fill backwards + while (!_classStack.is_empty()) { + result_list[--i] = _classStack.pop(); + } + + // Return the number of elements written + return count; + } + + // Return current size of the Stack + int get_count() { + return (int)_classStack.size(); + } +}; + +// The closure for GetClassLoaderClasses class JvmtiGetLoadedClassesClosure : public StackObj { // Since the SystemDictionary::classes_do callback // doesn't pass a closureData pointer, @@ -165,19 +200,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - // Finally, the static methods that are the callbacks - static void increment(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - that->set_count(that->get_count() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - that->set_count(that->get_count() + 1); - } - } - static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); oop class_loader = loader_data->class_loader(); @@ -196,24 +218,6 @@ class JvmtiGetLoadedClassesClosure : public StackObj { } } - static void add(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->available()) { - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - oop mirror = l->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - oop mirror = k->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } - } - static void add_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); if (that->available()) { @@ -255,39 +259,30 @@ class JvmtiGetLoadedClassesClosure : public StackObj { jvmtiError JvmtiGetLoadedClasses::getLoadedClasses(JvmtiEnv *env, jint* classCountPtr, jclass** classesPtr) { - // Since SystemDictionary::classes_do only takes a function pointer - // and doesn't call back with a closure data pointer, - // we can only pass static methods. - JvmtiGetLoadedClassesClosure closure; + LoadedClassesClosure closure(env); { // To get a consistent list of classes we need MultiArray_lock to ensure - // array classes aren't created, and SystemDictionary_lock to ensure that - // classes aren't added to the system dictionary, + // array classes aren't created. MutexLocker ma(MultiArray_lock); - MutexLocker sd(SystemDictionary_lock); - // First, count the classes - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::increment); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::increment); - // Next, fill in the classes - closure.allocate(); - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::add); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::add); - // Drop the SystemDictionary_lock, so the results could be wrong from here, - // but we still have a snapshot. + // Iterate through all classes in ClassLoaderDataGraph + // and collect them using the LoadedClassesClosure + ClassLoaderDataGraph::loaded_classes_do(&closure); } - // Post results + + // Return results by extracting the collected contents into a list + // allocated via JvmtiEnv jclass* result_list; - jvmtiError err = env->Allocate(closure.get_count() * sizeof(jclass), - (unsigned char**)&result_list); - if (err != JVMTI_ERROR_NONE) { - return err; + jvmtiError error = env->Allocate(closure.get_count() * sizeof(jclass), + (unsigned char**)&result_list); + + if (error == JVMTI_ERROR_NONE) { + int count = closure.extract(result_list); + *classCountPtr = count; + *classesPtr = result_list; } - closure.extract(env, result_list); - *classCountPtr = closure.get_count(); - *classesPtr = result_list; - return JVMTI_ERROR_NONE; + return error; } jvmtiError diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp index 5d560f56a2d..ad90eeb9435 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp @@ -210,6 +210,14 @@ void GrowableCache::oops_do(OopClosure* f) { } } +void GrowableCache::metadata_do(void f(Metadata*)) { + int len = _elements->length(); + for (int i=0; iat(i); + e->metadata_do(f); + } +} + void GrowableCache::gc_epilogue() { int len = _elements->length(); for (int i=0; imethod_holder()->class_loader_data()->class_loader(); + _class_holder = _method->method_holder()->klass_holder(); #ifdef CHECK_UNHANDLED_OOPS - // _class_loader can't be wrapped in a Handle, because JvmtiBreakpoint:s are - // eventually allocated on the heap. + // _class_holder can't be wrapped in a Handle, because JvmtiBreakpoints are + // sometimes allocated on the heap. // - // The code handling JvmtiBreakpoint:s allocated on the stack can't be - // interrupted by a GC until _class_loader is reachable by the GC via the + // The code handling JvmtiBreakpoints allocated on the stack can't be + // interrupted by a GC until _class_holder is reachable by the GC via the // oops_do method. - Thread::current()->allow_unhandled_oop(&_class_loader); + Thread::current()->allow_unhandled_oop(&_class_holder); #endif // CHECK_UNHANDLED_OOPS assert(_method != NULL, "_method != NULL"); _bci = (int) location; @@ -247,7 +255,7 @@ JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) { void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) { _method = bp._method; _bci = bp._bci; - _class_loader = bp._class_loader; + _class_holder = bp._class_holder; } bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) { @@ -365,6 +373,13 @@ void VM_ChangeBreakpoints::oops_do(OopClosure* f) { } } +void VM_ChangeBreakpoints::metadata_do(void f(Metadata*)) { + // Walk metadata in breakpoints to keep from being deallocated with RedefineClasses + if (_bp != NULL) { + _bp->metadata_do(f); + } +} + // // class JvmtiBreakpoints // @@ -381,6 +396,10 @@ void JvmtiBreakpoints::oops_do(OopClosure* f) { _bps.oops_do(f); } +void JvmtiBreakpoints::metadata_do(void f(Metadata*)) { + _bps.metadata_do(f); +} + void JvmtiBreakpoints::gc_epilogue() { _bps.gc_epilogue(); } @@ -499,6 +518,12 @@ void JvmtiCurrentBreakpoints::oops_do(OopClosure* f) { } } +void JvmtiCurrentBreakpoints::metadata_do(void f(Metadata*)) { + if (_jvmti_breakpoints != NULL) { + _jvmti_breakpoints->metadata_do(f); + } +} + void JvmtiCurrentBreakpoints::gc_epilogue() { if (_jvmti_breakpoints != NULL) { _jvmti_breakpoints->gc_epilogue(); diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp index c7beb176215..fc502c7387d 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp @@ -69,6 +69,7 @@ public: virtual bool lessThan(GrowableElement *e)=0; virtual GrowableElement *clone() =0; virtual void oops_do(OopClosure* f) =0; + virtual void metadata_do(void f(Metadata*)) =0; }; class GrowableCache VALUE_OBJ_CLASS_SPEC { @@ -115,6 +116,8 @@ public: void clear(); // apply f to every element and update the cache void oops_do(OopClosure* f); + // walk metadata to preserve for RedefineClasses + void metadata_do(void f(Metadata*)); // update the cache after a full gc void gc_epilogue(); }; @@ -148,6 +151,7 @@ public: void remove (int index) { _cache.remove(index); } void clear() { _cache.clear(); } void oops_do(OopClosure* f) { _cache.oops_do(f); } + void metadata_do(void f(Metadata*)) { _cache.metadata_do(f); } void gc_epilogue() { _cache.gc_epilogue(); } }; @@ -169,7 +173,7 @@ private: Method* _method; int _bci; Bytecodes::Code _orig_bytecode; - oop _class_loader; + oop _class_holder; // keeps _method memory from being deallocated public: JvmtiBreakpoint(); @@ -191,9 +195,15 @@ public: bool lessThan(GrowableElement* e) { Unimplemented(); return false; } bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); } void oops_do(OopClosure* f) { - // Mark the method loader as live - f->do_oop(&_class_loader); + // Mark the method loader as live so the Method* class loader doesn't get + // unloaded and Method* memory reclaimed. + f->do_oop(&_class_holder); } + void metadata_do(void f(Metadata*)) { + // walk metadata to preserve for RedefineClasses + f(_method); + } + GrowableElement *clone() { JvmtiBreakpoint *bp = new JvmtiBreakpoint(); bp->copy(*this); @@ -239,6 +249,7 @@ public: int length(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); void print(); int set(JvmtiBreakpoint& bp); @@ -288,6 +299,7 @@ public: static inline bool is_breakpoint(address bcp); static void oops_do(OopClosure* f); + static void metadata_do(void f(Metadata*)); static void gc_epilogue(); }; @@ -332,6 +344,7 @@ public: VMOp_Type type() const { return VMOp_ChangeBreakpoints; } void doit(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); }; diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index fce983f8cff..8060dae0377 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1988,6 +1988,15 @@ void Arguments::check_deprecated_gc_flags() { warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. " "Use MaxRAMFraction instead."); } + if (FLAG_IS_CMDLINE(UseCMSCompactAtFullCollection)) { + warning("UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(CMSFullGCsBeforeCompaction)) { + warning("CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(UseCMSCollectionPassing)) { + warning("UseCMSCollectionPassing is deprecated and will likely be removed in a future release."); + } } // Check stack pages settings diff --git a/hotspot/src/share/vm/runtime/handles.cpp b/hotspot/src/share/vm/runtime/handles.cpp index 1b4e9faecf9..ca73f86ba7f 100644 --- a/hotspot/src/share/vm/runtime/handles.cpp +++ b/hotspot/src/share/vm/runtime/handles.cpp @@ -45,7 +45,7 @@ oop* HandleArea::allocate_handle(oop obj) { assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); - assert(obj->is_oop(), "sanity check"); + assert(obj->is_oop(), err_msg("not an oop: " INTPTR_FORMAT, (intptr_t*) obj)); return real_allocate_handle(obj); } diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index f645be31d80..9f31c25b7c6 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1097,7 +1097,7 @@ static const char* get_java_runtime_version(TRAPS) { // General purpose hook into Java code, run once when the VM is initialized. // The Java library method itself may be changed independently from the VM. static void call_postVMInitHook(TRAPS) { - Klass* k = SystemDictionary::PostVMInitHook_klass(); + Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_PostVMInitHook(), THREAD); instanceKlassHandle klass (THREAD, k); if (klass.not_null()) { JavaValue result(T_VOID); diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h index 9f46499b4e8..e0a748a41d5 100644 --- a/hotspot/src/share/vm/services/jmm.h +++ b/hotspot/src/share/vm/services/jmm.h @@ -78,6 +78,7 @@ typedef enum { JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */ JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */ JMM_GC_COUNT = 10, /* Total number of collections */ + JMM_JVM_UPTIME_MS = 11, /* The JVM uptime in milliseconds */ JMM_INTERNAL_ATTRIBUTE_INDEX = 100, JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */ diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 9c87989601b..9585960daa2 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -1032,6 +1032,9 @@ static jlong get_long_attribute(jmmLongAttribute att) { case JMM_JVM_INIT_DONE_TIME_MS: return Management::vm_init_done_time(); + case JMM_JVM_UPTIME_MS: + return Management::ticks_to_ms(os::elapsed_counter()); + case JMM_COMPILE_TOTAL_TIME_MS: return Management::ticks_to_ms(CompileBroker::total_compilation_ticks()); diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 06a32dc9037..7806cdc0811 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -368,8 +368,6 @@ const int KlassAlignment = KlassAlignmentInBytes / HeapWordSize; // Klass encoding metaspace max size const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes; -const jlong CompressedKlassPointersBase = NOT_LP64(0) LP64_ONLY(CONST64(0x800000000)); // 32*G - // Machine dependent stuff #ifdef TARGET_ARCH_x86 diff --git a/hotspot/test/compiler/inlining/InlineDefaultMethod.java b/hotspot/test/compiler/inlining/InlineDefaultMethod.java new file mode 100644 index 00000000000..609eaf217d5 --- /dev/null +++ b/hotspot/test/compiler/inlining/InlineDefaultMethod.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026735 + * @summary CHA in C1 should make correct decisions about default methods + * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod + */ + + +interface InterfaceWithDefaultMethod0 { + default public int defaultMethod() { + return 1; + } +} + +interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + +abstract class Subtype implements InterfaceWithDefaultMethod1 { } + +class Decoy extends Subtype { + public int defaultMethod() { + return 2; + } +} + +class Instance extends Subtype { } + +public class InlineDefaultMethod { + public static int test(InterfaceWithDefaultMethod1 x) { + return x.defaultMethod(); + } + public static void main(String[] args) { + InterfaceWithDefaultMethod1 a = new Decoy(); + InterfaceWithDefaultMethod1 b = new Instance(); + if (test(a) != 2 || + test(b) != 1) { + System.err.println("FAILED"); + System.exit(97); + } + System.err.println("PASSED"); + } +} diff --git a/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java new file mode 100644 index 00000000000..f6785c07c69 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026722 + * @summary Verify that the compare after addExact is a signed compare + * @compile CompareTest.java + * @run main CompareTest + * + */ + +public class CompareTest { + public static long store = 0; + public static long addValue = 1231; + + public static void main(String[] args) { + for (int i = 0; i < 20000; ++i) { + runTest(i, i); + runTest(i-1, i); + } + } + + public static long create(long value, int v) { + if ((value | v) == 0) { + return 0; + } + + // C2 turned this test into unsigned test when a control edge was set on the Cmp + if (value < -31557014167219200L || value > 31556889864403199L) { + throw new RuntimeException("error"); + } + + return value; + } + + public static void runTest(long value, int value2) { + long res = Math.addExact(value, addValue); + store = create(res, Math.floorMod(value2, 100000)); + } +} diff --git a/jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java similarity index 52% rename from jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java rename to hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java index b78588bf8fa..211dc8baff1 100644 --- a/jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java +++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -22,18 +20,35 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package java.lang.invoke; -/**

MagicLambdaImpl (named for similarity to MagicAccessorImpl and - others, not because it actually implements an interface) is a - marker class in the hierarchy. All subclasses of this class are - "magically" granted access by the VM to otherwise inaccessible - fields and methods of other classes. It is distinct from MagicAccessorImpl - because, while we want to bypass accessibility checks, we do not want to - bypass verification.

+/* + * @test + * @bug 8027444 + * @summary Test nested loops + * @compile NestedMathExactTest.java + * @run main NestedMathExactTest + * + */ -

Do not change the name of this class without also changing the - VM's code.

*/ +public class NestedMathExactTest { + public static final int LIMIT = 100; + public static int[] result = new int[LIMIT]; + public static int value = 17; -class MagicLambdaImpl { + public static void main(String[] args) { + for (int i = 0; i < 100; ++i) { + result[i] = runTest(); + } + } + + public static int runTest() { + int sum = 0; + for (int j = 0; j < 100000; j = Math.addExact(j, 1)) { + sum = 1; + for (int i = 0; i < 5; ++i) { + sum *= value; + } + } + return sum; + } } diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java index 46eefcd194a..ec554d7662b 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test constant subtractExact * @compile SubExactLConstantTest.java Verify.java * @run main SubExactLConstantTest diff --git a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java index 2bd67bb0f9b..86ecf20f366 100644 --- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test non constant subtractExact * @compile SubExactLNonConstantTest.java Verify.java * @run main SubExactLNonConstantTest diff --git a/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java new file mode 100644 index 00000000000..0de5175d286 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8027445 + * @summary String.equals() may be called with a length whose upper bits are not cleared + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength + * + */ + +import java.util.Arrays; + +public class TestStringEqualsBadLength { + + int v1; + int v2; + + boolean m(String s1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr = new char[l]; + arr[0] = 'a'; + String s2 = new String(arr); + // The string length is not reloaded but the value computed is + // reused so pointer computation must not use + // 0xffffffff00000001 + return s2.equals(s1); + } + + // Same thing with String.compareTo() + int m2(String s1) { + int l = v2 - v1; + char[] arr = new char[l+1]; + arr[0] = 'a'; + arr[1] = 'b'; + String s2 = new String(arr); + return s2.compareTo(s1); + } + + // Same thing with equals() for arrays + boolean m3(char[] arr1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr2 = new char[l]; + arr2[0] = 'a'; + return Arrays.equals(arr2, arr1); + } + + static public void main(String[] args) { + TestStringEqualsBadLength tse = new TestStringEqualsBadLength(); + tse.v1 = -1; + tse.v2 = 0; + char[] arr = new char[1]; + arr[0] = 'a'; + for (int i = 0; i < 20000; i++) { + tse.m("a"); + tse.m2("ab"); + tse.m3(arr); + } + + System.out.println("TEST PASSED"); + } +} diff --git a/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java new file mode 100644 index 00000000000..d6976bd3bdf --- /dev/null +++ b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8027751 + * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill + * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp + * + * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT. + * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack. + * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT + * can be spilled just fine, and in that case the xor emission will fail. + */ + +import java.util.concurrent.atomic.*; +class C1ObjectSpillInLogicOp { + static public void main(String[] args) { + AtomicReferenceArray x = new AtomicReferenceArray(128); + Integer y = new Integer(0); + for (int i = 0; i < 50000; i++) { + x.getAndSet(i % x.length(), y); + } + } +} diff --git a/hotspot/test/compiler/startup/StartupOutput.java b/hotspot/test/compiler/startup/StartupOutput.java new file mode 100644 index 00000000000..f677853d51c --- /dev/null +++ b/hotspot/test/compiler/startup/StartupOutput.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026949 + * @summary Test ensures correct VM output during startup + * @library ../../testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class StartupOutput { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldNotContain("no space to run compilers"); + + out.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java new file mode 100644 index 00000000000..164453b7b62 --- /dev/null +++ b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java @@ -0,0 +1,10908 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8026775 + * @summary Uncommon trap blob did not bang all the stack shadow pages + * + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation UncommonTrapStackBang + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation UncommonTrapStackBang + * + * + * Note: This test does not reproduce the problem with absolute + * certainty. Empirically the bug reproduces on Windows some 80+% of + * the time. Setting everything up to fail in 100% of the cases turns + * out to be tricky at best. + * + * + * The goal of this test is to set up the following stack: + * + * doIt() + * eatStack() + * ... + * eatStack() + * run() + * + * + * When doIt() gets executed it will hit an uncommon trap and expand + * into a huge interpreter frame. The doIt method then calls the + * compiled version of StringBuilder.() which does a single + * stack bang StackShadowPages down. + * + * The uncommon trap blob is supposed to prepare for the interpreter + * by pre-touching stack pages. The bug was that it didn't correctly + * pre-touch all the stack shadow pages, leaving a "hole" on the stack + * which raises an exception on Windows when the stack bang in + * StringBuilder is performed. + */ +public class UncommonTrapStackBang extends Thread { + class Foo { } + + public static void main(String[] args) throws Exception { + doWarmup(); + + // Fork off a new thread to increase odds of the stack being unmapped + UncommonTrapStackBang htsb = new UncommonTrapStackBang(); + htsb.run(); + htsb.join(); + } + + // Make sure: + // + // a) StringBuilder.()V is compiled + // b) doIt() is compiled with an uncommon trap in the unlikely path + public static void doWarmup() { + for (int i = 0; i < 100_000; i++) { + new StringBuilder(); + + doIt(false); + } + } + + public void run() { + eatStack(200); + } + + // Consume some stack to get down to some unused/unmapped pages, + // then call doIt and provoke the uncommon trap/deoptimization + private void eatStack(int n) { + if (n <= 0) { + doIt(true); + return; + } + + eatStack(n - 1); + } + + static public void doIt(boolean unlikely) { + int i0; + int i1; + int i2; + int i3; + int i4; + int i5; + int i6; + int i7; + int i8; + int i9; + int i10; + int i11; + int i12; + int i13; + int i14; + int i15; + int i16; + int i17; + int i18; + int i19; + int i20; + int i21; + int i22; + int i23; + int i24; + int i25; + int i26; + int i27; + int i28; + int i29; + int i30; + int i31; + int i32; + int i33; + int i34; + int i35; + int i36; + int i37; + int i38; + int i39; + int i40; + int i41; + int i42; + int i43; + int i44; + int i45; + int i46; + int i47; + int i48; + int i49; + int i50; + int i51; + int i52; + int i53; + int i54; + int i55; + int i56; + int i57; + int i58; + int i59; + int i60; + int i61; + int i62; + int i63; + int i64; + int i65; + int i66; + int i67; + int i68; + int i69; + int i70; + int i71; + int i72; + int i73; + int i74; + int i75; + int i76; + int i77; + int i78; + int i79; + int i80; + int i81; + int i82; + int i83; + int i84; + int i85; + int i86; + int i87; + int i88; + int i89; + int i90; + int i91; + int i92; + int i93; + int i94; + int i95; + int i96; + int i97; + int i98; + int i99; + int i100; + int i101; + int i102; + int i103; + int i104; + int i105; + int i106; + int i107; + int i108; + int i109; + int i110; + int i111; + int i112; + int i113; + int i114; + int i115; + int i116; + int i117; + int i118; + int i119; + int i120; + int i121; + int i122; + int i123; + int i124; + int i125; + int i126; + int i127; + int i128; + int i129; + int i130; + int i131; + int i132; + int i133; + int i134; + int i135; + int i136; + int i137; + int i138; + int i139; + int i140; + int i141; + int i142; + int i143; + int i144; + int i145; + int i146; + int i147; + int i148; + int i149; + int i150; + int i151; + int i152; + int i153; + int i154; + int i155; + int i156; + int i157; + int i158; + int i159; + int i160; + int i161; + int i162; + int i163; + int i164; + int i165; + int i166; + int i167; + int i168; + int i169; + int i170; + int i171; + int i172; + int i173; + int i174; + int i175; + int i176; + int i177; + int i178; + int i179; + int i180; + int i181; + int i182; + int i183; + int i184; + int i185; + int i186; + int i187; + int i188; + int i189; + int i190; + int i191; + int i192; + int i193; + int i194; + int i195; + int i196; + int i197; + int i198; + int i199; + int i200; + int i201; + int i202; + int i203; + int i204; + int i205; + int i206; + int i207; + int i208; + int i209; + int i210; + int i211; + int i212; + int i213; + int i214; + int i215; + int i216; + int i217; + int i218; + int i219; + int i220; + int i221; + int i222; + int i223; + int i224; + int i225; + int i226; + int i227; + int i228; + int i229; + int i230; + int i231; + int i232; + int i233; + int i234; + int i235; + int i236; + int i237; + int i238; + int i239; + int i240; + int i241; + int i242; + int i243; + int i244; + int i245; + int i246; + int i247; + int i248; + int i249; + int i250; + int i251; + int i252; + int i253; + int i254; + int i255; + int i256; + int i257; + int i258; + int i259; + int i260; + int i261; + int i262; + int i263; + int i264; + int i265; + int i266; + int i267; + int i268; + int i269; + int i270; + int i271; + int i272; + int i273; + int i274; + int i275; + int i276; + int i277; + int i278; + int i279; + int i280; + int i281; + int i282; + int i283; + int i284; + int i285; + int i286; + int i287; + int i288; + int i289; + int i290; + int i291; + int i292; + int i293; + int i294; + int i295; + int i296; + int i297; + int i298; + int i299; + int i300; + int i301; + int i302; + int i303; + int i304; + int i305; + int i306; + int i307; + int i308; + int i309; + int i310; + int i311; + int i312; + int i313; + int i314; + int i315; + int i316; + int i317; + int i318; + int i319; + int i320; + int i321; + int i322; + int i323; + int i324; + int i325; + int i326; + int i327; + int i328; + int i329; + int i330; + int i331; + int i332; + int i333; + int i334; + int i335; + int i336; + int i337; + int i338; + int i339; + int i340; + int i341; + int i342; + int i343; + int i344; + int i345; + int i346; + int i347; + int i348; + int i349; + int i350; + int i351; + int i352; + int i353; + int i354; + int i355; + int i356; + int i357; + int i358; + int i359; + int i360; + int i361; + int i362; + int i363; + int i364; + int i365; + int i366; + int i367; + int i368; + int i369; + int i370; + int i371; + int i372; + int i373; + int i374; + int i375; + int i376; + int i377; + int i378; + int i379; + int i380; + int i381; + int i382; + int i383; + int i384; + int i385; + int i386; + int i387; + int i388; + int i389; + int i390; + int i391; + int i392; + int i393; + int i394; + int i395; + int i396; + int i397; + int i398; + int i399; + int i400; + int i401; + int i402; + int i403; + int i404; + int i405; + int i406; + int i407; + int i408; + int i409; + int i410; + int i411; + int i412; + int i413; + int i414; + int i415; + int i416; + int i417; + int i418; + int i419; + int i420; + int i421; + int i422; + int i423; + int i424; + int i425; + int i426; + int i427; + int i428; + int i429; + int i430; + int i431; + int i432; + int i433; + int i434; + int i435; + int i436; + int i437; + int i438; + int i439; + int i440; + int i441; + int i442; + int i443; + int i444; + int i445; + int i446; + int i447; + int i448; + int i449; + int i450; + int i451; + int i452; + int i453; + int i454; + int i455; + int i456; + int i457; + int i458; + int i459; + int i460; + int i461; + int i462; + int i463; + int i464; + int i465; + int i466; + int i467; + int i468; + int i469; + int i470; + int i471; + int i472; + int i473; + int i474; + int i475; + int i476; + int i477; + int i478; + int i479; + int i480; + int i481; + int i482; + int i483; + int i484; + int i485; + int i486; + int i487; + int i488; + int i489; + int i490; + int i491; + int i492; + int i493; + int i494; + int i495; + int i496; + int i497; + int i498; + int i499; + int i500; + int i501; + int i502; + int i503; + int i504; + int i505; + int i506; + int i507; + int i508; + int i509; + int i510; + int i511; + int i512; + int i513; + int i514; + int i515; + int i516; + int i517; + int i518; + int i519; + int i520; + int i521; + int i522; + int i523; + int i524; + int i525; + int i526; + int i527; + int i528; + int i529; + int i530; + int i531; + int i532; + int i533; + int i534; + int i535; + int i536; + int i537; + int i538; + int i539; + int i540; + int i541; + int i542; + int i543; + int i544; + int i545; + int i546; + int i547; + int i548; + int i549; + int i550; + int i551; + int i552; + int i553; + int i554; + int i555; + int i556; + int i557; + int i558; + int i559; + int i560; + int i561; + int i562; + int i563; + int i564; + int i565; + int i566; + int i567; + int i568; + int i569; + int i570; + int i571; + int i572; + int i573; + int i574; + int i575; + int i576; + int i577; + int i578; + int i579; + int i580; + int i581; + int i582; + int i583; + int i584; + int i585; + int i586; + int i587; + int i588; + int i589; + int i590; + int i591; + int i592; + int i593; + int i594; + int i595; + int i596; + int i597; + int i598; + int i599; + int i600; + int i601; + int i602; + int i603; + int i604; + int i605; + int i606; + int i607; + int i608; + int i609; + int i610; + int i611; + int i612; + int i613; + int i614; + int i615; + int i616; + int i617; + int i618; + int i619; + int i620; + int i621; + int i622; + int i623; + int i624; + int i625; + int i626; + int i627; + int i628; + int i629; + int i630; + int i631; + int i632; + int i633; + int i634; + int i635; + int i636; + int i637; + int i638; + int i639; + int i640; + int i641; + int i642; + int i643; + int i644; + int i645; + int i646; + int i647; + int i648; + int i649; + int i650; + int i651; + int i652; + int i653; + int i654; + int i655; + int i656; + int i657; + int i658; + int i659; + int i660; + int i661; + int i662; + int i663; + int i664; + int i665; + int i666; + int i667; + int i668; + int i669; + int i670; + int i671; + int i672; + int i673; + int i674; + int i675; + int i676; + int i677; + int i678; + int i679; + int i680; + int i681; + int i682; + int i683; + int i684; + int i685; + int i686; + int i687; + int i688; + int i689; + int i690; + int i691; + int i692; + int i693; + int i694; + int i695; + int i696; + int i697; + int i698; + int i699; + int i700; + int i701; + int i702; + int i703; + int i704; + int i705; + int i706; + int i707; + int i708; + int i709; + int i710; + int i711; + int i712; + int i713; + int i714; + int i715; + int i716; + int i717; + int i718; + int i719; + int i720; + int i721; + int i722; + int i723; + int i724; + int i725; + int i726; + int i727; + int i728; + int i729; + int i730; + int i731; + int i732; + int i733; + int i734; + int i735; + int i736; + int i737; + int i738; + int i739; + int i740; + int i741; + int i742; + int i743; + int i744; + int i745; + int i746; + int i747; + int i748; + int i749; + int i750; + int i751; + int i752; + int i753; + int i754; + int i755; + int i756; + int i757; + int i758; + int i759; + int i760; + int i761; + int i762; + int i763; + int i764; + int i765; + int i766; + int i767; + int i768; + int i769; + int i770; + int i771; + int i772; + int i773; + int i774; + int i775; + int i776; + int i777; + int i778; + int i779; + int i780; + int i781; + int i782; + int i783; + int i784; + int i785; + int i786; + int i787; + int i788; + int i789; + int i790; + int i791; + int i792; + int i793; + int i794; + int i795; + int i796; + int i797; + int i798; + int i799; + int i800; + int i801; + int i802; + int i803; + int i804; + int i805; + int i806; + int i807; + int i808; + int i809; + int i810; + int i811; + int i812; + int i813; + int i814; + int i815; + int i816; + int i817; + int i818; + int i819; + int i820; + int i821; + int i822; + int i823; + int i824; + int i825; + int i826; + int i827; + int i828; + int i829; + int i830; + int i831; + int i832; + int i833; + int i834; + int i835; + int i836; + int i837; + int i838; + int i839; + int i840; + int i841; + int i842; + int i843; + int i844; + int i845; + int i846; + int i847; + int i848; + int i849; + int i850; + int i851; + int i852; + int i853; + int i854; + int i855; + int i856; + int i857; + int i858; + int i859; + int i860; + int i861; + int i862; + int i863; + int i864; + int i865; + int i866; + int i867; + int i868; + int i869; + int i870; + int i871; + int i872; + int i873; + int i874; + int i875; + int i876; + int i877; + int i878; + int i879; + int i880; + int i881; + int i882; + int i883; + int i884; + int i885; + int i886; + int i887; + int i888; + int i889; + int i890; + int i891; + int i892; + int i893; + int i894; + int i895; + int i896; + int i897; + int i898; + int i899; + int i900; + int i901; + int i902; + int i903; + int i904; + int i905; + int i906; + int i907; + int i908; + int i909; + int i910; + int i911; + int i912; + int i913; + int i914; + int i915; + int i916; + int i917; + int i918; + int i919; + int i920; + int i921; + int i922; + int i923; + int i924; + int i925; + int i926; + int i927; + int i928; + int i929; + int i930; + int i931; + int i932; + int i933; + int i934; + int i935; + int i936; + int i937; + int i938; + int i939; + int i940; + int i941; + int i942; + int i943; + int i944; + int i945; + int i946; + int i947; + int i948; + int i949; + int i950; + int i951; + int i952; + int i953; + int i954; + int i955; + int i956; + int i957; + int i958; + int i959; + int i960; + int i961; + int i962; + int i963; + int i964; + int i965; + int i966; + int i967; + int i968; + int i969; + int i970; + int i971; + int i972; + int i973; + int i974; + int i975; + int i976; + int i977; + int i978; + int i979; + int i980; + int i981; + int i982; + int i983; + int i984; + int i985; + int i986; + int i987; + int i988; + int i989; + int i990; + int i991; + int i992; + int i993; + int i994; + int i995; + int i996; + int i997; + int i998; + int i999; + int i1000; + int i1001; + int i1002; + int i1003; + int i1004; + int i1005; + int i1006; + int i1007; + int i1008; + int i1009; + int i1010; + int i1011; + int i1012; + int i1013; + int i1014; + int i1015; + int i1016; + int i1017; + int i1018; + int i1019; + int i1020; + int i1021; + int i1022; + int i1023; + int i1024; + int i1025; + int i1026; + int i1027; + int i1028; + int i1029; + int i1030; + int i1031; + int i1032; + int i1033; + int i1034; + int i1035; + int i1036; + int i1037; + int i1038; + int i1039; + int i1040; + int i1041; + int i1042; + int i1043; + int i1044; + int i1045; + int i1046; + int i1047; + int i1048; + int i1049; + int i1050; + int i1051; + int i1052; + int i1053; + int i1054; + int i1055; + int i1056; + int i1057; + int i1058; + int i1059; + int i1060; + int i1061; + int i1062; + int i1063; + int i1064; + int i1065; + int i1066; + int i1067; + int i1068; + int i1069; + int i1070; + int i1071; + int i1072; + int i1073; + int i1074; + int i1075; + int i1076; + int i1077; + int i1078; + int i1079; + int i1080; + int i1081; + int i1082; + int i1083; + int i1084; + int i1085; + int i1086; + int i1087; + int i1088; + int i1089; + int i1090; + int i1091; + int i1092; + int i1093; + int i1094; + int i1095; + int i1096; + int i1097; + int i1098; + int i1099; + int i1100; + int i1101; + int i1102; + int i1103; + int i1104; + int i1105; + int i1106; + int i1107; + int i1108; + int i1109; + int i1110; + int i1111; + int i1112; + int i1113; + int i1114; + int i1115; + int i1116; + int i1117; + int i1118; + int i1119; + int i1120; + int i1121; + int i1122; + int i1123; + int i1124; + int i1125; + int i1126; + int i1127; + int i1128; + int i1129; + int i1130; + int i1131; + int i1132; + int i1133; + int i1134; + int i1135; + int i1136; + int i1137; + int i1138; + int i1139; + int i1140; + int i1141; + int i1142; + int i1143; + int i1144; + int i1145; + int i1146; + int i1147; + int i1148; + int i1149; + int i1150; + int i1151; + int i1152; + int i1153; + int i1154; + int i1155; + int i1156; + int i1157; + int i1158; + int i1159; + int i1160; + int i1161; + int i1162; + int i1163; + int i1164; + int i1165; + int i1166; + int i1167; + int i1168; + int i1169; + int i1170; + int i1171; + int i1172; + int i1173; + int i1174; + int i1175; + int i1176; + int i1177; + int i1178; + int i1179; + int i1180; + int i1181; + int i1182; + int i1183; + int i1184; + int i1185; + int i1186; + int i1187; + int i1188; + int i1189; + int i1190; + int i1191; + int i1192; + int i1193; + int i1194; + int i1195; + int i1196; + int i1197; + int i1198; + int i1199; + int i1200; + int i1201; + int i1202; + int i1203; + int i1204; + int i1205; + int i1206; + int i1207; + int i1208; + int i1209; + int i1210; + int i1211; + int i1212; + int i1213; + int i1214; + int i1215; + int i1216; + int i1217; + int i1218; + int i1219; + int i1220; + int i1221; + int i1222; + int i1223; + int i1224; + int i1225; + int i1226; + int i1227; + int i1228; + int i1229; + int i1230; + int i1231; + int i1232; + int i1233; + int i1234; + int i1235; + int i1236; + int i1237; + int i1238; + int i1239; + int i1240; + int i1241; + int i1242; + int i1243; + int i1244; + int i1245; + int i1246; + int i1247; + int i1248; + int i1249; + int i1250; + int i1251; + int i1252; + int i1253; + int i1254; + int i1255; + int i1256; + int i1257; + int i1258; + int i1259; + int i1260; + int i1261; + int i1262; + int i1263; + int i1264; + int i1265; + int i1266; + int i1267; + int i1268; + int i1269; + int i1270; + int i1271; + int i1272; + int i1273; + int i1274; + int i1275; + int i1276; + int i1277; + int i1278; + int i1279; + int i1280; + int i1281; + int i1282; + int i1283; + int i1284; + int i1285; + int i1286; + int i1287; + int i1288; + int i1289; + int i1290; + int i1291; + int i1292; + int i1293; + int i1294; + int i1295; + int i1296; + int i1297; + int i1298; + int i1299; + int i1300; + int i1301; + int i1302; + int i1303; + int i1304; + int i1305; + int i1306; + int i1307; + int i1308; + int i1309; + int i1310; + int i1311; + int i1312; + int i1313; + int i1314; + int i1315; + int i1316; + int i1317; + int i1318; + int i1319; + int i1320; + int i1321; + int i1322; + int i1323; + int i1324; + int i1325; + int i1326; + int i1327; + int i1328; + int i1329; + int i1330; + int i1331; + int i1332; + int i1333; + int i1334; + int i1335; + int i1336; + int i1337; + int i1338; + int i1339; + int i1340; + int i1341; + int i1342; + int i1343; + int i1344; + int i1345; + int i1346; + int i1347; + int i1348; + int i1349; + int i1350; + int i1351; + int i1352; + int i1353; + int i1354; + int i1355; + int i1356; + int i1357; + int i1358; + int i1359; + int i1360; + int i1361; + int i1362; + int i1363; + int i1364; + int i1365; + int i1366; + int i1367; + int i1368; + int i1369; + int i1370; + int i1371; + int i1372; + int i1373; + int i1374; + int i1375; + int i1376; + int i1377; + int i1378; + int i1379; + int i1380; + int i1381; + int i1382; + int i1383; + int i1384; + int i1385; + int i1386; + int i1387; + int i1388; + int i1389; + int i1390; + int i1391; + int i1392; + int i1393; + int i1394; + int i1395; + int i1396; + int i1397; + int i1398; + int i1399; + int i1400; + int i1401; + int i1402; + int i1403; + int i1404; + int i1405; + int i1406; + int i1407; + int i1408; + int i1409; + int i1410; + int i1411; + int i1412; + int i1413; + int i1414; + int i1415; + int i1416; + int i1417; + int i1418; + int i1419; + int i1420; + int i1421; + int i1422; + int i1423; + int i1424; + int i1425; + int i1426; + int i1427; + int i1428; + int i1429; + int i1430; + int i1431; + int i1432; + int i1433; + int i1434; + int i1435; + int i1436; + int i1437; + int i1438; + int i1439; + int i1440; + int i1441; + int i1442; + int i1443; + int i1444; + int i1445; + int i1446; + int i1447; + int i1448; + int i1449; + int i1450; + int i1451; + int i1452; + int i1453; + int i1454; + int i1455; + int i1456; + int i1457; + int i1458; + int i1459; + int i1460; + int i1461; + int i1462; + int i1463; + int i1464; + int i1465; + int i1466; + int i1467; + int i1468; + int i1469; + int i1470; + int i1471; + int i1472; + int i1473; + int i1474; + int i1475; + int i1476; + int i1477; + int i1478; + int i1479; + int i1480; + int i1481; + int i1482; + int i1483; + int i1484; + int i1485; + int i1486; + int i1487; + int i1488; + int i1489; + int i1490; + int i1491; + int i1492; + int i1493; + int i1494; + int i1495; + int i1496; + int i1497; + int i1498; + int i1499; + int i1500; + int i1501; + int i1502; + int i1503; + int i1504; + int i1505; + int i1506; + int i1507; + int i1508; + int i1509; + int i1510; + int i1511; + int i1512; + int i1513; + int i1514; + int i1515; + int i1516; + int i1517; + int i1518; + int i1519; + int i1520; + int i1521; + int i1522; + int i1523; + int i1524; + int i1525; + int i1526; + int i1527; + int i1528; + int i1529; + int i1530; + int i1531; + int i1532; + int i1533; + int i1534; + int i1535; + int i1536; + int i1537; + int i1538; + int i1539; + int i1540; + int i1541; + int i1542; + int i1543; + int i1544; + int i1545; + int i1546; + int i1547; + int i1548; + int i1549; + int i1550; + int i1551; + int i1552; + int i1553; + int i1554; + int i1555; + int i1556; + int i1557; + int i1558; + int i1559; + int i1560; + int i1561; + int i1562; + int i1563; + int i1564; + int i1565; + int i1566; + int i1567; + int i1568; + int i1569; + int i1570; + int i1571; + int i1572; + int i1573; + int i1574; + int i1575; + int i1576; + int i1577; + int i1578; + int i1579; + int i1580; + int i1581; + int i1582; + int i1583; + int i1584; + int i1585; + int i1586; + int i1587; + int i1588; + int i1589; + int i1590; + int i1591; + int i1592; + int i1593; + int i1594; + int i1595; + int i1596; + int i1597; + int i1598; + int i1599; + int i1600; + int i1601; + int i1602; + int i1603; + int i1604; + int i1605; + int i1606; + int i1607; + int i1608; + int i1609; + int i1610; + int i1611; + int i1612; + int i1613; + int i1614; + int i1615; + int i1616; + int i1617; + int i1618; + int i1619; + int i1620; + int i1621; + int i1622; + int i1623; + int i1624; + int i1625; + int i1626; + int i1627; + int i1628; + int i1629; + int i1630; + int i1631; + int i1632; + int i1633; + int i1634; + int i1635; + int i1636; + int i1637; + int i1638; + int i1639; + int i1640; + int i1641; + int i1642; + int i1643; + int i1644; + int i1645; + int i1646; + int i1647; + int i1648; + int i1649; + int i1650; + int i1651; + int i1652; + int i1653; + int i1654; + int i1655; + int i1656; + int i1657; + int i1658; + int i1659; + int i1660; + int i1661; + int i1662; + int i1663; + int i1664; + int i1665; + int i1666; + int i1667; + int i1668; + int i1669; + int i1670; + int i1671; + int i1672; + int i1673; + int i1674; + int i1675; + int i1676; + int i1677; + int i1678; + int i1679; + int i1680; + int i1681; + int i1682; + int i1683; + int i1684; + int i1685; + int i1686; + int i1687; + int i1688; + int i1689; + int i1690; + int i1691; + int i1692; + int i1693; + int i1694; + int i1695; + int i1696; + int i1697; + int i1698; + int i1699; + int i1700; + int i1701; + int i1702; + int i1703; + int i1704; + int i1705; + int i1706; + int i1707; + int i1708; + int i1709; + int i1710; + int i1711; + int i1712; + int i1713; + int i1714; + int i1715; + int i1716; + int i1717; + int i1718; + int i1719; + int i1720; + int i1721; + int i1722; + int i1723; + int i1724; + int i1725; + int i1726; + int i1727; + int i1728; + int i1729; + int i1730; + int i1731; + int i1732; + int i1733; + int i1734; + int i1735; + int i1736; + int i1737; + int i1738; + int i1739; + int i1740; + int i1741; + int i1742; + int i1743; + int i1744; + int i1745; + int i1746; + int i1747; + int i1748; + int i1749; + int i1750; + int i1751; + int i1752; + int i1753; + int i1754; + int i1755; + int i1756; + int i1757; + int i1758; + int i1759; + int i1760; + int i1761; + int i1762; + int i1763; + int i1764; + int i1765; + int i1766; + int i1767; + int i1768; + int i1769; + int i1770; + int i1771; + int i1772; + int i1773; + int i1774; + int i1775; + int i1776; + int i1777; + int i1778; + int i1779; + int i1780; + int i1781; + int i1782; + int i1783; + int i1784; + int i1785; + int i1786; + int i1787; + int i1788; + int i1789; + int i1790; + int i1791; + int i1792; + int i1793; + int i1794; + int i1795; + int i1796; + int i1797; + int i1798; + int i1799; + int i1800; + int i1801; + int i1802; + int i1803; + int i1804; + int i1805; + int i1806; + int i1807; + int i1808; + int i1809; + int i1810; + int i1811; + int i1812; + int i1813; + int i1814; + int i1815; + int i1816; + int i1817; + int i1818; + int i1819; + int i1820; + int i1821; + int i1822; + int i1823; + int i1824; + int i1825; + int i1826; + int i1827; + int i1828; + int i1829; + int i1830; + int i1831; + int i1832; + int i1833; + int i1834; + int i1835; + int i1836; + int i1837; + int i1838; + int i1839; + int i1840; + int i1841; + int i1842; + int i1843; + int i1844; + int i1845; + int i1846; + int i1847; + int i1848; + int i1849; + int i1850; + int i1851; + int i1852; + int i1853; + int i1854; + int i1855; + int i1856; + int i1857; + int i1858; + int i1859; + int i1860; + int i1861; + int i1862; + int i1863; + int i1864; + int i1865; + int i1866; + int i1867; + int i1868; + int i1869; + int i1870; + int i1871; + int i1872; + int i1873; + int i1874; + int i1875; + int i1876; + int i1877; + int i1878; + int i1879; + int i1880; + int i1881; + int i1882; + int i1883; + int i1884; + int i1885; + int i1886; + int i1887; + int i1888; + int i1889; + int i1890; + int i1891; + int i1892; + int i1893; + int i1894; + int i1895; + int i1896; + int i1897; + int i1898; + int i1899; + int i1900; + int i1901; + int i1902; + int i1903; + int i1904; + int i1905; + int i1906; + int i1907; + int i1908; + int i1909; + int i1910; + int i1911; + int i1912; + int i1913; + int i1914; + int i1915; + int i1916; + int i1917; + int i1918; + int i1919; + int i1920; + int i1921; + int i1922; + int i1923; + int i1924; + int i1925; + int i1926; + int i1927; + int i1928; + int i1929; + int i1930; + int i1931; + int i1932; + int i1933; + int i1934; + int i1935; + int i1936; + int i1937; + int i1938; + int i1939; + int i1940; + int i1941; + int i1942; + int i1943; + int i1944; + int i1945; + int i1946; + int i1947; + int i1948; + int i1949; + int i1950; + int i1951; + int i1952; + int i1953; + int i1954; + int i1955; + int i1956; + int i1957; + int i1958; + int i1959; + int i1960; + int i1961; + int i1962; + int i1963; + int i1964; + int i1965; + int i1966; + int i1967; + int i1968; + int i1969; + int i1970; + int i1971; + int i1972; + int i1973; + int i1974; + int i1975; + int i1976; + int i1977; + int i1978; + int i1979; + int i1980; + int i1981; + int i1982; + int i1983; + int i1984; + int i1985; + int i1986; + int i1987; + int i1988; + int i1989; + int i1990; + int i1991; + int i1992; + int i1993; + int i1994; + int i1995; + int i1996; + int i1997; + int i1998; + int i1999; + int i2000; + int i2001; + int i2002; + int i2003; + int i2004; + int i2005; + int i2006; + int i2007; + int i2008; + int i2009; + int i2010; + int i2011; + int i2012; + int i2013; + int i2014; + int i2015; + int i2016; + int i2017; + int i2018; + int i2019; + int i2020; + int i2021; + int i2022; + int i2023; + int i2024; + int i2025; + int i2026; + int i2027; + int i2028; + int i2029; + int i2030; + int i2031; + int i2032; + int i2033; + int i2034; + int i2035; + int i2036; + int i2037; + int i2038; + int i2039; + int i2040; + int i2041; + int i2042; + int i2043; + int i2044; + int i2045; + int i2046; + int i2047; + int i2048; + int i2049; + int i2050; + int i2051; + int i2052; + int i2053; + int i2054; + int i2055; + int i2056; + int i2057; + int i2058; + int i2059; + int i2060; + int i2061; + int i2062; + int i2063; + int i2064; + int i2065; + int i2066; + int i2067; + int i2068; + int i2069; + int i2070; + int i2071; + int i2072; + int i2073; + int i2074; + int i2075; + int i2076; + int i2077; + int i2078; + int i2079; + int i2080; + int i2081; + int i2082; + int i2083; + int i2084; + int i2085; + int i2086; + int i2087; + int i2088; + int i2089; + int i2090; + int i2091; + int i2092; + int i2093; + int i2094; + int i2095; + int i2096; + int i2097; + int i2098; + int i2099; + int i2100; + int i2101; + int i2102; + int i2103; + int i2104; + int i2105; + int i2106; + int i2107; + int i2108; + int i2109; + int i2110; + int i2111; + int i2112; + int i2113; + int i2114; + int i2115; + int i2116; + int i2117; + int i2118; + int i2119; + int i2120; + int i2121; + int i2122; + int i2123; + int i2124; + int i2125; + int i2126; + int i2127; + int i2128; + int i2129; + int i2130; + int i2131; + int i2132; + int i2133; + int i2134; + int i2135; + int i2136; + int i2137; + int i2138; + int i2139; + int i2140; + int i2141; + int i2142; + int i2143; + int i2144; + int i2145; + int i2146; + int i2147; + int i2148; + int i2149; + int i2150; + int i2151; + int i2152; + int i2153; + int i2154; + int i2155; + int i2156; + int i2157; + int i2158; + int i2159; + int i2160; + int i2161; + int i2162; + int i2163; + int i2164; + int i2165; + int i2166; + int i2167; + int i2168; + int i2169; + int i2170; + int i2171; + int i2172; + int i2173; + int i2174; + int i2175; + int i2176; + int i2177; + int i2178; + int i2179; + int i2180; + int i2181; + int i2182; + int i2183; + int i2184; + int i2185; + int i2186; + int i2187; + int i2188; + int i2189; + int i2190; + int i2191; + int i2192; + int i2193; + int i2194; + int i2195; + int i2196; + int i2197; + int i2198; + int i2199; + int i2200; + int i2201; + int i2202; + int i2203; + int i2204; + int i2205; + int i2206; + int i2207; + int i2208; + int i2209; + int i2210; + int i2211; + int i2212; + int i2213; + int i2214; + int i2215; + int i2216; + int i2217; + int i2218; + int i2219; + int i2220; + int i2221; + int i2222; + int i2223; + int i2224; + int i2225; + int i2226; + int i2227; + int i2228; + int i2229; + int i2230; + int i2231; + int i2232; + int i2233; + int i2234; + int i2235; + int i2236; + int i2237; + int i2238; + int i2239; + int i2240; + int i2241; + int i2242; + int i2243; + int i2244; + int i2245; + int i2246; + int i2247; + int i2248; + int i2249; + int i2250; + int i2251; + int i2252; + int i2253; + int i2254; + int i2255; + int i2256; + int i2257; + int i2258; + int i2259; + int i2260; + int i2261; + int i2262; + int i2263; + int i2264; + int i2265; + int i2266; + int i2267; + int i2268; + int i2269; + int i2270; + int i2271; + int i2272; + int i2273; + int i2274; + int i2275; + int i2276; + int i2277; + int i2278; + int i2279; + int i2280; + int i2281; + int i2282; + int i2283; + int i2284; + int i2285; + int i2286; + int i2287; + int i2288; + int i2289; + int i2290; + int i2291; + int i2292; + int i2293; + int i2294; + int i2295; + int i2296; + int i2297; + int i2298; + int i2299; + int i2300; + int i2301; + int i2302; + int i2303; + int i2304; + int i2305; + int i2306; + int i2307; + int i2308; + int i2309; + int i2310; + int i2311; + int i2312; + int i2313; + int i2314; + int i2315; + int i2316; + int i2317; + int i2318; + int i2319; + int i2320; + int i2321; + int i2322; + int i2323; + int i2324; + int i2325; + int i2326; + int i2327; + int i2328; + int i2329; + int i2330; + int i2331; + int i2332; + int i2333; + int i2334; + int i2335; + int i2336; + int i2337; + int i2338; + int i2339; + int i2340; + int i2341; + int i2342; + int i2343; + int i2344; + int i2345; + int i2346; + int i2347; + int i2348; + int i2349; + int i2350; + int i2351; + int i2352; + int i2353; + int i2354; + int i2355; + int i2356; + int i2357; + int i2358; + int i2359; + int i2360; + int i2361; + int i2362; + int i2363; + int i2364; + int i2365; + int i2366; + int i2367; + int i2368; + int i2369; + int i2370; + int i2371; + int i2372; + int i2373; + int i2374; + int i2375; + int i2376; + int i2377; + int i2378; + int i2379; + int i2380; + int i2381; + int i2382; + int i2383; + int i2384; + int i2385; + int i2386; + int i2387; + int i2388; + int i2389; + int i2390; + int i2391; + int i2392; + int i2393; + int i2394; + int i2395; + int i2396; + int i2397; + int i2398; + int i2399; + int i2400; + int i2401; + int i2402; + int i2403; + int i2404; + int i2405; + int i2406; + int i2407; + int i2408; + int i2409; + int i2410; + int i2411; + int i2412; + int i2413; + int i2414; + int i2415; + int i2416; + int i2417; + int i2418; + int i2419; + int i2420; + int i2421; + int i2422; + int i2423; + int i2424; + int i2425; + int i2426; + int i2427; + int i2428; + int i2429; + int i2430; + int i2431; + int i2432; + int i2433; + int i2434; + int i2435; + int i2436; + int i2437; + int i2438; + int i2439; + int i2440; + int i2441; + int i2442; + int i2443; + int i2444; + int i2445; + int i2446; + int i2447; + int i2448; + int i2449; + int i2450; + int i2451; + int i2452; + int i2453; + int i2454; + int i2455; + int i2456; + int i2457; + int i2458; + int i2459; + int i2460; + int i2461; + int i2462; + int i2463; + int i2464; + int i2465; + int i2466; + int i2467; + int i2468; + int i2469; + int i2470; + int i2471; + int i2472; + int i2473; + int i2474; + int i2475; + int i2476; + int i2477; + int i2478; + int i2479; + int i2480; + int i2481; + int i2482; + int i2483; + int i2484; + int i2485; + int i2486; + int i2487; + int i2488; + int i2489; + int i2490; + int i2491; + int i2492; + int i2493; + int i2494; + int i2495; + int i2496; + int i2497; + int i2498; + int i2499; + int i2500; + int i2501; + int i2502; + int i2503; + int i2504; + int i2505; + int i2506; + int i2507; + int i2508; + int i2509; + int i2510; + int i2511; + int i2512; + int i2513; + int i2514; + int i2515; + int i2516; + int i2517; + int i2518; + int i2519; + int i2520; + int i2521; + int i2522; + int i2523; + int i2524; + int i2525; + int i2526; + int i2527; + int i2528; + int i2529; + int i2530; + int i2531; + int i2532; + int i2533; + int i2534; + int i2535; + int i2536; + int i2537; + int i2538; + int i2539; + int i2540; + int i2541; + int i2542; + int i2543; + int i2544; + int i2545; + int i2546; + int i2547; + int i2548; + int i2549; + int i2550; + int i2551; + int i2552; + int i2553; + int i2554; + int i2555; + int i2556; + int i2557; + int i2558; + int i2559; + int i2560; + int i2561; + int i2562; + int i2563; + int i2564; + int i2565; + int i2566; + int i2567; + int i2568; + int i2569; + int i2570; + int i2571; + int i2572; + int i2573; + int i2574; + int i2575; + int i2576; + int i2577; + int i2578; + int i2579; + int i2580; + int i2581; + int i2582; + int i2583; + int i2584; + int i2585; + int i2586; + int i2587; + int i2588; + int i2589; + int i2590; + int i2591; + int i2592; + int i2593; + int i2594; + int i2595; + int i2596; + int i2597; + int i2598; + int i2599; + int i2600; + int i2601; + int i2602; + int i2603; + int i2604; + int i2605; + int i2606; + int i2607; + int i2608; + int i2609; + int i2610; + int i2611; + int i2612; + int i2613; + int i2614; + int i2615; + int i2616; + int i2617; + int i2618; + int i2619; + int i2620; + int i2621; + int i2622; + int i2623; + int i2624; + int i2625; + int i2626; + int i2627; + int i2628; + int i2629; + int i2630; + int i2631; + int i2632; + int i2633; + int i2634; + int i2635; + int i2636; + int i2637; + int i2638; + int i2639; + int i2640; + int i2641; + int i2642; + int i2643; + int i2644; + int i2645; + int i2646; + int i2647; + int i2648; + int i2649; + int i2650; + int i2651; + int i2652; + int i2653; + int i2654; + int i2655; + int i2656; + int i2657; + int i2658; + int i2659; + int i2660; + int i2661; + int i2662; + int i2663; + int i2664; + int i2665; + int i2666; + int i2667; + int i2668; + int i2669; + int i2670; + int i2671; + int i2672; + int i2673; + int i2674; + int i2675; + int i2676; + int i2677; + int i2678; + int i2679; + int i2680; + int i2681; + int i2682; + int i2683; + int i2684; + int i2685; + int i2686; + int i2687; + int i2688; + int i2689; + int i2690; + int i2691; + int i2692; + int i2693; + int i2694; + int i2695; + int i2696; + int i2697; + int i2698; + int i2699; + int i2700; + int i2701; + int i2702; + int i2703; + int i2704; + int i2705; + int i2706; + int i2707; + int i2708; + int i2709; + int i2710; + int i2711; + int i2712; + int i2713; + int i2714; + int i2715; + int i2716; + int i2717; + int i2718; + int i2719; + int i2720; + int i2721; + int i2722; + int i2723; + int i2724; + int i2725; + int i2726; + int i2727; + int i2728; + int i2729; + int i2730; + int i2731; + int i2732; + int i2733; + int i2734; + int i2735; + int i2736; + int i2737; + int i2738; + int i2739; + int i2740; + int i2741; + int i2742; + int i2743; + int i2744; + int i2745; + int i2746; + int i2747; + int i2748; + int i2749; + int i2750; + int i2751; + int i2752; + int i2753; + int i2754; + int i2755; + int i2756; + int i2757; + int i2758; + int i2759; + int i2760; + int i2761; + int i2762; + int i2763; + int i2764; + int i2765; + int i2766; + int i2767; + int i2768; + int i2769; + int i2770; + int i2771; + int i2772; + int i2773; + int i2774; + int i2775; + int i2776; + int i2777; + int i2778; + int i2779; + int i2780; + int i2781; + int i2782; + int i2783; + int i2784; + int i2785; + int i2786; + int i2787; + int i2788; + int i2789; + int i2790; + int i2791; + int i2792; + int i2793; + int i2794; + int i2795; + int i2796; + int i2797; + int i2798; + int i2799; + int i2800; + int i2801; + int i2802; + int i2803; + int i2804; + int i2805; + int i2806; + int i2807; + int i2808; + int i2809; + int i2810; + int i2811; + int i2812; + int i2813; + int i2814; + int i2815; + int i2816; + int i2817; + int i2818; + int i2819; + int i2820; + int i2821; + int i2822; + int i2823; + int i2824; + int i2825; + int i2826; + int i2827; + int i2828; + int i2829; + int i2830; + int i2831; + int i2832; + int i2833; + int i2834; + int i2835; + int i2836; + int i2837; + int i2838; + int i2839; + int i2840; + int i2841; + int i2842; + int i2843; + int i2844; + int i2845; + int i2846; + int i2847; + int i2848; + int i2849; + int i2850; + int i2851; + int i2852; + int i2853; + int i2854; + int i2855; + int i2856; + int i2857; + int i2858; + int i2859; + int i2860; + int i2861; + int i2862; + int i2863; + int i2864; + int i2865; + int i2866; + int i2867; + int i2868; + int i2869; + int i2870; + int i2871; + int i2872; + int i2873; + int i2874; + int i2875; + int i2876; + int i2877; + int i2878; + int i2879; + int i2880; + int i2881; + int i2882; + int i2883; + int i2884; + int i2885; + int i2886; + int i2887; + int i2888; + int i2889; + int i2890; + int i2891; + int i2892; + int i2893; + int i2894; + int i2895; + int i2896; + int i2897; + int i2898; + int i2899; + int i2900; + int i2901; + int i2902; + int i2903; + int i2904; + int i2905; + int i2906; + int i2907; + int i2908; + int i2909; + int i2910; + int i2911; + int i2912; + int i2913; + int i2914; + int i2915; + int i2916; + int i2917; + int i2918; + int i2919; + int i2920; + int i2921; + int i2922; + int i2923; + int i2924; + int i2925; + int i2926; + int i2927; + int i2928; + int i2929; + int i2930; + int i2931; + int i2932; + int i2933; + int i2934; + int i2935; + int i2936; + int i2937; + int i2938; + int i2939; + int i2940; + int i2941; + int i2942; + int i2943; + int i2944; + int i2945; + int i2946; + int i2947; + int i2948; + int i2949; + int i2950; + int i2951; + int i2952; + int i2953; + int i2954; + int i2955; + int i2956; + int i2957; + int i2958; + int i2959; + int i2960; + int i2961; + int i2962; + int i2963; + int i2964; + int i2965; + int i2966; + int i2967; + int i2968; + int i2969; + int i2970; + int i2971; + int i2972; + int i2973; + int i2974; + int i2975; + int i2976; + int i2977; + int i2978; + int i2979; + int i2980; + int i2981; + int i2982; + int i2983; + int i2984; + int i2985; + int i2986; + int i2987; + int i2988; + int i2989; + int i2990; + int i2991; + int i2992; + int i2993; + int i2994; + int i2995; + int i2996; + int i2997; + int i2998; + int i2999; + int i3000; + int i3001; + int i3002; + int i3003; + int i3004; + int i3005; + int i3006; + int i3007; + int i3008; + int i3009; + int i3010; + int i3011; + int i3012; + int i3013; + int i3014; + int i3015; + int i3016; + int i3017; + int i3018; + int i3019; + int i3020; + int i3021; + int i3022; + int i3023; + int i3024; + int i3025; + int i3026; + int i3027; + int i3028; + int i3029; + int i3030; + int i3031; + int i3032; + int i3033; + int i3034; + int i3035; + int i3036; + int i3037; + int i3038; + int i3039; + int i3040; + int i3041; + int i3042; + int i3043; + int i3044; + int i3045; + int i3046; + int i3047; + int i3048; + int i3049; + int i3050; + int i3051; + int i3052; + int i3053; + int i3054; + int i3055; + int i3056; + int i3057; + int i3058; + int i3059; + int i3060; + int i3061; + int i3062; + int i3063; + int i3064; + int i3065; + int i3066; + int i3067; + int i3068; + int i3069; + int i3070; + int i3071; + int i3072; + int i3073; + int i3074; + int i3075; + int i3076; + int i3077; + int i3078; + int i3079; + int i3080; + int i3081; + int i3082; + int i3083; + int i3084; + int i3085; + int i3086; + int i3087; + int i3088; + int i3089; + int i3090; + int i3091; + int i3092; + int i3093; + int i3094; + int i3095; + int i3096; + int i3097; + int i3098; + int i3099; + int i3100; + int i3101; + int i3102; + int i3103; + int i3104; + int i3105; + int i3106; + int i3107; + int i3108; + int i3109; + int i3110; + int i3111; + int i3112; + int i3113; + int i3114; + int i3115; + int i3116; + int i3117; + int i3118; + int i3119; + int i3120; + int i3121; + int i3122; + int i3123; + int i3124; + int i3125; + int i3126; + int i3127; + int i3128; + int i3129; + int i3130; + int i3131; + int i3132; + int i3133; + int i3134; + int i3135; + int i3136; + int i3137; + int i3138; + int i3139; + int i3140; + int i3141; + int i3142; + int i3143; + int i3144; + int i3145; + int i3146; + int i3147; + int i3148; + int i3149; + int i3150; + int i3151; + int i3152; + int i3153; + int i3154; + int i3155; + int i3156; + int i3157; + int i3158; + int i3159; + int i3160; + int i3161; + int i3162; + int i3163; + int i3164; + int i3165; + int i3166; + int i3167; + int i3168; + int i3169; + int i3170; + int i3171; + int i3172; + int i3173; + int i3174; + int i3175; + int i3176; + int i3177; + int i3178; + int i3179; + int i3180; + int i3181; + int i3182; + int i3183; + int i3184; + int i3185; + int i3186; + int i3187; + int i3188; + int i3189; + int i3190; + int i3191; + int i3192; + int i3193; + int i3194; + int i3195; + int i3196; + int i3197; + int i3198; + int i3199; + int i3200; + int i3201; + int i3202; + int i3203; + int i3204; + int i3205; + int i3206; + int i3207; + int i3208; + int i3209; + int i3210; + int i3211; + int i3212; + int i3213; + int i3214; + int i3215; + int i3216; + int i3217; + int i3218; + int i3219; + int i3220; + int i3221; + int i3222; + int i3223; + int i3224; + int i3225; + int i3226; + int i3227; + int i3228; + int i3229; + int i3230; + int i3231; + int i3232; + int i3233; + int i3234; + int i3235; + int i3236; + int i3237; + int i3238; + int i3239; + int i3240; + int i3241; + int i3242; + int i3243; + int i3244; + int i3245; + int i3246; + int i3247; + int i3248; + int i3249; + int i3250; + int i3251; + int i3252; + int i3253; + int i3254; + int i3255; + int i3256; + int i3257; + int i3258; + int i3259; + int i3260; + int i3261; + int i3262; + int i3263; + int i3264; + int i3265; + int i3266; + int i3267; + int i3268; + int i3269; + int i3270; + int i3271; + int i3272; + int i3273; + int i3274; + int i3275; + int i3276; + int i3277; + int i3278; + int i3279; + int i3280; + int i3281; + int i3282; + int i3283; + int i3284; + int i3285; + int i3286; + int i3287; + int i3288; + int i3289; + int i3290; + int i3291; + int i3292; + int i3293; + int i3294; + int i3295; + int i3296; + int i3297; + int i3298; + int i3299; + int i3300; + int i3301; + int i3302; + int i3303; + int i3304; + int i3305; + int i3306; + int i3307; + int i3308; + int i3309; + int i3310; + int i3311; + int i3312; + int i3313; + int i3314; + int i3315; + int i3316; + int i3317; + int i3318; + int i3319; + int i3320; + int i3321; + int i3322; + int i3323; + int i3324; + int i3325; + int i3326; + int i3327; + int i3328; + int i3329; + int i3330; + int i3331; + int i3332; + int i3333; + int i3334; + int i3335; + int i3336; + int i3337; + int i3338; + int i3339; + int i3340; + int i3341; + int i3342; + int i3343; + int i3344; + int i3345; + int i3346; + int i3347; + int i3348; + int i3349; + int i3350; + int i3351; + int i3352; + int i3353; + int i3354; + int i3355; + int i3356; + int i3357; + int i3358; + int i3359; + int i3360; + int i3361; + int i3362; + int i3363; + int i3364; + int i3365; + int i3366; + int i3367; + int i3368; + int i3369; + int i3370; + int i3371; + int i3372; + int i3373; + int i3374; + int i3375; + int i3376; + int i3377; + int i3378; + int i3379; + int i3380; + int i3381; + int i3382; + int i3383; + int i3384; + int i3385; + int i3386; + int i3387; + int i3388; + int i3389; + int i3390; + int i3391; + int i3392; + int i3393; + int i3394; + int i3395; + int i3396; + int i3397; + int i3398; + int i3399; + int i3400; + int i3401; + int i3402; + int i3403; + int i3404; + int i3405; + int i3406; + int i3407; + int i3408; + int i3409; + int i3410; + int i3411; + int i3412; + int i3413; + int i3414; + int i3415; + int i3416; + int i3417; + int i3418; + int i3419; + int i3420; + int i3421; + int i3422; + int i3423; + int i3424; + int i3425; + int i3426; + int i3427; + int i3428; + int i3429; + int i3430; + int i3431; + int i3432; + int i3433; + int i3434; + int i3435; + int i3436; + int i3437; + int i3438; + int i3439; + int i3440; + int i3441; + int i3442; + int i3443; + int i3444; + int i3445; + int i3446; + int i3447; + int i3448; + int i3449; + int i3450; + int i3451; + int i3452; + int i3453; + int i3454; + int i3455; + int i3456; + int i3457; + int i3458; + int i3459; + int i3460; + int i3461; + int i3462; + int i3463; + int i3464; + int i3465; + int i3466; + int i3467; + int i3468; + int i3469; + int i3470; + int i3471; + int i3472; + int i3473; + int i3474; + int i3475; + int i3476; + int i3477; + int i3478; + int i3479; + int i3480; + int i3481; + int i3482; + int i3483; + int i3484; + int i3485; + int i3486; + int i3487; + int i3488; + int i3489; + int i3490; + int i3491; + int i3492; + int i3493; + int i3494; + int i3495; + int i3496; + int i3497; + int i3498; + int i3499; + int i3500; + int i3501; + int i3502; + int i3503; + int i3504; + int i3505; + int i3506; + int i3507; + int i3508; + int i3509; + int i3510; + int i3511; + int i3512; + int i3513; + int i3514; + int i3515; + int i3516; + int i3517; + int i3518; + int i3519; + int i3520; + int i3521; + int i3522; + int i3523; + int i3524; + int i3525; + int i3526; + int i3527; + int i3528; + int i3529; + int i3530; + int i3531; + int i3532; + int i3533; + int i3534; + int i3535; + int i3536; + int i3537; + int i3538; + int i3539; + int i3540; + int i3541; + int i3542; + int i3543; + int i3544; + int i3545; + int i3546; + int i3547; + int i3548; + int i3549; + int i3550; + int i3551; + int i3552; + int i3553; + int i3554; + int i3555; + int i3556; + int i3557; + int i3558; + int i3559; + int i3560; + int i3561; + int i3562; + int i3563; + int i3564; + int i3565; + int i3566; + int i3567; + int i3568; + int i3569; + int i3570; + int i3571; + int i3572; + int i3573; + int i3574; + int i3575; + int i3576; + int i3577; + int i3578; + int i3579; + int i3580; + int i3581; + int i3582; + int i3583; + int i3584; + int i3585; + int i3586; + int i3587; + int i3588; + int i3589; + int i3590; + int i3591; + int i3592; + int i3593; + int i3594; + int i3595; + int i3596; + int i3597; + int i3598; + int i3599; + int i3600; + int i3601; + int i3602; + int i3603; + int i3604; + int i3605; + int i3606; + int i3607; + int i3608; + int i3609; + int i3610; + int i3611; + int i3612; + int i3613; + int i3614; + int i3615; + int i3616; + int i3617; + int i3618; + int i3619; + int i3620; + int i3621; + int i3622; + int i3623; + int i3624; + int i3625; + int i3626; + int i3627; + int i3628; + int i3629; + int i3630; + int i3631; + int i3632; + int i3633; + int i3634; + int i3635; + int i3636; + int i3637; + int i3638; + int i3639; + int i3640; + int i3641; + int i3642; + int i3643; + int i3644; + int i3645; + int i3646; + int i3647; + int i3648; + int i3649; + int i3650; + int i3651; + int i3652; + int i3653; + int i3654; + int i3655; + int i3656; + int i3657; + int i3658; + int i3659; + int i3660; + int i3661; + int i3662; + int i3663; + int i3664; + int i3665; + int i3666; + int i3667; + int i3668; + int i3669; + int i3670; + int i3671; + int i3672; + int i3673; + int i3674; + int i3675; + int i3676; + int i3677; + int i3678; + int i3679; + int i3680; + int i3681; + int i3682; + int i3683; + int i3684; + int i3685; + int i3686; + int i3687; + int i3688; + int i3689; + int i3690; + int i3691; + int i3692; + int i3693; + int i3694; + int i3695; + int i3696; + int i3697; + int i3698; + int i3699; + int i3700; + int i3701; + int i3702; + int i3703; + int i3704; + int i3705; + int i3706; + int i3707; + int i3708; + int i3709; + int i3710; + int i3711; + int i3712; + int i3713; + int i3714; + int i3715; + int i3716; + int i3717; + int i3718; + int i3719; + int i3720; + int i3721; + int i3722; + int i3723; + int i3724; + int i3725; + int i3726; + int i3727; + int i3728; + int i3729; + int i3730; + int i3731; + int i3732; + int i3733; + int i3734; + int i3735; + int i3736; + int i3737; + int i3738; + int i3739; + int i3740; + int i3741; + int i3742; + int i3743; + int i3744; + int i3745; + int i3746; + int i3747; + int i3748; + int i3749; + int i3750; + int i3751; + int i3752; + int i3753; + int i3754; + int i3755; + int i3756; + int i3757; + int i3758; + int i3759; + int i3760; + int i3761; + int i3762; + int i3763; + int i3764; + int i3765; + int i3766; + int i3767; + int i3768; + int i3769; + int i3770; + int i3771; + int i3772; + int i3773; + int i3774; + int i3775; + int i3776; + int i3777; + int i3778; + int i3779; + int i3780; + int i3781; + int i3782; + int i3783; + int i3784; + int i3785; + int i3786; + int i3787; + int i3788; + int i3789; + int i3790; + int i3791; + int i3792; + int i3793; + int i3794; + int i3795; + int i3796; + int i3797; + int i3798; + int i3799; + int i3800; + int i3801; + int i3802; + int i3803; + int i3804; + int i3805; + int i3806; + int i3807; + int i3808; + int i3809; + int i3810; + int i3811; + int i3812; + int i3813; + int i3814; + int i3815; + int i3816; + int i3817; + int i3818; + int i3819; + int i3820; + int i3821; + int i3822; + int i3823; + int i3824; + int i3825; + int i3826; + int i3827; + int i3828; + int i3829; + int i3830; + int i3831; + int i3832; + int i3833; + int i3834; + int i3835; + int i3836; + int i3837; + int i3838; + int i3839; + int i3840; + int i3841; + int i3842; + int i3843; + int i3844; + int i3845; + int i3846; + int i3847; + int i3848; + int i3849; + int i3850; + int i3851; + int i3852; + int i3853; + int i3854; + int i3855; + int i3856; + int i3857; + int i3858; + int i3859; + int i3860; + int i3861; + int i3862; + int i3863; + int i3864; + int i3865; + int i3866; + int i3867; + int i3868; + int i3869; + int i3870; + int i3871; + int i3872; + int i3873; + int i3874; + int i3875; + int i3876; + int i3877; + int i3878; + int i3879; + int i3880; + int i3881; + int i3882; + int i3883; + int i3884; + int i3885; + int i3886; + int i3887; + int i3888; + int i3889; + int i3890; + int i3891; + int i3892; + int i3893; + int i3894; + int i3895; + int i3896; + int i3897; + int i3898; + int i3899; + int i3900; + int i3901; + int i3902; + int i3903; + int i3904; + int i3905; + int i3906; + int i3907; + int i3908; + int i3909; + int i3910; + int i3911; + int i3912; + int i3913; + int i3914; + int i3915; + int i3916; + int i3917; + int i3918; + int i3919; + int i3920; + int i3921; + int i3922; + int i3923; + int i3924; + int i3925; + int i3926; + int i3927; + int i3928; + int i3929; + int i3930; + int i3931; + int i3932; + int i3933; + int i3934; + int i3935; + int i3936; + int i3937; + int i3938; + int i3939; + int i3940; + int i3941; + int i3942; + int i3943; + int i3944; + int i3945; + int i3946; + int i3947; + int i3948; + int i3949; + int i3950; + int i3951; + int i3952; + int i3953; + int i3954; + int i3955; + int i3956; + int i3957; + int i3958; + int i3959; + int i3960; + int i3961; + int i3962; + int i3963; + int i3964; + int i3965; + int i3966; + int i3967; + int i3968; + int i3969; + int i3970; + int i3971; + int i3972; + int i3973; + int i3974; + int i3975; + int i3976; + int i3977; + int i3978; + int i3979; + int i3980; + int i3981; + int i3982; + int i3983; + int i3984; + int i3985; + int i3986; + int i3987; + int i3988; + int i3989; + int i3990; + int i3991; + int i3992; + int i3993; + int i3994; + int i3995; + int i3996; + int i3997; + int i3998; + int i3999; + int i4000; + int i4001; + int i4002; + int i4003; + int i4004; + int i4005; + int i4006; + int i4007; + int i4008; + int i4009; + int i4010; + int i4011; + int i4012; + int i4013; + int i4014; + int i4015; + int i4016; + int i4017; + int i4018; + int i4019; + int i4020; + int i4021; + int i4022; + int i4023; + int i4024; + int i4025; + int i4026; + int i4027; + int i4028; + int i4029; + int i4030; + int i4031; + int i4032; + int i4033; + int i4034; + int i4035; + int i4036; + int i4037; + int i4038; + int i4039; + int i4040; + int i4041; + int i4042; + int i4043; + int i4044; + int i4045; + int i4046; + int i4047; + int i4048; + int i4049; + int i4050; + int i4051; + int i4052; + int i4053; + int i4054; + int i4055; + int i4056; + int i4057; + int i4058; + int i4059; + int i4060; + int i4061; + int i4062; + int i4063; + int i4064; + int i4065; + int i4066; + int i4067; + int i4068; + int i4069; + int i4070; + int i4071; + int i4072; + int i4073; + int i4074; + int i4075; + int i4076; + int i4077; + int i4078; + int i4079; + int i4080; + int i4081; + int i4082; + int i4083; + int i4084; + int i4085; + int i4086; + int i4087; + int i4088; + int i4089; + int i4090; + int i4091; + int i4092; + int i4093; + int i4094; + int i4095; + int i4096; + int i4097; + int i4098; + int i4099; + int i4100; + int i4101; + int i4102; + int i4103; + int i4104; + int i4105; + int i4106; + int i4107; + int i4108; + int i4109; + int i4110; + int i4111; + int i4112; + int i4113; + int i4114; + int i4115; + int i4116; + int i4117; + int i4118; + int i4119; + int i4120; + int i4121; + int i4122; + int i4123; + int i4124; + int i4125; + int i4126; + int i4127; + int i4128; + int i4129; + int i4130; + int i4131; + int i4132; + int i4133; + int i4134; + int i4135; + int i4136; + int i4137; + int i4138; + int i4139; + int i4140; + int i4141; + int i4142; + int i4143; + int i4144; + int i4145; + int i4146; + int i4147; + int i4148; + int i4149; + int i4150; + int i4151; + int i4152; + int i4153; + int i4154; + int i4155; + int i4156; + int i4157; + int i4158; + int i4159; + int i4160; + int i4161; + int i4162; + int i4163; + int i4164; + int i4165; + int i4166; + int i4167; + int i4168; + int i4169; + int i4170; + int i4171; + int i4172; + int i4173; + int i4174; + int i4175; + int i4176; + int i4177; + int i4178; + int i4179; + int i4180; + int i4181; + int i4182; + int i4183; + int i4184; + int i4185; + int i4186; + int i4187; + int i4188; + int i4189; + int i4190; + int i4191; + int i4192; + int i4193; + int i4194; + int i4195; + int i4196; + int i4197; + int i4198; + int i4199; + int i4200; + int i4201; + int i4202; + int i4203; + int i4204; + int i4205; + int i4206; + int i4207; + int i4208; + int i4209; + int i4210; + int i4211; + int i4212; + int i4213; + int i4214; + int i4215; + int i4216; + int i4217; + int i4218; + int i4219; + int i4220; + int i4221; + int i4222; + int i4223; + int i4224; + int i4225; + int i4226; + int i4227; + int i4228; + int i4229; + int i4230; + int i4231; + int i4232; + int i4233; + int i4234; + int i4235; + int i4236; + int i4237; + int i4238; + int i4239; + int i4240; + int i4241; + int i4242; + int i4243; + int i4244; + int i4245; + int i4246; + int i4247; + int i4248; + int i4249; + int i4250; + int i4251; + int i4252; + int i4253; + int i4254; + int i4255; + int i4256; + int i4257; + int i4258; + int i4259; + int i4260; + int i4261; + int i4262; + int i4263; + int i4264; + int i4265; + int i4266; + int i4267; + int i4268; + int i4269; + int i4270; + int i4271; + int i4272; + int i4273; + int i4274; + int i4275; + int i4276; + int i4277; + int i4278; + int i4279; + int i4280; + int i4281; + int i4282; + int i4283; + int i4284; + int i4285; + int i4286; + int i4287; + int i4288; + int i4289; + int i4290; + int i4291; + int i4292; + int i4293; + int i4294; + int i4295; + int i4296; + int i4297; + int i4298; + int i4299; + int i4300; + int i4301; + int i4302; + int i4303; + int i4304; + int i4305; + int i4306; + int i4307; + int i4308; + int i4309; + int i4310; + int i4311; + int i4312; + int i4313; + int i4314; + int i4315; + int i4316; + int i4317; + int i4318; + int i4319; + int i4320; + int i4321; + int i4322; + int i4323; + int i4324; + int i4325; + int i4326; + int i4327; + int i4328; + int i4329; + int i4330; + int i4331; + int i4332; + int i4333; + int i4334; + int i4335; + int i4336; + int i4337; + int i4338; + int i4339; + int i4340; + int i4341; + int i4342; + int i4343; + int i4344; + int i4345; + int i4346; + int i4347; + int i4348; + int i4349; + int i4350; + int i4351; + int i4352; + int i4353; + int i4354; + int i4355; + int i4356; + int i4357; + int i4358; + int i4359; + int i4360; + int i4361; + int i4362; + int i4363; + int i4364; + int i4365; + int i4366; + int i4367; + int i4368; + int i4369; + int i4370; + int i4371; + int i4372; + int i4373; + int i4374; + int i4375; + int i4376; + int i4377; + int i4378; + int i4379; + int i4380; + int i4381; + int i4382; + int i4383; + int i4384; + int i4385; + int i4386; + int i4387; + int i4388; + int i4389; + int i4390; + int i4391; + int i4392; + int i4393; + int i4394; + int i4395; + int i4396; + int i4397; + int i4398; + int i4399; + int i4400; + int i4401; + int i4402; + int i4403; + int i4404; + int i4405; + int i4406; + int i4407; + int i4408; + int i4409; + int i4410; + int i4411; + int i4412; + int i4413; + int i4414; + int i4415; + int i4416; + int i4417; + int i4418; + int i4419; + int i4420; + int i4421; + int i4422; + int i4423; + int i4424; + int i4425; + int i4426; + int i4427; + int i4428; + int i4429; + int i4430; + int i4431; + int i4432; + int i4433; + int i4434; + int i4435; + int i4436; + int i4437; + int i4438; + int i4439; + int i4440; + int i4441; + int i4442; + int i4443; + int i4444; + int i4445; + int i4446; + int i4447; + int i4448; + int i4449; + int i4450; + int i4451; + int i4452; + int i4453; + int i4454; + int i4455; + int i4456; + int i4457; + int i4458; + int i4459; + int i4460; + int i4461; + int i4462; + int i4463; + int i4464; + int i4465; + int i4466; + int i4467; + int i4468; + int i4469; + int i4470; + int i4471; + int i4472; + int i4473; + int i4474; + int i4475; + int i4476; + int i4477; + int i4478; + int i4479; + int i4480; + int i4481; + int i4482; + int i4483; + int i4484; + int i4485; + int i4486; + int i4487; + int i4488; + int i4489; + int i4490; + int i4491; + int i4492; + int i4493; + int i4494; + int i4495; + int i4496; + int i4497; + int i4498; + int i4499; + int i4500; + int i4501; + int i4502; + int i4503; + int i4504; + int i4505; + int i4506; + int i4507; + int i4508; + int i4509; + int i4510; + int i4511; + int i4512; + int i4513; + int i4514; + int i4515; + int i4516; + int i4517; + int i4518; + int i4519; + int i4520; + int i4521; + int i4522; + int i4523; + int i4524; + int i4525; + int i4526; + int i4527; + int i4528; + int i4529; + int i4530; + int i4531; + int i4532; + int i4533; + int i4534; + int i4535; + int i4536; + int i4537; + int i4538; + int i4539; + int i4540; + int i4541; + int i4542; + int i4543; + int i4544; + int i4545; + int i4546; + int i4547; + int i4548; + int i4549; + int i4550; + int i4551; + int i4552; + int i4553; + int i4554; + int i4555; + int i4556; + int i4557; + int i4558; + int i4559; + int i4560; + int i4561; + int i4562; + int i4563; + int i4564; + int i4565; + int i4566; + int i4567; + int i4568; + int i4569; + int i4570; + int i4571; + int i4572; + int i4573; + int i4574; + int i4575; + int i4576; + int i4577; + int i4578; + int i4579; + int i4580; + int i4581; + int i4582; + int i4583; + int i4584; + int i4585; + int i4586; + int i4587; + int i4588; + int i4589; + int i4590; + int i4591; + int i4592; + int i4593; + int i4594; + int i4595; + int i4596; + int i4597; + int i4598; + int i4599; + int i4600; + int i4601; + int i4602; + int i4603; + int i4604; + int i4605; + int i4606; + int i4607; + int i4608; + int i4609; + int i4610; + int i4611; + int i4612; + int i4613; + int i4614; + int i4615; + int i4616; + int i4617; + int i4618; + int i4619; + int i4620; + int i4621; + int i4622; + int i4623; + int i4624; + int i4625; + int i4626; + int i4627; + int i4628; + int i4629; + int i4630; + int i4631; + int i4632; + int i4633; + int i4634; + int i4635; + int i4636; + int i4637; + int i4638; + int i4639; + int i4640; + int i4641; + int i4642; + int i4643; + int i4644; + int i4645; + int i4646; + int i4647; + int i4648; + int i4649; + int i4650; + int i4651; + int i4652; + int i4653; + int i4654; + int i4655; + int i4656; + int i4657; + int i4658; + int i4659; + int i4660; + int i4661; + int i4662; + int i4663; + int i4664; + int i4665; + int i4666; + int i4667; + int i4668; + int i4669; + int i4670; + int i4671; + int i4672; + int i4673; + int i4674; + int i4675; + int i4676; + int i4677; + int i4678; + int i4679; + int i4680; + int i4681; + int i4682; + int i4683; + int i4684; + int i4685; + int i4686; + int i4687; + int i4688; + int i4689; + int i4690; + int i4691; + int i4692; + int i4693; + int i4694; + int i4695; + int i4696; + int i4697; + int i4698; + int i4699; + int i4700; + int i4701; + int i4702; + int i4703; + int i4704; + int i4705; + int i4706; + int i4707; + int i4708; + int i4709; + int i4710; + int i4711; + int i4712; + int i4713; + int i4714; + int i4715; + int i4716; + int i4717; + int i4718; + int i4719; + int i4720; + int i4721; + int i4722; + int i4723; + int i4724; + int i4725; + int i4726; + int i4727; + int i4728; + int i4729; + int i4730; + int i4731; + int i4732; + int i4733; + int i4734; + int i4735; + int i4736; + int i4737; + int i4738; + int i4739; + int i4740; + int i4741; + int i4742; + int i4743; + int i4744; + int i4745; + int i4746; + int i4747; + int i4748; + int i4749; + int i4750; + int i4751; + int i4752; + int i4753; + int i4754; + int i4755; + int i4756; + int i4757; + int i4758; + int i4759; + int i4760; + int i4761; + int i4762; + int i4763; + int i4764; + int i4765; + int i4766; + int i4767; + int i4768; + int i4769; + int i4770; + int i4771; + int i4772; + int i4773; + int i4774; + int i4775; + int i4776; + int i4777; + int i4778; + int i4779; + int i4780; + int i4781; + int i4782; + int i4783; + int i4784; + int i4785; + int i4786; + int i4787; + int i4788; + int i4789; + int i4790; + int i4791; + int i4792; + int i4793; + int i4794; + int i4795; + int i4796; + int i4797; + int i4798; + int i4799; + int i4800; + int i4801; + int i4802; + int i4803; + int i4804; + int i4805; + int i4806; + int i4807; + int i4808; + int i4809; + int i4810; + int i4811; + int i4812; + int i4813; + int i4814; + int i4815; + int i4816; + int i4817; + int i4818; + int i4819; + int i4820; + int i4821; + int i4822; + int i4823; + int i4824; + int i4825; + int i4826; + int i4827; + int i4828; + int i4829; + int i4830; + int i4831; + int i4832; + int i4833; + int i4834; + int i4835; + int i4836; + int i4837; + int i4838; + int i4839; + int i4840; + int i4841; + int i4842; + int i4843; + int i4844; + int i4845; + int i4846; + int i4847; + int i4848; + int i4849; + int i4850; + int i4851; + int i4852; + int i4853; + int i4854; + int i4855; + int i4856; + int i4857; + int i4858; + int i4859; + int i4860; + int i4861; + int i4862; + int i4863; + int i4864; + int i4865; + int i4866; + int i4867; + int i4868; + int i4869; + int i4870; + int i4871; + int i4872; + int i4873; + int i4874; + int i4875; + int i4876; + int i4877; + int i4878; + int i4879; + int i4880; + int i4881; + int i4882; + int i4883; + int i4884; + int i4885; + int i4886; + int i4887; + int i4888; + int i4889; + int i4890; + int i4891; + int i4892; + int i4893; + int i4894; + int i4895; + int i4896; + int i4897; + int i4898; + int i4899; + int i4900; + int i4901; + int i4902; + int i4903; + int i4904; + int i4905; + int i4906; + int i4907; + int i4908; + int i4909; + int i4910; + int i4911; + int i4912; + int i4913; + int i4914; + int i4915; + int i4916; + int i4917; + int i4918; + int i4919; + int i4920; + int i4921; + int i4922; + int i4923; + int i4924; + int i4925; + int i4926; + int i4927; + int i4928; + int i4929; + int i4930; + int i4931; + int i4932; + int i4933; + int i4934; + int i4935; + int i4936; + int i4937; + int i4938; + int i4939; + int i4940; + int i4941; + int i4942; + int i4943; + int i4944; + int i4945; + int i4946; + int i4947; + int i4948; + int i4949; + int i4950; + int i4951; + int i4952; + int i4953; + int i4954; + int i4955; + int i4956; + int i4957; + int i4958; + int i4959; + int i4960; + int i4961; + int i4962; + int i4963; + int i4964; + int i4965; + int i4966; + int i4967; + int i4968; + int i4969; + int i4970; + int i4971; + int i4972; + int i4973; + int i4974; + int i4975; + int i4976; + int i4977; + int i4978; + int i4979; + int i4980; + int i4981; + int i4982; + int i4983; + int i4984; + int i4985; + int i4986; + int i4987; + int i4988; + int i4989; + int i4990; + int i4991; + int i4992; + int i4993; + int i4994; + int i4995; + int i4996; + int i4997; + int i4998; + int i4999; + int i5000; + int i5001; + int i5002; + int i5003; + int i5004; + int i5005; + int i5006; + int i5007; + int i5008; + int i5009; + int i5010; + int i5011; + int i5012; + int i5013; + int i5014; + int i5015; + int i5016; + int i5017; + int i5018; + int i5019; + int i5020; + int i5021; + int i5022; + int i5023; + int i5024; + int i5025; + int i5026; + int i5027; + int i5028; + int i5029; + int i5030; + int i5031; + int i5032; + int i5033; + int i5034; + int i5035; + int i5036; + int i5037; + int i5038; + int i5039; + int i5040; + int i5041; + int i5042; + int i5043; + int i5044; + int i5045; + int i5046; + int i5047; + int i5048; + int i5049; + int i5050; + int i5051; + int i5052; + int i5053; + int i5054; + int i5055; + int i5056; + int i5057; + int i5058; + int i5059; + int i5060; + int i5061; + int i5062; + int i5063; + int i5064; + int i5065; + int i5066; + int i5067; + int i5068; + int i5069; + int i5070; + int i5071; + int i5072; + int i5073; + int i5074; + int i5075; + int i5076; + int i5077; + int i5078; + int i5079; + int i5080; + int i5081; + int i5082; + int i5083; + int i5084; + int i5085; + int i5086; + int i5087; + int i5088; + int i5089; + int i5090; + int i5091; + int i5092; + int i5093; + int i5094; + int i5095; + int i5096; + int i5097; + int i5098; + int i5099; + int i5100; + int i5101; + int i5102; + int i5103; + int i5104; + int i5105; + int i5106; + int i5107; + int i5108; + int i5109; + int i5110; + int i5111; + int i5112; + int i5113; + int i5114; + int i5115; + int i5116; + int i5117; + int i5118; + int i5119; + int i5120; + int i5121; + int i5122; + int i5123; + int i5124; + int i5125; + int i5126; + int i5127; + int i5128; + int i5129; + int i5130; + int i5131; + int i5132; + int i5133; + int i5134; + int i5135; + int i5136; + int i5137; + int i5138; + int i5139; + int i5140; + int i5141; + int i5142; + int i5143; + int i5144; + int i5145; + int i5146; + int i5147; + int i5148; + int i5149; + int i5150; + int i5151; + int i5152; + int i5153; + int i5154; + int i5155; + int i5156; + int i5157; + int i5158; + int i5159; + int i5160; + int i5161; + int i5162; + int i5163; + int i5164; + int i5165; + int i5166; + int i5167; + int i5168; + int i5169; + int i5170; + int i5171; + int i5172; + int i5173; + int i5174; + int i5175; + int i5176; + int i5177; + int i5178; + int i5179; + int i5180; + int i5181; + int i5182; + int i5183; + int i5184; + int i5185; + int i5186; + int i5187; + int i5188; + int i5189; + int i5190; + int i5191; + int i5192; + int i5193; + int i5194; + int i5195; + int i5196; + int i5197; + int i5198; + int i5199; + int i5200; + int i5201; + int i5202; + int i5203; + int i5204; + int i5205; + int i5206; + int i5207; + int i5208; + int i5209; + int i5210; + int i5211; + int i5212; + int i5213; + int i5214; + int i5215; + int i5216; + int i5217; + int i5218; + int i5219; + int i5220; + int i5221; + int i5222; + int i5223; + int i5224; + int i5225; + int i5226; + int i5227; + int i5228; + int i5229; + int i5230; + int i5231; + int i5232; + int i5233; + int i5234; + int i5235; + int i5236; + int i5237; + int i5238; + int i5239; + int i5240; + int i5241; + int i5242; + int i5243; + int i5244; + int i5245; + int i5246; + int i5247; + int i5248; + int i5249; + int i5250; + int i5251; + int i5252; + int i5253; + int i5254; + int i5255; + int i5256; + int i5257; + int i5258; + int i5259; + int i5260; + int i5261; + int i5262; + int i5263; + int i5264; + int i5265; + int i5266; + int i5267; + int i5268; + int i5269; + int i5270; + int i5271; + int i5272; + int i5273; + int i5274; + int i5275; + int i5276; + int i5277; + int i5278; + int i5279; + int i5280; + int i5281; + int i5282; + int i5283; + int i5284; + int i5285; + int i5286; + int i5287; + int i5288; + int i5289; + int i5290; + int i5291; + int i5292; + int i5293; + int i5294; + int i5295; + int i5296; + int i5297; + int i5298; + int i5299; + int i5300; + int i5301; + int i5302; + int i5303; + int i5304; + int i5305; + int i5306; + int i5307; + int i5308; + int i5309; + int i5310; + int i5311; + int i5312; + int i5313; + int i5314; + int i5315; + int i5316; + int i5317; + int i5318; + int i5319; + int i5320; + int i5321; + int i5322; + int i5323; + int i5324; + int i5325; + int i5326; + int i5327; + int i5328; + int i5329; + int i5330; + int i5331; + int i5332; + int i5333; + int i5334; + int i5335; + int i5336; + int i5337; + int i5338; + int i5339; + int i5340; + int i5341; + int i5342; + int i5343; + int i5344; + int i5345; + int i5346; + int i5347; + int i5348; + int i5349; + int i5350; + int i5351; + int i5352; + int i5353; + int i5354; + int i5355; + int i5356; + int i5357; + int i5358; + int i5359; + int i5360; + int i5361; + int i5362; + int i5363; + int i5364; + int i5365; + int i5366; + int i5367; + int i5368; + int i5369; + int i5370; + int i5371; + int i5372; + int i5373; + int i5374; + int i5375; + int i5376; + int i5377; + int i5378; + int i5379; + int i5380; + int i5381; + int i5382; + int i5383; + int i5384; + int i5385; + int i5386; + int i5387; + int i5388; + int i5389; + int i5390; + int i5391; + int i5392; + int i5393; + int i5394; + int i5395; + int i5396; + int i5397; + int i5398; + int i5399; + int i5400; + int i5401; + int i5402; + int i5403; + int i5404; + int i5405; + int i5406; + int i5407; + int i5408; + int i5409; + int i5410; + int i5411; + int i5412; + int i5413; + int i5414; + int i5415; + int i5416; + int i5417; + int i5418; + int i5419; + int i5420; + int i5421; + int i5422; + int i5423; + int i5424; + int i5425; + int i5426; + int i5427; + int i5428; + int i5429; + int i5430; + int i5431; + int i5432; + int i5433; + int i5434; + int i5435; + int i5436; + int i5437; + int i5438; + int i5439; + int i5440; + int i5441; + int i5442; + int i5443; + int i5444; + int i5445; + int i5446; + int i5447; + int i5448; + int i5449; + int i5450; + int i5451; + int i5452; + int i5453; + int i5454; + int i5455; + int i5456; + int i5457; + int i5458; + int i5459; + int i5460; + int i5461; + int i5462; + int i5463; + int i5464; + int i5465; + int i5466; + int i5467; + int i5468; + int i5469; + int i5470; + int i5471; + int i5472; + int i5473; + int i5474; + int i5475; + int i5476; + int i5477; + int i5478; + int i5479; + int i5480; + int i5481; + int i5482; + int i5483; + int i5484; + int i5485; + int i5486; + int i5487; + int i5488; + int i5489; + int i5490; + int i5491; + int i5492; + int i5493; + int i5494; + int i5495; + int i5496; + int i5497; + int i5498; + int i5499; + int i5500; + int i5501; + int i5502; + int i5503; + int i5504; + int i5505; + int i5506; + int i5507; + int i5508; + int i5509; + int i5510; + int i5511; + int i5512; + int i5513; + int i5514; + int i5515; + int i5516; + int i5517; + int i5518; + int i5519; + int i5520; + int i5521; + int i5522; + int i5523; + int i5524; + int i5525; + int i5526; + int i5527; + int i5528; + int i5529; + int i5530; + int i5531; + int i5532; + int i5533; + int i5534; + int i5535; + int i5536; + int i5537; + int i5538; + int i5539; + int i5540; + int i5541; + int i5542; + int i5543; + int i5544; + int i5545; + int i5546; + int i5547; + int i5548; + int i5549; + int i5550; + int i5551; + int i5552; + int i5553; + int i5554; + int i5555; + int i5556; + int i5557; + int i5558; + int i5559; + int i5560; + int i5561; + int i5562; + int i5563; + int i5564; + int i5565; + int i5566; + int i5567; + int i5568; + int i5569; + int i5570; + int i5571; + int i5572; + int i5573; + int i5574; + int i5575; + int i5576; + int i5577; + int i5578; + int i5579; + int i5580; + int i5581; + int i5582; + int i5583; + int i5584; + int i5585; + int i5586; + int i5587; + int i5588; + int i5589; + int i5590; + int i5591; + int i5592; + int i5593; + int i5594; + int i5595; + int i5596; + int i5597; + int i5598; + int i5599; + int i5600; + int i5601; + int i5602; + int i5603; + int i5604; + int i5605; + int i5606; + int i5607; + int i5608; + int i5609; + int i5610; + int i5611; + int i5612; + int i5613; + int i5614; + int i5615; + int i5616; + int i5617; + int i5618; + int i5619; + int i5620; + int i5621; + int i5622; + int i5623; + int i5624; + int i5625; + int i5626; + int i5627; + int i5628; + int i5629; + int i5630; + int i5631; + int i5632; + int i5633; + int i5634; + int i5635; + int i5636; + int i5637; + int i5638; + int i5639; + int i5640; + int i5641; + int i5642; + int i5643; + int i5644; + int i5645; + int i5646; + int i5647; + int i5648; + int i5649; + int i5650; + int i5651; + int i5652; + int i5653; + int i5654; + int i5655; + int i5656; + int i5657; + int i5658; + int i5659; + int i5660; + int i5661; + int i5662; + int i5663; + int i5664; + int i5665; + int i5666; + int i5667; + int i5668; + int i5669; + int i5670; + int i5671; + int i5672; + int i5673; + int i5674; + int i5675; + int i5676; + int i5677; + int i5678; + int i5679; + int i5680; + int i5681; + int i5682; + int i5683; + int i5684; + int i5685; + int i5686; + int i5687; + int i5688; + int i5689; + int i5690; + int i5691; + int i5692; + int i5693; + int i5694; + int i5695; + int i5696; + int i5697; + int i5698; + int i5699; + int i5700; + int i5701; + int i5702; + int i5703; + int i5704; + int i5705; + int i5706; + int i5707; + int i5708; + int i5709; + int i5710; + int i5711; + int i5712; + int i5713; + int i5714; + int i5715; + int i5716; + int i5717; + int i5718; + int i5719; + int i5720; + int i5721; + int i5722; + int i5723; + int i5724; + int i5725; + int i5726; + int i5727; + int i5728; + int i5729; + int i5730; + int i5731; + int i5732; + int i5733; + int i5734; + int i5735; + int i5736; + int i5737; + int i5738; + int i5739; + int i5740; + int i5741; + int i5742; + int i5743; + int i5744; + int i5745; + int i5746; + int i5747; + int i5748; + int i5749; + int i5750; + int i5751; + int i5752; + int i5753; + int i5754; + int i5755; + int i5756; + int i5757; + int i5758; + int i5759; + int i5760; + int i5761; + int i5762; + int i5763; + int i5764; + int i5765; + int i5766; + int i5767; + int i5768; + int i5769; + int i5770; + int i5771; + int i5772; + int i5773; + int i5774; + int i5775; + int i5776; + int i5777; + int i5778; + int i5779; + int i5780; + int i5781; + int i5782; + int i5783; + int i5784; + int i5785; + int i5786; + int i5787; + int i5788; + int i5789; + int i5790; + int i5791; + int i5792; + int i5793; + int i5794; + int i5795; + int i5796; + int i5797; + int i5798; + int i5799; + int i5800; + int i5801; + int i5802; + int i5803; + int i5804; + int i5805; + int i5806; + int i5807; + int i5808; + int i5809; + int i5810; + int i5811; + int i5812; + int i5813; + int i5814; + int i5815; + int i5816; + int i5817; + int i5818; + int i5819; + int i5820; + int i5821; + int i5822; + int i5823; + int i5824; + int i5825; + int i5826; + int i5827; + int i5828; + int i5829; + int i5830; + int i5831; + int i5832; + int i5833; + int i5834; + int i5835; + int i5836; + int i5837; + int i5838; + int i5839; + int i5840; + int i5841; + int i5842; + int i5843; + int i5844; + int i5845; + int i5846; + int i5847; + int i5848; + int i5849; + int i5850; + int i5851; + int i5852; + int i5853; + int i5854; + int i5855; + int i5856; + int i5857; + int i5858; + int i5859; + int i5860; + int i5861; + int i5862; + int i5863; + int i5864; + int i5865; + int i5866; + int i5867; + int i5868; + int i5869; + int i5870; + int i5871; + int i5872; + int i5873; + int i5874; + int i5875; + int i5876; + int i5877; + int i5878; + int i5879; + int i5880; + int i5881; + int i5882; + int i5883; + int i5884; + int i5885; + int i5886; + int i5887; + int i5888; + int i5889; + int i5890; + int i5891; + int i5892; + int i5893; + int i5894; + int i5895; + int i5896; + int i5897; + int i5898; + int i5899; + int i5900; + int i5901; + int i5902; + int i5903; + int i5904; + int i5905; + int i5906; + int i5907; + int i5908; + int i5909; + int i5910; + int i5911; + int i5912; + int i5913; + int i5914; + int i5915; + int i5916; + int i5917; + int i5918; + int i5919; + int i5920; + int i5921; + int i5922; + int i5923; + int i5924; + int i5925; + int i5926; + int i5927; + int i5928; + int i5929; + int i5930; + int i5931; + int i5932; + int i5933; + int i5934; + int i5935; + int i5936; + int i5937; + int i5938; + int i5939; + int i5940; + int i5941; + int i5942; + int i5943; + int i5944; + int i5945; + int i5946; + int i5947; + int i5948; + int i5949; + int i5950; + int i5951; + int i5952; + int i5953; + int i5954; + int i5955; + int i5956; + int i5957; + int i5958; + int i5959; + int i5960; + int i5961; + int i5962; + int i5963; + int i5964; + int i5965; + int i5966; + int i5967; + int i5968; + int i5969; + int i5970; + int i5971; + int i5972; + int i5973; + int i5974; + int i5975; + int i5976; + int i5977; + int i5978; + int i5979; + int i5980; + int i5981; + int i5982; + int i5983; + int i5984; + int i5985; + int i5986; + int i5987; + int i5988; + int i5989; + int i5990; + int i5991; + int i5992; + int i5993; + int i5994; + int i5995; + int i5996; + int i5997; + int i5998; + int i5999; + int i6000; + int i6001; + int i6002; + int i6003; + int i6004; + int i6005; + int i6006; + int i6007; + int i6008; + int i6009; + int i6010; + int i6011; + int i6012; + int i6013; + int i6014; + int i6015; + int i6016; + int i6017; + int i6018; + int i6019; + int i6020; + int i6021; + int i6022; + int i6023; + int i6024; + int i6025; + int i6026; + int i6027; + int i6028; + int i6029; + int i6030; + int i6031; + int i6032; + int i6033; + int i6034; + int i6035; + int i6036; + int i6037; + int i6038; + int i6039; + int i6040; + int i6041; + int i6042; + int i6043; + int i6044; + int i6045; + int i6046; + int i6047; + int i6048; + int i6049; + int i6050; + int i6051; + int i6052; + int i6053; + int i6054; + int i6055; + int i6056; + int i6057; + int i6058; + int i6059; + int i6060; + int i6061; + int i6062; + int i6063; + int i6064; + int i6065; + int i6066; + int i6067; + int i6068; + int i6069; + int i6070; + int i6071; + int i6072; + int i6073; + int i6074; + int i6075; + int i6076; + int i6077; + int i6078; + int i6079; + int i6080; + int i6081; + int i6082; + int i6083; + int i6084; + int i6085; + int i6086; + int i6087; + int i6088; + int i6089; + int i6090; + int i6091; + int i6092; + int i6093; + int i6094; + int i6095; + int i6096; + int i6097; + int i6098; + int i6099; + int i6100; + int i6101; + int i6102; + int i6103; + int i6104; + int i6105; + int i6106; + int i6107; + int i6108; + int i6109; + int i6110; + int i6111; + int i6112; + int i6113; + int i6114; + int i6115; + int i6116; + int i6117; + int i6118; + int i6119; + int i6120; + int i6121; + int i6122; + int i6123; + int i6124; + int i6125; + int i6126; + int i6127; + int i6128; + int i6129; + int i6130; + int i6131; + int i6132; + int i6133; + int i6134; + int i6135; + int i6136; + int i6137; + int i6138; + int i6139; + int i6140; + int i6141; + int i6142; + int i6143; + int i6144; + int i6145; + int i6146; + int i6147; + int i6148; + int i6149; + int i6150; + int i6151; + int i6152; + int i6153; + int i6154; + int i6155; + int i6156; + int i6157; + int i6158; + int i6159; + int i6160; + int i6161; + int i6162; + int i6163; + int i6164; + int i6165; + int i6166; + int i6167; + int i6168; + int i6169; + int i6170; + int i6171; + int i6172; + int i6173; + int i6174; + int i6175; + int i6176; + int i6177; + int i6178; + int i6179; + int i6180; + int i6181; + int i6182; + int i6183; + int i6184; + int i6185; + int i6186; + int i6187; + int i6188; + int i6189; + int i6190; + int i6191; + int i6192; + int i6193; + int i6194; + int i6195; + int i6196; + int i6197; + int i6198; + int i6199; + int i6200; + int i6201; + int i6202; + int i6203; + int i6204; + int i6205; + int i6206; + int i6207; + int i6208; + int i6209; + int i6210; + int i6211; + int i6212; + int i6213; + int i6214; + int i6215; + int i6216; + int i6217; + int i6218; + int i6219; + int i6220; + int i6221; + int i6222; + int i6223; + int i6224; + int i6225; + int i6226; + int i6227; + int i6228; + int i6229; + int i6230; + int i6231; + int i6232; + int i6233; + int i6234; + int i6235; + int i6236; + int i6237; + int i6238; + int i6239; + int i6240; + int i6241; + int i6242; + int i6243; + int i6244; + int i6245; + int i6246; + int i6247; + int i6248; + int i6249; + int i6250; + int i6251; + int i6252; + int i6253; + int i6254; + int i6255; + int i6256; + int i6257; + int i6258; + int i6259; + int i6260; + int i6261; + int i6262; + int i6263; + int i6264; + int i6265; + int i6266; + int i6267; + int i6268; + int i6269; + int i6270; + int i6271; + int i6272; + int i6273; + int i6274; + int i6275; + int i6276; + int i6277; + int i6278; + int i6279; + int i6280; + int i6281; + int i6282; + int i6283; + int i6284; + int i6285; + int i6286; + int i6287; + int i6288; + int i6289; + int i6290; + int i6291; + int i6292; + int i6293; + int i6294; + int i6295; + int i6296; + int i6297; + int i6298; + int i6299; + int i6300; + int i6301; + int i6302; + int i6303; + int i6304; + int i6305; + int i6306; + int i6307; + int i6308; + int i6309; + int i6310; + int i6311; + int i6312; + int i6313; + int i6314; + int i6315; + int i6316; + int i6317; + int i6318; + int i6319; + int i6320; + int i6321; + int i6322; + int i6323; + int i6324; + int i6325; + int i6326; + int i6327; + int i6328; + int i6329; + int i6330; + int i6331; + int i6332; + int i6333; + int i6334; + int i6335; + int i6336; + int i6337; + int i6338; + int i6339; + int i6340; + int i6341; + int i6342; + int i6343; + int i6344; + int i6345; + int i6346; + int i6347; + int i6348; + int i6349; + int i6350; + int i6351; + int i6352; + int i6353; + int i6354; + int i6355; + int i6356; + int i6357; + int i6358; + int i6359; + int i6360; + int i6361; + int i6362; + int i6363; + int i6364; + int i6365; + int i6366; + int i6367; + int i6368; + int i6369; + int i6370; + int i6371; + int i6372; + int i6373; + int i6374; + int i6375; + int i6376; + int i6377; + int i6378; + int i6379; + int i6380; + int i6381; + int i6382; + int i6383; + int i6384; + int i6385; + int i6386; + int i6387; + int i6388; + int i6389; + int i6390; + int i6391; + int i6392; + int i6393; + int i6394; + int i6395; + int i6396; + int i6397; + int i6398; + int i6399; + int i6400; + int i6401; + int i6402; + int i6403; + int i6404; + int i6405; + int i6406; + int i6407; + int i6408; + int i6409; + int i6410; + int i6411; + int i6412; + int i6413; + int i6414; + int i6415; + int i6416; + int i6417; + int i6418; + int i6419; + int i6420; + int i6421; + int i6422; + int i6423; + int i6424; + int i6425; + int i6426; + int i6427; + int i6428; + int i6429; + int i6430; + int i6431; + int i6432; + int i6433; + int i6434; + int i6435; + int i6436; + int i6437; + int i6438; + int i6439; + int i6440; + int i6441; + int i6442; + int i6443; + int i6444; + int i6445; + int i6446; + int i6447; + int i6448; + int i6449; + int i6450; + int i6451; + int i6452; + int i6453; + int i6454; + int i6455; + int i6456; + int i6457; + int i6458; + int i6459; + int i6460; + int i6461; + int i6462; + int i6463; + int i6464; + int i6465; + int i6466; + int i6467; + int i6468; + int i6469; + int i6470; + int i6471; + int i6472; + int i6473; + int i6474; + int i6475; + int i6476; + int i6477; + int i6478; + int i6479; + int i6480; + int i6481; + int i6482; + int i6483; + int i6484; + int i6485; + int i6486; + int i6487; + int i6488; + int i6489; + int i6490; + int i6491; + int i6492; + int i6493; + int i6494; + int i6495; + int i6496; + int i6497; + int i6498; + int i6499; + int i6500; + int i6501; + int i6502; + int i6503; + int i6504; + int i6505; + int i6506; + int i6507; + int i6508; + int i6509; + int i6510; + int i6511; + int i6512; + int i6513; + int i6514; + int i6515; + int i6516; + int i6517; + int i6518; + int i6519; + int i6520; + int i6521; + int i6522; + int i6523; + int i6524; + int i6525; + int i6526; + int i6527; + int i6528; + int i6529; + int i6530; + int i6531; + int i6532; + int i6533; + int i6534; + int i6535; + int i6536; + int i6537; + int i6538; + int i6539; + int i6540; + int i6541; + int i6542; + int i6543; + int i6544; + int i6545; + int i6546; + int i6547; + int i6548; + int i6549; + int i6550; + int i6551; + int i6552; + int i6553; + int i6554; + int i6555; + int i6556; + int i6557; + int i6558; + int i6559; + int i6560; + int i6561; + int i6562; + int i6563; + int i6564; + int i6565; + int i6566; + int i6567; + int i6568; + int i6569; + int i6570; + int i6571; + int i6572; + int i6573; + int i6574; + int i6575; + int i6576; + int i6577; + int i6578; + int i6579; + int i6580; + int i6581; + int i6582; + int i6583; + int i6584; + int i6585; + int i6586; + int i6587; + int i6588; + int i6589; + int i6590; + int i6591; + int i6592; + int i6593; + int i6594; + int i6595; + int i6596; + int i6597; + int i6598; + int i6599; + int i6600; + int i6601; + int i6602; + int i6603; + int i6604; + int i6605; + int i6606; + int i6607; + int i6608; + int i6609; + int i6610; + int i6611; + int i6612; + int i6613; + int i6614; + int i6615; + int i6616; + int i6617; + int i6618; + int i6619; + int i6620; + int i6621; + int i6622; + int i6623; + int i6624; + int i6625; + int i6626; + int i6627; + int i6628; + int i6629; + int i6630; + int i6631; + int i6632; + int i6633; + int i6634; + int i6635; + int i6636; + int i6637; + int i6638; + int i6639; + int i6640; + int i6641; + int i6642; + int i6643; + int i6644; + int i6645; + int i6646; + int i6647; + int i6648; + int i6649; + int i6650; + int i6651; + int i6652; + int i6653; + int i6654; + int i6655; + int i6656; + int i6657; + int i6658; + int i6659; + int i6660; + int i6661; + int i6662; + int i6663; + int i6664; + int i6665; + int i6666; + int i6667; + int i6668; + int i6669; + int i6670; + int i6671; + int i6672; + int i6673; + int i6674; + int i6675; + int i6676; + int i6677; + int i6678; + int i6679; + int i6680; + int i6681; + int i6682; + int i6683; + int i6684; + int i6685; + int i6686; + int i6687; + int i6688; + int i6689; + int i6690; + int i6691; + int i6692; + int i6693; + int i6694; + int i6695; + int i6696; + int i6697; + int i6698; + int i6699; + int i6700; + int i6701; + int i6702; + int i6703; + int i6704; + int i6705; + int i6706; + int i6707; + int i6708; + int i6709; + int i6710; + int i6711; + int i6712; + int i6713; + int i6714; + int i6715; + int i6716; + int i6717; + int i6718; + int i6719; + int i6720; + int i6721; + int i6722; + int i6723; + int i6724; + int i6725; + int i6726; + int i6727; + int i6728; + int i6729; + int i6730; + int i6731; + int i6732; + int i6733; + int i6734; + int i6735; + int i6736; + int i6737; + int i6738; + int i6739; + int i6740; + int i6741; + int i6742; + int i6743; + int i6744; + int i6745; + int i6746; + int i6747; + int i6748; + int i6749; + int i6750; + int i6751; + int i6752; + int i6753; + int i6754; + int i6755; + int i6756; + int i6757; + int i6758; + int i6759; + int i6760; + int i6761; + int i6762; + int i6763; + int i6764; + int i6765; + int i6766; + int i6767; + int i6768; + int i6769; + int i6770; + int i6771; + int i6772; + int i6773; + int i6774; + int i6775; + int i6776; + int i6777; + int i6778; + int i6779; + int i6780; + int i6781; + int i6782; + int i6783; + int i6784; + int i6785; + int i6786; + int i6787; + int i6788; + int i6789; + int i6790; + int i6791; + int i6792; + int i6793; + int i6794; + int i6795; + int i6796; + int i6797; + int i6798; + int i6799; + int i6800; + int i6801; + int i6802; + int i6803; + int i6804; + int i6805; + int i6806; + int i6807; + int i6808; + int i6809; + int i6810; + int i6811; + int i6812; + int i6813; + int i6814; + int i6815; + int i6816; + int i6817; + int i6818; + int i6819; + int i6820; + int i6821; + int i6822; + int i6823; + int i6824; + int i6825; + int i6826; + int i6827; + int i6828; + int i6829; + int i6830; + int i6831; + int i6832; + int i6833; + int i6834; + int i6835; + int i6836; + int i6837; + int i6838; + int i6839; + int i6840; + int i6841; + int i6842; + int i6843; + int i6844; + int i6845; + int i6846; + int i6847; + int i6848; + int i6849; + int i6850; + int i6851; + int i6852; + int i6853; + int i6854; + int i6855; + int i6856; + int i6857; + int i6858; + int i6859; + int i6860; + int i6861; + int i6862; + int i6863; + int i6864; + int i6865; + int i6866; + int i6867; + int i6868; + int i6869; + int i6870; + int i6871; + int i6872; + int i6873; + int i6874; + int i6875; + int i6876; + int i6877; + int i6878; + int i6879; + int i6880; + int i6881; + int i6882; + int i6883; + int i6884; + int i6885; + int i6886; + int i6887; + int i6888; + int i6889; + int i6890; + int i6891; + int i6892; + int i6893; + int i6894; + int i6895; + int i6896; + int i6897; + int i6898; + int i6899; + int i6900; + int i6901; + int i6902; + int i6903; + int i6904; + int i6905; + int i6906; + int i6907; + int i6908; + int i6909; + int i6910; + int i6911; + int i6912; + int i6913; + int i6914; + int i6915; + int i6916; + int i6917; + int i6918; + int i6919; + int i6920; + int i6921; + int i6922; + int i6923; + int i6924; + int i6925; + int i6926; + int i6927; + int i6928; + int i6929; + int i6930; + int i6931; + int i6932; + int i6933; + int i6934; + int i6935; + int i6936; + int i6937; + int i6938; + int i6939; + int i6940; + int i6941; + int i6942; + int i6943; + int i6944; + int i6945; + int i6946; + int i6947; + int i6948; + int i6949; + int i6950; + int i6951; + int i6952; + int i6953; + int i6954; + int i6955; + int i6956; + int i6957; + int i6958; + int i6959; + int i6960; + int i6961; + int i6962; + int i6963; + int i6964; + int i6965; + int i6966; + int i6967; + int i6968; + int i6969; + int i6970; + int i6971; + int i6972; + int i6973; + int i6974; + int i6975; + int i6976; + int i6977; + int i6978; + int i6979; + int i6980; + int i6981; + int i6982; + int i6983; + int i6984; + int i6985; + int i6986; + int i6987; + int i6988; + int i6989; + int i6990; + int i6991; + int i6992; + int i6993; + int i6994; + int i6995; + int i6996; + int i6997; + int i6998; + int i6999; + int i7000; + int i7001; + int i7002; + int i7003; + int i7004; + int i7005; + int i7006; + int i7007; + int i7008; + int i7009; + int i7010; + int i7011; + int i7012; + int i7013; + int i7014; + int i7015; + int i7016; + int i7017; + int i7018; + int i7019; + int i7020; + int i7021; + int i7022; + int i7023; + int i7024; + int i7025; + int i7026; + int i7027; + int i7028; + int i7029; + int i7030; + int i7031; + int i7032; + int i7033; + int i7034; + int i7035; + int i7036; + int i7037; + int i7038; + int i7039; + int i7040; + int i7041; + int i7042; + int i7043; + int i7044; + int i7045; + int i7046; + int i7047; + int i7048; + int i7049; + int i7050; + int i7051; + int i7052; + int i7053; + int i7054; + int i7055; + int i7056; + int i7057; + int i7058; + int i7059; + int i7060; + int i7061; + int i7062; + int i7063; + int i7064; + int i7065; + int i7066; + int i7067; + int i7068; + int i7069; + int i7070; + int i7071; + int i7072; + int i7073; + int i7074; + int i7075; + int i7076; + int i7077; + int i7078; + int i7079; + int i7080; + int i7081; + int i7082; + int i7083; + int i7084; + int i7085; + int i7086; + int i7087; + int i7088; + int i7089; + int i7090; + int i7091; + int i7092; + int i7093; + int i7094; + int i7095; + int i7096; + int i7097; + int i7098; + int i7099; + int i7100; + int i7101; + int i7102; + int i7103; + int i7104; + int i7105; + int i7106; + int i7107; + int i7108; + int i7109; + int i7110; + int i7111; + int i7112; + int i7113; + int i7114; + int i7115; + int i7116; + int i7117; + int i7118; + int i7119; + int i7120; + int i7121; + int i7122; + int i7123; + int i7124; + int i7125; + int i7126; + int i7127; + int i7128; + int i7129; + int i7130; + int i7131; + int i7132; + int i7133; + int i7134; + int i7135; + int i7136; + int i7137; + int i7138; + int i7139; + int i7140; + int i7141; + int i7142; + int i7143; + int i7144; + int i7145; + int i7146; + int i7147; + int i7148; + int i7149; + int i7150; + int i7151; + int i7152; + int i7153; + int i7154; + int i7155; + int i7156; + int i7157; + int i7158; + int i7159; + int i7160; + int i7161; + int i7162; + int i7163; + int i7164; + int i7165; + int i7166; + int i7167; + int i7168; + int i7169; + int i7170; + int i7171; + int i7172; + int i7173; + int i7174; + int i7175; + int i7176; + int i7177; + int i7178; + int i7179; + int i7180; + int i7181; + int i7182; + int i7183; + int i7184; + int i7185; + int i7186; + int i7187; + int i7188; + int i7189; + int i7190; + int i7191; + int i7192; + int i7193; + int i7194; + int i7195; + int i7196; + int i7197; + int i7198; + int i7199; + int i7200; + int i7201; + int i7202; + int i7203; + int i7204; + int i7205; + int i7206; + int i7207; + int i7208; + int i7209; + int i7210; + int i7211; + int i7212; + int i7213; + int i7214; + int i7215; + int i7216; + int i7217; + int i7218; + int i7219; + int i7220; + int i7221; + int i7222; + int i7223; + int i7224; + int i7225; + int i7226; + int i7227; + int i7228; + int i7229; + int i7230; + int i7231; + int i7232; + int i7233; + int i7234; + int i7235; + int i7236; + int i7237; + int i7238; + int i7239; + int i7240; + int i7241; + int i7242; + int i7243; + int i7244; + int i7245; + int i7246; + int i7247; + int i7248; + int i7249; + int i7250; + int i7251; + int i7252; + int i7253; + int i7254; + int i7255; + int i7256; + int i7257; + int i7258; + int i7259; + int i7260; + int i7261; + int i7262; + int i7263; + int i7264; + int i7265; + int i7266; + int i7267; + int i7268; + int i7269; + int i7270; + int i7271; + int i7272; + int i7273; + int i7274; + int i7275; + int i7276; + int i7277; + int i7278; + int i7279; + int i7280; + int i7281; + int i7282; + int i7283; + int i7284; + int i7285; + int i7286; + int i7287; + int i7288; + int i7289; + int i7290; + int i7291; + int i7292; + int i7293; + int i7294; + int i7295; + int i7296; + int i7297; + int i7298; + int i7299; + int i7300; + int i7301; + int i7302; + int i7303; + int i7304; + int i7305; + int i7306; + int i7307; + int i7308; + int i7309; + int i7310; + int i7311; + int i7312; + int i7313; + int i7314; + int i7315; + int i7316; + int i7317; + int i7318; + int i7319; + int i7320; + int i7321; + int i7322; + int i7323; + int i7324; + int i7325; + int i7326; + int i7327; + int i7328; + int i7329; + int i7330; + int i7331; + int i7332; + int i7333; + int i7334; + int i7335; + int i7336; + int i7337; + int i7338; + int i7339; + int i7340; + int i7341; + int i7342; + int i7343; + int i7344; + int i7345; + int i7346; + int i7347; + int i7348; + int i7349; + int i7350; + int i7351; + int i7352; + int i7353; + int i7354; + int i7355; + int i7356; + int i7357; + int i7358; + int i7359; + int i7360; + int i7361; + int i7362; + int i7363; + int i7364; + int i7365; + int i7366; + int i7367; + int i7368; + int i7369; + int i7370; + int i7371; + int i7372; + int i7373; + int i7374; + int i7375; + int i7376; + int i7377; + int i7378; + int i7379; + int i7380; + int i7381; + int i7382; + int i7383; + int i7384; + int i7385; + int i7386; + int i7387; + int i7388; + int i7389; + int i7390; + int i7391; + int i7392; + int i7393; + int i7394; + int i7395; + int i7396; + int i7397; + int i7398; + int i7399; + int i7400; + int i7401; + int i7402; + int i7403; + int i7404; + int i7405; + int i7406; + int i7407; + int i7408; + int i7409; + int i7410; + int i7411; + int i7412; + int i7413; + int i7414; + int i7415; + int i7416; + int i7417; + int i7418; + int i7419; + int i7420; + int i7421; + int i7422; + int i7423; + int i7424; + int i7425; + int i7426; + int i7427; + int i7428; + int i7429; + int i7430; + int i7431; + int i7432; + int i7433; + int i7434; + int i7435; + int i7436; + int i7437; + int i7438; + int i7439; + int i7440; + int i7441; + int i7442; + int i7443; + int i7444; + int i7445; + int i7446; + int i7447; + int i7448; + int i7449; + int i7450; + int i7451; + int i7452; + int i7453; + int i7454; + int i7455; + int i7456; + int i7457; + int i7458; + int i7459; + int i7460; + int i7461; + int i7462; + int i7463; + int i7464; + int i7465; + int i7466; + int i7467; + int i7468; + int i7469; + int i7470; + int i7471; + int i7472; + int i7473; + int i7474; + int i7475; + int i7476; + int i7477; + int i7478; + int i7479; + int i7480; + int i7481; + int i7482; + int i7483; + int i7484; + int i7485; + int i7486; + int i7487; + int i7488; + int i7489; + int i7490; + int i7491; + int i7492; + int i7493; + int i7494; + int i7495; + int i7496; + int i7497; + int i7498; + int i7499; + int i7500; + int i7501; + int i7502; + int i7503; + int i7504; + int i7505; + int i7506; + int i7507; + int i7508; + int i7509; + int i7510; + int i7511; + int i7512; + int i7513; + int i7514; + int i7515; + int i7516; + int i7517; + int i7518; + int i7519; + int i7520; + int i7521; + int i7522; + int i7523; + int i7524; + int i7525; + int i7526; + int i7527; + int i7528; + int i7529; + int i7530; + int i7531; + int i7532; + int i7533; + int i7534; + int i7535; + int i7536; + int i7537; + int i7538; + int i7539; + int i7540; + int i7541; + int i7542; + int i7543; + int i7544; + int i7545; + int i7546; + int i7547; + int i7548; + int i7549; + int i7550; + int i7551; + int i7552; + int i7553; + int i7554; + int i7555; + int i7556; + int i7557; + int i7558; + int i7559; + int i7560; + int i7561; + int i7562; + int i7563; + int i7564; + int i7565; + int i7566; + int i7567; + int i7568; + int i7569; + int i7570; + int i7571; + int i7572; + int i7573; + int i7574; + int i7575; + int i7576; + int i7577; + int i7578; + int i7579; + int i7580; + int i7581; + int i7582; + int i7583; + int i7584; + int i7585; + int i7586; + int i7587; + int i7588; + int i7589; + int i7590; + int i7591; + int i7592; + int i7593; + int i7594; + int i7595; + int i7596; + int i7597; + int i7598; + int i7599; + int i7600; + int i7601; + int i7602; + int i7603; + int i7604; + int i7605; + int i7606; + int i7607; + int i7608; + int i7609; + int i7610; + int i7611; + int i7612; + int i7613; + int i7614; + int i7615; + int i7616; + int i7617; + int i7618; + int i7619; + int i7620; + int i7621; + int i7622; + int i7623; + int i7624; + int i7625; + int i7626; + int i7627; + int i7628; + int i7629; + int i7630; + int i7631; + int i7632; + int i7633; + int i7634; + int i7635; + int i7636; + int i7637; + int i7638; + int i7639; + int i7640; + int i7641; + int i7642; + int i7643; + int i7644; + int i7645; + int i7646; + int i7647; + int i7648; + int i7649; + int i7650; + int i7651; + int i7652; + int i7653; + int i7654; + int i7655; + int i7656; + int i7657; + int i7658; + int i7659; + int i7660; + int i7661; + int i7662; + int i7663; + int i7664; + int i7665; + int i7666; + int i7667; + int i7668; + int i7669; + int i7670; + int i7671; + int i7672; + int i7673; + int i7674; + int i7675; + int i7676; + int i7677; + int i7678; + int i7679; + int i7680; + int i7681; + int i7682; + int i7683; + int i7684; + int i7685; + int i7686; + int i7687; + int i7688; + int i7689; + int i7690; + int i7691; + int i7692; + int i7693; + int i7694; + int i7695; + int i7696; + int i7697; + int i7698; + int i7699; + int i7700; + int i7701; + int i7702; + int i7703; + int i7704; + int i7705; + int i7706; + int i7707; + int i7708; + int i7709; + int i7710; + int i7711; + int i7712; + int i7713; + int i7714; + int i7715; + int i7716; + int i7717; + int i7718; + int i7719; + int i7720; + int i7721; + int i7722; + int i7723; + int i7724; + int i7725; + int i7726; + int i7727; + int i7728; + int i7729; + int i7730; + int i7731; + int i7732; + int i7733; + int i7734; + int i7735; + int i7736; + int i7737; + int i7738; + int i7739; + int i7740; + int i7741; + int i7742; + int i7743; + int i7744; + int i7745; + int i7746; + int i7747; + int i7748; + int i7749; + int i7750; + int i7751; + int i7752; + int i7753; + int i7754; + int i7755; + int i7756; + int i7757; + int i7758; + int i7759; + int i7760; + int i7761; + int i7762; + int i7763; + int i7764; + int i7765; + int i7766; + int i7767; + int i7768; + int i7769; + int i7770; + int i7771; + int i7772; + int i7773; + int i7774; + int i7775; + int i7776; + int i7777; + int i7778; + int i7779; + int i7780; + int i7781; + int i7782; + int i7783; + int i7784; + int i7785; + int i7786; + int i7787; + int i7788; + int i7789; + int i7790; + int i7791; + int i7792; + int i7793; + int i7794; + int i7795; + int i7796; + int i7797; + int i7798; + int i7799; + int i7800; + int i7801; + int i7802; + int i7803; + int i7804; + int i7805; + int i7806; + int i7807; + int i7808; + int i7809; + int i7810; + int i7811; + int i7812; + int i7813; + int i7814; + int i7815; + int i7816; + int i7817; + int i7818; + int i7819; + int i7820; + int i7821; + int i7822; + int i7823; + int i7824; + int i7825; + int i7826; + int i7827; + int i7828; + int i7829; + int i7830; + int i7831; + int i7832; + int i7833; + int i7834; + int i7835; + int i7836; + int i7837; + int i7838; + int i7839; + int i7840; + int i7841; + int i7842; + int i7843; + int i7844; + int i7845; + int i7846; + int i7847; + int i7848; + int i7849; + int i7850; + int i7851; + int i7852; + int i7853; + int i7854; + int i7855; + int i7856; + int i7857; + int i7858; + int i7859; + int i7860; + int i7861; + int i7862; + int i7863; + int i7864; + int i7865; + int i7866; + int i7867; + int i7868; + int i7869; + int i7870; + int i7871; + int i7872; + int i7873; + int i7874; + int i7875; + int i7876; + int i7877; + int i7878; + int i7879; + int i7880; + int i7881; + int i7882; + int i7883; + int i7884; + int i7885; + int i7886; + int i7887; + int i7888; + int i7889; + int i7890; + int i7891; + int i7892; + int i7893; + int i7894; + int i7895; + int i7896; + int i7897; + int i7898; + int i7899; + int i7900; + int i7901; + int i7902; + int i7903; + int i7904; + int i7905; + int i7906; + int i7907; + int i7908; + int i7909; + int i7910; + int i7911; + int i7912; + int i7913; + int i7914; + int i7915; + int i7916; + int i7917; + int i7918; + int i7919; + int i7920; + int i7921; + int i7922; + int i7923; + int i7924; + int i7925; + int i7926; + int i7927; + int i7928; + int i7929; + int i7930; + int i7931; + int i7932; + int i7933; + int i7934; + int i7935; + int i7936; + int i7937; + int i7938; + int i7939; + int i7940; + int i7941; + int i7942; + int i7943; + int i7944; + int i7945; + int i7946; + int i7947; + int i7948; + int i7949; + int i7950; + int i7951; + int i7952; + int i7953; + int i7954; + int i7955; + int i7956; + int i7957; + int i7958; + int i7959; + int i7960; + int i7961; + int i7962; + int i7963; + int i7964; + int i7965; + int i7966; + int i7967; + int i7968; + int i7969; + int i7970; + int i7971; + int i7972; + int i7973; + int i7974; + int i7975; + int i7976; + int i7977; + int i7978; + int i7979; + int i7980; + int i7981; + int i7982; + int i7983; + int i7984; + int i7985; + int i7986; + int i7987; + int i7988; + int i7989; + int i7990; + int i7991; + int i7992; + int i7993; + int i7994; + int i7995; + int i7996; + int i7997; + int i7998; + int i7999; + int i8000; + int i8001; + int i8002; + int i8003; + int i8004; + int i8005; + int i8006; + int i8007; + int i8008; + int i8009; + int i8010; + int i8011; + int i8012; + int i8013; + int i8014; + int i8015; + int i8016; + int i8017; + int i8018; + int i8019; + int i8020; + int i8021; + int i8022; + int i8023; + int i8024; + int i8025; + int i8026; + int i8027; + int i8028; + int i8029; + int i8030; + int i8031; + int i8032; + int i8033; + int i8034; + int i8035; + int i8036; + int i8037; + int i8038; + int i8039; + int i8040; + int i8041; + int i8042; + int i8043; + int i8044; + int i8045; + int i8046; + int i8047; + int i8048; + int i8049; + int i8050; + int i8051; + int i8052; + int i8053; + int i8054; + int i8055; + int i8056; + int i8057; + int i8058; + int i8059; + int i8060; + int i8061; + int i8062; + int i8063; + int i8064; + int i8065; + int i8066; + int i8067; + int i8068; + int i8069; + int i8070; + int i8071; + int i8072; + int i8073; + int i8074; + int i8075; + int i8076; + int i8077; + int i8078; + int i8079; + int i8080; + int i8081; + int i8082; + int i8083; + int i8084; + int i8085; + int i8086; + int i8087; + int i8088; + int i8089; + int i8090; + int i8091; + int i8092; + int i8093; + int i8094; + int i8095; + int i8096; + int i8097; + int i8098; + int i8099; + int i8100; + int i8101; + int i8102; + int i8103; + int i8104; + int i8105; + int i8106; + int i8107; + int i8108; + int i8109; + int i8110; + int i8111; + int i8112; + int i8113; + int i8114; + int i8115; + int i8116; + int i8117; + int i8118; + int i8119; + int i8120; + int i8121; + int i8122; + int i8123; + int i8124; + int i8125; + int i8126; + int i8127; + int i8128; + int i8129; + int i8130; + int i8131; + int i8132; + int i8133; + int i8134; + int i8135; + int i8136; + int i8137; + int i8138; + int i8139; + int i8140; + int i8141; + int i8142; + int i8143; + int i8144; + int i8145; + int i8146; + int i8147; + int i8148; + int i8149; + int i8150; + int i8151; + int i8152; + int i8153; + int i8154; + int i8155; + int i8156; + int i8157; + int i8158; + int i8159; + int i8160; + int i8161; + int i8162; + int i8163; + int i8164; + int i8165; + int i8166; + int i8167; + int i8168; + int i8169; + int i8170; + int i8171; + int i8172; + int i8173; + int i8174; + int i8175; + int i8176; + int i8177; + int i8178; + int i8179; + int i8180; + int i8181; + int i8182; + int i8183; + int i8184; + int i8185; + int i8186; + int i8187; + int i8188; + int i8189; + int i8190; + int i8191; + int i8192; + int i8193; + int i8194; + int i8195; + int i8196; + int i8197; + int i8198; + int i8199; + int i8200; + int i8201; + int i8202; + int i8203; + int i8204; + int i8205; + int i8206; + int i8207; + int i8208; + int i8209; + int i8210; + int i8211; + int i8212; + int i8213; + int i8214; + int i8215; + int i8216; + int i8217; + int i8218; + int i8219; + int i8220; + int i8221; + int i8222; + int i8223; + int i8224; + int i8225; + int i8226; + int i8227; + int i8228; + int i8229; + int i8230; + int i8231; + int i8232; + int i8233; + int i8234; + int i8235; + int i8236; + int i8237; + int i8238; + int i8239; + int i8240; + int i8241; + int i8242; + int i8243; + int i8244; + int i8245; + int i8246; + int i8247; + int i8248; + int i8249; + int i8250; + int i8251; + int i8252; + int i8253; + int i8254; + int i8255; + int i8256; + int i8257; + int i8258; + int i8259; + int i8260; + int i8261; + int i8262; + int i8263; + int i8264; + int i8265; + int i8266; + int i8267; + int i8268; + int i8269; + int i8270; + int i8271; + int i8272; + int i8273; + int i8274; + int i8275; + int i8276; + int i8277; + int i8278; + int i8279; + int i8280; + int i8281; + int i8282; + int i8283; + int i8284; + int i8285; + int i8286; + int i8287; + int i8288; + int i8289; + int i8290; + int i8291; + int i8292; + int i8293; + int i8294; + int i8295; + int i8296; + int i8297; + int i8298; + int i8299; + int i8300; + int i8301; + int i8302; + int i8303; + int i8304; + int i8305; + int i8306; + int i8307; + int i8308; + int i8309; + int i8310; + int i8311; + int i8312; + int i8313; + int i8314; + int i8315; + int i8316; + int i8317; + int i8318; + int i8319; + int i8320; + int i8321; + int i8322; + int i8323; + int i8324; + int i8325; + int i8326; + int i8327; + int i8328; + int i8329; + int i8330; + int i8331; + int i8332; + int i8333; + int i8334; + int i8335; + int i8336; + int i8337; + int i8338; + int i8339; + int i8340; + int i8341; + int i8342; + int i8343; + int i8344; + int i8345; + int i8346; + int i8347; + int i8348; + int i8349; + int i8350; + int i8351; + int i8352; + int i8353; + int i8354; + int i8355; + int i8356; + int i8357; + int i8358; + int i8359; + int i8360; + int i8361; + int i8362; + int i8363; + int i8364; + int i8365; + int i8366; + int i8367; + int i8368; + int i8369; + int i8370; + int i8371; + int i8372; + int i8373; + int i8374; + int i8375; + int i8376; + int i8377; + int i8378; + int i8379; + int i8380; + int i8381; + int i8382; + int i8383; + int i8384; + int i8385; + int i8386; + int i8387; + int i8388; + int i8389; + int i8390; + int i8391; + int i8392; + int i8393; + int i8394; + int i8395; + int i8396; + int i8397; + int i8398; + int i8399; + int i8400; + int i8401; + int i8402; + int i8403; + int i8404; + int i8405; + int i8406; + int i8407; + int i8408; + int i8409; + int i8410; + int i8411; + int i8412; + int i8413; + int i8414; + int i8415; + int i8416; + int i8417; + int i8418; + int i8419; + int i8420; + int i8421; + int i8422; + int i8423; + int i8424; + int i8425; + int i8426; + int i8427; + int i8428; + int i8429; + int i8430; + int i8431; + int i8432; + int i8433; + int i8434; + int i8435; + int i8436; + int i8437; + int i8438; + int i8439; + int i8440; + int i8441; + int i8442; + int i8443; + int i8444; + int i8445; + int i8446; + int i8447; + int i8448; + int i8449; + int i8450; + int i8451; + int i8452; + int i8453; + int i8454; + int i8455; + int i8456; + int i8457; + int i8458; + int i8459; + int i8460; + int i8461; + int i8462; + int i8463; + int i8464; + int i8465; + int i8466; + int i8467; + int i8468; + int i8469; + int i8470; + int i8471; + int i8472; + int i8473; + int i8474; + int i8475; + int i8476; + int i8477; + int i8478; + int i8479; + int i8480; + int i8481; + int i8482; + int i8483; + int i8484; + int i8485; + int i8486; + int i8487; + int i8488; + int i8489; + int i8490; + int i8491; + int i8492; + int i8493; + int i8494; + int i8495; + int i8496; + int i8497; + int i8498; + int i8499; + int i8500; + int i8501; + int i8502; + int i8503; + int i8504; + int i8505; + int i8506; + int i8507; + int i8508; + int i8509; + int i8510; + int i8511; + int i8512; + int i8513; + int i8514; + int i8515; + int i8516; + int i8517; + int i8518; + int i8519; + int i8520; + int i8521; + int i8522; + int i8523; + int i8524; + int i8525; + int i8526; + int i8527; + int i8528; + int i8529; + int i8530; + int i8531; + int i8532; + int i8533; + int i8534; + int i8535; + int i8536; + int i8537; + int i8538; + int i8539; + int i8540; + int i8541; + int i8542; + int i8543; + int i8544; + int i8545; + int i8546; + int i8547; + int i8548; + int i8549; + int i8550; + int i8551; + int i8552; + int i8553; + int i8554; + int i8555; + int i8556; + int i8557; + int i8558; + int i8559; + int i8560; + int i8561; + int i8562; + int i8563; + int i8564; + int i8565; + int i8566; + int i8567; + int i8568; + int i8569; + int i8570; + int i8571; + int i8572; + int i8573; + int i8574; + int i8575; + int i8576; + int i8577; + int i8578; + int i8579; + int i8580; + int i8581; + int i8582; + int i8583; + int i8584; + int i8585; + int i8586; + int i8587; + int i8588; + int i8589; + int i8590; + int i8591; + int i8592; + int i8593; + int i8594; + int i8595; + int i8596; + int i8597; + int i8598; + int i8599; + int i8600; + int i8601; + int i8602; + int i8603; + int i8604; + int i8605; + int i8606; + int i8607; + int i8608; + int i8609; + int i8610; + int i8611; + int i8612; + int i8613; + int i8614; + int i8615; + int i8616; + int i8617; + int i8618; + int i8619; + int i8620; + int i8621; + int i8622; + int i8623; + int i8624; + int i8625; + int i8626; + int i8627; + int i8628; + int i8629; + int i8630; + int i8631; + int i8632; + int i8633; + int i8634; + int i8635; + int i8636; + int i8637; + int i8638; + int i8639; + int i8640; + int i8641; + int i8642; + int i8643; + int i8644; + int i8645; + int i8646; + int i8647; + int i8648; + int i8649; + int i8650; + int i8651; + int i8652; + int i8653; + int i8654; + int i8655; + int i8656; + int i8657; + int i8658; + int i8659; + int i8660; + int i8661; + int i8662; + int i8663; + int i8664; + int i8665; + int i8666; + int i8667; + int i8668; + int i8669; + int i8670; + int i8671; + int i8672; + int i8673; + int i8674; + int i8675; + int i8676; + int i8677; + int i8678; + int i8679; + int i8680; + int i8681; + int i8682; + int i8683; + int i8684; + int i8685; + int i8686; + int i8687; + int i8688; + int i8689; + int i8690; + int i8691; + int i8692; + int i8693; + int i8694; + int i8695; + int i8696; + int i8697; + int i8698; + int i8699; + int i8700; + int i8701; + int i8702; + int i8703; + int i8704; + int i8705; + int i8706; + int i8707; + int i8708; + int i8709; + int i8710; + int i8711; + int i8712; + int i8713; + int i8714; + int i8715; + int i8716; + int i8717; + int i8718; + int i8719; + int i8720; + int i8721; + int i8722; + int i8723; + int i8724; + int i8725; + int i8726; + int i8727; + int i8728; + int i8729; + int i8730; + int i8731; + int i8732; + int i8733; + int i8734; + int i8735; + int i8736; + int i8737; + int i8738; + int i8739; + int i8740; + int i8741; + int i8742; + int i8743; + int i8744; + int i8745; + int i8746; + int i8747; + int i8748; + int i8749; + int i8750; + int i8751; + int i8752; + int i8753; + int i8754; + int i8755; + int i8756; + int i8757; + int i8758; + int i8759; + int i8760; + int i8761; + int i8762; + int i8763; + int i8764; + int i8765; + int i8766; + int i8767; + int i8768; + int i8769; + int i8770; + int i8771; + int i8772; + int i8773; + int i8774; + int i8775; + int i8776; + int i8777; + int i8778; + int i8779; + int i8780; + int i8781; + int i8782; + int i8783; + int i8784; + int i8785; + int i8786; + int i8787; + int i8788; + int i8789; + int i8790; + int i8791; + int i8792; + int i8793; + int i8794; + int i8795; + int i8796; + int i8797; + int i8798; + int i8799; + int i8800; + int i8801; + int i8802; + int i8803; + int i8804; + int i8805; + int i8806; + int i8807; + int i8808; + int i8809; + int i8810; + int i8811; + int i8812; + int i8813; + int i8814; + int i8815; + int i8816; + int i8817; + int i8818; + int i8819; + int i8820; + int i8821; + int i8822; + int i8823; + int i8824; + int i8825; + int i8826; + int i8827; + int i8828; + int i8829; + int i8830; + int i8831; + int i8832; + int i8833; + int i8834; + int i8835; + int i8836; + int i8837; + int i8838; + int i8839; + int i8840; + int i8841; + int i8842; + int i8843; + int i8844; + int i8845; + int i8846; + int i8847; + int i8848; + int i8849; + int i8850; + int i8851; + int i8852; + int i8853; + int i8854; + int i8855; + int i8856; + int i8857; + int i8858; + int i8859; + int i8860; + int i8861; + int i8862; + int i8863; + int i8864; + int i8865; + int i8866; + int i8867; + int i8868; + int i8869; + int i8870; + int i8871; + int i8872; + int i8873; + int i8874; + int i8875; + int i8876; + int i8877; + int i8878; + int i8879; + int i8880; + int i8881; + int i8882; + int i8883; + int i8884; + int i8885; + int i8886; + int i8887; + int i8888; + int i8889; + int i8890; + int i8891; + int i8892; + int i8893; + int i8894; + int i8895; + int i8896; + int i8897; + int i8898; + int i8899; + int i8900; + int i8901; + int i8902; + int i8903; + int i8904; + int i8905; + int i8906; + int i8907; + int i8908; + int i8909; + int i8910; + int i8911; + int i8912; + int i8913; + int i8914; + int i8915; + int i8916; + int i8917; + int i8918; + int i8919; + int i8920; + int i8921; + int i8922; + int i8923; + int i8924; + int i8925; + int i8926; + int i8927; + int i8928; + int i8929; + int i8930; + int i8931; + int i8932; + int i8933; + int i8934; + int i8935; + int i8936; + int i8937; + int i8938; + int i8939; + int i8940; + int i8941; + int i8942; + int i8943; + int i8944; + int i8945; + int i8946; + int i8947; + int i8948; + int i8949; + int i8950; + int i8951; + int i8952; + int i8953; + int i8954; + int i8955; + int i8956; + int i8957; + int i8958; + int i8959; + int i8960; + int i8961; + int i8962; + int i8963; + int i8964; + int i8965; + int i8966; + int i8967; + int i8968; + int i8969; + int i8970; + int i8971; + int i8972; + int i8973; + int i8974; + int i8975; + int i8976; + int i8977; + int i8978; + int i8979; + int i8980; + int i8981; + int i8982; + int i8983; + int i8984; + int i8985; + int i8986; + int i8987; + int i8988; + int i8989; + int i8990; + int i8991; + int i8992; + int i8993; + int i8994; + int i8995; + int i8996; + int i8997; + int i8998; + int i8999; + int i9000; + int i9001; + int i9002; + int i9003; + int i9004; + int i9005; + int i9006; + int i9007; + int i9008; + int i9009; + int i9010; + int i9011; + int i9012; + int i9013; + int i9014; + int i9015; + int i9016; + int i9017; + int i9018; + int i9019; + int i9020; + int i9021; + int i9022; + int i9023; + int i9024; + int i9025; + int i9026; + int i9027; + int i9028; + int i9029; + int i9030; + int i9031; + int i9032; + int i9033; + int i9034; + int i9035; + int i9036; + int i9037; + int i9038; + int i9039; + int i9040; + int i9041; + int i9042; + int i9043; + int i9044; + int i9045; + int i9046; + int i9047; + int i9048; + int i9049; + int i9050; + int i9051; + int i9052; + int i9053; + int i9054; + int i9055; + int i9056; + int i9057; + int i9058; + int i9059; + int i9060; + int i9061; + int i9062; + int i9063; + int i9064; + int i9065; + int i9066; + int i9067; + int i9068; + int i9069; + int i9070; + int i9071; + int i9072; + int i9073; + int i9074; + int i9075; + int i9076; + int i9077; + int i9078; + int i9079; + int i9080; + int i9081; + int i9082; + int i9083; + int i9084; + int i9085; + int i9086; + int i9087; + int i9088; + int i9089; + int i9090; + int i9091; + int i9092; + int i9093; + int i9094; + int i9095; + int i9096; + int i9097; + int i9098; + int i9099; + int i9100; + int i9101; + int i9102; + int i9103; + int i9104; + int i9105; + int i9106; + int i9107; + int i9108; + int i9109; + int i9110; + int i9111; + int i9112; + int i9113; + int i9114; + int i9115; + int i9116; + int i9117; + int i9118; + int i9119; + int i9120; + int i9121; + int i9122; + int i9123; + int i9124; + int i9125; + int i9126; + int i9127; + int i9128; + int i9129; + int i9130; + int i9131; + int i9132; + int i9133; + int i9134; + int i9135; + int i9136; + int i9137; + int i9138; + int i9139; + int i9140; + int i9141; + int i9142; + int i9143; + int i9144; + int i9145; + int i9146; + int i9147; + int i9148; + int i9149; + int i9150; + int i9151; + int i9152; + int i9153; + int i9154; + int i9155; + int i9156; + int i9157; + int i9158; + int i9159; + int i9160; + int i9161; + int i9162; + int i9163; + int i9164; + int i9165; + int i9166; + int i9167; + int i9168; + int i9169; + int i9170; + int i9171; + int i9172; + int i9173; + int i9174; + int i9175; + int i9176; + int i9177; + int i9178; + int i9179; + int i9180; + int i9181; + int i9182; + int i9183; + int i9184; + int i9185; + int i9186; + int i9187; + int i9188; + int i9189; + int i9190; + int i9191; + int i9192; + int i9193; + int i9194; + int i9195; + int i9196; + int i9197; + int i9198; + int i9199; + int i9200; + int i9201; + int i9202; + int i9203; + int i9204; + int i9205; + int i9206; + int i9207; + int i9208; + int i9209; + int i9210; + int i9211; + int i9212; + int i9213; + int i9214; + int i9215; + int i9216; + int i9217; + int i9218; + int i9219; + int i9220; + int i9221; + int i9222; + int i9223; + int i9224; + int i9225; + int i9226; + int i9227; + int i9228; + int i9229; + int i9230; + int i9231; + int i9232; + int i9233; + int i9234; + int i9235; + int i9236; + int i9237; + int i9238; + int i9239; + int i9240; + int i9241; + int i9242; + int i9243; + int i9244; + int i9245; + int i9246; + int i9247; + int i9248; + int i9249; + int i9250; + int i9251; + int i9252; + int i9253; + int i9254; + int i9255; + int i9256; + int i9257; + int i9258; + int i9259; + int i9260; + int i9261; + int i9262; + int i9263; + int i9264; + int i9265; + int i9266; + int i9267; + int i9268; + int i9269; + int i9270; + int i9271; + int i9272; + int i9273; + int i9274; + int i9275; + int i9276; + int i9277; + int i9278; + int i9279; + int i9280; + int i9281; + int i9282; + int i9283; + int i9284; + int i9285; + int i9286; + int i9287; + int i9288; + int i9289; + int i9290; + int i9291; + int i9292; + int i9293; + int i9294; + int i9295; + int i9296; + int i9297; + int i9298; + int i9299; + int i9300; + int i9301; + int i9302; + int i9303; + int i9304; + int i9305; + int i9306; + int i9307; + int i9308; + int i9309; + int i9310; + int i9311; + int i9312; + int i9313; + int i9314; + int i9315; + int i9316; + int i9317; + int i9318; + int i9319; + int i9320; + int i9321; + int i9322; + int i9323; + int i9324; + int i9325; + int i9326; + int i9327; + int i9328; + int i9329; + int i9330; + int i9331; + int i9332; + int i9333; + int i9334; + int i9335; + int i9336; + int i9337; + int i9338; + int i9339; + int i9340; + int i9341; + int i9342; + int i9343; + int i9344; + int i9345; + int i9346; + int i9347; + int i9348; + int i9349; + int i9350; + int i9351; + int i9352; + int i9353; + int i9354; + int i9355; + int i9356; + int i9357; + int i9358; + int i9359; + int i9360; + int i9361; + int i9362; + int i9363; + int i9364; + int i9365; + int i9366; + int i9367; + int i9368; + int i9369; + int i9370; + int i9371; + int i9372; + int i9373; + int i9374; + int i9375; + int i9376; + int i9377; + int i9378; + int i9379; + int i9380; + int i9381; + int i9382; + int i9383; + int i9384; + int i9385; + int i9386; + int i9387; + int i9388; + int i9389; + int i9390; + int i9391; + int i9392; + int i9393; + int i9394; + int i9395; + int i9396; + int i9397; + int i9398; + int i9399; + int i9400; + int i9401; + int i9402; + int i9403; + int i9404; + int i9405; + int i9406; + int i9407; + int i9408; + int i9409; + int i9410; + int i9411; + int i9412; + int i9413; + int i9414; + int i9415; + int i9416; + int i9417; + int i9418; + int i9419; + int i9420; + int i9421; + int i9422; + int i9423; + int i9424; + int i9425; + int i9426; + int i9427; + int i9428; + int i9429; + int i9430; + int i9431; + int i9432; + int i9433; + int i9434; + int i9435; + int i9436; + int i9437; + int i9438; + int i9439; + int i9440; + int i9441; + int i9442; + int i9443; + int i9444; + int i9445; + int i9446; + int i9447; + int i9448; + int i9449; + int i9450; + int i9451; + int i9452; + int i9453; + int i9454; + int i9455; + int i9456; + int i9457; + int i9458; + int i9459; + int i9460; + int i9461; + int i9462; + int i9463; + int i9464; + int i9465; + int i9466; + int i9467; + int i9468; + int i9469; + int i9470; + int i9471; + int i9472; + int i9473; + int i9474; + int i9475; + int i9476; + int i9477; + int i9478; + int i9479; + int i9480; + int i9481; + int i9482; + int i9483; + int i9484; + int i9485; + int i9486; + int i9487; + int i9488; + int i9489; + int i9490; + int i9491; + int i9492; + int i9493; + int i9494; + int i9495; + int i9496; + int i9497; + int i9498; + int i9499; + int i9500; + int i9501; + int i9502; + int i9503; + int i9504; + int i9505; + int i9506; + int i9507; + int i9508; + int i9509; + int i9510; + int i9511; + int i9512; + int i9513; + int i9514; + int i9515; + int i9516; + int i9517; + int i9518; + int i9519; + int i9520; + int i9521; + int i9522; + int i9523; + int i9524; + int i9525; + int i9526; + int i9527; + int i9528; + int i9529; + int i9530; + int i9531; + int i9532; + int i9533; + int i9534; + int i9535; + int i9536; + int i9537; + int i9538; + int i9539; + int i9540; + int i9541; + int i9542; + int i9543; + int i9544; + int i9545; + int i9546; + int i9547; + int i9548; + int i9549; + int i9550; + int i9551; + int i9552; + int i9553; + int i9554; + int i9555; + int i9556; + int i9557; + int i9558; + int i9559; + int i9560; + int i9561; + int i9562; + int i9563; + int i9564; + int i9565; + int i9566; + int i9567; + int i9568; + int i9569; + int i9570; + int i9571; + int i9572; + int i9573; + int i9574; + int i9575; + int i9576; + int i9577; + int i9578; + int i9579; + int i9580; + int i9581; + int i9582; + int i9583; + int i9584; + int i9585; + int i9586; + int i9587; + int i9588; + int i9589; + int i9590; + int i9591; + int i9592; + int i9593; + int i9594; + int i9595; + int i9596; + int i9597; + int i9598; + int i9599; + int i9600; + int i9601; + int i9602; + int i9603; + int i9604; + int i9605; + int i9606; + int i9607; + int i9608; + int i9609; + int i9610; + int i9611; + int i9612; + int i9613; + int i9614; + int i9615; + int i9616; + int i9617; + int i9618; + int i9619; + int i9620; + int i9621; + int i9622; + int i9623; + int i9624; + int i9625; + int i9626; + int i9627; + int i9628; + int i9629; + int i9630; + int i9631; + int i9632; + int i9633; + int i9634; + int i9635; + int i9636; + int i9637; + int i9638; + int i9639; + int i9640; + int i9641; + int i9642; + int i9643; + int i9644; + int i9645; + int i9646; + int i9647; + int i9648; + int i9649; + int i9650; + int i9651; + int i9652; + int i9653; + int i9654; + int i9655; + int i9656; + int i9657; + int i9658; + int i9659; + int i9660; + int i9661; + int i9662; + int i9663; + int i9664; + int i9665; + int i9666; + int i9667; + int i9668; + int i9669; + int i9670; + int i9671; + int i9672; + int i9673; + int i9674; + int i9675; + int i9676; + int i9677; + int i9678; + int i9679; + int i9680; + int i9681; + int i9682; + int i9683; + int i9684; + int i9685; + int i9686; + int i9687; + int i9688; + int i9689; + int i9690; + int i9691; + int i9692; + int i9693; + int i9694; + int i9695; + int i9696; + int i9697; + int i9698; + int i9699; + int i9700; + int i9701; + int i9702; + int i9703; + int i9704; + int i9705; + int i9706; + int i9707; + int i9708; + int i9709; + int i9710; + int i9711; + int i9712; + int i9713; + int i9714; + int i9715; + int i9716; + int i9717; + int i9718; + int i9719; + int i9720; + int i9721; + int i9722; + int i9723; + int i9724; + int i9725; + int i9726; + int i9727; + int i9728; + int i9729; + int i9730; + int i9731; + int i9732; + int i9733; + int i9734; + int i9735; + int i9736; + int i9737; + int i9738; + int i9739; + int i9740; + int i9741; + int i9742; + int i9743; + int i9744; + int i9745; + int i9746; + int i9747; + int i9748; + int i9749; + int i9750; + int i9751; + int i9752; + int i9753; + int i9754; + int i9755; + int i9756; + int i9757; + int i9758; + int i9759; + int i9760; + int i9761; + int i9762; + int i9763; + int i9764; + int i9765; + int i9766; + int i9767; + int i9768; + int i9769; + int i9770; + int i9771; + int i9772; + int i9773; + int i9774; + int i9775; + int i9776; + int i9777; + int i9778; + int i9779; + int i9780; + int i9781; + int i9782; + int i9783; + int i9784; + int i9785; + int i9786; + int i9787; + int i9788; + int i9789; + int i9790; + int i9791; + int i9792; + int i9793; + int i9794; + int i9795; + int i9796; + int i9797; + int i9798; + int i9799; + int i9800; + int i9801; + int i9802; + int i9803; + int i9804; + int i9805; + int i9806; + int i9807; + int i9808; + int i9809; + int i9810; + int i9811; + int i9812; + int i9813; + int i9814; + int i9815; + int i9816; + int i9817; + int i9818; + int i9819; + int i9820; + int i9821; + int i9822; + int i9823; + int i9824; + int i9825; + int i9826; + int i9827; + int i9828; + int i9829; + int i9830; + int i9831; + int i9832; + int i9833; + int i9834; + int i9835; + int i9836; + int i9837; + int i9838; + int i9839; + int i9840; + int i9841; + int i9842; + int i9843; + int i9844; + int i9845; + int i9846; + int i9847; + int i9848; + int i9849; + int i9850; + int i9851; + int i9852; + int i9853; + int i9854; + int i9855; + int i9856; + int i9857; + int i9858; + int i9859; + int i9860; + int i9861; + int i9862; + int i9863; + int i9864; + int i9865; + int i9866; + int i9867; + int i9868; + int i9869; + int i9870; + int i9871; + int i9872; + int i9873; + int i9874; + int i9875; + int i9876; + int i9877; + int i9878; + int i9879; + int i9880; + int i9881; + int i9882; + int i9883; + int i9884; + int i9885; + int i9886; + int i9887; + int i9888; + int i9889; + int i9890; + int i9891; + int i9892; + int i9893; + int i9894; + int i9895; + int i9896; + int i9897; + int i9898; + int i9899; + int i9900; + int i9901; + int i9902; + int i9903; + int i9904; + int i9905; + int i9906; + int i9907; + int i9908; + int i9909; + int i9910; + int i9911; + int i9912; + int i9913; + int i9914; + int i9915; + int i9916; + int i9917; + int i9918; + int i9919; + int i9920; + int i9921; + int i9922; + int i9923; + int i9924; + int i9925; + int i9926; + int i9927; + int i9928; + int i9929; + int i9930; + int i9931; + int i9932; + int i9933; + int i9934; + int i9935; + int i9936; + int i9937; + int i9938; + int i9939; + int i9940; + int i9941; + int i9942; + int i9943; + int i9944; + int i9945; + int i9946; + int i9947; + int i9948; + int i9949; + int i9950; + int i9951; + int i9952; + int i9953; + int i9954; + int i9955; + int i9956; + int i9957; + int i9958; + int i9959; + int i9960; + int i9961; + int i9962; + int i9963; + int i9964; + int i9965; + int i9966; + int i9967; + int i9968; + int i9969; + int i9970; + int i9971; + int i9972; + int i9973; + int i9974; + int i9975; + int i9976; + int i9977; + int i9978; + int i9979; + int i9980; + int i9981; + int i9982; + int i9983; + int i9984; + int i9985; + int i9986; + int i9987; + int i9988; + int i9989; + int i9990; + int i9991; + int i9992; + int i9993; + int i9994; + int i9995; + int i9996; + int i9997; + int i9998; + int i9999; + int i10000; + int i10001; + int i10002; + int i10003; + int i10004; + int i10005; + int i10006; + int i10007; + int i10008; + int i10009; + int i10010; + int i10011; + int i10012; + int i10013; + int i10014; + int i10015; + int i10016; + int i10017; + int i10018; + int i10019; + int i10020; + int i10021; + int i10022; + int i10023; + int i10024; + int i10025; + int i10026; + int i10027; + int i10028; + int i10029; + int i10030; + int i10031; + int i10032; + int i10033; + int i10034; + int i10035; + int i10036; + int i10037; + int i10038; + int i10039; + int i10040; + int i10041; + int i10042; + int i10043; + int i10044; + int i10045; + int i10046; + int i10047; + int i10048; + int i10049; + int i10050; + int i10051; + int i10052; + int i10053; + int i10054; + int i10055; + int i10056; + int i10057; + int i10058; + int i10059; + int i10060; + int i10061; + int i10062; + int i10063; + int i10064; + int i10065; + int i10066; + int i10067; + int i10068; + int i10069; + int i10070; + int i10071; + int i10072; + int i10073; + int i10074; + int i10075; + int i10076; + int i10077; + int i10078; + int i10079; + int i10080; + int i10081; + int i10082; + int i10083; + int i10084; + int i10085; + int i10086; + int i10087; + int i10088; + int i10089; + int i10090; + int i10091; + int i10092; + int i10093; + int i10094; + int i10095; + int i10096; + int i10097; + int i10098; + int i10099; + int i10100; + int i10101; + int i10102; + int i10103; + int i10104; + int i10105; + int i10106; + int i10107; + int i10108; + int i10109; + int i10110; + int i10111; + int i10112; + int i10113; + int i10114; + int i10115; + int i10116; + int i10117; + int i10118; + int i10119; + int i10120; + int i10121; + int i10122; + int i10123; + int i10124; + int i10125; + int i10126; + int i10127; + int i10128; + int i10129; + int i10130; + int i10131; + int i10132; + int i10133; + int i10134; + int i10135; + int i10136; + int i10137; + int i10138; + int i10139; + int i10140; + int i10141; + int i10142; + int i10143; + int i10144; + int i10145; + int i10146; + int i10147; + int i10148; + int i10149; + int i10150; + int i10151; + int i10152; + int i10153; + int i10154; + int i10155; + int i10156; + int i10157; + int i10158; + int i10159; + int i10160; + int i10161; + int i10162; + int i10163; + int i10164; + int i10165; + int i10166; + int i10167; + int i10168; + int i10169; + int i10170; + int i10171; + int i10172; + int i10173; + int i10174; + int i10175; + int i10176; + int i10177; + int i10178; + int i10179; + int i10180; + int i10181; + int i10182; + int i10183; + int i10184; + int i10185; + int i10186; + int i10187; + int i10188; + int i10189; + int i10190; + int i10191; + int i10192; + int i10193; + int i10194; + int i10195; + int i10196; + int i10197; + int i10198; + int i10199; + int i10200; + int i10201; + int i10202; + int i10203; + int i10204; + int i10205; + int i10206; + int i10207; + int i10208; + int i10209; + int i10210; + int i10211; + int i10212; + int i10213; + int i10214; + int i10215; + int i10216; + int i10217; + int i10218; + int i10219; + int i10220; + int i10221; + int i10222; + int i10223; + int i10224; + int i10225; + int i10226; + int i10227; + int i10228; + int i10229; + int i10230; + int i10231; + int i10232; + int i10233; + int i10234; + int i10235; + int i10236; + int i10237; + int i10238; + int i10239; + int i10240; + int i10241; + int i10242; + int i10243; + int i10244; + int i10245; + int i10246; + int i10247; + int i10248; + int i10249; + int i10250; + int i10251; + int i10252; + int i10253; + int i10254; + int i10255; + int i10256; + int i10257; + int i10258; + int i10259; + int i10260; + int i10261; + int i10262; + int i10263; + int i10264; + int i10265; + int i10266; + int i10267; + int i10268; + int i10269; + int i10270; + int i10271; + int i10272; + int i10273; + int i10274; + int i10275; + int i10276; + int i10277; + int i10278; + int i10279; + int i10280; + int i10281; + int i10282; + int i10283; + int i10284; + int i10285; + int i10286; + int i10287; + int i10288; + int i10289; + int i10290; + int i10291; + int i10292; + int i10293; + int i10294; + int i10295; + int i10296; + int i10297; + int i10298; + int i10299; + int i10300; + int i10301; + int i10302; + int i10303; + int i10304; + int i10305; + int i10306; + int i10307; + int i10308; + int i10309; + int i10310; + int i10311; + int i10312; + int i10313; + int i10314; + int i10315; + int i10316; + int i10317; + int i10318; + int i10319; + int i10320; + int i10321; + int i10322; + int i10323; + int i10324; + int i10325; + int i10326; + int i10327; + int i10328; + int i10329; + int i10330; + int i10331; + int i10332; + int i10333; + int i10334; + int i10335; + int i10336; + int i10337; + int i10338; + int i10339; + int i10340; + int i10341; + int i10342; + int i10343; + int i10344; + int i10345; + int i10346; + int i10347; + int i10348; + int i10349; + int i10350; + int i10351; + int i10352; + int i10353; + int i10354; + int i10355; + int i10356; + int i10357; + int i10358; + int i10359; + int i10360; + int i10361; + int i10362; + int i10363; + int i10364; + int i10365; + int i10366; + int i10367; + int i10368; + int i10369; + int i10370; + int i10371; + int i10372; + int i10373; + int i10374; + int i10375; + int i10376; + int i10377; + int i10378; + int i10379; + int i10380; + int i10381; + int i10382; + int i10383; + int i10384; + int i10385; + int i10386; + int i10387; + int i10388; + int i10389; + int i10390; + int i10391; + int i10392; + int i10393; + int i10394; + int i10395; + int i10396; + int i10397; + int i10398; + int i10399; + int i10400; + int i10401; + int i10402; + int i10403; + int i10404; + int i10405; + int i10406; + int i10407; + int i10408; + int i10409; + int i10410; + int i10411; + int i10412; + int i10413; + int i10414; + int i10415; + int i10416; + int i10417; + int i10418; + int i10419; + int i10420; + int i10421; + int i10422; + int i10423; + int i10424; + int i10425; + int i10426; + int i10427; + int i10428; + int i10429; + int i10430; + int i10431; + int i10432; + int i10433; + int i10434; + int i10435; + int i10436; + int i10437; + int i10438; + int i10439; + int i10440; + int i10441; + int i10442; + int i10443; + int i10444; + int i10445; + int i10446; + int i10447; + int i10448; + int i10449; + int i10450; + int i10451; + int i10452; + int i10453; + int i10454; + int i10455; + int i10456; + int i10457; + int i10458; + int i10459; + int i10460; + int i10461; + int i10462; + int i10463; + int i10464; + int i10465; + int i10466; + int i10467; + int i10468; + int i10469; + int i10470; + int i10471; + int i10472; + int i10473; + int i10474; + int i10475; + int i10476; + int i10477; + int i10478; + int i10479; + int i10480; + int i10481; + int i10482; + int i10483; + int i10484; + int i10485; + int i10486; + int i10487; + int i10488; + int i10489; + int i10490; + int i10491; + int i10492; + int i10493; + int i10494; + int i10495; + int i10496; + int i10497; + int i10498; + int i10499; + int i10500; + int i10501; + int i10502; + int i10503; + int i10504; + int i10505; + int i10506; + int i10507; + int i10508; + int i10509; + int i10510; + int i10511; + int i10512; + int i10513; + int i10514; + int i10515; + int i10516; + int i10517; + int i10518; + int i10519; + int i10520; + int i10521; + int i10522; + int i10523; + int i10524; + int i10525; + int i10526; + int i10527; + int i10528; + int i10529; + int i10530; + int i10531; + int i10532; + int i10533; + int i10534; + int i10535; + int i10536; + int i10537; + int i10538; + int i10539; + int i10540; + int i10541; + int i10542; + int i10543; + int i10544; + int i10545; + int i10546; + int i10547; + int i10548; + int i10549; + int i10550; + int i10551; + int i10552; + int i10553; + int i10554; + int i10555; + int i10556; + int i10557; + int i10558; + int i10559; + int i10560; + int i10561; + int i10562; + int i10563; + int i10564; + int i10565; + int i10566; + int i10567; + int i10568; + int i10569; + int i10570; + int i10571; + int i10572; + int i10573; + int i10574; + int i10575; + int i10576; + int i10577; + int i10578; + int i10579; + int i10580; + int i10581; + int i10582; + int i10583; + int i10584; + int i10585; + int i10586; + int i10587; + int i10588; + int i10589; + int i10590; + int i10591; + int i10592; + int i10593; + int i10594; + int i10595; + int i10596; + int i10597; + int i10598; + int i10599; + int i10600; + int i10601; + int i10602; + int i10603; + int i10604; + int i10605; + int i10606; + int i10607; + int i10608; + int i10609; + int i10610; + int i10611; + int i10612; + int i10613; + int i10614; + int i10615; + int i10616; + int i10617; + int i10618; + int i10619; + int i10620; + int i10621; + int i10622; + int i10623; + int i10624; + int i10625; + int i10626; + int i10627; + int i10628; + int i10629; + int i10630; + int i10631; + int i10632; + int i10633; + int i10634; + int i10635; + int i10636; + int i10637; + int i10638; + int i10639; + int i10640; + int i10641; + int i10642; + int i10643; + int i10644; + int i10645; + int i10646; + int i10647; + int i10648; + int i10649; + int i10650; + int i10651; + int i10652; + int i10653; + int i10654; + int i10655; + int i10656; + int i10657; + int i10658; + int i10659; + int i10660; + int i10661; + int i10662; + int i10663; + int i10664; + int i10665; + int i10666; + int i10667; + int i10668; + int i10669; + int i10670; + int i10671; + int i10672; + int i10673; + int i10674; + int i10675; + int i10676; + int i10677; + int i10678; + int i10679; + int i10680; + int i10681; + int i10682; + int i10683; + int i10684; + int i10685; + int i10686; + int i10687; + int i10688; + int i10689; + int i10690; + int i10691; + int i10692; + int i10693; + int i10694; + int i10695; + int i10696; + int i10697; + int i10698; + int i10699; + int i10700; + int i10701; + int i10702; + int i10703; + int i10704; + int i10705; + int i10706; + int i10707; + int i10708; + int i10709; + int i10710; + int i10711; + int i10712; + int i10713; + int i10714; + int i10715; + int i10716; + int i10717; + int i10718; + int i10719; + int i10720; + int i10721; + int i10722; + int i10723; + int i10724; + int i10725; + int i10726; + int i10727; + int i10728; + int i10729; + int i10730; + int i10731; + int i10732; + int i10733; + int i10734; + int i10735; + int i10736; + int i10737; + int i10738; + int i10739; + int i10740; + int i10741; + int i10742; + int i10743; + int i10744; + int i10745; + int i10746; + int i10747; + int i10748; + int i10749; + int i10750; + int i10751; + int i10752; + int i10753; + int i10754; + int i10755; + int i10756; + int i10757; + int i10758; + int i10759; + int i10760; + int i10761; + int i10762; + int i10763; + int i10764; + int i10765; + int i10766; + int i10767; + int i10768; + int i10769; + int i10770; + int i10771; + int i10772; + int i10773; + int i10774; + int i10775; + int i10776; + int i10777; + int i10778; + int i10779; + int i10780; + int i10781; + int i10782; + int i10783; + int i10784; + int i10785; + int i10786; + int i10787; + int i10788; + int i10789; + int i10790; + int i10791; + int i10792; + int i10793; + int i10794; + int i10795; + int i10796; + int i10797; + int i10798; + int i10799; + + if (unlikely) { + // Since Foo is not loaded this will turn into an uncommon trap + Class c = Foo.class; + + StringBuilder sb = new StringBuilder(); + } + } +} diff --git a/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java b/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java new file mode 100644 index 00000000000..ead8788524a --- /dev/null +++ b/hotspot/test/gc/startup_warnings/TestCMSForegroundFlags.java @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +*/ + +/* +* @test TestCMSForegroundFlags +* @key gc +* @bug 8027132 +* @summary Test that the deprecated CMS foreground collector flags print warning messages +* @library /testlibrary +* @run main TestCMSForegroundFlags -XX:-UseCMSCompactAtFullCollection UseCMSCompactAtFullCollection +* @run main TestCMSForegroundFlags -XX:CMSFullGCsBeforeCompaction=4 CMSFullGCsBeforeCompaction +* @run main TestCMSForegroundFlags -XX:-UseCMSCollectionPassing UseCMSCollectionPassing +*/ + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.ProcessTools; + +public class TestCMSForegroundFlags { + public static void main(String[] args) throws Exception { + if (args.length != 2) { + throw new Exception("Expected two arguments,flagValue and flagName"); + } + String flagValue = args[0]; + String flagName = args[1]; + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flagValue, "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("warning: " + flagName + " is deprecated and will likely be removed in a future release."); + output.shouldNotContain("error"); + output.shouldHaveExitValue(0); + } +} diff --git a/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java new file mode 100644 index 00000000000..c3de30edf86 --- /dev/null +++ b/hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026365 + * @summary Test invokespecial of host class method from an anonymous class + * @author Robert Field + * @library /testlibrary + * @compile -XDignore.symbol.file InvokeSpecialAnonTest.java + * @run main ClassFileInstaller InvokeSpecialAnonTest AnonTester + * @run main/othervm -Xbootclasspath/a:. -Xverify:all InvokeSpecialAnonTest + */ +import jdk.internal.org.objectweb.asm.*; +import java.lang.reflect.Constructor; +import sun.misc.Unsafe; + +public class InvokeSpecialAnonTest implements Opcodes { + + static byte[] anonClassBytes() throws Exception { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(V1_8, ACC_FINAL + ACC_SUPER, "Anon", null, "java/lang/Object", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(2, 2); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "(LInvokeSpecialAnonTest;)I", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ALOAD, 1); + mv.visitMethodInsn(INVOKESPECIAL, "InvokeSpecialAnonTest", "privMethod", "()I"); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 3); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + + private int privMethod() { return 1234; } + + public static void main(String[] args) throws Exception { + Class klass = InvokeSpecialAnonTest.class; + try { + Class result = AnonTester.defineTest(klass, anonClassBytes()); + System.out.println("Passed."); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } +} + + +class AnonTester { + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); + + public static Class defineTest(Class targetClass, byte[] classBytes) throws Exception { + return UNSAFE.defineAnonymousClass(targetClass, classBytes, null); + } +} diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java new file mode 100644 index 00000000000..1892e6fd0b5 --- /dev/null +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8024927 + * @summary Testing address of compressed class pointer space as best as possible. + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.*; + +public class CompressedClassPointers { + + public static void smallHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedBaseAddress=8g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000"); + output.shouldHaveExitValue(0); + } + + public static void smallHeapTestWith3G() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:CompressedClassSpaceSize=3g", + "-Xmx128m", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3"); + output.shouldHaveExitValue(0); + } + + public static void largeHeapTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx30g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("Narrow klass base: 0x0000000000000000"); + output.shouldContain("Narrow klass shift: 0"); + output.shouldHaveExitValue(0); + } + + public static void largePagesTest() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-Xmx128m", + "-XX:+UseLargePages", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Narrow klass base:"); + output.shouldHaveExitValue(0); + } + + public static void sharingTest() throws Exception { + // Test small heaps + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-XX:+VerifyBeforeGC", + "-Xshare:dump"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + try { + output.shouldContain("Loading classes to share"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:SharedArchiveFile=./sample.jsa", + "-Xmx128m", + "-XX:SharedBaseAddress=8g", + "-XX:+PrintCompressedOopsMode", + "-Xshare:on", + "-version"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("sharing"); + output.shouldHaveExitValue(0); + + } catch (RuntimeException e) { + output.shouldContain("Unable to use shared archive"); + output.shouldHaveExitValue(1); + } + } + + public static void main(String[] args) throws Exception { + if (!Platform.is64bit()) { + // Can't test this on 32 bit, just pass + System.out.println("Skipping test on 32bit"); + return; + } + // Solaris 10 can't mmap compressed oops space without a base + if (Platform.isSolaris()) { + String name = System.getProperty("os.version"); + if (name.equals("5.10")) { + System.out.println("Skipping test on Solaris 10"); + return; + } + } + smallHeapTest(); + smallHeapTestWith3G(); + largeHeapTest(); + largePagesTest(); + sharingTest(); + } +} diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 4038b1d8a3b..43356fd5d4d 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -235,3 +235,5 @@ d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111 c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112 0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113 +1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114 +f610fd46463e6b0533dd92bce11a1e7d84984e64 jdk8-b115 diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java index f4a80afacfe..c3f3a915f96 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java @@ -187,6 +187,19 @@ public final class XalanConstants { public static final String XML_SECURITY_PROPERTY_MANAGER = ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager"; + /** + * Feature enableExtensionFunctions + */ + public static final String ORACLE_ENABLE_EXTENSION_FUNCTION = + ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions"; + public static final String SP_ORACLE_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions"; + + /** + * Values for a feature + */ + public static final String FEATURE_TRUE = "true"; + public static final String FEATURE_FALSE = "false"; + /** * Check if we're in jdk8 or above */ diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java new file mode 100644 index 00000000000..644e3c14c2d --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.org.apache.xalan.internal.utils; + + +import com.sun.org.apache.xalan.internal.XalanConstants; + +/** + * This class manages security related properties + * + */ +public final class FeatureManager extends FeaturePropertyBase { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY + } + + /** + * Xalan Features + */ + public static enum Feature { + ORACLE_ENABLE_EXTENSION_FUNCTION(XalanConstants.ORACLE_ENABLE_EXTENSION_FUNCTION, + "true"); + + final String name; + final String defaultValue; + + Feature(String name, String value) { + this.name = name; + this.defaultValue = value; + } + + public boolean equalsName(String propertyName) { + return (propertyName == null) ? false : name.equals(propertyName); + } + + String defaultValue() { + return defaultValue; + } + } + + /** + * Default constructor. Establishes default values + */ + public FeatureManager() { + values = new String[Feature.values().length]; + for (Feature feature : Feature.values()) { + values[feature.ordinal()] = feature.defaultValue(); + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + + /** + * Check if the feature is enabled + * @param feature name of the feature + * @return true if enabled, false otherwise + */ + public boolean isFeatureEnabled(Feature feature) { + return Boolean.parseBoolean(values[feature.ordinal()]); + } + + /** + * Check if the feature is enabled + * @param propertyName name of the feature + * @return true if enabled, false otherwise + */ + public boolean isFeatureEnabled(String propertyName) { + return Boolean.parseBoolean(values[getIndex(propertyName)]); + } + + /** + * Get the index by property name + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName){ + for (Feature feature : Feature.values()) { + if (feature.equalsName(propertyName)) { + return feature.ordinal(); + } + } + return -1; + } + + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + getSystemProperty(Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + XalanConstants.SP_ORACLE_ENABLE_EXTENSION_FUNCTION); + } + +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java new file mode 100644 index 00000000000..a831d33fff2 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.org.apache.xalan.internal.utils; + +import com.sun.org.apache.xalan.internal.XalanConstants; + +/** + * This is the base class for features and properties + * + */ +public abstract class FeaturePropertyBase { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY + } + + + /** + * Values of the properties as defined in enum Properties + */ + String[] values = null; + /** + * States of the settings for each property in Properties above + */ + State[] states = {State.DEFAULT, State.DEFAULT}; + + + /** + * Set the value for a specific property. + * + * @param property the property + * @param state the state of the property + * @param value the value of the property + */ + public void setValue(Enum property, State state, String value) { + //only update if it shall override + if (state.compareTo(states[property.ordinal()]) >= 0) { + values[property.ordinal()] = value; + states[property.ordinal()] = state; + } + } + + /** + * Set the value of a property by its index + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setValue(int index, State state, String value) { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + } + } + + /** + * Set value by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setValue(index, state, (String)value); + return true; + } + return false; + } + + /** + * Set value by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, boolean value) { + int index = getIndex(propertyName); + if (index > -1) { + if (value) { + setValue(index, state, XalanConstants.FEATURE_TRUE); + } else { + setValue(index, state, XalanConstants.FEATURE_FALSE); + } + return true; + } + return false; + } + + /** + * Return the value of the specified property + * + * @param property the property + * @return the value of the property + */ + public String getValue(Enum property) { + return values[property.ordinal()]; + } + + /** + * Return the value of the specified property + * + * @param property the property + * @return the value of the property + */ + public String getValue(String property) { + int index = getIndex(property); + if (index > -1) { + return getValueByIndex(index); + } + return null; + } + + /** + * Return the value of the specified property. + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getValueAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getValueByIndex(index); + } + + return null; + } + + /** + * Return the value of a property by its ordinal + * @param index the index of a property + * @return value of a property + */ + public String getValueByIndex(int index) { + return values[index]; + } + + /** + * Get the index by property name + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public abstract int getIndex(String propertyName); + + public > int getIndex(Class property, String propertyName) { + for (Enum enumItem : property.getEnumConstants()) { + if (enumItem.toString().equals(propertyName)) { + //internally, ordinal is used as index + return enumItem.ordinal(); + } + } + return -1; + }; + + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the property + * @param systemProperty the name of the system property + */ + void getSystemProperty(Enum property, String systemProperty) { + try { + String value = SecuritySupport.getSystemProperty(systemProperty); + if (value != null) { + values[property.ordinal()] = value; + states[property.ordinal()] = State.SYSTEMPROPERTY; + return; + } + + value = SecuritySupport.readJAXPProperty(systemProperty); + if (value != null) { + values[property.ordinal()] = value; + states[property.ordinal()] = State.JAXPDOTPROPERTIES; + } + } catch (NumberFormatException e) { + //invalid setting ignored + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java index 99a8e2d5f69..e861c21c3a0 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java @@ -1,42 +1,28 @@ /* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * This code is free software; you can redistribute 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. * - * 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 - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. */ + package com.sun.org.apache.xalan.internal.utils; import com.sun.org.apache.xalan.internal.XalanConstants; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java index 35dc9a5d04b..611120baffc 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java @@ -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 @@ -33,20 +33,10 @@ import javax.xml.XMLConstants; * This class manages security related properties * */ -public final class XMLSecurityPropertyManager { +public final class XMLSecurityPropertyManager extends FeaturePropertyBase { /** - * States of the settings of a property, in the order: default value, value - * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system - * properties, and jaxp api properties - */ - public static enum State { - //this order reflects the overriding order - DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY - } - - /** - * Limits managed by the security manager + * Properties managed by the security property manager */ public static enum Property { ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD, @@ -72,15 +62,6 @@ public final class XMLSecurityPropertyManager { } - /** - * Values of the properties as defined in enum Properties - */ - private final String[] values; - /** - * States of the settings for each property in Properties above - */ - private State[] states = {State.DEFAULT, State.DEFAULT}; - /** * Default constructor. Establishes default values */ @@ -93,86 +74,6 @@ public final class XMLSecurityPropertyManager { readSystemProperties(); } - /** - * Set limit by property name and state - * @param propertyName property name - * @param state the state of the property - * @param value the value of the property - * @return true if the property is managed by the security property manager; - * false if otherwise. - */ - public boolean setValue(String propertyName, State state, Object value) { - int index = getIndex(propertyName); - if (index > -1) { - setValue(index, state, (String)value); - return true; - } - return false; - } - - /** - * Set the value for a specific property. - * - * @param property the property - * @param state the state of the property - * @param value the value of the property - */ - public void setValue(Property property, State state, String value) { - //only update if it shall override - if (state.compareTo(states[property.ordinal()]) >= 0) { - values[property.ordinal()] = value; - states[property.ordinal()] = state; - } - } - - /** - * Set the value of a property by its index - * @param index the index of the property - * @param state the state of the property - * @param value the value of the property - */ - public void setValue(int index, State state, String value) { - //only update if it shall override - if (state.compareTo(states[index]) >= 0) { - values[index] = value; - states[index] = state; - } - } - - /** - * Return the value of the specified property - * - * @param propertyName the property name - * @return the value of the property as a string - */ - public String getValue(String propertyName) { - int index = getIndex(propertyName); - if (index > -1) { - return getValueByIndex(index); - } - - return null; - } - - /** - * Return the value of the specified property - * - * @param property the property - * @return the value of the property - */ - public String getValue(Property property) { - return values[property.ordinal()]; - } - - /** - * Return the value of a property by its ordinal - * @param index the index of a property - * @return value of a property - */ - public String getValueByIndex(int index) { - return values[index]; - } - /** * Get the index by property name * @param propertyName property name @@ -198,28 +99,4 @@ public final class XMLSecurityPropertyManager { XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET); } - /** - * Read from system properties, or those in jaxp.properties - * - * @param property the property - * @param systemProperty the name of the system property - */ - private void getSystemProperty(Property property, String systemProperty) { - try { - String value = SecuritySupport.getSystemProperty(systemProperty); - if (value != null) { - values[property.ordinal()] = value; - states[property.ordinal()] = State.SYSTEMPROPERTY; - return; - } - - value = SecuritySupport.readJAXPProperty(systemProperty); - if (value != null) { - values[property.ordinal()] = value; - states[property.ordinal()] = State.JAXPDOTPROPERTIES; - } - } catch (NumberFormatException e) { - //invalid setting ignored - } - } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java index b6cdff01c0b..9ab7e30bec6 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.cmdline; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import java.io.File; import java.net.URL; import java.util.Vector; @@ -77,7 +78,7 @@ public final class Compile { final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv"); if (args.length < 1) printUsage(); - final XSLTC xsltc = new XSLTC(true); + final XSLTC xsltc = new XSLTC(true, new FeatureManager()); xsltc.init(); int c; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java index 76c4643f21b..56bebd88e2c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java @@ -42,6 +42,7 @@ import com.sun.org.apache.bcel.internal.generic.InvokeInstruction; import com.sun.org.apache.bcel.internal.generic.LocalVariableGen; import com.sun.org.apache.bcel.internal.generic.NEW; import com.sun.org.apache.bcel.internal.generic.PUSH; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -717,6 +718,8 @@ class FunctionCall extends Expression { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing(); + final boolean isExtensionFunctionEnabled = classGen.getParser().getXSLTC() + .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION); int index; // Translate calls to methods in the BasisLibrary @@ -760,7 +763,7 @@ class FunctionCall extends Expression { il.append(new INVOKESTATIC(index)); } else if (_isExtConstructor) { - if (isSecureProcessing) + if (isSecureProcessing && !isExtensionFunctionEnabled) translateUnallowedExtension(cpg, il); final String clazz = @@ -822,7 +825,7 @@ class FunctionCall extends Expression { } // Invoke function calls that are handled in separate classes else { - if (isSecureProcessing) + if (isSecureProcessing && !isExtensionFunctionEnabled) translateUnallowedExtension(cpg, il); final String clazz = _chosenMethod.getDeclaringClass().getName(); diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index 10823f14689..b6f81f7ba97 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -43,6 +43,8 @@ import javax.xml.XMLConstants; import com.sun.org.apache.bcel.internal.classfile.JavaClass; import com.sun.org.apache.xalan.internal.XalanConstants; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeatureManager.Feature; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -148,11 +150,14 @@ public final class XSLTC { private XMLSecurityManager _xmlSecurityManager; + private final FeatureManager _featureManager; + /** * XSLTC compiler constructor */ - public XSLTC(boolean useServicesMechanism) { + public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) { _parser = new Parser(this, useServicesMechanism); + _featureManager = featureManager; } /** @@ -182,6 +187,15 @@ public final class XSLTC { _useServicesMechanism = flag; } + /** + * Return the value of the specified feature + * @param name name of the feature + * @return true if the feature is enabled, false otherwise + */ + public boolean getFeature(Feature name) { + return _featureManager.isFeatureEnabled(name); + } + /** * Return allowed protocols for accessing external stylesheet. */ diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java index a26f093ee08..8cf62c05fa0 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java @@ -74,12 +74,12 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { DocumentBuilderFactory.newInstance(); private boolean _internal = true; - public SAX2DOM(boolean useServicesMachnism) throws ParserConfigurationException { - _document = createDocument(useServicesMachnism); + public SAX2DOM(boolean useServicesMechanism) throws ParserConfigurationException { + _document = createDocument(useServicesMechanism); _root = _document; } - public SAX2DOM(Node root, Node nextSibling, boolean useServicesMachnism) throws ParserConfigurationException { + public SAX2DOM(Node root, Node nextSibling, boolean useServicesMechanism) throws ParserConfigurationException { _root = root; if (root instanceof Document) { _document = (Document)root; @@ -88,15 +88,15 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { _document = root.getOwnerDocument(); } else { - _document = createDocument(useServicesMachnism); + _document = createDocument(useServicesMechanism); _root = _document; } _nextSibling = nextSibling; } - public SAX2DOM(Node root, boolean useServicesMachnism) throws ParserConfigurationException { - this(root, null, useServicesMachnism); + public SAX2DOM(Node root, boolean useServicesMechanism) throws ParserConfigurationException { + this(root, null, useServicesMechanism); } public Node getDOM() { @@ -308,18 +308,19 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants { public void startDTD(String name, String publicId, String systemId) throws SAXException {} - private Document createDocument(boolean useServicesMachnism) throws ParserConfigurationException { + private Document createDocument(boolean useServicesMechanism) throws ParserConfigurationException { if (_factory == null) { - if (useServicesMachnism) + if (useServicesMechanism) { _factory = DocumentBuilderFactory.newInstance(); if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) { _internal = false; } - else + } else { _factory = DocumentBuilderFactory.newInstance( "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAX2DOM.class.getClassLoader() ); + } } Document doc; if (_internal) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java index ff43ca9410f..8bbc5410695 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java @@ -95,7 +95,7 @@ public class TemplatesHandlerImpl _tfactory = tfactory; // Instantiate XSLTC and get reference to parser object - XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism()); + XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism(), tfactory.getFeatureManager()); if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) xsltc.setSecureProcessing(true); diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java index 9b6589d7aa8..46866fdb0ad 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java @@ -25,12 +25,14 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property; -import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State; import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants; import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; @@ -227,6 +229,8 @@ public class TransformerFactoryImpl private XMLSecurityPropertyManager _xmlSecurityPropertyMgr; private XMLSecurityManager _xmlSecurityManager; + private final FeatureManager _featureManager; + /** * javax.xml.transform.sax.TransformerFactory implementation. */ @@ -240,10 +244,13 @@ public class TransformerFactoryImpl private TransformerFactoryImpl(boolean useServicesMechanism) { this._useServicesMechanism = useServicesMechanism; + _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager(); @@ -504,6 +511,10 @@ public class TransformerFactoryImpl Property.ACCESS_EXTERNAL_STYLESHEET); } + if (value && _featureManager != null) { + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); + } return; } else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) { @@ -512,6 +523,11 @@ public class TransformerFactoryImpl _useServicesMechanism = value; } else { + if (_featureManager != null && + _featureManager.setValue(name, State.APIPROPERTY, value)) { + return; + } + // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); @@ -561,6 +577,13 @@ public class TransformerFactoryImpl return !_isNotSecureProcessing; } + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_featureManager != null) ? + _featureManager.getValueAsString(name) : null; + if (propertyValue != null) { + return Boolean.parseBoolean(propertyValue); + } + // Feature not supported return false; } @@ -571,6 +594,13 @@ public class TransformerFactoryImpl return _useServicesMechanism; } + /** + * @return the feature manager + */ + public FeatureManager getFeatureManager() { + return _featureManager; + } + /** * javax.xml.transform.sax.TransformerFactory implementation. * Get the object that is used by default during the transformation to @@ -857,7 +887,7 @@ public class TransformerFactoryImpl } // Create and initialize a stylesheet compiler - final XSLTC xsltc = new XSLTC(_useServicesMechanism); + final XSLTC xsltc = new XSLTC(_useServicesMechanism, _featureManager); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java index 600527daa93..fe1f63f89ed 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java @@ -569,32 +569,13 @@ public class XMLDocumentFragmentScannerImpl // xerces features fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true); - fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null); - fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); - - fElementAttributeLimit = (fSecurityManager != null)? - fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT):0; - fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false); Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null); fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ? (ExternalSubsetResolver) resolver : null; - // initialize vars - fMarkupDepth = 0; - fCurrentElement = null; - fElementStack.clear(); - fHasExternalDTD = false; - fStandaloneSet = false; - fStandalone = false; - fInScanContent = false; - //skipping algorithm - fShouldSkip = false; - fAdd = false; - fSkip = false; - //attribute fReadingAttributes = false; //xxx: external entities are supported in Xerces @@ -606,9 +587,6 @@ public class XMLDocumentFragmentScannerImpl // setup Driver setScannerState(SCANNER_STATE_CONTENT); setDriver(fContentDriver); - fEntityStore = fEntityManager.getEntityStore(); - - dtdGrammarUtil = null; // JAXP 1.5 features and properties XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) @@ -617,6 +595,7 @@ public class XMLDocumentFragmentScannerImpl fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false); + resetCommon(); //fEntityManager.test(); } // reset(XMLComponentManager) @@ -630,17 +609,7 @@ public class XMLDocumentFragmentScannerImpl fNamespaces = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue(); fNotifyBuiltInRefs = false ; - // initialize vars - fMarkupDepth = 0; - fCurrentElement = null; - fShouldSkip = false; - fAdd = false; - fSkip = false; - fElementStack.clear(); //fElementStack2.clear(); - fHasExternalDTD = false; - fStandaloneSet = false; - fStandalone = false; //fReplaceEntityReferences = true; //fSupportExternalEntities = true; Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_REPLACING_ENTITY_REFERENCES); @@ -661,20 +630,43 @@ public class XMLDocumentFragmentScannerImpl //we dont need to do this -- nb. //setScannerState(SCANNER_STATE_CONTENT); //setDriver(fContentDriver); - fEntityStore = fEntityManager.getEntityStore(); //fEntityManager.test(); - dtdGrammarUtil = null; - // JAXP 1.5 features and properties XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER); - fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + resetCommon(); } // reset(XMLComponentManager) + void resetCommon() { + // initialize vars + fMarkupDepth = 0; + fCurrentElement = null; + fElementStack.clear(); + fHasExternalDTD = false; + fStandaloneSet = false; + fStandalone = false; + fInScanContent = false; + //skipping algorithm + fShouldSkip = false; + fAdd = false; + fSkip = false; + + fEntityStore = fEntityManager.getEntityStore(); + dtdGrammarUtil = null; + + if (fSecurityManager != null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT); + } else { + fLimitAnalyzer = null; + fElementAttributeLimit = 0; + } + } + /** * Returns a list of feature identifiers that are recognized by * this component. This method may return null if no features @@ -1328,7 +1320,7 @@ public class XMLDocumentFragmentScannerImpl fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", - new Object[]{rawname, new Integer(fAttributes.getLength()) }, + new Object[]{rawname, fElementAttributeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR ); } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java index 464511c368c..f658d09e175 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java @@ -256,7 +256,7 @@ public class XMLNSDocumentScannerImpl fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", - new Object[]{rawname, new Integer(fAttributes.getLength()) }, + new Object[]{rawname, fElementAttributeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR ); } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java index 995105902f1..613d651594f 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java @@ -211,7 +211,7 @@ public final class SecuritySupport { if (i > 0) { return uri.substring(i+1, uri.length()); } - return ""; + return uri; } /** diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java index 0eac5f0c255..fee057ff361 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java @@ -33,6 +33,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.objects.XNodeSet; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import com.sun.org.apache.xpath.internal.functions.FuncExtFunction; import java.util.Vector; @@ -54,9 +55,12 @@ public class JAXPExtensionsProvider implements ExtensionsProvider { } public JAXPExtensionsProvider(XPathFunctionResolver resolver, - boolean featureSecureProcessing ) { + boolean featureSecureProcessing, FeatureManager featureManager ) { this.resolver = resolver; - this.extensionInvocationDisabled = featureSecureProcessing; + if (featureSecureProcessing && + !featureManager.isFeatureEnabled(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION)) { + this.extensionInvocationDisabled = true; + } } /** diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java index 2d7671ee8c7..925ce9c1234 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java @@ -30,6 +30,7 @@ import com.sun.org.apache.xml.internal.utils.PrefixResolver; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; @@ -67,33 +68,36 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{ private boolean featureSecureProcessing = false; private boolean useServicesMechanism = true; + + private final FeatureManager featureManager; + /** Protected constructor to prevent direct instantiation; use compile() * from the context. */ - protected XPathExpressionImpl() { }; - - protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, - JAXPPrefixResolver prefixResolver, - XPathFunctionResolver functionResolver, - XPathVariableResolver variableResolver ) { - this.xpath = xpath; - this.prefixResolver = prefixResolver; - this.functionResolver = functionResolver; - this.variableResolver = variableResolver; - this.featureSecureProcessing = false; + protected XPathExpressionImpl() { + this(null, null, null, null, + false, true, new FeatureManager()); }; protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, JAXPPrefixResolver prefixResolver, XPathFunctionResolver functionResolver, - XPathVariableResolver variableResolver, - boolean featureSecureProcessing, boolean useServicesMechanism ) { + XPathVariableResolver variableResolver ) { + this(xpath, prefixResolver, functionResolver, variableResolver, + false, true, new FeatureManager()); + }; + + protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath, + JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver, + XPathVariableResolver variableResolver, boolean featureSecureProcessing, + boolean useServicesMechanism, FeatureManager featureManager ) { this.xpath = xpath; this.prefixResolver = prefixResolver; this.functionResolver = functionResolver; this.variableResolver = variableResolver; this.featureSecureProcessing = featureSecureProcessing; this.useServicesMechanism = useServicesMechanism; + this.featureManager = featureManager; }; public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) { @@ -111,7 +115,7 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{ com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null; if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( - functionResolver, featureSecureProcessing ); + functionResolver, featureSecureProcessing, featureManager ); xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep ); } else { xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext(); diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java index 7159896c27d..b050af44674 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java @@ -24,6 +24,8 @@ package com.sun.org.apache.xpath.internal.jaxp; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; +import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase; import javax.xml.XMLConstants; import javax.xml.xpath.XPathFactory; @@ -68,6 +70,8 @@ public class XPathFactoryImpl extends XPathFactory { private boolean _useServicesMechanism = true; + private final FeatureManager _featureManager; + public XPathFactoryImpl() { this(true); } @@ -77,9 +81,12 @@ public class XPathFactoryImpl extends XPathFactory { } public XPathFactoryImpl(boolean useServicesMechanism) { + _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } this._useServicesMechanism = useServicesMechanism; } @@ -131,7 +138,8 @@ public class XPathFactoryImpl extends XPathFactory { public javax.xml.xpath.XPath newXPath() { return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl( xPathVariableResolver, xPathFunctionResolver, - !_isNotSecureProcessing, _useServicesMechanism ); + !_isNotSecureProcessing, _useServicesMechanism, + _featureManager ); } /** @@ -181,6 +189,10 @@ public class XPathFactoryImpl extends XPathFactory { } _isNotSecureProcessing = !value; + if (value && _featureManager != null) { + _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, + FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); + } // all done processing feature return; @@ -192,6 +204,11 @@ public class XPathFactoryImpl extends XPathFactory { return; } + if (_featureManager != null && + _featureManager.setValue(name, FeaturePropertyBase.State.APIPROPERTY, value)) { + return; + } + // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, @@ -240,6 +257,14 @@ public class XPathFactoryImpl extends XPathFactory { if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) { return _useServicesMechanism; } + + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_featureManager != null) ? + _featureManager.getValueAsString(name) : null; + if (propertyValue != null) { + return _featureManager.isFeatureEnabled(name); + } + // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java index 6b8082586b0..af82f378917 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java @@ -35,6 +35,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject; import com.sun.org.apache.xpath.internal.res.XPATHErrorResources; import com.sun.org.apache.xalan.internal.res.XSLMessages; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.FeatureManager; import org.w3c.dom.Node; import org.w3c.dom.Document; @@ -70,18 +71,20 @@ public class XPathImpl implements javax.xml.xpath.XPath { // extensions function need to throw XPathFunctionException private boolean featureSecureProcessing = false; private boolean useServiceMechanism = true; + private final FeatureManager featureManager; XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) { - this.origVariableResolver = this.variableResolver = vr; - this.origFunctionResolver = this.functionResolver = fr; + this(vr, fr, false, true, new FeatureManager()); } XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr, - boolean featureSecureProcessing, boolean useServiceMechanism ) { + boolean featureSecureProcessing, boolean useServiceMechanism, + FeatureManager featureManager) { this.origVariableResolver = this.variableResolver = vr; this.origFunctionResolver = this.functionResolver = fr; this.featureSecureProcessing = featureSecureProcessing; this.useServiceMechanism = useServiceMechanism; + this.featureManager = featureManager; } /** @@ -190,7 +193,7 @@ public class XPathImpl implements javax.xml.xpath.XPath { com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null; if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( - functionResolver, featureSecureProcessing ); + functionResolver, featureSecureProcessing, featureManager ); xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep ); } else { xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext(); @@ -391,7 +394,7 @@ public class XPathImpl implements javax.xml.xpath.XPath { // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, - featureSecureProcessing, useServiceMechanism ); + featureSecureProcessing, useServiceMechanism, featureManager ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 19b10816478..cee784b95fa 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -235,3 +235,5 @@ cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111 dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112 9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113 +9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114 +e126d8eca69b83a1cc159c2375b7c33140346d2b jdk8-b115 diff --git a/jdk/.hgtags b/jdk/.hgtags index f93b4c85fc5..0804e08a7d0 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -235,3 +235,5 @@ eea685b9ccaa1980e0a7e07d6a3a84bcc7e9ab82 jdk8-b107 719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111 f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112 5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113 +f26a0c8071bde1e3b923713c75156e4a58955623 jdk8-b114 +f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115 diff --git a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java index be0204eeeef..9f1204ca7fe 100644 --- a/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java +++ b/jdk/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java @@ -618,6 +618,11 @@ public final class TzdbZoneRulesCompiler { // remove ROC, which is not supported in j.u.tz builtZones.remove("ROC"); links.remove("ROC"); + // remove EST, HST and MST. They are supported via + // the short-id mapping + builtZones.remove("EST"); + builtZones.remove("HST"); + builtZones.remove("MST"); } /** diff --git a/jdk/makefiles/CompileDemos.gmk b/jdk/makefiles/CompileDemos.gmk index c65b0f898e3..beef573275c 100644 --- a/jdk/makefiles/CompileDemos.gmk +++ b/jdk/makefiles/CompileDemos.gmk @@ -157,8 +157,8 @@ $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services -$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html XYZApp.java)) -$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html ThreeD.java)) +$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java)) +$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java)) $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*)) $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt)) $(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*)) diff --git a/jdk/makefiles/Setup.gmk b/jdk/makefiles/Setup.gmk index b624afb6025..d2e706f6a1b 100644 --- a/jdk/makefiles/Setup.gmk +++ b/jdk/makefiles/Setup.gmk @@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,- # To build with all warnings enabled, do the following: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror +JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs -Werror # Any java code executed during a JDK build to build other parts of the JDK must be # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this diff --git a/jdk/makefiles/SignJars.gmk b/jdk/makefiles/SignJars.gmk index 4005ab736f3..263d266774d 100644 --- a/jdk/makefiles/SignJars.gmk +++ b/jdk/makefiles/SignJars.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -48,8 +48,10 @@ include MakeBase.gmk # be built, signed, and then the resulting jar files MUST BE CHECKED # INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT # BE FORGOTTEN*, otherwise a bug fixed in the source code will not be -# reflected in the shipped binaries. The "sign-jars" target in the top -# level Makefile should be used to generate the required files. +# reflected in the shipped binaries. +# +# Please consult with Release Engineering, which is responsible for +# creating the final JCE builds suitable for checkin. # # Default target @@ -58,7 +60,7 @@ all: ifndef OPENJDK README-MAKEFILE_WARNING := \ - "\nPlease read makefiles/SignJars.gmk for further build instructions.\n" + "\nPlease read jdk/makefiles/SignJars.gmk for further build instructions.\n" # # Location for JCE codesigning key. @@ -84,20 +86,34 @@ $(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/% $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE) @$(PRINTF) "\nJar codesigning finished.\n" -JAR_LIST := jce.jar \ +JAR_LIST := \ + jce.jar \ local_policy.jar \ sunec.jar \ sunjce_provider.jar \ sunpkcs11.jar \ - US_export_policy.jar + US_export_policy.jar \ + sunmscapi.jar \ + ucrypto.jar \ + # -SIGNED_JARS := $(addprefix $(JCE_OUTPUTDIR)/,$(JAR_LIST)) +UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/unsigned/, $(JAR_LIST))) + +ifeq ($(UNSIGNED_JARS), ) + $(error No jars found in $(JDK_OUTPUTDIR)/unsigned/) +endif + +SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/unsigned/%,$(JCE_OUTPUTDIR)/%, $(UNSIGNED_JARS)) $(SIGNED_JARS): check-keystore all: $(SIGNED_JARS) - @$(PRINTF) "\n***The jar files built by the 'jar-sign' target must***" - @$(PRINTF) "\n***still be checked into the closed workspace!***" + @$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer ***" + @$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***" + @$(PRINTF) "\n*** ***" + @$(PRINTF) "\n*** Please consult with Release Engineering: they will generate ***" + @$(PRINTF) "\n*** the proper binaries for the closed workspace. ***" + @$(PRINTF) "\n" @$(PRINTF) $(README-MAKEFILE_WARNING) endif # !OPENJDK diff --git a/jdk/makefiles/mapfiles/libjava/mapfile-vers b/jdk/makefiles/mapfiles/libjava/mapfile-vers index 29ce7eb26df..7b4d5472b14 100644 --- a/jdk/makefiles/mapfiles/libjava/mapfile-vers +++ b/jdk/makefiles/mapfiles/libjava/mapfile-vers @@ -267,7 +267,8 @@ SUNWprivate_1.1 { Java_sun_misc_GC_maxObjectInspectionAge; Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0; Java_sun_reflect_NativeMethodAccessorImpl_invoke0; - Java_sun_reflect_Reflection_getCallerClass; + Java_sun_reflect_Reflection_getCallerClass__; + Java_sun_reflect_Reflection_getCallerClass__I; Java_sun_reflect_Reflection_getClassAccessFlags; Java_sun_misc_Version_getJdkVersionInfo; Java_sun_misc_Version_getJdkSpecialVersion; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparc b/jdk/makefiles/mapfiles/libjava/reorder-sparc index b64537e3edd..16573052576 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparc +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparc @@ -27,7 +27,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_Object_getClass; text: .text%Java_sun_reflect_Reflection_getClassAccessFlags; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 index 8e6d249a440..fe80fca8b59 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 +++ b/jdk/makefiles/mapfiles/libjava/reorder-sparcv9 @@ -26,7 +26,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_java_lang_Float_floatToIntBits; diff --git a/jdk/makefiles/mapfiles/libjava/reorder-x86 b/jdk/makefiles/mapfiles/libjava/reorder-x86 index ff4836f4612..839ee50caa8 100644 --- a/jdk/makefiles/mapfiles/libjava/reorder-x86 +++ b/jdk/makefiles/mapfiles/libjava/reorder-x86 @@ -28,7 +28,8 @@ text: .text%Java_java_io_FileInputStream_initIDs; text: .text%Java_java_io_FileDescriptor_initIDs; text: .text%Java_java_io_FileOutputStream_initIDs; text: .text%Java_java_lang_System_setIn0; -text: .text%Java_sun_reflect_Reflection_getCallerClass; +text: .text%Java_sun_reflect_Reflection_getCallerClass__; +text: .text%Java_sun_reflect_Reflection_getCallerClass__I; text: .text%Java_java_lang_Class_forName0; text: .text%Java_java_lang_String_intern; text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0; diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m index dabaac740b6..e2d904122ba 100644 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m +++ b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m @@ -163,7 +163,7 @@ NSString *GetJavaRoot(NSDictionary *jvmInfoDict) { if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) { self.startOnFirstThread = YES; } else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) { - // for key compatability with the Apple JavaApplicationStub's 'Java' dictionary + // for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary self.startOnFirstThread = YES; } diff --git a/jdk/src/macosx/classes/com/apple/eawt/event/package.html b/jdk/src/macosx/classes/com/apple/eawt/event/package.html index 9c05d88c821..0946e60f309 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/event/package.html +++ b/jdk/src/macosx/classes/com/apple/eawt/event/package.html @@ -1,5 +1,7 @@ + + Classes for receiving gesture events. diff --git a/jdk/src/macosx/classes/com/apple/eawt/package.html b/jdk/src/macosx/classes/com/apple/eawt/package.html index e11ed40ba3f..81bc1a8d3f8 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/package.html +++ b/jdk/src/macosx/classes/com/apple/eawt/package.html @@ -1,5 +1,7 @@ + + Provides classes for integrating Java applications with the native application environment. diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 046d693e329..b2cf557ce89 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -244,7 +244,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel { * used for getting localized defaults. Also initialize the default * locale used when no locale is passed into UIDefaults.get(). The * default locale should generally not be relied upon. It is here for - * compatability with releases prior to 1.4. + * compatibility with releases prior to 1.4. */ private void initResourceBundle(final UIDefaults table) { table.setDefaultLocale(Locale.getDefault()); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java index a6b7de64e08..57e51e2d61f 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuPainter.java @@ -406,7 +406,7 @@ public class AquaMenuPainter { } /** Draw a string with the graphics g at location (x,y) just like g.drawString() would. - * The first occurence of underlineChar in text will be underlined. The matching is + * The first occurrence of underlineChar in text will be underlined. The matching is * not case sensitive. */ public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 5a1cf0cdeb7..353eb10bc3f 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3514,7 +3514,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3528,7 +3528,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class TabSelectionHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3542,7 +3542,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class MouseHandler extends MouseAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3556,7 +3556,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class FocusHandler extends FocusAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java index 93bcf7aafbc..0caf12d0eca 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTreeUI.java @@ -179,7 +179,7 @@ public class AquaTreeUI extends BasicTreeUI { } /** - * Paints the expand (toggle) part of a row. The reciever should NOT modify clipBounds, or + * Paints the expand (toggle) part of a row. The receiver should NOT modify clipBounds, or * insets. */ protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java index 644eaccc79d..bd922f3e143 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuItemCheckbox.java @@ -93,9 +93,9 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis } if (fMenuItem instanceof JCheckBoxMenuItem) { - setState(((JCheckBoxMenuItem)fMenuItem).isSelected()); + forceSetState(fMenuItem.isSelected()); } else { - setState(fMenuItem.getModel().isSelected()); + forceSetState(fMenuItem.getModel().isSelected()); } } @@ -196,10 +196,10 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis switch (e.getStateChange()) { case ItemEvent.SELECTED: - setState(true); + forceSetState(true); break; case ItemEvent.DESELECTED: - setState(false); + forceSetState(false); break; } } @@ -210,4 +210,20 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis ((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate); } } + + /* + * The CCheckboxMenuItem peer is calling setState unconditionally every time user clicks the menu + * However for Swing controls in the screen menu bar it is wrong - the state should be changed only + * in response to the ITEM_STATE_CHANGED event. So the setState is overridden to no-op and all the + * correct state changes are made with forceSetState + */ + + @Override + public synchronized void setState(boolean b) { + // No Op + } + + private void forceSetState(boolean b) { + super.setState(b); + } } diff --git a/jdk/src/macosx/classes/java/net/DefaultInterface.java b/jdk/src/macosx/classes/java/net/DefaultInterface.java index 638ca3a7648..ba032cf448f 100644 --- a/jdk/src/macosx/classes/java/net/DefaultInterface.java +++ b/jdk/src/macosx/classes/java/net/DefaultInterface.java @@ -26,7 +26,7 @@ package java.net; /** - * Choose a network inteface to be the default for + * Choose a network interface to be the default for * outgoing IPv6 traffic that does not specify a scope_id (and which needs one). * We choose the first interface that is up and is (in order of preference): * 1. neither loopback nor point to point diff --git a/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java index 4ff6a170267..ce63833da81 100644 --- a/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java +++ b/jdk/src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java @@ -122,7 +122,7 @@ class MacOSXPreferencesFile { long user() { return user; } long host() { return host; } - // private contructor - use factory method getFile() instead + // private constructor - use factory method getFile() instead private MacOSXPreferencesFile(String newName, long newUser, long newHost) { appName = newName; diff --git a/jdk/src/macosx/classes/sun/font/CFontManager.java b/jdk/src/macosx/classes/sun/font/CFontManager.java index a37fd81c0c4..e3e216e7a33 100644 --- a/jdk/src/macosx/classes/sun/font/CFontManager.java +++ b/jdk/src/macosx/classes/sun/font/CFontManager.java @@ -342,7 +342,7 @@ public class CFontManager extends SunFontManager { @Override public String getFontPath(boolean noType1Fonts) { - // In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts + // In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts Toolkit tk = Toolkit.getDefaultToolkit(); if (tk instanceof HeadlessToolkit) { tk = ((HeadlessToolkit)tk).getUnderlyingToolkit(); diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 44aafc59d11..7b3cff536ad 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -56,15 +56,6 @@ public class LWWindowPeer private final PlatformWindow platformWindow; - // Window bounds reported by the native system (as opposed to - // regular bounds inherited from LWComponentPeer which are - // requested by user and may haven't been applied yet because - // of asynchronous requests to the windowing system) - private int sysX; - private int sysY; - private int sysW; - private int sysH; - private static final int MINIMUM_WIDTH = 1; private static final int MINIMUM_HEIGHT = 1; @@ -320,10 +311,18 @@ public class LWWindowPeer // Don't post ComponentMoved/Resized and Paint events // until we've got a notification from the delegate Rectangle cb = constrainBounds(x, y, w, h); - setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false); - // Get updated bounds, so we don't have to handle 'op' here manually - Rectangle r = getBounds(); - platformWindow.setBounds(r.x, r.y, r.width, r.height); + + Rectangle newBounds = new Rectangle(getBounds()); + if ((op & (SET_LOCATION | SET_BOUNDS)) != 0) { + newBounds.x = cb.x; + newBounds.y = cb.y; + } + if ((op & (SET_SIZE | SET_BOUNDS)) != 0) { + newBounds.width = cb.width; + newBounds.height = cb.height; + } + // Native system could constraint bounds, so the peer wold be updated in the callback + platformWindow.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height); } public Rectangle constrainBounds(Rectangle bounds) { @@ -614,17 +613,10 @@ public class LWWindowPeer */ @Override public void notifyReshape(int x, int y, int w, int h) { - final boolean moved; - final boolean resized; + Rectangle oldBounds = getBounds(); final boolean invalid = updateInsets(platformWindow.getInsets()); - synchronized (getStateLock()) { - moved = (x != sysX) || (y != sysY); - resized = (w != sysW) || (h != sysH); - sysX = x; - sysY = y; - sysW = w; - sysH = h; - } + final boolean moved = (x != oldBounds.x) || (y != oldBounds.y); + final boolean resized = (w != oldBounds.width) || (h != oldBounds.height); // Check if anything changed if (!moved && !resized && !invalid) { diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index ecb2d5217f6..3f6109a4120 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -620,8 +620,7 @@ public class CInputMethod extends InputMethodAdapter { retString[0] = new String(selectedText); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(retString) { return retString[0]; } } @@ -669,8 +668,7 @@ public class CInputMethod extends InputMethodAdapter { }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(returnValue) { return returnValue; } } @@ -695,8 +693,7 @@ public class CInputMethod extends InputMethodAdapter { returnValue[0] = fIMContext.getInsertPositionOffset(); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } returnValue[1] = fCurrentTextLength; synchronized(returnValue) { return returnValue; } @@ -743,8 +740,7 @@ public class CInputMethod extends InputMethodAdapter { } }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } synchronized(rect) { return rect; } } @@ -764,8 +760,7 @@ public class CInputMethod extends InputMethodAdapter { insertPositionOffset[0] = fIMContext.getInsertPositionOffset(); }} }, fAwtFocussedComponent); - } catch (InterruptedException ie) { ie.printStackTrace(); } - catch (InvocationTargetException ite) { ite.printStackTrace(); } + } catch (InvocationTargetException ite) { ite.printStackTrace(); } // This bit of gymnastics ensures that the returned location is within the composed text. // If it falls outside that region, the input method will commit the text, which is inconsistent with native diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java index e5d99678b18..d09f1571d08 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformLWView.java @@ -53,14 +53,6 @@ public class CPlatformLWView extends CPlatformView { public void setBounds(int x, int y, int width, int height) { } - @Override - public void enterFullScreenMode() { - } - - @Override - public void exitFullScreenMode() { - } - @Override public SurfaceData replaceSurfaceData() { return null; diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java index b287e7745b7..ba05ab0b6c3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java @@ -96,14 +96,6 @@ public class CPlatformView extends CFRetainedResource { return peer; } - public void enterFullScreenMode() { - CWrapper.NSView.enterFullScreenMode(ptr); - } - - public void exitFullScreenMode() { - CWrapper.NSView.exitFullScreenMode(ptr); - } - public void setToolTip(String msg) { CWrapper.NSView.setToolTip(ptr, msg); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 8fca7df691d..f0eebfcdcb1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -63,6 +63,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private static native void nativeSynthesizeMouseEnteredExitedEvents(); private static native void nativeDispose(long nsWindowPtr); private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse(); + private static native void nativeEnterFullScreenMode(long nsWindowPtr); + private static native void nativeExitFullScreenMode(long nsWindowPtr); // Loger to report issues happened during execution but that do not affect functionality private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow"); @@ -230,7 +232,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo contentView.initialize(peer, responder); final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L; - Rectangle bounds = _peer.constrainBounds(_target.getBounds()); + Rectangle bounds; + if (!IS(DECORATED, styleBits)) { + // For undecorated frames the move/resize event does not come if the frame is centered on the screen + // so we need to set a stub location to force an initial move/resize. Real bounds would be set later. + bounds = new Rectangle(0, 0, 1, 1); + } else { + bounds = _peer.constrainBounds(_target.getBounds()); + } final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height); setPtr(nativeWindowPtr); @@ -433,10 +442,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override // PlatformWindow public Insets getInsets() { - if (!isFullScreenMode) { - return nativeGetNSWindowInsets(getNSWindowPtr()); - } - return new Insets(0, 0, 0, 0); + return nativeGetNSWindowInsets(getNSWindowPtr()); } @Override // PlatformWindow @@ -538,6 +544,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo updateIconImages(); updateFocusabilityForAutoRequestFocus(false); + boolean wasMaximized = isMaximized(); + // Actually show or hide the window LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null || !visible) { @@ -571,16 +579,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo if (visible) { // Apply the extended state as expected in shared code if (target instanceof Frame) { - switch (((Frame)target).getExtendedState()) { - case Frame.ICONIFIED: - CWrapper.NSWindow.miniaturize(nsWindowPtr); - break; - case Frame.MAXIMIZED_BOTH: - maximize(); - break; - default: // NORMAL - unmaximize(); // in case it was maximized, otherwise this is a no-op - break; + if (!wasMaximized && isMaximized()) { + // setVisible could have changed the native maximized state + deliverZoom(true); + } else { + switch (((Frame)target).getExtendedState()) { + case Frame.ICONIFIED: + CWrapper.NSWindow.miniaturize(nsWindowPtr); + break; + case Frame.MAXIMIZED_BOTH: + maximize(); + break; + default: // NORMAL + unmaximize(); // in case it was maximized, otherwise this is a no-op + break; + } } } } @@ -750,18 +763,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override public void enterFullScreenMode() { isFullScreenMode = true; - contentView.enterFullScreenMode(); - // the move/size notification from the underlying system comes - // but it contains a bounds smaller than the whole screen - // and therefore we need to create the synthetic notifications - Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds(); - peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width, - screenBounds.height); + nativeEnterFullScreenMode(getNSWindowPtr()); } @Override public void exitFullScreenMode() { - contentView.exitFullScreenMode(); + nativeExitFullScreenMode(getNSWindowPtr()); isFullScreenMode = false; } @@ -884,7 +891,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo //Posting an empty to flush the EventQueue without blocking the main thread } }, target); - } catch (InterruptedException | InvocationTargetException e) { + } catch (InvocationTargetException e) { e.printStackTrace(); } } @@ -919,13 +926,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo protected void deliverMoveResizeEvent(int x, int y, int width, int height, boolean byUser) { - // when the content view enters the full-screen mode, the native - // move/resize notifications contain a bounds smaller than - // the whole screen and therefore we ignore the native notifications - // and the content view itself creates correct synthetic notifications - if (isFullScreenMode) { - return; - } + checkZoom(); final Rectangle oldB = nativeBounds; nativeBounds = new Rectangle(x, y, width, height); @@ -957,6 +958,17 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } } + private void checkZoom() { + if (target instanceof Frame && isVisible()) { + Frame targetFrame = (Frame)target; + if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) { + deliverZoom(true); + } else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) { + deliverZoom(false); + } + } + } + private void deliverNCMouseDown() { if (peer != null) { peer.notifyNCMouseDown(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index b54a1baa2c5..0743c00ae63 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -233,6 +233,10 @@ public class CPrinterJob extends RasterPrinterJob { setAttributes(attributes); + // throw exception for invalid destination + if (destinationAttr != null) { + validateDestination(destinationAttr); + } /* Get the range of pages we are to print. If the * last page to print is unknown, then we print to diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java index 28acc26f6cc..6d843b88295 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java @@ -97,6 +97,6 @@ public class CViewEmbeddedFrame extends EmbeddedFrame { setVisible(true); } }, this); - } catch (InterruptedException | InvocationTargetException ex) {} + } catch (InvocationTargetException ex) {} } } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java index 879118cf2e1..a9c55237eee 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java @@ -82,9 +82,6 @@ public final class CWrapper { public static native Rectangle2D frame(long view); public static native long window(long view); - public static native void enterFullScreenMode(long view); - public static native void exitFullScreenMode(long view); - public static native void setHidden(long view, boolean hidden); public static native void setToolTip(long view, String msg); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index d698845e558..959b03868fb 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -548,22 +548,18 @@ public final class LWCToolkit extends LWToolkit { // Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop // The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop // Does not dispatch native events while in the loop - public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException { + public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException { final long mediator = createAWTRunLoopMediator(); InvocationEvent invocationEvent = - new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) { - @Override - public void dispatch() { - try { - super.dispatch(); - } finally { + new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), + runnable, + () -> { if (mediator != 0) { stopAWTRunLoop(mediator); } - } - } - }; + }, + true); if (component != null) { AppContext appContext = SunToolkit.targetToAppContext(component); diff --git a/jdk/src/macosx/native/sun/awt/AWTView.m b/jdk/src/macosx/native/sun/awt/AWTView.m index 28bdb4b9077..8fd088f426c 100644 --- a/jdk/src/macosx/native/sun/awt/AWTView.m +++ b/jdk/src/macosx/native/sun/awt/AWTView.m @@ -272,7 +272,6 @@ AWT_ASSERT_APPKIT_THREAD; */ - (void) keyDown: (NSEvent *)event { - fProcessingKeystroke = YES; fKeyEventsNeeded = YES; @@ -308,6 +307,23 @@ AWT_ASSERT_APPKIT_THREAD; - (BOOL) performKeyEquivalent: (NSEvent *) event { [self deliverJavaKeyEventHelper: event]; + + // Workaround for 8020209: special case for "Cmd =" and "Cmd ." + // because Cocoa calls performKeyEquivalent twice for these keystrokes + NSUInteger modFlags = [event modifierFlags] & + (NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask); + if (modFlags == NSCommandKeyMask) { + NSString *eventChars = [event charactersIgnoringModifiers]; + if ([eventChars length] == 1) { + unichar ch = [eventChars characterAtIndex:0]; + if (ch == '=' || ch == '.') { + [[NSApp mainMenu] performKeyEquivalent: event]; + return YES; + } + } + + } + return NO; } @@ -580,7 +596,7 @@ AWT_ASSERT_APPKIT_THREAD; // --- Services menu support for lightweights --- -// finds the focused accessable element, and if it's a text element, obtains the text from it +// finds the focused accessible element, and if it is a text element, obtains the text from it - (NSString *)accessibleSelectedText { id focused = [self accessibilityFocusedUIElement]; @@ -598,7 +614,7 @@ AWT_ASSERT_APPKIT_THREAD; return rtfdData; } -// finds the focused accessable element, and if it's a text element, sets the text in it +// finds the focused accessible element, and if it is a text element, sets the text in it - (BOOL)replaceAccessibleTextSelection:(NSString *)text { id focused = [self accessibilityFocusedUIElement]; diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.h b/jdk/src/macosx/native/sun/awt/AWTWindow.h index 698820ade4d..7f7bac777bc 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.h +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ BOOL isEnabled; NSWindow *nsWindow; AWTWindow *ownerWindow; + jint preFullScreenLevel; } // An instance of either AWTWindow_Normal or AWTWindow_Panel @@ -57,6 +58,7 @@ @property (nonatomic) NSSize javaMaxSize; @property (nonatomic) jint styleBits; @property (nonatomic) BOOL isEnabled; +@property (nonatomic) jint preFullScreenLevel; - (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m index 2231f10d1bf..687fa6b4d01 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.m +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m @@ -122,6 +122,7 @@ AWT_NS_WINDOW_IMPLEMENTATION @synthesize styleBits; @synthesize isEnabled; @synthesize ownerWindow; +@synthesize preFullScreenLevel; - (void) updateMinMaxSize:(BOOL)resizable { if (resizable) { @@ -501,20 +502,6 @@ AWT_ASSERT_APPKIT_THREAD; // window exposing in _setVisible:(BOOL) } -- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)proposedFrame { -AWT_ASSERT_APPKIT_THREAD; - - [AWTToolkit eventCountPlusPlus]; - JNIEnv *env = [ThreadUtilities getJNIEnv]; - jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; - if (platformWindow != NULL) { - static JNF_MEMBER_CACHE(jm_deliverZoom, jc_CPlatformWindow, "deliverZoom", "(Z)V"); - JNFCallVoidMethod(env, platformWindow, jm_deliverZoom, ![window isZoomed]); - (*env)->DeleteLocalRef(env, platformWindow); - } - return YES; -} - - (void) _deliverIconify:(BOOL)iconify { AWT_ASSERT_APPKIT_THREAD; @@ -1226,3 +1213,58 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeEnterFullScreenMode +(JNIEnv *env, jclass clazz, jlong windowPtr) +{ +JNF_COCOA_ENTER(env); + + NSWindow *nsWindow = OBJC(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; + CGDirectDisplayID aID = [screenID intValue]; + + if (CGDisplayCapture(aID) == kCGErrorSuccess) { + // remove window decoration + NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; + [nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask]; + + int shieldLevel = CGShieldingWindowLevel(); + window.preFullScreenLevel = [nsWindow level]; + [nsWindow setLevel: shieldLevel]; + + NSRect screenRect = [[nsWindow screen] frame]; + [nsWindow setFrame:screenRect display:YES]; + } else { + [JNFException raise:env as:kRuntimeException reason:"Failed to enter full screen."]; + } + }]; + +JNF_COCOA_EXIT(env); +} + +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode +(JNIEnv *env, jclass clazz, jlong windowPtr) +{ +JNF_COCOA_ENTER(env); + + NSWindow *nsWindow = OBJC(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + AWTWindow *window = (AWTWindow*)[nsWindow delegate]; + NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; + CGDirectDisplayID aID = [screenID intValue]; + + if (CGDisplayRelease(aID) == kCGErrorSuccess) { + NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; + [nsWindow setStyleMask:styleMask]; + [nsWindow setLevel: window.preFullScreenLevel]; + + // GraphicsDevice takes care of restoring pre full screen bounds + } else { + [JNFException raise:env as:kRuntimeException reason:"Failed to exit full screen."]; + } + }]; + +JNF_COCOA_EXIT(env); +} + diff --git a/jdk/src/macosx/native/sun/awt/CPrinterJob.m b/jdk/src/macosx/native/sun/awt/CPrinterJob.m index 3935240ff78..2b92c2250fb 100644 --- a/jdk/src/macosx/native/sun/awt/CPrinterJob.m +++ b/jdk/src/macosx/native/sun/awt/CPrinterJob.m @@ -359,7 +359,11 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj static JNF_CLASS_CACHE(jc_Pageable, "java/awt/print/Pageable"); static JNF_MEMBER_CACHE(jm_getCopies, sjc_CPrinterJob, "getCopiesInt", "()I"); static JNF_MEMBER_CACHE(jm_isCollated, sjc_CPrinterJob, "isCollated", "()Z"); + static JNF_MEMBER_CACHE(jm_getFromPage, sjc_CPrinterJob, "getFromPageAttrib", "()I"); + static JNF_MEMBER_CACHE(jm_getToPage, sjc_CPrinterJob, "getToPageAttrib", "()I"); + static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I"); static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I"); + static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;"); NSMutableDictionary* printingDictionary = [dst dictionary]; @@ -368,19 +372,35 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj jboolean collated = JNFCallBooleanMethod(env, srcPrinterJob, jm_isCollated); // AWT_THREADING Safe (known object) [printingDictionary setObject:[NSNumber numberWithBool:collated ? YES : NO] forKey:NSPrintMustCollate]; - jint jNumPages = JNFCallIntMethod(env, srcPageable, jm_getNumberOfPages); // AWT_THREADING Safe (!appKit) if (jNumPages != java_awt_print_Pageable_UNKNOWN_NUMBER_OF_PAGES) { - [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + jint selectID = JNFCallIntMethod(env, srcPrinterJob, jm_getSelectAttrib); + if (selectID ==0) { + [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages]; + } else if (selectID == 2) { + // In Mac 10.7, Print ALL is deselected if PrintSelection is YES whether + // NSPrintAllPages is YES or NO + [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintSelectionOnly]; + } else { + [printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages]; + } - [printingDictionary setObject:[NSNumber numberWithInteger:1] forKey:NSPrintFirstPage]; - [printingDictionary setObject:[NSNumber numberWithInteger:jNumPages] forKey:NSPrintLastPage]; + jint fromPage = JNFCallIntMethod(env, srcPrinterJob, jm_getFromPage); + jint toPage = JNFCallIntMethod(env, srcPrinterJob, jm_getToPage); + // setting fromPage and toPage will not be shown in the dialog if printing All pages + [printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage]; + [printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage]; } else { [printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages]; } + jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat); + if (page != NULL) { + javaPageFormatToNSPrintInfo(env, NULL, page, dst); + } } /* diff --git a/jdk/src/macosx/native/sun/awt/CTextPipe.m b/jdk/src/macosx/native/sun/awt/CTextPipe.m index f6510f204ae..aaa5f1ee3b1 100644 --- a/jdk/src/macosx/native/sun/awt/CTextPipe.m +++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m @@ -322,7 +322,7 @@ static void DrawTextContext Each stage of the pipeline is responsible for doing only one major thing, like allocating buffers, aquiring transform arrays from JNI, filling buffers, or striking glyphs. All resources or memory - aquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc) + acquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc) is to be handled in the stage it occurs in, and is to return immediatly after freeing it's resources. -----------------------------------*/ diff --git a/jdk/src/macosx/native/sun/awt/CWrapper.m b/jdk/src/macosx/native/sun/awt/CWrapper.m index a658a5df64a..e5847bea960 100644 --- a/jdk/src/macosx/native/sun/awt/CWrapper.m +++ b/jdk/src/macosx/native/sun/awt/CWrapper.m @@ -585,46 +585,6 @@ JNF_COCOA_EXIT(env); return jRect; } -/* - * Class: sun_lwawt_macosx_CWrapper$NSView - * Method: enterFullScreenMode - * Signature: (J)V - */ -JNIEXPORT void JNICALL -Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode -(JNIEnv *env, jclass cls, jlong viewPtr) -{ -JNF_COCOA_ENTER(env); - - NSView *view = (NSView *)jlong_to_ptr(viewPtr); - [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ - NSScreen *screen = [[view window] screen]; - NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil]; - [view enterFullScreenMode:screen withOptions:opts]; - }]; - -JNF_COCOA_EXIT(env); -} - -/* - * Class: sun_lwawt_macosx_CWrapper$NSView - * Method: exitFullScreenMode - * Signature: (J)V - */ -JNIEXPORT void JNICALL -Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode -(JNIEnv *env, jclass cls, jlong viewPtr) -{ -JNF_COCOA_ENTER(env); - - NSView *view = (NSView *)jlong_to_ptr(viewPtr); - [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ - [view exitFullScreenModeWithOptions:nil]; - }]; - -JNF_COCOA_EXIT(env); -} - /* * Class: sun_lwawt_macosx_CWrapper$NSView * Method: window diff --git a/jdk/src/macosx/native/sun/awt/awt.m b/jdk/src/macosx/native/sun/awt/awt.m index e730a5ca920..0a491fd44f2 100644 --- a/jdk/src/macosx/native/sun/awt/awt.m +++ b/jdk/src/macosx/native/sun/awt/awt.m @@ -312,15 +312,17 @@ AWT_ASSERT_APPKIT_THREAD; if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex"); } - // Don't set the delegate until the NSApplication has been created and - // its finishLaunching has initialized it. - // ApplicationDelegate is the support code for com.apple.eawt. - [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ - id delegate = [ApplicationDelegate sharedDelegate]; - if (delegate != nil) { - OSXAPP_SetApplicationDelegate(delegate); - } - }]; + if (!headless) { + // Don't set the delegate until the NSApplication has been created and + // its finishLaunching has initialized it. + // ApplicationDelegate is the support code for com.apple.eawt. + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + id delegate = [ApplicationDelegate sharedDelegate]; + if (delegate != nil) { + OSXAPP_SetApplicationDelegate(delegate); + } + }]; + } } - (void)starter:(NSArray*)args { diff --git a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m index 141a8c21ade..5c21b3f6394 100644 --- a/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m +++ b/jdk/src/macosx/native/sun/osxapp/NSApplicationAWT.m @@ -341,6 +341,10 @@ AWT_ASSERT_APPKIT_THREAD; if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) { [seenDummyEventLock lockWhenCondition:NO]; [seenDummyEventLock unlockWithCondition:YES]; + } else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) { + // Cocoa won't send us key up event when releasing a key while Cmd is down, + // so we have to do it ourselves. + [[self keyWindow] sendEvent:event]; } else { [super sendEvent:event]; } diff --git a/jdk/src/share/back/ThreadGroupReferenceImpl.c b/jdk/src/share/back/ThreadGroupReferenceImpl.c index 06ae01065d8..47b894a5894 100644 --- a/jdk/src/share/back/ThreadGroupReferenceImpl.c +++ b/jdk/src/share/back/ThreadGroupReferenceImpl.c @@ -47,7 +47,7 @@ name(PacketInputStream *in, PacketOutputStream *out) (void)memset(&info, 0, sizeof(info)); threadGroupInfo(group, &info); - (void)outStream_writeString(out, info.name); + (void)outStream_writeString(out, info.name == NULL ? "" : info.name); if ( info.name != NULL ) jvmtiDeallocate(info.name); diff --git a/jdk/src/share/back/commonRef.c b/jdk/src/share/back/commonRef.c index 8cb534a90cf..ce9c75eeace 100644 --- a/jdk/src/share/back/commonRef.c +++ b/jdk/src/share/back/commonRef.c @@ -52,7 +52,7 @@ * the number times an object has been referenced through * commonRef_refToID. A RefNode is freed once the reference * count is decremented to 0 (with commonRef_release*), even if the - * correspoding object has not been collected. + * corresponding object has not been collected. * * One hash table is maintained. The mapping of ID to jobject (or RefNode*) * is handled with one hash table that will re-size itself as the number diff --git a/jdk/src/share/back/eventFilter.c b/jdk/src/share/back/eventFilter.c index dd05758d6c9..d67aa96ba5b 100644 --- a/jdk/src/share/back/eventFilter.c +++ b/jdk/src/share/back/eventFilter.c @@ -644,7 +644,7 @@ eventFilter_predictFiltering(HandlerNode *node, jclass clazz, char *classname) case JDWP_REQUEST_MODIFIER(Count): { /* - * If preceeding filters have determined that events will + * If preceding filters have determined that events will * be filtered out, that is fine and we won't get here. * However, the count must be decremented - even if * subsequent filters will filter these events. We diff --git a/jdk/src/share/back/outStream.c b/jdk/src/share/back/outStream.c index 8eeebc4c66e..b48d5591c20 100644 --- a/jdk/src/share/back/outStream.c +++ b/jdk/src/share/back/outStream.c @@ -298,17 +298,15 @@ jdwpError outStream_writeString(PacketOutputStream *stream, char *string) { jdwpError error; - jint length; + jint length = string != NULL ? (int)strlen(string) : 0; /* Options utf8=y/n controls if we want Standard UTF-8 or Modified */ if ( gdata->modifiedUtf8 ) { - length = (int)strlen(string); (void)outStream_writeInt(stream, length); error = writeBytes(stream, (jbyte *)string, length); } else { jint new_length; - length = (int)strlen(string); new_length = (gdata->npt->utf8mToUtf8sLength) (gdata->npt->utf, (jbyte*)string, length); if ( new_length == length ) { diff --git a/jdk/src/share/back/util.c b/jdk/src/share/back/util.c index 315815caa43..40cca3c0fe8 100644 --- a/jdk/src/share/back/util.c +++ b/jdk/src/share/back/util.c @@ -1092,7 +1092,7 @@ debugMonitorWait(jrawMonitorID monitor) * we don't want to consume it. It came from * user code and is intended for user code, not us. * So, we will remember that the interrupt has - * occured and re-activate it when this thread + * occurred and re-activate it when this thread * goes back into user code. * That being said, what do we do here? Since * we could have been notified too, here we will diff --git a/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java index 93511bc5885..e2714f869e1 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/AccessorElementHandler.java @@ -40,7 +40,7 @@ abstract class AccessorElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
name *
the name of the accessible entity diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java index 5406891efbf..9a6d2284516 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ import java.lang.reflect.Array; * <int>456</int> * </array> * is equivalent to {@code int[] array = {123, 456}} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
length *
the array length @@ -76,7 +76,7 @@ final class ArrayElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
length *
the array length @@ -109,6 +109,20 @@ final class ArrayElementHandler extends NewElementHandler { } } + /** + * Tests whether the value of this element can be used + * as an argument of the element that contained in this one. + * + * @return {@code true} if the value of this element can be used + * as an argument of the element that contained in this one, + * {@code false} otherwise + */ + @Override + protected boolean isArgument() { + return true; // hack for compatibility + } + + /** * Creates an instance of the array. * diff --git a/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java index e00af8c4c45..a88aa164693 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/BooleanElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>true</string> * </method> * which is equivalent to {@code Boolean.valueOf("true")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java index a5347591793..a24f106fa9a 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ByteElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>127</string> * </method> * which is equivalent to {@code Byte.decode("127")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java index 6e257d6c72a..e75a865e5ee 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/CharElementHandler.java @@ -33,7 +33,7 @@ package com.sun.beans.decoder; * For example:
  * <char>X</char>
* which is equivalent to {@code Character.valueOf('X')} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
code *
this attribute specifies character code @@ -52,7 +52,7 @@ final class CharElementHandler extends StringElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
code *
this attribute specifies character code diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java index 9decb9f2d6a..63ebafd64c8 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ClassElementHandler.java @@ -36,7 +36,7 @@ package com.sun.beans.decoder; * <string>java.lang.Class</string> * </method> * which is equivalent to {@code Class.forName("java.lang.Class")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java index f8292aeea68..1fce298594b 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/DoubleElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>1.23e45</string> * </method> * which is equivalent to {@code Double.valueOf("1.23e45")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java index dc24b011b15..f408223f3c3 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ElementHandler.java @@ -126,7 +126,7 @@ public abstract class ElementHandler { /** * Parses attributes of the element. - * By default, the following atribute is supported: + * By default, the following attribute is supported: *
*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java index 608a827baed..c34c4a3ee24 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FalseElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
  * <false/>
* is equivalent to {@code false} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java index caa3a1d8ede..69d84bb5939 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FieldElementHandler.java @@ -43,7 +43,7 @@ import java.lang.reflect.Field; * For example:
  * <field name="id"><int>0</int></field>
* is equivalent to {@code id = 0} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
name *
the field name @@ -62,7 +62,7 @@ final class FieldElementHandler extends AccessorElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
name *
the field name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java index 0f934e660c1..320f17f020a 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/FloatElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>-1.23</string> * </method> * which is equivalent to {@code Float.valueOf("-1.23")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java index 0b9634af96b..56473b03de4 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/IntElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>-1</string> * </method> * which is equivalent to {@code Integer.decode("-1")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java index 53f30864753..61f3faddaf1 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/JavaElementHandler.java @@ -32,7 +32,7 @@ import java.beans.XMLDecoder; * is evaluated in the context of the decoder itself. * Typically this outer context is used to retrieve the owner of the decoder, * which can be set before reading the archive. - *

The following atributes are supported: + *

The following attributes are supported: *

*
version *
the Java version (not supported) @@ -54,7 +54,7 @@ final class JavaElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
version *
the Java version (not supported) diff --git a/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java index 3147f473e0e..3c15008e293 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/LongElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>0xFFFF</string> * </method> * which is equivalent to {@code Long.decode("0xFFFF")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java index 73fcb67fa4f..b1357206277 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/MethodElementHandler.java @@ -43,7 +43,7 @@ import sun.reflect.misc.MethodUtil; * <string>10</string> * </method> * is equivalent to {@code Long.valueOf("10")} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
name *
the method name @@ -62,7 +62,7 @@ final class MethodElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
name *
the method name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java index 18998db4ca1..9cf86dcca44 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/NewElementHandler.java @@ -43,7 +43,7 @@ import java.util.List; * <string>10</string> * </new> * is equivalent to {@code new Long("10")} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
class *
the type of object for instantiation @@ -63,7 +63,7 @@ class NewElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
class *
the type of object for instantiation diff --git a/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java index 59cb0e90f89..b47dd7063e9 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/NullElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
  * <null/>
* is equivalent to {@code null} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java index 566947183e8..c791e6c722b 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ObjectElementHandler.java @@ -33,7 +33,7 @@ import static java.util.Locale.ENGLISH; * This element looks like <void> element, * but its value is always used as an argument for element * that contains this one. - *

The following atributes are supported: + *

The following attributes are supported: *

*
class *
the type is used for static methods and fields @@ -64,7 +64,7 @@ class ObjectElementHandler extends NewElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
class *
the type is used for static methods and fields diff --git a/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java index 8f4c40cac93..9473d5ceb8c 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/PropertyElementHandler.java @@ -63,7 +63,7 @@ import sun.reflect.misc.MethodUtil; * <int>0</int> * </method> * which is equivalent to {@code set(0)} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
name *
the property name @@ -85,7 +85,7 @@ final class PropertyElementHandler extends AccessorElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
name *
the property name diff --git a/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java index f86ad3834ea..26c517f489e 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/ShortElementHandler.java @@ -37,7 +37,7 @@ package com.sun.beans.decoder; * <string>200</string> * </method> * which is equivalent to {@code Short.decode("200")} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java index bceb7ceb04f..fd6960a4be3 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/StringElementHandler.java @@ -40,7 +40,7 @@ package com.sun.beans.decoder; * <string> * <true> * </string> - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java index f3bed67c7ca..dfb6553b911 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/TrueElementHandler.java @@ -31,7 +31,7 @@ package com.sun.beans.decoder; * For example:
  * <true/>
* is equivalent to {@code true} in Java code. - *

The following atribute is supported: + *

The following attribute is supported: *

*
id *
the identifier of the variable that is intended to store the result diff --git a/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java index 2d540fd9949..51a4fa13d4c 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/VarElementHandler.java @@ -30,7 +30,7 @@ package com.sun.beans.decoder; * For example:
  * <var id="id1" idref="id2"/>
* is equivalent to {@code id1 = id2} in Java code. - *

The following atributes are supported: + *

The following attributes are supported: *

*
idref *
the identifier to refer to the variable @@ -47,7 +47,7 @@ final class VarElementHandler extends ElementHandler { /** * Parses attributes of the element. - * The following atributes are supported: + * The following attributes are supported: *
*
idref *
the identifier to refer to the variable diff --git a/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java index 63ce32c03f4..232772924ff 100644 --- a/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java +++ b/jdk/src/share/classes/com/sun/beans/decoder/VoidElementHandler.java @@ -29,7 +29,7 @@ package com.sun.beans.decoder; * This element looks like <object> element, * but its value is not used as an argument for element * that contains this one. - *

The following atributes are supported: + *

The following attributes are supported: *

*
class *
the type is used for static methods and fields diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java index 2d06c901942..98f85cf04bd 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBECipherCore.java @@ -408,7 +408,7 @@ final class PBECipherCore { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ byte[] doFinal(byte[] input, int inputOffset, int inputLen) @@ -448,7 +448,7 @@ final class PBECipherCore { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ int doFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java index 88296c857d1..d5389ac40ac 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java @@ -408,7 +408,7 @@ final class PBES1Core { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ byte[] doFinal(byte[] input, int inputOffset, int inputLen) @@ -448,7 +448,7 @@ final class PBES1Core { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ int doFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java index d448f277dcb..62394e784c2 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java @@ -307,7 +307,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) @@ -348,7 +348,7 @@ public final class PBEWithMD5AndDESCipher extends CipherSpi { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java index d6216a81fb9..978e7b7b778 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java @@ -317,7 +317,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi { * no padding has been requested (only in encryption mode), and the total * input length of the data processed by this cipher is not a multiple of * block size - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) @@ -358,7 +358,7 @@ public final class PBEWithMD5AndTripleDESCipher extends CipherSpi { * block size * @exception ShortBufferException if the given output buffer is too small * to hold the result - * @exception BadPaddingException if decrypting and padding is choosen, + * @exception BadPaddingException if decrypting and padding is chosen, * but the last input data does not have proper padding bytes. */ protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java index 94fd920ba31..b8c9a1e2b36 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java @@ -187,15 +187,24 @@ public class BMPImageReader extends ImageReader implements BMPConstants { return 1; } + @Override public int getWidth(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return width; } public int getHeight(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return height; } @@ -205,7 +214,18 @@ public class BMPImageReader extends ImageReader implements BMPConstants { } } - public void readHeader() throws IOException { + /** + * Process the image header. + * + * @exception IllegalStateException if source stream is not set. + * + * @exception IOException if image stream is corrupted. + * + * @exception IllegalArgumentException if the image stream does not contain + * a BMP image, or if a sample model instance to describe the + * image can not be created. + */ + protected void readHeader() throws IOException, IllegalArgumentException { if (gotHeader) return; @@ -307,6 +327,9 @@ public class BMPImageReader extends ImageReader implements BMPConstants { case BI_RLE4: // 4-bit RLE compression // Read in the palette + if (bitmapOffset < (size + 14)) { + throw new IIOException(I18N.getString("BMPImageReader7")); + } int numberOfEntries = (int)((bitmapOffset-14-size) / 4); int sizeOfPalette = numberOfEntries * 4; palette = new byte[sizeOfPalette]; @@ -375,7 +398,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { break; default: throw new - RuntimeException(I18N.getString("BMPImageReader2")); + IIOException(I18N.getString("BMPImageReader2")); } } else if (size == 108 || size == 124) { // Windows 4.x BMP @@ -478,7 +501,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { } } else { throw new - RuntimeException(I18N.getString("BMPImageReader3")); + IIOException(I18N.getString("BMPImageReader3")); } } @@ -660,7 +683,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { public Iterator getImageTypes(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } ArrayList list = new ArrayList(1); list.add(new ImageTypeSpecifier(originalColorModel, originalSampleModel)); @@ -675,7 +702,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { throws IOException { checkIndex(imageIndex); if (metadata == null) { - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } } return metadata; } @@ -686,7 +717,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { public boolean isRandomAccessEasy(int imageIndex) throws IOException { checkIndex(imageIndex); - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } return metadata.compression == BI_RGB; } @@ -705,7 +740,11 @@ public class BMPImageReader extends ImageReader implements BMPConstants { param = getDefaultReadParam(); //read header - readHeader(); + try { + readHeader(); + } catch (IllegalArgumentException e) { + throw new IIOException(I18N.getString("BMPImageReader6"), e); + } sourceRegion = new Rectangle(0, 0, 0, 0); destinationRegion = new Rectangle(0, 0, 0, 0); @@ -817,7 +856,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; @@ -833,7 +872,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; @@ -874,7 +913,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } case VERSION_4_8_BIT: @@ -890,7 +929,7 @@ public class BMPImageReader extends ImageReader implements BMPConstants { default: throw new - RuntimeException(I18N.getString("BMPImageReader1")); + IIOException(I18N.getString("BMPImageReader1")); } break; diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java b/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java index 08a17151f49..97e798a8e3d 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/StandardMetadataFormat.java @@ -32,7 +32,7 @@ import javax.imageio.metadata.IIOMetadataFormatImpl; public class StandardMetadataFormat extends IIOMetadataFormatImpl { - // Utility method for nodes with a single atttribute named "value" + // Utility method for nodes with a single attribute named "value" private void addSingleAttributeElement(String elementName, String parentName, int dataType) { diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties b/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties index 70a6f715211..85b108f8e3b 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties +++ b/jdk/src/share/classes/com/sun/imageio/plugins/common/iio-plugin.properties @@ -21,6 +21,8 @@ BMPImageReader2=Invalid compression specified in BMP stream. BMPImageReader3=New BMP version not implemented yet. BMPImageReader4=No ImageIO-style reader is found for BMPImageReader5=Input has not been set. +BMPImageReader6=Unable to read the image header. +BMPImageReader7=Invalid bitmap offset. BMPImageWriter0=Output is not an ImageOutputStream. BMPImageWriter1=The image region to be encoded is empty. BMPImageWriter2=Only 1 or 3 band image is encoded. @@ -34,7 +36,7 @@ BMPMetadata0=The provided metadata format isn't recognized. BMPMetadata1=Metadata is read-only. -# WBMP plugin properties +# WBMP plugin properties WBMPImageReader0=Only one image exists in the stream. WBMPImageReader1=Input has not been set. WBMPImageReader2=Bad WBMP header. diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java index 0fbdefb8e0e..5e3d852275d 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java @@ -115,6 +115,8 @@ public class GIFImageReader extends ImageReader { // The current interlace pass, starting with 0. int interlacePass = 0; + private byte[] fallbackColorTable = null; + // End per-stream settings // Constants used to control interlacing. @@ -239,10 +241,22 @@ public class GIFImageReader extends ImageReader { byte[] colorTable; if (imageMetadata.localColorTable != null) { colorTable = imageMetadata.localColorTable; + fallbackColorTable = imageMetadata.localColorTable; } else { colorTable = streamMetadata.globalColorTable; } + if (colorTable == null) { + if (fallbackColorTable == null) { + this.processWarningOccurred("Use default color table."); + + // no color table, the spec allows to use any palette. + fallbackColorTable = getDefaultPalette(); + } + + colorTable = fallbackColorTable; + } + // Normalize color table length to 2^1, 2^2, 2^4, or 2^8 int length = colorTable.length/3; int bits; @@ -1036,5 +1050,34 @@ public class GIFImageReader extends ImageReader { streamY = -1; rowsDone = 0; interlacePass = 0; + + fallbackColorTable = null; + } + + private static byte[] defaultPalette = null; + + private static synchronized byte[] getDefaultPalette() { + if (defaultPalette == null) { + BufferedImage img = new BufferedImage(1, 1, + BufferedImage.TYPE_BYTE_INDEXED); + IndexColorModel icm = (IndexColorModel) img.getColorModel(); + + final int size = icm.getMapSize(); + byte[] r = new byte[size]; + byte[] g = new byte[size]; + byte[] b = new byte[size]; + icm.getReds(r); + icm.getGreens(g); + icm.getBlues(b); + + defaultPalette = new byte[size * 3]; + + for (int i = 0; i < size; i++) { + defaultPalette[3 * i + 0] = r[i]; + defaultPalette[3 * i + 1] = g[i]; + defaultPalette[3 * i + 2] = b[i]; + } + } + return defaultPalette; } } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java index 7dac8e4bc55..5ae93b1b685 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java @@ -1368,7 +1368,7 @@ class JFIFMarkerSegment extends MarkerSegment { /** * An APP2 marker segment containing an ICC profile. In the stream * a profile larger than 64K is broken up into a series of chunks. - * This inner class represents the complete profile as a single objec, + * This inner class represents the complete profile as a single object, * combining chunks as necessary. */ class ICCMarkerSegment extends MarkerSegment { diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java index fd8d1cd53c1..f38e30f3ae8 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java @@ -28,6 +28,7 @@ package com.sun.imageio.plugins.jpeg; import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadataNode; import javax.imageio.stream.ImageOutputStream; +import javax.imageio.IIOException; import java.io.IOException; @@ -60,6 +61,10 @@ class MarkerSegment implements Cloneable { length = (buffer.buf[buffer.bufPtr++] & 0xff) << 8; length |= buffer.buf[buffer.bufPtr++] & 0xff; length -= 2; // JPEG length includes itself, we don't + + if (length < 0) { + throw new IIOException("Invalid segment length: " + length); + } buffer.bufAvail -= 3; // Now that we know the true length, ensure that we've got it, // or at least a bufferful if length is too big. diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java index c1359e7b09d..904fa73777c 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java @@ -78,7 +78,7 @@ class SOFMarkerSegment extends MarkerSegment { numLines |= buffer.buf[buffer.bufPtr++] & 0xff; samplesPerLine = (buffer.buf[buffer.bufPtr++] & 0xff) << 8; samplesPerLine |= buffer.buf[buffer.bufPtr++] & 0xff; - int numComponents = buffer.buf[buffer.bufPtr++]; + int numComponents = buffer.buf[buffer.bufPtr++] & 0xff; componentSpecs = new ComponentSpec [numComponents]; for (int i = 0; i < numComponents; i++) { componentSpecs[i] = new ComponentSpec(buffer); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index e2ab9577dc4..abef6740f74 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -688,6 +688,21 @@ public class PNGImageReader extends ImageReader { loop: while (true) { int chunkLength = stream.readInt(); int chunkType = stream.readInt(); + int chunkCRC; + + // verify the chunk length + if (chunkLength < 0) { + throw new IIOException("Invalid chunk lenght " + chunkLength); + }; + + try { + stream.mark(); + stream.seek(stream.getStreamPosition() + chunkLength); + chunkCRC = stream.readInt(); + stream.reset(); + } catch (IOException e) { + throw new IIOException("Invalid chunk length " + chunkLength); + } switch (chunkType) { case IDAT_TYPE: @@ -762,7 +777,11 @@ public class PNGImageReader extends ImageReader { break; } - int chunkCRC = stream.readInt(); + // double check whether all chunk data were consumed + if (chunkCRC != stream.readInt()) { + throw new IIOException("Failed to read a chunk of type " + + chunkType); + } stream.flushBefore(stream.getStreamPosition()); } } catch (IOException e) { @@ -1277,6 +1296,16 @@ public class PNGImageReader extends ImageReader { is = new BufferedInputStream(is); this.pixelStream = new DataInputStream(is); + /* + * NB: the PNG spec declares that valid range for width + * and height is [1, 2^31-1], so here we may fail to allocate + * a buffer for destination image due to memory limitation. + * + * However, the recovery strategy for this case should be + * defined on the level of application, so we will not + * try to estimate the required amount of the memory and/or + * handle OOM in any way. + */ theImage = getDestination(param, getImageTypes(0), width, diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java index be764d09129..367a6ed731b 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java @@ -1041,7 +1041,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements } /** - * Rotates the triangle to accomodate the passed in hue. + * Rotates the triangle to accommodate the passed in hue. */ private void setAngleFromHue(float hue) { setHueAngle((1.0 - hue) * Math.PI * 2); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index 1fe26b09f31..f615fa78fa8 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -304,7 +304,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { table.put("Synth.doNotSetTextAA", true); initResourceBundle(table); - // For compatability with apps expecting certain defaults we'll + // For compatibility with apps expecting certain defaults we'll // populate the table with the values from basic. initSystemColorDefaults(table); initComponentDefaults(table); @@ -332,7 +332,7 @@ public class GTKLookAndFeel extends SynthLookAndFeel { } protected void initComponentDefaults(UIDefaults table) { - // For compatability with apps expecting certain defaults we'll + // For compatibility with apps expecting certain defaults we'll // populate the table with the values from basic. super.initComponentDefaults(table); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java index 751c2d89a3f..20a384483da 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java @@ -131,7 +131,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * Returns a SynthPainter that will route the appropriate * calls to a GTKEngine. * - * @param state SynthContext indentifying requestor + * @param state SynthContext identifying requestor * @return SynthPainter */ @Override @@ -204,7 +204,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Returns the color for the specified state. * - * @param context SynthContext identifying requester + * @param context SynthContext identifying requestor * @param state to get the color for * @param type of the color * @return Color to render with @@ -305,7 +305,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * insets will be placed in it, otherwise a new Insets object will be * created and returned. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param insets Where to place Insets * @return Insets. */ @@ -640,7 +640,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific integer value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -660,7 +660,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific Insets value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -680,7 +680,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { /** * Convenience method to get a class specific Boolean value. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @param key Key identifying class specific value * @param defaultValue Returned if there is no value for the specified * type @@ -702,7 +702,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { * to. A Style should NOT assume the opacity will remain this value, the * developer may reset it or override it. * - * @param context SynthContext indentifying requestor + * @param context SynthContext identifying requestor * @return opaque Whether or not the JComponent is opaque. */ @Override @@ -843,7 +843,7 @@ class GTKStyle extends SynthStyle implements GTKConstants { // Is it another kind of value ? if (key != "engine") { - // For backward compatability we'll fallback to the UIManager. + // For backward compatibility we'll fallback to the UIManager. // We don't go to the UIManager for engine as the engine is GTK // specific. Object value = UIManager.get(key); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties index c4eeded333f..a8985ce605f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties @@ -41,7 +41,7 @@ FileChooser.saveDialogTitle.textAndMnemonic=Speichern FileChooser.openDialogTitle.textAndMnemonic=\u00D6ffnen FileChooser.pathLabel.textAndMnemonic=Aus&wahl: FileChooser.filterLabel.textAndMnemonic=Filter: -FileChooser.foldersLabel.textAndMnemonic=Or&dner +FileChooser.foldersLabel.textAndMnemonic=O&rdner FileChooser.filesLabel.textAndMnemonic=&Dateien FileChooser.cancelButtonToolTip.textAndMnemonic=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java index 31cd9fdb45b..a75a35e1ddd 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java @@ -86,19 +86,19 @@ public class MotifInternalFrameTitlePane protected void assembleSystemMenu() { systemMenu = new JPopupMenu(); - JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction)); - mi.setMnemonic('R'); - mi = systemMenu.add(new JMenuItem(moveAction)); - mi.setMnemonic('M'); - mi = systemMenu.add(new JMenuItem(sizeAction)); - mi.setMnemonic('S'); - mi = systemMenu.add(new JMenuItem(iconifyAction)); - mi.setMnemonic('n'); - mi = systemMenu.add(new JMenuItem(maximizeAction)); - mi.setMnemonic('x'); + JMenuItem mi = systemMenu.add(restoreAction); + mi.setMnemonic(getButtonMnemonic("restore")); + mi = systemMenu.add(moveAction); + mi.setMnemonic(getButtonMnemonic("move")); + mi = systemMenu.add(sizeAction); + mi.setMnemonic(getButtonMnemonic("size")); + mi = systemMenu.add(iconifyAction); + mi.setMnemonic(getButtonMnemonic("minimize")); + mi = systemMenu.add(maximizeAction); + mi.setMnemonic(getButtonMnemonic("maximize")); systemMenu.add(new JSeparator()); - mi = systemMenu.add(new JMenuItem(closeAction)); - mi.setMnemonic('C'); + mi = systemMenu.add(closeAction); + mi.setMnemonic(getButtonMnemonic("close")); systemButton = new SystemButton(); systemButton.addActionListener(new ActionListener() { @@ -124,6 +124,14 @@ public class MotifInternalFrameTitlePane }); } + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } + } protected void createButtons() { minimizeButton = new MinimizeButton(); diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java index 9efb196c537..61090774ccc 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java @@ -45,7 +45,7 @@ public class WindowsGraphicsUtils { /** * Renders a text String in Windows without the mnemonic. - * This is here because the WindowsUI hiearchy doesn't match the Component heirarchy. All + * This is here because the WindowsUI hierarchy doesn't match the Component hierarchy. All * the overriden paintText methods of the ButtonUI delegates will call this static method. *

* @param g Graphics context diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java index 3e5d313436a..3bc26eb46c3 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -174,7 +174,7 @@ public class WindowsIconFactory implements Serializable XPStyle xp = XPStyle.getXP(); if (xp != null) { Skin skin = xp.getSkin(c, part); - JButton b = (JButton)c; + AbstractButton b = (AbstractButton)c; ButtonModel model = b.getModel(); // Find out if frame is inactive diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java index 715f26ced3d..f0ab1667fa8 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java @@ -326,18 +326,27 @@ public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane { protected void addSystemMenuItems(JPopupMenu menu) { JMenuItem mi = menu.add(restoreAction); - mi.setMnemonic('R'); + mi.setMnemonic(getButtonMnemonic("restore")); mi = menu.add(moveAction); - mi.setMnemonic('M'); + mi.setMnemonic(getButtonMnemonic("move")); mi = menu.add(sizeAction); - mi.setMnemonic('S'); + mi.setMnemonic(getButtonMnemonic("size")); mi = menu.add(iconifyAction); - mi.setMnemonic('n'); + mi.setMnemonic(getButtonMnemonic("minimize")); mi = menu.add(maximizeAction); - mi.setMnemonic('x'); - systemPopupMenu.add(new JSeparator()); + mi.setMnemonic(getButtonMnemonic("maximize")); + menu.add(new JSeparator()); mi = menu.add(closeAction); - mi.setMnemonic('C'); + mi.setMnemonic(getButtonMnemonic("close")); + } + + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } } protected void showSystemMenu(){ diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 6213ac1e0c0..20d52c45ddf 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -2012,7 +2012,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel * results. *

* - * @param component Component the error occured in, may be + * @param component Component the error occurred in, may be * null indicating the error condition is * not directly associated with a * Component. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java index 1df612f08e4..b8a4a801074 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java @@ -50,7 +50,7 @@ import sun.swing.DefaultLookup; *
  • The cursor blinks at about 1/2 second intervals. *
  • The entire value is selected when focus is gained. *
  • Shift-left-arrow and shift-right-arrow extend selection - *
  • Cntrl-left-arrow and cntrl-right-arrow act like home and + *
  • Ctrl-left-arrow and ctrl-right-arrow act like home and * end respectively. * *

    diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java index 9d2a7ce4064..516770df43c 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTextUI.java @@ -162,7 +162,7 @@ public abstract class WindowsTextUI extends BasicTextUI { * necessarily the region to paint. * @param c the editor * @param view View painting for - * @return region drawing occured in + * @return region drawing occurred in */ public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view) { diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java index 3f2f430fb84..2c33866e508 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java @@ -190,7 +190,7 @@ class NativeUnpack { copyInOption(Utils.DEBUG_VERBOSE); copyInOption(Pack200.Unpacker.DEFLATE_HINT); - if (modtime == Constants.NO_MODTIME) // Dont pass KEEP && NOW + if (modtime == Constants.NO_MODTIME) // Don't pass KEEP && NOW copyInOption(Utils.UNPACK_MODIFICATION_TIME); updateProgress(); // reset progress bar for (;;) { diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java index a78c9ae9969..bca629f8008 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java @@ -106,7 +106,7 @@ class PackageWriter extends BandStructure { Set requiredEntries; // for the CP Map backCountTable; // for layout callables - int[][] attrCounts; // count attr. occurences + int[][] attrCounts; // count attr. occurrences void setup() { requiredEntries = new HashSet<>(); diff --git a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java index b6e4f0a2bb7..dc46af9ad16 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java @@ -70,7 +70,7 @@ public interface ListeningConnector extends Connector { * method). *

    * If arguments contains addressing information. and - * only one conection will be accepted, the {@link #accept accept} method + * only one connection will be accepted, the {@link #accept accept} method * can be called immediately without calling this method. * * @return the address at which the connector is listening diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java index 297d3e25116..c3f410e718c 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java @@ -250,7 +250,7 @@ public abstract class TransportService { * * @param address * The address to start listening for connections, - * or null to listen on an address choosen + * or null to listen on an address chosen * by the transport service. * * @return a listen key to be used in subsequent calls to be @@ -266,7 +266,7 @@ public abstract class TransportService { public abstract ListenKey startListening(String address) throws IOException; /** - * Listens on an address choosen by the transport service. + * Listens on an address chosen by the transport service. * *

    This convenience method works as if by invoking {@link * #startListening(String) startListening(null)}.

    diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index c5e00005b87..b6286e5d1c9 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -1291,7 +1291,7 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { * ambiguous set. If this set itself corresponds to a constructor, * there is no ambiguity for that pair. In the usual case, one * of the constructors is a superset of the other so the union is - * just the bigger constuctor. + * just the bigger constructor. * * The algorithm here is quadratic in the number of constructors * with a @ConstructorProperties annotation. Typically this corresponds diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java index 0e08177d7f2..06cc19d2894 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java @@ -644,7 +644,7 @@ public class Introspector { /** * Returns the list of "getter" methods for the given class. The list * is ordered so that isXXX methods appear before getXXX methods - this - * is for compatability with the JavaBeans Introspector. + * is for compatibility with the JavaBeans Introspector. */ static List getReadMethods(Class clazz) { // return cached result if available @@ -682,7 +682,7 @@ public class Introspector { * {@code null} if no method is found. */ static Method getReadMethod(Class clazz, String property) { - // first character in uppercase (compatability with JavaBeans) + // first character in uppercase (compatibility with JavaBeans) property = property.substring(0, 1).toUpperCase(Locale.ENGLISH) + property.substring(1); String getMethod = GET_METHOD_PREFIX + property; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java index 75786ffb1b4..d4c67d4e91b 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java @@ -35,7 +35,7 @@ class TokenMgrError extends Error */ /** - * Lexical error occured. + * Lexical error occurred. */ static final int LEXICAL_ERROR = 0; @@ -114,10 +114,10 @@ class TokenMgrError extends Error * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error - * curLexState : lexical state in which this error occured - * errorLine : line number when the error occured - * errorColumn : column number when the error occured - * errorAfter : prefix that was seen before this error occured + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java index 9ec7f7cd520..76af600386a 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/SnmpString.java @@ -130,7 +130,7 @@ public class SnmpString extends SnmpValue { * @return The value. */ public byte[] byteValue() { - return value ; + return value.clone() ; } /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java index ffa64b2f524..5d9b3e54cc4 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java @@ -70,7 +70,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * @param server The MBean server to register the service with. * @param name The object name. * - * @return The passed name paramter. + * @return The passed name parameter. * * @exception java.lang.Exception */ @@ -99,7 +99,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -147,7 +147,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be set. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -165,7 +165,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variables to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override @@ -190,7 +190,7 @@ public class SnmpErrorHandlerAgent extends SnmpMibAgent * * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java index df7587404ef..ac9c4bbd54f 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java @@ -476,8 +476,7 @@ public abstract class SnmpMib extends SnmpMibAgent implements Serializable { rootOid[i++]= val.longValue(); } } - return rootOid; - + return rootOid.clone(); } // -------------------------------------------------------------------- diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java index 451fa859df4..86892ee34d9 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java @@ -127,7 +127,7 @@ public abstract class SnmpMibAgent * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void get(SnmpMibRequest req) @@ -142,7 +142,7 @@ public abstract class SnmpMibAgent * OIDs from which the next variables should be retrieved. * This list is composed of SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void getNext(SnmpMibRequest req) @@ -166,7 +166,7 @@ public abstract class SnmpMibAgent * following the first nonRepeat variables for which * multiple lexicographic successors are requested. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ @Override public abstract void getBulk(SnmpMibRequest req, int nonRepeat, @@ -184,7 +184,7 @@ public abstract class SnmpMibAgent * be set. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * Throwing an exception in this method will break the * atomicity of the SET operation. Care must be taken so that * the exception is thrown in the {@link #check(SnmpMibRequest)} @@ -643,7 +643,7 @@ public abstract class SnmpMibAgent * * @return The variable list containing returned values. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. */ void getBulkWithGetNext(SnmpMibRequest req, int nonRepeat, int maxRepeat) throws SnmpStatusException { diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java index b057823dc6f..9f48879ac7c 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java @@ -62,7 +62,7 @@ public interface SnmpMibAgentMBean { * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#get(SnmpMibRequest) */ public void get(SnmpMibRequest req) throws SnmpStatusException; @@ -75,7 +75,7 @@ public interface SnmpMibAgentMBean { * be retrieved. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#getNext(SnmpMibRequest) */ public void getNext(SnmpMibRequest req) throws SnmpStatusException; @@ -97,7 +97,7 @@ public interface SnmpMibAgentMBean { * following the first nonRepeat variables for which * multiple lexicographic successors are requested. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#getBulk(SnmpMibRequest,int,int) */ public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat) @@ -111,7 +111,7 @@ public interface SnmpMibAgentMBean { * be set. This list is composed of * SnmpVarBind objects. * - * @exception SnmpStatusException An error occured during the operation. + * @exception SnmpStatusException An error occurred during the operation. * @see SnmpMibAgent#set(SnmpMibRequest) */ public void set(SnmpMibRequest req) throws SnmpStatusException; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java index 29882ce01d4..6050de77d70 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java @@ -119,7 +119,7 @@ public abstract class SnmpMibGroup extends SnmpMibOid // needed... // For instance, the subclass could provide a generated isNestedArc() // method in which the subgroup OID arcs would be hardcoded. - // However, the generic approach was prefered because at this time + // However, the generic approach was preferred because at this time // groups and subgroups are dynamically registered in the MIB. // /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java index e0282c6cec0..2edcbde2a40 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java @@ -435,7 +435,7 @@ public abstract class SnmpMibTable extends SnmpMibNode * If the entry is going to be registered, or if ObjectName's are * required, then * {@link com.sun.jmx.snmp.agent.SnmpMibTable#addEntry(SnmpOid, - * ObjectName, Object)} should be prefered. + * ObjectName, Object)} should be preferred. *
    This function is mainly provided for backward compatibility. * *

    @@ -1088,7 +1088,7 @@ public abstract class SnmpMibTable extends SnmpMibNode * @return true if the row can be placed in * notInService state. * - * @exception SnmpStatusException An error occured while trying + * @exception SnmpStatusException An error occurred while trying * to retrieve the row status, and the operation should * be aborted. * @@ -2444,7 +2444,7 @@ public abstract class SnmpMibTable extends SnmpMibNode l1+1,l2); } else if (pos < tablecount) { - // Vector is large enough to accomodate one additional + // Vector is large enough to accommodate one additional // entry. // // Shift vector, making an empty room at `pos' diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java index dbcca12d9ef..bfe2e0fee55 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java @@ -581,7 +581,7 @@ final class SnmpRequestTree { } else if (pos < entrycount) { - // Vectors are large enough to accomodate one additional + // Vectors are large enough to accommodate one additional // entry. // // Shift vectors, making an empty room at `pos' diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java index 8a015ce7c18..950bbce17e1 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java @@ -480,7 +480,7 @@ public abstract class SnmpTableSupport implements SnmpTableEntryFactory, * associated SnmpIndex. *

    * If the entry is going to be registered, then - * {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be prefered. + * {@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be preferred. *
    This function is mainly provided for backward compatibility. * * @param index The SnmpIndex built from the given entry. diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java index b2634d8eee1..b0828e21be9 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java @@ -1248,7 +1248,7 @@ public abstract class CommunicatorServer "of this CommunicatorServer instance has changed."); } - return notifInfos; + return notifInfos.clone(); } /** diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java index 1b42ed4f043..325daa5b990 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java @@ -473,7 +473,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean { * @param specific The specific number of the trap. * @param varBindList A list of SnmpVarBind instances or null. * - * @exception IOException An I/O error occured while sending the trap. + * @exception IOException An I/O error occurred while sending the trap. * @exception SnmpStatusException If the trap exceeds the limit defined by bufferSize. */ public void snmpV1Trap(int generic, int specific, SnmpVarBindList varBindList) throws IOException, SnmpStatusException; @@ -563,7 +563,7 @@ public interface SnmpAdaptorServerMBean extends CommunicatorServerMBean { * @param trapOid The OID identifying the trap. * @param varBindList A list of SnmpVarBind instances or null. * - * @exception IOException An I/O error occured while sending the trap. + * @exception IOException An I/O error occurred while sending the trap. * @exception SnmpStatusException If the trap exceeds the limit defined by bufferSize. */ public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList) throws IOException, SnmpStatusException; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java index 0b60e802270..3fea8fe08ca 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java @@ -559,7 +559,7 @@ class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions { // SnmpPduPacket result= executeSubRequest(req,userData); if (result != null) - // It means that an error occured. The error is already + // It means that an error occurred. The error is already // formatted by the executeSubRequest // method. return result; diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java index 2754975082f..6dc479f242c 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java @@ -52,7 +52,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler { private SnmpAdaptorServer server = null; /** - * The constuctor initialize the subrequest with the whole varbind list contained + * The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ protected SnmpSubBulkRequestHandler(SnmpEngine engine, @@ -68,7 +68,7 @@ class SnmpSubBulkRequestHandler extends SnmpSubRequestHandler { } /** - * The constuctor initialize the subrequest with the whole varbind list contained + * The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ protected SnmpSubBulkRequestHandler(SnmpAdaptorServer server, diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java index bb4dd0bfd3b..3ff95f6a001 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java @@ -55,7 +55,7 @@ import com.sun.jmx.snmp.ThreadContext; class SnmpSubNextRequestHandler extends SnmpSubRequestHandler { private SnmpAdaptorServer server = null; /** - * The constuctor initialize the subrequest with the whole varbind + * The constructor initialize the subrequest with the whole varbind * list contained in the original request. */ protected SnmpSubNextRequestHandler(SnmpAdaptorServer server, diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java index 04f4ca67443..0b981311358 100644 --- a/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java +++ b/jdk/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java @@ -99,7 +99,7 @@ class SnmpSubRequestHandler implements SnmpDefinitions, Runnable { } /** - * SNMP V1/V2 The constuctor initialize the subrequest with the whole varbind list contained + * SNMP V1/V2 The constructor initialize the subrequest with the whole varbind list contained * in the original request. */ @SuppressWarnings("unchecked") // cast to NonSyncVector diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java index 0d96af74a9c..9a220b6cd89 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java @@ -568,7 +568,7 @@ public final class Connection implements Runnable { //System.err.println("ldap.abandon: " + ex); } - // Dont expect any response for the abandon request. + // Don't expect any response for the abandon request. } synchronized void abandonOutstandingReqs(Control[] reqCtls) { @@ -623,7 +623,7 @@ public final class Connection implements Runnable { //System.err.println("ldap.unbind: " + ex); } - // Dont expect any response for the unbind request. + // Don't expect any response for the unbind request. } /** diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java index 0eb1caa420c..994586c3d78 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java @@ -191,7 +191,7 @@ final class Filter { /** * convert character 'c' that represents a hexadecimal digit to an integer. - * if 'c' is not a hexidecimal digit [0-9A-Fa-f], -1 is returned. + * if 'c' is not a hexadecimal digit [0-9A-Fa-f], -1 is returned. * otherwise the converted value is returned. */ private static int hexchar2int( byte c ) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java index b861ea0300c..989f39be600 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -176,7 +176,7 @@ final public class LdapCtx extends ComponentDirContext "com.sun.jndi.ldap.netscape.schemaBugs"; // deprecated private static final String OLD_NETSCAPE_SCHEMA_BUG = - "com.sun.naming.netscape.schemaBugs"; // for backward compatability + "com.sun.naming.netscape.schemaBugs"; // for backward compatibility // Timeout for socket connect private static final String CONNECT_TIMEOUT = diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java index 5e2ec66a0da..a2f528b2056 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java @@ -862,7 +862,7 @@ public final class LdapName implements Name { --end; } - // Add back the trailing whitespace with a preceeding '\' + // Add back the trailing whitespace with a preceding '\' // (escaped or unescaped) that was taken off in the above // loop. Whether or not to retain this whitespace is // decided below. @@ -918,7 +918,7 @@ public final class LdapName implements Name { } // Get rid of the unescaped trailing whitespace with the - // preceeding '\' character that was previously added back. + // preceding '\' character that was previously added back. int len = buf.length(); if (isWhitespace(buf.charAt(len - 1)) && esc != (end - 1)) { buf.setLength(len - 1); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java index 17d1cf08c2f..13b5daa602e 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java @@ -109,7 +109,7 @@ public abstract class PartialCompositeContext implements Context, Resolver { /** * A cheap way of getting the environment. - * Default implemenation is NOT cheap because it simply calls + * Default implementation is NOT cheap because it simply calls * getEnvironment(), which most implementations clone before returning. * Subclass should ALWAYS override this with the cheapest possible way. * The toolkit knows to clone when necessary. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java index ac6eb40fdcd..d88a7e214e9 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java @@ -82,7 +82,7 @@ public class ContextEnumerator implements NamingEnumeration { return ctx.listBindings(""); } - // Subclass should overrride so that instance is of same type as subclass + // Subclass should override so that instance is of same type as subclass protected ContextEnumerator newEnumerator(Context ctx, int scope, String contextName, boolean returnSelf) throws NamingException { return new ContextEnumerator(ctx, scope, contextName, returnSelf); diff --git a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java index 104af874ea5..874be7ddb05 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -106,7 +106,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice return info; } - /** Open the device from an aplication program. + /** Open the device from an application program. * Setting the open reference count to -1 here prevents Transmitters and Receivers that * opened the the device implicitly from closing it. The only way to close the device after * this call is a call to close(). diff --git a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java index 93d425e862c..5a96effbbe8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileReader.java @@ -51,15 +51,6 @@ public final class AiffFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 8; - /** - * Constructs a new AiffParser object. - */ - public AiffFileReader() { - } - - - - // METHODS TO IMPLEMENT AudioFileReader /** @@ -292,9 +283,15 @@ public final class AiffFileReader extends SunFileReader { throw new UnsupportedAudioFileException("Invalid AIFF/COMM chunksize"); } // Read header info. - int channels = dis.readShort(); - dis.readInt(); - int sampleSizeInBits = dis.readShort(); + int channels = dis.readUnsignedShort(); + if (channels <= 0) { + throw new UnsupportedAudioFileException("Invalid number of channels"); + } + dis.readInt(); // numSampleFrames + int sampleSizeInBits = dis.readUnsignedShort(); + if (sampleSizeInBits < 1 || sampleSizeInBits > 32) { + throw new UnsupportedAudioFileException("Invalid AIFF/COMM sampleSize"); + } float sampleRate = (float) read_ieee_extended(dis); chunkRead += (2 + 4 + 2 + 10); @@ -438,7 +435,4 @@ public final class AiffFileReader extends SunFileReader { return f; } - - - } diff --git a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java index d755d516efd..a12e461c95d 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/AuFileReader.java @@ -49,13 +49,6 @@ import javax.sound.sampled.UnsupportedAudioFileException; */ public final class AuFileReader extends SunFileReader { - /** - * Constructs a new AuFileReader object. - */ - public AuFileReader() { - } - - // METHODS TO IMPLEMENT AudioFileReader /** @@ -90,7 +83,7 @@ public final class AuFileReader extends SunFileReader { int frameRate = -1; int frameSize = -1; int channels = -1; - int sampleSizeInBits = 0; + final int sampleSizeInBits; int length = 0; int nread = 0; AudioFormat.Encoding encoding = null; @@ -118,6 +111,10 @@ public final class AuFileReader extends SunFileReader { encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; + if (channels <= 0) { + dis.reset(); + throw new UnsupportedAudioFileException("Invalid number of channels"); + } frameRate = sampleRate; @@ -372,7 +369,4 @@ public final class AuFileReader extends SunFileReader { return result; } - - - } diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index 9a3ef9970ca..d4305523526 100644 --- a/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -34,7 +34,7 @@ public final class AudioSynthesizerPropertyInfo { /** * Constructs a AudioSynthesizerPropertyInfo object with a given * name and value. The description and choices - * are intialized by null values. + * are initialized by null values. * * @param name the name of the property * @param value the current value or class used for values. diff --git a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java index d6556f65f80..698bac9f766 100644 --- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java +++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java @@ -378,7 +378,7 @@ final class DirectAudioDevice extends AbstractMixer { protected final boolean isSource; // true for SourceDataLine, false for TargetDataLine protected volatile long bytePosition; protected volatile boolean doIO = false; // true in between start() and stop() calls - protected volatile boolean stoppedWritten = false; // true if a write occured in stopped state + protected volatile boolean stoppedWritten = false; // true if a write occurred in stopped state protected volatile boolean drained = false; // set to true when drain function returns, set to false in write() protected boolean monitoring = false; @@ -642,7 +642,7 @@ final class DirectAudioDevice extends AbstractMixer { public void drain() { noService = true; // additional safeguard against draining forever - // this occured on Solaris 8 x86, probably due to a bug + // this occurred on Solaris 8 x86, probably due to a bug // in the audio driver int counter = 0; long startPos = getLongFramePosition(); diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java index d827770a514..962b4d2537b 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java @@ -37,7 +37,7 @@ import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; /** - * SourceDataLine implemention for the SoftMixingMixer. + * SourceDataLine implementation for the SoftMixingMixer. * * @author Karl Helgason */ diff --git a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java index 9ba6a6b8740..3599fdfab52 100644 --- a/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java +++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileReader.java @@ -52,13 +52,6 @@ public final class WaveFileReader extends SunFileReader { private static final int MAX_READ_LENGTH = 12; - /** - * Constructs a new WaveFileReader object. - */ - public WaveFileReader() { - } - - /** * Obtains the audio file format of the input stream provided. The stream must * point to valid audio file data. In general, audio file providers may @@ -304,6 +297,9 @@ public final class WaveFileReader extends SunFileReader { } // channels channels = rlshort(dis); nread += 2; + if (channels <= 0) { + throw new UnsupportedAudioFileException("Invalid number of channels"); + } // sample rate. sampleRate = rllong(dis); nread += 4; @@ -316,6 +312,9 @@ public final class WaveFileReader extends SunFileReader { // this is the PCM-specific value bitsPerSample sampleSizeInBits = (int)rlshort(dis); nread += 2; + if (sampleSizeInBits <= 0) { + throw new UnsupportedAudioFileException("Invalid bitsPerSample"); + } // if sampleSizeInBits==8, we need to use PCM_UNSIGNED if ((sampleSizeInBits==8) && encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) @@ -373,5 +372,4 @@ public final class WaveFileReader extends SunFileReader { format, dataLength / format.getFrameSize()); } - } diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java index c33e250d32b..7d07d42e8d0 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java @@ -33,7 +33,7 @@ import java.util.*; * {@link java.lang.String},{@link java.util.List}<{@link java.lang.String}>>. * The keys are case-insensitive Strings representing the header names and * the value associated with each key is a {@link List}<{@link String}> with one - * element for each occurence of the header name in the request or response. + * element for each occurrence of the header name in the request or response. *

    * For example, if a response header instance contains one key "HeaderName" with two values "value1 and value2" * then this object is output as two header lines: diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java index 2ceacf764ae..f976ac2040e 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -170,7 +170,7 @@ public abstract class HttpExchange { * then no response body is being sent. *

    * If the content-length response header has not already been set then - * this is set to the apropriate value depending on the response length parameter. + * this is set to the appropriate value depending on the response length parameter. *

    * This method must be called prior to calling {@link #getResponseBody()}. * @param rCode the response code to send diff --git a/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java index b1a08ce6f59..765c2322f1d 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java +++ b/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/Provider.java @@ -41,7 +41,7 @@ public final class Provider extends SunJSSE { super(); } - // prefered constructor to enable FIPS mode at runtime + // preferred constructor to enable FIPS mode at runtime public Provider(java.security.Provider cryptoProvider) { super(cryptoProvider); } diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java index 05c3cdc76cd..3f64cb3a41d 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionMethod.java @@ -110,7 +110,7 @@ public interface EncryptionMethod { * Returns an iterator over all the additional elements contained in the * EncryptionMethod. * - * @return an Iterator over all the additional infomation + * @return an Iterator over all the additional information * about the EncryptionMethod. */ Iterator getEncryptionMethodInformation(); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java index ece475c983d..ec0e2880ff3 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java @@ -63,7 +63,7 @@ import org.w3c.dom.Text; * * This includes: * - * Constuct a ds:Reference from an {@link org.w3c.dom.Element}. + * Constructs a ds:Reference from an {@link org.w3c.dom.Element}. * *

    Create a new reference

    *
    diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    index 490f184c57f..bb7cc03778c 100644
    --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java
    @@ -846,7 +846,7 @@ public final class XMLSignature extends SignatureElementProxy {
         }
     
         /**
    -     * Signal wether Manifest should be automatically validated.
    +     * Signal whether Manifest should be automatically validated.
          * Checking the digests in References in a Signature are mandatory, but for
          * References inside a Manifest it is application specific. This boolean is
          * to indicate that the References inside Manifests should be validated.
    diff --git a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
    index af0c988b5d1..7a7f693022d 100644
    --- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
    +++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
    @@ -41,7 +41,7 @@ import com.sun.rowset.providers.*;
     /**
      * The standard implementation of the CachedRowSet interface.
      *
    - * See interface defintion for full behaviour and implementation requirements.
    + * See interface definition for full behavior and implementation requirements.
      * This reference implementation has made provision for a one-to-one write back
      * facility and it is curremtly be possible to change the peristence provider
      * during the life-time of any CachedRowSetImpl.
    @@ -119,14 +119,14 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
         private Vector rvh;
     
         /**
    -     * The current postion of the cursor in this CachedRowSetImpl
    +     * The current position of the cursor in this CachedRowSetImpl
          * object.
          * @serial
          */
         private int cursorPos;
     
         /**
    -     * The current postion of the cursor in this CachedRowSetImpl
    +     * The current position of the cursor in this CachedRowSetImpl
          * object not counting rows that have been deleted, if any.
          * 

    * For example, suppose that the cursor is on the last row of a rowset @@ -236,7 +236,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern private int startPos; /** - * The integer value indicating the positon from where the page prior to this + * The integer value indicating the position from where the page prior to this * was populated. */ private int startPrev; @@ -3730,7 +3730,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern /* * Each call to internalPrevious may move the cursor - * over multiple rows, the absolute postion moves one one row + * over multiple rows, the absolute position moves one one row */ if (ret == true) --absolutePos; @@ -6265,7 +6265,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern /** * Returns a result set containing the original value of the rowset. The * original value is the state of the CachedRowSetImpl after the - * last population or synchronization (whichever occured most recently) with + * last population or synchronization (whichever occurred most recently) with * the data source. *

    * The cursor is positioned before the first row in the result set. @@ -6300,7 +6300,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern * Returns a result set containing the original value of the current * row only. * The original value is the state of the CachedRowSetImpl after - * the last population or synchronization (whichever occured most recently) + * the last population or synchronization (whichever occurred most recently) * with the data source. * * @return the original result set of the row @@ -9061,7 +9061,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR value * (depending on the argument's @@ -9081,7 +9081,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR * @param parameterName the name of the column to be set @@ -9421,7 +9421,7 @@ a * if parameterIndex does not correspond * to a parameter marker in the SQL statement, if the length specified * is less than zero or if the number of bytes in the inputstream does not match - * the specfied length. + * the specified length. * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method * * @since 1.6 @@ -9481,7 +9481,7 @@ a * @throws SQLException if parameterIndex does not correspond * to a parameter marker in the SQL statement, or if the length specified * is less than zero; if the number of bytes in the inputstream does not match - * the specfied length; if a database access error occurs or + * the specified length; if a database access error occurs or * this method is called on a closed CallableStatement * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method diff --git a/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java index eeda4b7e326..1e60fe8acef 100644 --- a/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java @@ -39,7 +39,7 @@ import com.sun.rowset.internal.*; /** * The standard implementation of the FilteredRowSet interface. See the interface - * defintion for full behaviour and implementation requirements. + * definition for full behavior and implementation requirements. * * @see javax.sql.rowset.Predicate * @author Jonathan Bruce, Amit Handa diff --git a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java index 8302c2922c0..45df1b8495e 100644 --- a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java @@ -36,7 +36,7 @@ import javax.sql.rowset.*; /** * The standard implementation of the JdbcRowSet interface. See the interface - * defintion for full behavior and implementation requirements. + * definition for full behavior and implementation requirements. * * @author Jonathan Bruce, Amit Handa */ @@ -67,7 +67,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { private ResultSet rs; /** - * The RowSetMetaDataImpl object that is contructed when + * The RowSetMetaDataImpl object that is constructed when * a ResultSet object is passed to the JdbcRowSet * constructor. This helps in constructing all metadata associated * with the ResultSet object using the setter methods of @@ -3152,7 +3152,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { * DatabaseMetaData method, this method returns * null. * - * @return the Statment object that produced + * @return the Statement object that produced * this rowset's ResultSet object or null * if the result set was produced some other way * @throws SQLException if a database access error occurs @@ -4748,7 +4748,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable { /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR value * (depending on the argument's @@ -5883,7 +5883,7 @@ a /** - * Sets the designated paramter to the given String object. + * Sets the designated parameter to the given String object. * The driver converts this to a SQL NCHAR or * NVARCHAR or LONGNVARCHAR * @param parameterName the name of the column to be set @@ -6222,7 +6222,7 @@ a * if parameterIndex does not correspond * to a parameter marker in the SQL statement, if the length specified * is less than zero or if the number of bytes in the inputstream does not match - * the specfied length. + * the specified length. * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method * * @since 1.6 @@ -6283,7 +6283,7 @@ a * @throws SQLException if parameterIndex does not correspond * to a parameter marker in the SQL statement, or if the length specified * is less than zero; if the number of bytes in the inputstream does not match - * the specfied length; if a database access error occurs or + * the specified length; if a database access error occurs or * this method is called on a closed CallableStatement * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method diff --git a/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java index a7afd4af563..a2d2c438d45 100644 --- a/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/WebRowSetImpl.java @@ -42,7 +42,7 @@ import com.sun.rowset.internal.*; /** * The standard implementation of the WebRowSet interface. See the interface - * defintion for full behaviour and implementation requirements. + * definition for full behavior and implementation requirements. * * @author Jonathan Bruce, Amit Handa */ diff --git a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java index b237150a701..c78e87415a0 100644 --- a/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java +++ b/jdk/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java @@ -4109,7 +4109,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { /** * Returns a result set containing the original value of the rowset. The * original value is the state of the CachedRowSetImpl after the - * last population or synchronization (whichever occured most recently) with + * last population or synchronization (whichever occurred most recently) with * the data source. *

    * The cursor is positioned before the first row in the result set. @@ -4128,7 +4128,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver { * Returns a result set containing the original value of the current * row only. * The original value is the state of the CachedRowSetImpl after - * the last population or synchronization (whichever occured most recently) + * the last population or synchronization (whichever occurred most recently) * with the data source. * * @return the original result set of the row diff --git a/jdk/src/share/classes/com/sun/rowset/package.html b/jdk/src/share/classes/com/sun/rowset/package.html index ca33ecafeb1..abd21b8b9ab 100644 --- a/jdk/src/share/classes/com/sun/rowset/package.html +++ b/jdk/src/share/classes/com/sun/rowset/package.html @@ -74,7 +74,7 @@ can with to other components of the Java platform.

    3.0 Extending the JDBC RowSet Implementations

    The JDBC RowSet reference implementations are provided as non-final -classess so that any developer can extend them to provider additional features +classes so that any developer can extend them to provide additional features while maintaining the core required standard functionality and compatibility. It is anticipated that many vendors and developers will extend the standard feature set to their their particular needs. The website for JDBC Technology will diff --git a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java index 24c7571effe..e2acedecfbc 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java @@ -153,7 +153,7 @@ import com.sun.security.auth.UserPrincipal; * If the attribute cannot be found then the option is ignored. * When this option is supplied and the user has been successfully * authenticated then an additional {@link UserPrincipal} - * is created using the authorization identity and it is assocated with + * is created using the authorization identity and it is associated with * the current {@link Subject}. * *
    useSSL
    diff --git a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java index 3370de962ec..3b645854b1b 100644 --- a/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java +++ b/jdk/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java @@ -62,7 +62,7 @@ import javax.security.sasl.*; * LMv2: NTLM v2, LM only * NTLMv2: NTLM v2, NTLM only * If not specified, use system property "ntlm.version". If also - * not specfied, all versions are accepted. + * not specified, all versions are accepted. * * com.sun.security.sasl.ntlm.domain * String, the domain of the server, default is server name (fqdn parameter) diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties index 722d302ef8e..4a8d160c02c 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties @@ -144,12 +144,12 @@ InternalFrame.restoreButtonToolTip=Restore InternalFrame.closeButtonToolTip=Close ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore -InternalFrameTitlePane.moveButton.textAndMnemonic=Move -InternalFrameTitlePane.sizeButton.textAndMnemonic=Size -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize -InternalFrameTitlePane.closeButton.textAndMnemonic=Close +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restore +InternalFrameTitlePane.moveButton.textAndMnemonic=&Move +InternalFrameTitlePane.sizeButton.textAndMnemonic=&Size +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimize +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximize +InternalFrameTitlePane.closeButton.textAndMnemonic=&Close ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties index 1affb2fe589..823abc43130 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Wiederherstellen InternalFrame.closeButtonToolTip=Schlie\u00DFen ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Wiederherstellen -InternalFrameTitlePane.moveButton.textAndMnemonic=Verschieben -InternalFrameTitlePane.sizeButton.textAndMnemonic=Gr\u00F6\u00DFe -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimieren -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximieren -InternalFrameTitlePane.closeButton.textAndMnemonic=Schlie\u00DFen +InternalFrameTitlePane.restoreButton.textAndMnemonic=Wiede&rherstellen +InternalFrameTitlePane.moveButton.textAndMnemonic=Verschieben(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Gr\u00F6\u00DFe(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimieren +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximieren +InternalFrameTitlePane.closeButton.textAndMnemonic=S&chlie\u00DFen ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties index 2de493e00f6..08c77828759 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurar InternalFrame.closeButtonToolTip=Cerrar ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurar -InternalFrameTitlePane.moveButton.textAndMnemonic=Mover -InternalFrameTitlePane.sizeButton.textAndMnemonic=Tama\u00F1o -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimizar -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximizar -InternalFrameTitlePane.closeButton.textAndMnemonic=Cerrar +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurar +InternalFrameTitlePane.moveButton.textAndMnemonic=&Mover +InternalFrameTitlePane.sizeButton.textAndMnemonic=Tama\u00F1o(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimizar +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximizar +InternalFrameTitlePane.closeButton.textAndMnemonic=&Cerrar ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties index f57feca66b0..902db71f44c 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurer InternalFrame.closeButtonToolTip=Fermer ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurer -InternalFrameTitlePane.moveButton.textAndMnemonic=D\u00E9placer -InternalFrameTitlePane.sizeButton.textAndMnemonic=Taille -InternalFrameTitlePane.minimizeButton.textAndMnemonic=R\u00E9duire -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Agrandir -InternalFrameTitlePane.closeButton.textAndMnemonic=Fermer +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurer +InternalFrameTitlePane.moveButton.textAndMnemonic=D\u00E9placer(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Taille(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=R\u00E9duire(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Agrandir(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=Fermer(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties index 243cf6af566..310d08f7779 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Ripristina InternalFrame.closeButtonToolTip=Chiudi ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Ripristina -InternalFrameTitlePane.moveButton.textAndMnemonic=Sposta -InternalFrameTitlePane.sizeButton.textAndMnemonic=Dimensioni -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Riduci a icona -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ingrandisci -InternalFrameTitlePane.closeButton.textAndMnemonic=Chiudi +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Ripristina +InternalFrameTitlePane.moveButton.textAndMnemonic=Sposta(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=Dimen&sioni +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Riduci a ico&na +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ingrandisci(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=&Chiudi ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties index d8adf8cce82..c5314fa25a9 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u5FA9\u5143 InternalFrame.closeButtonToolTip=\u9589\u3058\u308B ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u5143 -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u30B5\u30A4\u30BA -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u9589\u3058\u308B +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u5143(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u30B5\u30A4\u30BA(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u9589\u3058\u308B(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties index a8504f7872c..7f313031ba2 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\uBCF5\uC6D0 InternalFrame.closeButtonToolTip=\uB2EB\uAE30 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\uBCF5\uC6D0 -InternalFrameTitlePane.moveButton.textAndMnemonic=\uC774\uB3D9 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\uD06C\uAE30 -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\uCD5C\uC18C\uD654 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\uCD5C\uB300\uD654 -InternalFrameTitlePane.closeButton.textAndMnemonic=\uB2EB\uAE30 +InternalFrameTitlePane.restoreButton.textAndMnemonic=\uBCF5\uC6D0(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\uC774\uB3D9(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\uD06C\uAE30(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\uCD5C\uC18C\uD654(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\uCD5C\uB300\uD654(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\uB2EB\uAE30(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties index 61b4e122c9d..4f86d4c748e 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=Restaurar InternalFrame.closeButtonToolTip=Fechar ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=Restaurar -InternalFrameTitlePane.moveButton.textAndMnemonic=Mover -InternalFrameTitlePane.sizeButton.textAndMnemonic=Tamanho -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimizar -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximizar -InternalFrameTitlePane.closeButton.textAndMnemonic=Fechar +InternalFrameTitlePane.restoreButton.textAndMnemonic=&Restaurar +InternalFrameTitlePane.moveButton.textAndMnemonic=&Mover +InternalFrameTitlePane.sizeButton.textAndMnemonic=Tamanho(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimizar +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximizar +InternalFrameTitlePane.closeButton.textAndMnemonic=Fe&char ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties index 2d40e3c849b..27f2498ffd8 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u00C5terst\u00E4ll InternalFrame.closeButtonToolTip=St\u00E4ng ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u00C5terst\u00E4ll -InternalFrameTitlePane.moveButton.textAndMnemonic=Flytta -InternalFrameTitlePane.sizeButton.textAndMnemonic=Storlek -InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimera -InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximera -InternalFrameTitlePane.closeButton.textAndMnemonic=St\u00E4ng +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u00C5terst\u00E4ll(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=Flytta(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=&Storlek +InternalFrameTitlePane.minimizeButton.textAndMnemonic=Mi&nimera +InternalFrameTitlePane.maximizeButton.textAndMnemonic=Ma&ximera +InternalFrameTitlePane.closeButton.textAndMnemonic=St\u00E4ng(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties index 4db5d181ff3..d4c357281f4 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u8FD8\u539F InternalFrame.closeButtonToolTip=\u5173\u95ED ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u8FD8\u539F -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52A8 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u5173\u95ED +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u8FD8\u539F(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52A8(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u5173\u95ED(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties index 8112751e397..c26b7a15b4f 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties @@ -143,12 +143,12 @@ InternalFrame.restoreButtonToolTip=\u5FA9\u539F InternalFrame.closeButtonToolTip=\u95DC\u9589 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u539F -InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5 -InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F -InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316 -InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButton.textAndMnemonic=\u95DC\u9589 +InternalFrameTitlePane.restoreButton.textAndMnemonic=\u5FA9\u539F(&R) +InternalFrameTitlePane.moveButton.textAndMnemonic=\u79FB\u52D5(&M) +InternalFrameTitlePane.sizeButton.textAndMnemonic=\u5927\u5C0F(&S) +InternalFrameTitlePane.minimizeButton.textAndMnemonic=\u6700\u5C0F\u5316(&N) +InternalFrameTitlePane.maximizeButton.textAndMnemonic=\u6700\u5927\u5316(&X) +InternalFrameTitlePane.closeButton.textAndMnemonic=\u95DC\u9589(&C) ############ Text strings ############# # Used for html forms diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java index d63c3bdc6d3..1ab2a5be894 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java @@ -44,7 +44,7 @@ public class TokenMgrError extends Error private static final long serialVersionUID = -6236440836177601522L; /** - * Lexical error occured. + * Lexical error occurred. */ static final int LEXICAL_ERROR = 0; @@ -123,10 +123,10 @@ public class TokenMgrError extends Error * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error - * curLexState : lexical state in which this error occured - * errorLine : line number when the error occured - * errorColumn : column number when the error occured - * errorAfter : prefix that was seen before this error occured + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ diff --git a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js index ec15e15acd6..97e38a79342 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js +++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js @@ -33,7 +33,7 @@ var hatPkg = Packages.com.sun.tools.hat.internal; /** * This is JavaScript interface for heap analysis using HAT - * (Heap Analysis Tool). HAT classes are refered from + * (Heap Analysis Tool). HAT classes are referred from * this file. In particular, refer to classes in hat.model * package. * diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java index 992dacdf018..36f5be2fec1 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketAttachingConnector.java @@ -68,7 +68,7 @@ public class SocketAttachingConnector extends GenericAttachingConnector { transport = new Transport() { public String name() { - return "dt_socket"; // for compatability reasons + return "dt_socket"; // for compatibility reasons } }; diff --git a/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java index acfda94d0c6..7931dd9ff72 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/SocketListeningConnector.java @@ -58,7 +58,7 @@ public class SocketListeningConnector extends GenericListeningConnector { transport = new Transport() { public String name() { - return "dt_socket"; // for compatability reasons + return "dt_socket"; // for compatibility reasons } }; } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java index 787539e04bc..d50c8051dad 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadListener.java @@ -31,7 +31,7 @@ import java.util.EventListener; interface ThreadListener extends EventListener { boolean threadResumable(ThreadAction action); /* - * Not needed for current implemenation, and hard to implement + * Not needed for current implementation, and hard to implement * correctly. (See TargetVM.handleEventCmdSet) * void threadSuspended(ThreadAction action); */ diff --git a/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java index f469827e8d4..5826999458d 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/ThreadReferenceImpl.java @@ -62,7 +62,7 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl // This is cached only while this one thread is suspended. Each time // the thread is resumed, we abandon the current cache object and - // create a new intialized one. + // create a new initialized one. private static class LocalCache { JDWP.ThreadReference.Status status = null; List frames = null; diff --git a/jdk/src/share/classes/java/awt/AWTEventMulticaster.java b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java index a5daab688dc..4fc6d52c8c7 100644 --- a/jdk/src/share/classes/java/awt/AWTEventMulticaster.java +++ b/jdk/src/share/classes/java/awt/AWTEventMulticaster.java @@ -998,7 +998,7 @@ public class AWTEventMulticaster implements * If a null listener is specified, this method returns an * empty array. If the specified listener is not an instance of * AWTEventMulticaster, this method returns an array which - * contains only the specified listener. If no such listeners are chanined, + * contains only the specified listener. If no such listeners are chained, * this method returns an empty array. * * @param l the specified java.util.EventListener diff --git a/jdk/src/share/classes/java/awt/AlphaComposite.java b/jdk/src/share/classes/java/awt/AlphaComposite.java index 6903e7ec712..9f8b64f2684 100644 --- a/jdk/src/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/share/classes/java/awt/AlphaComposite.java @@ -197,7 +197,7 @@ import sun.java2d.SunCompositeContext; *

    Performance Considerations

    * *

    - * For performance reasons, it is preferrable that + * For performance reasons, it is preferable that * Raster objects passed to the compose * method of a {@link CompositeContext} object created by the * AlphaComposite class have premultiplied data. diff --git a/jdk/src/share/classes/java/awt/BasicStroke.java b/jdk/src/share/classes/java/awt/BasicStroke.java index 55d59d4224f..5cc466640c2 100644 --- a/jdk/src/share/classes/java/awt/BasicStroke.java +++ b/jdk/src/share/classes/java/awt/BasicStroke.java @@ -88,7 +88,7 @@ import java.lang.annotation.Native; * but also by the transform attribute of the * Graphics2D object. Consider this code: *

    - * // sets the Graphics2D object's Tranform attribute + * // sets the Graphics2D object's Transform attribute * g2d.scale(10, 10); * // sets the Graphics2D object's Stroke attribute * g2d.setStroke(new BasicStroke(1.5f)); diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java index 98bd4d5a9cd..8b131c485d3 100644 --- a/jdk/src/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/share/classes/java/awt/BorderLayout.java @@ -69,7 +69,7 @@ import java.util.Hashtable; * components, the latter constants are preferred. *

    * Mixing both absolute and relative positioning constants can lead to - * unpredicable results. If + * unpredictable results. If * you use both types, the relative constants will take precedence. * For example, if you add components using both the NORTH * and PAGE_START constants in a container whose @@ -206,7 +206,7 @@ public class BorderLayout implements LayoutManager2, * * A relative positioning constant, that can be used instead of * north, south, east, west or center. - * mixing the two types of constants can lead to unpredicable results. If + * mixing the two types of constants can lead to unpredictable results. If * you use both types, the relative constants will take precedence. * For example, if you add components using both the NORTH * and BEFORE_FIRST_LINE constants in a container whose diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java index 4da887ee242..20265c7ad12 100644 --- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java @@ -180,7 +180,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access } /** - * Sets this check box menu item to the specifed state. + * Sets this check box menu item to the specified state. * The boolean value true indicates "on" while * false indicates "off." * diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java index e74bd094fb6..b50746205d9 100644 --- a/jdk/src/share/classes/java/awt/Choice.java +++ b/jdk/src/share/classes/java/awt/Choice.java @@ -418,7 +418,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * an ItemEvent. The only way to trigger an * ItemEvent is by user interaction. * - * @param pos the positon of the selected item + * @param pos the position of the selected item * @exception IllegalArgumentException if the specified * position is greater than the * number of items or less than zero diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index f7e2fbdba05..bd913cbd50e 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -276,7 +276,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @see #getFont * @see #setFont */ - Font font; + volatile Font font; /** * The font which the peer is currently using. @@ -1885,10 +1885,8 @@ public abstract class Component implements ImageObserver, MenuContainer, public void setFont(Font f) { Font oldFont, newFont; synchronized(getTreeLock()) { - synchronized (this) { - oldFont = font; - newFont = font = f; - } + oldFont = font; + newFont = font = f; ComponentPeer peer = this.peer; if (peer != null) { f = getFont(); @@ -2684,7 +2682,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the mininimum size of this component. + * Gets the minimum size of this component. * @return a dimension object indicating this component's minimum size * @see #getPreferredSize * @see LayoutManager @@ -5254,7 +5252,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the component listeners * registered on this component. * - * @return all of this comonent's ComponentListeners + * @return all ComponentListeners of this component * or an empty array if no component * listeners are currently registered * diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java index 82b682db78e..a779d72d489 100644 --- a/jdk/src/share/classes/java/awt/Container.java +++ b/jdk/src/share/classes/java/awt/Container.java @@ -959,7 +959,7 @@ public class Container extends Component { * * @param comp the component to be added * @param constraints an object expressing - * layout contraints for this component + * layout constraints for this component * @exception NullPointerException if {@code comp} is {@code null} * @see #addImpl * @see #invalidate @@ -986,7 +986,7 @@ public class Container extends Component { * * * @param comp the component to be added - * @param constraints an object expressing layout contraints for this + * @param constraints an object expressing layout constraints for this * @param index the position in the container's list at which to insert * the component; -1 means insert at the end * component diff --git a/jdk/src/share/classes/java/awt/Dialog.java b/jdk/src/share/classes/java/awt/Dialog.java index a2248f033d7..b441100d9f2 100644 --- a/jdk/src/share/classes/java/awt/Dialog.java +++ b/jdk/src/share/classes/java/awt/Dialog.java @@ -338,7 +338,7 @@ public class Dialog extends Window { * * @param owner the owner of the dialog or null if * this dialog has no owner - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -387,7 +387,7 @@ public class Dialog extends Window { * this dialog has no owner * @param title the title of the dialog or null if this dialog * has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -416,7 +416,7 @@ public class Dialog extends Window { * has no owner * @param title the title of the dialog or null if this dialog * has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -488,7 +488,7 @@ public class Dialog extends Window { * dialog has no owner * @param title the title of the dialog or null if this * dialog has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -519,7 +519,7 @@ public class Dialog extends Window { * dialog has no owner * @param title the title of the dialog or null if this * dialog has no title - * @param modal specifes whether dialog blocks user input to other top-level + * @param modal specifies whether dialog blocks user input to other top-level * windows when shown. If false, the dialog is MODELESS; * if true, the modality type property is set to * DEFAULT_MODALITY_TYPE @@ -764,7 +764,7 @@ public class Dialog extends Window { /** * Indicates whether the dialog is modal. *

    - * This method is obsolete and is kept for backwards compatiblity only. + * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * * @return true if this dialog window is modal; diff --git a/jdk/src/share/classes/java/awt/Event.java b/jdk/src/share/classes/java/awt/Event.java index 2bc5c31b235..b2a2e6b3f60 100644 --- a/jdk/src/share/classes/java/awt/Event.java +++ b/jdk/src/share/classes/java/awt/Event.java @@ -29,14 +29,14 @@ import java.io.*; /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Event is a platform-independent class that * encapsulates events from the platform's Graphical User * Interface in the Java 1.0 event model. In Java 1.1 * and later versions, the Event class is maintained - * only for backwards compatibilty. The information in this + * only for backwards compatibility. The information in this * class description is provided to assist programmers in * converting Java 1.0 programs to the new event model. *

    @@ -390,7 +390,7 @@ public class Event implements java.io.Serializable { /** * The user has moved the bubble (thumb) in a scroll bar, * moving to an "absolute" position, rather than to - * an offset from the last postion. + * an offset from the last position. */ public static final int SCROLL_ABSOLUTE = 5 + SCROLL_EVENT; @@ -609,7 +609,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event with the specified target @@ -660,7 +660,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event, with the specified target @@ -681,7 +681,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Creates an instance of Event with the specified @@ -696,7 +696,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Translates this event so that its x and y @@ -717,7 +717,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Shift key is down. @@ -733,7 +733,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Control key is down. @@ -749,7 +749,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Checks if the Meta key is down. @@ -766,7 +766,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. */ void consume() { @@ -784,7 +784,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. */ boolean isConsumed() { @@ -793,7 +793,7 @@ public class Event implements java.io.Serializable { /* * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns the integer key-code associated with the key in this event, @@ -811,7 +811,7 @@ public class Event implements java.io.Serializable { /* * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a new KeyEvent char which corresponds to the int key @@ -828,7 +828,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a string representing the state of this Event. @@ -864,7 +864,7 @@ public class Event implements java.io.Serializable { /** * NOTE: The Event class is obsolete and is - * available only for backwards compatilibility. It has been replaced + * available only for backwards compatibility. It has been replaced * by the AWTEvent class and its subclasses. *

    * Returns a representation of this event's values as a string. diff --git a/jdk/src/share/classes/java/awt/EventDispatchThread.java b/jdk/src/share/classes/java/awt/EventDispatchThread.java index ab1d3e6f70a..51344658c7e 100644 --- a/jdk/src/share/classes/java/awt/EventDispatchThread.java +++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,19 +25,11 @@ package java.awt; -import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.ActionEvent; import java.awt.event.WindowEvent; -import java.lang.reflect.Method; -import java.security.AccessController; -import sun.security.action.GetPropertyAction; -import sun.awt.AWTAutoShutdown; -import sun.awt.SunToolkit; -import sun.awt.AppContext; import java.util.ArrayList; -import java.util.List; import sun.util.logging.PlatformLogger; import sun.awt.dnd.SunDragSourceContextPeer; @@ -67,8 +59,7 @@ class EventDispatchThread extends Thread { private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventDispatchThread"); private EventQueue theQueue; - private boolean doDispatch = true; - private volatile boolean shutdown = false; + private volatile boolean doDispatch = true; private static final int ANY_EVENT = -1; @@ -86,24 +77,15 @@ class EventDispatchThread extends Thread { doDispatch = false; } - public void interrupt() { - shutdown = true; - super.interrupt(); - } - public void run() { - while (true) { - try { - pumpEvents(new Conditional() { - public boolean evaluate() { - return true; - } - }); - } finally { - if(getEventQueue().detachDispatchThread(this, shutdown)) { - break; + try { + pumpEvents(new Conditional() { + public boolean evaluate() { + return true; } - } + }); + } finally { + getEventQueue().detachDispatchThread(this); } } @@ -130,8 +112,7 @@ class EventDispatchThread extends Thread { void pumpEventsForFilter(int id, Conditional cond, EventFilter filter) { addEventFilter(filter); doDispatch = true; - shutdown |= isInterrupted(); - while (doDispatch && !shutdown && cond.evaluate()) { + while (doDispatch && !isInterrupted() && cond.evaluate()) { pumpOneEventForFilters(id); } removeEventFilter(filter); @@ -223,12 +204,12 @@ class EventDispatchThread extends Thread { } } catch (ThreadDeath death) { - shutdown = true; + doDispatch = false; throw death; } catch (InterruptedException interruptedException) { - shutdown = true; // AppContext.dispose() interrupts all - // Threads in the AppContext + doDispatch = false; // AppContext.dispose() interrupts all + // Threads in the AppContext } catch (Throwable e) { processException(e); diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index d6a1dabfc72..af9e1bf08f3 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1074,7 +1074,7 @@ public class EventQueue { } } - final boolean detachDispatchThread(EventDispatchThread edt, boolean forceDetach) { + final void detachDispatchThread(EventDispatchThread edt) { /* * Minimize discard possibility for non-posted events */ @@ -1090,17 +1090,9 @@ public class EventQueue { pushPopLock.lock(); try { if (edt == dispatchThread) { - /* - * Don't detach the thread if any events are pending. Not - * sure if it's a possible scenario, though. - */ - if (!forceDetach && (peekEvent() != null)) { - return false; - } dispatchThread = null; } AWTAutoShutdown.getInstance().notifyThreadFree(edt); - return true; } finally { pushPopLock.unlock(); } @@ -1159,6 +1151,10 @@ public class EventQueue { if (entry.event instanceof SentEvent) { ((SentEvent)entry.event).dispose(); } + if (entry.event instanceof InvocationEvent) { + AWTAccessor.getInvocationEventAccessor() + .dispose((InvocationEvent)entry.event); + } if (prev == null) { queues[i].head = entry.next; } else { diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 3908b075c15..c5c400c651b 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -1334,7 +1334,7 @@ public class Font implements java.io.Serializable * Indicates whether or not this Font object's style is * PLAIN. * @return true if this Font has a - * PLAIN sytle; + * PLAIN style; * false otherwise. * @see java.awt.Font#getStyle * @since JDK1.0 diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index abd4b8cc50d..3e2dcb55008 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -105,7 +105,7 @@ public abstract class Graphics { /** * Constructs a new Graphics object. - * This constructor is the default contructor for a graphics + * This constructor is the default constructor for a graphics * context. *

    * Since Graphics is an abstract class, applications diff --git a/jdk/src/share/classes/java/awt/Graphics2D.java b/jdk/src/share/classes/java/awt/Graphics2D.java index f83bde71a36..c8bb23def69 100644 --- a/jdk/src/share/classes/java/awt/Graphics2D.java +++ b/jdk/src/share/classes/java/awt/Graphics2D.java @@ -305,7 +305,7 @@ import java.util.Map; * aliasing or antialiasing is being used. *

      *
    • Device coordinates are defined to be between device pixels which - * avoids any inconsistent results between aliased and antaliased + * avoids any inconsistent results between aliased and antialiased * rendering. If coordinates were defined to be at a pixel's center, some * of the pixels covered by a shape, such as a rectangle, would only be * half covered. @@ -806,7 +806,7 @@ public abstract class Graphics2D extends Graphics { * @param s the Shape to check for a hit * @param onStroke flag used to choose between testing the * stroked or the filled shape. If the flag is true, the - * Stroke oultine is tested. If the flag is + * Stroke outline is tested. If the flag is * false, the filled Shape is tested. * @return true if there is a hit; false * otherwise. @@ -1162,7 +1162,7 @@ public abstract class Graphics2D extends Graphics { * Component. To change the background * of the Component, use appropriate methods of * the Component. - * @param color the background color that isused in + * @param color the background color that is used in * subsequent calls to clearRect * @see #getBackground * @see java.awt.Graphics#clearRect diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java index 5e3901a0dd3..3c9d4178bd6 100644 --- a/jdk/src/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java @@ -162,7 +162,7 @@ public abstract class GraphicsDevice { * GraphicsEnvironment. Although there is * no public method to set this String, a programmer can * use the String for debugging purposes. Vendors of - * the JavaTM Runtime Environment can + * the Java™ Runtime Environment can * format the return value of the String. To determine * how to interpret the value of the String, contact the * vendor of your Java Runtime. To find out who the vendor is, from @@ -325,7 +325,14 @@ public abstract class GraphicsDevice { // Note that we use the graphics configuration of the device, // not the window's, because we're setting the fs window for // this device. - Rectangle screenBounds = getDefaultConfiguration().getBounds(); + final GraphicsConfiguration gc = getDefaultConfiguration(); + final Rectangle screenBounds = gc.getBounds(); + if (SunToolkit.isDispatchThreadForAppContext(fullScreenWindow)) { + // Update graphics configuration here directly and do not wait + // asynchronous notification from the peer. Note that + // setBounds() will reset a GC, if it was set incorrectly. + fullScreenWindow.setGraphicsConfiguration(gc); + } fullScreenWindow.setBounds(screenBounds.x, screenBounds.y, screenBounds.width, screenBounds.height); fullScreenWindow.setVisible(true); diff --git a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java index 9e1da05e35f..8a655ba99b8 100644 --- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java @@ -263,7 +263,7 @@ public abstract class GraphicsEnvironment { * available in this GraphicsEnvironment. Typical usage * would be to allow a user to select a particular font. Then, the * application can size the font and set various font attributes by - * calling the deriveFont method on the choosen instance. + * calling the deriveFont method on the chosen instance. *

      * This method provides for the application the most precise control * over which Font instance is used to render text. diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java index 1362e57dd76..8ac290a7a42 100644 --- a/jdk/src/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/share/classes/java/awt/GridBagLayout.java @@ -125,9 +125,9 @@ import java.util.Arrays; *

      * - * - * - * + * + * + * * * *

      Absolute Values

      Orientation Relative Values

      Baseline Relative Values

      Absolute Values

      Orientation Relative Values

      Baseline Relative Values

      @@ -255,10 +255,10 @@ import java.util.Arrays; *
      * * * * * @@ -366,7 +366,7 @@ java.io.Serializable { static final int EMPIRICMULTIPLIER = 2; /** - * This field is no longer used to reserve arrays and keeped for backward + * This field is no longer used to reserve arrays and kept for backward * compatibility. Previously, this was * the maximum number of grid positions (both horizontal and * vertical) that could be laid out by the grid bag layout. @@ -444,7 +444,7 @@ java.io.Serializable { * applied to the gridbag after all of the minimum row * heights have been calculated. * If rowHeights has more elements than the number of - * rows, rowa are added to the gridbag to match + * rows, rows are added to the gridbag to match * the number of elements in rowHeights. * * @serial @@ -533,7 +533,7 @@ java.io.Serializable { * and returns null. * * @param comp the component to be queried - * @return the contraints for the specified component + * @return the constraints for the specified component */ protected GridBagConstraints lookupConstraints(Component comp) { GridBagConstraints constraints = comptable.get(comp); @@ -800,7 +800,7 @@ java.io.Serializable { /** * Lays out the specified container using this grid bag layout. * This method reshapes components in the specified container in - * order to satisfy the contraints of this GridBagLayout + * order to satisfy the constraints of this GridBagLayout * object. *

      * Most applications do not call this method directly. @@ -897,7 +897,7 @@ java.io.Serializable { *

        *
      1. Figure out the dimensions of the layout grid. *
      2. Determine which cells the components occupy. - *
      3. Distribute the weights and min sizes amoung the rows/columns. + *
      4. Distribute the weights and min sizes among the rows/columns. *
      * * This also caches the minsizes for all the children when they are @@ -979,7 +979,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #getLayoutInfo(java.awt.Container, int) getLayoutInfo} instead. * This method is the same as getLayoutInfo; * refer to getLayoutInfo for details on parameters @@ -1612,7 +1612,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) * adjustForGravity} instead. * This method is the same as adjustForGravity; @@ -1993,7 +1993,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. * This method is the same as getMinSize; * refer to getMinSize for details on parameters @@ -2033,7 +2033,7 @@ java.io.Serializable { /** * This method is obsolete and supplied for backwards - * compatability only; new code should call {@link + * compatibility only; new code should call {@link * #arrangeGrid(Container) arrangeGrid} instead. * This method is the same as arrangeGrid; * refer to arrangeGrid for details on the @@ -2229,6 +2229,6 @@ java.io.Serializable { } } - // Added for serial backwards compatability (4348425) + // Added for serial backwards compatibility (4348425) static final long serialVersionUID = 8838754796412211005L; } diff --git a/jdk/src/share/classes/java/awt/KeyEventDispatcher.java b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java index 6d2215e2359..9970ac586e3 100644 --- a/jdk/src/share/classes/java/awt/KeyEventDispatcher.java +++ b/jdk/src/share/classes/java/awt/KeyEventDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,6 +51,7 @@ import java.awt.event.KeyEvent; * @see KeyboardFocusManager#removeKeyEventDispatcher * @since 1.4 */ +@FunctionalInterface public interface KeyEventDispatcher { /** diff --git a/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java index 12440aa1f95..5a36b9536b1 100644 --- a/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java +++ b/jdk/src/share/classes/java/awt/KeyEventPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,6 +54,7 @@ import java.awt.event.KeyEvent; * @see KeyboardFocusManager#removeKeyEventPostProcessor * @since 1.4 */ +@FunctionalInterface public interface KeyEventPostProcessor { /** diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index 8f869fa19c4..0184083ec5c 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -2663,7 +2663,7 @@ public abstract class KeyboardFocusManager * only if we have the last request to dispatch. If the last request * fails, focus will be restored to either the component of the last * previously succedded request, or to to the focus owner that was - * before this clearing proccess. + * before this clearing process. */ if (!iter.hasNext()) { disableRestoreFocus = false; diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaint.java b/jdk/src/share/classes/java/awt/LinearGradientPaint.java index e9fbcfc5d86..f4af6026da2 100644 --- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java +++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java @@ -94,7 +94,8 @@ import java.beans.ConstructorProperties; * of the three cycle methods: *

      *

      - * LinearGradientPaint + * image showing the output of the example code *
      * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java index dba6ac0bcdf..b3be9aeaf2e 100644 --- a/jdk/src/share/classes/java/awt/List.java +++ b/jdk/src/share/classes/java/awt/List.java @@ -797,7 +797,7 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Gets the minumum dimensions for a list with the specified + * Gets the minimum dimensions for a list with the specified * number of rows. * @param rows number of rows in the list * @return the minimum dimensions for displaying this scrolling list @@ -1164,7 +1164,7 @@ public class List extends Component implements ItemSelectable, Accessible { /* * Serialization support. Since the value of the selected - * field isn't neccessarily up to date we sync it up with the + * field isn't necessarily up to date, we sync it up with the * peer before serializing. */ diff --git a/jdk/src/share/classes/java/awt/MediaTracker.java b/jdk/src/share/classes/java/awt/MediaTracker.java index 9b8ba3cfb23..23ec3577274 100644 --- a/jdk/src/share/classes/java/awt/MediaTracker.java +++ b/jdk/src/share/classes/java/awt/MediaTracker.java @@ -744,7 +744,7 @@ public class MediaTracker implements java.io.Serializable { * All instances of Image being tracked * under the specified ID are removed regardless of scale. * @param image the image to be removed - * @param id the tracking ID frrom which to remove the image + * @param id the tracking ID from which to remove the image * @see java.awt.MediaTracker#removeImage(java.awt.Image) * @see java.awt.MediaTracker#removeImage(java.awt.Image, int, int, int) * @since JDK1.1 diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java index 4895fdc9548..8718821daaa 100644 --- a/jdk/src/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/share/classes/java/awt/MenuComponent.java @@ -402,7 +402,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets this component's locking object (the object that owns the thread - * sychronization monitor) for AWT component-tree and layout + * synchronization monitor) for AWT component-tree and layout * operations. * @return this component's locking object */ @@ -686,7 +686,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the Cursor of this object. * - * @return the Curso, if supported, of the object; + * @return the Cursor, if supported, of the object; * otherwise, null */ public Cursor getCursor() { diff --git a/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java index edf6bd8267b..cdff1907d95 100644 --- a/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java +++ b/jdk/src/share/classes/java/awt/MultipleGradientPaintContext.java @@ -81,7 +81,7 @@ abstract class MultipleGradientPaintContext implements PaintContext { protected float a00, a01, a10, a11, a02, a12; /** - * This boolean specifies wether we are in simple lookup mode, where an + * This boolean specifies whether we are in simple lookup mode, where an * input value between 0 and 1 may be used to directly index into a single * array of gradient colors. If this boolean value is false, then we have * to use a 2-step process where we have to determine which gradient array diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java index 08a545b78bc..5e649da6d76 100644 --- a/jdk/src/share/classes/java/awt/Polygon.java +++ b/jdk/src/share/classes/java/awt/Polygon.java @@ -246,7 +246,7 @@ public class Polygon implements Shape, java.io.Serializable { } /* - * Resizes the bounding box to accomodate the specified coordinates. + * Resizes the bounding box to accommodate the specified coordinates. * @param x, y the specified coordinates */ void updateBounds(int x, int y) { diff --git a/jdk/src/share/classes/java/awt/PopupMenu.java b/jdk/src/share/classes/java/awt/PopupMenu.java index 0e700638240..70ece5970ed 100644 --- a/jdk/src/share/classes/java/awt/PopupMenu.java +++ b/jdk/src/share/classes/java/awt/PopupMenu.java @@ -150,7 +150,7 @@ public class PopupMenu extends Menu { * @exception IllegalArgumentException if this PopupMenu * has a non-Component parent * @exception IllegalArgumentException if the origin is not in the - * parent's heirarchy + * parent's hierarchy * @exception RuntimeException if the parent is not showing on screen */ public void show(Component origin, int x, int y) { diff --git a/jdk/src/share/classes/java/awt/RadialGradientPaint.java b/jdk/src/share/classes/java/awt/RadialGradientPaint.java index a0bf944b93c..5fd08734f14 100644 --- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java +++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java @@ -80,14 +80,16 @@ import java.beans.ConstructorProperties; * from the focus point. The following figure shows that the distance AB * is equal to the distance BC, and the distance AD is equal to the distance DE. *
      - * RadialGradientPaint-3 + * image showing the
+ * distance AB=BC, and AD=DE *
      * If the gradient and graphics rendering transforms are uniformly scaled and * the user sets the focus so that it coincides with the center of the circle, * the gradient color proportions are equal for any line drawn from the center. * The following figure shows the distances AB, BC, AD, and DE. They are all equal. *
      - * RadialGradientPaint-4 + * image showing the
+ * distance of AB, BC, AD, and DE are all equal *
      * Note that some minor variations in distances may occur due to sampling at * the granularity of a pixel. @@ -117,7 +119,8 @@ import java.beans.ConstructorProperties; * (centered) focus for each of the three cycle methods: *

      *

      - * RadialGradientPaint-1 + * image showing the
+ * output of the sameple code *
      * *

      @@ -141,7 +144,8 @@ import java.beans.ConstructorProperties; * focus for each of the three cycle methods: *

      *

      - * RadialGradientPaint-2 + * image showing the
+ * output of the sample code *
      * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/RenderingHints.java b/jdk/src/share/classes/java/awt/RenderingHints.java index 48cf9e11d32..42386797055 100644 --- a/jdk/src/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/share/classes/java/awt/RenderingHints.java @@ -101,7 +101,7 @@ public class RenderingHints // - the integer key of the Key // It is theoretically possible for 2 distinct keys to collide // along all 3 of those attributes in the context of multiple - // class loaders, but that occurence will be extremely rare and + // class loaders, but that occurrence will be extremely rare and // we account for that possibility below in the recordIdentity // method by slightly relaxing our uniqueness guarantees if we // end up in that situation. @@ -729,7 +729,7 @@ public class RenderingHints * from one side of a sample to the other. * As the image is scaled down, more image pixels have their * color samples represented in the resulting output since each - * output pixel recieves color information from up to 4 image + * output pixel receives color information from up to 4 image * pixels. * * @see #KEY_INTERPOLATION diff --git a/jdk/src/share/classes/java/awt/ScrollPane.java b/jdk/src/share/classes/java/awt/ScrollPane.java index a2e2fc7ee0a..626fed6c0b1 100644 --- a/jdk/src/share/classes/java/awt/ScrollPane.java +++ b/jdk/src/share/classes/java/awt/ScrollPane.java @@ -425,8 +425,8 @@ public class ScrollPane extends Container implements Accessible { /** * Determine the size to allocate the child component. - * If the viewport area is bigger than the childs - * preferred size then the child is allocated enough + * If the viewport area is bigger than the preferred size + * of the child then the child is allocated enough * to fill the viewport, otherwise the child is given * it's preferred size. */ diff --git a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java index d51a84250c8..be3ad5fec6a 100644 --- a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java +++ b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java @@ -336,7 +336,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * the AdjustementEvent with specified type and value. * * @param v the new value of the scrollbar - * @param type the type of the scrolling operation occured + * @param type the type of the scrolling operation occurred */ private void setTypedValue(int v, int type) { v = Math.max(v, minimum); diff --git a/jdk/src/share/classes/java/awt/Shape.java b/jdk/src/share/classes/java/awt/Shape.java index e478ea7f3d8..8015d4593de 100644 --- a/jdk/src/share/classes/java/awt/Shape.java +++ b/jdk/src/share/classes/java/awt/Shape.java @@ -269,7 +269,7 @@ public interface Shape { * Tests if the interior of the Shape entirely contains * the specified rectangular area. All coordinates that lie inside * the rectangular area must lie within the Shape for the - * entire rectanglar area to be considered contained within the + * entire rectangular area to be considered contained within the * Shape. *

      * The {@code Shape.contains()} method allows a {@code Shape} diff --git a/jdk/src/share/classes/java/awt/TextComponent.java b/jdk/src/share/classes/java/awt/TextComponent.java index 331b20f70cc..4b72de8d638 100644 --- a/jdk/src/share/classes/java/awt/TextComponent.java +++ b/jdk/src/share/classes/java/awt/TextComponent.java @@ -1000,7 +1000,7 @@ public class TextComponent extends Component implements Accessible { * Return 0 if the text is empty, or the caret position * if no selection. * - * @return the index into teh text of the end of the selection >= 0 + * @return the index into the text of the end of the selection >= 0 */ public int getSelectionEnd() { return TextComponent.this.getSelectionEnd(); diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java index cfdaf51e213..85eaba2d17b 100644 --- a/jdk/src/share/classes/java/awt/TextField.java +++ b/jdk/src/share/classes/java/awt/TextField.java @@ -405,7 +405,7 @@ public class TextField extends TextComponent { } /** - * Gets the minumum dimensions for a text field with + * Gets the minimum dimensions for a text field with * the specified number of columns. * @param columns the number of columns in * this text field. @@ -430,7 +430,7 @@ public class TextField extends TextComponent { } /** - * Gets the minumum dimensions for this text field. + * Gets the minimum dimensions for this text field. * @return the minimum dimensions for * displaying this text field. * @since JDK1.1 diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index 606df3ed154..dcc1fa15b4e 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -1457,7 +1457,7 @@ public abstract class Toolkit { *

      Note that multi-frame images are invalid and may cause this * method to hang. * - * @param cursor the image to display when the cursor is actived + * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by * getBestCursorSize @@ -1809,8 +1809,7 @@ public abstract class Toolkit { // This property should never be cached if (propertyName.equals("awt.dynamicLayoutSupported")) { - value = lazilyLoadDesktopProperty(propertyName); - return value; + return getDefaultToolkit().lazilyLoadDesktopProperty(propertyName); } value = desktopProperties.get(propertyName); diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 6f66395169b..ceb901a3c4b 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -1656,7 +1656,7 @@ public class Window extends Container implements Accessible { * effect until it is hidden and then shown again. * * @param exclusionType the modal exclusion type for this window; a {@code null} - * value is equivivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE + * value is equivalent to {@link Dialog.ModalExclusionType#NO_EXCLUDE * NO_EXCLUDE} * @throws SecurityException if the calling thread does not have permission * to set the modal exclusion property to the window with the given @@ -2079,7 +2079,7 @@ public class Window extends Container implements Accessible { } /** - * Processes window focus event occuring on this window by + * Processes window focus event occurring on this window by * dispatching them to any registered WindowFocusListener objects. * NOTE: this method will not be called unless window focus events * are enabled for this window. This happens when one of the @@ -2114,7 +2114,7 @@ public class Window extends Container implements Accessible { } /** - * Processes window state event occuring on this window by + * Processes window state event occurring on this window by * dispatching them to any registered {@code WindowStateListener} * objects. * NOTE: this method will not be called unless window state events @@ -2191,13 +2191,11 @@ public class Window extends Container implements Accessible { * When the window is later shown, it will be always-on-top. * *

      When this method is called on a window with a value of - * {@code false} the always-on-top state is set to normal. The - * window remains in the top-most position but it`s z-order can be - * changed as for any other window. Calling this method with a value - * of {@code false} on a window that has a normal state has no - * effect. Setting the always-on-top state to false has no effect on - * the relative z-order of the windows if there are no other - * always-on-top windows. + * {@code false} the always-on-top state is set to normal. It may also + * cause an unspecified, platform-dependent change in the z-order of + * top-level windows, but other always-on-top windows will remain in + * top-most position. Calling this method with a value of {@code false} + * on a window that has a normal state has no effect. * *

      Note: some platforms might not support always-on-top * windows. To detect if always-on-top windows are supported by the @@ -2978,11 +2976,11 @@ public class Window extends Container implements Accessible { addToWindowList(); initGC(null); + ownedWindowList = new Vector<>(); } private void deserializeResources(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException { - ownedWindowList = new Vector<>(); if (windowSerializedDataVersion < 2) { // Translate old-style focus tracking to new model. For 1.4 and @@ -3678,7 +3676,7 @@ public class Window extends Container implements Accessible { * and either the {@code UnsupportedOperationException} or {@code * IllegalComponentStateException} will be thrown. *

      - * The tranlucency levels of individual pixels may also be effected by the + * The translucency levels of individual pixels may also be effected by the * alpha component of their color (see {@link Window#setBackground(Color)}) and the * opacity value (see {@link #setOpacity(float)}). See {@link * GraphicsDevice.WindowTranslucency} for more details. @@ -3749,7 +3747,7 @@ public class Window extends Container implements Accessible { *

      * If the windowing system supports the {@link * GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT} - * tranclucency, the alpha component of the given background color + * translucency, the alpha component of the given background color * may effect the mode of operation for this window: it indicates whether * this window must be opaque (alpha equals {@code 1.0f}) or per-pixel translucent * (alpha is less than {@code 1.0f}). If the given background color is diff --git a/jdk/src/share/classes/java/awt/color/package.html b/jdk/src/share/classes/java/awt/color/package.html index 8b82f8e59eb..13ab17419a3 100644 --- a/jdk/src/share/classes/java/awt/color/package.html +++ b/jdk/src/share/classes/java/awt/color/package.html @@ -25,6 +25,7 @@ + Provides classes for color spaces. It contains an diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index 86ac95cb172..90789edc97c 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -104,7 +104,7 @@ import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION; public class DataFlavor implements Externalizable, Cloneable { private static final long serialVersionUID = 8367026044764648243L; - private static final Class ioInputStreamClass = java.io.InputStream.class; + private static final Class ioInputStreamClass = InputStream.class; /** * Tries to load a class from: the bootstrap loader, the system loader, @@ -151,7 +151,7 @@ public class DataFlavor implements Externalizable, Cloneable { /* * private initializer */ - static private DataFlavor createConstant(Class rc, String prn) { + static private DataFlavor createConstant(Class rc, String prn) { try { return new DataFlavor(rc, prn); } catch (Exception e) { @@ -323,7 +323,7 @@ public class DataFlavor implements Externalizable, Cloneable { * @exception NullPointerException if either primaryType, * subType or representationClass is null */ - private DataFlavor(String primaryType, String subType, MimeTypeParameterList params, Class representationClass, String humanPresentableName) { + private DataFlavor(String primaryType, String subType, MimeTypeParameterList params, Class representationClass, String humanPresentableName) { super(); if (primaryType == null) { throw new NullPointerException("primaryType"); @@ -340,7 +340,7 @@ public class DataFlavor implements Externalizable, Cloneable { params.set("class", representationClass.getName()); if (humanPresentableName == null) { - humanPresentableName = (String)params.get("humanPresentableName"); + humanPresentableName = params.get("humanPresentableName"); if (humanPresentableName == null) humanPresentableName = primaryType + "/" + subType; @@ -741,7 +741,7 @@ public class DataFlavor implements Externalizable, Cloneable { return bestFlavor; } - private static Comparator textFlavorComparator; + private static Comparator textFlavorComparator; static class TextFlavorComparator extends DataTransferer.DataFlavorComparator { @@ -1447,6 +1447,6 @@ public class DataFlavor implements Externalizable, Cloneable { /** Java class of objects this DataFlavor represents **/ - private Class representationClass; + private Class representationClass; } // class DataFlavor diff --git a/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java index e5041073401..6bfbd510fce 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/FlavorMap.java @@ -30,7 +30,7 @@ import java.util.Map; /** * A two-way Map between "natives" (Strings), which correspond to platform- - * specfic data formats, and "flavors" (DataFlavors), which corerspond to + * specific data formats, and "flavors" (DataFlavors), which correspond to * platform-independent MIME types. FlavorMaps need not be symmetric, but * typically are. * diff --git a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java index 80947d9ea6f..2ef30747632 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java +++ b/jdk/src/share/classes/java/awt/datatransfer/MimeTypeParameterList.java @@ -33,7 +33,7 @@ import java.util.Set; /** - * An object that encapsualtes the parameter list of a MimeType + * An object that encapsulates the parameter list of a MimeType * as defined in RFC 2045 and 2046. * * @author jeff.dunn@eng.sun.com @@ -44,13 +44,13 @@ class MimeTypeParameterList implements Cloneable { * Default constructor. */ public MimeTypeParameterList() { - parameters = new Hashtable(); + parameters = new Hashtable<>(); } public MimeTypeParameterList(String rawdata) throws MimeTypeParseException { - parameters = new Hashtable(); + parameters = new Hashtable<>(); // now parse rawdata parse(rawdata); @@ -59,10 +59,10 @@ class MimeTypeParameterList implements Cloneable { public int hashCode() { int code = Integer.MAX_VALUE/45; // "random" value for empty lists String paramName = null; - Enumeration enum_ = this.getNames(); + Enumeration enum_ = this.getNames(); while (enum_.hasMoreElements()) { - paramName = (String)enum_.nextElement(); + paramName = enum_.nextElement(); code += paramName.hashCode(); code += this.get(paramName).hashCode(); } @@ -87,14 +87,14 @@ class MimeTypeParameterList implements Cloneable { String name = null; String thisValue = null; String thatValue = null; - Set entries = parameters.entrySet(); - Iterator iterator = entries.iterator(); - Map.Entry entry = null; + Set> entries = parameters.entrySet(); + Iterator> iterator = entries.iterator(); + Map.Entry entry = null; while (iterator.hasNext()) { - entry = (Map.Entry)iterator.next(); - name = (String)entry.getKey(); - thisValue = (String)entry.getValue(); - thatValue = (String)that.parameters.get(name); + entry = iterator.next(); + name = entry.getKey(); + thisValue = entry.getValue(); + thatValue = that.parameters.get(name); if ((thisValue == null) || (thatValue == null)) { // both null -> equal, only one null -> not equal if (thisValue != thatValue) { @@ -250,7 +250,7 @@ class MimeTypeParameterList implements Cloneable { * is no current association. */ public String get(String name) { - return (String)parameters.get(name.trim().toLowerCase()); + return parameters.get(name.trim().toLowerCase()); } /** @@ -271,7 +271,7 @@ class MimeTypeParameterList implements Cloneable { /** * Retrieve an enumeration of all the names in this list. */ - public Enumeration getNames() { + public Enumeration getNames() { return parameters.keys(); } @@ -279,15 +279,15 @@ class MimeTypeParameterList implements Cloneable { // Heuristic: 8 characters per field StringBuilder buffer = new StringBuilder(parameters.size() * 16); - Enumeration keys = parameters.keys(); + Enumeration keys = parameters.keys(); while(keys.hasMoreElements()) { buffer.append("; "); - String key = (String)keys.nextElement(); + String key = keys.nextElement(); buffer.append(key); buffer.append('='); - buffer.append(quote((String)parameters.get(key))); + buffer.append(quote(parameters.get(key))); } return buffer.toString(); @@ -307,7 +307,7 @@ class MimeTypeParameterList implements Cloneable { return newObj; } - private Hashtable parameters; + private Hashtable parameters; // below here be scary parsing related things diff --git a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java index ef154acdc2e..1258881c1e8 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java +++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java @@ -1324,7 +1324,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { List retval = null; for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) { List natives = getFlavorToNative().get(dataFlavor); - if (!natives.isEmpty()) { + if (natives != null && !natives.isEmpty()) { if (retval == null) { retval = new ArrayList<>(); } diff --git a/jdk/src/share/classes/java/awt/datatransfer/package.html b/jdk/src/share/classes/java/awt/datatransfer/package.html index a16e0090889..f33946cac58 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/package.html +++ b/jdk/src/share/classes/java/awt/datatransfer/package.html @@ -25,6 +25,7 @@ + Provides interfaces and classes for transferring data diff --git a/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java index 76b719bf70b..5da844c80b4 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java +++ b/jdk/src/share/classes/java/awt/dnd/DragGestureListener.java @@ -50,8 +50,8 @@ import java.util.EventListener; /** * This method is invoked by the {@code DragGestureRecognizer} * when the {@code DragGestureRecognizer} detects a platform-dependent - * drag initiating gesture. To intiate the drag and drop operation, - * if approtiate, {@link DragGestureEvent#startDrag startDrag()} method on + * drag initiating gesture. To initiate the drag and drop operation, + * if appropriate, {@link DragGestureEvent#startDrag startDrag()} method on * the {@code DragGestureEvent} has to be invoked. *

      * @see java.awt.dnd.DragGestureRecognizer diff --git a/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java index 60c1876fddf..331f085a3d3 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java +++ b/jdk/src/share/classes/java/awt/dnd/DragGestureRecognizer.java @@ -46,7 +46,7 @@ import java.io.Serializable; *

      * The appropriate DragGestureRecognizer * subclass instance is obtained from the - * {@link DragSource} asssociated with + * {@link DragSource} associated with * a particular Component, or from the Toolkit object via its * {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()} * method. diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java index 9655689a237..dd2a4150a85 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceContext.java @@ -474,7 +474,7 @@ public class DragSourceContext protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) { - // if the cursor has been previously set then dont do any defaults + // if the cursor has been previously set then don't do any defaults // processing. if (useCustomCursor) { diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java index 62ab7fcb27a..05e29f53a45 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceEvent.java @@ -38,7 +38,7 @@ import java.util.EventObject; * over, or exits a drop site, when the drop action changes, and when the drag * ends. The location for the generated DragSourceEvent specifies * the mouse cursor location in screen coordinates at the moment this event - * occured. + * occurred. *

      * In a multi-screen environment without a virtual device, the cursor location is * specified in the coordinate system of the initiator @@ -71,7 +71,7 @@ public class DragSourceEvent extends EventObject { /** * The horizontal coordinate for the cursor location at the moment this - * event occured if the cursor location is specified for this event; + * event occurred if the cursor location is specified for this event; * otherwise zero. * * @serial @@ -80,7 +80,7 @@ public class DragSourceEvent extends EventObject { /** * The vertical coordinate for the cursor location at the moment this event - * occured if the cursor location is specified for this event; + * occurred if the cursor location is specified for this event; * otherwise zero. * * @serial @@ -141,7 +141,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns a Point indicating the cursor - * location in screen coordinates at the moment this event occured, or + * location in screen coordinates at the moment this event occurred, or * null if the cursor location is not specified for this * event. * @@ -159,7 +159,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns the horizontal coordinate of the cursor location in - * screen coordinates at the moment this event occured, or zero if the + * screen coordinates at the moment this event occurred, or zero if the * cursor location is not specified for this event. * * @return an integer indicating the horizontal coordinate of the cursor @@ -172,7 +172,7 @@ public class DragSourceEvent extends EventObject { /** * This method returns the vertical coordinate of the cursor location in - * screen coordinates at the moment this event occured, or zero if the + * screen coordinates at the moment this event occurred, or zero if the * cursor location is not specified for this event. * * @return an integer indicating the vertical coordinate of the cursor diff --git a/jdk/src/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/share/classes/java/awt/dnd/DropTarget.java index 4006f728c9b..0480ba5f67e 100644 --- a/jdk/src/share/classes/java/awt/dnd/DropTarget.java +++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java @@ -612,7 +612,7 @@ public class DropTarget implements DropTargetListener, Serializable { dropTargetContext = (DropTargetContext)f.get("dropTargetContext", null); } catch (IllegalArgumentException e) { - // Pre-1.4 support. 'dropTargetContext' was previoulsy transient + // Pre-1.4 support. 'dropTargetContext' was previously transient } if (dropTargetContext == null) { dropTargetContext = createDropTargetContext(); @@ -789,7 +789,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * update autoscrolling with current cursor locn + * update autoscrolling with current cursor location *

      * @param dragCursorLocn the Point */ diff --git a/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java index 72a81fc75b8..37bf2cb8e1b 100644 --- a/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java +++ b/jdk/src/share/classes/java/awt/dnd/InvalidDnDOperationException.java @@ -29,7 +29,7 @@ package java.awt.dnd; * This exception is thrown by various methods in the java.awt.dnd package. * It is usually thrown to indicate that the target in question is unable * to undertake the requested operation that the present time, since the - * undrelying DnD system is not in the appropriate state. + * underlying DnD system is not in the appropriate state. * * @since 1.2 */ diff --git a/jdk/src/share/classes/java/awt/dnd/package.html b/jdk/src/share/classes/java/awt/dnd/package.html index b39c069b0c5..f2df34617bd 100644 --- a/jdk/src/share/classes/java/awt/dnd/package.html +++ b/jdk/src/share/classes/java/awt/dnd/package.html @@ -25,6 +25,7 @@ + Drag and Drop is a direct manipulation gesture found in many Graphical @@ -51,18 +52,18 @@ states (not entirely sequentially): associated with some presentation element (Component) in the GUI, to initiate a Drag and Drop of some potentially Transferable data. -

      +

    • 1 or more DropTarget(s) come into/go out of existence, associated with presentation elements in the GUI (Components), potentially capable of consuming Transferable data types. -

      +

    • A DragGestureRecognizer is obtained from the DragSource and is associated with a Component in order to track and identify any Drag initiating gesture by the user over the Component. -

      +

    • A user makes a Drag gesture over the Component, which the registered DragGestureRecognizer detects, and notifies its @@ -76,13 +77,13 @@ contains the abstract class MouseDragGestureRecognizer for recognizing mouse device gestures. Other abstract subclasses may be provided by the platform to support other input devices or particular Component class semantics. -

      +

    • The DragGestureListener causes the DragSource to initiate the Drag and Drop operation on behalf of the user, perhaps animating the GUI Cursor and/or rendering an Image of the item(s) that are the subject of the operation. -

      +

    • As the user gestures navigate over Component(s) in the GUI with associated DropTarget(s), the DragSource @@ -111,11 +112,11 @@ as follows:
      • By the transfer "operation" selected by the user, and supported by both the DragSource and DropTarget: Copy, Move or Reference(link). -

        +

      • By the intersection of the set of data types provided by the DragSource and the set of data types comprehensible by the DropTarget. -

        +

      • When the user terminates the drag operation, normally resulting in a successful Drop, both the DragSource and DropTarget receive diff --git a/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html b/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html index 735cfdd97d6..93d185181fe 100644 --- a/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html +++ b/jdk/src/share/classes/java/awt/doc-files/AWTThreadIssues.html @@ -23,7 +23,11 @@ questions. --> + + + +

        AWT Threading Issues

        @@ -81,13 +85,13 @@ this machinery are as follows: dispatched:
        • Sequentially. -
          That is, it is not permitted that several events from - this queue are dispatched simultaneously. +
          That is, it is not permitted that several events from + this queue are dispatched simultaneously.
        • In the same order as they are enqueued. -
          That is, if AWTEvent A is enqueued +
          That is, if AWTEvent A is enqueued to the EventQueue before AWTEvent B then event B will not be - dispatched before event A. + dispatched before event A.
      • There is at least one alive non-daemon thread while there is at least one displayable AWT or Swing component within the diff --git a/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html b/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html index ff9b144951c..8a3923c0f40 100644 --- a/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html +++ b/jdk/src/share/classes/java/awt/doc-files/DesktopProperties.html @@ -23,7 +23,11 @@ questions. --> + + + +

        AWT Desktop Properties

        @@ -51,8 +55,8 @@ unavailable for any reason, the implementation will return

        The following table summarizes the desktop properties documented here, and their value types. -

        -

    • - * The preceeding text describes this graphic (Figure 1). + * The preceding text describes this graphic (Figure 1). * - * The preceeding text describes this graphic (Figure 2). + * The preceding text describes this graphic (Figure 2). *
      Figure 2: Horizontal, Left-to-Right
      @@ -60,17 +64,17 @@ here, and their value types. - - + + + - - + + +
      Property NameSummary Description
      awt.font.desktophints -java.util.MapFont smoothing (text antialiasing) settings.awt.font.desktophintsjava.util.MapFont smoothing (text antialiasing) settings.
      sun.awt.enableExtraMouseButtons -java.lang.BooleanControls if mouse events from extra buttons are to be generated or notsun.awt.enableExtraMouseButtonsjava.lang.BooleanControls if mouse events from extra buttons are to be generated or not
      -

      +

      Desktop Font Rendering Hints

      Desktop Property: "awt.font.desktophints"

      @@ -84,14 +88,14 @@ This is particularly important when creating Swing components which are required to appear consistent with native desktop components or other Swing components. -

      +

      Basic Usage

      The standard desktop property named "awt.font.desktophints" can be used to obtain the rendering hints that best match the desktop settings. The return value is a - Map of + Map of RenderingHints which can be directly applied to a Graphics2D.

      @@ -105,7 +109,7 @@ if (map != null) { }

      Advanced Usage Tips

      -

      +

      Listening for changes

      An application can listen for changes in the property @@ -161,7 +165,7 @@ RenderingHints getRenderingHints(Graphics2D g2d, if (hintsToSave.size() == 0) { return savedHints; } - /* RenderingHints.keySet() returns Set */ + /* RenderingHints.keySet() returns Set<Object> */ for (Object o : hintsToSave.keySet()) { RenderingHints.Key key = (RenderingHints.Key)o; Object value = g2d.getRenderingHint(key); @@ -185,17 +189,17 @@ if (map != null) {

      Details

      • The return value will always be null or a Map -

        +

      • If the return value is null, then no desktop properties are available, and dynamic updates will not be available. This is a typical behaviour if the JDK does not recognise the desktop environment, or it is one which has no such settings. The Headless toolkit is one such example. Therefore it is important to test against null before using the map. -

        +

      • If non-null the value will be a Map of RenderingHints such that every key is an instance of RenderingHints.Key and the value is a legal value for that key. -

        +

      • The map may contain the default value for a hint. This is needed in the event there is a previously a non-default value for the hint set on the Graphics2D. If the map did not contain @@ -204,7 +208,7 @@ the previous hint which may not correspond to the desktop setting.

        An application can use setRenderingHints(Map) to reinitialise all hints, but this would affect unrelated hints too. -

        +

      • A multi-screen desktop may support per-screen device settings in which case the returned value is for the default screen of the desktop. An application may want to use the settings for the screen on diff --git a/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html index 908afef4f55..910db97b3fc 100644 --- a/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html +++ b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html @@ -27,7 +27,7 @@ - The AWT Focus Subsystem + The AWT Focus Subsystem @@ -660,16 +660,16 @@ All other applications, including pure AWT applications, will use FocusTraversalPolicy of its own. To do so, one needs to set Container's focus traversal policy provider property to true with the call to -
          +
          Container.setFocusTraversalPolicyProvider(boolean) -
        + To determine whether a Container is a focus traversal policy provider, the following method should be used: -
          +
          Container.isFocusTraversalPolicyProvider() -
        + If focus traversal policy provider property is set on a focus cycle root, it isn't considered a focus traversal policy provider and behaves just like any @@ -750,10 +750,10 @@ traversals. The preferred way to initiate a programmatic traversal is to use one of the following methods on KeyboardFocusManager:
          - KeyboardFocusManager.focusNextComponent() - KeyboardFocusManager.focusPreviousComponent() - KeyboardFocusManager.upFocusCycle() - KeyboardFocusManager.downFocusCycle() +
        • KeyboardFocusManager.focusNextComponent() +
        • KeyboardFocusManager.focusPreviousComponent() +
        • KeyboardFocusManager.upFocusCycle() +
        • KeyboardFocusManager.downFocusCycle()

        @@ -1149,7 +1149,7 @@ Microsoft Windows and Solaris is as follows: Microsoft Windows: The Window is moved to front and becomes the focused Window.
        - Solaris: The Window is moved to front. In a point-to-focus focus + Solaris: The Window is moved to front. In a point-to-focus focus window manager, the Window will be focused if it is now the top-most Window under the cursor. In a click-to-focus window manager, the Window will become the focused Window. diff --git a/jdk/src/share/classes/java/awt/doc-files/Modality.html b/jdk/src/share/classes/java/awt/doc-files/Modality.html index 777d16837ee..f0bf00ca2fa 100644 --- a/jdk/src/share/classes/java/awt/doc-files/Modality.html +++ b/jdk/src/share/classes/java/awt/doc-files/Modality.html @@ -43,7 +43,7 @@ modality features and how to use them. It contains the following sections:

        -

        Definitions

        +

        Definitions

        Document - a window without an owner that, together with all its child hierarchy, may be operated on as a single self-contained document. - Every window belongs to some document — its root can be found as + Every window belongs to some document — its root can be found as the closest ancestor window without an owner.

        @@ -73,7 +73,7 @@


        Warning! Some window managers allow users to change the window - Z-order in an arbitrary way — in that case the last requirement + Z-order in an arbitrary way — in that case the last requirement may not be met.
        @@ -92,12 +92,12 @@


        Note: Everywhere in this document the notion of "window" is equal - to a top-level window in the Java programming language — in other words + to a top-level window in the Java programming language — in other words an instance of java.awt.Window or any descendant class.
        -

        Modality types

        +

        Modality types

        There are four supported modality types : @@ -163,11 +163,11 @@


        -

        Show/hide blocking

        +

        Show/hide blocking

        Showing the window or modeless dialog: "F"
        - All the visible modal dialogs are looked through — if F is from the SB + All the visible modal dialogs are looked through — if F is from the SB of one of them, it becomes blocked by it. If there are several such dialogs, the first shown is used. If no such dialogs exist, F remains unblocked. @@ -185,7 +185,7 @@ dialogs outside M's SB and modal dialogs outside M's SB that do not block M).

      -

      +

      After the modal dialog M is shown, it becomes blocked by the first shown dialog from the first group (if there are any), all the windows from the second one become blocked by M, and all the windows from the third group @@ -197,12 +197,12 @@

      Showing the document-modal dialog: "M"
      All the visible application- and toolkit-modal dialogs are looked - through — if M is from the SB of one of them, + through — if M is from the SB of one of them, it becomes blocked by it. If there are several such dialogs, the first shown is used. If no such dialogs exist, M remains unblocked.

      Showing the application-modal dialog: "M"
      - All the visible toolkit-modal dialogs are looked through — + All the visible toolkit-modal dialogs are looked through — if M is from the SB of one of them, it becomes blocked by it. If there are several such dialogs, the first shown is used. If no such dialogs exist, M remains unblocked. @@ -212,7 +212,7 @@

      - +
      @@ -293,11 +293,10 @@
      Implementation note: Changing the modal exclusion type for a visible window may have no effect until it is hidden and then shown again. - - -

      Related AWT features

      +
      +

      Related AWT features

      Always-On-Top
      @@ -315,16 +314,16 @@

      Minimizing, maximizing and closing blocked windows
      When a modal dialog blocks a window, the user may not be able to maximize or - minimize the blocked window— however, the actual behavior is unspecified + minimize the blocked window— however, the actual behavior is unspecified and platform-dependent. In any case, the user can't close the blocked window - interactively— but it can be closed programmatically by calling the + interactively— but it can be closed programmatically by calling the setVisible(false) or dispose() methods on the blocked window.

      Blocked windows activations
      When the user selects a blocked window, it may be brought to the front, along - with the blocking modal dialog which would then become the active window— + with the blocking modal dialog which would then become the active window— however, the actual behavior is unspecified and platform-dependent.

      @@ -339,9 +338,9 @@ If the modal dialog to be hidden does not have focus, the active window remains unchanged. -

      + -

      Security

      +

      Security

      A special AWTPermission, "toolkitModality", @@ -386,35 +385,35 @@

      Examples

      -
      The Standard Blocking Matrix
      current/shown
      +
      - - - @@ -424,45 +423,45 @@ - - - - diff --git a/jdk/src/share/classes/java/awt/event/ActionEvent.java b/jdk/src/share/classes/java/awt/event/ActionEvent.java index d549db020ca..24a91ac0cd2 100644 --- a/jdk/src/share/classes/java/awt/event/ActionEvent.java +++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java @@ -95,7 +95,7 @@ public class ActionEvent extends AWTEvent { public static final int ACTION_LAST = 1001; /** - * This event id indicates that a meaningful action occured. + * This event id indicates that a meaningful action occurred. */ @Native public static final int ACTION_PERFORMED = ACTION_FIRST; //Event.ACTION_EVENT diff --git a/jdk/src/share/classes/java/awt/event/InvocationEvent.java b/jdk/src/share/classes/java/awt/event/InvocationEvent.java index 1f411e1ac1a..3f04a2316e8 100644 --- a/jdk/src/share/classes/java/awt/event/InvocationEvent.java +++ b/jdk/src/share/classes/java/awt/event/InvocationEvent.java @@ -25,6 +25,8 @@ package java.awt.event; +import sun.awt.AWTAccessor; + import java.awt.ActiveEvent; import java.awt.AWTEvent; @@ -56,6 +58,15 @@ import java.awt.AWTEvent; */ public class InvocationEvent extends AWTEvent implements ActiveEvent { + static { + AWTAccessor.setInvocationEventAccessor(new AWTAccessor.InvocationEventAccessor() { + @Override + public void dispose(InvocationEvent invocationEvent) { + invocationEvent.finishedDispatching(false); + } + }); + } + /** * Marks the first integer id for the range of invocation event ids. */ @@ -78,11 +89,21 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { /** * The (potentially null) Object whose notifyAll() method will be called - * immediately after the Runnable.run() method has returned or thrown an exception. + * immediately after the Runnable.run() method has returned or thrown an exception + * or after the event was disposed. * * @see #isDispatched */ - protected Object notifier; + protected volatile Object notifier; + + /** + * The (potentially null) Runnable whose run() method will be called + * immediately after the event was dispatched or disposed. + * + * @see #isDispatched + * @since 1.8 + */ + private final Runnable listener; /** * Indicates whether the run() method of the runnable @@ -147,7 +168,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { * @see #InvocationEvent(Object, Runnable, Object, boolean) */ public InvocationEvent(Object source, Runnable runnable) { - this(source, runnable, null, false); + this(source, INVOCATION_DEFAULT, runnable, null, null, false); } /** @@ -171,7 +192,8 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { * @param notifier The {@code Object} whose notifyAll * method will be called after * Runnable.run has returned or - * thrown an exception + * thrown an exception or after the event was + * disposed * @param catchThrowables Specifies whether dispatch * should catch Throwable when executing * the Runnable's run @@ -185,7 +207,39 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { */ public InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchThrowables) { - this(source, INVOCATION_DEFAULT, runnable, notifier, catchThrowables); + this(source, INVOCATION_DEFAULT, runnable, notifier, null, catchThrowables); + } + + /** + * Constructs an InvocationEvent with the specified + * source which will execute the runnable's run + * method when dispatched. If listener is non-null, + * listener.run() will be called immediately after + * run has returned, thrown an exception or the event + * was disposed. + *

      This method throws an IllegalArgumentException + * if source is null. + * + * @param source The Object that originated + * the event + * @param runnable The Runnable whose + * run method will be + * executed + * @param listener The RunnableRunnable whose + * run() method will be called + * after the {@code InvocationEvent} + * was dispatched or disposed + * @param catchThrowables Specifies whether dispatch + * should catch Throwable when executing + * the Runnable's run + * method, or should instead propagate those + * Throwables to the EventDispatchThread's + * dispatch loop + * @throws IllegalArgumentException if source is null + */ + public InvocationEvent(Object source, Runnable runnable, Runnable listener, + boolean catchThrowables) { + this(source, INVOCATION_DEFAULT, runnable, null, listener, catchThrowables); } /** @@ -208,7 +262,8 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { * @param notifier The Object whose notifyAll * method will be called after * Runnable.run has returned or - * thrown an exception + * thrown an exception or after the event was + * disposed * @param catchThrowables Specifies whether dispatch * should catch Throwable when executing the * Runnable's run @@ -221,13 +276,18 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { */ protected InvocationEvent(Object source, int id, Runnable runnable, Object notifier, boolean catchThrowables) { + this(source, id, runnable, notifier, null, catchThrowables); + } + + private InvocationEvent(Object source, int id, Runnable runnable, + Object notifier, Runnable listener, boolean catchThrowables) { super(source, id); this.runnable = runnable; this.notifier = notifier; + this.listener = listener; this.catchExceptions = catchThrowables; this.when = System.currentTimeMillis(); } - /** * Executes the Runnable's run() method and notifies the * notifier (if any) when run() has returned or thrown an exception. @@ -251,13 +311,7 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { runnable.run(); } } finally { - dispatched = true; - - if (notifier != null) { - synchronized (notifier) { - notifier.notifyAll(); - } - } + finishedDispatching(true); } } @@ -330,6 +384,25 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent { return dispatched; } + /** + * Called when the event was dispatched or disposed + * @param dispatched true if the event was dispatched + * false if the event was disposed + */ + private void finishedDispatching(boolean dispatched) { + this.dispatched = dispatched; + + if (notifier != null) { + synchronized (notifier) { + notifier.notifyAll(); + } + } + + if (listener != null) { + listener.run(); + } + } + /** * Returns a parameter string identifying this event. * This method is useful for event-logging and for debugging. diff --git a/jdk/src/share/classes/java/awt/event/KeyEvent.java b/jdk/src/share/classes/java/awt/event/KeyEvent.java index 5f88e3a9165..682c226fa3d 100644 --- a/jdk/src/share/classes/java/awt/event/KeyEvent.java +++ b/jdk/src/share/classes/java/awt/event/KeyEvent.java @@ -133,7 +133,7 @@ import sun.awt.AWTAccessor; * WARNING: Aside from those keys that are defined by the Java language * (VK_ENTER, VK_BACK_SPACE, and VK_TAB), do not rely on the values of the VK_ * constants. Sun reserves the right to change these values as needed - * to accomodate a wider range of keyboards in the future. + * to accommodate a wider range of keyboards in the future. *

      * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code KeyEvent} instance is not diff --git a/jdk/src/share/classes/java/awt/event/WindowEvent.java b/jdk/src/share/classes/java/awt/event/WindowEvent.java index ef5082937f2..6750805a9fa 100644 --- a/jdk/src/share/classes/java/awt/event/WindowEvent.java +++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java @@ -79,8 +79,10 @@ public class WindowEvent extends ComponentEvent { @Native public static final int WINDOW_CLOSING = 1 + WINDOW_FIRST; //Event.WINDOW_DESTROY /** - * The window closed event. This event is delivered after - * the window has been closed as the result of a call to dispose. + * The window closed event. This event is delivered after the displayable + * window has been closed as the result of a call to dispose. + * @see java.awt.Component#isDisplayable + * @see Window#dispose */ @Native public static final int WINDOW_CLOSED = 2 + WINDOW_FIRST; diff --git a/jdk/src/share/classes/java/awt/event/package.html b/jdk/src/share/classes/java/awt/event/package.html index edf84c11476..eec07cacd6c 100644 --- a/jdk/src/share/classes/java/awt/event/package.html +++ b/jdk/src/share/classes/java/awt/event/package.html @@ -25,6 +25,7 @@ + Provides interfaces and classes for dealing with different diff --git a/jdk/src/share/classes/java/awt/font/FontRenderContext.java b/jdk/src/share/classes/java/awt/font/FontRenderContext.java index 8ad710607cc..f9f5f1eec79 100644 --- a/jdk/src/share/classes/java/awt/font/FontRenderContext.java +++ b/jdk/src/share/classes/java/awt/font/FontRenderContext.java @@ -126,7 +126,7 @@ public class FontRenderContext { * anti-aliasing or fractional metrics. * @param tx the transform which is used to scale typographical points * to pixels in this FontRenderContext. If null, an - * identity tranform is used. + * identity transform is used. * @param aaHint - one of the text antialiasing rendering hint values * defined in {@link java.awt.RenderingHints java.awt.RenderingHints}. * Any other value will throw IllegalArgumentException. diff --git a/jdk/src/share/classes/java/awt/font/GlyphMetrics.java b/jdk/src/share/classes/java/awt/font/GlyphMetrics.java index 267debc77c4..74f2b0a69aa 100644 --- a/jdk/src/share/classes/java/awt/font/GlyphMetrics.java +++ b/jdk/src/share/classes/java/awt/font/GlyphMetrics.java @@ -43,7 +43,7 @@ package java.awt.font; import java.awt.geom.Rectangle2D; /** - * The GlyphMetrics class represents infomation for a + * The GlyphMetrics class represents information for a * single glyph. A glyph is the visual representation of one or more * characters. Many different glyphs can be used to represent a single * character or combination of characters. GlyphMetrics @@ -143,24 +143,24 @@ public final class GlyphMetrics { * as a ligature, for example 'fi' or 'ffi'. It is followed by * filler glyphs for the remaining characters. Filler and combining * glyphs can be intermixed to control positioning of accent marks - * on the logically preceeding ligature. + * on the logically preceding ligature. */ public static final byte LIGATURE = 1; /** * Indicates a glyph that represents a combining character, * such as an umlaut. There is no caret position between this glyph - * and the preceeding glyph. + * and the preceding glyph. */ public static final byte COMBINING = 2; /** * Indicates a glyph with no corresponding character in the * backing store. The glyph is associated with the character - * represented by the logicaly preceeding non-component glyph. This + * represented by the logically preceding non-component glyph. This * is used for kashida justification or other visual modifications to * existing glyphs. There is no caret position between this glyph - * and the preceeding glyph. + * and the preceding glyph. */ public static final byte COMPONENT = 3; diff --git a/jdk/src/share/classes/java/awt/font/GlyphVector.java b/jdk/src/share/classes/java/awt/font/GlyphVector.java index 264a06f07ab..23ce1a9bdf0 100644 --- a/jdk/src/share/classes/java/awt/font/GlyphVector.java +++ b/jdk/src/share/classes/java/awt/font/GlyphVector.java @@ -395,7 +395,7 @@ public abstract class GlyphVector implements Cloneable { * indicates that no special transform is applied for the specified * glyph. * This method can be used to rotate, mirror, translate and scale the - * glyph. Adding a transform can result in signifant performance changes. + * glyph. Adding a transform can result in significant performance changes. * @param glyphIndex the index into this GlyphVector * @param newTX the new transform of the glyph at glyphIndex * @throws IndexOutOfBoundsException if glyphIndex diff --git a/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java b/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java index 2e2be83e58c..0688ab41969 100644 --- a/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java +++ b/jdk/src/share/classes/java/awt/font/LineBreakMeasurer.java @@ -112,7 +112,7 @@ import java.awt.font.FontRenderContext; * Examples:

      * Rendering a paragraph in a component *

      - *
      + * 
      {@code
        * public void paint(Graphics graphics) {
        *
        *     Point2D pen = new Point2D(10, 20);
      @@ -137,13 +137,13 @@ import java.awt.font.FontRenderContext;
        *         pen.y += layout.getDescent() + layout.getLeading();
        *     }
        * }
      - * 
      + * }
      *
      *

      * Rendering text with tabs. For simplicity, the overall text * direction is assumed to be left-to-right *

      - *
      + * 
      {@code
        * public void paint(Graphics graphics) {
        *
        *     float leftMargin = 10, rightMargin = 310;
      @@ -240,7 +240,7 @@ import java.awt.font.FontRenderContext;
        *         verticalPos += maxDescent;
        *     }
        * }
      - * 
      + * }
      *
      * @see TextLayout */ diff --git a/jdk/src/share/classes/java/awt/font/MultipleMaster.java b/jdk/src/share/classes/java/awt/font/MultipleMaster.java index 757ca01db23..8c672647939 100644 --- a/jdk/src/share/classes/java/awt/font/MultipleMaster.java +++ b/jdk/src/share/classes/java/awt/font/MultipleMaster.java @@ -41,7 +41,7 @@ public interface MultipleMaster { public int getNumDesignAxes(); /** - * Returns an array of design limits interleaved in the form [from->to] + * Returns an array of design limits interleaved in the form [from→to] * for each axis. For example, * design limits for weight could be from 0.1 to 1.0. The values are * returned in the same order returned by diff --git a/jdk/src/share/classes/java/awt/font/NumericShaper.java b/jdk/src/share/classes/java/awt/font/NumericShaper.java index 7685e65f918..0de80e91f39 100644 --- a/jdk/src/share/classes/java/awt/font/NumericShaper.java +++ b/jdk/src/share/classes/java/awt/font/NumericShaper.java @@ -1212,7 +1212,7 @@ public final class NumericShaper implements java.io.Serializable { * For example, to check if a shaper shapes to Arabic, you would use the * following: *
      - * if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... + * if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... *
      * *

      Note that this method supports only the bit mask-based diff --git a/jdk/src/share/classes/java/awt/font/OpenType.java b/jdk/src/share/classes/java/awt/font/OpenType.java index a5bcdce3dc3..559cb03f939 100644 --- a/jdk/src/share/classes/java/awt/font/OpenType.java +++ b/jdk/src/share/classes/java/awt/font/OpenType.java @@ -33,7 +33,7 @@ package java.awt.font; *

      * For more information on TrueType and OpenType fonts, see the * OpenType specification. - * ( http://www.microsoft.com/typography/otspec/l ). + * ( http://www.microsoft.com/typography/otspec/ ). */ public interface OpenType { @@ -268,7 +268,7 @@ public interface OpenType { public final static int TAG_ACNT = 0x61636e74; /** - * Axis variaiton. Table tag "avar" in the Open + * Axis variation. Table tag "avar" in the Open * Type Specification. */ public final static int TAG_AVAR = 0x61766172; diff --git a/jdk/src/share/classes/java/awt/font/TextLayout.java b/jdk/src/share/classes/java/awt/font/TextLayout.java index c09afd7e653..34e9f88e41f 100644 --- a/jdk/src/share/classes/java/awt/font/TextLayout.java +++ b/jdk/src/share/classes/java/awt/font/TextLayout.java @@ -223,7 +223,7 @@ import sun.text.CodePointIterator; * baseline-relative coordinates map the 'x' coordinate to the * distance along the baseline, (positive x is forward along the * baseline), and the 'y' coordinate to a distance along the - * perpendicular to the baseline at 'x' (postitive y is 90 degrees + * perpendicular to the baseline at 'x' (positive y is 90 degrees * clockwise from the baseline vector). Values in standard * coordinates are measured along the x and y axes, with 0,0 at the * origin of the TextLayout. Documentation for each relevant API @@ -337,7 +337,7 @@ public final class TextLayout implements Cloneable { TextHitInfo hit2, TextLayout layout) { - // default implmentation just calls private method on layout + // default implementation just calls private method on layout return layout.getStrongHit(hit1, hit2); } } @@ -912,7 +912,7 @@ public final class TextLayout implements Cloneable { * The ascent is the distance from the top (right) of the * TextLayout to the baseline. It is always either * positive or zero. The ascent is sufficient to - * accomodate superscripted text and is the maximum of the sum of the + * accommodate superscripted text and is the maximum of the sum of the * ascent, offset, and baseline of each glyph. The ascent is * the maximum ascent from the baseline of all the text in the * TextLayout. It is in baseline-relative coordinates. @@ -927,7 +927,7 @@ public final class TextLayout implements Cloneable { * Returns the descent of this TextLayout. * The descent is the distance from the baseline to the bottom (left) of * the TextLayout. It is always either positive or zero. - * The descent is sufficient to accomodate subscripted text and is the + * The descent is sufficient to accommodate subscripted text and is the * maximum of the sum of the descent, offset, and baseline of each glyph. * This is the maximum descent from the baseline of all the text in * the TextLayout. It is in baseline-relative coordinates. diff --git a/jdk/src/share/classes/java/awt/font/TransformAttribute.java b/jdk/src/share/classes/java/awt/font/TransformAttribute.java index 6156b4df7f3..e282c715cef 100644 --- a/jdk/src/share/classes/java/awt/font/TransformAttribute.java +++ b/jdk/src/share/classes/java/awt/font/TransformAttribute.java @@ -120,7 +120,7 @@ public final class TransformAttribute implements Serializable { return this; } - // Added for serial backwards compatability (4348425) + // Added for serial backwards compatibility (4348425) static final long serialVersionUID = 3356247357827709530L; /** diff --git a/jdk/src/share/classes/java/awt/font/package.html b/jdk/src/share/classes/java/awt/font/package.html index ec5d783e708..d4d0a0a998d 100644 --- a/jdk/src/share/classes/java/awt/font/package.html +++ b/jdk/src/share/classes/java/awt/font/package.html @@ -25,6 +25,7 @@ + Provides classes and interface relating to fonts. It diff --git a/jdk/src/share/classes/java/awt/geom/AffineTransform.java b/jdk/src/share/classes/java/awt/geom/AffineTransform.java index 0977cf8eaa4..d3c27ffa87e 100644 --- a/jdk/src/share/classes/java/awt/geom/AffineTransform.java +++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java @@ -47,7 +47,7 @@ import java.beans.ConstructorProperties; * [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ] * *

      - *

      Handling 90-Degree Rotations

      + *

      Handling 90-Degree Rotations

      *

      * In some variations of the rotate methods in the * AffineTransform class, a double-precision argument @@ -525,7 +525,7 @@ public class AffineTransform implements Cloneable, java.io.Serializable { /** * Constructs a new AffineTransform from an array of * floating point values representing either the 4 non-translation - * enries or the 6 specifiable entries of the 3x3 transformation + * entries or the 6 specifiable entries of the 3x3 transformation * matrix. The values are retrieved from the array as * { m00 m10 m01 m11 [m02 m12]}. * @param flatmatrix the float array containing the values to be set @@ -715,7 +715,7 @@ public class AffineTransform implements Cloneable, java.io.Serializable { /** * Returns a transform that rotates coordinates around an anchor - * point accordinate to a rotation vector. + * point according to a rotation vector. * All coordinates rotate about the specified anchor coordinates * by the same amount. * The amount of rotation is such that coordinates along the former @@ -845,7 +845,7 @@ public class AffineTransform implements Cloneable, java.io.Serializable { * this transform. * The return value is either one of the constants TYPE_IDENTITY * or TYPE_GENERAL_TRANSFORM, or a combination of the - * appriopriate flag bits. + * appropriate flag bits. * A valid combination of flag bits is an exclusive OR operation * that can combine * the TYPE_TRANSLATION flag bit @@ -2876,7 +2876,7 @@ public class AffineTransform implements Cloneable, java.io.Serializable { * @param ptDst the specified Point2D that stores the * result of transforming ptSrc * @return the ptDst after transforming - * ptSrc and stroring the result in ptDst. + * ptSrc and storing the result in ptDst. * @since 1.2 */ public Point2D transform(Point2D ptSrc, Point2D ptDst) { diff --git a/jdk/src/share/classes/java/awt/geom/Line2D.java b/jdk/src/share/classes/java/awt/geom/Line2D.java index a34e7941479..7d49d27e29b 100644 --- a/jdk/src/share/classes/java/awt/geom/Line2D.java +++ b/jdk/src/share/classes/java/awt/geom/Line2D.java @@ -477,7 +477,7 @@ public abstract class Line2D implements Shape, Cloneable { * direction is clockwise. *

      A return value of 0 indicates that the point lies * exactly on the line segment. Note that an indicator value - * of 0 is rare and not useful for determining colinearity + * of 0 is rare and not useful for determining collinearity * because of floating point rounding issues. *

      If the point is colinear with the line segment, but * not between the end points, then the value will be -1 if the point diff --git a/jdk/src/share/classes/java/awt/geom/Path2D.java b/jdk/src/share/classes/java/awt/geom/Path2D.java index 3aae874310c..acf781ad775 100644 --- a/jdk/src/share/classes/java/awt/geom/Path2D.java +++ b/jdk/src/share/classes/java/awt/geom/Path2D.java @@ -2064,7 +2064,7 @@ public abstract class Path2D implements Shape, Cloneable { * @param w the width of the specified rectangular area * @param h the height of the specified rectangular area * @return {@code true} if the specified {@code PathIterator} contains - * the specified rectangluar area; {@code false} otherwise. + * the specified rectangular area; {@code false} otherwise. * @since 1.6 */ public static boolean contains(PathIterator pi, diff --git a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java index 4df791e40b2..a2c41d91fae 100644 --- a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java +++ b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java @@ -511,7 +511,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable { /** * Returns the X coordinate of the end point in * double precision. - * @return the x coordiante of the end point. + * @return the x coordinate of the end point. * @since 1.2 */ public abstract double getX2(); diff --git a/jdk/src/share/classes/java/awt/geom/package.html b/jdk/src/share/classes/java/awt/geom/package.html index e0ff8681e04..4b18dee4c5f 100644 --- a/jdk/src/share/classes/java/awt/geom/package.html +++ b/jdk/src/share/classes/java/awt/geom/package.html @@ -25,6 +25,7 @@ + Provides the Java 2D classes for defining and performing operations diff --git a/jdk/src/share/classes/java/awt/im/InputContext.java b/jdk/src/share/classes/java/awt/im/InputContext.java index e2223fcbc50..615029120dd 100644 --- a/jdk/src/share/classes/java/awt/im/InputContext.java +++ b/jdk/src/share/classes/java/awt/im/InputContext.java @@ -98,7 +98,6 @@ public class InputContext { * an input method or keyboard layout has been successfully selected. The * following steps are taken until an input method has been selected: * - *

      *

        *
      • * If the currently selected input method or keyboard layout supports the diff --git a/jdk/src/share/classes/java/awt/im/InputMethodRequests.java b/jdk/src/share/classes/java/awt/im/InputMethodRequests.java index 080d25140db..414eaaad48f 100644 --- a/jdk/src/share/classes/java/awt/im/InputMethodRequests.java +++ b/jdk/src/share/classes/java/awt/im/InputMethodRequests.java @@ -83,7 +83,7 @@ public interface InputMethodRequests { * For example, for horizontal left-to-right text (such as English), the * location to the left of the left-most character on the last line * containing selected text is returned. For vertical top-to-bottom text, - * with lines proceding from right to left, the location to the top of the + * with lines proceeding from right to left, the location to the top of the * left-most line containing selected text is returned. * *

        diff --git a/jdk/src/share/classes/java/awt/image/BandedSampleModel.java b/jdk/src/share/classes/java/awt/image/BandedSampleModel.java index c1a620c7d8f..ac97f06dcd0 100644 --- a/jdk/src/share/classes/java/awt/image/BandedSampleModel.java +++ b/jdk/src/share/classes/java/awt/image/BandedSampleModel.java @@ -39,7 +39,7 @@ package java.awt.image; * This class represents image data which is stored in a band interleaved * fashion and for * which each sample of a pixel occupies one data element of the DataBuffer. - * It subclasses ComponentSampleModel but provides a more efficent + * It subclasses ComponentSampleModel but provides a more efficient * implementation for accessing band interleaved image data than is provided * by ComponentSampleModel. This class should typically be used when working * with images which store sample data for each band in a different bank of the diff --git a/jdk/src/share/classes/java/awt/image/BufferStrategy.java b/jdk/src/share/classes/java/awt/image/BufferStrategy.java index de7877330b9..7a4f793b791 100644 --- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java +++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java @@ -34,7 +34,7 @@ import java.awt.Image; * to organize complex memory on a particular Canvas or * Window. Hardware and software limitations determine whether and * how a particular buffer strategy can be implemented. These limitations - * are detectible through the capabilities of the + * are detectable through the capabilities of the * GraphicsConfiguration used when creating the * Canvas or Window. *

        diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java index b4222b1e740..811c209a983 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java @@ -1336,7 +1336,7 @@ public class BufferedImage extends java.awt.Image /** * Returns the minimum tile index in the y direction. * This is always zero. - * @return the mininum tile index in the y direction. + * @return the minimum tile index in the y direction. */ public int getMinTileY() { return 0; diff --git a/jdk/src/share/classes/java/awt/image/ComponentColorModel.java b/jdk/src/share/classes/java/awt/image/ComponentColorModel.java index ec0bce587f0..28e41a2bc27 100644 --- a/jdk/src/share/classes/java/awt/image/ComponentColorModel.java +++ b/jdk/src/share/classes/java/awt/image/ComponentColorModel.java @@ -2318,7 +2318,7 @@ public class ComponentColorModel extends ColorModel { * and is not large enough to hold all the color and alpha components * (starting at normOffset). *

        - * This method must be overrridden by a subclass if that subclass + * This method must be overridden by a subclass if that subclass * is designed to translate pixel sample values to color component values * in a non-default way. The default translations implemented by this * class is described in the class comments. Any subclass implementing diff --git a/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java index d5f86f35287..2a9def53a96 100644 --- a/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java +++ b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java @@ -167,6 +167,7 @@ public class ComponentSampleModel extends SampleModel for (int i=0; i (Integer.MAX_VALUE - 1)) { + throw new IllegalArgumentException("Invalid band offset"); + } + + if (pixelStride < 0 || pixelStride > (Integer.MAX_VALUE / width)) { + throw new IllegalArgumentException("Invalid pixel stride"); + } + + if (scanlineStride < 0 || scanlineStride > (Integer.MAX_VALUE / height)) { + throw new IllegalArgumentException("Invalid scanline stride"); + } + + int size = maxBandOff + 1; + + int val = pixelStride * (width - 1); + + if (val > (Integer.MAX_VALUE - size)) { + throw new IllegalArgumentException("Invalid pixel stride"); + } + + size += val; + + val = scanlineStride * (height - 1); + + if (val > (Integer.MAX_VALUE - size)) { + throw new IllegalArgumentException("Invalid scan stride"); + } + + size += val; - long size = 0; - if (maxBandOff >= 0) - size += maxBandOff+1; - if (pixelStride > 0) - size += pixelStride * (width-1); - if (scanlineStride > 0) - size += scanlineStride*(height-1); return size; } @@ -409,7 +439,7 @@ public class ComponentSampleModel extends SampleModel public DataBuffer createDataBuffer() { DataBuffer dataBuffer = null; - int size = (int)getBufferSize(); + int size = getBufferSize(); switch (dataType) { case DataBuffer.TYPE_BYTE: dataBuffer = new DataBufferByte(size, numBanks); @@ -584,7 +614,7 @@ public class ComponentSampleModel extends SampleModel * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are - * not in bounds, or if obj is too small to hold the ouput. + * not in bounds, or if obj is too small to hold the output. */ public Object getDataElements(int x, int y, Object obj, DataBuffer data) { if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) { diff --git a/jdk/src/share/classes/java/awt/image/ImageConsumer.java b/jdk/src/share/classes/java/awt/image/ImageConsumer.java index da2231008d3..5298c9d58f8 100644 --- a/jdk/src/share/classes/java/awt/image/ImageConsumer.java +++ b/jdk/src/share/classes/java/awt/image/ImageConsumer.java @@ -191,7 +191,7 @@ public interface ImageConsumer { * finished delivering all of the pixels that the source image * contains, or when a single frame of a multi-frame animation has * been completed, or when an error in loading or producing the - * image has occured. The ImageConsumer should remove itself from the + * image has occurred. The ImageConsumer should remove itself from the * list of consumers registered with the ImageProducer at this time, * unless it is interested in successive frames. * @param status the status of image loading diff --git a/jdk/src/share/classes/java/awt/image/IndexColorModel.java b/jdk/src/share/classes/java/awt/image/IndexColorModel.java index d26e3d381be..7e4317cd3ab 100644 --- a/jdk/src/share/classes/java/awt/image/IndexColorModel.java +++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java @@ -1152,7 +1152,7 @@ public class IndexColorModel extends ColorModel { * @throws ClassCastException if pixel is not a * primitive array of type transferType * @throws UnsupportedOperationException if transferType - * is not one of the supported transer types + * is not one of the supported transfer types * @see ColorModel#hasAlpha * @see ColorModel#getNumComponents */ @@ -1271,7 +1271,7 @@ public class IndexColorModel extends ColorModel { * array is not large enough to hold all of the color and alpha * components starting at offset * @throws UnsupportedOperationException if transferType - * is not one of the supported transer types + * is not one of the supported transfer types * @see WritableRaster#setDataElements * @see SampleModel#setDataElements */ diff --git a/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java index 1c5475d09bc..8cc3c179146 100644 --- a/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java +++ b/jdk/src/share/classes/java/awt/image/PixelInterleavedSampleModel.java @@ -29,7 +29,7 @@ package java.awt.image; * This class represents image data which is stored in a pixel interleaved * fashion and for * which each sample of a pixel occupies one data element of the DataBuffer. - * It subclasses ComponentSampleModel but provides a more efficent + * It subclasses ComponentSampleModel but provides a more efficient * implementation for accessing pixel interleaved image data than is provided * by ComponentSampleModel. This class * stores sample data for all bands in a single bank of the diff --git a/jdk/src/share/classes/java/awt/image/package.html b/jdk/src/share/classes/java/awt/image/package.html index 9ef6e7f419b..c2f4c69d5c5 100644 --- a/jdk/src/share/classes/java/awt/image/package.html +++ b/jdk/src/share/classes/java/awt/image/package.html @@ -25,6 +25,7 @@ + Provides classes for creating and modifying images. diff --git a/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java b/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java index 3fec6d62977..8b0b3de368d 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java +++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java @@ -65,7 +65,7 @@ public interface RenderableImage { * String constant that can be used to identify a property on * a RenderedImage obtained via the createRendering or * createScaledRendering methods. If such a property exists, - * the value of the propoery will be a RenderingHints object + * the value of the property will be a RenderingHints object * specifying which hints were observed in creating the rendering. */ static final String HINTS_OBSERVED = "HINTS_OBSERVED"; @@ -162,7 +162,7 @@ public interface RenderableImage { * * @param w the width of rendered image in pixels, or 0. * @param h the height of rendered image in pixels, or 0. - * @param hints a RenderingHints object containg hints. + * @param hints a RenderingHints object containing hints. * @return a RenderedImage containing the rendered data. */ RenderedImage createScaledRendering(int w, int h, RenderingHints hints); diff --git a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java index f2247a309b7..92b3b96fc45 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java +++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java @@ -236,7 +236,7 @@ public class RenderableImageOp implements RenderableImage { * * @param w the width of rendered image in pixels, or 0. * @param h the height of rendered image in pixels, or 0. - * @param hints a RenderingHints object containg hints. + * @param hints a RenderingHints object containing hints. * @return a RenderedImage containing the rendered data. */ public RenderedImage createScaledRendering(int w, int h, diff --git a/jdk/src/share/classes/java/awt/image/renderable/package.html b/jdk/src/share/classes/java/awt/image/renderable/package.html index 3bcff3c39ab..58a9694269f 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/package.html +++ b/jdk/src/share/classes/java/awt/image/renderable/package.html @@ -25,6 +25,7 @@ + Provides classes and interfaces for producing diff --git a/jdk/src/share/classes/java/awt/package.html b/jdk/src/share/classes/java/awt/package.html index 184ca072c9a..1b6527e45b6 100644 --- a/jdk/src/share/classes/java/awt/package.html +++ b/jdk/src/share/classes/java/awt/package.html @@ -25,6 +25,7 @@ + Contains all of the classes for creating user @@ -53,7 +54,7 @@ If the bounds of a Component object exceed a platform limit, there is no way to properly arrange them within a Container object. The object's bounds are defined by any object's coordinate in combination with its size on a respective axis. -

        +

        Additional Specification

          diff --git a/jdk/src/share/classes/java/awt/print/package.html b/jdk/src/share/classes/java/awt/print/package.html index ddbecd2ee54..c04f6f9e33b 100644 --- a/jdk/src/share/classes/java/awt/print/package.html +++ b/jdk/src/share/classes/java/awt/print/package.html @@ -25,6 +25,7 @@ + Provides classes and interfaces for a general printing API. The diff --git a/jdk/src/share/classes/java/beans/AppletInitializer.java b/jdk/src/share/classes/java/beans/AppletInitializer.java index 2c271a236ca..c28f67434fd 100644 --- a/jdk/src/share/classes/java/beans/AppletInitializer.java +++ b/jdk/src/share/classes/java/beans/AppletInitializer.java @@ -32,7 +32,7 @@ import java.beans.beancontext.BeanContext; /** *

          * This interface is designed to work in collusion with java.beans.Beans.instantiate. - * The interafce is intended to provide mechanism to allow the proper + * The interface is intended to provide mechanism to allow the proper * initialization of JavaBeans that are also Applets, during their * instantiation by java.beans.Beans.instantiate(). *

          diff --git a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java index d4ec31a29e1..76ceaa65b22 100644 --- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -273,7 +273,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { TableModelListener (the JTable itself in this case) to the supplied table model. - We do not need to explictly add these listeners to the model in an + We do not need to explicitly add these listeners to the model in an archive as they will be added automatically by, in the above case, the JTable's "setModel" method. In some cases, we must specifically avoid trying to do this since the listener may be an inner class diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java index 935f7359e26..470991e11bd 100644 --- a/jdk/src/share/classes/java/beans/EventHandler.java +++ b/jdk/src/share/classes/java/beans/EventHandler.java @@ -611,7 +611,7 @@ public class EventHandler implements InvocationHandler { * the empty string. * The format of the eventPropertyName string is a sequence of * methods or properties where each method or - * property is applied to the value returned by the preceeding method + * property is applied to the value returned by the preceding method * starting from the incoming event object. * The syntax is: propertyName{.propertyName}* * where propertyName matches a method or diff --git a/jdk/src/share/classes/java/beans/MethodDescriptor.java b/jdk/src/share/classes/java/beans/MethodDescriptor.java index f8cd73d3897..f7f527c7d42 100644 --- a/jdk/src/share/classes/java/beans/MethodDescriptor.java +++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java @@ -76,7 +76,7 @@ public class MethodDescriptor extends FeatureDescriptor { } /** - * Gets the method that this MethodDescriptor encapsualtes. + * Gets the method that this MethodDescriptor encapsulates. * * @return The low-level description of the method */ diff --git a/jdk/src/share/classes/java/beans/PropertyDescriptor.java b/jdk/src/share/classes/java/beans/PropertyDescriptor.java index aed5ec57a4d..07149f9752d 100644 --- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java +++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java @@ -335,7 +335,7 @@ public class PropertyDescriptor extends FeatureDescriptor { */ void setClass0(Class clz) { if (getClass0() != null && clz.isAssignableFrom(getClass0())) { - // dont replace a subclass with a superclass + // don't replace a subclass with a superclass return; } super.setClass0(clz); diff --git a/jdk/src/share/classes/java/beans/PropertyEditorSupport.java b/jdk/src/share/classes/java/beans/PropertyEditorSupport.java index 246eca0ad61..ece9378aa0f 100644 --- a/jdk/src/share/classes/java/beans/PropertyEditorSupport.java +++ b/jdk/src/share/classes/java/beans/PropertyEditorSupport.java @@ -30,7 +30,7 @@ import java.beans.*; /** * This is a support class to help build property editors. *

          - * It can be used either as a base class or as a delagatee. + * It can be used either as a base class or as a delegate. */ public class PropertyEditorSupport implements PropertyEditor { diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java index b2b855867b5..897e5a8a4da 100644 --- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java +++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java @@ -302,7 +302,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer /** * This method may be overridden by subclasses to provide their own - * initialization behaviors. When invoked any resources requried by the + * initialization behaviors. When invoked any resources required by the * BeanContextChild should be obtained from the current BeanContext. */ @@ -317,7 +317,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer private void writeObject(ObjectOutputStream oos) throws IOException { /* - * dont serialize if we are delegated and the delegator isnt also + * don't serialize if we are delegated and the delegator is not also * serializable. */ diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java index ecf4017c657..fe976f21dd1 100644 --- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java +++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedListener.java @@ -38,7 +38,7 @@ public interface BeanContextServiceRevokedListener extends EventListener { /** * The service named has been revoked. getService requests for - * this service will no longer be satisifed. + * this service will no longer be satisfied. * @param bcsre the BeanContextServiceRevokedEvent received * by this listener. */ diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java index ca0942efef9..41cfa9d7a89 100644 --- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java +++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java @@ -620,7 +620,7 @@ public class BeanContextServicesSupport extends BeanContextSupport /** * subclasses can override this method to create new subclasses of - * BCSSServiceProvider without having to overrride addService() in + * BCSSServiceProvider without having to override addService() in * order to instantiate. * @param sc the class * @param bcsp the service provider diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java index a549e2dc317..43dfcb02c97 100644 --- a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java +++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java @@ -183,7 +183,7 @@ public class BeanContextSupport extends BeanContextChildSupport * into a BeanContext. *

          *

          - * The semantics of the beanName parameter are defined by java.beans.Beans.instantate. + * The semantics of the beanName parameter are defined by java.beans.Beans.instantiate. *

          * * @param beanName the name of the Bean to instantiate within this BeanContext diff --git a/jdk/src/share/classes/java/io/ByteArrayInputStream.java b/jdk/src/share/classes/java/io/ByteArrayInputStream.java index e58c6e64a64..ce0b8d1f183 100644 --- a/jdk/src/share/classes/java/io/ByteArrayInputStream.java +++ b/jdk/src/share/classes/java/io/ByteArrayInputStream.java @@ -275,7 +275,6 @@ class ByteArrayInputStream extends InputStream { * Closing a ByteArrayInputStream has no effect. The methods in * this class can be called after the stream has been closed without * generating an IOException. - *

          */ public void close() throws IOException { } diff --git a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java index d28d397b31c..cd3c139a27e 100644 --- a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java +++ b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java @@ -263,8 +263,6 @@ public class ByteArrayOutputStream extends OutputStream { * Closing a ByteArrayOutputStream has no effect. The methods in * this class can be called after the stream has been closed without * generating an IOException. - *

          - * */ public void close() throws IOException { } diff --git a/jdk/src/share/classes/java/io/Closeable.java b/jdk/src/share/classes/java/io/Closeable.java index 530cde86171..b4a1c81f004 100644 --- a/jdk/src/share/classes/java/io/Closeable.java +++ b/jdk/src/share/classes/java/io/Closeable.java @@ -34,7 +34,6 @@ import java.io.IOException; * * @since 1.5 */ -@FunctionalInterface public interface Closeable extends AutoCloseable { /** diff --git a/jdk/src/share/classes/java/io/DataInput.java b/jdk/src/share/classes/java/io/DataInput.java index 58a3a2bfd3f..c61aeb58eda 100644 --- a/jdk/src/share/classes/java/io/DataInput.java +++ b/jdk/src/share/classes/java/io/DataInput.java @@ -155,7 +155,7 @@ interface DataInput { * to the length of {@code b}. *

          * This method blocks until one of the - * following conditions occurs:

          + * following conditions occurs: *

            *
          • {@code b.length} * bytes of input data are available, in which @@ -197,7 +197,7 @@ interface DataInput { *

            * This method * blocks until one of the following conditions - * occurs:

            + * occurs: *

              *
            • {@code len} bytes * of input data are available, in which case @@ -316,8 +316,8 @@ interface DataInput { * be the second byte. The value * returned * is: - *

              (short)((a << 8) | (b & 0xff))
              -     * 
              + *
              {@code (short)((a << 8) | (b & 0xff))
              +     * }
              * This method * is suitable for reading the bytes written * by the {@code writeShort} method of @@ -337,8 +337,8 @@ interface DataInput { * be the first byte read and * {@code b} * be the second byte. The value returned is: - *

              (((a & 0xff) << 8) | (b & 0xff))
              -     * 
              + *
              {@code (((a & 0xff) << 8) | (b & 0xff))
              +     * }
              * This method is suitable for reading the bytes * written by the {@code writeShort} method * of interface {@code DataOutput} if @@ -359,8 +359,8 @@ interface DataInput { * be the first byte read and {@code b} * be the second byte. The value * returned is: - *

              (char)((a << 8) | (b & 0xff))
              -     * 
              + *
              {@code (char)((a << 8) | (b & 0xff))
              +     * }
              * This method * is suitable for reading bytes written by * the {@code writeChar} method of interface @@ -377,10 +377,10 @@ interface DataInput { * Reads four input bytes and returns an * {@code int} value. Let {@code a-d} * be the first through fourth bytes read. The value returned is: - *

              
              -     * (((a & 0xff) << 24) | ((b & 0xff) << 16) |
              -     *  ((c & 0xff) << 8) | (d & 0xff))
              -     * 
              + *
              {@code
              +     * (((a & 0xff) << 24) | ((b & 0xff) << 16) |
              +     *  ((c & 0xff) <<  8) | (d & 0xff))
              +     * }
              * This method is suitable * for reading bytes written by the {@code writeInt} * method of interface {@code DataOutput}. @@ -397,16 +397,16 @@ interface DataInput { * a {@code long} value. Let {@code a-h} * be the first through eighth bytes read. * The value returned is: - *

              
              -     * (((long)(a & 0xff) << 56) |
              -     *  ((long)(b & 0xff) << 48) |
              -     *  ((long)(c & 0xff) << 40) |
              -     *  ((long)(d & 0xff) << 32) |
              -     *  ((long)(e & 0xff) << 24) |
              -     *  ((long)(f & 0xff) << 16) |
              -     *  ((long)(g & 0xff) <<  8) |
              -     *  ((long)(h & 0xff)))
              -     * 
              + *
              {@code
              +     * (((long)(a & 0xff) << 56) |
              +     *  ((long)(b & 0xff) << 48) |
              +     *  ((long)(c & 0xff) << 40) |
              +     *  ((long)(d & 0xff) << 32) |
              +     *  ((long)(e & 0xff) << 24) |
              +     *  ((long)(f & 0xff) << 16) |
              +     *  ((long)(g & 0xff) <<  8) |
              +     *  ((long)(h & 0xff)))
              +     * }
              *

              * This method is suitable * for reading bytes written by the {@code writeLong} @@ -540,9 +540,9 @@ interface DataInput { * not match the bit pattern {@code 10xxxxxx}, * then a {@code UTFDataFormatException} * is thrown. Otherwise, the group is converted - * to the character:

              - *

              (char)(((a& 0x1F) << 6) | (b & 0x3F))
              -     * 
              + * to the character: + *
              {@code (char)(((a & 0x1F) << 6) | (b & 0x3F))
              +     * }
              * If the first byte of a group * matches the bit pattern {@code 1110xxxx}, * then the group consists of that byte {@code a} @@ -554,10 +554,10 @@ interface DataInput { * does not match the bit pattern {@code 10xxxxxx}, * then a {@code UTFDataFormatException} * is thrown. Otherwise, the group is converted - * to the character:

              - *

              
              -     * (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
              -     * 
              + * to the character: + *
              {@code
              +     * (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
              +     * }
              * If the first byte of a group matches the * pattern {@code 1111xxxx} or the pattern * {@code 10xxxxxx}, then a {@code UTFDataFormatException} diff --git a/jdk/src/share/classes/java/io/DataOutput.java b/jdk/src/share/classes/java/io/DataOutput.java index 07fbc3a927d..ce909d10238 100644 --- a/jdk/src/share/classes/java/io/DataOutput.java +++ b/jdk/src/share/classes/java/io/DataOutput.java @@ -134,11 +134,11 @@ interface DataOutput { * Writes two bytes to the output * stream to represent the value of the argument. * The byte values to be written, in the order - * shown, are:

              - *

              
              -     * (byte)(0xff & (v >> 8))
              -     * (byte)(0xff & v)
              -     *  

              + * shown, are: + *

              {@code
              +     * (byte)(0xff & (v >> 8))
              +     * (byte)(0xff & v)
              +     * }

              * The bytes written by this method may be * read by the readShort method * of interface DataInput , which @@ -156,10 +156,10 @@ interface DataOutput { * output stream. * The byte values to be written, in the order * shown, are: - *

              
              -     * (byte)(0xff & (v >> 8))
              -     * (byte)(0xff & v)
              -     * 

              + *

              {@code
              +     * (byte)(0xff & (v >> 8))
              +     * (byte)(0xff & v)
              +     * }

              * The bytes written by this method may be * read by the readChar method * of interface DataInput , which @@ -176,12 +176,12 @@ interface DataOutput { * comprised of four bytes, to the output stream. * The byte values to be written, in the order * shown, are: - *

              
              -     * (byte)(0xff & (v >> 24))
              -     * (byte)(0xff & (v >> 16))
              -     * (byte)(0xff & (v >>    8))
              -     * (byte)(0xff & v)
              -     * 

              + *

              {@code
              +     * (byte)(0xff & (v >> 24))
              +     * (byte)(0xff & (v >> 16))
              +     * (byte)(0xff & (v >>  8))
              +     * (byte)(0xff & v)
              +     * }

              * The bytes written by this method may be read * by the readInt method of interface * DataInput , which will then @@ -197,16 +197,16 @@ interface DataOutput { * comprised of eight bytes, to the output stream. * The byte values to be written, in the order * shown, are: - *

              
              -     * (byte)(0xff & (v >> 56))
              -     * (byte)(0xff & (v >> 48))
              -     * (byte)(0xff & (v >> 40))
              -     * (byte)(0xff & (v >> 32))
              -     * (byte)(0xff & (v >> 24))
              -     * (byte)(0xff & (v >> 16))
              -     * (byte)(0xff & (v >>  8))
              -     * (byte)(0xff & v)
              -     * 

              + *

              {@code
              +     * (byte)(0xff & (v >> 56))
              +     * (byte)(0xff & (v >> 48))
              +     * (byte)(0xff & (v >> 40))
              +     * (byte)(0xff & (v >> 32))
              +     * (byte)(0xff & (v >> 24))
              +     * (byte)(0xff & (v >> 16))
              +     * (byte)(0xff & (v >>  8))
              +     * (byte)(0xff & v)
              +     * }

              * The bytes written by this method may be * read by the readLong method * of interface DataInput , which @@ -314,24 +314,24 @@ interface DataOutput { * If a character c * is in the range \u0001 through * \u007f, it is represented - * by one byte:

              + * by one byte: *

              (byte)c 

              * If a character c is \u0000 * or is in the range \u0080 * through \u07ff, then it is * represented by two bytes, to be written - * in the order shown:

              
              -     * (byte)(0xc0 | (0x1f & (c >> 6)))
              -     * (byte)(0x80 | (0x3f & c))
              -     *  

              If a character + * in the order shown:

              {@code
              +     * (byte)(0xc0 | (0x1f & (c >> 6)))
              +     * (byte)(0x80 | (0x3f & c))
              +     * }

              If a character * c is in the range \u0800 * through uffff, then it is * represented by three bytes, to be written - * in the order shown:

              
              -     * (byte)(0xe0 | (0x0f & (c >> 12)))
              -     * (byte)(0x80 | (0x3f & (c >>  6)))
              -     * (byte)(0x80 | (0x3f & c))
              -     *  

              First, + * in the order shown:

              {@code
              +     * (byte)(0xe0 | (0x0f & (c >> 12)))
              +     * (byte)(0x80 | (0x3f & (c >>  6)))
              +     * (byte)(0x80 | (0x3f & c))
              +     * }

              First, * the total number of bytes needed to represent * all the characters of s is * calculated. If this number is larger than diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java index bafcea5a839..846ddc3004d 100644 --- a/jdk/src/share/classes/java/io/File.java +++ b/jdk/src/share/classes/java/io/File.java @@ -1685,7 +1685,7 @@ public class File * operation will fail if the user does not have permission to * change the access permissions of this abstract pathname. If * executable is false and the underlying - * file system does not implement an excute permission, then the + * file system does not implement an execute permission, then the * operation will fail. * * @throws SecurityException diff --git a/jdk/src/share/classes/java/io/FilePermission.java b/jdk/src/share/classes/java/io/FilePermission.java index e70d292e0c8..89f2c33287a 100644 --- a/jdk/src/share/classes/java/io/FilePermission.java +++ b/jdk/src/share/classes/java/io/FilePermission.java @@ -55,7 +55,7 @@ import sun.security.util.SecurityConstants; * a list of one or more comma-separated keywords. The possible keywords are * "read", "write", "execute", "delete", and "readlink". Their meaning is * defined as follows: - *

              + * *

              *
              read
              read permission *
              write
              write permission @@ -297,11 +297,11 @@ public final class FilePermission extends Permission implements Serializable { /** * Checks if this FilePermission object "implies" the specified permission. *

              - * More specifically, this method returns true if:

              + * More specifically, this method returns true if: *

                - *
              • p is an instanceof FilePermission,

                + *

              • p is an instanceof FilePermission, *
              • p's actions are a proper subset of this - * object's actions, and

                + * object's actions, and *

              • p's pathname is implied by this object's * pathname. For example, "/tmp/*" implies "/tmp/foo", since * "/tmp/*" encompasses all files in the "/tmp" directory, diff --git a/jdk/src/share/classes/java/io/Flushable.java b/jdk/src/share/classes/java/io/Flushable.java index 8912316d4d2..fe90fbdf6e1 100644 --- a/jdk/src/share/classes/java/io/Flushable.java +++ b/jdk/src/share/classes/java/io/Flushable.java @@ -34,7 +34,6 @@ import java.io.IOException; * * @since 1.5 */ -@FunctionalInterface public interface Flushable { /** diff --git a/jdk/src/share/classes/java/io/InputStream.java b/jdk/src/share/classes/java/io/InputStream.java index 3c7ff17f609..6c46a40a8a0 100644 --- a/jdk/src/share/classes/java/io/InputStream.java +++ b/jdk/src/share/classes/java/io/InputStream.java @@ -306,8 +306,7 @@ public abstract class InputStream implements Closeable { * *

                The general contract of reset is: * - *

                  - * + *
                    *
                  • If the method markSupported returns * true, then: * diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index c71681c255d..15ecd9bee65 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -109,7 +109,7 @@ import sun.reflect.misc.ReflectUtil; * *

                    Serializable classes that require special handling during the * serialization and deserialization process should implement the following - * methods:

                    + * methods: * *

                      * private void writeObject(java.io.ObjectOutputStream stream)
                    diff --git a/jdk/src/share/classes/java/io/ObjectStreamConstants.java b/jdk/src/share/classes/java/io/ObjectStreamConstants.java
                    index ddbada963b1..89265fb4fb5 100644
                    --- a/jdk/src/share/classes/java/io/ObjectStreamConstants.java
                    +++ b/jdk/src/share/classes/java/io/ObjectStreamConstants.java
                    @@ -219,7 +219,7 @@ public interface ObjectStreamConstants {
                         * This protocol is written by JVM 1.2.
                         *
                         * Externalizable data is written in block data mode and is
                    -    * terminated with TC_ENDBLOCKDATA. Externalizable classdescriptor
                    +    * terminated with TC_ENDBLOCKDATA. Externalizable class descriptor
                         * flags has SC_BLOCK_DATA enabled. JVM 1.1.6 and greater can
                         * read this format change.
                         *
                    diff --git a/jdk/src/share/classes/java/io/PipedInputStream.java b/jdk/src/share/classes/java/io/PipedInputStream.java
                    index af07de5b4e6..83dde31ed42 100644
                    --- a/jdk/src/share/classes/java/io/PipedInputStream.java
                    +++ b/jdk/src/share/classes/java/io/PipedInputStream.java
                    @@ -172,15 +172,14 @@ public class PipedInputStream extends InputStream {
                          * unconnected piped output stream and snk
                          * is an unconnected piped input stream, they
                          * may be connected by either the call:
                    -     * 

                    + * *

                    snk.connect(src) 
                    *

                    * or the call: - *

                    + * *

                    src.connect(snk) 
                    *

                    - * The two - * calls have the same effect. + * The two calls have the same effect. * * @param src The piped output stream to connect to. * @exception IOException if an I/O error occurs. diff --git a/jdk/src/share/classes/java/io/PipedReader.java b/jdk/src/share/classes/java/io/PipedReader.java index bb86022af6f..34716466a44 100644 --- a/jdk/src/share/classes/java/io/PipedReader.java +++ b/jdk/src/share/classes/java/io/PipedReader.java @@ -145,15 +145,14 @@ public class PipedReader extends Reader { * unconnected piped writer and snk * is an unconnected piped reader, they * may be connected by either the call: - *

                    + * *

                    snk.connect(src) 
                    *

                    * or the call: - *

                    + * *

                    src.connect(snk) 
                    *

                    - * The two - * calls have the same effect. + * The two calls have the same effect. * * @param src The piped writer to connect to. * @exception IOException if an I/O error occurs. diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java index b803c6a657f..d57984e298b 100644 --- a/jdk/src/share/classes/java/io/PrintStream.java +++ b/jdk/src/share/classes/java/io/PrintStream.java @@ -303,7 +303,7 @@ public class PrintStream extends FilterOutputStream * creating the file * * @throws SecurityException - * If a security manager is presentand {@link + * If a security manager is present and {@link * SecurityManager#checkWrite checkWrite(file.getPath())} * denies write access to the file * diff --git a/jdk/src/share/classes/java/io/RandomAccessFile.java b/jdk/src/share/classes/java/io/RandomAccessFile.java index fd1c712d1e3..c48aa99b32f 100644 --- a/jdk/src/share/classes/java/io/RandomAccessFile.java +++ b/jdk/src/share/classes/java/io/RandomAccessFile.java @@ -784,7 +784,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { *

                    *

                    * then the result is equal to: - *

                    +     * 
                          *     ((long)b1 << 56) + ((long)b2 << 48)
                          *     + ((long)b3 << 40) + ((long)b4 << 32)
                          *     + ((long)b5 << 24) + ((long)b6 << 16)
                    diff --git a/jdk/src/share/classes/java/io/Serializable.java b/jdk/src/share/classes/java/io/Serializable.java
                    index fc717f7570e..2f7bea1833e 100644
                    --- a/jdk/src/share/classes/java/io/Serializable.java
                    +++ b/jdk/src/share/classes/java/io/Serializable.java
                    @@ -55,7 +55,7 @@ package java.io;
                      *
                      * Classes that require special handling during the serialization and
                      * deserialization process must implement special methods with these exact
                    - * signatures: 

                    + * signatures: * *

                      * private void writeObject(java.io.ObjectOutputStream out)
                    @@ -101,7 +101,7 @@ package java.io;
                      *
                      * 

                    Serializable classes that need to designate an alternative object to be * used when writing an object to the stream should implement this - * special method with the exact signature:

                    + * special method with the exact signature: * *

                      * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;
                    @@ -115,7 +115,7 @@ package java.io;
                      *
                      * Classes that need to designate a replacement when an instance of it
                      * is read from the stream should implement this special method with the
                    - * exact signature.

                    + * exact signature. * *

                      * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException;
                    @@ -133,7 +133,7 @@ package java.io;
                      * deserialization will result in an {@link InvalidClassException}.  A
                      * serializable class can declare its own serialVersionUID explicitly by
                      * declaring a field named "serialVersionUID" that must be static,
                    - * final, and of type long:

                    + * final, and of type long: * *

                      * ANY-ACCESS-MODIFIER static final long serialVersionUID = 42L;
                    diff --git a/jdk/src/share/classes/java/io/SerializablePermission.java b/jdk/src/share/classes/java/io/SerializablePermission.java
                    index eaa2913243d..b208d24d2f5 100644
                    --- a/jdk/src/share/classes/java/io/SerializablePermission.java
                    +++ b/jdk/src/share/classes/java/io/SerializablePermission.java
                    @@ -43,7 +43,6 @@ import java.util.StringTokenizer;
                      * The following table lists all the possible SerializablePermission target names,
                      * and for each provides a description of what the permission allows
                      * and a discussion of the risks of granting code the permission.
                    - * 

                    * *

      +
      1. Frame "F" is shown
      2. Document-modal dialog "Di" is shown
        -
      3. F becomes blocked by Di — it's in the same document
        +
      4. F becomes blocked by Di — it's in the same document
      5. Document-modal dialog "Dii" is shown
        -
      6. Di becomes blocked by Dii — it's in the +
      7. Di becomes blocked by Dii — it's in the same document

      +
      +
      1. Frame "F" is shown
      2. Document-modal dialog "Di" is shown
        -
      3. F becomes blocked by Di — it's in the same document
        +
      4. F becomes blocked by Di — it's in the same document
      5. Document-modal dialog "Dii" is shown
        -
      6. Di becomes blocked by Dii — +
      7. Di becomes blocked by Dii — it's in the same document
      8. Di is hidden
        -
      9. F becomes blocked by Dii — it's in the same document
        +
      10. F becomes blocked by Dii — it's in the same document

      +
      1. Frame "F" is shown
      2. Toolkit-modal dialog "Di" is created, but not shown
      3. Document-modal dialog "Dii" is shown
        -
      4. F becomes blocked by Dii — it's in the same document
        +
      5. F becomes blocked by Dii — it's in the same document
      6. Application-modal dialog "Diii" is shown
        -
      7. Dii becomes blocked by Diii — +
      8. Dii becomes blocked by Diii — it's in the same application
      9. Di is shown
        -
      10. Di becomes blocked by Dii — it's its owner
        -
      11. Diii remains unblocked — it blocks Dii and +
      12. Di becomes blocked by Dii — it's its owner
        +
      13. Diii remains unblocked — it blocks Dii and Dii blocks Di

      +
      +
      1. Frame "F" is shown
      2. Toolkit-modal dialog "Di" is created, but not shown
      3. Document-modal dialog "Dii" is shown
        -
      4. F becomes blocked by Dii — it's in the same document
        +
      5. F becomes blocked by Dii — it's in the same document
      6. Application-modal dialog "Diii" is shown
        -
      7. Dii becomes blocked by Diii — it's in the +
      8. Dii becomes blocked by Diii — it's in the same application
      9. Di is shown
        -
      10. Diii becomes blocked by Di — Di +
      11. Diii becomes blocked by Di — Di is not blocked
      12. Di remains unblocked

      +
      * diff --git a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java index 3260da6ae99..3cde60d6437 100644 --- a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java @@ -330,9 +330,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * characters to be copied is {@code srcEnd-srcBegin}. The * characters are copied into the subarray of {@code dst} starting * at index {@code dstBegin} and ending at index: - *

      +     * 
      {@code
            * dstbegin + (srcEnd-srcBegin) - 1
      -     * 
      + * } * * @param srcBegin start copying at this offset. * @param srcEnd stop copying at this offset. @@ -859,16 +859,16 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * *

      An invocation of this method of the form * - *

      -     * sb.subSequence(begin, end)
      + *
      {@code
      +     * sb.subSequence(begin, end)}
      * * behaves in exactly the same way as the invocation * - *
      -     * sb.substring(begin, end)
      + *
      {@code
      +     * sb.substring(begin, end)}
      * * This method is provided so that this class can - * implement the {@link CharSequence} interface.

      + * implement the {@link CharSequence} interface. * * @param start the start index, inclusive. * @param end the end index, exclusive. @@ -1287,9 +1287,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * Returns the index within this string of the first occurrence of the * specified substring. The integer returned is the smallest value * k such that: - *
      +     * 
      {@code
            * this.toString().startsWith(str, k)
      -     * 
      + * } * is {@code true}. * * @param str any string. @@ -1306,10 +1306,10 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * Returns the index within this string of the first occurrence of the * specified substring, starting at the specified index. The integer * returned is the smallest value {@code k} for which: - *
      +     * 
      {@code
            *     k >= Math.min(fromIndex, this.length()) &&
            *                   this.toString().startsWith(str, k)
      -     * 
      + * } * If no such value of k exists, then -1 is returned. * * @param str the substring for which to search. @@ -1326,9 +1326,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * of the specified substring. The rightmost empty string "" is * considered to occur at the index value {@code this.length()}. * The returned index is the largest value k such that - *
      +     * 
      {@code
            * this.toString().startsWith(str, k)
      -     * 
      + * } * is true. * * @param str the substring to search for. @@ -1345,10 +1345,10 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * Returns the index within this string of the last occurrence of the * specified substring. The integer returned is the largest value k * such that: - *
      +     * 
      {@code
            *     k <= Math.min(fromIndex, this.length()) &&
            *                   this.toString().startsWith(str, k)
      -     * 
      + * } * If no such value of k exists, then -1 is returned. * * @param str the substring to search for. diff --git a/jdk/src/share/classes/java/lang/ArrayStoreException.java b/jdk/src/share/classes/java/lang/ArrayStoreException.java index aec35f2de34..96fa7447a79 100644 --- a/jdk/src/share/classes/java/lang/ArrayStoreException.java +++ b/jdk/src/share/classes/java/lang/ArrayStoreException.java @@ -29,7 +29,7 @@ package java.lang; * Thrown to indicate that an attempt has been made to store the * wrong type of object into an array of objects. For example, the * following code generates an ArrayStoreException: - *

      + * 
        *     Object x[] = new String[3];
        *     x[0] = new Integer(0);
        * 
      diff --git a/jdk/src/share/classes/java/lang/AutoCloseable.java b/jdk/src/share/classes/java/lang/AutoCloseable.java index be47cd0835f..135d9fe746b 100644 --- a/jdk/src/share/classes/java/lang/AutoCloseable.java +++ b/jdk/src/share/classes/java/lang/AutoCloseable.java @@ -48,7 +48,6 @@ package java.lang; * @author Josh Bloch * @since 1.7 */ -@FunctionalInterface public interface AutoCloseable { /** * Closes this resource, relinquishing any underlying resources. diff --git a/jdk/src/share/classes/java/lang/Byte.java b/jdk/src/share/classes/java/lang/Byte.java index 275e33de5a7..3a894a5f5e2 100644 --- a/jdk/src/share/classes/java/lang/Byte.java +++ b/jdk/src/share/classes/java/lang/Byte.java @@ -244,7 +244,7 @@ public final class Byte extends Number implements Comparable { *
      Signopt {@code 0X} HexDigits *
      Signopt {@code #} HexDigits *
      Signopt {@code 0} OctalDigits - *

      + * *

      Sign: *
      {@code -} *
      {@code +} diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java index 41576cca8d8..0926758b054 100644 --- a/jdk/src/share/classes/java/lang/Character.java +++ b/jdk/src/share/classes/java/lang/Character.java @@ -5394,7 +5394,7 @@ class Character implements java.io.Serializable, Comparable { * Other_Lowercase as defined by the Unicode Standard. *

      * The following are examples of lowercase characters: - *

      +     * 
            * a b c d e f g h i j k l m n o p q r s t u v w x y z
            * '\u00DF' '\u00E0' '\u00E1' '\u00E2' '\u00E3' '\u00E4' '\u00E5' '\u00E6'
            * '\u00E7' '\u00E8' '\u00E9' '\u00EA' '\u00EB' '\u00EC' '\u00ED' '\u00EE'
      @@ -5430,7 +5430,7 @@ class Character implements java.io.Serializable, Comparable {
            * Other_Lowercase as defined by the Unicode Standard.
            * 

      * The following are examples of lowercase characters: - *

      +     * 
            * a b c d e f g h i j k l m n o p q r s t u v w x y z
            * '\u00DF' '\u00E0' '\u00E1' '\u00E2' '\u00E3' '\u00E4' '\u00E5' '\u00E6'
            * '\u00E7' '\u00E8' '\u00E9' '\u00EA' '\u00EB' '\u00EC' '\u00ED' '\u00EE'
      @@ -5461,14 +5461,14 @@ class Character implements java.io.Serializable, Comparable {
            * or it has contributory property Other_Uppercase as defined by the Unicode Standard.
            * 

      * The following are examples of uppercase characters: - *

      +     * 
            * A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
            * '\u00C0' '\u00C1' '\u00C2' '\u00C3' '\u00C4' '\u00C5' '\u00C6' '\u00C7'
            * '\u00C8' '\u00C9' '\u00CA' '\u00CB' '\u00CC' '\u00CD' '\u00CE' '\u00CF'
            * '\u00D0' '\u00D1' '\u00D2' '\u00D3' '\u00D4' '\u00D5' '\u00D6' '\u00D8'
            * '\u00D9' '\u00DA' '\u00DB' '\u00DC' '\u00DD' '\u00DE'
            * 
      - *

      Many other Unicode characters are uppercase too.

      + *

      Many other Unicode characters are uppercase too. * *

      Note: This method cannot handle supplementary characters. To support @@ -5496,7 +5496,7 @@ class Character implements java.io.Serializable, Comparable { * or it has contributory property Other_Uppercase as defined by the Unicode Standard. *

      * The following are examples of uppercase characters: - *

      +     * 
            * A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
            * '\u00C0' '\u00C1' '\u00C2' '\u00C3' '\u00C4' '\u00C5' '\u00C6' '\u00C7'
            * '\u00C8' '\u00C9' '\u00CA' '\u00CB' '\u00CC' '\u00CD' '\u00CE' '\u00CF'
      @@ -5540,7 +5540,7 @@ class Character implements java.io.Serializable, Comparable {
            * 
    • {@code LATIN CAPITAL LETTER N WITH SMALL LETTER J} *
    • {@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z} * - *

      Many other Unicode characters are titlecase too.

      + *

      Many other Unicode characters are titlecase too. * *

      Note: This method cannot handle supplementary characters. To support diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index 500f70d3cb5..45c00913f6c 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -91,7 +91,7 @@ import sun.reflect.misc.ReflectUtil; *

      The following example uses a {@code Class} object to print the * class name of an object: * - *

      + * 
        *     void printClassName(Object obj) {
        *         System.out.println("The class of " + obj +
        *                            " is " + obj.getClass().getName());
      @@ -103,7 +103,7 @@ import sun.reflect.misc.ReflectUtil;
        * The Java™ Language Specification.
        * For example:
        *
      - * 

      + *
      * {@code System.out.println("The name of class Foo is: "+Foo.class.getName());} *
      * @@ -1571,6 +1571,10 @@ public final class Class implements java.io.Serializable, *

      If this {@code Class} object represents a primitive type or void, * then the returned array has length 0. * + *

      Static methods declared in superinterfaces of the class or interface + * represented by this {@code Class} object are not considered members of + * the class or interface. + * *

      The elements in the returned array are not sorted and are not in any * particular order. * @@ -1729,6 +1733,10 @@ public final class Class implements java.io.Serializable, *

      If this {@code Class} object represents an array type, then this * method does not find the {@code clone()} method. * + *

      Static methods declared in superinterfaces of the class or interface + * represented by this {@code Class} object are not considered members of + * the class or interface. + * * @param name the name of the method * @param parameterTypes the list of parameters * @return the {@code Method} object that matches the specified @@ -1752,7 +1760,7 @@ public final class Class implements java.io.Serializable, public Method getMethod(String name, Class... parameterTypes) throws NoSuchMethodException, SecurityException { checkMemberAccess(Member.PUBLIC, Reflection.getCallerClass(), true); - Method method = getMethod0(name, parameterTypes); + Method method = getMethod0(name, parameterTypes, true); if (method == null) { throw new NoSuchMethodException(getName() + "." + name + argumentTypesToString(parameterTypes)); } @@ -2727,6 +2735,14 @@ public final class Class implements java.io.Serializable, } } + void addAllNonStatic(Method[] methods) { + for (Method candidate : methods) { + if (!Modifier.isStatic(candidate.getModifiers())) { + add(candidate); + } + } + } + int length() { return length; } @@ -2797,7 +2813,7 @@ public final class Class implements java.io.Serializable, MethodArray inheritedMethods = new MethodArray(); Class[] interfaces = getInterfaces(); for (int i = 0; i < interfaces.length; i++) { - inheritedMethods.addAll(interfaces[i].privateGetPublicMethods()); + inheritedMethods.addAllNonStatic(interfaces[i].privateGetPublicMethods()); } if (!isInterface()) { Class c = getSuperclass(); @@ -2900,7 +2916,7 @@ public final class Class implements java.io.Serializable, } - private Method getMethod0(String name, Class[] parameterTypes) { + private Method getMethod0(String name, Class[] parameterTypes, boolean includeStaticMethods) { // Note: the intent is that the search algorithm this routine // uses be equivalent to the ordering imposed by // privateGetPublicMethods(). It fetches only the declared @@ -2913,25 +2929,23 @@ public final class Class implements java.io.Serializable, if ((res = searchMethods(privateGetDeclaredMethods(true), name, parameterTypes)) != null) { - return res; + if (includeStaticMethods || !Modifier.isStatic(res.getModifiers())) + return res; } // Search superclass's methods if (!isInterface()) { Class c = getSuperclass(); if (c != null) { - if ((res = c.getMethod0(name, parameterTypes)) != null) { + if ((res = c.getMethod0(name, parameterTypes, true)) != null) { return res; } } } // Search superinterfaces' methods Class[] interfaces = getInterfaces(); - for (int i = 0; i < interfaces.length; i++) { - Class c = interfaces[i]; - if ((res = c.getMethod0(name, parameterTypes)) != null) { + for (Class c : interfaces) + if ((res = c.getMethod0(name, parameterTypes, false)) != null) return res; - } - } // Not found return null; } @@ -3300,7 +3314,10 @@ public final class Class implements java.io.Serializable, public A[] getAnnotationsByType(Class annotationClass) { Objects.requireNonNull(annotationClass); - return AnnotationSupport.getMultipleAnnotations(annotationData().annotations, annotationClass); + AnnotationData annotationData = annotationData(); + return AnnotationSupport.getAssociatedAnnotations(annotationData.declaredAnnotations, + this, + annotationClass); } /** @@ -3330,7 +3347,8 @@ public final class Class implements java.io.Serializable, public A[] getDeclaredAnnotationsByType(Class annotationClass) { Objects.requireNonNull(annotationClass); - return AnnotationSupport.getMultipleAnnotations(annotationData().declaredAnnotations, annotationClass); + return AnnotationSupport.getDirectlyAndIndirectlyPresent(annotationData().declaredAnnotations, + annotationClass); } /** @@ -3424,6 +3442,10 @@ public final class Class implements java.io.Serializable, return annotationType; } + Map, Annotation> getDeclaredAnnotationMap() { + return annotationData().declaredAnnotations; + } + /* Backing store of user-defined values pertaining to this class. * Maintained by the ClassValue class. */ diff --git a/jdk/src/share/classes/java/lang/ClassCastException.java b/jdk/src/share/classes/java/lang/ClassCastException.java index fc9b2616eff..93b61630d21 100644 --- a/jdk/src/share/classes/java/lang/ClassCastException.java +++ b/jdk/src/share/classes/java/lang/ClassCastException.java @@ -29,7 +29,7 @@ package java.lang; * Thrown to indicate that the code has attempted to cast an object * to a subclass of which it is not an instance. For example, the * following code generates a ClassCastException: - *

      + * 
        *     Object x = new Integer(0);
        *     System.out.println((String)x);
        * 
      diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index 7aa5087ad2f..875f5ec8e97 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -362,7 +362,7 @@ public abstract class ClassLoader { * default implementation of this method searches for classes in the * following order: * - *

        + *
          * *
        1. Invoke {@link #findLoadedClass(String)} to check if the class * has already been loaded.

        2. @@ -488,7 +488,7 @@ public abstract class ClassLoader { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (ReflectUtil.isNonPublicProxyClass(cls)) { - for (Class intf: cls.getInterfaces()) { + for (Class intf: cls.getInterfaces()) { checkPackageAccess(intf, pd); } return; diff --git a/jdk/src/share/classes/java/lang/ClassValue.java b/jdk/src/share/classes/java/lang/ClassValue.java index be190c0d4eb..676c2eccb30 100644 --- a/jdk/src/share/classes/java/lang/ClassValue.java +++ b/jdk/src/share/classes/java/lang/ClassValue.java @@ -692,7 +692,7 @@ public abstract class ClassValue { /** Remove all stale entries, everywhere. */ private void removeStaleEntries() { - Entry[] cache = getCache(); + Entry[] cache = getCache(); removeStaleEntries(cache, 0, cache.length + PROBE_LIMIT - 1); } diff --git a/jdk/src/share/classes/java/lang/Comparable.java b/jdk/src/share/classes/java/lang/Comparable.java index 9d607679a61..a88cf167fbd 100644 --- a/jdk/src/share/classes/java/lang/Comparable.java +++ b/jdk/src/share/classes/java/lang/Comparable.java @@ -93,7 +93,6 @@ import java.util.*; * @see java.util.Comparator * @since 1.2 */ -@FunctionalInterface public interface Comparable { /** * Compares this object with the specified object for order. Returns a diff --git a/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java b/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java index 9f3d81624e9..d2ed9d91b50 100644 --- a/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java +++ b/jdk/src/share/classes/java/lang/ConditionalSpecialCasing.java @@ -74,7 +74,6 @@ final class ConditionalSpecialCasing { new Entry(0x00CC, new char[]{0x0069, 0x0307, 0x0300}, new char[]{0x00CC}, "lt", 0), // # LATIN CAPITAL LETTER I WITH GRAVE new Entry(0x00CD, new char[]{0x0069, 0x0307, 0x0301}, new char[]{0x00CD}, "lt", 0), // # LATIN CAPITAL LETTER I WITH ACUTE new Entry(0x0128, new char[]{0x0069, 0x0307, 0x0303}, new char[]{0x0128}, "lt", 0), // # LATIN CAPITAL LETTER I WITH TILDE - new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "lt", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE //# ================================================================================ //# Turkish and Azeri @@ -85,10 +84,7 @@ final class ConditionalSpecialCasing { new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "tr", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "az", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN SMALL LETTER I - new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN SMALL LETTER I - //# ================================================================================ - //# Other - new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "en", 0), // # LATIN CAPITALLETTER I WITH DOT ABOVE + new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0) // # LATIN SMALL LETTER I }; // A hash table that contains the above entries diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java index 1b1aece8122..690ca6a8dc3 100644 --- a/jdk/src/share/classes/java/lang/Double.java +++ b/jdk/src/share/classes/java/lang/Double.java @@ -361,15 +361,11 @@ public final class Double extends Number implements Comparable { *
          SignedInteger * * - *

          - * *

          *
          HexFloatingPointLiteral: *
          HexSignificand BinaryExponent FloatTypeSuffixopt *
          * - *

          - * *

          *
          HexSignificand: *
          HexNumeral @@ -380,15 +376,11 @@ public final class Double extends Number implements Comparable { * {@code .} HexDigits *
          * - *

          - * *

          *
          BinaryExponent: *
          BinaryExponentIndicator SignedInteger *
          * - *

          - * *

          *
          BinaryExponentIndicator: *
          {@code p} diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java index e130e92314e..5cc28f99bff 100644 --- a/jdk/src/share/classes/java/lang/Float.java +++ b/jdk/src/share/classes/java/lang/Float.java @@ -321,15 +321,11 @@ public final class Float extends Number implements Comparable { *
          SignedInteger *
          * - *

          - * *

          *
          HexFloatingPointLiteral: *
          HexSignificand BinaryExponent FloatTypeSuffixopt *
          * - *

          - * *

          *
          HexSignificand: *
          HexNumeral @@ -340,15 +336,11 @@ public final class Float extends Number implements Comparable { * {@code .} HexDigits *
          * - *

          - * *

          *
          BinaryExponent: *
          BinaryExponentIndicator SignedInteger *
          * - *

          - * *

          *
          BinaryExponentIndicator: *
          {@code p} diff --git a/jdk/src/share/classes/java/lang/Integer.java b/jdk/src/share/classes/java/lang/Integer.java index 7ee4b48855e..c5d971a54ae 100644 --- a/jdk/src/share/classes/java/lang/Integer.java +++ b/jdk/src/share/classes/java/lang/Integer.java @@ -1123,7 +1123,7 @@ public final class Integer extends Number implements Comparable { *
          Signopt {@code 0X} HexDigits *
          Signopt {@code #} HexDigits *
          Signopt {@code 0} OctalDigits - *

          + * *

          Sign: *
          {@code -} *
          {@code +} diff --git a/jdk/src/share/classes/java/lang/Iterable.java b/jdk/src/share/classes/java/lang/Iterable.java index fe9086f6874..eed39388a8f 100644 --- a/jdk/src/share/classes/java/lang/Iterable.java +++ b/jdk/src/share/classes/java/lang/Iterable.java @@ -42,7 +42,6 @@ import java.util.function.Consumer; * @since 1.5 * @jls 14.14.2 The enhanced for statement */ -@FunctionalInterface public interface Iterable { /** * Returns an iterator over elements of type {@code T}. @@ -52,10 +51,12 @@ public interface Iterable { Iterator iterator(); /** - * Performs the given action on the contents of the {@code Iterable}, in the - * order elements occur when iterating, until all elements have been - * processed or the action throws an exception. Errors or runtime - * exceptions thrown by the action are relayed to the caller. + * Performs the given action for each element of the {@code Iterable} + * until all elements have been processed or the action throws an + * exception. Unless otherwise specified by the implementing class, + * actions are performed in the order of iteration (if an iteration order + * is specified). Exceptions thrown by the action are relayed to the + * caller. * * @implSpec *

          The default implementation behaves as if: @@ -100,4 +101,3 @@ public interface Iterable { return Spliterators.spliteratorUnknownSize(iterator(), 0); } } - diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java index bfaf0c4412f..fa43fa4d0b5 100644 --- a/jdk/src/share/classes/java/lang/Long.java +++ b/jdk/src/share/classes/java/lang/Long.java @@ -853,7 +853,7 @@ public final class Long extends Number implements Comparable { *

          Signopt {@code 0X} HexDigits *
          Signopt {@code #} HexDigits *
          Signopt {@code 0} OctalDigits - *

          + * *

          Sign: *
          {@code -} *
          {@code +} diff --git a/jdk/src/share/classes/java/lang/Readable.java b/jdk/src/share/classes/java/lang/Readable.java index e3d08d34b62..c7a3d1a800a 100644 --- a/jdk/src/share/classes/java/lang/Readable.java +++ b/jdk/src/share/classes/java/lang/Readable.java @@ -34,7 +34,6 @@ import java.io.IOException; * * @since 1.5 */ -@FunctionalInterface public interface Readable { /** diff --git a/jdk/src/share/classes/java/lang/RuntimePermission.java b/jdk/src/share/classes/java/lang/RuntimePermission.java index 6dcbc275e9e..9da131ba938 100644 --- a/jdk/src/share/classes/java/lang/RuntimePermission.java +++ b/jdk/src/share/classes/java/lang/RuntimePermission.java @@ -47,7 +47,6 @@ import java.util.StringTokenizer; * The following table lists all the possible RuntimePermission target names, * and for each provides a description of what the permission allows * and a discussion of the risks of granting code the permission. - *

          * *

    • diff --git a/jdk/src/share/classes/java/lang/SecurityManager.java b/jdk/src/share/classes/java/lang/SecurityManager.java index 3565082033c..635f6db093e 100644 --- a/jdk/src/share/classes/java/lang/SecurityManager.java +++ b/jdk/src/share/classes/java/lang/SecurityManager.java @@ -56,7 +56,7 @@ import sun.security.util.SecurityConstants; * are called by various methods in the Java libraries before those * methods perform certain potentially sensitive operations. The * invocation of such a check method typically looks like this: - *

      + * 
        *     SecurityManager security = System.getSecurityManager();
        *     if (security != null) {
        *         security.checkXXX(argument,  . . . );
      @@ -323,7 +323,7 @@ class SecurityManager {
            * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors.
            * 

      * This method will return - * null in the following three cases:

      + * null in the following three cases: *

        *
      1. All methods on the execution stack are from classes * defined using the system class loader or one of its ancestors. @@ -370,7 +370,7 @@ class SecurityManager { * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. *

        * This method will return - * null in the following three cases:

        + * null in the following three cases: *

          *
        1. All methods on the execution stack are from classes * defined using the system class loader or one of its ancestors. @@ -429,7 +429,7 @@ class SecurityManager { * by {@link ClassLoader#getSystemClassLoader}) or one of its ancestors. *

          * This method will return - * -1 in the following three cases:

          + * -1 in the following three cases: *

            *
          1. All methods on the execution stack are from classes * defined using the system class loader or one of its ancestors. @@ -1281,7 +1281,6 @@ class SecurityManager { * This method calls checkPermission with the * PropertyPermission(key, "read") permission. *

            - *

            * If you override this method, then you should make a call to * super.checkPropertyAccess * at the point the overridden method would normally throw an @@ -1714,7 +1713,7 @@ class SecurityManager { throw new NullPointerException("class can't be null"); } if (which != Member.PUBLIC) { - Class stack[] = getClassContext(); + Class stack[] = getClassContext(); /* * stack depth of 4 should be the caller of one of the * methods in java.lang.Class that invoke checkMember diff --git a/jdk/src/share/classes/java/lang/Short.java b/jdk/src/share/classes/java/lang/Short.java index c7641807c56..9fb3913beae 100644 --- a/jdk/src/share/classes/java/lang/Short.java +++ b/jdk/src/share/classes/java/lang/Short.java @@ -249,7 +249,7 @@ public final class Short extends Number implements Comparable { *

            Signopt {@code 0X} HexDigits *
            Signopt {@code #} HexDigits *
            Signopt {@code 0} OctalDigits - *

            + * *

            Sign: *
            {@code -} *
            {@code +} diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java index 2231aa3bb71..9223c0ab54f 100644 --- a/jdk/src/share/classes/java/lang/String.java +++ b/jdk/src/share/classes/java/lang/String.java @@ -47,16 +47,16 @@ import java.util.regex.PatternSyntaxException; * Strings are constant; their values cannot be changed after they * are created. String buffers support mutable strings. * Because String objects are immutable they can be shared. For example: - *

            + * 
              *     String str = "abc";
              * 

            * is equivalent to: - *

            + * 
              *     char data[] = {'a', 'b', 'c'};
              *     String str = new String(data);
              * 

            * Here are some more examples of how strings can be used: - *

            + * 
              *     System.out.println("abc");
              *     String cde = "cde";
              *     System.out.println("abc" + cde);
            @@ -786,7 +786,7 @@ public final class String
                  * {@code srcEnd-srcBegin}). The characters are copied into the
                  * subarray of {@code dst} starting at index {@code dstBegin}
                  * and ending at index:
            -     * 

            +     * 
                  *     dstbegin + (srcEnd-srcBegin) - 1
                  * 
            * @@ -2598,21 +2598,14 @@ public final class String } if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale); - } else if (srcChar == '\u0130') { // LATIN CAPITAL LETTER I DOT - lowerChar = Character.ERROR; } else { lowerChar = Character.toLowerCase(srcChar); } if ((lowerChar == Character.ERROR) || (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) { if (lowerChar == Character.ERROR) { - if (!localeDependent && srcChar == '\u0130') { - lowerCharArray = - ConditionalSpecialCasing.toLowerCaseCharArray(this, i, Locale.ENGLISH); - } else { - lowerCharArray = - ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale); - } + lowerCharArray = + ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale); } else if (srcCount == 2) { resultOffset += Character.toChars(lowerChar, result, i + resultOffset) - srcCount; continue; @@ -2669,7 +2662,7 @@ public final class String * {@code String} may be a different length than the original {@code String}. *

            * Examples of locale-sensitive and 1:M case mappings are in the following table. - *

            + * *

      * * diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index c5b5e9e890b..f68a5401704 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -26,10 +26,12 @@ package java.lang; import java.io.*; import java.lang.reflect.Executable; +import java.lang.annotation.Annotation; import java.security.AccessControlContext; import java.util.Properties; import java.util.PropertyPermission; import java.util.StringTokenizer; +import java.util.Map; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.AllPermission; @@ -1227,6 +1229,9 @@ public final class System { public AnnotationType getAnnotationType(Class klass) { return klass.getAnnotationType(); } + public Map, Annotation> getDeclaredAnnotationMap(Class klass) { + return klass.getDeclaredAnnotationMap(); + } public byte[] getRawClassAnnotations(Class klass) { return klass.getRawAnnotations(); } diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index c2f5561bdf4..13d8ac26cad 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -76,7 +76,7 @@ import sun.security.util.SecurityConstants; * Thread. An instance of the subclass can then be * allocated and started. For example, a thread that computes primes * larger than a stated value could be written as follows: - *


      + * 
        *     class PrimeThread extends Thread {
        *         long minPrime;
        *         PrimeThread(long minPrime) {
      @@ -91,7 +91,7 @@ import sun.security.util.SecurityConstants;
        * 

      *

      * The following code would then create a thread and start it running: - *

      + * 
        *     PrimeThread p = new PrimeThread(143);
        *     p.start();
        * 
      @@ -102,7 +102,7 @@ import sun.security.util.SecurityConstants; * then be allocated, passed as an argument when creating * Thread, and started. The same example in this other * style looks like the following: - *


      + * 
        *     class PrimeRun implements Runnable {
        *         long minPrime;
        *         PrimeRun(long minPrime) {
      @@ -117,7 +117,7 @@ import sun.security.util.SecurityConstants;
        * 

      *

      * The following code would then create a thread and start it running: - *

      + * 
        *     PrimeRun p = new PrimeRun(143);
        *     new Thread(p).start();
        * 
      diff --git a/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java index 793a2d13f01..e1c82d8f559 100644 --- a/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java @@ -101,7 +101,6 @@ import static sun.invoke.util.Wrapper.isWrapperType; * should implement. * @param additionalBridges Method types for additional signatures to be * bridged to the implementation method - * @throws ReflectiveOperationException * @throws LambdaConversionException If any of the meta-factory protocol * invariants are violated */ @@ -114,7 +113,7 @@ import static sun.invoke.util.Wrapper.isWrapperType; boolean isSerializable, Class[] markerInterfaces, MethodType[] additionalBridges) - throws ReflectiveOperationException, LambdaConversionException { + throws LambdaConversionException { this.targetClass = caller.lookupClass(); this.invokedType = invokedType; @@ -160,7 +159,7 @@ import static sun.invoke.util.Wrapper.isWrapperType; * @throws ReflectiveOperationException */ abstract CallSite buildCallSite() - throws ReflectiveOperationException, LambdaConversionException; + throws LambdaConversionException; /** * Check the meta-factory arguments for errors diff --git a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 486680712e0..a85c505c0f8 100644 --- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -26,16 +26,19 @@ package java.lang.invoke; import jdk.internal.org.objectweb.asm.*; +import sun.invoke.util.BytecodeDescriptor; import sun.misc.Unsafe; import sun.security.action.GetPropertyAction; import java.io.FilePermission; +import java.io.Serializable; import java.lang.reflect.Constructor; import java.security.AccessController; import java.security.PrivilegedAction; -import java.security.ProtectionDomain; +import java.util.LinkedHashSet; import java.util.concurrent.atomic.AtomicInteger; import java.util.PropertyPermission; +import java.util.Set; import static jdk.internal.org.objectweb.asm.Opcodes.*; @@ -50,14 +53,19 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private static final int CLASSFILE_VERSION = 51; private static final String METHOD_DESCRIPTOR_VOID = Type.getMethodDescriptor(Type.VOID_TYPE); - private static final String NAME_MAGIC_ACCESSOR_IMPL = "java/lang/invoke/MagicLambdaImpl"; + private static final String JAVA_LANG_OBJECT = "java/lang/Object"; private static final String NAME_CTOR = ""; + private static final String NAME_FACTORY = "get$Lambda"; //Serialization support private static final String NAME_SERIALIZED_LAMBDA = "java/lang/invoke/SerializedLambda"; + private static final String NAME_NOT_SERIALIZABLE_EXCEPTION = "java/io/NotSerializableException"; private static final String DESCR_METHOD_WRITE_REPLACE = "()Ljava/lang/Object;"; + private static final String DESCR_METHOD_WRITE_OBJECT = "(Ljava/io/ObjectOutputStream;)V"; + private static final String DESCR_METHOD_READ_OBJECT = "(Ljava/io/ObjectInputStream;)V"; private static final String NAME_METHOD_WRITE_REPLACE = "writeReplace"; - private static final String NAME_OBJECT = "java/lang/Object"; + private static final String NAME_METHOD_READ_OBJECT = "readObject"; + private static final String NAME_METHOD_WRITE_OBJECT = "writeObject"; private static final String DESCR_CTOR_SERIALIZED_LAMBDA = MethodType.methodType(void.class, Class.class, @@ -65,6 +73,12 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; int.class, String.class, String.class, String.class, String.class, Object[].class).toMethodDescriptorString(); + private static final String DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION + = MethodType.methodType(void.class, String.class).toMethodDescriptorString(); + private static final String[] SER_HOSTILE_EXCEPTIONS = new String[] {NAME_NOT_SERIALIZABLE_EXCEPTION}; + + + private static final String[] EMPTY_STRING_ARRAY = new String[0]; // Used to ensure that each spun class name is unique private static final AtomicInteger counter = new AtomicInteger(0); @@ -84,15 +98,12 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private final String implMethodClassName; // Name of type containing implementation "CC" private final String implMethodName; // Name of implementation method "impl" private final String implMethodDesc; // Type descriptor for implementation methods "(I)Ljava/lang/String;" - private final Type[] implMethodArgumentTypes; // ASM types for implementation method parameters - private final Type implMethodReturnType; // ASM type for implementation method return type "Ljava/lang/String;" + private final Class implMethodReturnClass; // class for implementaion method return type "Ljava/lang/String;" private final MethodType constructorType; // Generated class constructor type "(CC)void" - private final String constructorDesc; // Type descriptor for constructor "(LCC;)V" private final ClassWriter cw; // ASM class writer - private final Type[] argTypes; // ASM types for the constructor arguments private final String[] argNames; // Generated names for the constructor arguments + private final String[] argDescs; // Type descriptors for the constructor arguments private final String lambdaClassName; // Generated name for the generated class "X$$Lambda$1" - private final Type[] instantiatedArgumentTypes; // ASM types for the functional interface arguments /** * General meta-factory constructor, supporting both standard cases and @@ -128,7 +139,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; * should implement. * @param additionalBridges Method types for additional signatures to be * bridged to the implementation method - * @throws ReflectiveOperationException * @throws LambdaConversionException If any of the meta-factory protocol * invariants are violated */ @@ -141,29 +151,30 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; boolean isSerializable, Class[] markerInterfaces, MethodType[] additionalBridges) - throws ReflectiveOperationException, LambdaConversionException { + throws LambdaConversionException { super(caller, invokedType, samMethodName, samMethodType, implMethod, instantiatedMethodType, isSerializable, markerInterfaces, additionalBridges); implMethodClassName = implDefiningClass.getName().replace('.', '/'); implMethodName = implInfo.getName(); implMethodDesc = implMethodType.toMethodDescriptorString(); - Type implMethodAsmType = Type.getMethodType(implMethodDesc); - implMethodArgumentTypes = implMethodAsmType.getArgumentTypes(); - implMethodReturnType = (implKind == MethodHandleInfo.REF_newInvokeSpecial) - ? Type.getObjectType(implMethodClassName) - : implMethodAsmType.getReturnType(); + implMethodReturnClass = (implKind == MethodHandleInfo.REF_newInvokeSpecial) + ? implDefiningClass + : implMethodType.returnType(); constructorType = invokedType.changeReturnType(Void.TYPE); - constructorDesc = constructorType.toMethodDescriptorString(); lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet(); cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); - argTypes = Type.getArgumentTypes(constructorDesc); - argNames = new String[argTypes.length]; - for (int i = 0; i < argTypes.length; i++) { - argNames[i] = "arg$" + (i + 1); + int parameterCount = invokedType.parameterCount(); + if (parameterCount > 0) { + argNames = new String[parameterCount]; + argDescs = new String[parameterCount]; + for (int i = 0; i < parameterCount; i++) { + argNames[i] = "arg$" + (i + 1); + argDescs[i] = BytecodeDescriptor.unparse(invokedType.parameterType(i)); + } + } else { + argNames = argDescs = EMPTY_STRING_ARRAY; } - instantiatedArgumentTypes = Type.getArgumentTypes( - instantiatedMethodType.toMethodDescriptorString()); } /** @@ -179,36 +190,44 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; * is not found */ @Override - CallSite buildCallSite() throws ReflectiveOperationException, LambdaConversionException { + CallSite buildCallSite() throws LambdaConversionException { final Class innerClass = spinInnerClass(); if (invokedType.parameterCount() == 0) { final Constructor[] ctrs = AccessController.doPrivileged( new PrivilegedAction() { @Override public Constructor[] run() { - return innerClass.getDeclaredConstructors(); + Constructor[] ctrs = innerClass.getDeclaredConstructors(); + if (ctrs.length == 1) { + // The lambda implementing inner class constructor is private, set + // it accessible (by us) before creating the constant sole instance + ctrs[0].setAccessible(true); + } + return ctrs; } - }); + }); if (ctrs.length != 1) { - throw new ReflectiveOperationException("Expected one lambda constructor for " + throw new LambdaConversionException("Expected one lambda constructor for " + innerClass.getCanonicalName() + ", got " + ctrs.length); } - // The lambda implementing inner class constructor is private, set - // it accessible (by us) before creating the constant sole instance - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Void run() { - ctrs[0].setAccessible(true); - return null; - } - }); - Object inst = ctrs[0].newInstance(); - return new ConstantCallSite(MethodHandles.constant(samBase, inst)); + + try { + Object inst = ctrs[0].newInstance(); + return new ConstantCallSite(MethodHandles.constant(samBase, inst)); + } + catch (ReflectiveOperationException e) { + throw new LambdaConversionException("Exception instantiating lambda object", e); + } } else { - return new ConstantCallSite( - MethodHandles.Lookup.IMPL_LOOKUP - .findConstructor(innerClass, constructorType) - .asType(constructorType.changeReturnType(samBase))); + try { + UNSAFE.ensureClassInitialized(innerClass); + return new ConstantCallSite( + MethodHandles.Lookup.IMPL_LOOKUP + .findStatic(innerClass, NAME_FACTORY, invokedType)); + } + catch (ReflectiveOperationException e) { + throw new LambdaConversionException("Exception finding constructor", e); + } } } @@ -228,44 +247,59 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; * is not found */ private Class spinInnerClass() throws LambdaConversionException { - String[] interfaces = new String[markerInterfaces.length + 1]; - interfaces[0] = samBase.getName().replace('.', '/'); - for (int i=0; i itfs = new LinkedHashSet<>(markerInterfaces.length + 1); + itfs.add(samIntf); + for (Class markerInterface : markerInterfaces) { + itfs.add(markerInterface.getName().replace('.', '/')); + accidentallySerializable |= !isSerializable && Serializable.class.isAssignableFrom(markerInterface); + } + interfaces = itfs.toArray(new String[itfs.size()]); } + cw.visit(CLASSFILE_VERSION, ACC_SUPER + ACC_FINAL + ACC_SYNTHETIC, lambdaClassName, null, - NAME_MAGIC_ACCESSOR_IMPL, interfaces); + JAVA_LANG_OBJECT, interfaces); // Generate final fields to be filled in by constructor - for (int i = 0; i < argTypes.length; i++) { + for (int i = 0; i < argDescs.length; i++) { FieldVisitor fv = cw.visitField(ACC_PRIVATE + ACC_FINAL, argNames[i], - argTypes[i].getDescriptor(), + argDescs[i], null, null); fv.visitEnd(); } generateConstructor(); + if (invokedType.parameterCount() != 0) { + generateFactory(); + } + // Forward the SAM method - String methodDescriptor = samMethodType.toMethodDescriptorString(); MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName, - methodDescriptor, null, null); - new ForwardingMethodGenerator(mv).generate(methodDescriptor); + samMethodType.toMethodDescriptorString(), null, null); + new ForwardingMethodGenerator(mv).generate(samMethodType); // Forward the bridges if (additionalBridges != null) { for (MethodType mt : additionalBridges) { - methodDescriptor = mt.toMethodDescriptorString(); mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName, - methodDescriptor, null, null); - new ForwardingMethodGenerator(mv).generate(methodDescriptor); + mt.toMethodDescriptorString(), null, null); + new ForwardingMethodGenerator(mv).generate(mt); } } if (isSerializable) - generateWriteReplace(); + generateSerializationFriendlyMethods(); + else if (accidentallySerializable) + generateSerializationHostileMethods(); cw.visitEnd(); @@ -287,21 +321,27 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; new PropertyPermission("user.dir", "read")); } - ClassLoader loader = targetClass.getClassLoader(); - ProtectionDomain pd = (loader == null) - ? null - : AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public ProtectionDomain run() { - return targetClass.getProtectionDomain(); - } - } - ); + return UNSAFE.defineAnonymousClass(targetClass, classBytes, null); + } - return UNSAFE.defineClass(lambdaClassName, - classBytes, 0, classBytes.length, - loader, pd); + /** + * Generate the factory method for the class + */ + private void generateFactory() { + MethodVisitor m = cw.visitMethod(ACC_PRIVATE | ACC_STATIC, NAME_FACTORY, invokedType.toMethodDescriptorString(), null, null); + m.visitCode(); + m.visitTypeInsn(NEW, lambdaClassName); + m.visitInsn(Opcodes.DUP); + int parameterCount = invokedType.parameterCount(); + for (int typeIndex = 0, varIndex = 0; typeIndex < parameterCount; typeIndex++) { + Class argType = invokedType.parameterType(typeIndex); + m.visitVarInsn(getLoadOpcode(argType), varIndex); + varIndex += getParameterSize(argType); + } + m.visitMethodInsn(INVOKESPECIAL, lambdaClassName, NAME_CTOR, constructorType.toMethodDescriptorString()); + m.visitInsn(ARETURN); + m.visitMaxs(-1, -1); + m.visitEnd(); } /** @@ -310,18 +350,18 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private void generateConstructor() { // Generate constructor MethodVisitor ctor = cw.visitMethod(ACC_PRIVATE, NAME_CTOR, - constructorDesc, null, null); + constructorType.toMethodDescriptorString(), null, null); ctor.visitCode(); ctor.visitVarInsn(ALOAD, 0); - ctor.visitMethodInsn(INVOKESPECIAL, NAME_MAGIC_ACCESSOR_IMPL, NAME_CTOR, + ctor.visitMethodInsn(INVOKESPECIAL, JAVA_LANG_OBJECT, NAME_CTOR, METHOD_DESCRIPTOR_VOID); - int lvIndex = 0; - for (int i = 0; i < argTypes.length; i++) { + int parameterCount = invokedType.parameterCount(); + for (int i = 0, lvIndex = 0; i < parameterCount; i++) { ctor.visitVarInsn(ALOAD, 0); - ctor.visitVarInsn(argTypes[i].getOpcode(ILOAD), lvIndex + 1); - lvIndex += argTypes[i].getSize(); - ctor.visitFieldInsn(PUTFIELD, lambdaClassName, argNames[i], - argTypes[i].getDescriptor()); + Class argType = invokedType.parameterType(i); + ctor.visitVarInsn(getLoadOpcode(argType), lvIndex + 1); + lvIndex += getParameterSize(argType); + ctor.visitFieldInsn(PUTFIELD, lambdaClassName, argNames[i], argDescs[i]); } ctor.visitInsn(RETURN); // Maxs computed by ClassWriter.COMPUTE_MAXS, these arguments ignored @@ -330,9 +370,9 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; } /** - * Generate the writeReplace method (if needed for serialization) + * Generate a writeReplace method that supports serialization */ - private void generateWriteReplace() { + private void generateSerializationFriendlyMethods() { TypeConvertingMethodAdapter mv = new TypeConvertingMethodAdapter( cw.visitMethod(ACC_PRIVATE + ACC_FINAL, @@ -351,16 +391,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; mv.visitLdcInsn(implInfo.getName()); mv.visitLdcInsn(implInfo.getMethodType().toMethodDescriptorString()); mv.visitLdcInsn(instantiatedMethodType.toMethodDescriptorString()); - - mv.iconst(argTypes.length); - mv.visitTypeInsn(ANEWARRAY, NAME_OBJECT); - for (int i = 0; i < argTypes.length; i++) { + mv.iconst(argDescs.length); + mv.visitTypeInsn(ANEWARRAY, JAVA_LANG_OBJECT); + for (int i = 0; i < argDescs.length; i++) { mv.visitInsn(DUP); mv.iconst(i); mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], - argTypes[i].getDescriptor()); - mv.boxIfTypePrimitive(argTypes[i]); + mv.visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], argDescs[i]); + mv.boxIfTypePrimitive(Type.getType(argDescs[i])); mv.visitInsn(AASTORE); } mv.visitMethodInsn(INVOKESPECIAL, NAME_SERIALIZED_LAMBDA, NAME_CTOR, @@ -371,6 +409,37 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; mv.visitEnd(); } + /** + * Generate a readObject/writeObject method that is hostile to serialization + */ + private void generateSerializationHostileMethods() { + MethodVisitor mv = cw.visitMethod(ACC_PRIVATE + ACC_FINAL, + NAME_METHOD_WRITE_OBJECT, DESCR_METHOD_WRITE_OBJECT, + null, SER_HOSTILE_EXCEPTIONS); + mv.visitCode(); + mv.visitTypeInsn(NEW, NAME_NOT_SERIALIZABLE_EXCEPTION); + mv.visitInsn(DUP); + mv.visitLdcInsn("Non-serializable lambda"); + mv.visitMethodInsn(INVOKESPECIAL, NAME_NOT_SERIALIZABLE_EXCEPTION, NAME_CTOR, + DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION); + mv.visitInsn(ATHROW); + mv.visitMaxs(-1, -1); + mv.visitEnd(); + + mv = cw.visitMethod(ACC_PRIVATE + ACC_FINAL, + NAME_METHOD_READ_OBJECT, DESCR_METHOD_READ_OBJECT, + null, SER_HOSTILE_EXCEPTIONS); + mv.visitCode(); + mv.visitTypeInsn(NEW, NAME_NOT_SERIALIZABLE_EXCEPTION); + mv.visitInsn(DUP); + mv.visitLdcInsn("Non-serializable lambda"); + mv.visitMethodInsn(INVOKESPECIAL, NAME_NOT_SERIALIZABLE_EXCEPTION, NAME_CTOR, + DESCR_CTOR_NOT_SERIALIZABLE_EXCEPTION); + mv.visitInsn(ATHROW); + mv.visitMaxs(-1, -1); + mv.visitEnd(); + } + /** * This class generates a method body which calls the lambda implementation * method, converting arguments, as needed. @@ -381,20 +450,19 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; super(mv); } - void generate(String methodDescriptor) { + void generate(MethodType methodType) { visitCode(); if (implKind == MethodHandleInfo.REF_newInvokeSpecial) { visitTypeInsn(NEW, implMethodClassName); visitInsn(DUP); } - for (int i = 0; i < argTypes.length; i++) { + for (int i = 0; i < argNames.length; i++) { visitVarInsn(ALOAD, 0); - visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], - argTypes[i].getDescriptor()); + visitFieldInsn(GETFIELD, lambdaClassName, argNames[i], argDescs[i]); } - convertArgumentTypes(Type.getArgumentTypes(methodDescriptor)); + convertArgumentTypes(methodType); // Invoke the method we want to forward to visitMethodInsn(invocationOpcode(), implMethodClassName, implMethodName, implMethodDesc); @@ -402,46 +470,36 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // Convert the return value (if any) and return it // Note: if adapting from non-void to void, the 'return' // instruction will pop the unneeded result - Type samReturnType = Type.getReturnType(methodDescriptor); - convertType(implMethodReturnType, samReturnType, samReturnType); - visitInsn(samReturnType.getOpcode(Opcodes.IRETURN)); + Class samReturnClass = methodType.returnType(); + convertType(implMethodReturnClass, samReturnClass, samReturnClass); + visitInsn(getReturnOpcode(samReturnClass)); // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored visitMaxs(-1, -1); visitEnd(); } - private void convertArgumentTypes(Type[] samArgumentTypes) { + private void convertArgumentTypes(MethodType samType) { int lvIndex = 0; boolean samIncludesReceiver = implIsInstanceMethod && - argTypes.length == 0; + invokedType.parameterCount() == 0; int samReceiverLength = samIncludesReceiver ? 1 : 0; if (samIncludesReceiver) { // push receiver - Type rcvrType = samArgumentTypes[0]; - Type instantiatedRcvrType = instantiatedArgumentTypes[0]; - - visitVarInsn(rcvrType.getOpcode(ILOAD), lvIndex + 1); - lvIndex += rcvrType.getSize(); - convertType(rcvrType, Type.getType(implDefiningClass), instantiatedRcvrType); + Class rcvrType = samType.parameterType(0); + visitVarInsn(getLoadOpcode(rcvrType), lvIndex + 1); + lvIndex += getParameterSize(rcvrType); + convertType(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0)); } - int argOffset = implMethodArgumentTypes.length - samArgumentTypes.length; - for (int i = samReceiverLength; i < samArgumentTypes.length; i++) { - Type argType = samArgumentTypes[i]; - Type targetType = implMethodArgumentTypes[argOffset + i]; - Type instantiatedArgType = instantiatedArgumentTypes[i]; - - visitVarInsn(argType.getOpcode(ILOAD), lvIndex + 1); - lvIndex += argType.getSize(); - convertType(argType, targetType, instantiatedArgType); + int samParametersLength = samType.parameterCount(); + int argOffset = implMethodType.parameterCount() - samParametersLength; + for (int i = samReceiverLength; i < samParametersLength; i++) { + Class argType = samType.parameterType(i); + visitVarInsn(getLoadOpcode(argType), lvIndex + 1); + lvIndex += getParameterSize(argType); + convertType(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i)); } } - private void convertType(Type argType, Type targetType, Type functionalType) { - convertType(argType.getDescriptor(), - targetType.getDescriptor(), - functionalType.getDescriptor()); - } - private int invocationOpcode() throws InternalError { switch (implKind) { case MethodHandleInfo.REF_invokeStatic: @@ -459,4 +517,43 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; } } } + + static int getParameterSize(Class c) { + if (c == Void.TYPE) { + return 0; + } else if (c == Long.TYPE || c == Double.TYPE) { + return 2; + } + return 1; + } + + static int getLoadOpcode(Class c) { + if(c == Void.TYPE) { + throw new InternalError("Unexpected void type of load opcode"); + } + return ILOAD + getOpcodeOffset(c); + } + + static int getReturnOpcode(Class c) { + if(c == Void.TYPE) { + return RETURN; + } + return IRETURN + getOpcodeOffset(c); + } + + private static int getOpcodeOffset(Class c) { + if (c.isPrimitive()) { + if (c == Long.TYPE) { + return 1; + } else if (c == Float.TYPE) { + return 2; + } else if (c == Double.TYPE) { + return 3; + } + return 0; + } else { + return 4; + } + } + } diff --git a/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java index 87c7923d9ba..5bea02055ef 100644 --- a/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/LambdaMetafactory.java @@ -29,88 +29,128 @@ import java.io.Serializable; import java.util.Arrays; /** - *

      Bootstrap methods for converting lambda expressions and method references to functional interface objects.

      + *

      Methods to facilitate the creation of simple "function objects" that + * implement one or more interfaces by delegation to a provided {@link MethodHandle}, + * possibly after type adaptation and partial evaluation of arguments. These + * methods are typically used as bootstrap methods for {@code invokedynamic} + * call sites, to support the lambda expression and method + * reference expression features of the Java Programming Language. * - *

      For every lambda expressions or method reference in the source code, there is a target type which is a - * functional interface. Evaluating a lambda expression produces an object of its target type. The mechanism for - * evaluating lambda expressions is to invoke an invokedynamic call site, which takes arguments describing the sole - * method of the functional interface and the implementation method, and returns an object (the lambda object) that - * implements the target type. Methods of the lambda object invoke the implementation method. For method - * references, the implementation method is simply the referenced method; for lambda expressions, the - * implementation method is produced by the compiler based on the body of the lambda expression. The methods in - * this file are the bootstrap methods for those invokedynamic call sites, called lambda factories, and the - * bootstrap methods responsible for linking the lambda factories are called lambda meta-factories. - * - *

      The bootstrap methods in this class take the information about the functional interface, the implementation - * method, and the static types of the captured lambda arguments, and link a call site which, when invoked, - * produces the lambda object. - * - *

      When parameterized types are used, the instantiated type of the functional interface method may be different - * from that in the functional interface. For example, consider - * {@code interface I { int m(T x); }} if this functional interface type is used in a lambda - * {@code I; v = ...}, we need both the actual functional interface method which has the signature - * {@code (Object)int} and the erased instantiated type of the functional interface method (or simply - * instantiated method type), which has signature - * {@code (Byte)int}. - * - *

      The argument list of the implementation method and the argument list of the functional interface method(s) - * may differ in several ways. The implementation methods may have additional arguments to accommodate arguments - * captured by the lambda expression; there may also be differences resulting from permitted adaptations of - * arguments, such as casting, boxing, unboxing, and primitive widening. They may also differ because of var-args, - * but this is expected to be handled by the compiler. - * - *

      Invokedynamic call sites have two argument lists: a static argument list and a dynamic argument list. The - * static argument list lives in the constant pool; the dynamic argument list lives on the operand stack at - * invocation time. The bootstrap method has access to the entire static argument list (which in this case, - * contains method handles describing the implementation method and the canonical functional interface method), - * as well as a method signature describing the number and static types (but not the values) of the dynamic - * arguments, and the static return type of the invokedynamic site. - * - *

      The implementation method is described with a method handle. In theory, any method handle could be used. - * Currently supported are method handles representing invocation of virtual, interface, constructor and static - * methods. - * - *

      Assume: + *

      Indirect access to the behavior specified by the provided {@code MethodHandle} + * proceeds in order through three phases: *

        - *
      • the functional interface method has N arguments, of types (U1, U2, ... Un) and return type Ru
      • - *
      • then the instantiated method type also has N arguments, of types (T1, T2, ... Tn) and return type Rt
      • - *
      • the implementation method has M arguments, of types (A1..Am) and return type Ra,
      • - *
      • the dynamic argument list has K arguments of types (D1..Dk), and the invokedynamic return site has - * type Rd
      • - *
      • the functional interface type is F
      • + *
      • Linkage occurs when the methods in this class are invoked. + * They take as arguments an interface to be implemented (typically a + * functional interface, one with a single abstract method), a + * name and signature of a method from that interface to be implemented, a + * method handle describing the desired implementation behavior + * for that method, and possibly other additional metadata, and produce a + * {@link CallSite} whose target can be used to create suitable function + * objects. Linkage may involve dynamically loading a new class that + * implements the target interface. The {@code CallSite} can be considered a + * "factory" for function objects and so these linkage methods are referred + * to as "metafactories".
      • + * + *
      • Capture occurs when the {@code CallSite}'s target is + * invoked, typically through an {@code invokedynamic} call site, + * producing a function object. This may occur many times for + * a single factory {@code CallSite}. Capture may involve allocation of a + * new function object, or may return an existing function object. The + * behavior {@code MethodHandle} may have additional parameters beyond those + * of the specified interface method; these are referred to as captured + * parameters, which must be provided as arguments to the + * {@code CallSite} target, and which may be early-bound to the behavior + * {@code MethodHandle}. The number of captured parameters and their types + * are determined during linkage.
      • + * + *
      • Invocation occurs when an implemented interface method + * is invoked on a function object. This may occur many times for a single + * function object. The method referenced by the behavior {@code MethodHandle} + * is invoked with the captured arguments and any additional arguments + * provided on invocation, as if by {@link MethodHandle#invoke(Object...)}.
      • *
      * - *

      The following signature invariants must hold: + *

      It is sometimes useful to restrict the set of inputs or results permitted + * at invocation. For example, when the generic interface {@code Predicate} + * is parameterized as {@code Predicate}, the input must be a + * {@code String}, even though the method to implement allows any {@code Object}. + * At linkage time, an additional {@link MethodType} parameter describes the + * "instantiated" method type; on invocation, the arguments and eventual result + * are checked against this {@code MethodType}. + * + *

      This class provides two forms of linkage methods: a standard version + * ({@link #metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)}) + * using an optimized protocol, and an alternate version + * {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}). + * The alternate version is a generalization of the standard version, providing + * additional control over the behavior of the generated function objects via + * flags and additional arguments. The alternate version adds the ability to + * manage the following attributes of function objects: + * *

        - *
      • Rd is a subtype of F
      • - *
      • For i=1..N, Ti is a subtype of Ui
      • - *
      • Either Rt and Ru are primitive and are the same type, or both are reference types and - * Rt is a subtype of Ru
      • - *
      • If the implementation method is a static method: - *
          - *
        • K + N = M
        • - *
        • For i=1..K, Di = Ai
        • - *
        • For i=1..N, Ti is adaptable to Aj, where j=i+k
        • - *
      • - *
      • If the implementation method is an instance method: - *
          - *
        • K + N = M + 1
        • - *
        • D1 must be a subtype of the enclosing class for the implementation method
        • - *
        • For i=2..K, Di = Aj, where j=i-1
        • - *
        • For i=1..N, Ti is adaptable to Aj, where j=i+k-1
        • - *
      • - *
      • The return type Rt is void, or the return type Ra is not void and is adaptable to Rt
      • + *
      • Bridging. It is sometimes useful to implement multiple + * variations of the method signature, involving argument or return type + * adaptation. This occurs when multiple distinct VM signatures for a method + * are logically considered to be the same method by the language. The + * flag {@code FLAG_BRIDGES} indicates that a list of additional + * {@code MethodType}s will be provided, each of which will be implemented + * by the resulting function object. These methods will share the same + * name and instantiated type.
      • + * + *
      • Multiple interfaces. If needed, more than one interface + * can be implemented by the function object. (These additional interfaces + * are typically marker interfaces with no methods.) The flag {@code FLAG_MARKERS} + * indicates that a list of additional interfaces will be provided, each of + * which should be implemented by the resulting function object.
      • + * + *
      • Serializability. The generated function objects do not + * generally support serialization. If desired, {@code FLAG_SERIALIZABLE} + * can be used to indicate that the function objects should be serializable. + * Serializable function objects will use, as their serialized form, + * instances of the class {@code SerializedLambda}, which requires additional + * assistance from the capturing class (the class described by the + * {@link MethodHandles.Lookup} parameter {@code caller}); see + * {@link SerializedLambda} for details.
      • *
      * - *

      Note that the potentially parameterized implementation return type provides the value for the SAM. Whereas - * the completely known instantiated return type is adapted to the implementation arguments. Because the - * instantiated type of the implementation method is not available, the adaptability of return types cannot be - * checked as precisely at link-time as the arguments can be checked. Thus a loose version of link-time checking is - * done on return type, while a strict version is applied to arguments. + *

      Assume the linkage arguments are as follows: + *

        + *
      • {@code invokedType} (describing the {@code CallSite} signature) has + * K parameters of types (D1..Dk) and return type Rd;
      • + *
      • {@code samMethodType} (describing the implemented method type) has N + * parameters, of types (U1..Un) and return type Ru;
      • + *
      • {@code implMethod} (the {@code MethodHandle} providing the + * implementation has M parameters, of types (A1..Am) and return type Ra + * (if the method describes an instance method, the method type of this + * method handle already includes an extra first argument corresponding to + * the receiver);
      • + *
      • {@code instantiatedMethodType} (allowing restrictions on invocation) + * has N parameters, of types (T1..Tn) and return type Rt.
      • + *
      + * + *

      Then the following linkage invariants must hold: + *

        + *
      • Rd is an interface
      • + *
      • {@code implMethod} is a direct method handle
      • + *
      • {@code samMethodType} and {@code instantiatedMethodType} have the same + * arity N, and for i=1..N, Ti and Ui are the same type, or Ti and Ui are + * both reference types and Ti is a subtype of Ui
      • + *
      • Either Rt and Ru are the same type, or both are reference types and + * Rt is a subtype of Ru
      • + *
      • K + N = M
      • + *
      • For i=1..K, Di = Ai
      • + *
      • For i=1..N, Ti is adaptable to Aj, where j=i+k
      • + *
      • The return type Rt is void, or the return type Ra is not void and is + * adaptable to Rt
      • + *
      + * + *

      Further, at capture time, if {@code implMethod} corresponds to an instance + * method, and there are any capture arguments ({@code K > 0}), then the first + * capture argument (corresponding to the receiver) must be non-null. * *

      A type Q is considered adaptable to S as follows: *

      Language Code of Locale
      - * + * * * * @@ -123,27 +163,59 @@ import java.util.Arrays; * * * - * - * + * + * * * * - * + * * * *
      QSLink-time checksCapture-time checks
      QSLink-time checksInvocation-time checks
      PrimitivePrimitiveQ can be converted to S via a primitive widening conversion
      ReferencePrimitivestrict: Q is a primitive wrapper and Primitive(Q) can be widened to S - *
      loose: If Q is a primitive wrapper, check that Primitive(Q) can be widened to S
      If Q is not a primitive wrapper, cast Q to the base Wrapper(S); for example Number for numeric typesfor parameter types: Q is a primitive wrapper and Primitive(Q) + * can be widened to S + *
      for return types: If Q is a primitive wrapper, check that + * Primitive(Q) can be widened to S
      If Q is not a primitive wrapper, cast Q to the base Wrapper(S); + * for example Number for numeric types
      ReferenceReferencestrict: S is a supertype of Q - *
      loose: none
      for parameter types: S is a supertype of Q + *
      for return types: none
      Cast from Q to S
      * - * The default bootstrap ({@link #metafactory}) represents the common cases and uses an optimized protocol. - * Alternate bootstraps (e.g., {@link #altMetafactory}) exist to support uncommon cases such as serialization - * or additional marker superinterfaces. + * @apiNote These linkage methods are designed to support the evaluation + * of lambda expressions and method references in the Java + * Language. For every lambda expressions or method reference in the source code, + * there is a target type which is a functional interface. Evaluating a lambda + * expression produces an object of its target type. The recommended mechanism + * for evaluating lambda expressions is to desugar the lambda body to a method, + * invoke an invokedynamic call site whose static argument list describes the + * sole method of the functional interface and the desugared implementation + * method, and returns an object (the lambda object) that implements the target + * type. (For method references, the implementation method is simply the + * referenced method; no desugaring is needed.) * + *

      The argument list of the implementation method and the argument list of + * the interface method(s) may differ in several ways. The implementation + * methods may have additional arguments to accommodate arguments captured by + * the lambda expression; there may also be differences resulting from permitted + * adaptations of arguments, such as casting, boxing, unboxing, and primitive + * widening. (Varargs adaptations are not handled by the metafactories; these are + * expected to be handled by the caller.) + * + *

      Invokedynamic call sites have two argument lists: a static argument list + * and a dynamic argument list. The static argument list is stored in the + * constant pool; the dynamic argument is pushed on the operand stack at capture + * time. The bootstrap method has access to the entire static argument list + * (which in this case, includes information describing the implementation method, + * the target interface, and the target interface method(s)), as well as a + * method signature describing the number and static types (but not the values) + * of the dynamic arguments and the static return type of the invokedynamic site. + * + * @implNote The implementation method is described with a method handle. In + * theory, any method handle could be used. Currently supported are direct method + * handles representing invocation of virtual, interface, constructor and static + * methods. */ public class LambdaMetafactory { - /** Flag for alternate metafactories indicating the lambda object is - * must to be serializable */ + /** Flag for alternate metafactories indicating the lambda object + * must be serializable */ public static final int FLAG_SERIALIZABLE = 1 << 0; /** @@ -163,41 +235,58 @@ public class LambdaMetafactory { private static final MethodType[] EMPTY_MT_ARRAY = new MethodType[0]; /** - * Standard meta-factory for conversion of lambda expressions or method - * references to functional interfaces. + * Facilitates the creation of simple "function objects" that implement one + * or more interfaces by delegation to a provided {@link MethodHandle}, + * after appropriate type adaptation and partial evaluation of arguments. + * Typically used as a bootstrap method for {@code invokedynamic} + * call sites, to support the lambda expression and method + * reference expression features of the Java Programming Language. * - * @param caller Stacked automatically by VM; represents a lookup context - * with the accessibility privileges of the caller. - * @param invokedName Stacked automatically by VM; the name of the invoked - * method as it appears at the call site. - * Used as the name of the functional interface method - * to which the lambda or method reference is being - * converted. - * @param invokedType Stacked automatically by VM; the signature of the - * invoked method, which includes the expected static - * type of the returned lambda object, and the static - * types of the captured arguments for the lambda. + *

      This is the standard, streamlined metafactory; additional flexibility + * is provided by {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}. + * A general description of the behavior of this method is provided + * {@link LambdaMetafactory above}. + * + *

      When the target of the {@code CallSite} returned from this method is + * invoked, the resulting function objects are instances of a class which + * implements the interface named by the return type of {@code invokedType}, + * declares a method with the name given by {@code invokedName} and the + * signature given by {@code samMethodType}. It may also override additional + * methods from {@code Object}. + * + * @param caller Represents a lookup context with the accessibility + * privileges of the caller. When used with {@code invokedynamic}, + * this is stacked automatically by the VM. + * @param invokedName The name of the method to implement. When used with + * {@code invokedynamic}, this is provided by the + * {@code NameAndType} of the {@code InvokeDynamic} + * structure and is stacked automatically by the VM. + * @param invokedType The expected signature of the {@code CallSite}. The + * parameter types represent the types of capture variables; + * the return type is the interface to implement. When + * used with {@code invokedynamic}, this is provided by + * the {@code NameAndType} of the {@code InvokeDynamic} + * structure and is stacked automatically by the VM. * In the event that the implementation method is an - * instance method, the first argument in the invocation - * signature will correspond to the receiver. - * @param samMethodType MethodType of the method in the functional interface - * to which the lambda or method reference is being - * converted, represented as a MethodType. - * @param implMethod The implementation method which should be called - * (with suitable adaptation of argument types, return - * types, and adjustment for captured arguments) when - * methods of the resulting functional interface instance - * are invoked. - * @param instantiatedMethodType The signature of the primary functional - * interface method after type variables - * are substituted with their instantiation - * from the capture site - * @return a CallSite, which, when invoked, will return an instance of the - * functional interface - * @throws ReflectiveOperationException if the caller is not able to - * reconstruct one of the method handles - * @throws LambdaConversionException If any of the meta-factory protocol - * invariants are violated + * instance method and this signature has any parameters, + * the first parameter in the invocation signature must + * correspond to the receiver. + * @param samMethodType Signature and return type of method to be implemented + * by the function object. + * @param implMethod A direct method handle describing the implementation + * method which should be called (with suitable adaptation + * of argument types, return types, and with captured + * arguments prepended to the invocation arguments) at + * invocation time. + * @param instantiatedMethodType The signature and return type that should + * be enforced dynamically at invocation time. + * This may be the same as {@code samMethodType}, + * or may be a specialization of it. + * @return a CallSite whose target can be used to perform capture, generating + * instances of the interface named by {@code invokedType} + * @throws LambdaConversionException If any of the linkage invariants + * described {@link LambdaMetafactory above} + * are violated */ public static CallSite metafactory(MethodHandles.Lookup caller, String invokedName, @@ -205,7 +294,7 @@ public class LambdaMetafactory { MethodType samMethodType, MethodHandle implMethod, MethodType instantiatedMethodType) - throws ReflectiveOperationException, LambdaConversionException { + throws LambdaConversionException { AbstractValidatingLambdaMetafactory mf; mf = new InnerClassLambdaMetafactory(caller, invokedType, invokedName, samMethodType, @@ -216,60 +305,128 @@ public class LambdaMetafactory { } /** - * Alternate meta-factory for conversion of lambda expressions or method - * references to functional interfaces, which supports serialization and - * other uncommon options. + * Facilitates the creation of simple "function objects" that implement one + * or more interfaces by delegation to a provided {@link MethodHandle}, + * after appropriate type adaptation and partial evaluation of arguments. + * Typically used as a bootstrap method for {@code invokedynamic} + * call sites, to support the lambda expression and method + * reference expression features of the Java Programming Language. * - * The declared argument list for this method is: + *

      This is the general, more flexible metafactory; a streamlined version + * is provided by {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)}. + * A general description of the behavior of this method is provided + * {@link LambdaMetafactory above}. * + *

      The argument list for this method includes three fixed parameters, + * corresponding to the parameters automatically stacked by the VM for the + * bootstrap method in an {@code invokedynamic} invocation, and an {@code Object[]} + * parameter that contains additional parameters. The declared argument + * list for this method is: + * + *

      {@code
            *  CallSite altMetafactory(MethodHandles.Lookup caller,
            *                          String invokedName,
            *                          MethodType invokedType,
            *                          Object... args)
      +     * }
      * - * but it behaves as if the argument list is: + *

      but it behaves as if the argument list is as follows: * + *

      {@code
            *  CallSite altMetafactory(MethodHandles.Lookup caller,
            *                          String invokedName,
            *                          MethodType invokedType,
      -     *                          MethodType samMethodType
      +     *                          MethodType samMethodType,
            *                          MethodHandle implMethod,
            *                          MethodType instantiatedMethodType,
            *                          int flags,
      -     *                          int markerInterfaceCount, // IF flags has MARKERS set
      -     *                          Class... markerInterfaces // IF flags has MARKERS set
      -     *                          int bridgeCount,          // IF flags has BRIDGES set
      -     *                          MethodType... bridges     // IF flags has BRIDGES set
      +     *                          int markerInterfaceCount,  // IF flags has MARKERS set
      +     *                          Class... markerInterfaces, // IF flags has MARKERS set
      +     *                          int bridgeCount,           // IF flags has BRIDGES set
      +     *                          MethodType... bridges      // IF flags has BRIDGES set
            *                          )
      +     * }
      * + *

      Arguments that appear in the argument list for + * {@link #metafactory(MethodHandles.Lookup, String, MethodType, MethodType, MethodHandle, MethodType)} + * have the same specification as in that method. The additional arguments + * are interpreted as follows: + *

        + *
      • {@code flags} indicates additional options; this is a bitwise + * OR of desired flags. Defined flags are {@link #FLAG_BRIDGES}, + * {@link #FLAG_MARKERS}, and {@link #FLAG_SERIALIZABLE}.
      • + *
      • {@code markerInterfaceCount} is the number of additional interfaces + * the function object should implement, and is present if and only if the + * {@code FLAG_MARKERS} flag is set.
      • + *
      • {@code markerInterfaces} is a variable-length list of additional + * interfaces to implement, whose length equals {@code markerInterfaceCount}, + * and is present if and only if the {@code FLAG_MARKERS} flag is set.
      • + *
      • {@code bridgeCount} is the number of additional method signatures + * the function object should implement, and is present if and only if + * the {@code FLAG_BRIDGES} flag is set.
      • + *
      • {@code bridges} is a variable-length list of additional + * methods signatures to implement, whose length equals {@code bridgeCount}, + * and is present if and only if the {@code FLAG_BRIDGES} flag is set.
      • + *
      * - * @param caller Stacked automatically by VM; represents a lookup context - * with the accessibility privileges of the caller. - * @param invokedName Stacked automatically by VM; the name of the invoked - * method as it appears at the call site. - * Used as the name of the functional interface method - * to which the lambda or method reference is being - * converted. - * @param invokedType Stacked automatically by VM; the signature of the - * invoked method, which includes the expected static - * type of the returned lambda object, and the static - * types of the captured arguments for the lambda. + *

      Each class named by {@code markerInterfaces} is subject to the same + * restrictions as {@code Rd}, the return type of {@code invokedType}, + * as described {@link LambdaMetafactory above}. Each {@code MethodType} + * named by {@code bridges} is subject to the same restrictions as + * {@code samMethodType}, as described {@link LambdaMetafactory above}. + * + *

      When FLAG_SERIALIZABLE is set in {@code flags}, the function objects + * will implement {@code Serializable}, and will have a {@code writeReplace} + * method that returns an appropriate {@link SerializedLambda}. The + * {@code caller} class must have an appropriate {@code $deserializeLambda$} + * method, as described in {@link SerializedLambda}. + * + *

      When the target of the {@code CallSite} returned from this method is + * invoked, the resulting function objects are instances of a class with + * the following properties: + *

        + *
      • The class implements the interface named by the return type + * of {@code invokedType} and any interfaces named by {@code markerInterfaces}
      • + *
      • The class declares methods with the name given by {@code invokedName}, + * and the signature given by {@code samMethodType} and additional signatures + * given by {@code bridges}
      • + *
      • The class may override methods from {@code Object}, and may + * implement methods related to serialization.
      • + *
      + * + * @param caller Represents a lookup context with the accessibility + * privileges of the caller. When used with {@code invokedynamic}, + * this is stacked automatically by the VM. + * @param invokedName The name of the method to implement. When used with + * {@code invokedynamic}, this is provided by the + * {@code NameAndType} of the {@code InvokeDynamic} + * structure and is stacked automatically by the VM. + * @param invokedType The expected signature of the {@code CallSite}. The + * parameter types represent the types of capture variables; + * the return type is the interface to implement. When + * used with {@code invokedynamic}, this is provided by + * the {@code NameAndType} of the {@code InvokeDynamic} + * structure and is stacked automatically by the VM. * In the event that the implementation method is an - * instance method, the first argument in the invocation - * signature will correspond to the receiver. - * @param args flags and optional arguments, as described above - * @return a CallSite, which, when invoked, will return an instance of the - * functional interface - * @throws ReflectiveOperationException if the caller is not able to - * reconstruct one of the method handles - * @throws LambdaConversionException If any of the meta-factory protocol - * invariants are violated + * instance method and this signature has any parameters, + * the first parameter in the invocation signature must + * correspond to the receiver. + * @param args An {@code Object[]} array containing the required + * arguments {@code samMethodType}, {@code implMethod}, + * {@code instantiatedMethodType}, {@code flags}, and any + * optional arguments, as described + * {@link #altMetafactory(MethodHandles.Lookup, String, MethodType, Object...)} above} + * @return a CallSite whose target can be used to perform capture, generating + * instances of the interface named by {@code invokedType} + * @throws LambdaConversionException If any of the linkage invariants + * described {@link LambdaMetafactory above} + * are violated */ public static CallSite altMetafactory(MethodHandles.Lookup caller, String invokedName, MethodType invokedType, Object... args) - throws ReflectiveOperationException, LambdaConversionException { + throws LambdaConversionException { MethodType samMethodType = (MethodType)args[0]; MethodHandle implMethod = (MethodHandle)args[1]; MethodType instantiatedMethodType = (MethodType)args[2]; @@ -294,15 +451,15 @@ public class LambdaMetafactory { else bridges = EMPTY_MT_ARRAY; - boolean foundSerializableSupertype = Serializable.class.isAssignableFrom(invokedType.returnType()); - for (Class c : markerInterfaces) - foundSerializableSupertype |= Serializable.class.isAssignableFrom(c); - boolean isSerializable = ((flags & LambdaMetafactory.FLAG_SERIALIZABLE) != 0) - || foundSerializableSupertype; - - if (isSerializable && !foundSerializableSupertype) { - markerInterfaces = Arrays.copyOf(markerInterfaces, markerInterfaces.length + 1); - markerInterfaces[markerInterfaces.length-1] = Serializable.class; + boolean isSerializable = ((flags & FLAG_SERIALIZABLE) != 0); + if (isSerializable) { + boolean foundSerializableSupertype = Serializable.class.isAssignableFrom(invokedType.returnType()); + for (Class c : markerInterfaces) + foundSerializableSupertype |= Serializable.class.isAssignableFrom(c); + if (!foundSerializableSupertype) { + markerInterfaces = Arrays.copyOf(markerInterfaces, markerInterfaces.length + 1); + markerInterfaces[markerInterfaces.length-1] = Serializable.class; + } } AbstractValidatingLambdaMetafactory mf diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java index 56cb245e6ae..fd5cac8cd7b 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -441,8 +441,13 @@ class MethodHandleNatives { assert(refKindIsValid(refKind)); return lookup.linkMethodHandleConstant((byte) refKind, defc, name, type); } catch (IllegalAccessException ex) { - Error err = new IllegalAccessError(ex.getMessage()); - throw initCauseFrom(err, ex); + Throwable cause = ex.getCause(); + if (cause instanceof AbstractMethodError) { + throw (AbstractMethodError) cause; + } else { + Error err = new IllegalAccessError(ex.getMessage()); + throw initCauseFrom(err, ex); + } } catch (NoSuchMethodException ex) { Error err = new NoSuchMethodError(ex.getMessage()); throw initCauseFrom(err, ex); diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index 1ad7e9cd23f..57a6f785164 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -1716,6 +1716,13 @@ return mh1; checkSymbolicClass(defc); return mh; } + // Treat MethodHandle.invoke and invokeExact specially. + if (defc == MethodHandle.class && refKind == REF_invokeVirtual) { + mh = findVirtualForMH(member.getName(), member.getMethodType()); + if (mh != null) { + return mh; + } + } MemberName resolved = resolveOrFail(refKind, member); mh = getDirectMethodForConstant(refKind, defc, resolved); if (mh instanceof DirectMethodHandle @@ -1768,12 +1775,6 @@ return mh1; if (MethodHandleNatives.refKindIsField(refKind)) { return getDirectFieldNoSecurityManager(refKind, defc, member); } else if (MethodHandleNatives.refKindIsMethod(refKind)) { - if (defc == MethodHandle.class && refKind == REF_invokeVirtual) { - MethodHandle mh = findVirtualForMH(member.getName(), member.getMethodType()); - if (mh != null) { - return mh; - } - } return getDirectMethodNoSecurityManager(refKind, defc, member, lookupClass); } else if (refKind == REF_newInvokeSpecial) { return getDirectConstructorNoSecurityManager(defc, member); diff --git a/jdk/src/share/classes/java/lang/invoke/MethodType.java b/jdk/src/share/classes/java/lang/invoke/MethodType.java index f8e0967c7af..cfef437cda6 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodType.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java @@ -813,7 +813,7 @@ class MethodType implements java.io.Serializable { * So this method returns {@link #parameterCount() parameterCount} plus the * number of long and double parameters (if any). *

      - * This method is included for the benfit of applications that must + * This method is included for the benefit of applications that must * generate bytecodes that process method handles and invokedynamic. * @return the number of JVM stack slots for this type's parameters */ @@ -844,7 +844,7 @@ class MethodType implements java.io.Serializable { * plus the number of long or double arguments * at or after after the argument for the given parameter. *

      - * This method is included for the benfit of applications that must + * This method is included for the benefit of applications that must * generate bytecodes that process method handles and invokedynamic. * @param num an index (zero-based, inclusive) within the parameter types * @return the index of the (shallowest) JVM stack slot transmitting the @@ -862,7 +862,7 @@ class MethodType implements java.io.Serializable { * If the {@link #returnType() return type} is void, it will be zero, * else if the return type is long or double, it will be two, else one. *

      - * This method is included for the benfit of applications that must + * This method is included for the benefit of applications that must * generate bytecodes that process method handles and invokedynamic. * @return the number of JVM stack slots (0, 1, or 2) for this type's return value * Will be removed for PFD. @@ -882,7 +882,7 @@ class MethodType implements java.io.Serializable { * constructed by this method, because their component types are * not all reachable from a common class loader. *

      - * This method is included for the benfit of applications that must + * This method is included for the benefit of applications that must * generate bytecodes that process method handles and {@code invokedynamic}. * @param descriptor a bytecode-level type descriptor string "(T...)T" * @param loader the class loader in which to look up the types @@ -912,7 +912,7 @@ class MethodType implements java.io.Serializable { * Two distinct classes which share a common name but have different class loaders * will appear identical when viewed within descriptor strings. *

      - * This method is included for the benfit of applications that must + * This method is included for the benefit of applications that must * generate bytecodes that process method handles and {@code invokedynamic}. * {@link #fromMethodDescriptorString(java.lang.String, java.lang.ClassLoader) fromMethodDescriptorString}, * because the latter requires a suitable class loader argument. diff --git a/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java b/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java index 9be96ff685b..e6412012721 100644 --- a/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java +++ b/jdk/src/share/classes/java/lang/invoke/SerializedLambda.java @@ -32,9 +32,26 @@ import java.security.PrivilegedExceptionAction; import java.util.Objects; /** - * Serialized form of a lambda expression. The properties of this class represent the information that is present - * at the lambda factory site, including the identity of the primary functional interface method, the identity of the - * implementation method, and any variables captured from the local environment at the time of lambda capture. + * Serialized form of a lambda expression. The properties of this class + * represent the information that is present at the lambda factory site, including + * static metafactory arguments such as the identity of the primary functional + * interface method and the identity of the implementation method, as well as + * dynamic metafactory arguments such as values captured from the lexical scope + * at the time of lambda capture. + * + *

      Implementors of serializable lambdas, such as compilers or language + * runtime libraries, are expected to ensure that instances deserialize properly. + * One means to do so is to ensure that the {@code writeReplace} method returns + * an instance of {@code SerializedLambda}, rather than allowing default + * serialization to proceed. + * + *

      {@code SerializedLambda} has a {@code readResolve} method that looks for + * a (possibly private) static method called + * {@code $deserializeLambda$(SerializedLambda)} in the capturing class, invokes + * that with itself as the first argument, and returns the result. Lambda classes + * implementing {@code $deserializeLambda$} are responsible for validating + * that the properties of the {@code SerializedLambda} are consistent with a + * lambda actually captured by that class. * * @see LambdaMetafactory */ diff --git a/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java b/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java index 3aa63c84ae7..f65049df036 100644 --- a/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java +++ b/jdk/src/share/classes/java/lang/invoke/TypeConvertingMethodAdapter.java @@ -28,6 +28,7 @@ package java.lang.invoke; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.org.objectweb.asm.Type; +import sun.invoke.util.BytecodeDescriptor; import sun.invoke.util.Wrapper; import static sun.invoke.util.Wrapper.*; @@ -204,27 +205,27 @@ class TypeConvertingMethodAdapter extends MethodVisitor { } /** - * Convert an argument of type 'argType' to be passed to 'targetType' assuring that it is 'functionalType'. + * Convert an argument of type 'arg' to be passed to 'target' assuring that it is 'functional'. * Insert the needed conversion instructions in the method code. - * @param argType - * @param targetType - * @param functionalType + * @param arg + * @param target + * @param functional */ - void convertType(String dArg, String dTarget, String dFunctional) { - if (dArg.equals(dTarget)) { + void convertType(Class arg, Class target, Class functional) { + if (arg.equals(target)) { return; } - Wrapper wArg = toWrapper(dArg); - Wrapper wTarget = toWrapper(dTarget); - if (wArg == VOID || wTarget == VOID) { + if (arg == Void.TYPE || target == Void.TYPE) { return; } - if (isPrimitive(wArg)) { - if (isPrimitive(wTarget)) { + if (arg.isPrimitive()) { + Wrapper wArg = Wrapper.forPrimitiveType(arg); + if (target.isPrimitive()) { // Both primitives: widening - widen(wArg, wTarget); + widen(wArg, Wrapper.forPrimitiveType(target)); } else { // Primitive argument to reference target + String dTarget = BytecodeDescriptor.unparse(target); Wrapper wPrimTarget = wrapperOrNullFromDescriptor(dTarget); if (wPrimTarget != null) { // The target is a boxed primitive type, widen to get there before boxing @@ -237,16 +238,18 @@ class TypeConvertingMethodAdapter extends MethodVisitor { } } } else { + String dArg = BytecodeDescriptor.unparse(arg); String dSrc; - Wrapper wFunctional = toWrapper(dFunctional); - if (isPrimitive(wFunctional)) { + if (functional.isPrimitive()) { dSrc = dArg; } else { // Cast to convert to possibly more specific type, and generate CCE for invalid arg - dSrc = dFunctional; - cast(dArg, dFunctional); + dSrc = BytecodeDescriptor.unparse(functional); + cast(dArg, dSrc); } - if (isPrimitive(wTarget)) { + String dTarget = BytecodeDescriptor.unparse(target); + if (target.isPrimitive()) { + Wrapper wTarget = toWrapper(dTarget); // Reference argument to primitive target Wrapper wps = wrapperOrNullFromDescriptor(dSrc); if (wps != null) { diff --git a/jdk/src/share/classes/java/lang/management/CompilationMXBean.java b/jdk/src/share/classes/java/lang/management/CompilationMXBean.java index 693beae1a01..bc411ed00ab 100644 --- a/jdk/src/share/classes/java/lang/management/CompilationMXBean.java +++ b/jdk/src/share/classes/java/lang/management/CompilationMXBean.java @@ -74,7 +74,7 @@ public interface CompilationMXBean extends PlatformManagedObject { public boolean isCompilationTimeMonitoringSupported(); /** - * Returns the approximate accumlated elapsed time (in milliseconds) + * Returns the approximate accumulated elapsed time (in milliseconds) * spent in compilation. * If multiple threads are used for compilation, this value is * summation of the approximate time that each thread spent in compilation. diff --git a/jdk/src/share/classes/java/lang/management/ManagementFactory.java b/jdk/src/share/classes/java/lang/management/ManagementFactory.java index 6e00706ccd0..0c7297abe95 100644 --- a/jdk/src/share/classes/java/lang/management/ManagementFactory.java +++ b/jdk/src/share/classes/java/lang/management/ManagementFactory.java @@ -60,7 +60,7 @@ import sun.management.ManagementFactoryHelper; * one or more platform MXBeans representing * the management interface of a component of the Java virtual * machine. - *

      + * *

      Platform MXBeans

      *

      * A platform MXBean is a managed bean that diff --git a/jdk/src/share/classes/java/lang/management/ManagementPermission.java b/jdk/src/share/classes/java/lang/management/ManagementPermission.java index 7f62c5e396a..ae3dc564518 100644 --- a/jdk/src/share/classes/java/lang/management/ManagementPermission.java +++ b/jdk/src/share/classes/java/lang/management/ManagementPermission.java @@ -33,10 +33,8 @@ package java.lang.management; * The following table * provides a summary description of what the permission allows, * and discusses the risks of granting code the permission. - *

      * - * + *
      * * * diff --git a/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java b/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java index 82aa1fcda87..ae0b97cbc85 100644 --- a/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java +++ b/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java @@ -147,7 +147,7 @@ package java.lang.management; * by calling either the {@link #getUsage} method for all * memory pools or the {@link #isUsageThresholdExceeded} method * for those memory pools that support a usage threshold. - * Below is example code that has a thread delicated for + * Below is example code that has a thread dedicated for * task distribution and processing. At every interval, * it will determine if it should receive and process new tasks based * on its memory usage. If the memory usage exceeds its usage threshold, @@ -191,7 +191,7 @@ package java.lang.management; *
      * The above example does not differentiate the case where * the memory usage has temporarily dropped below the usage threshold - * from the case where the memory usage remains above the threshould + * from the case where the memory usage remains above the threshold * between two iterations. The usage threshold count returned by * the {@link #getUsageThresholdCount} method * can be used to determine diff --git a/jdk/src/share/classes/java/lang/management/MemoryUsage.java b/jdk/src/share/classes/java/lang/management/MemoryUsage.java index bbb75a26484..6d11e323f6d 100644 --- a/jdk/src/share/classes/java/lang/management/MemoryUsage.java +++ b/jdk/src/share/classes/java/lang/management/MemoryUsage.java @@ -79,7 +79,7 @@ import sun.management.MemoryUsageCompositeData; *
      Permission Target NameWhat the Permission Allows
      * * Below is a picture showing an example of a memory pool: - *

      + * *

        *        +----------------------------------------------+
        *        +////////////////           |                  +
      @@ -250,7 +250,7 @@ public class MemoryUsage {
            * Returns a MemoryUsage object represented by the
            * given CompositeData. The given CompositeData
            * must contain the following attributes:
      -     * 

      + * *

      * * diff --git a/jdk/src/share/classes/java/lang/management/ThreadInfo.java b/jdk/src/share/classes/java/lang/management/ThreadInfo.java index e6f80b2eb23..b1028f31488 100644 --- a/jdk/src/share/classes/java/lang/management/ThreadInfo.java +++ b/jdk/src/share/classes/java/lang/management/ThreadInfo.java @@ -492,7 +492,7 @@ public class ThreadInfo { * @return the thread ID of the owner thread of the object * this thread is blocked on; * -1 if this thread is not blocked - * or if the object lis not owned by any thread. + * or if the object is not owned by any thread. * * @see #getLockInfo */ diff --git a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java index 02a87dcf6d3..521ca7fe6dd 100644 --- a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java +++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java @@ -646,7 +646,7 @@ public interface ThreadMXBean extends PlatformManagedObject { * exists and the caller does not have * ManagementPermission("monitor"). * @throws java.lang.UnsupportedOperationException if the Java virtual - * machine does not support monitoriing of ownable synchronizer usage. + * machine does not support monitoring of ownable synchronizer usage. * * @see #isSynchronizerUsageSupported * @see #findMonitorDeadlockedThreads diff --git a/jdk/src/share/classes/java/lang/management/package.html b/jdk/src/share/classes/java/lang/management/package.html index 7d2fa99b737..c2c74d0ccdd 100644 --- a/jdk/src/share/classes/java/lang/management/package.html +++ b/jdk/src/share/classes/java/lang/management/package.html @@ -82,7 +82,7 @@ Java virtual machine and the runtime in the following ways: 1. Direct access to an MXBean interface

        -
      • Get an MXBean instance locally in the running Java virtual machine:

        +

      • Get an MXBean instance locally in the running Java virtual machine:
            RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
         
        @@ -103,7 +103,7 @@ Java virtual machine and the runtime in the following ways:
         

      • Construct an MXBean proxy instance that forwards the - method calls to a given MBeanServer:

        + method calls to a given MBeanServer:

            MBeanServerConnection mbs;
         
        diff --git a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java
        index 50a7e6af904..f169202132a 100644
        --- a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java
        +++ b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java
        @@ -27,6 +27,15 @@ package java.lang.reflect;
         
         import java.lang.annotation.Annotation;
         import java.lang.annotation.AnnotationFormatError;
        +import java.lang.annotation.Repeatable;
        +import java.util.Arrays;
        +import java.util.LinkedHashMap;
        +import java.util.Map;
        +import java.util.Objects;
        +import java.util.function.Function;
        +import java.util.stream.Collectors;
        +import sun.reflect.annotation.AnnotationSupport;
        +import sun.reflect.annotation.AnnotationType;
         
         /**
          * Represents an annotated element of the program currently running in this
        @@ -222,6 +231,18 @@ public interface AnnotatedElement {
              * The caller of this method is free to modify the returned array; it will
              * have no effect on the arrays returned to other callers.
              *
        +     * @implSpec The default implementation first calls {@link
        +     * #getDeclaredAnnotationsByType(Class)} passing {@code
        +     * annotationClass} as the argument. If the returned array has
        +     * length greater than zero, the array is returned. If the returned
        +     * array is zero-length and this {@code AnnotatedElement} is a
        +     * class and the argument type is an inheritable annotation type,
        +     * and the superclass of this {@code AnnotatedElement} is non-null,
        +     * then the returned result is the result of calling {@link
        +     * #getAnnotationsByType(Class)} on the superclass with {@code
        +     * annotationClass} as the argument. Otherwise, a zero-length
        +     * array is returned.
        +     *
              * @param  the type of the annotation to query for and return if present
              * @param annotationClass the Class object corresponding to the
              *        annotation type
        @@ -230,7 +251,29 @@ public interface AnnotatedElement {
              * @throws NullPointerException if the given annotation class is null
              * @since 1.8
              */
        -     T[] getAnnotationsByType(Class annotationClass);
        +    default  T[] getAnnotationsByType(Class annotationClass) {
        +         /*
        +          * Definition of associated: directly or indirectly present OR
        +          * neither directly nor indirectly present AND the element is
        +          * a Class, the annotation type is inheritable, and the
        +          * annotation type is associated with the superclass of the
        +          * element.
        +          */
        +         T[] result = getDeclaredAnnotationsByType(annotationClass);
        +
        +         if (result.length == 0 && // Neither directly nor indirectly present
        +             this instanceof Class && // the element is a class
        +             AnnotationType.getInstance(annotationClass).isInherited()) { // Inheritable
        +             Class superClass = ((Class) this).getSuperclass();
        +             if (superClass != null) {
        +                 // Determine if the annotation is associated with the
        +                 // superclass
        +                 result = superClass.getAnnotationsByType(annotationClass);
        +             }
        +         }
        +
        +         return result;
        +     }
         
             /**
              * Returns this element's annotation for the specified type if
        @@ -239,6 +282,11 @@ public interface AnnotatedElement {
              * This method ignores inherited annotations. (Returns null if no
              * annotations are directly present on this element.)
              *
        +     * @implSpec The default implementation first performs a null check
        +     * and then loops over the results of {@link
        +     * #getDeclaredAnnotations} returning the first annotation whose
        +     * annotation type matches the argument type.
        +     *
              * @param  the type of the annotation to query for and return if directly present
              * @param annotationClass the Class object corresponding to the
              *        annotation type
        @@ -247,7 +295,18 @@ public interface AnnotatedElement {
              * @throws NullPointerException if the given annotation class is null
              * @since 1.8
              */
        -     T getDeclaredAnnotation(Class annotationClass);
        +    default  T getDeclaredAnnotation(Class annotationClass) {
        +         Objects.requireNonNull(annotationClass);
        +         // Loop over all directly-present annotations looking for a matching one
        +         for (Annotation annotation : getDeclaredAnnotations()) {
        +             if (annotationClass.equals(annotation.annotationType())) {
        +                 // More robust to do a dynamic cast at runtime instead
        +                 // of compile-time only.
        +                 return annotationClass.cast(annotation);
        +             }
        +         }
        +         return null;
        +     }
         
             /**
              * Returns this element's annotation(s) for the specified type if
        @@ -268,6 +327,22 @@ public interface AnnotatedElement {
              * The caller of this method is free to modify the returned array; it will
              * have no effect on the arrays returned to other callers.
              *
        +     * @implSpec The default implementation may call {@link
        +     * #getDeclaredAnnotation(Class)} one or more times to find a
        +     * directly present annotation and, if the annotation type is
        +     * repeatable, to find a container annotation. If annotations of
        +     * the annotation type {@code annotationClass} are found to be both
        +     * directly and indirectly present, then {@link
        +     * #getDeclaredAnnotations()} will get called to determine the
        +     * order of the elements in the returned array.
        +     *
        +     * 

        Alternatively, the default implementation may call {@link + * #getDeclaredAnnotations()} a single time and the returned array + * examined for both directly and indirectly present + * annotations. The results of calling {@link + * #getDeclaredAnnotations()} are assumed to be consistent with the + * results of calling {@link #getDeclaredAnnotation(Class)}. + * * @param the type of the annotation to query for and return * if directly or indirectly present * @param annotationClass the Class object corresponding to the @@ -277,7 +352,16 @@ public interface AnnotatedElement { * @throws NullPointerException if the given annotation class is null * @since 1.8 */ - T[] getDeclaredAnnotationsByType(Class annotationClass); + default T[] getDeclaredAnnotationsByType(Class annotationClass) { + Objects.requireNonNull(annotationClass); + return AnnotationSupport. + getDirectlyAndIndirectlyPresent(Arrays.stream(getDeclaredAnnotations()). + collect(Collectors.toMap(Annotation::annotationType, + Function.identity(), + ((first,second) -> first), + LinkedHashMap::new)), + annotationClass); + } /** * Returns annotations that are directly present on this element. diff --git a/jdk/src/share/classes/java/lang/reflect/Constructor.java b/jdk/src/share/classes/java/lang/reflect/Constructor.java index 202a7368fb1..d852fcd1741 100644 --- a/jdk/src/share/classes/java/lang/reflect/Constructor.java +++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java @@ -28,6 +28,8 @@ package java.lang.reflect; import sun.reflect.CallerSensitive; import sun.reflect.ConstructorAccessor; import sun.reflect.Reflection; +import sun.reflect.annotation.TypeAnnotation; +import sun.reflect.annotation.TypeAnnotationParser; import sun.reflect.generics.repository.ConstructorRepository; import sun.reflect.generics.factory.CoreReflectionFactory; import sun.reflect.generics.factory.GenericsFactory; @@ -534,4 +536,22 @@ public final class Constructor extends Executable { public AnnotatedType getAnnotatedReturnType() { return getAnnotatedReturnType0(getDeclaringClass()); } + + /** + * {@inheritDoc} + * @since 1.8 + */ + @Override + public AnnotatedType getAnnotatedReceiverType() { + if (getDeclaringClass().getEnclosingClass() == null) + return super.getAnnotatedReceiverType(); + + return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(), + sun.misc.SharedSecrets.getJavaLangAccess(). + getConstantPool(getDeclaringClass()), + this, + getDeclaringClass(), + getDeclaringClass().getEnclosingClass(), + TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER); + } } diff --git a/jdk/src/share/classes/java/lang/reflect/Executable.java b/jdk/src/share/classes/java/lang/reflect/Executable.java index c92c9a57f78..d033e7e9300 100644 --- a/jdk/src/share/classes/java/lang/reflect/Executable.java +++ b/jdk/src/share/classes/java/lang/reflect/Executable.java @@ -383,7 +383,7 @@ public abstract class Executable extends AccessibleObject private transient volatile Parameter[] parameters; private native Parameter[] getParameters0(); - private native byte[] getTypeAnnotationBytes0(); + native byte[] getTypeAnnotationBytes0(); // Needed by reflectaccess byte[] getTypeAnnotationBytes() { @@ -527,7 +527,7 @@ public abstract class Executable extends AccessibleObject public T[] getAnnotationsByType(Class annotationClass) { Objects.requireNonNull(annotationClass); - return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass); + return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass); } /** diff --git a/jdk/src/share/classes/java/lang/reflect/Field.java b/jdk/src/share/classes/java/lang/reflect/Field.java index e84b6b242d3..6e243bc82b6 100644 --- a/jdk/src/share/classes/java/lang/reflect/Field.java +++ b/jdk/src/share/classes/java/lang/reflect/Field.java @@ -1123,7 +1123,7 @@ class Field extends AccessibleObject implements Member { public T[] getAnnotationsByType(Class annotationClass) { Objects.requireNonNull(annotationClass); - return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass); + return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass); } /** diff --git a/jdk/src/share/classes/java/lang/reflect/Parameter.java b/jdk/src/share/classes/java/lang/reflect/Parameter.java index 2285819c27b..d8c992c15bd 100644 --- a/jdk/src/share/classes/java/lang/reflect/Parameter.java +++ b/jdk/src/share/classes/java/lang/reflect/Parameter.java @@ -295,7 +295,7 @@ public final class Parameter implements AnnotatedElement { public T[] getAnnotationsByType(Class annotationClass) { Objects.requireNonNull(annotationClass); - return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass); + return AnnotationSupport.getDirectlyAndIndirectlyPresent(declaredAnnotations(), annotationClass); } /** diff --git a/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java b/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java index 6570e792242..2674de47caa 100644 --- a/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java +++ b/jdk/src/share/classes/java/lang/reflect/ReflectPermission.java @@ -31,7 +31,6 @@ package java.lang.reflect; * The following table * provides a summary description of what the permission allows, * and discusses the risks of granting code the permission. - *

        * *

      * diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index f7878ab3302..5fab7443295 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -97,6 +97,21 @@ import sun.misc.FloatConsts; * {@code NullPointerException} when passed * a null object reference for any input parameter. * + * BigInteger must support values in the range + * -2{@code Integer.MAX_VALUE} (exclusive) to + * +2{@code Integer.MAX_VALUE} (exclusive) + * and may support values outside of that range. + * + * The range of probable prime values is limited and may be less than + * the full supported positive range of {@code BigInteger}. + * The range must be at least 1 to 2500000000. + * + * @implNote + * BigInteger constructors and operations throw {@code ArithmeticException} when + * the result is out of the supported range of + * -2{@code Integer.MAX_VALUE} (exclusive) to + * +2{@code Integer.MAX_VALUE} (exclusive). + * * @see BigDecimal * @author Josh Bloch * @author Michael McCloskey @@ -182,6 +197,18 @@ public class BigInteger extends Number implements Comparable { */ final static long LONG_MASK = 0xffffffffL; + /** + * This constant limits {@code mag.length} of BigIntegers to the supported + * range. + */ + private static final int MAX_MAG_LENGTH = Integer.MAX_VALUE / Integer.SIZE + 1; // (1 << 26) + + /** + * Bit lengths larger than this constant can cause overflow in searchLen + * calculation and in BitSieve.singleSearch method. + */ + private static final int PRIME_SEARCH_BIT_LENGTH_LIMIT = 500000000; + /** * The threshold value for using Karatsuba multiplication. If the number * of ints in both mag arrays are greater than this number, then @@ -256,6 +283,9 @@ public class BigInteger extends Number implements Comparable { mag = stripLeadingZeroBytes(val); signum = (mag.length == 0 ? 0 : 1); } + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /** @@ -275,6 +305,9 @@ public class BigInteger extends Number implements Comparable { mag = trustedStripLeadingZeroInts(val); signum = (mag.length == 0 ? 0 : 1); } + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /** @@ -306,6 +339,9 @@ public class BigInteger extends Number implements Comparable { throw(new NumberFormatException("signum-magnitude mismatch")); this.signum = signum; } + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /** @@ -327,6 +363,9 @@ public class BigInteger extends Number implements Comparable { throw(new NumberFormatException("signum-magnitude mismatch")); this.signum = signum; } + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /** @@ -359,17 +398,20 @@ public class BigInteger extends Number implements Comparable { int sign = 1; int index1 = val.lastIndexOf('-'); int index2 = val.lastIndexOf('+'); - if ((index1 + index2) <= -1) { - // No leading sign character or at most one leading sign character - if (index1 == 0 || index2 == 0) { - cursor = 1; - if (len == 1) - throw new NumberFormatException("Zero length BigInteger"); + if (index1 >= 0) { + if (index1 != 0 || index2 >= 0) { + throw new NumberFormatException("Illegal embedded sign character"); } - if (index1 == 0) - sign = -1; - } else - throw new NumberFormatException("Illegal embedded sign character"); + sign = -1; + cursor = 1; + } else if (index2 >= 0) { + if (index2 != 0) { + throw new NumberFormatException("Illegal embedded sign character"); + } + cursor = 1; + } + if (cursor == len) + throw new NumberFormatException("Zero length BigInteger"); // Skip leading zeros and compute number of digits in magnitude while (cursor < len && @@ -388,8 +430,11 @@ public class BigInteger extends Number implements Comparable { // Pre-allocate array of expected size. May be too large but can // never be too small. Typically exact. - int numBits = (int)(((numDigits * bitsPerDigit[radix]) >>> 10) + 1); - int numWords = (numBits + 31) >>> 5; + long numBits = ((numDigits * bitsPerDigit[radix]) >>> 10) + 1; + if (numBits + 31 >= (1L << 32)) { + reportOverflow(); + } + int numWords = (int) (numBits + 31) >>> 5; int[] magnitude = new int[numWords]; // Process first (potentially short) digit group @@ -413,6 +458,9 @@ public class BigInteger extends Number implements Comparable { } // Required for cases where the array was overallocated. mag = trustedStripLeadingZeroInts(magnitude); + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /* @@ -439,8 +487,11 @@ public class BigInteger extends Number implements Comparable { if (len < 10) { numWords = 1; } else { - int numBits = (int)(((numDigits * bitsPerDigit[10]) >>> 10) + 1); - numWords = (numBits + 31) >>> 5; + long numBits = ((numDigits * bitsPerDigit[10]) >>> 10) + 1; + if (numBits + 31 >= (1L << 32)) { + reportOverflow(); + } + numWords = (int) (numBits + 31) >>> 5; } int[] magnitude = new int[numWords]; @@ -456,6 +507,9 @@ public class BigInteger extends Number implements Comparable { destructiveMulAdd(magnitude, intRadix[10], groupVal); } mag = trustedStripLeadingZeroInts(magnitude); + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } // Create an integer with the digits between the two indexes @@ -575,7 +629,7 @@ public class BigInteger extends Number implements Comparable { * this constructor is proportional to the value of this parameter. * @param rnd source of random bits used to select candidates to be * tested for primality. - * @throws ArithmeticException {@code bitLength < 2}. + * @throws ArithmeticException {@code bitLength < 2} or {@code bitLength} is too large. * @see #bitLength() */ public BigInteger(int bitLength, int certainty, Random rnd) { @@ -607,7 +661,7 @@ public class BigInteger extends Number implements Comparable { * @param rnd source of random bits used to select candidates to be * tested for primality. * @return a BigInteger of {@code bitLength} bits that is probably prime - * @throws ArithmeticException {@code bitLength < 2}. + * @throws ArithmeticException {@code bitLength < 2} or {@code bitLength} is too large. * @see #bitLength() * @since 1.4 */ @@ -677,7 +731,7 @@ public class BigInteger extends Number implements Comparable { p.mag[p.mag.length-1] &= 0xfffffffe; // Use a sieve length likely to contain the next prime number - int searchLen = (bitLength / 20) * 64; + int searchLen = getPrimeSearchLen(bitLength); BitSieve searchSieve = new BitSieve(p, searchLen); BigInteger candidate = searchSieve.retrieve(p, certainty, rnd); @@ -701,7 +755,7 @@ public class BigInteger extends Number implements Comparable { * * @return the first integer greater than this {@code BigInteger} that * is probably prime. - * @throws ArithmeticException {@code this < 0}. + * @throws ArithmeticException {@code this < 0} or {@code this} is too large. * @since 1.5 */ public BigInteger nextProbablePrime() { @@ -750,7 +804,7 @@ public class BigInteger extends Number implements Comparable { result = result.subtract(ONE); // Looking for the next large prime - int searchLen = (result.bitLength() / 20) * 64; + int searchLen = getPrimeSearchLen(result.bitLength()); while (true) { BitSieve searchSieve = new BitSieve(result, searchLen); @@ -762,6 +816,13 @@ public class BigInteger extends Number implements Comparable { } } + private static int getPrimeSearchLen(int bitLength) { + if (bitLength > PRIME_SEARCH_BIT_LENGTH_LIMIT + 1) { + throw new ArithmeticException("Prime search implementation restriction on bitLength"); + } + return bitLength / 20 * 64; + } + /** * Returns {@code true} if this BigInteger is probably prime, * {@code false} if it's definitely composite. @@ -965,6 +1026,9 @@ public class BigInteger extends Number implements Comparable { BigInteger(int[] magnitude, int signum) { this.signum = (magnitude.length == 0 ? 0 : signum); this.mag = magnitude; + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } } /** @@ -974,6 +1038,25 @@ public class BigInteger extends Number implements Comparable { private BigInteger(byte[] magnitude, int signum) { this.signum = (magnitude.length == 0 ? 0 : signum); this.mag = stripLeadingZeroBytes(magnitude); + if (mag.length >= MAX_MAG_LENGTH) { + checkRange(); + } + } + + /** + * Throws an {@code ArithmeticException} if the {@code BigInteger} would be + * out of the supported range. + * + * @throws ArithmeticException if {@code this} exceeds the supported range. + */ + private void checkRange() { + if (mag.length > MAX_MAG_LENGTH || mag.length == MAX_MAG_LENGTH && mag[0] < 0) { + reportOverflow(); + } + } + + private static void reportOverflow() { + throw new ArithmeticException("BigInteger would overflow supported range"); } //Static Factory Methods @@ -2073,6 +2156,10 @@ public class BigInteger extends Number implements Comparable { // The remaining part can then be exponentiated faster. The // powers of two will be multiplied back at the end. int powersOfTwo = partToSquare.getLowestSetBit(); + long bitsToShift = (long)powersOfTwo * exponent; + if (bitsToShift > Integer.MAX_VALUE) { + reportOverflow(); + } int remainingBits; @@ -2126,11 +2213,10 @@ public class BigInteger extends Number implements Comparable { // Multiply back the powers of two (quickly, by shifting left) if (powersOfTwo > 0) { - int bitsToShift = powersOfTwo*exponent; if (bitsToShift + scaleFactor <= 62) { // Fits in long? return valueOf((result << bitsToShift) * newSign); } else { - return valueOf(result*newSign).shiftLeft(bitsToShift); + return valueOf(result*newSign).shiftLeft((int) bitsToShift); } } else { @@ -2375,8 +2461,17 @@ public class BigInteger extends Number implements Comparable { BigInteger y1 = m2.modInverse(m1); BigInteger y2 = m1.modInverse(m2); - result = a1.multiply(m2).multiply(y1).add - (a2.multiply(m1).multiply(y2)).mod(m); + if (m.mag.length < MAX_MAG_LENGTH / 2) { + result = a1.multiply(m2).multiply(y1).add(a2.multiply(m1).multiply(y2)).mod(m); + } else { + MutableBigInteger t1 = new MutableBigInteger(); + new MutableBigInteger(a1.multiply(m2)).multiply(new MutableBigInteger(y1), t1); + MutableBigInteger t2 = new MutableBigInteger(); + new MutableBigInteger(a2.multiply(m1)).multiply(new MutableBigInteger(y2), t2); + t1.add(t2); + MutableBigInteger q = new MutableBigInteger(); + result = t1.divide(new MutableBigInteger(m), q).toBigInteger(); + } } return (invertResult ? result.modInverse(m) : result); @@ -2797,27 +2892,31 @@ public class BigInteger extends Number implements Comparable { * * @param n shift distance, in bits. * @return {@code this << n} - * @throws ArithmeticException if the shift distance is {@code - * Integer.MIN_VALUE}. * @see #shiftRight */ public BigInteger shiftLeft(int n) { if (signum == 0) return ZERO; - if (n == 0) + if (n > 0) { + return new BigInteger(shiftLeft(mag, n), signum); + } else if (n == 0) { return this; - if (n < 0) { - if (n == Integer.MIN_VALUE) { - throw new ArithmeticException("Shift distance of Integer.MIN_VALUE not supported."); - } else { - return shiftRight(-n); - } + } else { + // Possible int overflow in (-n) is not a trouble, + // because shiftRightImpl considers its argument unsigned + return shiftRightImpl(-n); } - int[] newMag = shiftLeft(mag, n); - - return new BigInteger(newMag, signum); } + /** + * Returns a magnitude array whose value is {@code (mag << n)}. + * The shift distance, {@code n}, is considered unnsigned. + * (Computes this * 2n.) + * + * @param mag magnitude, the most-significant int ({@code mag[0]}) must be non-zero. + * @param n unsigned shift distance, in bits. + * @return {@code mag << n} + */ private static int[] shiftLeft(int[] mag, int n) { int nInts = n >>> 5; int nBits = n & 0x1f; @@ -2853,21 +2952,31 @@ public class BigInteger extends Number implements Comparable { * * @param n shift distance, in bits. * @return {@code this >> n} - * @throws ArithmeticException if the shift distance is {@code - * Integer.MIN_VALUE}. * @see #shiftLeft */ public BigInteger shiftRight(int n) { - if (n == 0) + if (signum == 0) + return ZERO; + if (n > 0) { + return shiftRightImpl(n); + } else if (n == 0) { return this; - if (n < 0) { - if (n == Integer.MIN_VALUE) { - throw new ArithmeticException("Shift distance of Integer.MIN_VALUE not supported."); - } else { - return shiftLeft(-n); - } + } else { + // Possible int overflow in {@code -n} is not a trouble, + // because shiftLeft considers its argument unsigned + return new BigInteger(shiftLeft(mag, -n), signum); } + } + /** + * Returns a BigInteger whose value is {@code (this >> n)}. The shift + * distance, {@code n}, is considered unsigned. + * (Computes floor(this * 2-n).) + * + * @param n unsigned shift distance, in bits. + * @return {@code this >> n} + */ + private BigInteger shiftRightImpl(int n) { int nInts = n >>> 5; int nBits = n & 0x1f; int magLen = mag.length; @@ -3899,7 +4008,7 @@ public class BigInteger extends Number implements Comparable { ; int extraByte = (k == byteLength) ? 1 : 0; - int intLength = ((byteLength - keep + extraByte) + 3)/4; + int intLength = ((byteLength - keep + extraByte) + 3) >>> 2; int result[] = new int[intLength]; /* Copy one's complement of input into output, leaving extra @@ -4135,7 +4244,8 @@ public class BigInteger extends Number implements Comparable { message = "BigInteger: Signum not present in stream"; throw new java.io.StreamCorruptedException(message); } - if ((magnitude.length == 0) != (sign == 0)) { + int[] mag = stripLeadingZeroBytes(magnitude); + if ((mag.length == 0) != (sign == 0)) { String message = "BigInteger: signum-magnitude mismatch"; if (fields.defaulted("magnitude")) message = "BigInteger: Magnitude not present in stream"; @@ -4146,7 +4256,14 @@ public class BigInteger extends Number implements Comparable { UnsafeHolder.putSign(this, sign); // Calculate mag field from magnitude and discard magnitude - UnsafeHolder.putMag(this, stripLeadingZeroBytes(magnitude)); + UnsafeHolder.putMag(this, mag); + if (mag.length >= MAX_MAG_LENGTH) { + try { + checkRange(); + } catch (ArithmeticException e) { + throw new java.io.StreamCorruptedException("BigInteger: Out of the supported range"); + } + } } // Support for resetting final fields while deserializing diff --git a/jdk/src/share/classes/java/math/MutableBigInteger.java b/jdk/src/share/classes/java/math/MutableBigInteger.java index 6f72f2d0c83..bc4e4841344 100644 --- a/jdk/src/share/classes/java/math/MutableBigInteger.java +++ b/jdk/src/share/classes/java/math/MutableBigInteger.java @@ -1257,14 +1257,14 @@ class MutableBigInteger { int j = (s+m-1) / m; // step 2a: j = ceil(s/m) int n = j * m; // step 2b: block length in 32-bit units - int n32 = 32 * n; // block length in bits - int sigma = Math.max(0, n32 - b.bitLength()); // step 3: sigma = max{T | (2^T)*B < beta^n} + long n32 = 32L * n; // block length in bits + int sigma = (int) Math.max(0, n32 - b.bitLength()); // step 3: sigma = max{T | (2^T)*B < beta^n} MutableBigInteger bShifted = new MutableBigInteger(b); bShifted.safeLeftShift(sigma); // step 4a: shift b so its length is a multiple of n safeLeftShift(sigma); // step 4b: shift this by the same amount // step 5: t is the number of blocks needed to accommodate this plus one additional bit - int t = (bitLength()+n32) / n32; + int t = (int) ((bitLength()+n32) / n32); if (t < 2) { t = 2; } @@ -1421,10 +1421,10 @@ class MutableBigInteger { } /** @see BigInteger#bitLength() */ - int bitLength() { + long bitLength() { if (intLen == 0) return 0; - return intLen*32 - Integer.numberOfLeadingZeros(value[offset]); + return intLen*32L - Integer.numberOfLeadingZeros(value[offset]); } /** diff --git a/jdk/src/share/classes/java/net/Authenticator.java b/jdk/src/share/classes/java/net/Authenticator.java index 28df05ca0d3..c88a6006b89 100644 --- a/jdk/src/share/classes/java/net/Authenticator.java +++ b/jdk/src/share/classes/java/net/Authenticator.java @@ -358,7 +358,7 @@ class Authenticator { * will be based on a URL, but in a future JDK it could be, for * example, "SOCKS" for a password-protected SOCKS5 firewall. * - * @return the protcol, optionally followed by "/version", where + * @return the protocol, optionally followed by "/version", where * version is a version number. * * @see java.net.URL#getProtocol() diff --git a/jdk/src/share/classes/java/net/CookieManager.java b/jdk/src/share/classes/java/net/CookieManager.java index bb80f0a7f25..f2d29cda82b 100644 --- a/jdk/src/share/classes/java/net/CookieManager.java +++ b/jdk/src/share/classes/java/net/CookieManager.java @@ -143,7 +143,7 @@ public class CookieManager extends CookieHandler * * @param store a {@code CookieStore} to be used by cookie manager. * if {@code null}, cookie manager will use a default one, - * which is an in-memory CookieStore implmentation. + * which is an in-memory CookieStore implementation. * @param cookiePolicy a {@code CookiePolicy} instance * to be used by cookie manager as policy callback. * if {@code null}, ACCEPT_ORIGINAL_SERVER will diff --git a/jdk/src/share/classes/java/net/CookieStore.java b/jdk/src/share/classes/java/net/CookieStore.java index 648817e4b52..105cc667579 100644 --- a/jdk/src/share/classes/java/net/CookieStore.java +++ b/jdk/src/share/classes/java/net/CookieStore.java @@ -48,7 +48,7 @@ public interface CookieStore { *

      A cookie to store may or may not be associated with an URI. If it * is not associated with an URI, the cookie's domain and path attribute * will indicate where it comes from. If it is associated with an URI and - * its domain and path attribute are not speicifed, given URI will indicate + * its domain and path attribute are not specified, given URI will indicate * where this cookie comes from. * *

      If a cookie corresponding to the given URI already exists, diff --git a/jdk/src/share/classes/java/net/DatagramSocket.java b/jdk/src/share/classes/java/net/DatagramSocket.java index ab60a263ac7..1e095dec731 100644 --- a/jdk/src/share/classes/java/net/DatagramSocket.java +++ b/jdk/src/share/classes/java/net/DatagramSocket.java @@ -196,7 +196,7 @@ class DatagramSocket implements java.io.Closeable { * socket address. *

      * If, if the address is {@code null}, creates an unbound socket. - *

      + * *

      If there is a security manager, * its {@code checkListen} method is first called * with the port from the socket address @@ -640,7 +640,7 @@ class DatagramSocket implements java.io.Closeable { SecurityManager security = System.getSecurityManager(); // The reason you want to synchronize on datagram packet - // is because you dont want an applet to change the address + // is because you don't want an applet to change the address // while you are trying to send the packet for example // after the security check but before the send. if (security != null) { @@ -1109,7 +1109,7 @@ class DatagramSocket implements java.io.Closeable { * represent the value of the TOS octet in IP packets sent by * the socket. * RFC 1349 defines the TOS values as follows: - *

      + * *

        *
      • IPTOS_LOWCOST (0x02)
      • *
      • IPTOS_RELIABILITY (0x04)
      • diff --git a/jdk/src/share/classes/java/net/HttpCookie.java b/jdk/src/share/classes/java/net/HttpCookie.java index fb02ae3e03d..00177122600 100644 --- a/jdk/src/share/classes/java/net/HttpCookie.java +++ b/jdk/src/share/classes/java/net/HttpCookie.java @@ -761,7 +761,7 @@ public final class HttpCookie implements Cloneable { // from RFC 2068, token special case characters // // private static final String tspecials = "()<>@,;:\\\"/[]?={} \t"; - private static final String tspecials = ",;"; + private static final String tspecials = ",; "; // deliberately includes space /* * Tests a string and returns true if the string counts as a token. diff --git a/jdk/src/share/classes/java/net/Inet6Address.java b/jdk/src/share/classes/java/net/Inet6Address.java index 068a4ce235d..001c55ffc59 100644 --- a/jdk/src/share/classes/java/net/Inet6Address.java +++ b/jdk/src/share/classes/java/net/Inet6Address.java @@ -133,7 +133,7 @@ import java.util.Arrays; * representation. However, it will be converted into an IPv4 * address.
      *
      - *

      + * *

      Textual representation of IPv6 scoped addresses

      * *

      The textual representation of IPv6 addresses as described above can be @@ -150,11 +150,11 @@ import java.util.Arrays; * *

      The general format for specifying the scope_id is the following: * - *

      IPv6-address%scope_id
      + *
      IPv6-address%scope_id
      *

      The IPv6-address is a literal IPv6 address as described above. * The scope_id refers to an interface on the local system, and it can be * specified in two ways. - *

      1. As a numeric identifier. This must be a positive integer + *
        1. As a numeric identifier. This must be a positive integer * that identifies the particular interface and scope as understood by the * system. Usually, the numeric values can be determined through administration * tools on the system. Each interface may have multiple values, one for each diff --git a/jdk/src/share/classes/java/net/InetSocketAddress.java b/jdk/src/share/classes/java/net/InetSocketAddress.java index 6792979312b..e8a804fa601 100644 --- a/jdk/src/share/classes/java/net/InetSocketAddress.java +++ b/jdk/src/share/classes/java/net/InetSocketAddress.java @@ -196,7 +196,7 @@ public class InetSocketAddress * If that attempt fails, the address will be flagged as unresolved. *

          * If there is a security manager, its {@code checkConnect} method - * is called with the host name as its argument to check the permissiom + * is called with the host name as its argument to check the permission * to resolve it. This could result in a SecurityException. *

          * A valid port value is between 0 and 65535. diff --git a/jdk/src/share/classes/java/net/InterfaceAddress.java b/jdk/src/share/classes/java/net/InterfaceAddress.java index 704e1fae9d5..39354a0c233 100644 --- a/jdk/src/share/classes/java/net/InterfaceAddress.java +++ b/jdk/src/share/classes/java/net/InterfaceAddress.java @@ -56,7 +56,7 @@ public class InterfaceAddress { } /** - * Returns an {@code InetAddress} for the brodcast address + * Returns an {@code InetAddress} for the broadcast address * for this InterfaceAddress. *

          * Only IPv4 networks have broadcast address therefore, in the case diff --git a/jdk/src/share/classes/java/net/JarURLConnection.java b/jdk/src/share/classes/java/net/JarURLConnection.java index c6fd8cf94f7..70dedec795e 100644 --- a/jdk/src/share/classes/java/net/JarURLConnection.java +++ b/jdk/src/share/classes/java/net/JarURLConnection.java @@ -82,7 +82,7 @@ import sun.net.www.ParseUtil; * * * - *

          {@code !/} is refered to as the separator. + *

          {@code !/} is referred to as the separator. * *

          When constructing a JAR url via {@code new URL(context, spec)}, * the following rules apply: @@ -223,7 +223,7 @@ public abstract class JarURLConnection extends URLConnection { * for this connection. * * @exception IOException if getting the JAR file for this - * connection causes an IOException to be trown. + * connection causes an IOException to be thrown. * * @see #getJarFile */ @@ -240,7 +240,7 @@ public abstract class JarURLConnection extends URLConnection { * the JAR URL for this connection points to a JAR file. * * @exception IOException if getting the JAR file for this - * connection causes an IOException to be trown. + * connection causes an IOException to be thrown. * * @see #getJarFile * @see #getJarEntry diff --git a/jdk/src/share/classes/java/net/MulticastSocket.java b/jdk/src/share/classes/java/net/MulticastSocket.java index 9c5cb05acbb..1d42dfe6e87 100644 --- a/jdk/src/share/classes/java/net/MulticastSocket.java +++ b/jdk/src/share/classes/java/net/MulticastSocket.java @@ -140,7 +140,7 @@ class MulticastSocket extends DatagramSocket { * Create a MulticastSocket bound to the specified socket address. *

          * Or, if the address is {@code null}, create an unbound socket. - *

          + * *

          If there is a security manager, * its {@code checkListen} method is first called * with the SocketAddress port as its argument to ensure the operation is allowed. diff --git a/jdk/src/share/classes/java/net/NetPermission.java b/jdk/src/share/classes/java/net/NetPermission.java index cf7cbd2af67..9178f348723 100644 --- a/jdk/src/share/classes/java/net/NetPermission.java +++ b/jdk/src/share/classes/java/net/NetPermission.java @@ -46,7 +46,6 @@ import java.util.StringTokenizer; * The following table lists all the possible NetPermission target names, * and for each provides a description of what the permission allows * and a discussion of the risks of granting code the permission. - *

          * * * diff --git a/jdk/src/share/classes/java/net/Proxy.java b/jdk/src/share/classes/java/net/Proxy.java index fe481fadfa2..8ba020ef484 100644 --- a/jdk/src/share/classes/java/net/Proxy.java +++ b/jdk/src/share/classes/java/net/Proxy.java @@ -66,8 +66,8 @@ public class Proxy { * Used, for instance, to create sockets bypassing any other global * proxy settings (like SOCKS): *

          - * {@code Socket s = new Socket(Proxy.NO_PROXY);}
          - *

          + * {@code Socket s = new Socket(Proxy.NO_PROXY);} + * */ public final static Proxy NO_PROXY = new Proxy(); diff --git a/jdk/src/share/classes/java/net/ServerSocket.java b/jdk/src/share/classes/java/net/ServerSocket.java index bcc77ae42f3..2ee3420d548 100644 --- a/jdk/src/share/classes/java/net/ServerSocket.java +++ b/jdk/src/share/classes/java/net/ServerSocket.java @@ -610,7 +610,7 @@ class ServerSocket implements java.io.Closeable { /** * Returns the binding state of the ServerSocket. * - * @return true if the ServerSocket succesfuly bound to an address + * @return true if the ServerSocket successfully bound to an address * @since 1.4 */ public boolean isBound() { diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java index 361260351f5..21cf5aae133 100644 --- a/jdk/src/share/classes/java/net/Socket.java +++ b/jdk/src/share/classes/java/net/Socket.java @@ -1230,13 +1230,13 @@ class Socket implements java.io.Closeable { * Generally, the window size can be modified at any time when a socket is * connected. However, if a receive window larger than 64K is required then * this must be requested before the socket is connected to the - * remote peer. There are two cases to be aware of:

          + * remote peer. There are two cases to be aware of: *

            *
          1. For sockets accepted from a ServerSocket, this must be done by calling * {@link ServerSocket#setReceiveBufferSize(int)} before the ServerSocket * is bound to a local address.

          2. *
          3. For client sockets, setReceiveBufferSize() must be called before - * connecting the socket to its remote peer.

          + * connecting the socket to its remote peer. * @param size the size to which to set the receive buffer * size. This value must be greater than 0. * @@ -1329,7 +1329,7 @@ class Socket implements java.io.Closeable { * represent the value of the TOS octet in IP packets sent by * the socket. * RFC 1349 defines the TOS values as follows: - *

          + * *

            *
          • IPTOS_LOWCOST (0x02)
          • *
          • IPTOS_RELIABILITY (0x04)
          • diff --git a/jdk/src/share/classes/java/net/SocketOptions.java b/jdk/src/share/classes/java/net/SocketOptions.java index b9508dbb266..7e1b0fc85b6 100644 --- a/jdk/src/share/classes/java/net/SocketOptions.java +++ b/jdk/src/share/classes/java/net/SocketOptions.java @@ -134,7 +134,7 @@ public interface SocketOptions { * previously written data. *

            * Valid for TCP only: SocketImpl. - *

            + * * @see Socket#setTcpNoDelay * @see Socket#getTcpNoDelay */ @@ -155,7 +155,7 @@ public interface SocketOptions { * This option must be specified in the constructor. *

            * Valid for: SocketImpl, DatagramSocketImpl - *

            + * * @see Socket#getLocalAddress * @see DatagramSocket#getLocalAddress */ @@ -186,7 +186,7 @@ public interface SocketOptions { * want to use other than the system default. Takes/returns an InetAddress. *

            * Valid for Multicast: DatagramSocketImpl - *

            + * * @see MulticastSocket#setInterface(InetAddress) * @see MulticastSocket#getInterface() */ diff --git a/jdk/src/share/classes/java/net/SocketPermission.java b/jdk/src/share/classes/java/net/SocketPermission.java index e90856eac8e..1b11437b1aa 100644 --- a/jdk/src/share/classes/java/net/SocketPermission.java +++ b/jdk/src/share/classes/java/net/SocketPermission.java @@ -779,27 +779,27 @@ public final class SocketPermission extends Permission * specified permission. *

            * More specifically, this method first ensures that all of the following - * are true (and returns false if any of them are not):

            + * are true (and returns false if any of them are not): *

              - *
            • p is an instanceof SocketPermission,

              + *

            • p is an instanceof SocketPermission, *
            • p's actions are a proper subset of this - * object's actions, and

              + * object's actions, and *

            • p's port range is included in this port range. Note: - * port range is ignored when p only contains the action, 'resolve'.

              + * port range is ignored when p only contains the action, 'resolve'. *

            * * Then {@code implies} checks each of the following, in order, - * and for each returns true if the stated condition is true:

            + * and for each returns true if the stated condition is true: *

              *
            • If this object was initialized with a single IP address and one of p's - * IP addresses is equal to this object's IP address.

              + * IP addresses is equal to this object's IP address. *

            • If this object is a wildcard domain (such as *.sun.com), and * p's canonical name (the name without any preceding *) * ends with this object's canonical host name. For example, *.sun.com - * implies *.eng.sun.com..

              + * implies *.eng.sun.com. *

            • If this object was not initialized with a single IP address, and one of this - * object's IP addresses equals one of p's IP addresses.

              - *

            • If this canonical name equals p's canonical name.

              + * object's IP addresses equals one of p's IP addresses. + *

            • If this canonical name equals p's canonical name. *
            * * If none of the above are true, {@code implies} returns false. diff --git a/jdk/src/share/classes/java/net/SocksSocketImpl.java b/jdk/src/share/classes/java/net/SocksSocketImpl.java index 3e4fb5fe74a..2138f9dfcf1 100644 --- a/jdk/src/share/classes/java/net/SocksSocketImpl.java +++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java @@ -437,7 +437,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { } } - // cmdIn & cmdOut were intialized during the privilegedConnect() call + // cmdIn & cmdOut were initialized during the privilegedConnect() call BufferedOutputStream out = new BufferedOutputStream(cmdOut, 512); InputStream in = cmdIn; diff --git a/jdk/src/share/classes/java/net/StandardSocketOptions.java b/jdk/src/share/classes/java/net/StandardSocketOptions.java index 84fedd804f1..25fb61aec71 100644 --- a/jdk/src/share/classes/java/net/StandardSocketOptions.java +++ b/jdk/src/share/classes/java/net/StandardSocketOptions.java @@ -257,7 +257,7 @@ public final class StandardSocketOptions { * represents the outgoing interface for multicast datagrams sent by the * datagram-oriented socket. For {@link StandardProtocolFamily#INET6 IPv6} * sockets then it is system dependent whether setting this option also - * sets the outgoing interface for multlicast datagrams sent to IPv4 + * sets the outgoing interface for multicast datagrams sent to IPv4 * addresses. * *

            The initial/default value of this socket option may be {@code null} diff --git a/jdk/src/share/classes/java/net/URI.java b/jdk/src/share/classes/java/net/URI.java index 71c4f6dc5de..813de5cf453 100644 --- a/jdk/src/share/classes/java/net/URI.java +++ b/jdk/src/share/classes/java/net/URI.java @@ -389,20 +389,20 @@ import java.lang.NullPointerException; // for javadoc * colon following a host name but no port (as in * {@code http://java.sun.com:} ), and that does not encode characters * except those that must be quoted, the following identities also hold: - *

            + * 
              *     new URI(u.getScheme(),
              *             u.getSchemeSpecificPart(),
              *             u.getFragment())
              *     .equals(u)
            * in all cases, - *

            + * 
              *     new URI(u.getScheme(),
              *             u.getUserInfo(), u.getAuthority(),
              *             u.getPath(), u.getQuery(),
              *             u.getFragment())
              *     .equals(u)
            * if u is hierarchical, and - *

            + * 
              *     new URI(u.getScheme(),
              *             u.getUserInfo(), u.getHost(), u.getPort(),
              *             u.getPath(), u.getQuery(),
            diff --git a/jdk/src/share/classes/java/net/URL.java b/jdk/src/share/classes/java/net/URL.java
            index e7946d22e89..1ff5d63a35a 100644
            --- a/jdk/src/share/classes/java/net/URL.java
            +++ b/jdk/src/share/classes/java/net/URL.java
            @@ -465,7 +465,7 @@ public final class URL implements java.io.Serializable {
                  * Otherwise, the path is treated as a relative path and is appended to the
                  * context path, as described in RFC2396. Also, in this case,
                  * the path is canonicalized through the removal of directory
            -     * changes made by occurences of ".." and ".".
            +     * changes made by occurrences of ".." and ".".
                  * 

            * For a more detailed description of URL parsing, refer to RFC2396. * diff --git a/jdk/src/share/classes/java/net/URLClassLoader.java b/jdk/src/share/classes/java/net/URLClassLoader.java index 748748520ea..f272346ce2f 100644 --- a/jdk/src/share/classes/java/net/URLClassLoader.java +++ b/jdk/src/share/classes/java/net/URLClassLoader.java @@ -25,21 +25,30 @@ package java.net; -import java.io.*; -import java.util.*; -import java.util.jar.Manifest; -import java.util.jar.JarFile; -import java.util.jar.Attributes; -import java.util.jar.Attributes.Name; -import java.security.CodeSigner; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; -import java.security.AccessController; +import java.io.Closeable; +import java.io.File; +import java.io.FilePermission; +import java.io.IOException; +import java.io.InputStream; import java.security.AccessControlContext; -import java.security.SecureClassLoader; +import java.security.AccessController; +import java.security.CodeSigner; import java.security.CodeSource; import java.security.Permission; import java.security.PermissionCollection; +import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; +import java.security.SecureClassLoader; +import java.util.Enumeration; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.jar.Attributes; +import java.util.jar.Attributes.Name; +import java.util.jar.JarFile; +import java.util.jar.Manifest; import sun.misc.Resource; import sun.misc.URLClassPath; import sun.net.www.ParseUtil; @@ -84,6 +93,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. + * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent) { @@ -127,6 +137,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. + * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls) { @@ -169,6 +180,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * @exception SecurityException if a security manager exists and its * {@code checkCreateClassLoader} method doesn't allow * creation of a class loader. + * @exception NullPointerException if {@code urls} is {@code null}. * @see SecurityManager#checkCreateClassLoader */ public URLClassLoader(URL[] urls, ClassLoader parent, @@ -260,13 +272,13 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * and errors are not caught. Calling close on an already closed * loader has no effect. *

            - * @throws IOException if closing any file opened by this class loader + * @exception IOException if closing any file opened by this class loader * resulted in an IOException. Any such exceptions are caught internally. * If only one is caught, then it is re-thrown. If more than one exception * is caught, then the second and following exceptions are added * as suppressed exceptions of the first one caught, which is then re-thrown. * - * @throws SecurityException if a security manager is set, and it denies + * @exception SecurityException if a security manager is set, and it denies * {@link RuntimePermission}{@code ("closeClassLoader")} * * @since 1.7 @@ -339,6 +351,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * @return the resulting class * @exception ClassNotFoundException if the class could not be found, * or if the loader is closed. + * @exception NullPointerException if {@code name} is {@code null}. */ protected Class findClass(final String name) throws ClassNotFoundException @@ -621,6 +634,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * If the protocol is not "file", then permission * to connect to and accept connections from the URL's host is granted. * @param codesource the codesource + * @exception NullPointerException if {@code codesource} is {@code null}. * @return the permissions granted to the codesource */ protected PermissionCollection getPermissions(CodeSource codesource) @@ -700,6 +714,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * * @param urls the URLs to search for classes and resources * @param parent the parent class loader for delegation + * @exception NullPointerException if {@code urls} is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls, @@ -725,6 +740,7 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { * loading the class. * * @param urls the URLs to search for classes and resources + * @exception NullPointerException if {@code urls} is {@code null}. * @return the resulting class loader */ public static URLClassLoader newInstance(final URL[] urls) { diff --git a/jdk/src/share/classes/java/net/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java index b731ac70d90..dd66ed26c54 100644 --- a/jdk/src/share/classes/java/net/URLConnection.java +++ b/jdk/src/share/classes/java/net/URLConnection.java @@ -45,7 +45,7 @@ import sun.net.www.MessageHeader; * application and a URL. Instances of this class can be used both to * read from and to write to the resource referenced by the URL. In * general, creating a connection to a URL is a multistep process: - *

            + * *

          * * @@ -371,7 +371,7 @@ public abstract class URLConnection { * java.net.SocketTimeoutException is raised. A timeout of zero is * interpreted as an infinite timeout. - *

          Some non-standard implmentation of this method may ignore + *

          Some non-standard implementation of this method may ignore * the specified timeout. To see the connect timeout set, please * call getConnectTimeout(). * @@ -1059,7 +1059,7 @@ public abstract class URLConnection { * *

          NOTE: HTTP requires all request properties which can * legally have multiple instances with the same key - * to use a comma-seperated list syntax which enables multiple + * to use a comma-separated list syntax which enables multiple * properties to be appended into a single property. * * @param key the keyword by which the request is known diff --git a/jdk/src/share/classes/java/net/URLDecoder.java b/jdk/src/share/classes/java/net/URLDecoder.java index eb5e36e5d82..1e1138ad7ec 100644 --- a/jdk/src/share/classes/java/net/URLDecoder.java +++ b/jdk/src/share/classes/java/net/URLDecoder.java @@ -43,7 +43,7 @@ import java.io.*; * as the start of a special escaped sequence. *

          * The following rules are applied in the conversion: - *

          + * *

            *
          • The alphanumeric characters "{@code a}" through * "{@code z}", "{@code A}" through @@ -116,7 +116,7 @@ public class URLDecoder { * "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars"> * World Wide Web Consortium Recommendation states that * UTF-8 should be used. Not doing so may introduce - * incompatibilites. + * incompatibilities. * * @param s the {@code String} to decode * @param enc The name of a supported diff --git a/jdk/src/share/classes/java/net/URLEncoder.java b/jdk/src/share/classes/java/net/URLEncoder.java index b5c4a8c32f9..86377b7a752 100644 --- a/jdk/src/share/classes/java/net/URLEncoder.java +++ b/jdk/src/share/classes/java/net/URLEncoder.java @@ -49,7 +49,6 @@ import sun.security.action.GetPropertyAction; *

            * When encoding a String, the following rules apply: * - *

            *

              *
            • The alphanumeric characters "{@code a}" through * "{@code z}", "{@code A}" through @@ -186,7 +185,7 @@ public class URLEncoder { * "http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars"> * World Wide Web Consortium Recommendation states that * UTF-8 should be used. Not doing so may introduce - * incompatibilites. + * incompatibilities. * * @param s {@code String} to be translated. * @param enc The name of a supported diff --git a/jdk/src/share/classes/java/net/URLPermission.java b/jdk/src/share/classes/java/net/URLPermission.java index f6572cd3575..7ad56a1c20f 100644 --- a/jdk/src/share/classes/java/net/URLPermission.java +++ b/jdk/src/share/classes/java/net/URLPermission.java @@ -45,7 +45,7 @@ import java.security.Permission; * * scheme will typically be http or https, but is not restricted by this * class. - * authority is specified as:

              + * authority is specified as: *

                *     authority = hostrange [ : portrange ]
                *     portrange = portnumber | -portnumber | portnumber-[portnumber] | *
              @@ -223,7 +223,7 @@ public final class URLPermission extends Permission {
                    * Checks if this URLPermission implies the given permission.
                    * Specifically, the following checks are done as if in the
                    * following sequence:
              -     * 

                + *
                  *
                • if 'p' is not an instance of URLPermission return false
                • *
                • if any of p's methods are not in this's method list, and if * this's method list is not equal to "*", then return false.
                • @@ -242,7 +242,7 @@ public final class URLPermission extends Permission { *
                • otherwise, return false
                • *
                *

                Some examples of how paths are matched are shown below: - *

          {@code openConnection()}{@code connect()}
          + *
          * * * @@ -353,7 +353,7 @@ public final class URLPermission extends Permission { return getActions().hashCode() + scheme.hashCode() + authority.hashCode() - + path == null ? 0 : path.hashCode(); + + (path == null ? 0 : path.hashCode()); } diff --git a/jdk/src/share/classes/java/net/package-info.java b/jdk/src/share/classes/java/net/package-info.java index 6552b30b634..fda2e4f28b8 100644 --- a/jdk/src/share/classes/java/net/package-info.java +++ b/jdk/src/share/classes/java/net/package-info.java @@ -127,9 +127,9 @@ * resources, then convert it into a {@link java.net.URL} when it is time to * access the resource. From that URL, you can either get the * {@link java.net.URLConnection} for fine control, or get directly the - * InputStream.

          + * InputStream. *

          Here is an example:

          - *

          + * 
            * URI uri = new URI("http://java.sun.com/");
            * URL url = uri.toURL();
            * InputStream in = url.openStream();
          @@ -147,7 +147,7 @@
            *    the {@code java.protocol.handler.pkgs} system property. For instance if
            *    it is set to {@code myapp.protocols}, then the URL code will try, in the
            *    case of http, first to load {@code myapp.protocols.http.Handler}, then,
          - *    if this fails, {@code http.Handler} from the default location.

          + * if this fails, {@code http.Handler} from the default location. *

          Note that the Handler class has to be a subclass of the abstract * class {@link java.net.URLStreamHandler}.

          *

          Additional Specification

          diff --git a/jdk/src/share/classes/java/nio/X-Buffer.java.template b/jdk/src/share/classes/java/nio/X-Buffer.java.template index 60f0733c9ab..acc8fc89912 100644 --- a/jdk/src/share/classes/java/nio/X-Buffer.java.template +++ b/jdk/src/share/classes/java/nio/X-Buffer.java.template @@ -1129,7 +1129,7 @@ public abstract class $Type$Buffer * *

          Two $type$ buffers are equal if, and only if, * - *

            + *
              * *
            1. They have the same element type,

            2. * diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java index ace607323cb..aa56bbf38a2 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousChannelGroup.java @@ -199,7 +199,7 @@ public abstract class AsynchronousChannelGroup { * *

              The {@code initialSize} parameter may be used by the implementation * as a hint as to the initial number of tasks it may submit. For - * example, it may be used to indictae the initial number of threads that + * example, it may be used to indicate the initial number of threads that * wait on I/O events. * *

              The executor is intended to be used exclusively by the resulting diff --git a/jdk/src/share/classes/java/nio/channels/DatagramChannel.java b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java index 3626317a982..b979cd398ff 100644 --- a/jdk/src/share/classes/java/nio/channels/DatagramChannel.java +++ b/jdk/src/share/classes/java/nio/channels/DatagramChannel.java @@ -153,7 +153,7 @@ public abstract class DatagramChannel * Opens a datagram channel. * *

              The {@code family} parameter is used to specify the {@link - * ProtocolFamily}. If the datagram channel is to be used for IP multicasing + * ProtocolFamily}. If the datagram channel is to be used for IP multicasting * then this should correspond to the address type of the multicast groups * that this channel will join. * diff --git a/jdk/src/share/classes/java/nio/channels/MembershipKey.java b/jdk/src/share/classes/java/nio/channels/MembershipKey.java index ea7536ac344..cd955862ebe 100644 --- a/jdk/src/share/classes/java/nio/channels/MembershipKey.java +++ b/jdk/src/share/classes/java/nio/channels/MembershipKey.java @@ -103,7 +103,7 @@ public abstract class MembershipKey { * multicast datagrams from the given source address. If the given source * address is already blocked then this method has no effect. * After a source address is blocked it may still be possible to receive - * datagams from that source. This can arise when datagrams are waiting to + * datagrams from that source. This can arise when datagrams are waiting to * be received in the socket's receive buffer. * * @param source diff --git a/jdk/src/share/classes/java/nio/channels/package-info.java b/jdk/src/share/classes/java/nio/channels/package-info.java index cb55f8f8da7..81183472108 100644 --- a/jdk/src/share/classes/java/nio/channels/package-info.java +++ b/jdk/src/share/classes/java/nio/channels/package-info.java @@ -269,7 +269,7 @@ * own asynchronous channel groups or configure the {@code ExecutorService} * that will be used for the default group. * - *

              As with selectors, the implementatin of asynchronous channels can be + *

              As with selectors, the implementation of asynchronous channels can be * replaced by "plugging in" an alternative definition or instance of the {@link * java.nio.channels.spi.AsynchronousChannelProvider} class defined in the * {@link java.nio.channels.spi} package. It is not expected that many diff --git a/jdk/src/share/classes/java/nio/charset/Charset.java b/jdk/src/share/classes/java/nio/charset/Charset.java index e1a828dcb15..3d946f1d4bc 100644 --- a/jdk/src/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/share/classes/java/nio/charset/Charset.java @@ -201,7 +201,7 @@ import sun.security.action.GetPropertyAction; * * * - * In any case, byte order marks occuring after the first element of an + * In any case, byte order marks occurring after the first element of an * input sequence are not omitted since the same code is used to represent * ZERO-WIDTH NON-BREAKING SPACE. * diff --git a/jdk/src/share/classes/java/nio/file/FileSystem.java b/jdk/src/share/classes/java/nio/file/FileSystem.java index 2296cada829..2a961fb8ecf 100644 --- a/jdk/src/share/classes/java/nio/file/FileSystem.java +++ b/jdk/src/share/classes/java/nio/file/FileSystem.java @@ -355,7 +355,7 @@ public abstract class FileSystem * *

              The following rules are used to interpret glob patterns: * - *

                + *
                  *
                • The {@code *} character matches zero or more {@link Character * characters} of a {@link Path#getName(int) name} component without * crossing directory boundaries.

                • diff --git a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java index 2a1dd6e18f8..9840e849302 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java @@ -81,7 +81,7 @@ public interface UserDefinedFileAttributeView /** * Returns a list containing the names of the user-defined attributes. * - * @return An unmodifiable list continaing the names of the file's + * @return An unmodifiable list containing the names of the file's * user-defined * * @throws IOException @@ -179,7 +179,7 @@ public interface UserDefinedFileAttributeView *

                  If an attribute of the given name already exists then its value is * replaced. If the attribute does not exist then it is created. If it * implementation specific if a test to check for the existence of the - * attribute and the creation of attribute are atomic with repect to other + * attribute and the creation of attribute are atomic with respect to other * file system activities. * *

                  Where there is insufficient space to store the attribute, or the diff --git a/jdk/src/share/classes/java/rmi/MarshalledObject.java b/jdk/src/share/classes/java/rmi/MarshalledObject.java index 84675c11d1c..384230f88a3 100644 --- a/jdk/src/share/classes/java/rmi/MarshalledObject.java +++ b/jdk/src/share/classes/java/rmi/MarshalledObject.java @@ -135,7 +135,7 @@ public final class MarshalledObject implements Serializable { /** * Returns a new copy of the contained marshalledobject. The internal * representation is deserialized with the semantics used for - * unmarshaling paramters for RMI calls. + * unmarshaling parameters for RMI calls. * * @return a copy of the contained object * @exception IOException if an IOException occurs while @@ -182,7 +182,7 @@ public final class MarshalledObject implements Serializable { * in the serialized representation. * * @param obj the object to compare with this MarshalledObject - * @return true if the argument contains an equaivalent + * @return true if the argument contains an equivalent * serialized object; false otherwise * @since 1.2 */ diff --git a/jdk/src/share/classes/java/rmi/RMISecurityManager.java b/jdk/src/share/classes/java/rmi/RMISecurityManager.java index 3759e7f48ea..b260c49a1ce 100644 --- a/jdk/src/share/classes/java/rmi/RMISecurityManager.java +++ b/jdk/src/share/classes/java/rmi/RMISecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,35 +28,38 @@ package java.rmi; import java.security.*; /** - * A subclass of {@link SecurityManager} used by RMI applications that use - * downloaded code. RMI's class loader will not download any classes from - * remote locations if no security manager has been set. - * RMISecurityManager does not apply to applets, which run - * under the protection of their browser's security manager. + * {@code RMISecurityManager} implements a policy identical to the policy + * implemented by {@link SecurityManager}. RMI applications + * should use the {@code SecurityManager} class or another appropriate + * {@code SecurityManager} implementation instead of this class. RMI's class + * loader will download classes from remote locations only if a security + * manager has been set. * - * RMISecurityManager implements a policy that - * is no different than the policy implemented by {@link SecurityManager}. - * Therefore an RMI application should use the SecurityManager - * class or another application-specific SecurityManager - * implementation instead of this class. + * @implNote + *

                  Applets typically run in a container that already has a security + * manager, so there is generally no need for applets to set a security + * manager. If you have a standalone application, you might need to set a + * {@code SecurityManager} in order to enable class downloading. This can be + * done by adding the following to your code. (It needs to be executed before + * RMI can download code from remote hosts, so it most likely needs to appear + * in the {@code main} method of your application.) * - *

                  To use a SecurityManager in your application, add - * the following statement to your code (it needs to be executed before RMI - * can download code from remote hosts, so it most likely needs to appear - * in the main method of your application): - * - *

                  - * System.setSecurityManager(new SecurityManager());
                  - * 
                  + *
                  {@code
                  + *    if (System.getSecurityManager() == null) {
                  + *        System.setSecurityManager(new SecurityManager());
                  + *    }
                  + * }
                  * * @author Roger Riggs * @author Peter Jones * @since JDK1.1 - **/ + * @deprecated Use {@link SecurityManager} instead. + */ +@Deprecated public class RMISecurityManager extends SecurityManager { /** - * Constructs a new RMISecurityManager. + * Constructs a new {@code RMISecurityManager}. * @since JDK1.1 */ public RMISecurityManager() { diff --git a/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java b/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java index 49dffd18e0e..bfa64ba3c6f 100644 --- a/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java +++ b/jdk/src/share/classes/java/rmi/activation/ActivationGroup.java @@ -74,7 +74,7 @@ import sun.security.action.GetIntegerAction; * ActivationGroup will override the system properties * with the properties requested when its * ActivationGroupDesc was created, and will set a - * java.rmi.RMISecurityManager as the default system + * {@link SecurityManager} as the default system * security manager. If your application requires specific properties * to be set when objects are activated in the group, the application * should create a special Properties object containing @@ -84,7 +84,7 @@ import sun.security.action.GetIntegerAction; * ActivationDescs (before the default * ActivationGroupDesc is created). If your application * requires the use of a security manager other than - * java.rmi.RMISecurityManager, in the + * {@link SecurityManager}, in the * ActivativationGroupDescriptor properties list you can set * java.security.manager property to the name of the security * manager you would like to install. @@ -154,21 +154,21 @@ public abstract class ActivationGroup * active). If the object does not call * Activatable.inactive when it deactivates, the * object will never be garbage collected since the group keeps - * strong references to the objects it creates.

                  + * strong references to the objects it creates. * *

                  The group's inactiveObject method unexports the * remote object from the RMI runtime so that the object can no * longer receive incoming RMI calls. An object will only be unexported * if the object has no pending or executing calls. * The subclass of ActivationGroup must override this - * method and unexport the object.

                  + * method and unexport the object. * *

                  After removing the object from the RMI runtime, the group * must inform its ActivationMonitor (via the monitor's * inactiveObject method) that the remote object is * not currently active so that the remote object will be * re-activated by the activator upon a subsequent activation - * request.

                  + * request. * *

                  This method simply informs the group's monitor that the object * is inactive. It is up to the concrete subclass of ActivationGroup @@ -235,7 +235,7 @@ public abstract class ActivationGroup *

                  Note that if your application creates its own custom * activation group, a security manager must be set for that * group. Otherwise objects cannot be activated in the group. - * java.rmi.RMISecurityManager is set by default. + * {@link SecurityManager} is set by default. * *

                  If a security manager is already set in the group VM, this * method first calls the security manager's diff --git a/jdk/src/share/classes/java/rmi/dgc/VMID.java b/jdk/src/share/classes/java/rmi/dgc/VMID.java index 45e58599d66..913c598be2e 100644 --- a/jdk/src/share/classes/java/rmi/dgc/VMID.java +++ b/jdk/src/share/classes/java/rmi/dgc/VMID.java @@ -67,7 +67,7 @@ public final class VMID implements java.io.Serializable { * conditions: a) the conditions for uniqueness for objects of * the class java.rmi.server.UID are satisfied, and b) an * address can be obtained for this host that is unique and constant - * for the lifetime of this object.

                  + * for the lifetime of this object. */ public VMID() { addr = randomBytes; diff --git a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java index ec9ade2f54c..c9b8a4786a4 100644 --- a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java +++ b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java @@ -41,7 +41,15 @@ import java.net.*; * (due to a firewall), the runtime uses HTTP with the explicit port * number of the server. If the firewall does not allow this type of * communication, then HTTP to a cgi-bin script on the server is used - * to POST the RMI call. + * to POST the RMI call. The HTTP tunneling mechanisms are disabled by + * default. This behavior is controlled by the {@code java.rmi.server.disableHttp} + * property, whose default value is {@code true}. Setting this property's + * value to {@code false} will enable the HTTP tunneling mechanisms. + * + *

                  Deprecated: HTTP Tunneling. The HTTP tunneling mechanisms + * described above, specifically HTTP with an explicit port and HTTP to a + * cgi-bin script, are deprecated. These HTTP tunneling mechanisms are + * subject to removal in a future release of the platform. * *

                  The default socket factory implementation creates server sockets that * are bound to the wildcard address, which accepts requests from all network diff --git a/jdk/src/share/classes/java/rmi/server/RemoteStub.java b/jdk/src/share/classes/java/rmi/server/RemoteStub.java index 988132cacc8..36f8eb068e0 100644 --- a/jdk/src/share/classes/java/rmi/server/RemoteStub.java +++ b/jdk/src/share/classes/java/rmi/server/RemoteStub.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,8 @@ package java.rmi.server; /** - * The RemoteStub class is the common superclass to client + * The {@code RemoteStub} class is the common superclass of + * statically generated client * stubs and provides the framework to support a wide range of remote * reference semantics. Stub objects are surrogates that support * exactly the same set of remote interfaces defined by the actual @@ -33,21 +34,26 @@ package java.rmi.server; * * @author Ann Wollrath * @since JDK1.1 + * + * @deprecated Statically generated stubs are deprecated, since + * stubs are generated dynamically. See {@link UnicastRemoteObject} + * for information about dynamic stub generation. */ +@Deprecated abstract public class RemoteStub extends RemoteObject { /** indicate compatibility with JDK 1.1.x version of class */ private static final long serialVersionUID = -1585587260594494182L; /** - * Constructs a RemoteStub. + * Constructs a {@code RemoteStub}. */ protected RemoteStub() { super(); } /** - * Constructs a RemoteStub, with the specified remote + * Constructs a {@code RemoteStub} with the specified remote * reference. * * @param ref the remote reference @@ -58,14 +64,17 @@ abstract public class RemoteStub extends RemoteObject { } /** - * Sets the remote reference inside the remote stub. + * Throws {@link UnsupportedOperationException}. * * @param stub the remote stub * @param ref the remote reference + * @throws UnsupportedOperationException always * @since JDK1.1 - * @deprecated no replacement. The setRef method - * is not needed since RemoteStubs can be created with - * the RemoteStub(RemoteRef) constructor. + * @deprecated No replacement. The {@code setRef} method + * was intended for setting the remote reference of a remote + * stub. This is unnecessary, since {@code RemoteStub}s can be created + * and initialized with a remote reference through use of + * the {@link #RemoteStub(RemoteRef)} constructor. */ @Deprecated protected static void setRef(RemoteStub stub, RemoteRef ref) { diff --git a/jdk/src/share/classes/java/rmi/server/ServerRef.java b/jdk/src/share/classes/java/rmi/server/ServerRef.java index cf73b7c9ab2..f0b521eaad7 100644 --- a/jdk/src/share/classes/java/rmi/server/ServerRef.java +++ b/jdk/src/share/classes/java/rmi/server/ServerRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,9 @@ import java.rmi.*; * * @author Ann Wollrath * @since JDK1.1 + * @deprecated No replacement. This interface is unused and is obsolete. */ +@Deprecated public interface ServerRef extends RemoteRef { /** indicate compatibility with JDK 1.1.x version of class. */ diff --git a/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java b/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java index 61fc9154d90..3fbec26e341 100644 --- a/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java +++ b/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,9 @@ package java.rmi.server; * * @author Ann Wollrath * @since JDK1.1 - **/ + * @deprecated This class is obsolete. Use {@link ExportException} instead. + */ +@Deprecated public class SocketSecurityException extends ExportException { /* indicate compatibility with JDK 1.1.x version of class */ diff --git a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java index be86c275246..802d7144ec2 100644 --- a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java +++ b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java @@ -30,52 +30,88 @@ import sun.rmi.server.UnicastServerRef2; /** * Used for exporting a remote object with JRMP and obtaining a stub - * that communicates to the remote object. + * that communicates to the remote object. Stubs are either generated + * at runtime using dynamic proxy objects, or they are generated statically + * at build time, typically using the {@code rmic} tool. * - *

                  For the constructors and static exportObject methods - * below, the stub for a remote object being exported is obtained as - * follows: + *

                  Deprecated: Static Stubs. Support for statically + * generated stubs is deprecated. This includes the API in this class that + * requires the use of static stubs, as well as the runtime support for + * loading static stubs. Generating stubs dynamically is preferred, using one + * of the five non-deprecated ways of exporting objects as listed below. Do + * not run {@code rmic} to generate static stub classes. It is unnecessary, and + * it is also deprecated. * - *

                    + *

                    There are six ways to export remote objects: + * + *

                      + * + *
                    1. Subclassing {@code UnicastRemoteObject} and calling the + * {@link #UnicastRemoteObject()} constructor. + * + *
                    2. Subclassing {@code UnicastRemoteObject} and calling the + * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)} constructor. + * + *
                    3. Subclassing {@code UnicastRemoteObject} and calling the + * {@link #UnicastRemoteObject(int, RMIClientSocketFactory, RMIServerSocketFactory) + * UnicastRemoteObject(port, csf, ssf)} constructor. + * + *
                    4. Calling the + * {@link #exportObject(Remote) exportObject(Remote)} method. + * Deprecated. + * + *
                    5. Calling the + * {@link #exportObject(Remote, int) exportObject(Remote, port)} method. + * + *
                    6. Calling the + * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory) + * exportObject(Remote, port, csf, ssf)} method. + * + *
                    + * + *

                    The fourth technique, {@link #exportObject(Remote)}, + * always uses statically generated stubs and is deprecated. + * + *

                    The other five techniques all use the following approach: if the + * {@code java.rmi.server.ignoreStubClasses} property is {@code true} + * (case insensitive) or if a static stub cannot be found, stubs are generated + * dynamically using {@link java.lang.reflect.Proxy Proxy} objects. Otherwise, + * static stubs are used. + * + *

                    The default value of the + * {@code java.rmi.server.ignoreStubClasses} property is {@code false}. + * + *

                    Statically generated stubs are typically pregenerated from the + * remote object's class using the {@code rmic} tool. A static stub is + * loaded and an instance of that stub class is constructed as described + * below. * - *

                  • If the remote object is exported using the {@link - * #exportObject(Remote) UnicastRemoteObject.exportObject(Remote)} method, - * a stub class (typically pregenerated from the remote object's class - * using the rmic tool) is loaded and an instance of that stub - * class is constructed as follows. *
                      * - *
                    • A "root class" is determined as follows: if the remote object's + *
                    • A "root class" is determined as follows: if the remote object's * class directly implements an interface that extends {@link Remote}, then * the remote object's class is the root class; otherwise, the root class is * the most derived superclass of the remote object's class that directly - * implements an interface that extends Remote. + * implements an interface that extends {@code Remote}. * *
                    • The name of the stub class to load is determined by concatenating - * the binary name of the root class with the suffix "_Stub". + * the binary name of the root class with the suffix {@code _Stub}. * *
                    • The stub class is loaded by name using the class loader of the root - * class. The stub class must extend {@link RemoteStub} and must have a - * public constructor that has one parameter, of type {@link RemoteRef}. + * class. The stub class must extend {@link RemoteStub} and must have a + * public constructor that has one parameter of type {@link RemoteRef}. * *
                    • Finally, an instance of the stub class is constructed with a * {@link RemoteRef}. - *
                    * - *
                  • If the appropriate stub class could not be found, or the stub class - * could not be loaded, or a problem occurs creating the stub instance, a + *
                  • If the appropriate stub class could not be found, or if the stub class + * could not be loaded, or if a problem occurs creating the stub instance, a * {@link StubNotFoundException} is thrown. * - *

                    - *

                  • For all other means of exporting: - *

                      + *
                    * - *
                  • If the remote object's stub class (as defined above) could not be - * loaded or the system property - * java.rmi.server.ignoreStubClasses is set to - * "true" (case insensitive), a {@link - * java.lang.reflect.Proxy} instance is constructed with the following - * properties: + *

                    Stubs are dynamically generated by constructing an instance of + * a {@link java.lang.reflect.Proxy Proxy} with the following characteristics: * *

                      * @@ -91,29 +127,13 @@ import sun.rmi.server.UnicastServerRef2; * *
                    • If the proxy could not be created, a {@link StubNotFoundException} * will be thrown. - *
                    - * - *

                    - *

                  • Otherwise, an instance of the remote object's stub class (as - * described above) is used as the stub. * *
                  - *
                - * - *

                If an object is exported with the - * {@link #exportObject(Remote) exportObject(Remote)} - * or - * {@link #exportObject(Remote, int) exportObject(Remote, port)} - * methods, or if a subclass constructor invokes one of the - * {@link #UnicastRemoteObject()} - * or - * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)} - * constructors, the object is exported with a server socket created using the - * {@link RMISocketFactory} - * class. * * @implNote - *

                By default, server sockets created by the {@link RMISocketFactory} class + * Depending upon which constructor or static method is used for exporting an + * object, {@link RMISocketFactory} may be used for creating sockets. + * By default, server sockets created by {@link RMISocketFactory} * listen on all network interfaces. See the * {@link RMISocketFactory} class and the section * RMI Socket Factories @@ -148,6 +168,10 @@ public class UnicastRemoteObject extends RemoteServer { /** * Creates and exports a new UnicastRemoteObject object using an * anonymous port. + * + *

                The object is exported with a server socket + * created using the {@link RMISocketFactory} class. + * * @throws RemoteException if failed to export object * @since JDK1.1 */ @@ -159,6 +183,10 @@ public class UnicastRemoteObject extends RemoteServer { /** * Creates and exports a new UnicastRemoteObject object using the * particular supplied port. + * + *

                The object is exported with a server socket + * created using the {@link RMISocketFactory} class. + * * @param port the port number on which the remote object receives calls * (if port is zero, an anonymous port is chosen) * @throws RemoteException if failed to export object @@ -173,6 +201,11 @@ public class UnicastRemoteObject extends RemoteServer { /** * Creates and exports a new UnicastRemoteObject object using the * particular supplied port and socket factories. + * + *

                Either socket factory may be {@code null}, in which case + * the corresponding client or server socket creation method of + * {@link RMISocketFactory} is used instead. + * * @param port the port number on which the remote object receives calls * (if port is zero, an anonymous port is chosen) * @param csf the client-side socket factory for making calls to the @@ -238,12 +271,23 @@ public class UnicastRemoteObject extends RemoteServer { /** * Exports the remote object to make it available to receive incoming - * calls using an anonymous port. + * calls using an anonymous port. This method will always return a + * statically generated stub. + * + *

                The object is exported with a server socket + * created using the {@link RMISocketFactory} class. + * * @param obj the remote object to be exported * @return remote object stub * @exception RemoteException if export fails * @since JDK1.1 + * @deprecated This method is deprecated because it supports only static stubs. + * Use {@link #exportObject(Remote, int) exportObject(Remote, port)} or + * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory) + * exportObject(Remote, port, csf, ssf)} + * instead. */ + @Deprecated public static RemoteStub exportObject(Remote obj) throws RemoteException { @@ -260,6 +304,10 @@ public class UnicastRemoteObject extends RemoteServer { /** * Exports the remote object to make it available to receive incoming * calls, using the particular supplied port. + * + *

                The object is exported with a server socket + * created using the {@link RMISocketFactory} class. + * * @param obj the remote object to be exported * @param port the port to export the object on * @return remote object stub @@ -275,6 +323,11 @@ public class UnicastRemoteObject extends RemoteServer { /** * Exports the remote object to make it available to receive incoming * calls, using a transport specified by the given socket factory. + * + *

                Either socket factory may be {@code null}, in which case + * the corresponding client or server socket creation method of + * {@link RMISocketFactory} is used instead. + * * @param obj the remote object to be exported * @param port the port to export the object on * @param csf the client-side socket factory for making calls to the diff --git a/jdk/src/share/classes/java/rmi/server/package.html b/jdk/src/share/classes/java/rmi/server/package.html index 290ca9a4ba2..1bfa46dfa8f 100644 --- a/jdk/src/share/classes/java/rmi/server/package.html +++ b/jdk/src/share/classes/java/rmi/server/package.html @@ -1,5 +1,5 @@ - + diff --git a/jdk/src/share/classes/javax/swing/colorchooser/package.html b/jdk/src/share/classes/javax/swing/colorchooser/package.html index d64ba91b64b..bf405aa45c1 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/package.html +++ b/jdk/src/share/classes/javax/swing/colorchooser/package.html @@ -25,6 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> + diff --git a/jdk/src/share/classes/javax/swing/event/DocumentEvent.java b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java index 9c9c796f8ec..a115660ec82 100644 --- a/jdk/src/share/classes/javax/swing/event/DocumentEvent.java +++ b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java @@ -79,7 +79,7 @@ public interface DocumentEvent { * This method is for observers to discover the structural * changes that were made. This means that only elements * that existed prior to the mutation (and still exist after - * the mutatino) need to have ElementChange records. + * the mutation) need to have ElementChange records. * The changes made available need not be recursive. *

                * For example, if the an element is removed from it's diff --git a/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java index 004038af785..b3262e6f0fd 100644 --- a/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java +++ b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java @@ -158,7 +158,7 @@ public class HyperlinkEvent extends EventObject { /** * Returns the Element that corresponds to the source of the * event. This will typically be an Element representing - * an anchor. If a constructur that is used that does not specify a source + * an anchor. If a constructor that is used that does not specify a source * Element, or null was specified as the source * Element, this will return null. * diff --git a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java index 038ccb36bb0..05c5c7bdc76 100644 --- a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java @@ -67,7 +67,7 @@ import javax.swing.table.*; */ public class TableModelEvent extends java.util.EventObject { - /** Identifies the addtion of new rows or columns. */ + /** Identifies the addition of new rows or columns. */ public static final int INSERT = 1; /** Identifies a change to existing data. */ public static final int UPDATE = 0; diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java index e67552df9c5..9b3bc05f331 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java @@ -89,7 +89,7 @@ public class TreeModelEvent extends EventObject { * before the deletes have occurred. Since the indexes must be specified in * order, the most natural processing methodology is to use a delete-counter. * Start by initializing the counter to zero and start work through the - * list from lowest to higest. Every time you do a delete, add the current + * list from lowest to highest. Every time you do a delete, add the current * value of the delete-counter to the index-position where the delete occurred, * and append the result to a Vector of delete-locations, using * addElement(). Then increment the delete-counter. The index diff --git a/jdk/src/share/classes/javax/swing/event/package.html b/jdk/src/share/classes/javax/swing/event/package.html index 5a90113561d..c1fab2cfd12 100644 --- a/jdk/src/share/classes/javax/swing/event/package.html +++ b/jdk/src/share/classes/javax/swing/event/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java index 3e206e2df78..9d93b9b8ae1 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java +++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java @@ -122,7 +122,7 @@ public abstract class FileSystemView { } /** - * Determines if the given file is a root in the navigatable tree(s). + * Determines if the given file is a root in the navigable tree(s). * Examples: Windows 98 has one root, the Desktop folder. DOS has one root * per drive letter, C:\, D:\, etc. Unix has one root, * the "/" directory. @@ -130,7 +130,7 @@ public abstract class FileSystemView { * The default implementation gets information from the ShellFolder class. * * @param f a File object representing a directory - * @return true if f is a root in the navigatable tree. + * @return true if f is a root in the navigable tree. * @see #isFileSystemRoot */ public boolean isRoot(File f) { @@ -201,7 +201,7 @@ public abstract class FileSystemView { /** * Type description for a file, directory, or folder as it would be displayed in * a system file browser. Example from Windows: the "Desktop" folder - * is desribed as "Desktop". + * is described as "Desktop". * * Override for platforms with native ShellFolder implementations. * @@ -254,7 +254,7 @@ public abstract class FileSystemView { * parent directory in the filesystem. Folder could for example be the * "Desktop" folder which is not the same as file.getParentFile(). * - * @param folder a File object repesenting a directory or special folder + * @param folder a File object representing a directory or special folder * @param file a File object * @return true if folder is a directory or special folder and contains file. * @since 1.4 @@ -281,7 +281,7 @@ public abstract class FileSystemView { /** * - * @param parent a File object repesenting a directory or special folder + * @param parent a File object representing a directory or special folder * @param fileName a name of a file or folder which exists in parent * @return a File object. This is normally constructed with new * File(parent, fileName) except when parent and child are both @@ -698,7 +698,7 @@ class WindowsFileSystemView extends FileSystemView { /** * Type description for a file, directory, or folder as it would be displayed in * a system file browser. Example from Windows: the "Desktop" folder - * is desribed as "Desktop". + * is described as "Desktop". * * The Windows implementation gets information from the ShellFolder class. */ diff --git a/jdk/src/share/classes/javax/swing/filechooser/package.html b/jdk/src/share/classes/javax/swing/filechooser/package.html index 58048bab801..6303e9fd35f 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/package.html +++ b/jdk/src/share/classes/javax/swing/filechooser/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java index 57de91208af..92eb0e1afcd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/ComboBoxUI.java @@ -36,7 +36,7 @@ import javax.swing.JComboBox; public abstract class ComboBoxUI extends ComponentUI { /** - * Set the visiblity of the popup + * Set the visibility of the popup */ public abstract void setPopupVisible( JComboBox c, boolean v ); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java index b9773ff0900..9e67b81d0ad 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java @@ -497,7 +497,7 @@ public class BasicBorders { /** - * Draws the border around the splitpane. To work correctly you shoudl + * Draws the border around the splitpane. To work correctly you should * also install a border on the divider (property SplitPaneDivider.border). */ public static class SplitPaneBorder implements Border, UIResource { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 37764cce509..bd5276afa2d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -41,7 +41,7 @@ import sun.swing.UIAction; /** * Basic UI implementation for JComboBox. *

                - * The combo box is a compound component which means that it is an agregate of + * The combo box is a compound component which means that it is an aggregate of * many simpler components. This class creates and manages the listeners * on the combo box and the combo box model. These listeners update the user * interface in response to changes in the properties and state of the combo box. @@ -705,7 +705,7 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * The aggregate components which compise the combo box are + * The aggregate components which comprise the combo box are * unregistered and uninitialized. This method is called as part of the * UI uninstallation process. */ @@ -911,7 +911,7 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * The minumum size is the size of the display area plus insets plus the button. + * The minimum size is the size of the display area plus insets plus the button. */ @Override public Dimension getMinimumSize( JComponent c ) { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java index 21be1269e02..17ce072b6cc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -456,7 +456,7 @@ public class BasicFileChooserUI extends FileChooserUI { public void mouseClicked(MouseEvent evt) { // Note: we can't depend on evt.getSource() because of backward - // compatability + // compatibility if (list != null && SwingUtilities.isLeftMouseButton(evt) && (evt.getClickCount()%2 == 0)) { @@ -565,7 +565,7 @@ public class BasicFileChooserUI extends FileChooserUI { } protected class DoubleClickListener extends MouseAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -591,7 +591,7 @@ public class BasicFileChooserUI extends FileChooserUI { } protected class SelectionListener implements ListSelectionListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java index 283ced62287..22eb7951066 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java @@ -270,18 +270,27 @@ public class BasicInternalFrameTitlePane extends JComponent protected void addSystemMenuItems(JMenu systemMenu) { JMenuItem mi = systemMenu.add(restoreAction); - mi.setMnemonic('R'); + mi.setMnemonic(getButtonMnemonic("restore")); mi = systemMenu.add(moveAction); - mi.setMnemonic('M'); + mi.setMnemonic(getButtonMnemonic("move")); mi = systemMenu.add(sizeAction); - mi.setMnemonic('S'); + mi.setMnemonic(getButtonMnemonic("size")); mi = systemMenu.add(iconifyAction); - mi.setMnemonic('n'); + mi.setMnemonic(getButtonMnemonic("minimize")); mi = systemMenu.add(maximizeAction); - mi.setMnemonic('x'); + mi.setMnemonic(getButtonMnemonic("maximize")); systemMenu.add(new JSeparator()); mi = systemMenu.add(closeAction); - mi.setMnemonic('C'); + mi.setMnemonic(getButtonMnemonic("close")); + } + + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } } protected JMenu createSystemMenu() { @@ -556,7 +565,7 @@ public class BasicInternalFrameTitlePane extends JComponent * Instantiate it only within subclasses of Foo. */ public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -570,7 +579,7 @@ public class BasicInternalFrameTitlePane extends JComponent * Instantiate it only within subclasses of Foo. */ public class TitlePaneLayout implements LayoutManager { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java index f5cdaef24b4..1db95fb8f96 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -477,7 +477,7 @@ public class BasicInternalFrameUI extends InternalFrameUI public class InternalFramePropertyChangeListener implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -491,7 +491,7 @@ public class BasicInternalFrameUI extends InternalFrameUI } public class InternalFrameLayout implements LayoutManager { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1093,7 +1093,7 @@ public class BasicInternalFrameUI extends InternalFrameUI } /// End BorderListener Class protected class ComponentHandler implements ComponentListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1119,7 +1119,7 @@ public class BasicInternalFrameUI extends InternalFrameUI protected class GlassPaneDispatcher implements MouseInputListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1159,7 +1159,7 @@ public class BasicInternalFrameUI extends InternalFrameUI protected class BasicInternalFrameListener implements InternalFrameListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java index b8aff8a255a..4ad134756e9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java @@ -433,7 +433,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab * used for getting localized defaults. Also initialize the default * locale used when no locale is passed into UIDefaults.get(). The * default locale should generally not be relied upon. It is here for - * compatability with releases prior to 1.4. + * compatibility with releases prior to 1.4. */ private void initResourceBundle(UIDefaults table) { table.setDefaultLocale( Locale.getDefault() ); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java index e32e12da0b8..c6b521c9cd0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -760,7 +760,7 @@ public class BasicMenuItemUI extends MenuItemUI Thread.dumpStack(); } protected class MouseInputHandler implements MouseInputListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 72b25eadafd..d849077b7ab 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -322,7 +322,7 @@ public class BasicMenuUI extends BasicMenuItemUI * @since 1.4 */ protected class MouseInputHandler implements MouseInputListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 4f784fa07e6..28b1d0a09bb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -923,7 +923,7 @@ public class BasicOptionPaneUI extends OptionPaneUI { private boolean reverseButtons; /** * Indicates whether or not centersChildren should be used vs - * the orientation. This is done for backward compatability + * the orientation. This is done for backward compatibility * for subclassers. */ private boolean useOrientation; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java index 94e47d043a0..c83172848bd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java @@ -335,7 +335,7 @@ public class BasicProgressBarUI extends ProgressBarUI { /** * Returns the width (if HORIZONTAL) or height (if VERTICAL) - * of each of the indivdual cells/units to be rendered in the + * of each of the individual cells/units to be rendered in the * progress bar. However, for text rendering simplification and * aesthetic considerations, this function will return 1 when * the progress string is being rendered. @@ -1215,7 +1215,7 @@ public class BasicProgressBarUI extends ProgressBarUI { * Instantiate it only within subclasses of {@code BasicProgressBarUI}. */ public class ChangeHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java index 65e170a3181..765e948b030 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -1489,7 +1489,7 @@ public class BasicScrollBarUI public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java index 355f5fce2b9..08b8090613a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java @@ -443,7 +443,7 @@ public class BasicScrollPaneUI public class ViewportChangeHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -464,7 +464,7 @@ public class BasicScrollPaneUI public class HSBChangeListener implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -494,7 +494,7 @@ public class BasicScrollPaneUI public class VSBChangeListener implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -534,7 +534,7 @@ public class BasicScrollPaneUI */ protected class MouseWheelHandler implements MouseWheelListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -665,7 +665,7 @@ public class BasicScrollPaneUI public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java index 7ca5c22cc59..e90c1e8bbee 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java @@ -743,7 +743,7 @@ public class BasicSliderUI extends SliderUI{ } public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1545,7 +1545,7 @@ public class BasicSliderUI extends SliderUI{ * Instantiate it only within subclasses of Foo. */ public class ChangeHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1852,7 +1852,7 @@ public class BasicSliderUI extends SliderUI{ * Instantiate it only within subclasses of Foo. */ public class ComponentHandler extends ComponentAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1868,7 +1868,7 @@ public class BasicSliderUI extends SliderUI{ * Instantiate it only within subclasses of Foo. */ public class FocusHandler implements FocusListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1895,7 +1895,7 @@ public class BasicSliderUI extends SliderUI{ * Instantiate it only within subclasses of Foo. */ public class ActionScroller extends AbstractAction { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Actions. If you need to add // new functionality add it to the Actions, but make sure this // class calls into the Actions. @@ -1928,7 +1928,7 @@ public class BasicSliderUI extends SliderUI{ * A static version of the above. */ static class SharedActionScroller extends AbstractAction { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Actions. If you need to add // new functionality add it to the Actions, but make sure this // class calls into the Actions. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index ba9ef818ae2..0f47e8965c5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -273,7 +273,7 @@ public class BasicSplitPaneUI extends SplitPaneUI private Color dividerDraggingColor; private boolean rememberPaneSizes; - // Indicates wether the one of splitpane sides is expanded + // Indicates whether the one of splitpane sides is expanded private boolean keepHidden = false; /** Indicates that we have painted once. */ @@ -637,7 +637,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Determines wether the JSplitPane is set to use a continuous layout. + * Determines whether the JSplitPane is set to use a continuous layout. */ public boolean isContinuousLayout() { return continuousLayout; @@ -683,7 +683,7 @@ public class BasicSplitPaneUI extends SplitPaneUI */ public class PropertyHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -707,7 +707,7 @@ public class BasicSplitPaneUI extends SplitPaneUI */ public class FocusHandler extends FocusAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1073,7 +1073,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the preferred size for the passed in component, - * This is passed off to the current layoutmanager. + * This is passed off to the current layout manager. */ public Dimension getPreferredSize(JComponent jc) { if(splitPane != null) @@ -1084,7 +1084,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the minimum size for the passed in component, - * This is passed off to the current layoutmanager. + * This is passed off to the current layout manager. */ public Dimension getMinimumSize(JComponent jc) { if(splitPane != null) @@ -1095,7 +1095,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the maximum size for the passed in component, - * This is passed off to the current layoutmanager. + * This is passed off to the current layout manager. */ public Dimension getMaximumSize(JComponent jc) { if(splitPane != null) @@ -1438,8 +1438,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the minimum size needed to contain the children. - * The width is the sum of all the childrens min widths and - * the height is the largest of the childrens minimum heights. + * The width is the sum of all the children's min widths and + * the height is the largest of the children's minimum heights. */ public Dimension minimumLayoutSize(Container container) { int minPrimary = 0; @@ -1471,8 +1471,8 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the preferred size needed to contain the children. - * The width is the sum of all the childrens preferred widths and - * the height is the largest of the childrens preferred heights. + * The width is the sum of all the preferred widths of the children and + * the height is the largest preferred height of the children. */ public Dimension preferredLayoutSize(Container container) { int prePrimary = 0; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java index b239cd70280..f0e3ada72cb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -3748,7 +3748,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3762,7 +3762,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class TabSelectionHandler implements ChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3776,7 +3776,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class MouseHandler extends MouseAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -3790,7 +3790,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { * Instantiate it only within subclasses of BasicTabbedPaneUI. */ public class FocusHandler extends FocusAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java index f9f9c728ed1..dba3c6b23a1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java @@ -738,7 +738,7 @@ public class BasicTableUI extends TableUI * the current TableCellEditor. */ public class KeyHandler implements KeyListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -764,7 +764,7 @@ public class BasicTableUI extends TableUI * Instantiate it only within subclasses of {@code BasicTableUI}. */ public class FocusHandler implements FocusListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -786,7 +786,7 @@ public class BasicTableUI extends TableUI * Instantiate it only within subclasses of BasicTableUI. */ public class MouseInputHandler implements MouseInputListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java index bec3faacbfd..9d037c1e670 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -1560,6 +1560,10 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { * location that one might place a caret. Some views may not be visible, * they might not be in the same order found in the model, or they just * might not allow access to some of the locations in the model. + * This method enables specifying a position to convert + * within the range of >=0. If the value is -1, a position + * will be calculated automatically. If the value < -1, + * the {@code BadLocationException} will be thrown. * * @param pos the position to convert >= 0 * @param a the allocated region to render into @@ -1569,13 +1573,17 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { * SwingConstants.NORTH, or SwingConstants.SOUTH. * @return the location within the model that best represents the next * location visual position. - * @exception BadLocationException + * @exception BadLocationException the given position is not a valid + * position within the document * @exception IllegalArgumentException for an invalid direction */ public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException { + if (pos < -1) { + throw new BadLocationException("invalid position", pos); + } if( view != null ) { int nextPos = view.getNextVisualPositionFrom(pos, b, a, direction, biasRet); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java index 7f1d05af875..847e1db6551 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -583,7 +583,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants /** * Sets the flag for enabling rollover borders on the toolbar and it will - * also install the apropriate border depending on the state of the flag. + * also install the appropriate border depending on the state of the flag. * * @param rollover if true, rollover borders are installed. * Otherwise non-rollover borders are installed @@ -606,7 +606,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * This is a convenience method to call setBorderToRollover * for each child component. * - * @param c container which holds the child components (usally a JToolBar) + * @param c container which holds the child components (usually a JToolBar) * @see #setBorderToRollover * @since 1.4 */ @@ -630,7 +630,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * This is a convenience method to call setBorderToNonRollover * for each child component. * - * @param c container which holds the child components (usally a JToolBar) + * @param c container which holds the child components (usually a JToolBar) * @see #setBorderToNonRollover * @since 1.4 */ @@ -654,7 +654,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * This is a convenience method to call setBorderNormal * for each child component. * - * @param c container which holds the child components (usally a JToolBar) + * @param c container which holds the child components (usually a JToolBar) * @see #setBorderToNonRollover * @since 1.4 */ @@ -1274,7 +1274,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants } protected class ToolBarContListener implements ContainerListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1289,7 +1289,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants } protected class ToolBarFocusListener implements FocusListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1303,7 +1303,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants } protected class PropertyListener implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -1317,7 +1317,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * Instantiate it only within subclasses of BasicToolBarUI. */ public class DockingListener implements MouseInputListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java index 8309dd6aa40..79b2093d39b 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java @@ -204,7 +204,7 @@ public class BasicToolTipUI extends ToolTipUI JComponent comp = ((JToolTip)c).getComponent(); if (comp != null && !(comp.isEnabled())) { - // For better backward compatability, only install inactive + // For better backward compatibility, only install inactive // properties if they are defined. if (UIManager.getBorder("ToolTip.borderInactive") != null) { LookAndFeel.installBorder(c, "ToolTip.borderInactive"); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index de739dc1e75..821483049f0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -140,7 +140,7 @@ public class BasicTreeUI extends TreeUI /** Used to determine what to display. */ protected TreeModel treeModel; - /** Model maintaing the selection. */ + /** Model maintaining the selection. */ protected TreeSelectionModel treeSelectionModel; /** How much the depth should be offset to properly calculate @@ -1275,7 +1275,7 @@ public class BasicTreeUI extends TreeUI } /** - * Returns a ubounding box for the drop line. + * Returns a unbounding box for the drop line. * * @param loc a {@code DropLocation} * @return bounding box for the drop line @@ -2525,7 +2525,7 @@ public class BasicTreeUI extends TreeUI * Updates the TreeState in response to nodes expanding/collapsing. */ public class TreeExpansionHandler implements TreeExpansionListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2627,7 +2627,7 @@ public class BasicTreeUI extends TreeUI */ public class TreeModelHandler implements TreeModelListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2656,7 +2656,7 @@ public class BasicTreeUI extends TreeUI */ public class TreeSelectionHandler implements TreeSelectionListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2677,7 +2677,7 @@ public class BasicTreeUI extends TreeUI */ public class CellEditorHandler implements CellEditorListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2695,12 +2695,12 @@ public class BasicTreeUI extends TreeUI /** - * This is used to get mutliple key down events to appropriately generate + * This is used to get multiple key down events to appropriately generate * events. */ public class KeyHandler extends KeyAdapter { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2742,7 +2742,7 @@ public class BasicTreeUI extends TreeUI * Repaints the lead selection row when focus is lost/gained. */ public class FocusHandler implements FocusListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2844,7 +2844,7 @@ public class BasicTreeUI extends TreeUI */ public class MouseHandler extends MouseAdapter implements MouseMotionListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2877,12 +2877,12 @@ public class BasicTreeUI extends TreeUI /** * PropertyChangeListener for the tree. Updates the appropriate - * varaible, or TreeState, based on what changes. + * variable, or TreeState, based on what changes. */ public class PropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. @@ -2900,7 +2900,7 @@ public class BasicTreeUI extends TreeUI public class SelectionModelPropertyChangeHandler implements PropertyChangeListener { - // NOTE: This class exists only for backward compatability. All + // NOTE: This class exists only for backward compatibility. All // its functionality has been moved into Handler. If you need to add // new functionality add it to the Handler, but make sure this // class calls into the Handler. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/package.html b/jdk/src/share/classes/javax/swing/plaf/basic/package.html index f48ba91ad76..d453d348595 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/basic/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java index b0b42cfcf55..5527815d5b6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java @@ -57,7 +57,7 @@ import sun.swing.SwingUtilities2; * UIManager.put("swing.boldMetal", Boolean.FALSE); *

              * The defaults property swing.boldMetal, if set, - * takes precendence over the system property of the same name. After + * takes precedence over the system property of the same name. After * setting this defaults property you need to re-install * MetalLookAndFeel, as well as update the UI * of any previously created widgets. Otherwise the results are undefined. @@ -284,7 +284,7 @@ public class DefaultMetalTheme extends MetalTheme { /** * Returns the system text font. This returns Dialog, 12pt, plain. * - * @return the sytem text font + * @return the system text font */ public FontUIResource getSystemTextFont() { return getFont(SYSTEM_TEXT_FONT); diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index 76ece662b2f..7318815e691 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -1738,7 +1738,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel public static FontUIResource getControlTextFont() { return getCurrentTheme().getControlTextFont();} /** - * Returns the sytem text font of the current theme. This is a + * Returns the system text font of the current theme. This is a * cover method for {@code getCurrentTheme().getSystemTextFont()}. * * @return the system text font diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java index e2c6d519c53..e40721dddb5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java @@ -682,7 +682,7 @@ public class MetalRootPaneUI extends BasicRootPaneUI private boolean isMovingWindow; /** - * Used to determine the corner the resize is occuring from. + * Used to determine the corner the resize is occurring from. */ private int dragCursor; diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java index 8b50bb76961..3fbfb3fa55f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java @@ -64,14 +64,14 @@ public class MetalSliderUI extends BasicSliderUI { /** * A default horizontal thumb Icon. This field might not be - * used. To change the Icon used by this delgate directly set it + * used. To change the Icon used by this delegate directly set it * using the Slider.horizontalThumbIcon UIManager property. */ protected static Icon horizThumbIcon; /** * A default vertical thumb Icon. This field might not be - * used. To change the Icon used by this delgate directly set it + * used. To change the Icon used by this delegate directly set it * using the Slider.verticalThumbIcon UIManager property. */ protected static Icon vertThumbIcon; diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java index 6de36bea4f3..65b2cb4a572 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java @@ -64,7 +64,7 @@ public class MetalToolBarUI extends BasicToolBarUI private static List> components = new ArrayList>(); /** - * This protected field is implemenation specific. Do not access directly + * This protected field is implementation specific. Do not access directly * or override. Use the create method instead. * * @see #createContainerListener @@ -72,7 +72,7 @@ public class MetalToolBarUI extends BasicToolBarUI protected ContainerListener contListener; /** - * This protected field is implemenation specific. Do not access directly + * This protected field is implementation specific. Do not access directly * or override. Use the create method instead. * * @see #createRolloverListener diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java index 29e7f45db31..b3ba0ea969e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java @@ -64,7 +64,7 @@ import javax.swing.plaf.basic.*; *
          Examples of Path Matching
          this's pathp's pathmatch
          /a/b/a/byes
          * *

          - * As it is typically impratical to obtain the TreeUI from + * As it is typically impractical to obtain the TreeUI from * the JTree and cast to an instance of MetalTreeUI * you enable this property via the client property * JTree.lineStyle. For example, to switch to diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/package.html b/jdk/src/share/classes/javax/swing/plaf/metal/package.html index e60da42ed46..146cbbbc79b 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/metal/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html index 5160494f750..3ae0bf2c6c0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html +++ b/jdk/src/share/classes/javax/swing/plaf/multi/doc-files/multi_tsc.html @@ -14,14 +14,14 @@ Using the Multiplexing Look and Feel


          -

          + This document is based on an article originally published in The Swing Connection. -

          +


          @@ -43,7 +43,6 @@ the Java or Windows look and feel, for example -- and requires no modifications to work with auxiliary look and feels.

          -

          This document has the following sections: @@ -76,14 +75,12 @@ a Swing Connection article.

          - +


          - Overview -

          @@ -146,14 +143,12 @@ is called (unsurprisingly) the Multiplexing look and feel.

          - +


          - How to Use Auxiliary Look and Feels -

          It's easy to use auxiliary look and feels with Swing. To instruct @@ -204,14 +199,12 @@ of the UIs obtained from the default and auxiliary look and feels.

          - +


          - Tips for Writing an Auxiliary Look and Feel -

          An auxiliary look and feel is like any other look and feel, @@ -252,7 +245,6 @@ the javax.swing.plaf package. Dos and Don'ts

          -

          The following paragraphs provide some general recommendations for developing @@ -264,22 +256,19 @@ auxiliary look and feels. to perform all initialization, and the uninstallUI method to perform all cleanup. -

          -
            -

            +

            The installUI and uninstallUI methods are invoked when a component's look and feel is set. The installUI method gives the new UI object a chance to add listeners on the component and its data model. Similarly, the uninstallUI method lets the previous UI object remove its listeners. -

            -
          +

          Don't extend visual look and feels.

          -
            -

            We recommended that you don't implement +

            + We recommended that you don't implement UI classes of an auxiliary look and feel as subclasses of the UI classes of a visual look and feel. Why not? Because they might accidentally inherit code that installs listeners on a component @@ -290,13 +279,13 @@ lets the previous UI object remove its listeners. Instead, we recommend that the UI classes of an auxiliary look and feel directly extend the abstract UI classes in the javax.swing.plaf package. By using this strategy, the developer of an auxiliary - look and feel can avoid competing with the default look and feel.

            -
          + look and feel can avoid competing with the default look and feel. +

          Override all UI-specific methods your UI classes inherit.

          -
            -

            We recommend that each UI class of +

            + We recommend that each UI class of an auxiliary look and feel override the methods defined in the javax.swing.plaf UI classes it descends from @@ -309,15 +298,14 @@ lets the previous UI object remove its listeners. if the component is opaque. If a UI class from a non-visual auxiliary look and feel does not override this method, all - opaque components appear as blank areas on the screen!

            -
          + opaque components appear as blank areas on the screen! +


          Extending UIDefaults -

          In many cases, you might want an auxiliary look and feel to be "incomplete." That @@ -379,7 +367,6 @@ In the preceding example, an auxiliary look and feel named MyAux Examining Other UI Objects -

          In rare instances, a UI object from an auxiliary look and feel @@ -395,12 +382,10 @@ In the preceding example, an auxiliary look and feel named MyAux

          - +


          - How the Multiplexing Look and Feel Is Implemented -

          The Multiplexing look and feel @@ -437,8 +422,8 @@ all developers and users. and feel is always the first to be created. After that, a UI object is created from each auxiliary look and feel in the order they are specified in the swing.auxiliarylaf - property.

        2. -

          + property.

          +

        3. When a method that requests information from a UI object is invoked, the multiplexing UI object invokes the method on all the UI objects, but returns @@ -450,8 +435,8 @@ all developers and users. The getPreferredSize method is also invoked on the UI object for each auxiliary look and feel, but the return values are ignored. -
        4. -

          +

          +

        5. When a method that does not request information from the UI object is invoked, the multiplexing UI object invokes that method on all UIs -- @@ -474,14 +459,12 @@ all developers and users.

          - +


          - How to Provide a Custom Multiplexing Look and Feel -

          -

          While +

          While we hope the behavior of the Multiplexing look and feel is flexible enough not to require an alternative multiplexing look and feel, Swing allows the user to specify another multiplexing look diff --git a/jdk/src/share/classes/javax/swing/plaf/multi/package.html b/jdk/src/share/classes/javax/swing/plaf/multi/package.html index 31b212bfbdb..94e73080e3d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/multi/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/multi/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java index 355e68e95cb..6cdeb119c1e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java @@ -187,7 +187,7 @@ public abstract class AbstractRegionPainter implements Painter { protected abstract PaintContext getPaintContext(); /** - *

          Configures the given Graphics2D. Often, rendering hints or compositiing rules are + *

          Configures the given Graphics2D. Often, rendering hints or compositing rules are * applied to a Graphics2D object prior to painting, which should affect all of the * subsequent painting operations. This method provides a convenient hook for configuring * the Graphics object prior to rendering, regardless of whether the render operation is @@ -201,7 +201,7 @@ public abstract class AbstractRegionPainter implements Painter { /** * Actually performs the painting operation. Subclasses must implement this method. - * The graphics object passed may represent the actual surface being rendererd to, + * The graphics object passed may represent the actual surface being rendered to, * or it may be an intermediate buffer. It has also been pre-translated. Simply render * the component as if it were located at 0, 0 and had a width of width * and a height of height. For performance reasons, you may want to read @@ -313,13 +313,13 @@ public abstract class AbstractRegionPainter implements Painter { * Decodes and returns a color, which is derived from a base color in UI * defaults. * - * @param key A key corrosponding to the value in the UI Defaults table + * @param key A key corresponding to the value in the UI Defaults table * of UIManager where the base color is defined * @param hOffset The hue offset used for derivation. * @param sOffset The saturation offset used for derivation. * @param bOffset The brightness offset used for derivation. * @param aOffset The alpha offset used for derivation. Between 0...255 - * @return The derived color, whos color value will change if the parent + * @return The derived color, whose color value will change if the parent * uiDefault color changes. */ protected final Color decodeColor(String key, float hOffset, float sOffset, @@ -532,11 +532,11 @@ public abstract class AbstractRegionPainter implements Painter { * to one of the "decode" methods will return the passed in value. * @param inverted Whether to "invert" the meaning of the 9-square grid and stretching insets * @param cacheMode A hint as to which caching mode to use. If null, then set to no caching. - * @param maxH The maximium scale in the horizontal direction to use before punting and redrawing from scratch. + * @param maxH The maximum scale in the horizontal direction to use before punting and redrawing from scratch. * For example, if maxH is 2, then we will attempt to scale any cached images up to 2x the canvas * width before redrawing from scratch. Reasonable maxH values may improve painting performance. * If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1. - * @param maxV The maximium scale in the vertical direction to use before punting and redrawing from scratch. + * @param maxV The maximum scale in the vertical direction to use before punting and redrawing from scratch. * For example, if maxV is 2, then we will attempt to scale any cached images up to 2x the canvas * height before redrawing from scratch. Reasonable maxV values may improve painting performance. * If set too high, then you may get poor looking graphics at higher zoom levels. Must be >= 1. diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java index 768d7721974..deeecddfbbd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java @@ -64,7 +64,7 @@ class LoweredBorder extends AbstractRegionPainter implements Border { /** * Actually performs the painting operation. Subclasses must implement this * method. The graphics object passed may represent the actual surface being - * rendererd to, or it may be an intermediate buffer. It has also been + * rendered to, or it may be an intermediate buffer. It has also been * pre-translated. Simply render the component as if it were located at 0, 0 * and had a width of width and a height of * height. For performance reasons, you may want to read the diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java index fcb8cdb6a47..b4dfaffd124 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java @@ -808,7 +808,7 @@ public final class NimbusStyle extends SynthStyle { } /** - * Simple utility method that searchs the given array of Strings for the + * Simple utility method that searches the given array of Strings for the * given string. This method is only called from getExtendedState if * the developer has specified a specific state for the component to be * in (ie, has "wedged" the component in that state) by specifying @@ -1010,7 +1010,7 @@ public final class NimbusStyle extends SynthStyle { } /** - * Contains values such as the UIDefaults and painters asssociated with + * Contains values such as the UIDefaults and painters associated with * a state. Whereas State represents a distinct state that a * component can be in (such as Enabled), this class represents the colors, * fonts, painters, etc associated with some state for this diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html index bedeffb5db7..67048cf1087 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/doc-files/properties.html @@ -1,5 +1,7 @@ + +

          Primary Colors

          diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html index 338df175b51..5a60f7a7885 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + @@ -39,11 +39,11 @@ component states.

          Nimbus allows customizing many of its properties, including painters, by altering the {@link javax.swing.UIDefaults} table. Here's an example: -

          +
               UIManager.put("ProgressBar.tileWidth", myTileWidth);
               UIManager.put("ProgressBar[Enabled].backgroundPainter", myBgPainter);
               UIManager.put("ProgressBar[Enabled].foregroundPainter", myFgPainter);
          -
          +

          Per-component customization is also possible. When rendering a component, Nimbus checks its client property named "Nimbus.Overrides". The value of this @@ -53,14 +53,14 @@ only. An optional client property, "Nimbus.Overrides.InheritDefaults" of type Boolean, specifies whether the overriding settings should be merged with default ones ({@code true}), or replace them ({@code false}). By default they are merged: -

          +
               JProgressBar bar = new JProgressBar();
               UIDefaults overrides = new UIDefaults();
               overrides.put("ProgressBar.cycleTime", 330);
               ...
               bar.putClientProperty("Nimbus.Overrides", overrides);
               bar.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
          -
          +

          Colors in Nimbus are derived from a core set of primary colors. There are also diff --git a/jdk/src/share/classes/javax/swing/plaf/package.html b/jdk/src/share/classes/javax/swing/plaf/package.html index fdd354d8c0a..4e1745e4457 100644 --- a/jdk/src/share/classes/javax/swing/plaf/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/package.html @@ -25,7 +25,7 @@ Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> - + diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java index 021d21de116..a6442da947c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java @@ -191,20 +191,28 @@ class SynthInternalFrameTitlePane extends BasicInternalFrameTitlePane } protected void addSystemMenuItems(JPopupMenu menu) { - // PENDING: this should all be localizable! JMenuItem mi = menu.add(restoreAction); - mi.setMnemonic('R'); + mi.setMnemonic(getButtonMnemonic("restore")); mi = menu.add(moveAction); - mi.setMnemonic('M'); + mi.setMnemonic(getButtonMnemonic("move")); mi = menu.add(sizeAction); - mi.setMnemonic('S'); + mi.setMnemonic(getButtonMnemonic("size")); mi = menu.add(iconifyAction); - mi.setMnemonic('n'); + mi.setMnemonic(getButtonMnemonic("minimize")); mi = menu.add(maximizeAction); - mi.setMnemonic('x'); + mi.setMnemonic(getButtonMnemonic("maximize")); menu.add(new JSeparator()); mi = menu.add(closeAction); - mi.setMnemonic('C'); + mi.setMnemonic(getButtonMnemonic("close")); + } + + private static int getButtonMnemonic(String button) { + try { + return Integer.parseInt(UIManager.getString( + "InternalFrameTitlePane." + button + "Button.mnemonic")); + } catch (NumberFormatException e) { + return -1; + } } protected void showSystemMenu() { diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java index bece289030f..1df0737620d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java @@ -116,7 +116,7 @@ public class SynthLookAndFeel extends BasicLookAndFeel { /** * Used by the renderers. For the most part the renderers are implemented * as Labels, which is problematic in so far as they are never selected. - * To accomodate this SynthLabelUI checks if the current + * To accommodate this SynthLabelUI checks if the current * UI matches that of selectedUI (which this methods sets), if * it does, then a state as set by this method is returned. This provides * a way for labels to have a state other than selected. diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html index aa0145cfce2..2837aaec4d7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html +++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/componentProperties.html @@ -47,7 +47,7 @@ Components will create it to render a button with an arrow. The JComboBox, JScrollBar and JSplitPane (for the buttons on the divider). In addition to the Button properties, ArrowButton supports -the following propeties:

          +the following properties:

          ArrowButton Specific Properties
          @@ -887,7 +887,7 @@ invoked. JScrollPane is unique in that it provides a method for setting the Border around the JViewport with JViewport throwing an IllegalArgumentException from setBorder. To - accomodate this a special border is installed on the + accommodate this a special border is installed on the JScrollPane that uses the insets from the key ScrollPane.viewportBorderInsets. The @@ -1190,7 +1190,7 @@ space, along the y axis, to offset nodes from their parent. - diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html index dfb99f4ef50..ad84defba08 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html +++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synthFileFormat.html @@ -2,7 +2,7 @@ Synth File Format -
          Tree.scrollsHorizontallyAndVertically Boolean false If false and scrolling needs to happen to accomodate cells + If false and scrolling needs to happen to accommodate cells it will only happen along the vertical axis, if true, scrolling may happen along both the horizontal and vertical axis.