diff --git a/.hgtags b/.hgtags index 5df287b11d4..d13de9187bc 100644 --- a/.hgtags +++ b/.hgtags @@ -235,3 +235,4 @@ b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 +dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index ef0f8b30804..bc18620853e 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -235,3 +235,4 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113 +4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114 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..132a2d9acf4 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -235,3 +235,4 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113 +0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114 diff --git a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java index 3018cdef99e..1b03be02dd1 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java @@ -580,7 +580,7 @@ public class AnyImpl extends Any java.lang.Object[] objholder = new java.lang.Object[1]; objholder[0] = object; long[] longholder = new long[1]; - TCUtility.unmarshalIn(in, typeCode, longholder, objholder); + TCUtility.unmarshalIn(in, realType(), longholder, objholder); value = longholder[0]; object = objholder[0]; stream = null; diff --git a/corba/src/share/classes/javax/rmi/CORBA/Stub.java b/corba/src/share/classes/javax/rmi/CORBA/Stub.java index 72f9434c99f..227e28992b6 100644 --- a/corba/src/share/classes/javax/rmi/CORBA/Stub.java +++ b/corba/src/share/classes/javax/rmi/CORBA/Stub.java @@ -61,13 +61,11 @@ public abstract class Stub extends ObjectImpl private transient StubDelegate stubDelegate = null; private static Class stubDelegateClass = null; private static final String StubClassKey = "javax.rmi.CORBA.StubClass"; - private static final String defaultStubImplName = "com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl"; static { - Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName); + Object stubDelegateInstance = createDelegate(StubClassKey); if (stubDelegateInstance != null) stubDelegateClass = stubDelegateInstance.getClass(); - } @@ -207,7 +205,7 @@ public abstract class Stub extends ObjectImpl // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Util.java - private static Object createDelegateIfSpecified(String classKey, String defaultClassName) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -218,7 +216,7 @@ public abstract class Stub extends ObjectImpl } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl(); } try { diff --git a/corba/src/share/classes/javax/rmi/CORBA/Util.java b/corba/src/share/classes/javax/rmi/CORBA/Util.java index 449788afa62..65df15f1a27 100644 --- a/corba/src/share/classes/javax/rmi/CORBA/Util.java +++ b/corba/src/share/classes/javax/rmi/CORBA/Util.java @@ -60,14 +60,11 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction; public class Util { // This can only be set at static initialization time (no sync necessary). - private static javax.rmi.CORBA.UtilDelegate utilDelegate = null; + private static final javax.rmi.CORBA.UtilDelegate utilDelegate; private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass"; - private static final String defaultUtilImplName = -"com.sun.corba.se.impl.javax.rmi.CORBA.Util"; static { - utilDelegate = (javax.rmi.CORBA.UtilDelegate) - createDelegateIfSpecified(UtilClassKey, defaultUtilImplName); + utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey); } private Util(){} @@ -338,9 +335,7 @@ Tie#deactivate} // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Stub.java - private static Object createDelegateIfSpecified(String classKey, - String defaultClassName) - { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -351,7 +346,7 @@ Tie#deactivate} } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.Util(); } try { diff --git a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java index cbd6df25510..951f06cb477 100644 --- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java +++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java @@ -65,17 +65,14 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction; */ public class PortableRemoteObject { - private static javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate = null; + private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate; private static final String PortableRemoteObjectClassKey = "javax.rmi.CORBA.PortableRemoteObjectClass"; - private static final String defaultPortableRemoteObjectImplName = - "com.sun.corba.se.impl.javax.rmi.PortableRemoteObject"; - static { proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate) - createDelegateIfSpecified(PortableRemoteObjectClassKey); + createDelegate(PortableRemoteObjectClassKey); } /** @@ -181,7 +178,7 @@ public class PortableRemoteObject { // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from here. - private static Object createDelegateIfSpecified(String classKey) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -191,7 +188,7 @@ public class PortableRemoteObject { } } if (className == null) { - className = defaultPortableRemoteObjectImplName; + return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject(); } try { diff --git a/corba/src/share/classes/org/omg/CORBA/ORB.java b/corba/src/share/classes/org/omg/CORBA/ORB.java index 42fe7bc0090..5b434097c65 100644 --- a/corba/src/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/share/classes/org/omg/CORBA/ORB.java @@ -173,15 +173,6 @@ abstract public class ORB { private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; - // - // The last resort fallback ORB implementation classes in case - // no ORB implementation class is dynamically configured through - // properties or applet parameters. Change these values to - // vendor-specific class names. - // - private static final String defaultORB = "com.sun.corba.se.impl.orb.ORBImpl"; - private static final String defaultORBSingleton = "com.sun.corba.se.impl.orb.ORBSingleton"; - // // The global instance of the singleton ORB implementation which // acts as a factory for typecodes for generated Helper classes. @@ -294,10 +285,11 @@ abstract public class ORB { String className = getSystemProperty(ORBSingletonClassKey); if (className == null) className = getPropertyFromFile(ORBSingletonClassKey); - if (className == null) - className = defaultORBSingleton; - - singleton = create_impl(className); + if (className == null) { + singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); + } else { + singleton = create_impl(className); + } } return singleton; } @@ -347,10 +339,12 @@ abstract public class ORB { className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(args, props); return orb; } @@ -375,10 +369,12 @@ abstract public class ORB { className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(app, props); return orb; } diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f794add23e0..22734a967f6 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -389,3 +389,5 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 +7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 +3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57 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..69d9e8e9e59 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=57 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..af142976b35 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -4099,15 +4099,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 +4119,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 +4138,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 +4156,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 +4176,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..eadb0a8b60f 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"); } 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/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index c39c50082aa..cc4fe6869dc 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -5049,25 +5049,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 +5088,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 +5111,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 +5127,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..3d07cb0ee32 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -2925,9 +2925,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..1da6efa85e0 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -2980,9 +2980,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/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/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/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..8df4e32c355 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/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..55a533bc38a 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: 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/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/NestedMathExactTest.java b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java new file mode 100644 index 00000000000..211dc8baff1 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java @@ -0,0 +1,54 @@ +/* + * 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 8027444 + * @summary Test nested loops + * @compile NestedMathExactTest.java + * @run main NestedMathExactTest + * + */ + +public class NestedMathExactTest { + public static final int LIMIT = 100; + public static int[] result = new int[LIMIT]; + public static int value = 17; + + 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/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/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..d3911b41c9c 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -235,3 +235,4 @@ d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111 c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112 0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113 +1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114 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..dc8b2a85477 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -235,3 +235,4 @@ cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111 dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112 9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113 +9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114 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/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/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/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/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/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/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/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/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/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/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/lang/invoke/MethodType.java b/jdk/src/share/classes/java/lang/invoke/MethodType.java index 781ecfc56bd..214ca6ce48c 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodType.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java @@ -823,7 +823,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 */ @@ -854,7 +854,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 @@ -872,7 +872,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. @@ -892,7 +892,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 @@ -922,7 +922,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/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/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/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/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 9f269ffd660..1e095dec731 100644 --- a/jdk/src/share/classes/java/net/DatagramSocket.java +++ b/jdk/src/share/classes/java/net/DatagramSocket.java @@ -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) { 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/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/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/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/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java index 785cfc0c9e2..dd66ed26c54 100644 --- a/jdk/src/share/classes/java/net/URLConnection.java +++ b/jdk/src/share/classes/java/net/URLConnection.java @@ -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 acf10e98244..1e1138ad7ec 100644 --- a/jdk/src/share/classes/java/net/URLDecoder.java +++ b/jdk/src/share/classes/java/net/URLDecoder.java @@ -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 7b05e1cde79..86377b7a752 100644 --- a/jdk/src/share/classes/java/net/URLEncoder.java +++ b/jdk/src/share/classes/java/net/URLEncoder.java @@ -185,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/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/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/security/AccessControlException.java b/jdk/src/share/classes/java/security/AccessControlException.java index fbdbb77b999..a4f2a7803ad 100644 --- a/jdk/src/share/classes/java/security/AccessControlException.java +++ b/jdk/src/share/classes/java/security/AccessControlException.java @@ -44,7 +44,7 @@ public class AccessControlException extends SecurityException { private static final long serialVersionUID = 5138225684096988535L; - // the permission that caused the exeception to be thrown. + // the permission that caused the exception to be thrown. private Permission perm; /** @@ -71,7 +71,7 @@ public class AccessControlException extends SecurityException { } /** - * Gets the Permission object associated with this exeception, or + * Gets the Permission object associated with this exception, or * null if there was no corresponding Permission object. * * @return the Permission object. diff --git a/jdk/src/share/classes/java/security/DigestOutputStream.java b/jdk/src/share/classes/java/security/DigestOutputStream.java index 5634a2252ec..51db133a5f6 100644 --- a/jdk/src/share/classes/java/security/DigestOutputStream.java +++ b/jdk/src/share/classes/java/security/DigestOutputStream.java @@ -38,7 +38,7 @@ import java.io.ByteArrayOutputStream; * *

        To complete the message digest computation, call one of the * {@code digest} methods on the associated message - * digest after your calls to one of this digest ouput stream's + * digest after your calls to one of this digest output stream's * {@link #write(int) write} methods. * *

        It is possible to turn this stream on or off (see diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index 19c05a87d4f..80bf17da68f 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -1611,7 +1611,7 @@ public class KeyStore { * Returns the KeyStore described by this object. * * @return the {@code KeyStore} described by this object - * @exception KeyStoreException if an error occured during the + * @exception KeyStoreException if an error occurred during the * operation, for example if the KeyStore could not be * instantiated or loaded */ @@ -1627,7 +1627,7 @@ public class KeyStore { * the {@link KeyStore.Entry Entry} with the given alias. * @param alias the alias of the KeyStore entry * @throws NullPointerException if alias is null - * @throws KeyStoreException if an error occured during the + * @throws KeyStoreException if an error occurred during the * operation * @throws IllegalStateException if the getKeyStore method has * not been invoked prior to calling this method diff --git a/jdk/src/share/classes/java/security/ProtectionDomain.java b/jdk/src/share/classes/java/security/ProtectionDomain.java index 3e306edd376..ed57ce9a2ac 100644 --- a/jdk/src/share/classes/java/security/ProtectionDomain.java +++ b/jdk/src/share/classes/java/security/ProtectionDomain.java @@ -401,7 +401,7 @@ public class ProtectionDomain { if (perms != null && permissions != null) { // // Weed out the duplicates from the policy. Unless a refresh - // has occured since the pd was consed this should result in + // has occurred since the pd was consed this should result in // an empty vector. synchronized (permissions) { e = permissions.elements(); // domain vs policy diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java index ce99101e716..0db09da7061 100644 --- a/jdk/src/share/classes/java/security/Security.java +++ b/jdk/src/share/classes/java/security/Security.java @@ -496,7 +496,7 @@ public final class Security { *

      • {@literal . * :} *

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

        A provider satisfies this selection criterion iff the @@ -570,7 +570,7 @@ public final class Security { *

      • {@literal }. * {@literal } *

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

        The value associated with the key must be a non-empty string. diff --git a/jdk/src/share/classes/java/security/UnresolvedPermission.java b/jdk/src/share/classes/java/security/UnresolvedPermission.java index e6a6b36ed2a..6c400382dfe 100644 --- a/jdk/src/share/classes/java/security/UnresolvedPermission.java +++ b/jdk/src/share/classes/java/security/UnresolvedPermission.java @@ -441,7 +441,7 @@ implements java.io.Serializable * * @return the target name of the underlying permission that * has not been resolved, or {@code null}, - * if there is no targe name + * if there is no target name * * @since 1.5 */ diff --git a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java index c50a224861a..a545627061a 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java +++ b/jdk/src/share/classes/java/security/cert/CertificateRevokedException.java @@ -129,7 +129,7 @@ public class CertificateRevokedException extends CertificateException { } /** - * Returns the invalidity date, as specifed in the Invalidity Date + * Returns the invalidity date, as specified in the Invalidity Date * extension of this {@code CertificateRevokedException}. The * invalidity date is the date on which it is known or suspected that the * private key was compromised or that the certificate otherwise became diff --git a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java index 58843ab67da..4076fa6a39b 100644 --- a/jdk/src/share/classes/java/security/spec/ECFieldF2m.java +++ b/jdk/src/share/classes/java/security/spec/ECFieldF2m.java @@ -64,7 +64,7 @@ public class ECFieldF2m implements ECField { * field which has 2^{@code m} elements with * polynomial basis. * The reduction polynomial for this field is based - * on {@code rp} whose i-th bit correspondes to + * on {@code rp} whose i-th bit corresponds to * the i-th coefficient of the reduction polynomial.

        * Note: A valid reduction polynomial is either a * trinomial (X^{@code m} + X^{@code k} + 1 diff --git a/jdk/src/share/classes/java/sql/Array.java b/jdk/src/share/classes/java/sql/Array.java index 584c63ffaf9..81278144b10 100644 --- a/jdk/src/share/classes/java/sql/Array.java +++ b/jdk/src/share/classes/java/sql/Array.java @@ -323,7 +323,7 @@ public interface Array { * element at index index. The result set has * up to count rows in ascending order based on the * indices. Each row has two columns: The second column stores - * the element value; the first column stroes the index into the + * the element value; the first column stores the index into the * array for that element. * * @param index the array index of the first element to retrieve; diff --git a/jdk/src/share/classes/java/sql/BatchUpdateException.java b/jdk/src/share/classes/java/sql/BatchUpdateException.java index 4d41d471cff..9c0c072140c 100644 --- a/jdk/src/share/classes/java/sql/BatchUpdateException.java +++ b/jdk/src/share/classes/java/sql/BatchUpdateException.java @@ -143,7 +143,7 @@ public class BatchUpdateException extends SQLException { * initialized by a call to the * {@link Throwable#initCause(java.lang.Throwable)} method. The * SQLState is initialized to null - * and the vender code is initialized to 0. + * and the vendor code is initialized to 0. *

        * Note: There is no validation of {@code updateCounts} for * overflow and because of this it is recommended that you use the constructor diff --git a/jdk/src/share/classes/java/sql/Blob.java b/jdk/src/share/classes/java/sql/Blob.java index 90bb251c07b..ba65c4027d6 100644 --- a/jdk/src/share/classes/java/sql/Blob.java +++ b/jdk/src/share/classes/java/sql/Blob.java @@ -158,7 +158,7 @@ public interface Blob { * in the Blob object starting at the position * pos. If the end of the Blob value is reached * while writing the array of bytes, then the length of the Blob - * value will be increased to accomodate the extra bytes. + * value will be increased to accommodate the extra bytes. *

        * Note: If the value specified for pos * is greater then the length+1 of the BLOB value then the @@ -190,7 +190,7 @@ public interface Blob { * in the Blob object starting at the position * pos. If the end of the Blob value is reached * while writing the array of bytes, then the length of the Blob - * value will be increased to accomodate the extra bytes. + * value will be increased to accommodate the extra bytes. *

        * Note: If the value specified for pos * is greater then the length+1 of the BLOB value then the @@ -224,7 +224,7 @@ public interface Blob { * in the Blob object starting at the position * pos. If the end of the Blob value is reached * while writing to the stream, then the length of the Blob - * value will be increased to accomodate the extra bytes. + * value will be increased to accommodate the extra bytes. *

        * Note: If the value specified for pos * is greater then the length+1 of the BLOB value then the diff --git a/jdk/src/share/classes/java/sql/CallableStatement.java b/jdk/src/share/classes/java/sql/CallableStatement.java index a41aa10fa1e..9e593ae32db 100644 --- a/jdk/src/share/classes/java/sql/CallableStatement.java +++ b/jdk/src/share/classes/java/sql/CallableStatement.java @@ -1900,7 +1900,7 @@ public interface CallableStatement extends PreparedStatement { * @throws SQLException if parameterName does not correspond to a named * parameter; 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/java/sql/Clob.java b/jdk/src/share/classes/java/sql/Clob.java index 8ffc38af754..86bd1cc870c 100644 --- a/jdk/src/share/classes/java/sql/Clob.java +++ b/jdk/src/share/classes/java/sql/Clob.java @@ -172,7 +172,7 @@ public interface Clob { * in the Clob object starting at the position * pos. If the end of the Clob value is reached * while writing the given string, then the length of the Clob - * value will be increased to accomodate the extra characters. + * value will be increased to accommodate the extra characters. *

        * Note: If the value specified for pos * is greater then the length+1 of the CLOB value then the @@ -202,7 +202,7 @@ public interface Clob { * in the Clob object starting at the position * pos. If the end of the Clob value is reached * while writing the given string, then the length of the Clob - * value will be increased to accomodate the extra characters. + * value will be increased to accommodate the extra characters. *

        * Note: If the value specified for pos * is greater then the length+1 of the CLOB value then the @@ -235,7 +235,7 @@ public interface Clob { * in the Clob object starting at the position * pos. If the end of the Clob value is reached * while writing characters to the stream, then the length of the Clob - * value will be increased to accomodate the extra characters. + * value will be increased to accommodate the extra characters. *

        * Note: If the value specified for pos * is greater then the length+1 of the CLOB value then the @@ -264,7 +264,7 @@ public interface Clob { * in the Clob object starting at the position * pos. If the end of the Clob value is reached * while writing characters to the stream, then the length of the Clob - * value will be increased to accomodate the extra characters. + * value will be increased to accommodate the extra characters. *

        * Note: If the value specified for pos * is greater then the length+1 of the CLOB value then the diff --git a/jdk/src/share/classes/java/sql/Connection.java b/jdk/src/share/classes/java/sql/Connection.java index 3077c3c278c..19acac7fa61 100644 --- a/jdk/src/share/classes/java/sql/Connection.java +++ b/jdk/src/share/classes/java/sql/Connection.java @@ -242,7 +242,7 @@ public interface Connection extends Wrapper, AutoCloseable { * * @exception SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, - * if this method is called on a closed conection or this + * if this method is called on a closed connection or this * Connection object is in auto-commit mode * @see #setAutoCommit */ diff --git a/jdk/src/share/classes/java/sql/DataTruncation.java b/jdk/src/share/classes/java/sql/DataTruncation.java index 09d43ac6019..c21305c33f4 100644 --- a/jdk/src/share/classes/java/sql/DataTruncation.java +++ b/jdk/src/share/classes/java/sql/DataTruncation.java @@ -30,7 +30,7 @@ package java.sql; * (on writes) or reported as a * DataTruncation warning (on reads) * when a data values is unexpectedly truncated for reasons other than its having - * execeeded MaxFieldSize. + * exceeded MaxFieldSize. * *

        The SQLstate for a DataTruncation during read is 01004. *

        The SQLstate for a DataTruncation during write is 22001. @@ -107,7 +107,7 @@ public class DataTruncation extends SQLWarning { *

        This may be -1 if the column or parameter index is unknown, in * which case the parameter and read fields should be ignored. * - * @return the index of the truncated paramter or column value + * @return the index of the truncated parameter or column value */ public int getIndex() { return index; diff --git a/jdk/src/share/classes/java/sql/DatabaseMetaData.java b/jdk/src/share/classes/java/sql/DatabaseMetaData.java index 1ab6a60379d..11b013df863 100644 --- a/jdk/src/share/classes/java/sql/DatabaseMetaData.java +++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java @@ -1701,7 +1701,7 @@ public interface DatabaseMetaData extends Wrapper { *

        Only privileges matching the column name criteria are * returned. They are ordered by COLUMN_NAME and PRIVILEGE. * - *

        Each privilige description has the following columns: + *

        Each privilege description has the following columns: *

          *
        1. TABLE_CAT String {@code =>} table catalog (may be null) *
        2. TABLE_SCHEM String {@code =>} table schema (may be null) @@ -1747,7 +1747,7 @@ public interface DatabaseMetaData extends Wrapper { * TABLE_SCHEM, TABLE_NAME, * and PRIVILEGE. * - *

          Each privilige description has the following columns: + *

          Each privilege description has the following columns: *

            *
          1. TABLE_CAT String {@code =>} table catalog (may be null) *
          2. TABLE_SCHEM String {@code =>} table schema (may be null) @@ -3257,7 +3257,7 @@ public interface DatabaseMetaData extends Wrapper { boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException; /** - * Retrieves whether a SQLException while autoCommit is true inidcates + * Retrieves whether a SQLException while autoCommit is true indicates * that all open ResultSets are closed, even ones that are holdable. When a SQLException occurs while * autocommit is true, it is vendor specific whether the JDBC driver responds with a commit operation, a * rollback operation, or by doing neither a commit nor a rollback. A potential result of this difference diff --git a/jdk/src/share/classes/java/sql/DriverManager.java b/jdk/src/share/classes/java/sql/DriverManager.java index bd16f92de7b..53b4762d562 100644 --- a/jdk/src/share/classes/java/sql/DriverManager.java +++ b/jdk/src/share/classes/java/sql/DriverManager.java @@ -59,7 +59,7 @@ import sun.reflect.Reflection; * my.sql.Driver * * - *

            Applications no longer need to explictly load JDBC drivers using Class.forName(). Existing programs + *

            Applications no longer need to explicitly load JDBC drivers using Class.forName(). Existing programs * which currently load JDBC drivers using Class.forName() will continue to work without * modification. * diff --git a/jdk/src/share/classes/java/sql/DriverPropertyInfo.java b/jdk/src/share/classes/java/sql/DriverPropertyInfo.java index 6e78e0723fc..0a0b8702ca5 100644 --- a/jdk/src/share/classes/java/sql/DriverPropertyInfo.java +++ b/jdk/src/share/classes/java/sql/DriverPropertyInfo.java @@ -38,7 +38,7 @@ public class DriverPropertyInfo { /** * Constructs a DriverPropertyInfo object with a given * name and value. The description and choices - * are intialized to null and required is initialized + * are initialized to null and required is initialized * to false. * * @param name the name of the property diff --git a/jdk/src/share/classes/java/sql/PreparedStatement.java b/jdk/src/share/classes/java/sql/PreparedStatement.java index 83c005cee3d..20cde7fb985 100644 --- a/jdk/src/share/classes/java/sql/PreparedStatement.java +++ b/jdk/src/share/classes/java/sql/PreparedStatement.java @@ -856,7 +856,7 @@ public interface PreparedStatement extends Statement { * this method is called on a closed PreparedStatement; * 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 diff --git a/jdk/src/share/classes/java/sql/ResultSet.java b/jdk/src/share/classes/java/sql/ResultSet.java index 3b9bfbbfe09..5ac61d1d4c1 100644 --- a/jdk/src/share/classes/java/sql/ResultSet.java +++ b/jdk/src/share/classes/java/sql/ResultSet.java @@ -184,7 +184,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { *

            The closing of a ResultSet object does not close the Blob, * Clob or NClob objects created by the ResultSet. Blob, * Clob or NClob objects remain valid for at least the duration of the - * transaction in which they are creataed, unless their free method is invoked. + * transaction in which they are created, unless their free method is invoked. *

            * When a ResultSet is closed, any ResultSetMetaData * instances that were created by calling the getMetaData @@ -2423,7 +2423,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * DatabaseMetaData method, this method may return * null. * - * @return the Statment object that produced + * @return the Statement object that produced * this ResultSet object or null * if the result set was produced some other way * @exception SQLException if a database access error occurs @@ -2749,7 +2749,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { /** * The constant indicating that open ResultSet objects with this - * holdability will remain open when the current transaction is commited. + * holdability will remain open when the current transaction is committed. * * @since 1.4 */ @@ -2757,7 +2757,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { /** * The constant indicating that open ResultSet objects with this - * holdability will be closed when the current transaction is commited. + * holdability will be closed when the current transaction is committed. * * @since 1.4 */ diff --git a/jdk/src/share/classes/java/sql/SQLException.java b/jdk/src/share/classes/java/sql/SQLException.java index dfc5be33349..3b8c27a79d7 100644 --- a/jdk/src/share/classes/java/sql/SQLException.java +++ b/jdk/src/share/classes/java/sql/SQLException.java @@ -107,7 +107,7 @@ public class SQLException extends java.lang.Exception /** * Constructs a SQLException object with a given * reason. The SQLState is initialized to - * null and the vender code is initialized to 0. + * null and the vendor code is initialized to 0. * * The cause is not initialized, and may subsequently be * initialized by a call to the diff --git a/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java b/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java index 164c3181814..c15ff74fee6 100644 --- a/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java +++ b/jdk/src/share/classes/java/sql/SQLFeatureNotSupportedException.java @@ -60,7 +60,7 @@ public class SQLFeatureNotSupportedException extends SQLNonTransientException { /** * Constructs a SQLFeatureNotSupportedException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be @@ -118,7 +118,7 @@ public class SQLFeatureNotSupportedException extends SQLNonTransientException { * cause==null or to cause.toString() if * cause!=null. *

            - * @param cause the underlying reason for this SQLException (which is saved for later retrieval bythe getCause() method); may be null indicating + * @param cause the underlying reason for this SQLException (which is saved for later retrieval by the getCause() method); may be null indicating * the cause is non-existent or unknown. * @since 1.6 */ diff --git a/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java b/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java index 0f92ac50dfa..0fd5ca7b6e5 100644 --- a/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java +++ b/jdk/src/share/classes/java/sql/SQLIntegrityConstraintViolationException.java @@ -55,7 +55,7 @@ public class SQLIntegrityConstraintViolationException extends SQLNonTransientExc /** * Constructs a SQLIntegrityConstraintViolationException * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java b/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java index 0b4d206df96..74067f0abd6 100644 --- a/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java +++ b/jdk/src/share/classes/java/sql/SQLInvalidAuthorizationSpecException.java @@ -55,7 +55,7 @@ public class SQLInvalidAuthorizationSpecException extends SQLNonTransientExcepti /** * Constructs a SQLInvalidAuthorizationSpecException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java b/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java index 036c881f205..726a50529eb 100644 --- a/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java +++ b/jdk/src/share/classes/java/sql/SQLNonTransientConnectionException.java @@ -56,7 +56,7 @@ public class SQLNonTransientConnectionException extends java.sql.SQLNonTransient /** * Constructs a SQLNonTransientConnectionException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLNonTransientException.java b/jdk/src/share/classes/java/sql/SQLNonTransientException.java index 1e6889338be..e9e151da579 100644 --- a/jdk/src/share/classes/java/sql/SQLNonTransientException.java +++ b/jdk/src/share/classes/java/sql/SQLNonTransientException.java @@ -54,7 +54,7 @@ public class SQLNonTransientException extends java.sql.SQLException { /** * Constructs a SQLNonTransientException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLRecoverableException.java b/jdk/src/share/classes/java/sql/SQLRecoverableException.java index 08de9d7798a..9b7bdabccb3 100644 --- a/jdk/src/share/classes/java/sql/SQLRecoverableException.java +++ b/jdk/src/share/classes/java/sql/SQLRecoverableException.java @@ -56,7 +56,7 @@ public class SQLRecoverableException extends java.sql.SQLException { /** * Constructs a SQLRecoverableException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java b/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java index b65dec722c7..4b1f71b88fe 100644 --- a/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java +++ b/jdk/src/share/classes/java/sql/SQLSyntaxErrorException.java @@ -54,7 +54,7 @@ public class SQLSyntaxErrorException extends SQLNonTransientException { /** * Constructs a SQLSyntaxErrorException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be @@ -112,7 +112,7 @@ public class SQLSyntaxErrorException extends SQLNonTransientException { * cause==null or to cause.toString() if * cause!=null. *

            - * @param cause the underlying reason for this SQLException (which is saved for later retrieval bythe getCause() method); may be null indicating + * @param cause the underlying reason for this SQLException (which is saved for later retrieval by the getCause() method); may be null indicating * the cause is non-existent or unknown. * @since 1.6 */ diff --git a/jdk/src/share/classes/java/sql/SQLTimeoutException.java b/jdk/src/share/classes/java/sql/SQLTimeoutException.java index a55ee05a74d..3f9ed357d30 100644 --- a/jdk/src/share/classes/java/sql/SQLTimeoutException.java +++ b/jdk/src/share/classes/java/sql/SQLTimeoutException.java @@ -54,7 +54,7 @@ public class SQLTimeoutException extends SQLTransientException { /** * Constructs a SQLTimeoutException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java b/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java index 90eb702994b..f5fe1563787 100644 --- a/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java +++ b/jdk/src/share/classes/java/sql/SQLTransactionRollbackException.java @@ -54,7 +54,7 @@ public class SQLTransactionRollbackException extends SQLTransientException { /** * Constructs a SQLTransactionRollbackException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java b/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java index cebc67d67d4..538ca47b3f2 100644 --- a/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java +++ b/jdk/src/share/classes/java/sql/SQLTransientConnectionException.java @@ -55,7 +55,7 @@ public class SQLTransientConnectionException extends java.sql.SQLTransientExcept /** * Constructs a SQLTransientConnectionException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLTransientException.java b/jdk/src/share/classes/java/sql/SQLTransientException.java index 644be1b2764..f0e86d5b82b 100644 --- a/jdk/src/share/classes/java/sql/SQLTransientException.java +++ b/jdk/src/share/classes/java/sql/SQLTransientException.java @@ -27,7 +27,7 @@ package java.sql; /** * The subclass of {@link SQLException} is thrown in situations where a - * previoulsy failed operation might be able to succeed when the operation is + * previously failed operation might be able to succeed when the operation is * retried without any intervention by application-level functionality. *

            * @@ -53,7 +53,7 @@ public class SQLTransientException extends java.sql.SQLException { /** * Constructs a SQLTransientException object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLWarning.java b/jdk/src/share/classes/java/sql/SQLWarning.java index 944540c1f72..011a93ad3b1 100644 --- a/jdk/src/share/classes/java/sql/SQLWarning.java +++ b/jdk/src/share/classes/java/sql/SQLWarning.java @@ -86,7 +86,7 @@ public class SQLWarning extends SQLException { /** * Constructs a SQLWarning object * with a given reason. The SQLState - * is initialized to null and the vender code is initialized + * is initialized to null and the vendor code is initialized * to 0. * * The cause is not initialized, and may subsequently be diff --git a/jdk/src/share/classes/java/sql/SQLXML.java b/jdk/src/share/classes/java/sql/SQLXML.java index 65f38217c4f..b7e55220271 100644 --- a/jdk/src/share/classes/java/sql/SQLXML.java +++ b/jdk/src/share/classes/java/sql/SQLXML.java @@ -362,7 +362,7 @@ public interface SQLXML * * @param the type of the class modeled by this Class object * @param sourceClass The class of the source, or null. - * If the class is null, a vendor specifc Source implementation will be returned. + * If the class is null, a vendor specific Source implementation will be returned. * The following classes are supported at a minimum: *

                *   javax.xml.transform.dom.DOMSource - returns a DOMSource
            diff --git a/jdk/src/share/classes/java/sql/Statement.java b/jdk/src/share/classes/java/sql/Statement.java
            index ca347074b20..7c8cff8185d 100644
            --- a/jdk/src/share/classes/java/sql/Statement.java
            +++ b/jdk/src/share/classes/java/sql/Statement.java
            @@ -34,8 +34,8 @@ package java.sql;
              * ResultSet object is interleaved
              * with the reading of another, each must have been generated by
              * different Statement objects. All execution methods in the
            - * Statement interface implicitly close a statment's current
            - * ResultSet object if an open one exists.
            + * Statement interface implicitly close a current
            + * ResultSet object of the statement if an open one exists.
              *
              * @see Connection#createStatement
              * @see ResultSet
            @@ -445,7 +445,7 @@ public interface Statement extends Wrapper, AutoCloseable {
                 /**
                  * Gives the JDBC driver a hint as to the number of rows that should
                  * be fetched from the database when more rows are needed for
            -     * ResultSet objects genrated by this Statement.
            +     * ResultSet objects generated by this Statement.
                  * If the value specified is zero, then the hint is ignored.
                  * The default value is zero.
                  *
            @@ -501,7 +501,7 @@ public interface Statement extends Wrapper, AutoCloseable {
                 int getResultSetType()  throws SQLException;
             
                 /**
            -     * Adds the given SQL command to the current list of commmands for this
            +     * Adds the given SQL command to the current list of commands for this
                  * Statement object. The commands in this list can be
                  * executed as a batch by calling the method executeBatch.
                  * 

            @@ -567,8 +567,8 @@ public interface Statement extends Wrapper, AutoCloseable { *

            * The possible implementations and return values have been modified in * the Java 2 SDK, Standard Edition, version 1.3 to - * accommodate the option of continuing to proccess commands in a batch - * update after a BatchUpdateException obejct has been thrown. + * accommodate the option of continuing to process commands in a batch + * update after a BatchUpdateException object has been thrown. * * @return an array of update counts containing one element for each * command in the batch. The elements of the array are ordered according @@ -635,7 +635,7 @@ public interface Statement extends Wrapper, AutoCloseable { int SUCCESS_NO_INFO = -2; /** - * The constant indicating that an error occured while executing a + * The constant indicating that an error occurred while executing a * batch statement. * * @since 1.4 diff --git a/jdk/src/share/classes/java/sql/Struct.java b/jdk/src/share/classes/java/sql/Struct.java index 50261a6c89c..1b549616f5f 100644 --- a/jdk/src/share/classes/java/sql/Struct.java +++ b/jdk/src/share/classes/java/sql/Struct.java @@ -81,7 +81,7 @@ public interface Struct { /** * Produces the ordered values of the attributes of the SQL * structured type that this Struct object represents. - * As individual attrbutes are proccessed, this method uses the given type map + * As individual attributes are processed, this method uses the given type map * for customizations of the type mappings. * If there is no * entry in the given type map that matches the structured diff --git a/jdk/src/share/classes/java/sql/package.html b/jdk/src/share/classes/java/sql/package.html index d6c97126a2a..d60cb5354ce 100644 --- a/jdk/src/share/classes/java/sql/package.html +++ b/jdk/src/share/classes/java/sql/package.html @@ -221,7 +221,7 @@ The java.sql package contains API for the following:

          3. SQLException enhancements -- Added support for cause chaining; New SQLExceptions added for common SQLState class value codes
          4. Enhanced Blob/Clob functionality -- Support provided to create and free a Blob/Clob instance - as well as additional methods added to improve accessiblity + as well as additional methods added to improve accessibility
          5. Support added for accessing a SQL ROWID
          6. Support added to allow a JDBC application to access an instance of a JDBC resource that has been wrapped by a vendor, usually in an application server or connection diff --git a/jdk/src/share/classes/java/text/BreakIterator.java b/jdk/src/share/classes/java/text/BreakIterator.java index 7c1f4524b8e..f5e53c4d4f9 100644 --- a/jdk/src/share/classes/java/text/BreakIterator.java +++ b/jdk/src/share/classes/java/text/BreakIterator.java @@ -338,7 +338,7 @@ public abstract class BreakIterator implements Cloneable * Otherwise, the iterator's current position is set to the returned boundary. * The value returned is always less than the offset or the value * BreakIterator.DONE. - * @param offset the characater offset to begin scanning. + * @param offset the character offset to begin scanning. * @return The last boundary before the specified offset or * BreakIterator.DONE if the first text boundary is passed in * as the offset. diff --git a/jdk/src/share/classes/java/text/ChoiceFormat.java b/jdk/src/share/classes/java/text/ChoiceFormat.java index 8fcba9a92a9..f55837f8a4c 100644 --- a/jdk/src/share/classes/java/text/ChoiceFormat.java +++ b/jdk/src/share/classes/java/text/ChoiceFormat.java @@ -409,7 +409,7 @@ public class ChoiceFormat extends NumberFormat { * @param status an input-output parameter. On input, the * status.index field indicates the first character of the * source text that should be parsed. On exit, if no error - * occured, status.index is set to the first unparsed character + * occurred, status.index is set to the first unparsed character * in the source text. On exit, if an error did occur, * status.index is unchanged and status.errorIndex is set to the * first index of the character that caused the parse to fail. diff --git a/jdk/src/share/classes/java/text/DigitList.java b/jdk/src/share/classes/java/text/DigitList.java index 5f4321c025b..363306406eb 100644 --- a/jdk/src/share/classes/java/text/DigitList.java +++ b/jdk/src/share/classes/java/text/DigitList.java @@ -483,7 +483,7 @@ final class DigitList implements Cloneable { * * This has to be considered only if digit at maximumDigits index * is exactly the last one in the set of digits, otherwise there are - * remaining digits after that position and we dont have to consider + * remaining digits after that position and we don't have to consider * what FloatingDecimal did. * * - Other rounding modes are not impacted by these tie cases. @@ -570,7 +570,7 @@ final class DigitList implements Cloneable { return false; if (!allDecimalDigits) - // Otherwise if the digits dont represent exact value, + // Otherwise if the digits don't represent exact value, // value was above tie and FloatingDecimal truncated // digits to tie. We must round up. return true; diff --git a/jdk/src/share/classes/java/text/FieldPosition.java b/jdk/src/share/classes/java/text/FieldPosition.java index 300c7e89822..955221dee80 100644 --- a/jdk/src/share/classes/java/text/FieldPosition.java +++ b/jdk/src/share/classes/java/text/FieldPosition.java @@ -136,7 +136,7 @@ public class FieldPosition { * constant, fieldID should be -1. * * @param attribute Format.Field constant identifying a field - * @param fieldID integer constantce identifying a field + * @param fieldID integer constant identifying a field * @since 1.4 */ public FieldPosition(Format.Field attribute, int fieldID) { diff --git a/jdk/src/share/classes/java/text/Format.java b/jdk/src/share/classes/java/text/Format.java index 7a9c2ec4ddf..74fcc37d1bf 100644 --- a/jdk/src/share/classes/java/text/Format.java +++ b/jdk/src/share/classes/java/text/Format.java @@ -281,7 +281,7 @@ public abstract class Format implements Serializable, Cloneable { } /** - * Creates an AttributedCharacterIterator containg the + * Creates an AttributedCharacterIterator containing the * concatenated contents of the passed in * AttributedCharacterIterators. * diff --git a/jdk/src/share/classes/java/text/RuleBasedCollator.java b/jdk/src/share/classes/java/text/RuleBasedCollator.java index a99c0f757eb..53ebc7e7ef5 100644 --- a/jdk/src/share/classes/java/text/RuleBasedCollator.java +++ b/jdk/src/share/classes/java/text/RuleBasedCollator.java @@ -671,7 +671,7 @@ public class RuleBasedCollator extends Collator{ if (tables.isFrenchSec()) { if (preSecIgnore < secResult.length()) { - // If we've accumlated any secondary characters after the last base character, + // If we've accumulated any secondary characters after the last base character, // reverse them. RBCollationTables.reverse(secResult, preSecIgnore, secResult.length()); } diff --git a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java index 24e3a3a514c..e98f422bb3a 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java @@ -158,7 +158,7 @@ public interface ChronoZonedDateTime * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used as a query via method reference, {@code ChronoZonedDateTime::from}. * - * @param temporal the temporal objec t to convert, not null + * @param temporal the temporal object to convert, not null * @return the date-time, not null * @throws DateTimeException if unable to convert to a {@code ChronoZonedDateTime} * @see Chronology#zonedDateTime(TemporalAccessor) diff --git a/jdk/src/share/classes/java/time/zone/ZoneRules.java b/jdk/src/share/classes/java/time/zone/ZoneRules.java index 4ed12755c23..6d7c07bfb0e 100644 --- a/jdk/src/share/classes/java/time/zone/ZoneRules.java +++ b/jdk/src/share/classes/java/time/zone/ZoneRules.java @@ -899,7 +899,7 @@ public final class ZoneRules implements Serializable { return transArray[i]; } } - // use last from preceeding year + // use last from preceding year int lastHistoricYear = findYear(lastHistoric, lastHistoricOffset); if (--year > lastHistoricYear) { transArray = findTransitionArray(year); diff --git a/jdk/src/share/classes/java/util/Arrays.java b/jdk/src/share/classes/java/util/Arrays.java index 43463a5aff6..c620c81f572 100644 --- a/jdk/src/share/classes/java/util/Arrays.java +++ b/jdk/src/share/classes/java/util/Arrays.java @@ -1225,7 +1225,7 @@ public class Arrays { * *

            The implementation was adapted from Tim Peters's list sort for Python * ( - * TimSort). It uses techiques from Peter McIlroy's "Optimistic + * TimSort). It uses techniques from Peter McIlroy's "Optimistic * Sorting and Information Theoretic Complexity", in Proceedings of the * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * January 1993. @@ -1284,7 +1284,7 @@ public class Arrays { * *

            The implementation was adapted from Tim Peters's list sort for Python * ( - * TimSort). It uses techiques from Peter McIlroy's "Optimistic + * TimSort). It uses techniques from Peter McIlroy's "Optimistic * Sorting and Information Theoretic Complexity", in Proceedings of the * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * January 1993. @@ -1411,7 +1411,7 @@ public class Arrays { * *

            The implementation was adapted from Tim Peters's list sort for Python * ( - * TimSort). It uses techiques from Peter McIlroy's "Optimistic + * TimSort). It uses techniques from Peter McIlroy's "Optimistic * Sorting and Information Theoretic Complexity", in Proceedings of the * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * January 1993. @@ -1475,7 +1475,7 @@ public class Arrays { * *

            The implementation was adapted from Tim Peters's list sort for Python * ( - * TimSort). It uses techiques from Peter McIlroy's "Optimistic + * TimSort). It uses techniques from Peter McIlroy's "Optimistic * Sorting and Information Theoretic Complexity", in Proceedings of the * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, * January 1993. diff --git a/jdk/src/share/classes/java/util/Locale.java b/jdk/src/share/classes/java/util/Locale.java index 54050c65fa8..f1acc5bc87b 100644 --- a/jdk/src/share/classes/java/util/Locale.java +++ b/jdk/src/share/classes/java/util/Locale.java @@ -1836,7 +1836,7 @@ public final class Locale implements Cloneable, Serializable { * country
            * * depending on which fields are specified in the locale. If the - * language, sacript, country, and variant fields are all empty, + * language, script, country, and variant fields are all empty, * this function returns the empty string. * * @return The name of the locale appropriate to display. diff --git a/jdk/src/share/classes/java/util/MissingFormatWidthException.java b/jdk/src/share/classes/java/util/MissingFormatWidthException.java index af76ac5b273..bd7c5901599 100644 --- a/jdk/src/share/classes/java/util/MissingFormatWidthException.java +++ b/jdk/src/share/classes/java/util/MissingFormatWidthException.java @@ -28,7 +28,7 @@ package java.util; /** * Unchecked exception thrown when the format width is required. * - *

            Unless otherwise specified, passing a null argument to anyg + *

            Unless otherwise specified, passing a null argument to any * method or constructor in this class will cause a {@link * NullPointerException} to be thrown. * diff --git a/jdk/src/share/classes/java/util/PriorityQueue.java b/jdk/src/share/classes/java/util/PriorityQueue.java index 645497530a7..f2f870670bb 100644 --- a/jdk/src/share/classes/java/util/PriorityQueue.java +++ b/jdk/src/share/classes/java/util/PriorityQueue.java @@ -65,7 +65,7 @@ import java.util.function.Consumer; * java.util.concurrent.PriorityBlockingQueue} class. * *

            Implementation note: this implementation provides - * O(log(n)) time for the enqueing and dequeing methods + * O(log(n)) time for the enqueuing and dequeuing methods * ({@code offer}, {@code poll}, {@code remove()} and {@code add}); * linear time for the {@code remove(Object)} and {@code contains(Object)} * methods; and constant time for the retrieval methods diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java index e34c9b9f437..95948c5abcc 100644 --- a/jdk/src/share/classes/java/util/ResourceBundle.java +++ b/jdk/src/share/classes/java/util/ResourceBundle.java @@ -1254,7 +1254,7 @@ public abstract class ResourceBundle { *

            getBundle finds * foo/bar/Messages_fr.properties and creates a * ResourceBundle instance. Then, getBundle - * sets up its parent chain from the list of the candiate locales. Only + * sets up its parent chain from the list of the candidate locales. Only * foo/bar/Messages.properties is found in the list and * getBundle creates a ResourceBundle instance * that becomes the parent of the instance for @@ -2240,7 +2240,7 @@ public abstract class ResourceBundle { *

          7. For an input Locale with a variant value consisting * of multiple subtags separated by underscore, generate candidate * Locales by omitting the variant subtags one by one, then - * insert them after every occurence of Locales with the + * insert them after every occurrence of Locales with the * full variant value in the original list. For example, if the * the variant consists of two subtags V1 and V2: * @@ -2843,7 +2843,7 @@ public abstract class ResourceBundle { * and variant are the language, script, country, and variant * values of locale, respectively. Final component values that * are empty Strings are omitted along with the preceding '_'. When the - * script is empty, the script value is ommitted along with the preceding '_'. + * script is empty, the script value is omitted along with the preceding '_'. * If all of the values are empty strings, then baseName * is returned. * diff --git a/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java b/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java index 9a0346f6a52..a8f27ec8216 100644 --- a/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java +++ b/jdk/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java @@ -946,7 +946,7 @@ public class ArrayBlockingQueue extends AbstractQueue } /** - * Called whenever an interior remove (not at takeIndex) occured. + * Called whenever an interior remove (not at takeIndex) occurred. * * Notifies all iterators, and expunges any that are now stale. */ @@ -1305,7 +1305,7 @@ public class ArrayBlockingQueue extends AbstractQueue } /** - * Called whenever an interior remove (not at takeIndex) occured. + * Called whenever an interior remove (not at takeIndex) occurred. * * @return true if this iterator should be unlinked from itrs */ diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java index 62364d9f0ec..fed0aa4135f 100644 --- a/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java +++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java @@ -265,7 +265,7 @@ public class ConcurrentSkipListMap extends AbstractMap * highly contended cases. * * Unlike most skip-list implementations, index insertion and - * deletion here require a separate traversal pass occuring after + * deletion here require a separate traversal pass occurring after * the base-level action, to add or remove index nodes. This adds * to single-threaded overhead, but improves contended * multithreaded performance by narrowing interference windows, diff --git a/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java b/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java index 34d1d1a4fda..6047fd86088 100644 --- a/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java +++ b/jdk/src/share/classes/java/util/concurrent/ExecutorCompletionService.java @@ -161,7 +161,7 @@ public class ExecutorCompletionService implements CompletionService { * @param completionQueue the queue to use as the completion queue * normally one dedicated for use by this service. This * queue is treated as unbounded -- failed attempted - * {@code Queue.add} operations for completed taskes cause + * {@code Queue.add} operations for completed tasks cause * them not to be retrievable. * @throws NullPointerException if executor or completionQueue are {@code null} */ diff --git a/jdk/src/share/classes/java/util/jar/Manifest.java b/jdk/src/share/classes/java/util/jar/Manifest.java index b25165b3345..4e7da2ae853 100644 --- a/jdk/src/share/classes/java/util/jar/Manifest.java +++ b/jdk/src/share/classes/java/util/jar/Manifest.java @@ -63,7 +63,7 @@ public class Manifest implements Cloneable { * Constructs a new Manifest from the specified input stream. * * @param is the input stream containing manifest data - * @throws IOException if an I/O error has occured + * @throws IOException if an I/O error has occurred */ public Manifest(InputStream is) throws IOException { read(is); diff --git a/jdk/src/share/classes/java/util/regex/Pattern.java b/jdk/src/share/classes/java/util/regex/Pattern.java index bcdd90dcf12..e9a0c67f79d 100644 --- a/jdk/src/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/share/classes/java/util/regex/Pattern.java @@ -2438,7 +2438,7 @@ loop: for(int x=0, offset=0; xNote that the AccessibleRole class is also extensible, so diff --git a/jdk/src/share/classes/javax/accessibility/AccessibleText.java b/jdk/src/share/classes/javax/accessibility/AccessibleText.java index 1e37354673e..d4ed6643727 100644 --- a/jdk/src/share/classes/javax/accessibility/AccessibleText.java +++ b/jdk/src/share/classes/javax/accessibility/AccessibleText.java @@ -175,7 +175,7 @@ public interface AccessibleText { * If there is no selection, but there is * a caret, the start and end offsets will be the same. * - * @return the index into teh text of the end of the selection + * @return the index into the text of the end of the selection */ public int getSelectionEnd(); diff --git a/jdk/src/share/classes/javax/crypto/NullCipher.java b/jdk/src/share/classes/javax/crypto/NullCipher.java index 5c8d2f54735..f24ff0b8098 100644 --- a/jdk/src/share/classes/javax/crypto/NullCipher.java +++ b/jdk/src/share/classes/javax/crypto/NullCipher.java @@ -27,7 +27,7 @@ package javax.crypto; /** * The NullCipher class is a class that provides an - * "identity cipher" -- one that does not tranform the plaintext. As + * "identity cipher" -- one that does not transform the plain text. As * a consequence, the ciphertext is identical to the plaintext. All * initialization methods do nothing, while the blocksize is set to 1 * byte. diff --git a/jdk/src/share/classes/javax/crypto/NullCipherSpi.java b/jdk/src/share/classes/javax/crypto/NullCipherSpi.java index 2b310974aaf..23399a80921 100644 --- a/jdk/src/share/classes/javax/crypto/NullCipherSpi.java +++ b/jdk/src/share/classes/javax/crypto/NullCipherSpi.java @@ -30,7 +30,7 @@ import java.security.spec.*; /** * This class provides a delegate for the identity cipher - one that does not - * tranform the plaintext. + * transform the plain text. * * @author Li Gong * @see NullCipher diff --git a/jdk/src/share/classes/javax/imageio/IIOParam.java b/jdk/src/share/classes/javax/imageio/IIOParam.java index 02482c9e8e9..33bede6cdb6 100644 --- a/jdk/src/share/classes/javax/imageio/IIOParam.java +++ b/jdk/src/share/classes/javax/imageio/IIOParam.java @@ -95,7 +95,7 @@ public abstract class IIOParam { /** * An ImageTypeSpecifier to be used to generate a * destination image when reading, or to set the output color type - * when writing. If non has been setm the value will be + * when writing. If non has been set the value will be * null. By default, the value is null. */ protected ImageTypeSpecifier destinationType = null; diff --git a/jdk/src/share/classes/javax/imageio/ImageIO.java b/jdk/src/share/classes/javax/imageio/ImageIO.java index 62098779a72..e6345322301 100644 --- a/jdk/src/share/classes/javax/imageio/ImageIO.java +++ b/jdk/src/share/classes/javax/imageio/ImageIO.java @@ -102,7 +102,7 @@ public final class ImageIO { * into the registry for later retrieval. * *

            The exact set of locations searched depends on the - * implementation of the Java runtime enviroment. + * implementation of the Java runtime environment. * * @see ClassLoader#getResources */ @@ -1466,7 +1466,7 @@ public final class ImageIO { * it is the responsibility of the caller to close the stream, if desired. * * @param im a RenderedImage to be written. - * @param formatName a String containg the informal + * @param formatName a String containing the informal * name of the format. * @param output an ImageOutputStream to be written to. * @@ -1499,7 +1499,7 @@ public final class ImageIO { * discarded. * * @param im a RenderedImage to be written. - * @param formatName a String containg the informal + * @param formatName a String containing the informal * name of the format. * @param output a File to be written to. * @@ -1551,7 +1551,7 @@ public final class ImageIO { * getCacheDirectory will be used to control caching. * * @param im a RenderedImage to be written. - * @param formatName a String containg the informal + * @param formatName a String containing the informal * name of the format. * @param output an OutputStream to be written to. * diff --git a/jdk/src/share/classes/javax/imageio/ImageReader.java b/jdk/src/share/classes/javax/imageio/ImageReader.java index ebbb98324a0..b6b70216902 100644 --- a/jdk/src/share/classes/javax/imageio/ImageReader.java +++ b/jdk/src/share/classes/javax/imageio/ImageReader.java @@ -632,7 +632,7 @@ public abstract class ImageReader { * Returns the aspect ratio of the given image (that is, its width * divided by its height) as a float. For images * that are inherently resizable, this method provides a way to - * determine the appropriate width given a deired height, or vice + * determine the appropriate width given a desired height, or vice * versa. For non-resizable images, the true width and height * are used. * @@ -750,7 +750,7 @@ public abstract class ImageReader { * not associated with any particular image). If no such data * exists, null is returned. * - *

            The resuting metadata object is only responsible for + *

            The resulting metadata object is only responsible for * returning documents in the format named by * formatName. Within any documents that are * returned, only nodes whose names are members of @@ -855,7 +855,7 @@ public abstract class ImageReader { * if the reader does not support reading metadata or none * is available. * - *

            The resuting metadata object is only responsible for + *

            The resulting metadata object is only responsible for * returning documents in the format named by * formatName. Within any documents that are * returned, only nodes whose names are members of @@ -1435,7 +1435,7 @@ public abstract class ImageReader { * *

            This method is merely a convenience equivalent to calling * read(int, ImageReadParam) with a read param - * specifiying a source region having offsets of + * specifying a source region having offsets of * tileX*getTileWidth(imageIndex), * tileY*getTileHeight(imageIndex) and width and * height of getTileWidth(imageIndex), @@ -1948,7 +1948,7 @@ public abstract class ImageReader { * *

            The final results of decoding will be the same whether or * not intermediate updates are performed. Thus if only the final - * image is desired it may be perferable not to register any + * image is desired it may be preferable not to register any * IIOReadUpdateListeners. In general, progressive * updating is most effective when fetching images over a network * connection that is very slow compared to local CPU processing; diff --git a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java index adf4f3a9029..f903dd6f917 100644 --- a/jdk/src/share/classes/javax/imageio/ImageWriteParam.java +++ b/jdk/src/share/classes/javax/imageio/ImageWriteParam.java @@ -253,7 +253,7 @@ public class ImageWriteParam extends IIOParam { * false. Subclasses must set the value manually. * *

            Subclasses that do not support writing tiles, or that - * supprt writing but not offsetting tiles must ensure that this + * support writing but not offsetting tiles must ensure that this * value is set to false. */ protected boolean canOffsetTiles = false; @@ -803,7 +803,7 @@ public class ImageWriteParam extends IIOParam { * *

              *
            • MODE_DISABLED - No progression. Use this to - * turn off progession. + * turn off progression. * *
            • MODE_COPY_FROM_METADATA - The output image * will use whatever progression parameters are found in the diff --git a/jdk/src/share/classes/javax/imageio/ImageWriter.java b/jdk/src/share/classes/javax/imageio/ImageWriter.java index 1fdabdcd5f8..9c150b93de3 100644 --- a/jdk/src/share/classes/javax/imageio/ImageWriter.java +++ b/jdk/src/share/classes/javax/imageio/ImageWriter.java @@ -423,7 +423,7 @@ public abstract class ImageWriter implements ImageTranscoder { // Thumbnails /** - * Returns the number of thumbnails suported by the format being + * Returns the number of thumbnails supported by the format being * written, given the image type and any additional write * parameters and metadata objects that will be used during * encoding. A return value of -1 indicates that @@ -923,7 +923,7 @@ public abstract class ImageWriter implements ImageTranscoder { *

              The default implementation throws an * IllegalStateException if the output is * null, and otherwise returns false - * withour checking the value of imageIndex. + * without checking the value of imageIndex. * * @param imageIndex the index at which the image is to be * inserted. diff --git a/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java b/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java index 4f0423a753e..d3f455e10de 100644 --- a/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java +++ b/jdk/src/share/classes/javax/imageio/event/IIOReadProgressListener.java @@ -62,7 +62,7 @@ public interface IIOReadProgressListener extends EventListener { void sequenceStarted(ImageReader source, int minIndex); /** - * Reports that a sequence of read operationshas completed. + * Reports that a sequence of read operations has completed. * ImageReader implementations are required to call * this method exactly once from their * readAll(Iterator) method. diff --git a/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java b/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java index 6e49314127b..d5077682a90 100644 --- a/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java +++ b/jdk/src/share/classes/javax/imageio/event/IIOReadUpdateListener.java @@ -58,7 +58,7 @@ public interface IIOReadUpdateListener extends EventListener { * @param source the ImageReader object calling this * method. * @param theImage the BufferedImage being updated. - * @param pass the numer of the pass that is about to begin, + * @param pass the number of the pass that is about to begin, * starting with 0. * @param minPass the index of the first pass that will be decoded. * @param maxPass the index of the last pass that will be decoded. @@ -175,7 +175,7 @@ public interface IIOReadUpdateListener extends EventListener { * method. * @param theThumbnail the BufferedImage thumbnail * being updated. - * @param pass the numer of the pass that is about to begin, + * @param pass the number of the pass that is about to begin, * starting with 0. * @param minPass the index of the first pass that will be decoded. * @param maxPass the index of the last pass that will be decoded. diff --git a/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java b/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java index 72d4956b3ca..71a720b4e50 100644 --- a/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java +++ b/jdk/src/share/classes/javax/imageio/event/IIOReadWarningListener.java @@ -46,7 +46,7 @@ import javax.imageio.ImageReader; public interface IIOReadWarningListener extends EventListener { /** - * Reports the occurence of a non-fatal error in decoding. Decoding + * Reports the occurrence of a non-fatal error in decoding. Decoding * will continue following the call to this method. The application * may choose to display a dialog, print the warning to the console, * ignore the warning, or take any other action it chooses. diff --git a/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java b/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java index c39f0fed926..f7cde3e9758 100644 --- a/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java +++ b/jdk/src/share/classes/javax/imageio/event/IIOWriteWarningListener.java @@ -46,7 +46,7 @@ import javax.imageio.ImageWriter; public interface IIOWriteWarningListener extends EventListener { /** - * Reports the occurence of a non-fatal error in encoding. Encoding + * Reports the occurrence of a non-fatal error in encoding. Encoding * will continue following the call to this method. The application * may choose to display a dialog, print the warning to the console, * ignore the warning, or take any other action it chooses. diff --git a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java index 15a2e26d0a8..3040d64f7bd 100644 --- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java +++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadata.java @@ -45,7 +45,7 @@ import java.lang.reflect.Method; * is designed to encode its metadata losslessly. This format will * typically be designed specifically to work with a specific file * format, so that images may be loaded and saved in the same format - * with no loss of metadata, but may be less useful for transfering + * with no loss of metadata, but may be less useful for transferring * metadata between an ImageReader and an * ImageWriter for different image formats. To convert * between two native formats as losslessly as the image file formats @@ -130,9 +130,9 @@ public abstract class IIOMetadata { /** * Constructs an empty IIOMetadata object. The - * subclass is responsible for suppying values for all protected + * subclass is responsible for supplying values for all protected * instance variables that will allow any non-overridden default - * implemtations of methods to satisfy their contracts. For example, + * implementations of methods to satisfy their contracts. For example, * extraMetadataFormatNames should not have length 0. */ protected IIOMetadata() {} @@ -475,7 +475,7 @@ public abstract class IIOMetadata { * Alters the internal state of this IIOMetadata * object from a tree of XML DOM Nodes whose syntax * is defined by the given metadata format. The previous state is - * altered only as necessary to accomodate the nodes that are + * altered only as necessary to accommodate the nodes that are * present in the given tree. If the tree structure or contents * are invalid, an IIOInvalidTreeException will be * thrown. diff --git a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java index dff11b9d24e..08bc4f12d14 100644 --- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java +++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormat.java @@ -40,7 +40,7 @@ import javax.imageio.ImageTypeSpecifier; * *

              N.B: classes that implement this interface should contain a * method declared as public static getInstance() which - * returns an instance of the class. Commonly, an implentation will + * returns an instance of the class. Commonly, an implementation will * construct only a single instance and cache it for future * invocations of getInstance. * @@ -307,7 +307,7 @@ public interface IIOMetadataFormat { * with child policy CHILD_POLICY_REPEAT. For * example, an element representing color primary information * might be required to have at least 3 children, one for each - * primay. + * primary. * * @param elementName the name of the element being queried. * @@ -343,7 +343,7 @@ public interface IIOMetadataFormat { /** * Returns a String containing a description of the - * named element, or null. The desciption will be + * named element, or null. The description will be * localized for the supplied Locale if possible. * *

              If locale is null, the current @@ -434,8 +434,8 @@ public interface IIOMetadataFormat { /** * Returns one of the constants starting with * DATATYPE_, indicating the format and - * interpretation of the value of the given attribute within th - * enamed element. If getAttributeValueType returns + * interpretation of the value of the given attribute within the + * named element. If getAttributeValueType returns * VALUE_LIST, then the legal value is a * whitespace-spearated list of values of the returned datatype. * @@ -460,7 +460,7 @@ public interface IIOMetadataFormat { * @param elementName the name of the element being queried. * @param attrName the name of the attribute being queried. * - * @return true if the attribut must be present. + * @return true if the attribute must be present. * * @exception IllegalArgumentException if elementName * is null or is not a legal element name for this @@ -473,7 +473,7 @@ public interface IIOMetadataFormat { /** * Returns the default value of the named attribute, if it is not - * explictly present within the named element, as a + * explicitly present within the named element, as a * String, or null if no default value * is available. * @@ -624,7 +624,7 @@ public interface IIOMetadataFormat { /** * Returns a String containing a description of the - * named attribute, or null. The desciption will be + * named attribute, or null. The description will be * localized for the supplied Locale if possible. * *

              If locale is null, the current @@ -725,7 +725,7 @@ public interface IIOMetadataFormat { * VALUE_ENUMERATION. * *

              The Object associated with a node that accepts - * emuerated values must be equal to one of the values returned by + * enumerated values must be equal to one of the values returned by * this method, as defined by the == operator (as * opposed to the Object.equals method). * diff --git a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java index 4ca4f74c4a0..ef7caf3313e 100644 --- a/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java +++ b/jdk/src/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java @@ -234,7 +234,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { * name will be equal to this.getClass().getName() + * "Resources". * - * @param resourceBaseName a String containg the new + * @param resourceBaseName a String containing the new * base name. * * @exception IllegalArgumentException if @@ -381,7 +381,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { * * @param parentName the name of the element that will be the * new parent of the element. - * @param elementName the name of the element to be addded as a + * @param elementName the name of the element to be added as a * child. * * @exception IllegalArgumentException if elementName @@ -991,7 +991,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { /** * Returns a String containing a description of the - * named element, or null. The desciption will be + * named element, or null. The description will be * localized for the supplied Locale if possible. * *

              The default implementation will first locate a @@ -1129,7 +1129,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { /** * Returns a String containing a description of the - * named attribute, or null. The desciption will be + * named attribute, or null. The description will be * localized for the supplied Locale if possible. * *

              The default implementation will first locate a diff --git a/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html b/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html index 2e515879edb..4b909e66162 100644 --- a/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html +++ b/jdk/src/share/classes/javax/imageio/metadata/doc-files/standard_metadata.html @@ -228,7 +228,7 @@ following DTD: <!-- Data type: Float --> <!ELEMENT "HorizontalPixelOffset" EMPTY> - <!-- The horizonal position, in pixels, where the image should be + <!-- The horizontal position, in pixels, where the image should be rendered onto a raster display --> <!ATTLIST "HorizontalPixelOffset" "value" #CDATA #REQUIRED> <!-- Data type: Integer --> diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java index 4d4ccec0fa6..36d08e6cfdb 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java +++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java @@ -341,7 +341,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { * @exception IOException if the attempt to instantiate * the reader fails. * @exception IllegalArgumentException if the - * ImageReader's contructor throws an + * ImageReader's constructor throws an * IllegalArgumentException to indicate that the * extension object is unsuitable. */ diff --git a/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java index 63719d415b9..60c049d1eb4 100644 --- a/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java +++ b/jdk/src/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java @@ -538,7 +538,7 @@ public abstract class ImageReaderWriterSpi extends IIOServiceProvider { * Returns an IIOMetadataFormat object describing the * given image metadata format, or null if no * description is available. The supplied name must be the native - * iamge metadata format name, the standard metadata format name, + * image metadata format name, the standard metadata format name, * or one of those returned by * getExtraImageMetadataFormatNames. * diff --git a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java index ebf984a9ddc..822971f18a4 100644 --- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java +++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java @@ -550,7 +550,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param s an array of shorts to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within s to write to. * @param len the maximum number of shorts to read. * * @exception IndexOutOfBoundsException if off is @@ -575,7 +575,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param c an array of chars to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within c to write to. * @param len the maximum number of chars to read. * * @exception IndexOutOfBoundsException if off is @@ -600,7 +600,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param i an array of ints to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within i to write to. * @param len the maximum number of ints to read. * * @exception IndexOutOfBoundsException if off is @@ -625,7 +625,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param l an array of longs to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within l to write to. * @param len the maximum number of longs to read. * * @exception IndexOutOfBoundsException if off is @@ -650,7 +650,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param f an array of floats to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within f to write to. * @param len the maximum number of floats to read. * * @exception IndexOutOfBoundsException if off is @@ -675,7 +675,7 @@ public interface ImageInputStream extends DataInput, Closeable { * the read occurs. * * @param d an array of doubles to be written to. - * @param off the starting position withinb to write to. + * @param off the starting position within d to write to. * @param len the maximum number of doubles to read. * * @exception IndexOutOfBoundsException if off is @@ -904,7 +904,7 @@ public interface ImageInputStream extends DataInput, Closeable { /** * Discards the initial portion of the stream prior to the - * indicated postion. Attempting to seek to an offset within the + * indicated position. Attempting to seek to an offset within the * flushed portion of the stream will result in an * IndexOutOfBoundsException. * diff --git a/jdk/src/share/classes/javax/management/relation/RelationService.java b/jdk/src/share/classes/javax/management/relation/RelationService.java index dce1fe4ed1a..6ea329a6d13 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationService.java +++ b/jdk/src/share/classes/javax/management/relation/RelationService.java @@ -132,7 +132,7 @@ public class RelationService extends NotificationBroadcasterSupport private MBeanServer myMBeanServer = null; // Filter registered in the MBean Server with the Relation Service to be - // informed of referenced MBean unregistrations + // informed of referenced MBean deregistrations private MBeanServerNotificationFilter myUnregNtfFilter = null; // List of unregistration notifications received (storage used if purge @@ -2108,7 +2108,7 @@ public class RelationService extends NotificationBroadcasterSupport *

              Will check the role according to its corresponding role definition * provided in relation's relation type *

              The Relation Service will keep track of the change to keep the - * consistency of relations by handling referenced MBean unregistrations. + * consistency of relations by handling referenced MBean deregistrations. * * @param relationId relation id * @param role role to be set (name and new value) @@ -2220,7 +2220,7 @@ public class RelationService extends NotificationBroadcasterSupport *

              Will check the role according to its corresponding role definition * provided in relation's relation type *

              The Relation Service keeps track of the changes to keep the - * consistency of relations by handling referenced MBean unregistrations. + * consistency of relations by handling referenced MBean deregistrations. * * @param relationId relation id * @param roleList list of roles to be set @@ -2831,7 +2831,7 @@ public class RelationService extends NotificationBroadcasterSupport } // Updates the listener registered to the MBean Server to be informed of - // referenced MBean unregistrations + // referenced MBean deregistrations // // -param newRefList ArrayList of ObjectNames for new references done // to MBeans (can be null) diff --git a/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java b/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java index 1c668e6785a..48dde4be3f4 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java +++ b/jdk/src/share/classes/javax/management/relation/RelationServiceMBean.java @@ -699,7 +699,7 @@ public interface RelationServiceMBean { *

              Will check the role according to its corresponding role definition * provided in relation's relation type *

              The Relation Service will keep track of the change to keep the - * consistency of relations by handling referenced MBean unregistrations. + * consistency of relations by handling referenced MBean deregistrations. * * @param relationId relation id * @param role role to be set (name and new value) @@ -742,7 +742,7 @@ public interface RelationServiceMBean { *

              Will check the role according to its corresponding role definition * provided in relation's relation type *

              The Relation Service keeps track of the changes to keep the - * consistency of relations by handling referenced MBean unregistrations. + * consistency of relations by handling referenced MBean deregistrations. * * @param relationId relation id * @param roleList list of roles to be set diff --git a/jdk/src/share/classes/javax/management/remote/rmi/package.html b/jdk/src/share/classes/javax/management/remote/rmi/package.html index 8492a05bebf..4306c292e18 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/package.html +++ b/jdk/src/share/classes/javax/management/remote/rmi/package.html @@ -95,7 +95,7 @@ questions. rmi or iiop in the protocol part of the serviceURL when creating the connector server. You - can also create specialised connector servers by instantiating + can also create specialized connector servers by instantiating an appropriate subclass of {@link javax.management.remote.rmi.RMIServerImpl RMIServerImpl} and supplying it to the RMIConnectorServer diff --git a/jdk/src/share/classes/javax/naming/Binding.java b/jdk/src/share/classes/javax/naming/Binding.java index 5b7f3b85faa..5206dd0899b 100644 --- a/jdk/src/share/classes/javax/naming/Binding.java +++ b/jdk/src/share/classes/javax/naming/Binding.java @@ -48,7 +48,7 @@ package javax.naming; public class Binding extends NameClassPair { /** * Contains this binding's object. - * It is initialized by the constuctor and can be updated using + * It is initialized by the constructor and can be updated using * setObject. * @serial * @see #getObject diff --git a/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java b/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java index 45535b325f0..3ef840c85e3 100644 --- a/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java +++ b/jdk/src/share/classes/javax/naming/InsufficientResourcesException.java @@ -30,7 +30,7 @@ package javax.naming; * the requested operation. This might due to a lack of resources on * the server or on the client. There are no restrictions to resource types, * as different services might make use of different resources. Such - * restrictions might be due to physical limits and/or adminstrative quotas. + * restrictions might be due to physical limits and/or administrative quotas. * Examples of limited resources are internal buffers, memory, network bandwidth. *

              * InsufficientResourcesException is different from LimitExceededException in that diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapName.java b/jdk/src/share/classes/javax/naming/ldap/LdapName.java index ce94537062d..cde2b6a13e2 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java @@ -432,7 +432,7 @@ public class LdapName implements Name { * Adds the components of a name -- in order -- at a specified position * within this name. Components of this LDAP name at or after the * index (if any) of the first new component are shifted up - * (away from index 0) to accomodate the new components. + * (away from index 0) to accommodate the new components. * * @param suffix The non-null components to add. * @param posn The index at which to add the new component. @@ -467,7 +467,7 @@ public class LdapName implements Name { * Adds the RDNs of a name -- in order -- at a specified position * within this name. RDNs of this LDAP name at or after the * index (if any) of the first new RDN are shifted up (away from index 0) to - * accomodate the new RDNs. + * accommodate the new RDNs. * * @param suffixRdns The non-null suffix Rdns to add. * @param posn The index at which to add the suffix RDNs. diff --git a/jdk/src/share/classes/javax/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java index 93ebf339914..a78fda3af4e 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java +++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java @@ -116,7 +116,7 @@ public class Rdn implements Serializable, Comparable { * Constructs an Rdn from the given attribute set. See * {@link javax.naming.directory.Attributes Attributes}. *

              - * The string attribute values are not interpretted as + * The string attribute values are not interpreted as * RFC 2253 * formatted RDN strings. That is, the values are used * literally (not parsed) and assumed to be unescaped. @@ -179,7 +179,7 @@ public class Rdn implements Serializable, Comparable { /** * Constructs an Rdn from the given attribute type and * value. - * The string attribute values are not interpretted as + * The string attribute values are not interpreted as * RFC 2253 * formatted RDN strings. That is, the values are used * literally (not parsed) and assumed to be unescaped. @@ -215,7 +215,7 @@ public class Rdn implements Serializable, Comparable { /* * Adds the given attribute type and value to this Rdn. - * The string attribute values are not interpretted as + * The string attribute values are not interpreted as * RFC 2253 * formatted RDN strings. That is the values are used * literally (not parsed) and assumed to be unescaped. @@ -343,7 +343,7 @@ public class Rdn implements Serializable, Comparable { * components in multi-valued Rdns (such as "ou=Sales+cn=Bob") is not * significant. *

              - * Type and value equalilty matching is done as below: + * Type and value equality matching is done as below: *

                *
              • The types are compared for equality with their case ignored. *
              • String values with different but equivalent usage of quoting, @@ -605,7 +605,7 @@ public class Rdn implements Serializable, Comparable { --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. if (end != chars.length && @@ -662,7 +662,7 @@ public class Rdn implements Serializable, Comparable { } // 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 = builder.length(); if (isWhitespace(builder.charAt(len - 1)) && esc != (end - 1)) { builder.setLength(len - 1); diff --git a/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java b/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java index b6b4087b7e5..380a525a474 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLPeerUnverifiedException.java @@ -46,7 +46,7 @@ class SSLPeerUnverifiedException extends SSLException /** * Constructs an exception reporting that the SSL peer's - * identity has not been verifiied. + * identity has not been verified. * * @param reason describes the problem. */ diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java index 58f943ace5d..0945fc0d320 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java @@ -78,7 +78,7 @@ import java.net.*; * * *

                If handshaking fails for any reason, the SSLSocket - * is closed, and no futher communications can be done. + * is closed, and no further communications can be done. * *

                There are two groups of cipher suites which you will need to know * about when managing cipher suites:

                  diff --git a/jdk/src/share/classes/javax/print/CancelablePrintJob.java b/jdk/src/share/classes/javax/print/CancelablePrintJob.java index 4c72fe76563..30f15294495 100644 --- a/jdk/src/share/classes/javax/print/CancelablePrintJob.java +++ b/jdk/src/share/classes/javax/print/CancelablePrintJob.java @@ -55,7 +55,7 @@ public interface CancelablePrintJob extends DocPrintJob { * Stops further processing of a print job. *

                  * If a service supports this method it cannot be concluded that - * job cancellation will always suceeed. A job may not be able to be + * job cancellation will always succeed. A job may not be able to be * cancelled once it has reached and passed some point in its processing. * A successful cancellation means only that the entire job was not * printed, some portion may already have printed when cancel returns. diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index c5d96af423e..0cdcda324ea 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -95,7 +95,7 @@ import java.io.Serializable; *

                    *
                  • * Character array (char[]) -- The print data consists of the - * Unicde characters in the array. + * Unicode characters in the array. *

                    *

                  • * String -- @@ -163,7 +163,7 @@ import java.io.Serializable; * Every instance of the Java virtual machine has a default character encoding * determined during virtual-machine startup and typically depends upon the * locale and charset being used by the underlying operating system. - * In a distributed environment there is no gurantee that two VM's share + * In a distributed environment there is no guarantee that two VM share * the same default encoding. Thus clients which want to stream platform * encoded text data from the host platform to a Java Print Service instance * must explicitly declare the charset and not rely on defaults. diff --git a/jdk/src/share/classes/javax/print/DocPrintJob.java b/jdk/src/share/classes/javax/print/DocPrintJob.java index 9c51acea4aa..1a661f67860 100644 --- a/jdk/src/share/classes/javax/print/DocPrintJob.java +++ b/jdk/src/share/classes/javax/print/DocPrintJob.java @@ -102,7 +102,7 @@ public interface DocPrintJob { * specific job attribute should verify it is in that set, but * updates about an attribute will be made only if it changes and this * is detected by the job. Also updates may be subject to batching - * by the job. To minimise overhead in print job processing it is + * by the job. To minimize overhead in print job processing it is * recommended to listen on only that subset of attributes which * are likely to change. * If the specified set is empty no attribute updates will be reported diff --git a/jdk/src/share/classes/javax/print/MultiDoc.java b/jdk/src/share/classes/javax/print/MultiDoc.java index 4813a59931b..a7ded912521 100644 --- a/jdk/src/share/classes/javax/print/MultiDoc.java +++ b/jdk/src/share/classes/javax/print/MultiDoc.java @@ -117,7 +117,7 @@ public interface MultiDoc { * @return Current doc object. * * @exception IOException - * Thrown if a error ocurred reading the document. + * Thrown if a error occurred reading the document. */ public Doc getDoc() throws IOException; diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java index 04ad21345f5..f70d19d6c6d 100644 --- a/jdk/src/share/classes/javax/print/PrintService.java +++ b/jdk/src/share/classes/javax/print/PrintService.java @@ -118,7 +118,7 @@ public interface PrintService { /** * Gets the value of the single specified service attribute. * This may be useful to clients which only need the value of one - * attribute and want to minimise overhead. + * attribute and want to minimize overhead. * @param category the category of a PrintServiceAttribute supported * by this service - may not be null. * @return the value of the supported attribute or null if the diff --git a/jdk/src/share/classes/javax/print/attribute/package.html b/jdk/src/share/classes/javax/print/attribute/package.html index 7c848c5b296..661cbc2becd 100644 --- a/jdk/src/share/classes/javax/print/attribute/package.html +++ b/jdk/src/share/classes/javax/print/attribute/package.html @@ -1,3 +1,4 @@ + javax.print.attribute package @@ -30,7 +31,6 @@ questions. Provides classes and interfaces that describe the types of JavaTM Print Service attributes and how they can be collected into attribute sets. -

                    What is an Attribute?

                    When setting up a print job, a client specifies two things: @@ -71,7 +71,6 @@ of the results of a print job. The print job determines the manner in which it achieves the results specified by the processing instructions. Representing processing instructions as descriptive items provides more flexibility for implementing print jobs. -

                    Attribute Categories and Values

                    Each printer has a set of capabilities, such as the ability to print on different paper sizes or the ability to print more than one copy. Each of @@ -222,7 +221,6 @@ one concrete implementation of each of the attribute set subinterfaces: All of these classes extend HashAttributeSet and enforce the restriction that the attribute set is only allowed to contain the corresponding kind of attribute. -

                    Attribute Class Design

                    An attribute value is a small, atomic data item, such as an integer or an enumerated value. The Java Print Service API @@ -299,8 +297,8 @@ certain contexts also implements one or more subinterfaces of Attribute. Most attribute classes also extend the appropriate abstract syntax class to get the implementation. Consider the Sides attribute class: -
                     
                    +
                     public class Sides
                       extends EnumSyntax
                       implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
                    @@ -311,8 +309,8 @@ public class Sides
                         }
                       ...
                       }
                    -
                    +

                    Since every attribute class implements Attribute, every attribute class must provide an implementation for the @@ -363,9 +361,8 @@ because print-request attributes are the types of attributes that client usually specifies. This example demonstrates creating an attribute set of print-request attributes and locating a printer that can print the document according to the specified attributes: -

                    -

                     
                    +
                     
                     FileInputStream psStream;
                     try {
                    @@ -392,8 +389,8 @@ if (services.length > 0) {
                     	job.print(myDoc, aset);
                        } catch (PrintException pe) {}
                     }
                    -
                    +

                    Please note: In the javax.print APIs, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningful diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java index ba659e6c17e..9acda4fafd8 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaTray.java @@ -55,7 +55,7 @@ public class MediaTray extends Media implements Attribute { public static final MediaTray TOP = new MediaTray(0); /** - * The middle input tray in the printe. + * The middle input tray in the printer. */ public static final MediaTray MIDDLE = new MediaTray(1); diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java index 88e3a445cd0..6d151f8acf4 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/PresentationDirection.java @@ -56,56 +56,56 @@ public final class PresentationDirection extends EnumSyntax /** * Pages are laid out in columns starting at the top left, - * proceeeding towards the bottom {@literal &} right. + * proceeding towards the bottom {@literal &} right. */ public static final PresentationDirection TOBOTTOM_TORIGHT = new PresentationDirection(0); /** * Pages are laid out in columns starting at the top right, - * proceeeding towards the bottom {@literal &} left. + * proceeding towards the bottom {@literal &} left. */ public static final PresentationDirection TOBOTTOM_TOLEFT = new PresentationDirection(1); /** * Pages are laid out in columns starting at the bottom left, - * proceeeding towards the top {@literal &} right. + * proceeding towards the top {@literal &} right. */ public static final PresentationDirection TOTOP_TORIGHT = new PresentationDirection(2); /** * Pages are laid out in columns starting at the bottom right, - * proceeeding towards the top {@literal &} left. + * proceeding towards the top {@literal &} left. */ public static final PresentationDirection TOTOP_TOLEFT = new PresentationDirection(3); /** * Pages are laid out in rows starting at the top left, - * proceeeding towards the right {@literal &} bottom. + * proceeding towards the right {@literal &} bottom. */ public static final PresentationDirection TORIGHT_TOBOTTOM = new PresentationDirection(4); /** * Pages are laid out in rows starting at the bottom left, - * proceeeding towards the right {@literal &} top. + * proceeding towards the right {@literal &} top. */ public static final PresentationDirection TORIGHT_TOTOP = new PresentationDirection(5); /** * Pages are laid out in rows starting at the top right, - * proceeeding towards the left {@literal &} bottom. + * proceeding towards the left {@literal &} bottom. */ public static final PresentationDirection TOLEFT_TOBOTTOM = new PresentationDirection(6); /** * Pages are laid out in rows starting at the bottom right, - * proceeeding towards the left {@literal &} top. + * proceeding towards the left {@literal &} top. */ public static final PresentationDirection TOLEFT_TOTOP = new PresentationDirection(7); diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java index c0b8d664062..d6628a07299 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java @@ -39,7 +39,7 @@ import javax.print.attribute.PrintServiceAttribute; * will accept jobs even when the {@link PrinterState PrinterState} is STOPPED. *

                    * IPP Compatibility: The IPP boolean value is "true" for ACCEPTING_JOBS - * and "false" for NOT_ACCEPTING_JOBS. TThe category name returned by + * and "false" for NOT_ACCEPTING_JOBS. The category name returned by * getName() is the IPP attribute name. The enumeration's * integer value is the IPP enum value. The toString() method * returns the IPP string representation of the attribute value. @@ -59,7 +59,7 @@ public final class PrinterIsAcceptingJobs extends EnumSyntax NOT_ACCEPTING_JOBS = new PrinterIsAcceptingJobs(0); /** - * The printer is currently acccepting jobs. + * The printer is currently accepting jobs. */ public static final PrinterIsAcceptingJobs ACCEPTING_JOBS = new PrinterIsAcceptingJobs(1); diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java index 64e0e380664..b461a5d0dad 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReason.java @@ -50,7 +50,7 @@ import javax.print.attribute.Attribute; * object to the Print Service's * {@link PrinterStateReasons PrinterStateReasons} attribute when the * corresponding condition becomes true of the printer, and the printer - * removesthe PrinterStateReason object again when the corresponding + * removes the PrinterStateReason object again when the corresponding * condition becomes false, regardless of whether the Print Service's overall * {@link PrinterState PrinterState} also changed. *

                    diff --git a/jdk/src/share/classes/javax/print/attribute/standard/package.html b/jdk/src/share/classes/javax/print/attribute/standard/package.html index b71b72b79bb..540f8ede65a 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/package.html +++ b/jdk/src/share/classes/javax/print/attribute/standard/package.html @@ -1,3 +1,4 @@ + javax.print.attribute.standard package @@ -199,7 +200,6 @@ never appear in attribute sets, so there is no restricted AttributeSet subinterface for them. -

                    Attribute Table

                    The table below lists all the printing attributes. @@ -213,7 +213,6 @@ the column marked "SupportedValuesAttribute" lists the supported-values attribute class, if any, with which a print service indicates the supported values for that attribute category. -

      +
      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/javax/print/event/package.html b/jdk/src/share/classes/javax/print/event/package.html index 4074b949cb3..69c54bda2d8 100644 --- a/jdk/src/share/classes/javax/print/event/package.html +++ b/jdk/src/share/classes/javax/print/event/package.html @@ -1,3 +1,4 @@ +javax.print.event package @@ -30,7 +31,7 @@ questions. Package javax.print.event contains event classes and listener interfaces.

      They may be used to monitor both print services (such as printers going -on-line & off-line), and the progress of a specific print job. +on-line & off-line), and the progress of a specific print job.

      Please note: In the javax.print APIs, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningful diff --git a/jdk/src/share/classes/javax/print/package.html b/jdk/src/share/classes/javax/print/package.html index df8c04573c6..0f195be3866 100644 --- a/jdk/src/share/classes/javax/print/package.html +++ b/jdk/src/share/classes/javax/print/package.html @@ -1,3 +1,4 @@ + javax.print package @@ -52,7 +53,7 @@ such as IPP printers or JINI printers, a print-service provider can write implementations of PrintServiceLookup. The print-service provider can dynamically install these PrintServiceLookup implementations using the - + SPI JAR file specification.

      Attribute Definitions

      @@ -69,7 +70,7 @@ of which are implementations of attributes specified in the IETF Specification, RFC 2911 Internet Printing Protocol, 1.1: Model and Semantics, dated September 2000. The attributes specified in javax.print.attribute.standard -include common capabilites, such as: resolution, copies, media sizes, +include common capabilities, such as: resolution, copies, media sizes, job priority, and page ranges.

      Document Type Specification

      @@ -105,9 +106,8 @@ Service API: locating printers that can print five double-sided copies of a Postscript document on size A4 paper, creating a print job from one of the returned print services, and calling print. -

      -

       
      +
       FileInputStream psStream;
       try {
          psStream = new FileInputStream("file.ps");
      @@ -132,8 +132,8 @@ if (services.length > 0) {
       	job.print(myDoc, aset);
          } catch (PrintException pe) {}
       }
      -
      +

      Please note: In the javax.print APIs, a null reference parameter to methods is incorrect unless explicitly documented on the method as having a meaningful diff --git a/jdk/src/share/classes/javax/script/AbstractScriptEngine.java b/jdk/src/share/classes/javax/script/AbstractScriptEngine.java index a9c15522777..a0db613db13 100644 --- a/jdk/src/share/classes/javax/script/AbstractScriptEngine.java +++ b/jdk/src/share/classes/javax/script/AbstractScriptEngine.java @@ -255,7 +255,7 @@ public abstract class AbstractScriptEngine implements ScriptEngine { * * @param script A String containing the source of the script. * @return The return value from eval(String, ScriptContext) - * @throws ScriptException if an error occurrs in script. + * @throws ScriptException if an error occurs in script. * @throws NullPointerException if any of the parameters is null. */ public Object eval(String script) throws ScriptException { diff --git a/jdk/src/share/classes/javax/script/CompiledScript.java b/jdk/src/share/classes/javax/script/CompiledScript.java index 9186d919fb8..50175656d48 100644 --- a/jdk/src/share/classes/javax/script/CompiledScript.java +++ b/jdk/src/share/classes/javax/script/CompiledScript.java @@ -36,7 +36,7 @@ import java.util.Map; * Each CompiledScript is associated with a ScriptEngine -- A call to an eval * method of the CompiledScript causes the execution of the script by the * ScriptEngine. Changes in the state of the ScriptEngine caused by execution - * of tne CompiledScript may visible during subsequent executions of scripts by the engine. + * of the CompiledScript may visible during subsequent executions of scripts by the engine. * * @author Mike Grogan * @since 1.6 diff --git a/jdk/src/share/classes/javax/script/Invocable.java b/jdk/src/share/classes/javax/script/Invocable.java index 81d363c01e9..1fda248a521 100644 --- a/jdk/src/share/classes/javax/script/Invocable.java +++ b/jdk/src/share/classes/javax/script/Invocable.java @@ -51,7 +51,7 @@ public interface Invocable { * @return The value returned by the procedure. The rules for converting the scripting * variable returned by the script method to a Java Object are implementation-specific. * - * @throws ScriptException if an error occurrs during invocation of the method. + * @throws ScriptException if an error occurs during invocation of the method. * @throws NoSuchMethodException if method with given name or matching argument types cannot be found. * @throws NullPointerException if the method name is null. * @throws IllegalArgumentException if the specified thiz is null or the specified Object is @@ -67,7 +67,7 @@ public interface Invocable { * @param args Arguments to pass to the procedure or function * @return The value returned by the procedure or function * - * @throws ScriptException if an error occurrs during invocation of the method. + * @throws ScriptException if an error occurs during invocation of the method. * @throws NoSuchMethodException if method with given name or matching argument types cannot be found. * @throws NullPointerException if method name is null. */ diff --git a/jdk/src/share/classes/javax/script/ScriptEngine.java b/jdk/src/share/classes/javax/script/ScriptEngine.java index df562fc43dc..889cb667cb1 100644 --- a/jdk/src/share/classes/javax/script/ScriptEngine.java +++ b/jdk/src/share/classes/javax/script/ScriptEngine.java @@ -114,7 +114,7 @@ public interface ScriptEngine { * * @return The value returned from the execution of the script. * - * @throws ScriptException if an error occurrs in script. ScriptEngines should create and throw + * @throws ScriptException if an error occurs in script. ScriptEngines should create and throw * ScriptException wrappers for checked Exceptions thrown by underlying scripting * implementations. * @throws NullPointerException if either argument is null. @@ -132,7 +132,7 @@ public interface ScriptEngine { * * @return The value returned from the execution of the script. * - * @throws ScriptException if an error occurrs in script. + * @throws ScriptException if an error occurs in script. * @throws NullPointerException if either argument is null. */ public Object eval(Reader reader , ScriptContext context) throws ScriptException; @@ -145,7 +145,7 @@ public interface ScriptEngine { * * @return The value returned from the execution of the script. * - * @throws ScriptException if error occurrs in script. + * @throws ScriptException if error occurs in script. * @throws NullPointerException if the argument is null. */ public Object eval(String script) throws ScriptException; @@ -158,7 +158,7 @@ public interface ScriptEngine { * * @return The value returned by the script. * - * @throws ScriptException if an error occurrs in script. + * @throws ScriptException if an error occurs in script. * @throws NullPointerException if the argument is null. */ public Object eval(Reader reader) throws ScriptException; @@ -177,7 +177,7 @@ public interface ScriptEngine { * * @return The value returned by the script. * - * @throws ScriptException if an error occurrs in script. + * @throws ScriptException if an error occurs in script. * @throws NullPointerException if either argument is null. */ public Object eval(String script, Bindings n) throws ScriptException; @@ -191,7 +191,7 @@ public interface ScriptEngine { * * @return The value returned by the script. * - * @throws ScriptException if an error occurrs. + * @throws ScriptException if an error occurs. * @throws NullPointerException if either argument is null. */ public Object eval(Reader reader , Bindings n) throws ScriptException; diff --git a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java index e2596f0da1a..38c665df5bd 100644 --- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java +++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java @@ -142,7 +142,7 @@ public interface ScriptEngineFactory { /** * Returns a String which can be used to invoke a method of a Java object using the syntax - * of the supported scripting language. For instance, an implementaton for a Javascript + * of the supported scripting language. For instance, an implementation for a Javascript * engine might be; *

      *

      {@code
      @@ -178,7 +178,7 @@ public interface ScriptEngineFactory {
       
           /**
            * Returns a String that can be used as a statement to display the specified String  using
      -     * the syntax of the supported scripting language.  For instance, the implementaton for a Perl
      +     * the syntax of the supported scripting language.  For instance, the implementation for a Perl
            * engine might be;
            * 

      *

      
      @@ -196,7 +196,7 @@ public interface ScriptEngineFactory {
       
       
           /**
      -     * Returns a valid scripting language executable progam with given statements.
      +     * Returns a valid scripting language executable program with given statements.
            * For instance an implementation for a PHP engine might be:
            * 

      *

      {@code
      diff --git a/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java b/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java
      index 7954109f541..aa3fa4419e5 100644
      --- a/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java
      +++ b/jdk/src/share/classes/javax/security/sasl/RealmChoiceCallback.java
      @@ -46,7 +46,7 @@ public class RealmChoiceCallback extends ChoiceCallback {
            * @param choices the non-null list of realms to choose from.
            * @param defaultChoice the choice to be used as the default choice
            * when the list of choices is displayed. It is an index into
      -     * the {@code choices} arary.
      +     * the {@code choices} array.
            * @param multiple true if multiple choices allowed; false otherwise
            * @throws IllegalArgumentException If {@code prompt} is null or the empty string,
            * if {@code choices} has a length of 0, if any element from
      diff --git a/jdk/src/share/classes/javax/security/sasl/Sasl.java b/jdk/src/share/classes/javax/security/sasl/Sasl.java
      index 77edc108792..1ce36c74311 100644
      --- a/jdk/src/share/classes/javax/security/sasl/Sasl.java
      +++ b/jdk/src/share/classes/javax/security/sasl/Sasl.java
      @@ -172,7 +172,7 @@ public class Sasl {
            *
            * Mechanism implementations that support reuse might allow customization
            * of its implementation, for factors such as cache size, timeouts, and
      -     * criteria for reuseability. Such customizations are
      +     * criteria for reusability. Such customizations are
            * implementation-dependent.
            */
            public static final String REUSE = "javax.security.sasl.reuse";
      diff --git a/jdk/src/share/classes/javax/security/sasl/SaslClient.java b/jdk/src/share/classes/javax/security/sasl/SaslClient.java
      index e6786097228..c7258f4007b 100644
      --- a/jdk/src/share/classes/javax/security/sasl/SaslClient.java
      +++ b/jdk/src/share/classes/javax/security/sasl/SaslClient.java
      @@ -123,7 +123,7 @@ public abstract interface SaslClient {
            * @param challenge The non-null challenge sent from the server.
            * The challenge array may have zero length.
            *
      -     * @return The possibly null reponse to send to the server.
      +     * @return The possibly null response to send to the server.
            * It is null if the challenge accompanied a "SUCCESS" status and the challenge
            * only contains data for the client to update its state and no response
            * needs to be sent to the server. The response is a zero-length byte
      diff --git a/jdk/src/share/classes/javax/security/sasl/SaslException.java b/jdk/src/share/classes/javax/security/sasl/SaslException.java
      index 87fed3cec58..0398d8d7277 100644
      --- a/jdk/src/share/classes/javax/security/sasl/SaslException.java
      +++ b/jdk/src/share/classes/javax/security/sasl/SaslException.java
      @@ -107,7 +107,7 @@ public class SaslException extends IOException {
           /**
            * Returns the string representation of this exception.
            * The string representation contains
      -     * this exception's class name, its detailed messsage, and if
      +     * this exception's class name, its detailed message, and if
            * it has a root exception, the string representation of the root
            * exception. This string representation
            * is meant for debugging and not meant to be interpreted
      diff --git a/jdk/src/share/classes/javax/smartcardio/CardChannel.java b/jdk/src/share/classes/javax/smartcardio/CardChannel.java
      index f104674f2a6..688c4da4740 100644
      --- a/jdk/src/share/classes/javax/smartcardio/CardChannel.java
      +++ b/jdk/src/share/classes/javax/smartcardio/CardChannel.java
      @@ -122,7 +122,7 @@ public abstract class CardChannel {
       
           /**
            * Transmits the command APDU stored in the command ByteBuffer and receives
      -     * the reponse APDU in the response ByteBuffer.
      +     * the response APDU in the response ByteBuffer.
            *
            * 

      The command buffer must contain valid command APDU data starting * at command.position() and the APDU must be diff --git a/jdk/src/share/classes/javax/smartcardio/CardTerminal.java b/jdk/src/share/classes/javax/smartcardio/CardTerminal.java index ac79bb51bfa..65671d87a9d 100644 --- a/jdk/src/share/classes/javax/smartcardio/CardTerminal.java +++ b/jdk/src/share/classes/javax/smartcardio/CardTerminal.java @@ -28,7 +28,7 @@ package javax.smartcardio; import java.util.*; /** - * A Smart Card terminal, sometimes refered to as a Smart Card Reader. + * A Smart Card terminal, sometimes referred to as a Smart Card Reader. * A CardTerminal object can be obtained by calling * {@linkplain CardTerminals#list} * or {@linkplain CardTerminals#getTerminal CardTerminals.getTerminal()}. diff --git a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java index be950e8aa48..f53d4ff3e2f 100644 --- a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java +++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java @@ -60,7 +60,7 @@ import java.util.List; * Receiver or Transmitter that resulted in * opening it. If more than one implicitly opening * Receiver or Transmitter were obtained by - * the application, the decive is closed after the last + * the application, the device is closed after the last * Receiver or Transmitter has been * closed. On the other hand, calling getReceiver or * getTransmitter on the device instance directly does diff --git a/jdk/src/share/classes/javax/sound/midi/MidiMessage.java b/jdk/src/share/classes/javax/sound/midi/MidiMessage.java index 7cc840bd775..728d654cea8 100644 --- a/jdk/src/share/classes/javax/sound/midi/MidiMessage.java +++ b/jdk/src/share/classes/javax/sound/midi/MidiMessage.java @@ -59,7 +59,7 @@ package javax.sound.midi; *

      * If you simply need to pass a known MIDI byte value as a method parameter, * it can be expressed directly as an integer, using (for example) decimal or - * hexidecimal notation. For instance, to pass the "active sensing" status byte + * hexadecimal notation. For instance, to pass the "active sensing" status byte * as the first argument to ShortMessage's * {@link ShortMessage#setMessage(int) setMessage(int)} * method, you can express it as 254 or 0xFE. diff --git a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java index 4e390f11998..ac13aa58a86 100644 --- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java +++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java @@ -120,7 +120,7 @@ import com.sun.media.sound.MidiDeviceTransmitterEnvelope; * is optional. * *

      If the provider class is specified, and it can be - * successully retrieved from the installed providers, + * successfully retrieved from the installed providers, * the list of * MidiDevice.Info objects is retrieved * from the provider. Otherwise, or when these devices diff --git a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java index 1445201f3fe..02301ca2a49 100644 --- a/jdk/src/share/classes/javax/sound/midi/ShortMessage.java +++ b/jdk/src/share/classes/javax/sound/midi/ShortMessage.java @@ -94,7 +94,7 @@ public class ShortMessage extends MidiMessage { // System real-time messages /** - * Status byte for Timing Clock messagem (0xF8, or 248). + * Status byte for Timing Clock message (0xF8, or 248). * @see MidiMessage#getStatus */ public static final int TIMING_CLOCK = 0xF8; // 248 diff --git a/jdk/src/share/classes/javax/sound/midi/Soundbank.java b/jdk/src/share/classes/javax/sound/midi/Soundbank.java index 3de81ef8f15..023cabe2335 100644 --- a/jdk/src/share/classes/javax/sound/midi/Soundbank.java +++ b/jdk/src/share/classes/javax/sound/midi/Soundbank.java @@ -100,7 +100,7 @@ public interface Soundbank { /** * Extracts a list of non-Instrument resources contained in the sound bank. - * @return an array of resources, exclusing instruments. If the sound bank contains + * @return an array of resources, excluding instruments. If the sound bank contains * no resources (other than instruments), returns an array of length 0. */ public SoundbankResource[] getResources(); diff --git a/jdk/src/share/classes/javax/sound/midi/Synthesizer.java b/jdk/src/share/classes/javax/sound/midi/Synthesizer.java index 6740479b389..6763a969504 100644 --- a/jdk/src/share/classes/javax/sound/midi/Synthesizer.java +++ b/jdk/src/share/classes/javax/sound/midi/Synthesizer.java @@ -212,7 +212,7 @@ public interface Synthesizer extends MidiDevice { * @param from the Instrument object to be replaced * @param to the Instrument object to be used in place * of the old instrument, it should be loaded into the synthesizer - * @return true if the instrument succeessfully remapped, + * @return true if the instrument successfully remapped, * false if feature is not implemented by synthesizer * @throws IllegalArgumentException if instrument * from or instrument to aren't supported by diff --git a/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java b/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java index 4a267cf6b6d..775331f6ba6 100644 --- a/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java +++ b/jdk/src/share/classes/javax/sound/sampled/AudioFormat.java @@ -31,7 +31,7 @@ import java.util.Map; /** * AudioFormat is the class that specifies a particular arrangement of data in a sound stream. - * By examing the information stored in the audio format, you can discover how to interpret the bits in the + * By examining the information stored in the audio format, you can discover how to interpret the bits in the * binary sound data. *

      * Every data line has an audio format associated with its data stream. The audio format of a source (playback) data line indicates diff --git a/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java index 6c8bfaf9f5e..97e7af39c7e 100644 --- a/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java +++ b/jdk/src/share/classes/javax/sound/sampled/AudioSystem.java @@ -115,7 +115,7 @@ import com.sun.media.sound.JDK13Services; * is optional. * *

      If the provider class is specified, and it can be - * successully retrieved from the installed providers, the list of + * successfully retrieved from the installed providers, the list of * Mixer.Info objects is retrieved * from the provider. Otherwise, or when these mixers * do not provide a subsequent match, the list is retrieved diff --git a/jdk/src/share/classes/javax/sound/sampled/ReverbType.java b/jdk/src/share/classes/javax/sound/sampled/ReverbType.java index a6c90b270ac..424b6ac4db1 100644 --- a/jdk/src/share/classes/javax/sound/sampled/ReverbType.java +++ b/jdk/src/share/classes/javax/sound/sampled/ReverbType.java @@ -42,7 +42,7 @@ package javax.sound.sampled; * intensity of late reflections, and an overall decay time. * Early reflections are the initial individual low-order reflections of the * direct signal off the surfaces in the room. - * The late Relections are the dense, high-order reflections that characterize + * The late Reflections are the dense, high-order reflections that characterize * the room's reverberation. * The delay times for the start of these two reflection types give the listener * a sense of the overall size and complexity of the room's shape and contents. diff --git a/jdk/src/share/classes/javax/sql/PooledConnection.java b/jdk/src/share/classes/javax/sql/PooledConnection.java index 47926293db7..78158937874 100644 --- a/jdk/src/share/classes/javax/sql/PooledConnection.java +++ b/jdk/src/share/classes/javax/sql/PooledConnection.java @@ -73,7 +73,7 @@ import java.sql.SQLException; * if a fatal error has made the connection unusable. * *

      - * A connection pool manager is often also a statement pool manager, maintining + * A connection pool manager is often also a statement pool manager, maintaining * a pool of PreparedStatement objects. * When an application closes a prepared statement, it calls the * PreparedStatement diff --git a/jdk/src/share/classes/javax/sql/RowSet.java b/jdk/src/share/classes/javax/sql/RowSet.java index 7f6bd2b1caf..2f7b0abc2e6 100644 --- a/jdk/src/share/classes/javax/sql/RowSet.java +++ b/jdk/src/share/classes/javax/sql/RowSet.java @@ -206,7 +206,7 @@ public interface RowSet extends ResultSet { int getTransactionIsolation(); /** - * Sets the transaction isolation level for this RowSet obejct. + * Sets the transaction isolation level for this RowSet object. * * @param level the transaction isolation level; one of * Connection.TRANSACTION_READ_UNCOMMITTED, @@ -1438,7 +1438,7 @@ public interface RowSet extends ResultSet { * 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 @@ -1492,7 +1492,7 @@ public interface RowSet extends ResultSet { * @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 @@ -1956,7 +1956,7 @@ public interface RowSet extends ResultSet { void setRowId(String parameterName, RowId x) throws SQLException; /** - * 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 @@ -1973,7 +1973,7 @@ public interface RowSet extends ResultSet { void setNString(int parameterIndex, String value) throws SQLException; /** - * 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 diff --git a/jdk/src/share/classes/javax/sql/StatementEvent.java b/jdk/src/share/classes/javax/sql/StatementEvent.java index ee06956e044..62a2ae2acdb 100644 --- a/jdk/src/share/classes/javax/sql/StatementEvent.java +++ b/jdk/src/share/classes/javax/sql/StatementEvent.java @@ -53,7 +53,7 @@ public class StatementEvent extends EventObject { *

      * @param con The PooledConnection that the closed or invalid * PreparedStatementis associated with. - * @param statement The PreparedStatement that is bieng closed or is invalid + * @param statement The PreparedStatement that is being closed or is invalid *

      * @throws IllegalArgumentException if con is null. * diff --git a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java index 4cc5778610f..8fcfbbf612d 100644 --- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java @@ -211,7 +211,7 @@ import javax.sql.rowset.serial.*; * to the driver or the DBMS. For example, the methods setDate, * setTime, and setTimestamp can take a Calendar * object as their third parameter. If the DBMS does not store time zone information, - * the drivern uses the Calendar object to construct the Date, + * the driver uses the Calendar object to construct the Date, * Time, or Timestamp object being set. As is true with other * methods that provide additional information, the element in the array returned * by getParams is an array instead of a simple Object instance. @@ -3162,7 +3162,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { * @return an array of Object instances that includes the * parameter values that may be set in this RowSet object's * command; an empty array if no parameters have been set - * @throws SQLException if an error occurs retrieveing the object array of + * @throws SQLException if an error occurs retrieving the object array of * parameters of this RowSet object or if not all parameters have * been set */ @@ -3810,7 +3810,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { * 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 @@ -3870,7 +3870,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { * @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 @@ -4253,7 +4253,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { } /** - * 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 @@ -4275,7 +4275,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable { /** - * 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 diff --git a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java index 6eecd829a33..08746bfe1b8 100644 --- a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java @@ -1104,7 +1104,7 @@ public interface CachedRowSet extends RowSet, Joinable { public SyncProvider getSyncProvider() throws SQLException; /** - * Sets the SyncProvider objec for this CachedRowSet + * Sets the SyncProvider object for this CachedRowSet * object to the one specified. This method * allows the SyncProvider object to be reset. *

      @@ -1173,7 +1173,7 @@ public interface CachedRowSet extends RowSet, Joinable { * the last synchronization with the underlying data source. If there have been * no synchronizations, the original value will be the value with which the * RowSet object was populated. This method is called internally - * when an aplication calls the method acceptChanges and the + * when an application calls the method acceptChanges and the * SyncProvider object has been implemented to check for conflicts. * If this is the case, the writer compares the original value with the value * currently in the data source to check for conflicts. diff --git a/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java b/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java index 695e29d6701..08b88ddbac1 100644 --- a/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java +++ b/jdk/src/share/classes/javax/sql/rowset/JoinRowSet.java @@ -359,7 +359,7 @@ public interface JoinRowSet extends WebRowSet { * RowSet objects that have been added to this * JoinRowSet object. * This should return the 'n' number of RowSet contained - * within the JOIN and maintain any updates that have occured while in + * within the JOIN and maintain any updates that have occurred while in * this union. * * @return a Collection object consisting of the diff --git a/jdk/src/share/classes/javax/sql/rowset/Joinable.java b/jdk/src/share/classes/javax/sql/rowset/Joinable.java index 24c035fab0f..15a5b77d673 100644 --- a/jdk/src/share/classes/javax/sql/rowset/Joinable.java +++ b/jdk/src/share/classes/javax/sql/rowset/Joinable.java @@ -76,7 +76,7 @@ import java.sql.SQLException; * jrs.addRowSet(crs); *

      * In the previous example, crs is a CachedRowSet object that - * has emplemented the Joinable interface. In the following example, + * has implemented the Joinable interface. In the following example, * crs2 has not, so it must supply the match column as an argument to the * addRowSet method. This example assumes that column 1 is the match * column. @@ -250,7 +250,7 @@ public interface Joinable { * Unsets the designated columns as the match column for this RowSet * object. * - * @param columnIdxes an arrary of int that identifies the indexes + * @param columnIdxes an array of int that identifies the indexes * of the columns that are to be unset as match columns * @throws SQLException if an invalid column index is designated or if * the designated column was not previously set as a match diff --git a/jdk/src/share/classes/javax/sql/rowset/Predicate.java b/jdk/src/share/classes/javax/sql/rowset/Predicate.java index 0c8f7471c57..f9fec9e49c8 100644 --- a/jdk/src/share/classes/javax/sql/rowset/Predicate.java +++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java @@ -131,7 +131,7 @@ public interface Predicate { * SQL index of a column in this RowSet object. This must * have been passed to Predicate as one of the columns * for filtering while initializing a Predicate - * @return true ifrow value lies within the filter; + * @return true if row value lies within the filter; * false otherwise * @throws SQLException if the column is not part of filtering criteria */ diff --git a/jdk/src/share/classes/javax/sql/rowset/package.html b/jdk/src/share/classes/javax/sql/rowset/package.html index e8b494ee744..da94c386bfd 100644 --- a/jdk/src/share/classes/javax/sql/rowset/package.html +++ b/jdk/src/share/classes/javax/sql/rowset/package.html @@ -43,7 +43,7 @@ that a standard RowSet implementation either implements or extends. diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java index d78f5f4db11..fceeab85e2b 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java @@ -71,7 +71,7 @@ import javax.naming.*; * WebRowSet objects * * Note that the JDBC RowSet Implementations include the SyncProvider - * implemtations RIOptimisticProvider and RIXmlProvider, + * implementations RIOptimisticProvider and RIXmlProvider, * which satisfy this requirement. *

      * The SyncFactory class provides accessor methods to assist diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java index 3783e143a97..45fdfe02a53 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java @@ -264,10 +264,10 @@ public interface SyncResolver extends RowSet { public static int INSERT_ROW_CONFLICT = 2; /** - * Indicates that no conflict occured while the RowSet object + * Indicates that no conflict occurred while the RowSet object * was attempting to update, delete or insert a row in the data source. The values in * the SyncResolver will contain null values only as an indication - * that no information in pertitent to the conflict resolution in this row. + * that no information in pertinent to the conflict resolution in this row. */ public static int NO_ROW_CONFLICT = 3; diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java b/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java index 812cf5b0779..871e94c6b24 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java @@ -37,10 +37,10 @@ import java.sql.Savepoint; * SyncProvider abstract class so that it has finer grained * transaction control. *

      - * If one or more disconnected RowSet objects are particating + * If one or more disconnected RowSet objects are participating * in a global transaction, they may wish to coordinate their synchronization * commits to preserve data integrity and reduce the number of - * sychronization exceptions. If this is the case, an application should set + * synchronization exceptions. If this is the case, an application should set * the CachedRowSet constant COMMIT_ON_ACCEPT_CHANGES * to false and use the commit and rollback * methods defined in this interface to manage transaction boundaries. diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java b/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java index 8306b927901..ea03f85bb6c 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlReader.java @@ -38,7 +38,7 @@ import javax.sql.rowset.*; *

      * SyncProvider implementations that supply XML data reader * capabilities such as output XML stream capabilities can implement this - * interface to provider standard XmlReader objects to + * interface to provide standard XmlReader objects to * WebRowSet implementations. *

      * An XmlReader object is registered as the diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java b/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java index 0e49d83ba44..9943736fca1 100644 --- a/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java +++ b/jdk/src/share/classes/javax/sql/rowset/spi/XmlWriter.java @@ -38,7 +38,7 @@ import javax.sql.rowset.*; *

      * SyncProvider implementations that supply XML data writer * capabilities such as output XML stream capabilities can implement this - * interface to provider standard XmlWriter objects to + * interface to provide standard XmlWriter objects to * WebRowSet implementations. *

      * Writing a WebRowSet object includes printing the diff --git a/jdk/src/share/classes/javax/swing/AbstractButton.java b/jdk/src/share/classes/javax/swing/AbstractButton.java index 193317c99ac..5157b16ee71 100644 --- a/jdk/src/share/classes/javax/swing/AbstractButton.java +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java @@ -330,7 +330,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl /** * Sets the state of the button. Note that this method does not * trigger an actionEvent. - * Call doClick to perform a programatic action change. + * Call doClick to perform a programmatic action change. * * @param b true if the button is selected, otherwise false */ @@ -2928,7 +2928,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * If there is no selection, but there is * a caret, the start and end offsets will be the same. * - * @return the index into teh text of the end of the selection + * @return the index into the text of the end of the selection * @since 1.3 */ public int getSelectionEnd() { diff --git a/jdk/src/share/classes/javax/swing/Action.java b/jdk/src/share/classes/javax/swing/Action.java index 48c4b6a329f..307f40a74db 100644 --- a/jdk/src/share/classes/javax/swing/Action.java +++ b/jdk/src/share/classes/javax/swing/Action.java @@ -98,10 +98,10 @@ import java.beans.*; * summary="Supported Action properties" * valign="top" > *

      - * *
      Attribute Class
      Component Property - * Components - * Action Key - * Notes + * Component Property + * Components + * Action Key + * Notes *
      enabled * All diff --git a/jdk/src/share/classes/javax/swing/BoxLayout.java b/jdk/src/share/classes/javax/swing/BoxLayout.java index abe4b73201f..f510553063e 100644 --- a/jdk/src/share/classes/javax/swing/BoxLayout.java +++ b/jdk/src/share/classes/javax/swing/BoxLayout.java @@ -338,7 +338,7 @@ public class BoxLayout implements LayoutManager2, Serializable { * to lay out the components it contains. * * @param target the container that needs to be laid out - * @return the dimenions >= 0 && <= Integer.MAX_VALUE + * @return the dimensions >= 0 && <= Integer.MAX_VALUE * @exception AWTError if the target isn't the container specified to the * BoxLayout constructor * @see #preferredLayoutSize diff --git a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java index 8da0b4254a8..26f06c63a2c 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java @@ -786,7 +786,7 @@ public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, * leadIndex and newLeadIndex is the new one. *

      * If the value at the anchor index is not selected, do the same thing in - * reverse selecting values in the old range and deslecting values in the + * reverse selecting values in the old range and deselecting values in the * new one. *

      * Generate a single event for this change and notify all listeners. diff --git a/jdk/src/share/classes/javax/swing/DefaultRowSorter.java b/jdk/src/share/classes/javax/swing/DefaultRowSorter.java index 826d650a725..f33a83e8717 100644 --- a/jdk/src/share/classes/javax/swing/DefaultRowSorter.java +++ b/jdk/src/share/classes/javax/swing/DefaultRowSorter.java @@ -53,7 +53,7 @@ import javax.swing.SortOrder; * Collator.getInstance() is used on the results of * calling toString on the underlying objects. The * Comparator is never passed null. A - * null value is treated as occuring before a + * null value is treated as occurring before a * non-null value, and two null values are * considered equal. *

      diff --git a/jdk/src/share/classes/javax/swing/GroupLayout.java b/jdk/src/share/classes/javax/swing/GroupLayout.java index ba29f7cdbdb..9b0d4df485b 100644 --- a/jdk/src/share/classes/javax/swing/GroupLayout.java +++ b/jdk/src/share/classes/javax/swing/GroupLayout.java @@ -79,7 +79,7 @@ import static javax.swing.SwingConstants.VERTICAL; * The following diagram shows a sequential group along the horizontal * axis. The sequential group contains three components. A parallel group * was used along the vertical axis. - *

      + *

      * *

      * To reinforce that each axis is treated independently the diagram shows @@ -101,7 +101,7 @@ import static javax.swing.SwingConstants.VERTICAL; * parallel group along the horizontal axis and the sequential group along * the vertical axis. *

      - *

      + *

      * *

      * As {@code c1} is the largest of the three components, the parallel @@ -115,7 +115,7 @@ import static javax.swing.SwingConstants.VERTICAL; *

      * The following diagram shows a sequential group along both the horizontal * and vertical axis. - *

      + *

      * *

      * {@code GroupLayout} provides the ability to insert gaps between @@ -172,7 +172,7 @@ import static javax.swing.SwingConstants.VERTICAL; * *

      * When run the following is produced. - *

      + *

      * *

      * This layout consists of the following. @@ -382,7 +382,7 @@ public class GroupLayout implements LayoutManager2 { } /** - * Sets whether component visiblity is considered when sizing and + * Sets whether component visibility is considered when sizing and * positioning components. A value of {@code true} indicates that * non-visible components should not be treated as part of the * layout. A value of {@code false} indicates that components should be @@ -397,7 +397,7 @@ public class GroupLayout implements LayoutManager2 { *

      * The default is {@code true}. * - * @param honorsVisibility whether component visiblity is considered when + * @param honorsVisibility whether component visibility is considered when * sizing and positioning components * @see #setHonorsVisibility(Component,Boolean) */ @@ -411,10 +411,10 @@ public class GroupLayout implements LayoutManager2 { } /** - * Returns whether component visiblity is considered when sizing and + * Returns whether component visibility is considered when sizing and * positioning components. * - * @return whether component visiblity is considered when sizing and + * @return whether component visibility is considered when sizing and * positioning components */ public boolean getHonorsVisibility() { @@ -422,7 +422,7 @@ public class GroupLayout implements LayoutManager2 { } /** - * Sets whether the component's visiblity is considered for + * Sets whether the component's visibility is considered for * sizing and positioning. A value of {@code Boolean.TRUE} * indicates that if {@code component} is not visible it should * not be treated as part of the layout. A value of {@code false} @@ -432,11 +432,11 @@ public class GroupLayout implements LayoutManager2 { * setHonorsVisibility} should be used. *

      * If {@code component} is not a child of the {@code Container} this - * {@code GroupLayout} is managine, it will be added to the + * {@code GroupLayout} is managing, it will be added to the * {@code Container}. * * @param component the component - * @param honorsVisibility whether {@code component}'s visiblity should be + * @param honorsVisibility whether visibility of this {@code component} should be * considered for sizing and positioning * @throws IllegalArgumentException if {@code component} is {@code null} * @see #setHonorsVisibility(Component,Boolean) @@ -1315,7 +1315,7 @@ public class GroupLayout implements LayoutManager2 { return parent; } - // This is here purely as a conveniance for ParallelGroup to avoid + // This is here purely as a convenience for ParallelGroup to avoid // having to track alignment separately. void setAlignment(Alignment alignment) { this.alignment = alignment; @@ -2048,7 +2048,7 @@ public class GroupLayout implements LayoutManager2 { // 2. Sort the list in ascending order // 3. Iterate through each of the resizable Springs, attempting // to give them (pref - size) / resizeCount - // 4. For any Springs that can not accomodate that much space + // 4. For any Springs that can not accommodate that much space // add the remainder back to the amount to distribute and // recalculate how must space the remaining springs will get. // 5. Set the size of the springs. @@ -2275,7 +2275,7 @@ public class GroupLayout implements LayoutManager2 { if (!baselineSpring.isResizable(VERTICAL)) { // Spring to use for baseline isn't resizable. In this case // baseline resize behavior can be determined based on how - // preceeding springs resize. + // preceding springs resize. boolean leadingResizable = false; for (Spring spring : springs) { if (spring == baselineSpring) { diff --git a/jdk/src/share/classes/javax/swing/ImageIcon.java b/jdk/src/share/classes/javax/swing/ImageIcon.java index 236d682d9a8..b744d5aa5c5 100644 --- a/jdk/src/share/classes/javax/swing/ImageIcon.java +++ b/jdk/src/share/classes/javax/swing/ImageIcon.java @@ -80,8 +80,20 @@ public class ImageIcon implements Icon, Serializable, Accessible { ImageObserver imageObserver; String description = null; - // Fields for twisted backward compatibility only. DO NOT USE. + /** + * Do not use this shared component, which is used to track image loading. + * It is left for backward compatibility only. + * @deprecated since 1.8 + */ + @Deprecated protected final static Component component; + + /** + * Do not use this shared media tracker, which is used to load images. + * It is left for backward compatibility only. + * @deprecated since 1.8 + */ + @Deprecated protected final static MediaTracker tracker; static { diff --git a/jdk/src/share/classes/javax/swing/JApplet.java b/jdk/src/share/classes/javax/swing/JApplet.java index acb02035420..a97b3e96d75 100644 --- a/jdk/src/share/classes/javax/swing/JApplet.java +++ b/jdk/src/share/classes/javax/swing/JApplet.java @@ -46,9 +46,10 @@ import javax.accessibility.*; * java.applet.Applet. JApplet contains a * JRootPane as its only child. The contentPane * should be the parent of any children of the JApplet. - * As a convenience add and its variants, remove and - * setLayout have been overridden to forward to the - * contentPane as necessary. This means you can write: + * As a convenience, the {@code add}, {@code remove}, and {@code setLayout} + * methods of this class are overridden, so that they delegate calls + * to the corresponding methods of the {@code ContentPane}. + * For example, you can add a child component to an applet as follows: *

        *       applet.add(child);
        * 
      @@ -256,7 +257,7 @@ public class JApplet extends Applet implements Accessible, * setLayout are forwarded to the contentPane. * * @return true if add and setLayout - * are fowarded; false otherwise + * are forwarded; false otherwise * * @see #addImpl * @see #setLayout diff --git a/jdk/src/share/classes/javax/swing/JComboBox.java b/jdk/src/share/classes/javax/swing/JComboBox.java index 2d81a18a1d0..a277da79b2b 100644 --- a/jdk/src/share/classes/javax/swing/JComboBox.java +++ b/jdk/src/share/classes/javax/swing/JComboBox.java @@ -2143,7 +2143,7 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { * a set of predefined roles. This enables assistive technologies to * provide a consistent interface to various tweaked subclasses of * components (e.g., use AccessibleRole.PUSH_BUTTON for all components - * that act like a push button) as well as distinguish between sublasses + * that act like a push button) as well as distinguish between subclasses * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes * and AccessibleRole.RADIO_BUTTON for radio buttons). *

      Note that the AccessibleRole class is also extensible, so diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index a15ec705655..598916da412 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -316,7 +316,7 @@ public abstract class JComponent extends Container implements Serializable, /** * JPopupMenu assigned to this component - * and all of its childrens + * and all of its children */ private JPopupMenu popupMenu; @@ -2020,7 +2020,7 @@ public abstract class JComponent extends Container implements Serializable, /** * This method is now obsolete, please use a combination of * getActionMap() and getInputMap() for - * similiar behavior. For example, to bind the KeyStroke + * similar behavior. For example, to bind the KeyStroke * aKeyStroke to the Action anAction * now use: *

      @@ -2207,7 +2207,7 @@ public abstract class JComponent extends Container implements Serializable,
           /**
            * This method is now obsolete, please use a combination of
            * getActionMap() and getInputMap() for
      -     * similiar behavior.
      +     * similar behavior.
            */
           public void registerKeyboardAction(ActionListener anAction,KeyStroke aKeyStroke,int aCondition) {
               registerKeyboardAction(anAction,null,aKeyStroke,aCondition);
      @@ -5236,7 +5236,7 @@ public abstract class JComponent extends Container implements Serializable,
            *
            * @return NOT_OBSCURED if non of the siblings above the Component obscure
            *         it, COMPLETELY_OBSCURED if one of the siblings completely
      -     *         obscures the Component or PARTIALLY_OBSCURED if the Comonent is
      +     *         obscures the Component or PARTIALLY_OBSCURED if the Component is
            *         only partially obscured.
            */
           private int getObscuredState(int compIndex, int x, int y, int width,
      diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java
      index 2e4b2b72efd..92febed0843 100644
      --- a/jdk/src/share/classes/javax/swing/JDialog.java
      +++ b/jdk/src/share/classes/javax/swing/JDialog.java
      @@ -44,9 +44,10 @@ import javax.accessibility.*;
        * as its only child.
        * The {@code contentPane} should be the parent of any children of the
        * {@code JDialog}.
      - * As a convenience {@code add} and its variants, {@code remove} and
      - * {@code setLayout} have been overridden to forward to the
      - * {@code contentPane} as necessary. This means you can write:
      + * As a convenience, the {@code add}, {@code remove}, and {@code setLayout}
      + * methods of this class are overridden, so that they delegate calls
      + * to the corresponding methods of the {@code ContentPane}.
      + * For example, you can add a child component to a dialog as follows:
        * 
        *       dialog.add(child);
        * 
      @@ -862,7 +863,7 @@ public class JDialog extends Dialog implements WindowConstants, * {@code setLayout} are forwarded to the {@code contentPane}. * * @return true if {@code add} and {@code setLayout} - * are fowarded; false otherwise + * are forwarded; false otherwise * * @see #addImpl * @see #setLayout @@ -1024,7 +1025,7 @@ public class JDialog extends Dialog implements WindowConstants, * This method is called by the constructor. *

      * Swing's painting architecture requires an opaque {@code JComponent} - * in the containment hiearchy. This is typically provided by the + * in the containment hierarchy. This is typically provided by the * content pane. If you replace the content pane it is recommended you * replace it with an opaque {@code JComponent}. * @see JRootPane diff --git a/jdk/src/share/classes/javax/swing/JFileChooser.java b/jdk/src/share/classes/javax/swing/JFileChooser.java index 5f897e3ed9a..218f6ae7310 100644 --- a/jdk/src/share/classes/javax/swing/JFileChooser.java +++ b/jdk/src/share/classes/javax/swing/JFileChooser.java @@ -134,7 +134,7 @@ public class JFileChooser extends JComponent implements Accessible { public static final int APPROVE_OPTION = 0; /** - * Return value if an error occured. + * Return value if an error occurred. */ public static final int ERROR_OPTION = -1; diff --git a/jdk/src/share/classes/javax/swing/JFormattedTextField.java b/jdk/src/share/classes/javax/swing/JFormattedTextField.java index e682c571e51..36e637727ea 100644 --- a/jdk/src/share/classes/javax/swing/JFormattedTextField.java +++ b/jdk/src/share/classes/javax/swing/JFormattedTextField.java @@ -126,14 +126,14 @@ import javax.swing.text.*; * policy is JFormattedTextField.PERSIST * and the JFormattedTextField has been edited, the * AbstractFormatterFactory will not be queried until the - * value has been commited. Similarly if the focus lost policy is + * value has been committed. Similarly if the focus lost policy is * JFormattedTextField.COMMIT and an exception * is thrown from stringToValue, the - * AbstractFormatterFactory will not be querired when focus is + * AbstractFormatterFactory will not be queried when focus is * lost or gained. *

      * JFormattedTextField.AbstractFormatter - * is also responsible for determining when values are commited to + * is also responsible for determining when values are committed to * the JFormattedTextField. Some * JFormattedTextField.AbstractFormatters will make new values * available on every edit, and others will never commit the value. You can @@ -184,7 +184,7 @@ public class JFormattedTextField extends JTextField { /** * Constant identifying that when focus is lost, - * commitEdit should be invoked. If in commiting the + * commitEdit should be invoked. If in committing the * new value a ParseException is thrown, the invalid * value will remain. * @@ -194,7 +194,7 @@ public class JFormattedTextField extends JTextField { /** * Constant identifying that when focus is lost, - * commitEdit should be invoked. If in commiting the new + * commitEdit should be invoked. If in committing the new * value a ParseException is thrown, the value will be * reverted. * @@ -878,7 +878,7 @@ public class JFormattedTextField extends JTextField { * Instances of AbstractFormatter are used by * JFormattedTextField to handle the conversion both * from an Object to a String, and back from a String to an Object. - * AbstractFormatters can also enfore editing policies, + * AbstractFormatters can also enforce editing policies, * or navigation policies, or manipulate the * JFormattedTextField in any way it sees fit to * enforce the desired policy. @@ -1116,7 +1116,7 @@ public class JFormattedTextField extends JTextField { ((JFormattedTextField)target).commitEdit(); } catch (ParseException pe) { ((JFormattedTextField)target).invalidEdit(); - // value not commited, don't notify ActionListeners + // value not committed, don't notify ActionListeners return; } } diff --git a/jdk/src/share/classes/javax/swing/JFrame.java b/jdk/src/share/classes/javax/swing/JFrame.java index 038c63b122a..27a5a04e276 100644 --- a/jdk/src/share/classes/javax/swing/JFrame.java +++ b/jdk/src/share/classes/javax/swing/JFrame.java @@ -50,9 +50,10 @@ import javax.accessibility.*; * as a rule, contain * all the non-menu components displayed by the JFrame. * This is different from the AWT Frame case. - * As a conveniance add and its variants, remove and - * setLayout have been overridden to forward to the - * contentPane as necessary. This means you can write: + * As a convenience, the {@code add}, {@code remove}, and {@code setLayout} + * methods of this class are overridden, so that they delegate calls + * to the corresponding methods of the {@code ContentPane}. + * For example, you can add a child component to a frame as follows: *

        *       frame.add(child);
        * 
      @@ -505,7 +506,7 @@ public class JFrame extends Frame implements WindowConstants, * setLayout are forwarded to the contentPane. * * @return true if add and setLayout - * are fowarded; false otherwise + * are forwarded; false otherwise * * @see #addImpl * @see #setLayout @@ -673,7 +674,7 @@ public class JFrame extends Frame implements WindowConstants, * This method is called by the constructor. *

      * Swing's painting architecture requires an opaque JComponent - * in the containment hiearchy. This is typically provided by the + * in the containment hierarchy. This is typically provided by the * content pane. If you replace the content pane it is recommended you * replace it with an opaque JComponent. * diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index ad78df11c01..901f1371b81 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -63,9 +63,10 @@ import sun.swing.SwingUtilities2; *

      * The JInternalFrame content pane * is where you add child components. - * As a conveniance add and its variants, remove and - * setLayout have been overridden to forward to the - * contentPane as necessary. This means you can write: + * As a convenience, the {@code add}, {@code remove}, and {@code setLayout} + * methods of this class are overridden, so that they delegate calls + * to the corresponding methods of the {@code ContentPane}. + * For example, you can add a child component to an internal frame as follows: *

        *       internalFrame.add(child);
        * 
      @@ -445,7 +446,7 @@ public class JInternalFrame extends JComponent implements * setLayout are forwarded to the contentPane. * * @return true if add and setLayout - * are fowarded; false otherwise + * are forwarded; false otherwise * * @see #addImpl * @see #setLayout diff --git a/jdk/src/share/classes/javax/swing/JLabel.java b/jdk/src/share/classes/javax/swing/JLabel.java index cf4ae3921f0..be900a4697d 100644 --- a/jdk/src/share/classes/javax/swing/JLabel.java +++ b/jdk/src/share/classes/javax/swing/JLabel.java @@ -1457,7 +1457,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * If there is no selection, but there is * a caret, the start and end offsets will be the same. * - * @return the index into teh text of the end of the selection + * @return the index into the text of the end of the selection * @since 1.3 */ public int getSelectionEnd() { diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java index 075e535309b..052fcf34c31 100644 --- a/jdk/src/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java @@ -168,7 +168,7 @@ public class JLayeredPane extends JComponent implements Accessible { /** Convenience object defining the Drag layer. Equivalent to new Integer(400).*/ public final static Integer DRAG_LAYER = new Integer(400); /** Convenience object defining the Frame Content layer. - * This layer is normally only use to positon the contentPane and menuBar + * This layer is normally only use to position the contentPane and menuBar * components of JFrame. * Equivalent to new Integer(-30000). * @see JFrame @@ -648,7 +648,7 @@ public class JLayeredPane extends JComponent implements Accessible { /** * This method is an extended version of insertIndexForLayer() * to support setLayer which uses Container.setZOrder which does - * not remove the component from the containment heirarchy though + * not remove the component from the containment hierarchy though * we need to ignore it when calculating the insertion index. * * @param comp component to ignore when determining index diff --git a/jdk/src/share/classes/javax/swing/JMenu.java b/jdk/src/share/classes/javax/swing/JMenu.java index ad5f6fef68e..60aa661ff70 100644 --- a/jdk/src/share/classes/javax/swing/JMenu.java +++ b/jdk/src/share/classes/javax/swing/JMenu.java @@ -495,7 +495,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement * In most cases, the delay is not observed for top level menus * or while dragging. The default for delay is 0. * This method is a property of the look and feel code and is used - * to manage the idiosyncracies of the various UI implementations. + * to manage the idiosyncrasies of the various UI implementations. * * * @return the delay property @@ -510,7 +510,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement * it's own policy for observing the delay property. In most cases, * the delay is not observed for top level menus or while dragging. * This method is a property of the look and feel code and is used - * to manage the idiosyncracies of the various UI implementations. + * to manage the idiosyncrasies of the various UI implementations. * * @param d the number of milliseconds to delay * @exception IllegalArgumentException if d diff --git a/jdk/src/share/classes/javax/swing/JPasswordField.java b/jdk/src/share/classes/javax/swing/JPasswordField.java index 8a646944ada..05a113b2ca4 100644 --- a/jdk/src/share/classes/javax/swing/JPasswordField.java +++ b/jdk/src/share/classes/javax/swing/JPasswordField.java @@ -348,7 +348,7 @@ public class JPasswordField extends JTextField { /** * This method is a hack to get around the fact that we cannot - * directly override setUIProperty because part of the inheritance heirarchy + * directly override setUIProperty because part of the inheritance hierarchy * goes outside of the javax.swing package, and therefore calling a package * private method isn't allowed. This method should return true if the property * was handled, and false otherwise. diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java index 3b9bbfc7237..0967ebaf5db 100644 --- a/jdk/src/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java @@ -1104,7 +1104,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { /** * Returns the margin, in pixels, between the popup menu's border and - * its containees. + * its containers. * * @return an Insets object containing the margin values. */ diff --git a/jdk/src/share/classes/javax/swing/JRootPane.java b/jdk/src/share/classes/javax/swing/JRootPane.java index 480af1b5ca3..b1eaf52f4e1 100644 --- a/jdk/src/share/classes/javax/swing/JRootPane.java +++ b/jdk/src/share/classes/javax/swing/JRootPane.java @@ -161,7 +161,7 @@ import sun.security.action.GetBooleanAction; *

      * The painting architecture of Swing requires an opaque * JComponent - * to exist in the containment hieararchy above all other components. This is + * to exist in the containment hierarchy above all other components. This is * typically provided by way of the content pane. If you replace the content * pane, it is recommended that you make the content pane opaque * by way of setOpaque(true). Additionally, if the content pane @@ -608,7 +608,7 @@ public class JRootPane extends JComponent implements Accessible { * parented by the root pane. *

      * Swing's painting architecture requires an opaque JComponent - * in the containment hiearchy. This is typically provided by the + * in the containment hierarchy. This is typically provided by the * content pane. If you replace the content pane it is recommended you * replace it with an opaque JComponent. * @@ -741,7 +741,7 @@ public class JRootPane extends JComponent implements Accessible { * On the other hand, the glassPane * is normally not visible, and so this can return true if the * glassPane isn't visible. Therefore, the - * return value here depends upon the visiblity of the + * return value here depends upon the visibility of the * glassPane. * * @return true if this component's children don't overlap diff --git a/jdk/src/share/classes/javax/swing/JSlider.java b/jdk/src/share/classes/javax/swing/JSlider.java index 207ce7d0535..88fe7129b2b 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -662,7 +662,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { /** * Returns the "extent" from the BoundedRangeModel. - * This respresents the range of values "covered" by the knob. + * This represents the range of values "covered" by the knob. * * @return an int representing the extent * @see #setExtent diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java index d15bde3ad6e..d2dac526518 100644 --- a/jdk/src/share/classes/javax/swing/JSpinner.java +++ b/jdk/src/share/classes/javax/swing/JSpinner.java @@ -545,7 +545,7 @@ public class JSpinner extends JComponent implements Accessible * call if forwarded to the editor, otherwise this does nothing. * * @throws ParseException if the currently edited value couldn't - * be commited. + * be committed. */ public void commitEdit() throws ParseException { JComponent editor = getEditor(); @@ -1462,7 +1462,7 @@ public class JSpinner extends JComponent implements Accessible * a set of predefined roles. This enables assistive technologies to * provide a consistent interface to various tweaked subclasses of * components (e.g., use AccessibleRole.PUSH_BUTTON for all components - * that act like a push button) as well as distinguish between sublasses + * that act like a push button) as well as distinguish between subclasses * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes * and AccessibleRole.RADIO_BUTTON for radio buttons). *

      Note that the AccessibleRole class is also extensible, so @@ -1889,7 +1889,7 @@ public class JSpinner extends JComponent implements Accessible * If there is no selection, but there is * a caret, the start and end offsets will be the same. * - * @return the index into teh text of the end of the selection + * @return the index into the text of the end of the selection */ public int getSelectionEnd() { AccessibleText at = getEditorAccessibleText(); diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index 111a3e0285a..d403dde928c 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -828,7 +828,7 @@ public class JSplitPane extends JComponent implements Accessible * Returns the last value passed to setDividerLocation. * The value returned from this method may differ from the actual * divider location (if setDividerLocation was passed a - * value bigger than the curent size). + * value bigger than the current size). * * @return an integer specifying the location of the divider */ diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index 81b4e6bbd52..bdcb27b1b17 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -2991,7 +2991,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable /** * Causes this table to lay out its rows and columns. Overridden so - * that columns can be resized to accomodate a change in the size of + * that columns can be resized to accommodate a change in the size of * a containing parent. * Resizes one or more of the columns in the table * so that the total width of all of this JTable's @@ -3014,7 +3014,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * The modes are: *

        *
      • AUTO_RESIZE_OFF: Don't automatically adjust the column's - * widths at all. Use a horizontal scrollbar to accomodate the + * widths at all. Use a horizontal scrollbar to accommodate the * columns when their sum exceeds the width of the * Viewport. If the JTable is not * enclosed in a JScrollPane this may @@ -3104,7 +3104,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable *

        * The overall effect is that the total size moves that same percentage, * k, towards the total minimum or maximum and that percentage guarantees - * accomodation of the required space, DELTA. + * accommodation of the required space, DELTA. * *

        Details

        *

        diff --git a/jdk/src/share/classes/javax/swing/JViewport.java b/jdk/src/share/classes/javax/swing/JViewport.java index 7f3346de550..5df23b9b0ab 100644 --- a/jdk/src/share/classes/javax/swing/JViewport.java +++ b/jdk/src/share/classes/javax/swing/JViewport.java @@ -463,7 +463,7 @@ public class JViewport extends JComponent implements Accessible // and paint is received another repaint is queued // indicating part of the view is invalid. There // is no way for JViewport to notice another - // repaint has occured and it ends up blitting + // repaint has occurred and it ends up blitting // what is now a dirty region and the repaint is // never delivered. // It just so happens JTable encounters this @@ -585,7 +585,7 @@ public class JViewport extends JComponent implements Accessible * Returns the insets (border) dimensions as (0,0,0,0), since borders * are not supported on a JViewport. * - * @return a Rectange of zero dimension and zero origin + * @return a Rectangle of zero dimension and zero origin * @see #setBorder */ public final Insets getInsets() { diff --git a/jdk/src/share/classes/javax/swing/JWindow.java b/jdk/src/share/classes/javax/swing/JWindow.java index c49e942b9aa..2cfdef4a7b0 100644 --- a/jdk/src/share/classes/javax/swing/JWindow.java +++ b/jdk/src/share/classes/javax/swing/JWindow.java @@ -43,9 +43,10 @@ import javax.accessibility.*; * The JWindow component contains a JRootPane * as its only child. The contentPane should be the parent * of any children of the JWindow. - * As a conveniance add and its variants, remove and - * setLayout have been overridden to forward to the - * contentPane as necessary. This means you can write: + * As a convenience, the {@code add}, {@code remove}, and {@code setLayout} + * methods of this class are overridden, so that they delegate calls + * to the corresponding methods of the {@code ContentPane}. + * For example, you can add a child component to a window as follows: *

          *       window.add(child);
          * 
        @@ -286,7 +287,7 @@ public class JWindow extends Window implements Accessible, * setLayout are forwarded to the contentPane. * * @return true if add and setLayout - * are fowarded; false otherwise + * are forwarded; false otherwise * * @see #addImpl * @see #setLayout diff --git a/jdk/src/share/classes/javax/swing/LookAndFeel.java b/jdk/src/share/classes/javax/swing/LookAndFeel.java index 785512dd52d..024162cfa50 100644 --- a/jdk/src/share/classes/javax/swing/LookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java @@ -74,7 +74,7 @@ import java.util.StringTokenizer; * BasicLookAndFeel} providing the key-value pair {@code * "TreeUI"-"javax.swing.plaf.basic.BasicTreeUI"}, in the * {@code UIDefaults} returned from {@code getDefaults}. Refer to - * {@link UIDefaults#getUI(JComponent)} for defails on how the implementation + * {@link UIDefaults#getUI(JComponent)} for details on how the implementation * of the {@code ComponentUI} subclass is obtained. *

        * When a {@code LookAndFeel} is installed the {@code UIManager} does @@ -114,7 +114,7 @@ import java.util.StringTokenizer; *

        * For primitive values, such as {@code opaque}, the method {@code * installProperty} should be invoked. {@code installProperty} only changes - * the correspoding property if the value has not been changed by the + * the corresponding property if the value has not been changed by the * developer. *

        * {@code ComponentUI} implementations should use the various install methods @@ -269,7 +269,7 @@ public abstract class LookAndFeel */ public static void installProperty(JComponent c, String propertyName, Object propertyValue) { - // this is a special case because the JPasswordField's ancestor heirarchy + // this is a special case because the JPasswordField's ancestor hierarchy // includes a class outside of javax.swing, thus we cannot call setUIProperty // directly. if (SunToolkit.isInstanceOf(c, "javax.swing.JPasswordField")) { diff --git a/jdk/src/share/classes/javax/swing/ProgressMonitor.java b/jdk/src/share/classes/javax/swing/ProgressMonitor.java index 72f5f57cbbd..c7637657333 100644 --- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java +++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java @@ -650,7 +650,7 @@ public class ProgressMonitor implements Accessible * a set of predefined roles. This enables assistive technologies to * provide a consistent interface to various tweaked subclasses of * components (e.g., use AccessibleRole.PUSH_BUTTON for all components - * that act like a push button) as well as distinguish between sublasses + * that act like a push button) as well as distinguish between subclasses * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes * and AccessibleRole.RADIO_BUTTON for radio buttons). *

        Note that the AccessibleRole class is also extensible, so @@ -1017,7 +1017,7 @@ public class ProgressMonitor implements Accessible * If there is no selection, but there is * a caret, the start and end offsets will be the same. * - * @return the index into teh text of the end of the selection + * @return the index into the text of the end of the selection */ public int getSelectionEnd() { AccessibleText at = getNoteLabelAccessibleText(); diff --git a/jdk/src/share/classes/javax/swing/RepaintManager.java b/jdk/src/share/classes/javax/swing/RepaintManager.java index 461f93d5fc4..ce0467a517f 100644 --- a/jdk/src/share/classes/javax/swing/RepaintManager.java +++ b/jdk/src/share/classes/javax/swing/RepaintManager.java @@ -698,7 +698,7 @@ public class RepaintManager /** * This is invoked to process paint requests. It's needed - * for backward compatability in so far as RepaintManager would previously + * for backward compatibility in so far as RepaintManager would previously * not see paint requests for top levels, so, we have to make sure * a subclass correctly paints any dirty top levels. */ diff --git a/jdk/src/share/classes/javax/swing/RootPaneContainer.java b/jdk/src/share/classes/javax/swing/RootPaneContainer.java index 8405015a989..8f4405faf33 100644 --- a/jdk/src/share/classes/javax/swing/RootPaneContainer.java +++ b/jdk/src/share/classes/javax/swing/RootPaneContainer.java @@ -45,18 +45,18 @@ import java.awt.Container; * dropping a component on a RootPaneContainer would be interpreted * as frame.getContentPane().add(child). *

        - * For conveniance - * JFrame, JDialog, JWindow, - * JApplet and JInternalFrame, by default, - * forward, by default, all calls to the add, - * remove and setLayout methods, to the - * contentPane. This means you can call: + * As a convenience, the standard classes that implement this interface + * (such as {@code JFrame}, {@code JDialog}, {@code JWindow}, {@code JApplet}, + * and {@code JInternalFrame}) have their {@code add}, {@code remove}, + * and {@code setLayout} methods overridden, so that they delegate calls + * to the corresponding methods of the {@code ContentPane}. + * For example, you can add a child component to a frame as follows: *

        - * rootPaneContainer.add(component);
        + *       frame.add(child);
          * 
        * instead of: *
        - * rootPaneContainer.getContentPane().add(component);
        + *       frame.getContentPane().add(child);
          * 
        *

        * The behavior of the add and diff --git a/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java b/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java index c23496bcb67..ff9284aa99a 100644 --- a/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java +++ b/jdk/src/share/classes/javax/swing/ScrollPaneConstants.java @@ -40,7 +40,7 @@ public interface ScrollPaneConstants String VIEWPORT = "VIEWPORT"; /** Identifies a vertical scrollbar. */ String VERTICAL_SCROLLBAR = "VERTICAL_SCROLLBAR"; - /** Identifies a horizonal scrollbar. */ + /** Identifies a horizontal scrollbar. */ String HORIZONTAL_SCROLLBAR = "HORIZONTAL_SCROLLBAR"; /** * Identifies the area along the left side of the viewport between the diff --git a/jdk/src/share/classes/javax/swing/SpinnerDateModel.java b/jdk/src/share/classes/javax/swing/SpinnerDateModel.java index 3eec041ca77..ee72e062956 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerDateModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerDateModel.java @@ -67,7 +67,7 @@ import java.io.Serializable; *

      • Calendar.SECOND *
      • Calendar.MILLISECOND *
      - * However some UIs may set the calendarField before commiting the edit + * However some UIs may set the calendarField before committing the edit * to spin the field under the cursor. If you only want one field to * spin you can subclass and ignore the setCalendarField calls. *

      @@ -133,7 +133,7 @@ public class SpinnerDateModel extends AbstractSpinnerModel implements Serializab * upper or lower bound. If value or * calendarField is null, or if both * start and end are specified and - * mininum > maximum then an + * minimum > maximum then an * IllegalArgumentException is thrown. * Similarly if (minimum <= value <= maximum) is false, * an IllegalArgumentException is thrown. @@ -310,7 +310,7 @@ public class SpinnerDateModel extends AbstractSpinnerModel implements Serializab * simply move the specified Calendar field forward or backward * by one unit with the Calendar.add method. * You should use this method with care as some UIs may set the - * calendarField before commiting the edit to spin the field under + * calendarField before committing the edit to spin the field under * the cursor. If you only want one field to spin you can subclass * and ignore the setCalendarField calls. * diff --git a/jdk/src/share/classes/javax/swing/SpinnerModel.java b/jdk/src/share/classes/javax/swing/SpinnerModel.java index bfee59203d7..029f7041db2 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerModel.java @@ -33,7 +33,7 @@ import javax.swing.event.*; * A model for a potentially unbounded sequence of object values. This model * is similar to ListModel however there are some important differences: *

        - *
      • The number of sequence elements isn't neccessarily bounded. + *
      • The number of sequence elements isn't necessarily bounded. *
      • The model doesn't support indexed random access to sequence elements. * Only three sequence values are accessible at a time: current, next and * previous. @@ -50,7 +50,7 @@ import javax.swing.event.*; * last element of the sequence. * *
        previousValue - *
        The preceeding element or null if value is the + *
        The preceding element or null if value is the * first element of the sequence. * * When the the value property changes, diff --git a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java index 22016125785..cc12cb775fa 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java @@ -102,7 +102,7 @@ public class SpinnerNumberModel extends AbstractSpinnerModel implements Serializ * have an upper or lower bound. * If value or stepSize is null, * or if both minimum and maximum - * are specified and mininum > maximum then an + * are specified and minimum > maximum then an * IllegalArgumentException is thrown. * Similarly if (minimum <= value <= maximum) is false, * an IllegalArgumentException is thrown. diff --git a/jdk/src/share/classes/javax/swing/SpringLayout.java b/jdk/src/share/classes/javax/swing/SpringLayout.java index 699a9ce5a5d..dc85b2c1dcd 100644 --- a/jdk/src/share/classes/javax/swing/SpringLayout.java +++ b/jdk/src/share/classes/javax/swing/SpringLayout.java @@ -286,7 +286,7 @@ public class SpringLayout implements LayoutManager2 { * as EAST - WIDTH. *

        * [RELATIVE_BASELINE is a private constraint that is set automatically when - * the SpringLayout.Constraints(Component) constuctor is called or when + * the SpringLayout.Constraints(Component) constructor is called or when * a constraints object is registered with a SpringLayout object.] *

        * Note: In this document, @@ -1167,7 +1167,7 @@ public class SpringLayout implements LayoutManager2 { * method, instead of returning the current binding for the * edge, returns a proxy that tracks the characteristics * of the edge even if the edge is subsequently rebound. - * Proxies are intended to be used in builder envonments + * Proxies are intended to be used in builder environments * where it is useful to allow the user to define the * constraints for a layout in any order. Proxies do, however, * provide the means to create cyclic dependencies amongst diff --git a/jdk/src/share/classes/javax/swing/SwingUtilities.java b/jdk/src/share/classes/javax/swing/SwingUtilities.java index 28d1f198cd9..5dfbb08695c 100644 --- a/jdk/src/share/classes/javax/swing/SwingUtilities.java +++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java @@ -1337,7 +1337,7 @@ public class SwingUtilities implements SwingConstants * java.awt.EventQueue.invokeAndWait(). * * @exception InterruptedException if we're interrupted while waiting for - * the event dispatching thread to finish excecuting + * the event dispatching thread to finish executing * doRun.run() * @exception InvocationTargetException if an exception is thrown * while running doRun diff --git a/jdk/src/share/classes/javax/swing/ToolTipManager.java b/jdk/src/share/classes/javax/swing/ToolTipManager.java index 1bb26e29cce..f180a9a3301 100644 --- a/jdk/src/share/classes/javax/swing/ToolTipManager.java +++ b/jdk/src/share/classes/javax/swing/ToolTipManager.java @@ -37,7 +37,7 @@ import java.awt.*; * hide. Consider a component that has a different tooltip based on where * the mouse is, such as JTree. When the mouse moves into the JTree and * over a region that has a valid tooltip, the tooltip will become - * visibile after initialDelay milliseconds. After + * visible after initialDelay milliseconds. After * dismissDelay milliseconds the tooltip will be hidden. If * the mouse is over a region that has a valid tooltip, and the tooltip * is currently visible, when the mouse moves to a region that doesn't have diff --git a/jdk/src/share/classes/javax/swing/TransferHandler.java b/jdk/src/share/classes/javax/swing/TransferHandler.java index 016dd987bee..8b767707566 100644 --- a/jdk/src/share/classes/javax/swing/TransferHandler.java +++ b/jdk/src/share/classes/javax/swing/TransferHandler.java @@ -759,7 +759,7 @@ public class TransferHandler implements Serializable { * returns. Should the clipboard be unavailable when attempting to place * data on it, the IllegalStateException thrown by * {@link Clipboard#setContents(Transferable, ClipboardOwner)} will - * be propogated through this method. However, + * be propagated through this method. However, * exportDone will first be called with an action * of NONE for consistency. * diff --git a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java index 2ea4bdce8f8..c7a3c8291bf 100644 --- a/jdk/src/share/classes/javax/swing/UIManager.java +++ b/jdk/src/share/classes/javax/swing/UIManager.java @@ -126,7 +126,7 @@ import sun.awt.AWTAccessor; * current look and feel ({@code setLookAndFeel()} is invoked). The * look and feel defaults can be obtained using the {@code * getLookAndFeelDefaults()} method. - *

      • Sytem defaults. The system defaults are provided by Swing. + *
      • System defaults. The system defaults are provided by Swing. * * Invoking any of the various {@code get} methods * results in checking each of the defaults, in order, returning @@ -152,7 +152,7 @@ import sun.awt.AWTAccessor; * and documented by that look and feel. In addition, each look and * feel, or {@code ComponentUI} provided by a look and feel, may * access the defaults at different times in their life cycle. Some - * look and feels may agressively look up defaults, so that changing a + * look and feels may aggressively look up defaults, so that changing a * default may not have an effect after installing the look and feel. * Other look and feels may lazily access defaults so that a change to * the defaults may effect an existing look and feel. Finally, other look @@ -313,7 +313,7 @@ public class UIManager implements Serializable * * @param name a String specifying the name of * the look and feel - * @param className a String specifiying the name of + * @param className a String specifying the name of * the class that implements the look and feel */ public LookAndFeelInfo(String name, String className) { diff --git a/jdk/src/share/classes/javax/swing/border/TitledBorder.java b/jdk/src/share/classes/javax/swing/border/TitledBorder.java index 0eec042c7ec..250f0b764bf 100644 --- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java +++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java @@ -45,7 +45,7 @@ import javax.swing.plaf.basic.BasicHTML; * specified position and justification. *

        * If the border, font, or color property values are not - * specified in the constuctor or by invoking the appropriate + * specified in the constructor or by invoking the appropriate * set methods, the property values will be defined by the current * look and feel, using the following property names in the * Defaults Table: diff --git a/jdk/src/share/classes/javax/swing/border/package.html b/jdk/src/share/classes/javax/swing/border/package.html index 9bd379bd992..c11b6747eab 100644 --- a/jdk/src/share/classes/javax/swing/border/package.html +++ b/jdk/src/share/classes/javax/swing/border/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/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.*; *
      * *

      - * 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. -

      + property.

      +

    • 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. -
    • -

      +

      +

    • 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.